From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:16:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:16:29 +0000 Subject: osmo-bts[master]: sysmo, litecell15: Make sure all TCH events are triggered In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie674c7ec40838af36308c6998f227fa452ace4b4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:18:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:18:26 +0000 Subject: osmo-bts[master]: Allow passing low link quality buffers to upper layers In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:23:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:23:13 +0000 Subject: osmo-bts[master]: Log fn across different layers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3098/1/src/common/l1sap.c File src/common/l1sap.c: PS1, Line 966: % I think we should introduce a generic fn-print-helper like I introduced in Change-Id Idd07a3f4a88c38398d3e844333c0104e2de23864 (dump_gsmtims). Actually, that function should move to libosmocore (and get an osmo_ prefix) and then all code should use that function. -- To view, visit https://gerrit.osmocom.org/3098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:23:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:23:52 +0000 Subject: osmo-bts[master]: Fix annoying trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0ba1321ed326c1498e3f60b611bd962f2a9484a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:24:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:24:33 +0000 Subject: osmo-bts[master]: sysmo/tch.c: Use L1P instead of L1C for logging and allocation In-Reply-To: References: Message-ID: Patch Set 1: the commit log should explain why. (i.e. L1C is l1-control, i.e. the MPH primitives only.) -- To view, visit https://gerrit.osmocom.org/3093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:25:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:25:19 +0000 Subject: osmo-bts[master]: octphy/tch.c: Use L1P instead of L1C for logging and allocation In-Reply-To: References: Message-ID: Patch Set 1: can merge in one patch for all bts models, and that patch should state reasons in commitlog -- To view, visit https://gerrit.osmocom.org/3095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8593e9fcd94f1a42f1e09f079d3d40f07bd56307 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:26:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:26:14 +0000 Subject: osmo-bts[master]: l1sap.c: fn_ms_adj: Add err logging and always return GSM_RT... In-Reply-To: References: Message-ID: Patch Set 2: please clarify with Max rgarding DTX and also ask is help to verify DTX still works after all related changes. -- To view, visit https://gerrit.osmocom.org/3084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:27:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:27:02 +0000 Subject: osmo-bts[master]: l1sap.c: Avoid sending RTP frame with empty payload In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc Gerrit-PatchSet: 5 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 Sat Jul 1 07:27:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:27:18 +0000 Subject: libosmocore[master]: l1sap.h: Add ber10k and lqual_cb to ph_tch_param In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If4ae20c22b881e94585dad710f17b9e37f77bf82 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:28:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:28:21 +0000 Subject: openbsc[master]: bsc_init: add logging for unhandled signals In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 so we add a new signal in libosmo-abis and all existing applications will print erros? What's the rationale here? -- To view, visit https://gerrit.osmocom.org/3091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ddaec3b017d637027b0478ce3e137becbf25ea7 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:28:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:28:41 +0000 Subject: [MERGED] libosmocore[master]: l1sap.h: Add ber10k and lqual_cb to ph_tch_param In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: l1sap.h: Add ber10k and lqual_cb to ph_tch_param ...................................................................... l1sap.h: Add ber10k and lqual_cb to ph_tch_param These fields are required in osmo-bts to do low link quality checks in a generic way. Change-Id: If4ae20c22b881e94585dad710f17b9e37f77bf82 --- M include/osmocom/gsm/l1sap.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h index 01f61ce..1bc1818 100644 --- a/include/osmocom/gsm/l1sap.h +++ b/include/osmocom/gsm/l1sap.h @@ -84,6 +84,8 @@ uint32_t fn; /*!< GSM Frame Number */ int8_t rssi; /*!< RSSI of received indication */ uint8_t marker; /*!< RTP Marker bit (speech onset indicator) */ + uint16_t ber10k; /*!< BER in units of 0.01% */ + int16_t lqual_cb; /* !< Link quality in centiBel */ }; /*! for PH-CONN.ind */ -- To view, visit https://gerrit.osmocom.org/3092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If4ae20c22b881e94585dad710f17b9e37f77bf82 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:35:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:35:26 +0000 Subject: osmo-bts[master]: OML: fill MO while handling attr. request In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 (1 comment) https://gerrit.osmocom.org/#/c/3090/1/src/common/oml.c File src/common/oml.c: Line 1126: bts->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; this most certainly is completely wrong. The bts->mo is the instance of the managed object for the BTS. It's "MO Address" is configured once statically at BTS startup and never modified - *particularly* not by a get/read request. -- To view, visit https://gerrit.osmocom.org/3090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:37:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:37:58 +0000 Subject: osmo-bts[master]: TRX: don't free l1h in trx_phy_inst_close() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:38:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:38:04 +0000 Subject: [MERGED] osmo-bts[master]: TRX: don't free l1h in trx_phy_inst_close() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: don't free l1h in trx_phy_inst_close() ...................................................................... TRX: don't free l1h in trx_phy_inst_close() l1h is allocated in bts_model_phy_instance_set_defaults() and not in trx_phy_inst_open(). Hence, trx_phy_inst_close() should not free() it! Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938 --- M src/osmo-bts-trx/trx_if.c 1 file changed, 0 insertions(+), 1 deletion(-) 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 c56efbf..8ce2893 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -629,7 +629,6 @@ trx_if_close(l1h); trx_sched_exit(&l1h->l1s); - talloc_free(l1h); } /*! open the control + burst data sockets for one phy_instance */ -- To view, visit https://gerrit.osmocom.org/3043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts 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 Sat Jul 1 07:38:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:38:04 +0000 Subject: [MERGED] osmo-bts[master]: TRX: trx_if: Improve code description / comments In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: trx_if: Improve code description / comments ...................................................................... TRX: trx_if: Improve code description / comments Change-Id: I4e19d68782a12e52ba1d3ba2665060275d04866c --- M src/osmo-bts-trx/trx_if.c 1 file changed, 54 insertions(+), 13 deletions(-) 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 c676d11..b15d24d 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -1,5 +1,9 @@ /* - * OpenBTS TRX interface handling + * OpenBTS-style TRX interface/protocol handling + * + * This file contains the BTS-side implementation of the OpenBTS-style + * UDP TRX protocol. It manages the clock, control + burst-data UDP + * sockets and their respective protocol encoding/parsing. * * Copyright (C) 2013 Andreas Eversberg * Copyright (C) 2016 Harald Welte @@ -53,10 +57,10 @@ #define TRX_MAX_BURST_LEN 512 /* - * socket + * socket helper functions */ -/* open socket */ +/*! convenience wrapper to open socket + fill in osmo_fd */ static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host_local, uint16_t port_local, const char *host_remote, uint16_t port_remote, int (*cb)(struct osmo_fd *fd, unsigned int what)) @@ -77,7 +81,7 @@ return 0; } -/* close socket */ +/* close socket + unregister osmo_fd */ static void trx_udp_close(struct osmo_fd *ofd) { if (ofd->fd > 0) { @@ -89,7 +93,7 @@ /* - * clock + * TRX clock socket */ /* get clock from clock socket */ @@ -121,6 +125,7 @@ "correctly, correcting to fn=%u\n", fn); } + /* inform core TRX clock handling code that a FN has been received */ trx_sched_clock(pinst->trx->bts, fn); return 0; @@ -128,7 +133,7 @@ /* - * ctrl + * TRX ctrl socket */ static void trx_ctrl_timer_cb(void *data); @@ -165,7 +170,16 @@ trx_ctrl_send(l1h); } -/* add a new ctrl command */ +/*! Send a new TRX control command. + * \param[inout] l1h TRX Layer1 handle to which to send command + * \param[in] criticial + * \param[in] cmd zero-terminated string containing command + * \param[in] fmt Format string (+ variable list of arguments) + * \returns 0 on success; negative on error + * + * The new ocommand will be added to the end of the control command + * queue. + */ static int trx_ctrl_cmd(struct trx_l1h *l1h, int critical, const char *cmd, const char *fmt, ...) { @@ -197,15 +211,16 @@ tcm->cmd_len = strlen(cmd); tcm->critical = critical; llist_add_tail(&tcm->list, &l1h->trx_ctrl_list); - LOGP(DTRX, LOGL_INFO, "Adding new control '%s'\n", tcm->cmd); + LOGP(DTRX, LOGL_INFO, "Enqueuing TRX control command '%s'\n", tcm->cmd); - /* send message, if no pending message */ + /* send message, if we didn't already have pending messages */ if (!pending) trx_ctrl_send(l1h); return 0; } +/*! Send "POWEROFF" command to TRX */ int trx_if_cmd_poweroff(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; @@ -215,6 +230,7 @@ return 0; } +/*! Send "POWERON" command to TRX */ int trx_if_cmd_poweron(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; @@ -224,6 +240,7 @@ return 0; } +/*! Send "SETTSC" command to TRX */ int trx_if_cmd_settsc(struct trx_l1h *l1h, uint8_t tsc) { if (!settsc_enabled) @@ -233,6 +250,7 @@ tsc); } +/*! Send "SETBSIC" command to TRX */ int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic) { if (!setbsic_enabled) @@ -242,31 +260,37 @@ bsic); } +/*! Send "SETRXGAIN" command to TRX */ int trx_if_cmd_setrxgain(struct trx_l1h *l1h, int db) { return trx_ctrl_cmd(l1h, 0, "SETRXGAIN", "%d", db); } +/*! Send "SETPOWER" command to TRX */ int trx_if_cmd_setpower(struct trx_l1h *l1h, int db) { return trx_ctrl_cmd(l1h, 0, "SETPOWER", "%d", db); } +/*! Send "SETMAXDLY" command to TRX, i.e. maximum delay for RACH bursts */ int trx_if_cmd_setmaxdly(struct trx_l1h *l1h, int dly) { return trx_ctrl_cmd(l1h, 0, "SETMAXDLY", "%d", dly); } +/*! Send "SETMAXDLYNB" command to TRX, i.e. maximum delay for normal bursts */ int trx_if_cmd_setmaxdlynb(struct trx_l1h *l1h, int dly) { return trx_ctrl_cmd(l1h, 0, "SETMAXDLYNB", "%d", dly); } +/*! Send "SETSLOT" command to TRX: Configure Channel Combination for TS */ int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, uint8_t type) { return trx_ctrl_cmd(l1h, 1, "SETSLOT", "%d %d", tn, type); } +/*! Send "RXTUNE" command to TRX: Tune Receiver to given ARFCN */ int trx_if_cmd_rxtune(struct trx_l1h *l1h, uint16_t arfcn) { struct phy_instance *pinst = l1h->phy_inst; @@ -285,6 +309,7 @@ return trx_ctrl_cmd(l1h, 1, "RXTUNE", "%d", freq10 * 100); } +/*! Send "TXTUNE" command to TRX: Tune Transmitter to given ARFCN */ int trx_if_cmd_txtune(struct trx_l1h *l1h, uint16_t arfcn) { struct phy_instance *pinst = l1h->phy_inst; @@ -303,17 +328,19 @@ return trx_ctrl_cmd(l1h, 1, "TXTUNE", "%d", freq10 * 100); } +/*! Send "HANDOVER" command to TRX: Enable handover RACH Detection on timeslot/sub-slot */ int trx_if_cmd_handover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss) { return trx_ctrl_cmd(l1h, 1, "HANDOVER", "%d %d", tn, ss); } +/*! Send "NOHANDOVER" command to TRX: Disable handover RACH Detection on timeslot/sub-slot */ int trx_if_cmd_nohandover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss) { return trx_ctrl_cmd(l1h, 1, "NOHANDOVER", "%d %d", tn, ss); } -/* get response from ctrl socket */ +/*! Get + parse response from TRX ctrl socket */ static int trx_ctrl_read_cb(struct osmo_fd *ofd, unsigned int what) { struct trx_l1h *l1h = ofd->data; @@ -353,7 +380,7 @@ tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); - /* check if respose matches command */ + /* check if response matches command */ if (rsp_len != tcm->cmd_len) { notmatch: LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, @@ -393,7 +420,7 @@ /* - * data + * TRX burst data socket */ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what) @@ -452,11 +479,20 @@ fprintf(stderr, "%s\n", deb); #endif + /* feed received burst into scheduler code */ trx_sched_ul_burst(&l1h->l1s, tn, fn, bits, burst_len, rssi, toa); return 0; } +/*! Send burst data for given FN/timeslot to TRX + * \param[inout] l1h TRX Layer1 handle referring to TX + * \param[in] tn Timeslot Number (0..7) + * \param[in] fn GSM Frame Number + * \param[in] pwr Transmit Power to use + * \param[in] bits Unpacked bits to be transmitted + * \param[in] nbits Number of \a bits + * \returns 0 on success; negative on error */ int trx_if_data(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, const ubit_t *bits, uint16_t nbits) { @@ -495,6 +531,7 @@ * open/close */ +/*! open the PHY link using TRX protocol */ int bts_model_phy_link_open(struct phy_link *plink) { struct phy_instance *pinst; @@ -537,6 +574,7 @@ return -1; } +/*! compute UDP port number used for TRX protocol */ static uint16_t compute_port(struct phy_instance *pinst, int remote, int is_data) { struct phy_link *plink = pinst->phy_link; @@ -551,6 +589,7 @@ return plink->u.osmotrx.base_port_local + (pinst->num << 1) + inc; } +/*! open a TRX interface. creates contro + data sockets */ int trx_if_open(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; @@ -593,7 +632,7 @@ return rc; } -/* flush pending control messages */ +/*! flush (delete) all pending control messages */ void trx_if_flush(struct trx_l1h *l1h) { struct trx_ctrl_msg *tcm; @@ -607,6 +646,7 @@ } } +/*! close the TRX for given handle (data + control socket) */ void trx_if_close(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; @@ -620,6 +660,7 @@ trx_udp_close(&l1h->trx_ofd_data); } +/*! determine if the TRX for given handle is powered up */ int trx_if_powered(struct trx_l1h *l1h) { return l1h->config.poweron; -- To view, visit https://gerrit.osmocom.org/3039 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4e19d68782a12e52ba1d3ba2665060275d04866c Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:38:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:38:05 +0000 Subject: [MERGED] osmo-bts[master]: TRX: merge/simplify l1_if and trx_if code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: merge/simplify l1_if and trx_if code ...................................................................... TRX: merge/simplify l1_if and trx_if code Related code / function structure still dates back to the pre-phy_link days. Let's clean this up to make things less convoluted and reduce the number of non-static symbols needed between code split over two files. Change-Id: I1f30ae1f547a5c01c516d4a05032193294c25f2d --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/l1_if.h M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h 4 files changed, 93 insertions(+), 104 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 3517787..37a399f 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -57,48 +57,6 @@ }; -/* - * create/destroy trx l1 instance - */ - -struct trx_l1h *l1if_open(struct phy_instance *pinst) -{ - struct trx_l1h *l1h; - int rc; - - l1h = pinst->u.osmotrx.hdl; - if (!l1h) - return NULL; - - rc = trx_sched_init(&l1h->l1s, pinst->trx); - if (rc < 0) { - LOGP(DL1C, LOGL_FATAL, "Cannot initialize scheduler for phy " - "instance %d\n", pinst->num); - return NULL; - } - - rc = trx_if_open(l1h); - if (rc < 0) { - LOGP(DL1C, LOGL_FATAL, "Cannot open TRX interface for phy " - "instance %d\n", pinst->num); - l1if_close(l1h); - return NULL; - } - - return l1h; -} - -void l1if_close(struct trx_l1h *l1h) -{ - trx_if_close(l1h); - trx_sched_exit(&l1h->l1s); - talloc_free(l1h); -} - -void l1if_reset(struct trx_l1h *l1h) -{ -} - static void check_transceiver_availability_trx(struct trx_l1h *l1h, int avail) { struct phy_instance *pinst = l1h->phy_inst; diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index fdc40f2..d978c44 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -61,9 +61,6 @@ struct l1sched_trx l1s; }; -struct trx_l1h *l1if_open(struct phy_instance *pinst); -void l1if_close(struct trx_l1h *l1h); -void l1if_reset(struct trx_l1h *l1h); int check_transceiver_availability(struct gsm_bts *bts, int avail); int l1if_provision_transceiver_trx(struct trx_l1h *l1h); int l1if_provision_transceiver(struct gsm_bts *bts); diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index ba2908a..c56efbf 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -536,47 +536,32 @@ * open/close */ -/*! open the PHY link using TRX protocol */ -int bts_model_phy_link_open(struct phy_link *plink) +/*! flush (delete) all pending control messages */ +void trx_if_flush(struct trx_l1h *l1h) { - struct phy_instance *pinst; - int rc; + struct trx_ctrl_msg *tcm; - phy_link_state_set(plink, PHY_LINK_CONNECTING); - - /* open the shared/common clock socket */ - rc = trx_udp_open(plink, &plink->u.osmotrx.trx_ofd_clk, - plink->u.osmotrx.local_ip, - plink->u.osmotrx.base_port_local, - plink->u.osmotrx.remote_ip, - plink->u.osmotrx.base_port_remote, - trx_clk_read_cb); - if (rc < 0) { - phy_link_state_set(plink, PHY_LINK_SHUTDOWN); - return -1; + /* free ctrl message list */ + while (!llist_empty(&l1h->trx_ctrl_list)) { + tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, + list); + llist_del(&tcm->list); + talloc_free(tcm); } +} - /* open the individual instances with their ctrl+data sockets */ - llist_for_each_entry(pinst, &plink->instances, list) { - pinst->u.osmotrx.hdl = l1if_open(pinst); - if (!pinst->u.osmotrx.hdl) - goto cleanup; - } - /* FIXME: is there better way to check/report TRX availability? */ - transceiver_available = 1; - phy_link_state_set(plink, PHY_LINK_CONNECTED); - return 0; +/*! close the TRX for given handle (data + control socket) */ +void trx_if_close(struct trx_l1h *l1h) +{ + struct phy_instance *pinst = l1h->phy_inst; + LOGP(DTRX, LOGL_NOTICE, "Close transceiver for %s\n", + phy_instance_name(pinst)); -cleanup: - phy_link_state_set(plink, PHY_LINK_SHUTDOWN); - llist_for_each_entry(pinst, &plink->instances, list) { - if (pinst->u.osmotrx.hdl) { - trx_if_close(pinst->u.osmotrx.hdl); - pinst->u.osmotrx.hdl = NULL; - } - } - trx_udp_close(&plink->u.osmotrx.trx_ofd_clk); - return -1; + trx_if_flush(l1h); + + /* close sockets */ + trx_udp_close(&l1h->trx_ofd_ctrl); + trx_udp_close(&l1h->trx_ofd_data); } /*! compute UDP port number used for TRX protocol */ @@ -595,7 +580,7 @@ } /*! open a TRX interface. creates contro + data sockets */ -int trx_if_open(struct trx_l1h *l1h) +static int trx_if_open(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; struct phy_link *plink = pinst->phy_link; @@ -637,32 +622,84 @@ return rc; } -/*! flush (delete) all pending control messages */ -void trx_if_flush(struct trx_l1h *l1h) +/*! close the control + burst data sockets for one phy_instance */ +static void trx_phy_inst_close(struct phy_instance *pinst) { - struct trx_ctrl_msg *tcm; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; - /* free ctrl message list */ - while (!llist_empty(&l1h->trx_ctrl_list)) { - tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, - list); - llist_del(&tcm->list); - talloc_free(tcm); - } + trx_if_close(l1h); + trx_sched_exit(&l1h->l1s); + talloc_free(l1h); } -/*! close the TRX for given handle (data + control socket) */ -void trx_if_close(struct trx_l1h *l1h) +/*! open the control + burst data sockets for one phy_instance */ +static int trx_phy_inst_open(struct phy_instance *pinst) { - struct phy_instance *pinst = l1h->phy_inst; - LOGP(DTRX, LOGL_NOTICE, "Close transceiver for %s\n", - phy_instance_name(pinst)); + struct trx_l1h *l1h; + int rc; - trx_if_flush(l1h); + l1h = pinst->u.osmotrx.hdl; + if (!l1h) + return -EINVAL; - /* close sockets */ - trx_udp_close(&l1h->trx_ofd_ctrl); - trx_udp_close(&l1h->trx_ofd_data); + rc = trx_sched_init(&l1h->l1s, pinst->trx); + if (rc < 0) { + LOGP(DL1C, LOGL_FATAL, "Cannot initialize scheduler for phy " + "instance %d\n", pinst->num); + return -EIO; + } + + rc = trx_if_open(l1h); + if (rc < 0) { + LOGP(DL1C, LOGL_FATAL, "Cannot open TRX interface for phy " + "instance %d\n", pinst->num); + trx_phy_inst_close(pinst); + return -EIO; + } + + return 0; +} + +/*! open the PHY link using TRX protocol */ +int bts_model_phy_link_open(struct phy_link *plink) +{ + struct phy_instance *pinst; + int rc; + + phy_link_state_set(plink, PHY_LINK_CONNECTING); + + /* open the shared/common clock socket */ + rc = trx_udp_open(plink, &plink->u.osmotrx.trx_ofd_clk, + plink->u.osmotrx.local_ip, + plink->u.osmotrx.base_port_local, + plink->u.osmotrx.remote_ip, + plink->u.osmotrx.base_port_remote, + trx_clk_read_cb); + if (rc < 0) { + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + return -1; + } + + /* open the individual instances with their ctrl+data sockets */ + llist_for_each_entry(pinst, &plink->instances, list) { + if (trx_phy_inst_open(pinst) < 0) + goto cleanup; + } + /* FIXME: is there better way to check/report TRX availability? */ + transceiver_available = 1; + phy_link_state_set(plink, PHY_LINK_CONNECTED); + return 0; + +cleanup: + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + llist_for_each_entry(pinst, &plink->instances, list) { + if (pinst->u.osmotrx.hdl) { + trx_if_close(pinst->u.osmotrx.hdl); + pinst->u.osmotrx.hdl = NULL; + } + } + trx_udp_close(&plink->u.osmotrx.trx_ofd_clk); + return -1; } /*! determine if the TRX for given handle is powered up */ diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 93ea180..1fc454d 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -31,9 +31,6 @@ int trx_if_cmd_nohandover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss); int trx_if_send_burst(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, const ubit_t *bits, uint16_t nbits); -int trx_if_open(struct trx_l1h *l1h); -void trx_if_flush(struct trx_l1h *l1h); -void trx_if_close(struct trx_l1h *l1h); int trx_if_powered(struct trx_l1h *l1h); #endif /* TRX_IF_H */ -- To view, visit https://gerrit.osmocom.org/3042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f30ae1f547a5c01c516d4a05032193294c25f2d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:38:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:38:05 +0000 Subject: [MERGED] osmo-bts[master]: TRX: Rename trx_if_data() -> trx_if_send_burst() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: Rename trx_if_data() -> trx_if_send_burst() ...................................................................... TRX: Rename trx_if_data() -> trx_if_send_burst() The new name makes it clear what the function actually does: Send burst data via the trx interface. Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa --- M src/osmo-bts-trx/scheduler_trx.c M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h 3 files changed, 3 insertions(+), 3 deletions(-) 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/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 9c87643..a9bcbda 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1398,7 +1398,7 @@ } else gain = 0; if (nbits) - trx_if_data(l1h, tn, fn, gain, bits, nbits); + trx_if_send_burst(l1h, tn, fn, gain, bits, nbits); } } diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 2486894..ba2908a 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -498,7 +498,7 @@ * \param[in] bits Unpacked bits to be transmitted * \param[in] nbits Number of \a bits * \returns 0 on success; negative on error */ -int trx_if_data(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, +int trx_if_send_burst(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, const ubit_t *bits, uint16_t nbits) { uint8_t buf[TRX_MAX_BURST_LEN]; diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 05e8bff..93ea180 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -29,7 +29,7 @@ int trx_if_cmd_txtune(struct trx_l1h *l1h, uint16_t arfcn); int trx_if_cmd_handover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss); int trx_if_cmd_nohandover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss); -int trx_if_data(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, +int trx_if_send_burst(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, const ubit_t *bits, uint16_t nbits); int trx_if_open(struct trx_l1h *l1h); void trx_if_flush(struct trx_l1h *l1h); -- To view, visit https://gerrit.osmocom.org/3041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts 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 Sat Jul 1 07:38:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:38:05 +0000 Subject: [MERGED] osmo-bts[master]: trx_if: Improve error handling In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: trx_if: Improve error handling ...................................................................... trx_if: Improve error handling There ware some error conditions that the previous code didn't catch and/or report, such as unparseable TRX control strings, non-terminated buffers, ... Change-Id: I354d0c121880553ce1bd59b7394d52b104b7d6da --- M src/osmo-bts-trx/trx_if.c 1 file changed, 8 insertions(+), 3 deletions(-) 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 b15d24d..2486894 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -6,7 +6,7 @@ * sockets and their respective protocol encoding/parsing. * * Copyright (C) 2013 Andreas Eversberg - * Copyright (C) 2016 Harald Welte + * Copyright (C) 2016-2017 Harald Welte * * All Rights Reserved * @@ -84,7 +84,7 @@ /* close socket + unregister osmo_fd */ static void trx_udp_close(struct osmo_fd *ofd) { - if (ofd->fd > 0) { + if (ofd->fd >= 0) { osmo_fd_unregister(ofd); close(ofd->fd); ofd->fd = -1; @@ -116,7 +116,11 @@ return 0; } - sscanf(buf, "IND CLOCK %u", &fn); + if (sscanf(buf, "IND CLOCK %u", &fn) != 1) { + LOGP(DTRX, LOGL_ERROR, "Unable to parse '%s'\n", buf); + return 0; + } + LOGP(DTRX, LOGL_INFO, "Clock indication: fn=%u\n", fn); if (fn >= GSM_HYPERFRAME) { @@ -208,6 +212,7 @@ va_end(ap); } else snprintf(tcm->cmd, sizeof(tcm->cmd)-1, "CMD %s", cmd); + tcm->cmd[sizeof(tcm->cmd)-1] = '\0'; tcm->cmd_len = strlen(cmd); tcm->critical = critical; llist_add_tail(&tcm->list, &l1h->trx_ctrl_list); -- To view, visit https://gerrit.osmocom.org/3040 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I354d0c121880553ce1bd59b7394d52b104b7d6da Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:39:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:39:09 +0000 Subject: osmo-gsm-tester[master]: jenkins: build msc using libosmo-sccp master In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I850e0dd2fc61d59d56c0dd69ee00b6e19685fb95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:39:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:39:31 +0000 Subject: libosmo-sccp[master]: sccp_helpers.h: remove duplicate declaration of osmo_sccp_ma... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifbb03de3df3b9bac86fb97dfc8e81e99fc172292 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:39:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:39:35 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_helpers.h: remove duplicate declaration of osmo_sccp_ma... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_helpers.h: remove duplicate declaration of osmo_sccp_make_addr_pc_ssn() ...................................................................... sccp_helpers.h: remove duplicate declaration of osmo_sccp_make_addr_pc_ssn() Change-Id: Ifbb03de3df3b9bac86fb97dfc8e81e99fc172292 --- M include/osmocom/sigtran/sccp_helpers.h 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_helpers.h b/include/osmocom/sigtran/sccp_helpers.h index bbd0364..ecf583e 100644 --- a/include/osmocom/sigtran/sccp_helpers.h +++ b/include/osmocom/sigtran/sccp_helpers.h @@ -4,8 +4,6 @@ #include #include -void osmo_sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr, uint32_t pc, uint32_t ssn); - int osmo_sccp_tx_unitdata(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr, const struct osmo_sccp_addr *called_addr, -- To view, visit https://gerrit.osmocom.org/3086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifbb03de3df3b9bac86fb97dfc8e81e99fc172292 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:40:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:40:08 +0000 Subject: libosmocore[master]: Add missing BSSGP cause values In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie39a6c91a46d179392d861805a106743a07c6fb0 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 Sat Jul 1 07:40:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:40:10 +0000 Subject: [MERGED] libosmocore[master]: Add missing BSSGP cause values In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add missing BSSGP cause values ...................................................................... Add missing BSSGP cause values Add values from 3GPP TS 48.018 Change-Id: Ie39a6c91a46d179392d861805a106743a07c6fb0 --- M include/osmocom/gprs/protocol/gsm_08_18.h M src/gb/gprs_bssgp_util.c 2 files changed, 114 insertions(+), 40 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gprs/protocol/gsm_08_18.h b/include/osmocom/gprs/protocol/gsm_08_18.h index 3179455..af6caf3 100644 --- a/include/osmocom/gprs/protocol/gsm_08_18.h +++ b/include/osmocom/gprs/protocol/gsm_08_18.h @@ -120,24 +120,61 @@ /*! Cause coding (Section 11.3.8 / Table 11.10) */ enum gprs_bssgp_cause { - BSSGP_CAUSE_PROC_OVERLOAD = 0x00, - BSSGP_CAUSE_EQUIP_FAIL = 0x01, - BSSGP_CAUSE_TRASIT_NET_FAIL = 0x02, - BSSGP_CAUSE_CAPA_GREATER_0KPBS = 0x03, - BSSGP_CAUSE_UNKNOWN_MS = 0x04, - BSSGP_CAUSE_UNKNOWN_BVCI = 0x05, - BSSGP_CAUSE_CELL_TRAF_CONG = 0x06, - BSSGP_CAUSE_SGSN_CONG = 0x07, - BSSGP_CAUSE_OML_INTERV = 0x08, - BSSGP_CAUSE_BVCI_BLOCKED = 0x09, - BSSGP_CAUSE_PFC_CREATE_FAIL = 0x0a, - BSSGP_CAUSE_SEM_INCORR_PDU = 0x20, - BSSGP_CAUSE_INV_MAND_INF = 0x21, - BSSGP_CAUSE_MISSING_MAND_IE = 0x22, - BSSGP_CAUSE_MISSING_COND_IE = 0x23, - BSSGP_CAUSE_UNEXP_COND_IE = 0x24, - BSSGP_CAUSE_COND_IE_ERR = 0x25, - BSSGP_CAUSE_PDU_INCOMP_STATE = 0x26, - BSSGP_CAUSE_PROTO_ERR_UNSPEC = 0x27, - BSSGP_CAUSE_PDU_INCOMP_FEAT = 0x28, + BSSGP_CAUSE_PROC_OVERLOAD = 0x00, + BSSGP_CAUSE_EQUIP_FAIL = 0x01, + BSSGP_CAUSE_TRASIT_NET_FAIL = 0x02, + BSSGP_CAUSE_CAPA_GREATER_0KPBS = 0x03, + BSSGP_CAUSE_UNKNOWN_MS = 0x04, + BSSGP_CAUSE_UNKNOWN_BVCI = 0x05, + BSSGP_CAUSE_CELL_TRAF_CONG = 0x06, + BSSGP_CAUSE_SGSN_CONG = 0x07, + BSSGP_CAUSE_OML_INTERV = 0x08, + BSSGP_CAUSE_BVCI_BLOCKED = 0x09, + BSSGP_CAUSE_PFC_CREATE_FAIL = 0x0a, + BSSGP_CAUSE_PFC_PREEMPTED = 0x0b, + BSSGP_CAUSE_ABQP_NOT_SUPP = 0x0c, + BSSGP_CAUSE_SEM_INCORR_PDU = 0x20, + BSSGP_CAUSE_INV_MAND_INF = 0x21, + BSSGP_CAUSE_MISSING_MAND_IE = 0x22, + BSSGP_CAUSE_MISSING_COND_IE = 0x23, + BSSGP_CAUSE_UNEXP_COND_IE = 0x24, + BSSGP_CAUSE_COND_IE_ERR = 0x25, + BSSGP_CAUSE_PDU_INCOMP_STATE = 0x26, + BSSGP_CAUSE_PROTO_ERR_UNSPEC = 0x27, + BSSGP_CAUSE_PDU_INCOMP_FEAT = 0x28, + BSSGP_CAUSE_REQ_INFO_NOT_AVAIL = 0x29, + BSSGP_CAUSE_UNKN_DST = 0x2a, + BSSGP_CAUSE_UNKN_RIM_AI = 0x2b, + BSSGP_CAUSE_INVAL_CONT_UI = 0x2c, + BSSGP_CAUSE_PFC_QUEUE = 0x2d, + BSSGP_CAUSE_PFC_CREATED = 0x2e, + BSSGP_CAUSE_T12_EXPIRY = 0x2f, + BSSGP_CAUSE_MS_UNDER_PS_HO = 0x30, + BSSGP_CAUSE_UL_QUALITY = 0x31, + BSSGP_CAUSE_UL_STRENGTH = 0x32, + BSSGP_CAUSE_DL_QUALITY = 0x33, + BSSGP_CAUSE_DL_STRENGTH = 0x34, + BSSGP_CAUSE_DISTANCE = 0x35, + BSSGP_CAUSE_BETTER_CELL = 0x36, + BSSGP_CAUSE_TRAFFIC = 0x37, + BSSGP_CAUSE_MS_RADIO_LOSS = 0x38, + BSSGP_CAUSE_MS_BACK_OLD_CHAN = 0x39, + BSSGP_CAUSE_T13_EXPIRY = 0x3a, + BSSGP_CAUSE_T14_EXPIRY = 0x3b, + BSSGP_CAUSE_NOT_ALL_PFC = 0x3c, + BSSGP_CAUSE_CS = 0x3d, + BSSGP_CAUSE_REQ_ALG_NOT_SUPP = 0x3e, + BSSGP_CAUSE_RELOC_FAIL = 0x3f, + BSSGP_CAUSE_DIR_RETRY = 0x40, + BSSGP_CAUSE_TIME_CRIT_RELOC = 0x41, + BSSGP_CAUSE_PS_HO_TARG_NA = 0x42, + BSSGP_CAUSE_PS_HO_TARG_NOT_SUPP = 0x43, + BSSGP_CAUSE_PUESBINE = 0x44, + BSSGP_CAUSE_DTM_HO_NO_CS_RES = 0x45, + BSSGP_CAUSE_DTM_HO_PS_ALLOC_FAIL = 0x46, + BSSGP_CAUSE_DTM_HO_T24_EXPIRY = 0x47, + BSSGP_CAUSE_DTM_HO_INVAL_CS_IND = 0x48, + BSSGP_CAUSE_DTM_HO_T23_EXPIRY = 0x49, + BSSGP_CAUSE_DTM_HO_MSC_ERR = 0x4a, + BSSGP_CAUSE_INVAL_CSG_CELL = 0x4b, }; diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c index 78a11a3..4553da8 100644 --- a/src/gb/gprs_bssgp_util.c +++ b/src/gb/gprs_bssgp_util.c @@ -39,26 +39,63 @@ /* Chapter 11.3.9 / Table 11.10: Cause coding */ static const struct value_string bssgp_cause_strings[] = { - { BSSGP_CAUSE_PROC_OVERLOAD, "Processor overload" }, - { BSSGP_CAUSE_EQUIP_FAIL, "Equipment Failure" }, - { BSSGP_CAUSE_TRASIT_NET_FAIL, "Transit netowkr service failure" }, - { BSSGP_CAUSE_CAPA_GREATER_0KPBS,"Transmission capacity modified" }, - { BSSGP_CAUSE_UNKNOWN_MS, "Unknown MS" }, - { BSSGP_CAUSE_UNKNOWN_BVCI, "Unknown BVCI" }, - { BSSGP_CAUSE_CELL_TRAF_CONG, "Cell traffic congestion" }, - { BSSGP_CAUSE_SGSN_CONG, "SGSN congestion" }, - { BSSGP_CAUSE_OML_INTERV, "O&M intervention" }, - { BSSGP_CAUSE_BVCI_BLOCKED, "BVCI blocked" }, - { BSSGP_CAUSE_PFC_CREATE_FAIL, "PFC create failure" }, - { BSSGP_CAUSE_SEM_INCORR_PDU, "Semantically incorrect PDU" }, - { BSSGP_CAUSE_INV_MAND_INF, "Invalid mandatory information" }, - { BSSGP_CAUSE_MISSING_MAND_IE, "Missing mandatory IE" }, - { BSSGP_CAUSE_MISSING_COND_IE, "Missing conditional IE" }, - { BSSGP_CAUSE_UNEXP_COND_IE, "Unexpected conditional IE" }, - { BSSGP_CAUSE_COND_IE_ERR, "Conditional IE error" }, - { BSSGP_CAUSE_PDU_INCOMP_STATE, "PDU incompatible with protocol state" }, - { BSSGP_CAUSE_PROTO_ERR_UNSPEC, "Protocol error - unspecified" }, - { BSSGP_CAUSE_PDU_INCOMP_FEAT, "PDU not compatible with feature set" }, + { BSSGP_CAUSE_PROC_OVERLOAD, "Processor overload" }, + { BSSGP_CAUSE_EQUIP_FAIL, "Equipment Failure" }, + { BSSGP_CAUSE_TRASIT_NET_FAIL, "Transit netowkr service failure" }, + { BSSGP_CAUSE_CAPA_GREATER_0KPBS, "Transmission capacity modified" }, + { BSSGP_CAUSE_UNKNOWN_MS, "Unknown MS" }, + { BSSGP_CAUSE_UNKNOWN_BVCI, "Unknown BVCI" }, + { BSSGP_CAUSE_CELL_TRAF_CONG, "Cell traffic congestion" }, + { BSSGP_CAUSE_SGSN_CONG, "SGSN congestion" }, + { BSSGP_CAUSE_OML_INTERV, "O&M intervention" }, + { BSSGP_CAUSE_BVCI_BLOCKED, "BVCI blocked" }, + { BSSGP_CAUSE_PFC_CREATE_FAIL, "PFC create failure" }, + { BSSGP_CAUSE_PFC_PREEMPTED, "PFC preempted" }, + { BSSGP_CAUSE_ABQP_NOT_SUPP, "ABQP no more supported" }, + { BSSGP_CAUSE_SEM_INCORR_PDU, "Semantically incorrect PDU" }, + { BSSGP_CAUSE_INV_MAND_INF, "Invalid mandatory information" }, + { BSSGP_CAUSE_MISSING_MAND_IE, "Missing mandatory IE" }, + { BSSGP_CAUSE_MISSING_COND_IE, "Missing conditional IE" }, + { BSSGP_CAUSE_UNEXP_COND_IE, "Unexpected conditional IE" }, + { BSSGP_CAUSE_COND_IE_ERR, "Conditional IE error" }, + { BSSGP_CAUSE_PDU_INCOMP_STATE, "PDU incompatible with protocol state" }, + { BSSGP_CAUSE_PROTO_ERR_UNSPEC, "Protocol error - unspecified" }, + { BSSGP_CAUSE_PDU_INCOMP_FEAT, "PDU not compatible with feature set" }, + { BSSGP_CAUSE_REQ_INFO_NOT_AVAIL, "Requested Information not available" }, + { BSSGP_CAUSE_UNKN_DST , "Unknown Destination address" }, + { BSSGP_CAUSE_UNKN_RIM_AI, "Unknown RIM Application Identity or RIM application disabled" }, + { BSSGP_CAUSE_INVAL_CONT_UI, "Invalid Container Unit Information" }, + { BSSGP_CAUSE_PFC_QUEUE, "PFC queuing" }, + { BSSGP_CAUSE_PFC_CREATED, "PFC created successfully" }, + { BSSGP_CAUSE_T12_EXPIRY, "T12 expiry" }, + { BSSGP_CAUSE_MS_UNDER_PS_HO, "MS under PS Handover treatment" }, + { BSSGP_CAUSE_UL_QUALITY, "Uplink quality" }, + { BSSGP_CAUSE_UL_STRENGTH, "Uplink strength" }, + { BSSGP_CAUSE_DL_QUALITY, "Downlink quality" }, + { BSSGP_CAUSE_DL_STRENGTH, "Downlink strength" }, + { BSSGP_CAUSE_DISTANCE, "Distance" }, + { BSSGP_CAUSE_BETTER_CELL, "Better cell" }, + { BSSGP_CAUSE_TRAFFIC, "Traffic" }, + { BSSGP_CAUSE_MS_RADIO_LOSS, "Radio contact lost with MS" }, + { BSSGP_CAUSE_MS_BACK_OLD_CHAN, "MS back on old channel" }, + { BSSGP_CAUSE_T13_EXPIRY, "T13 expiry" }, + { BSSGP_CAUSE_T14_EXPIRY, "T14 expiry" }, + { BSSGP_CAUSE_NOT_ALL_PFC, "Not all requested PFCs created" }, + { BSSGP_CAUSE_CS, "CS cause" }, + { BSSGP_CAUSE_REQ_ALG_NOT_SUPP, "Requested ciphering and/or integrity protection algorithms not supported" }, + { BSSGP_CAUSE_RELOC_FAIL, "Relocation failure in target system" }, + { BSSGP_CAUSE_DIR_RETRY , "Directed Retry" }, + { BSSGP_CAUSE_TIME_CRIT_RELOC , "Time critical relocation" }, + { BSSGP_CAUSE_PS_HO_TARG_NA , "PS Handover Target not allowed" }, + { BSSGP_CAUSE_PS_HO_TARG_NOT_SUPP, "PS Handover not Supported in Target BSS or Target System" }, + { BSSGP_CAUSE_PUESBINE, "Incoming relocation not supported due to PUESBINE feature" }, + { BSSGP_CAUSE_DTM_HO_NO_CS_RES, "DTM Handover - No CS resource" }, + { BSSGP_CAUSE_DTM_HO_PS_ALLOC_FAIL, "DTM Handover - PS Allocation failure" }, + { BSSGP_CAUSE_DTM_HO_T24_EXPIRY, "DTM Handover - T24 expiry" }, + { BSSGP_CAUSE_DTM_HO_INVAL_CS_IND, "DTM Handover - Invalid CS Indication IE" }, + { BSSGP_CAUSE_DTM_HO_T23_EXPIRY, "DTM Handover - T23 expiry" }, + { BSSGP_CAUSE_DTM_HO_MSC_ERR, "DTM Handover - MSC Error" }, + { BSSGP_CAUSE_INVAL_CSG_CELL, "Invalid CSG cell" }, { 0, NULL }, }; -- To view, visit https://gerrit.osmocom.org/3087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie39a6c91a46d179392d861805a106743a07c6fb0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 1 07:42:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 1 Jul 2017 07:42:25 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: build msc using libosmo-sccp master In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: build msc using libosmo-sccp master ...................................................................... jenkins: build msc using libosmo-sccp master Since 81c0bcab068174036f6897e69311f413d94c74d4 was merged, it is not necessary to build the neels/aoip branch anymore. Other patches on that branch are not necessary either. Change-Id: I850e0dd2fc61d59d56c0dd69ee00b6e19685fb95 --- M contrib/jenkins-build-osmo-msc.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index 53a23fe..f9710c0 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -9,7 +9,7 @@ build_repo libosmo-netif build_repo openggsn build_repo libsmpp34 -build_repo libosmo-sccp neels/aoip # TEMPORARY BRANCH +build_repo libosmo-sccp build_repo libasn1c build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -- To view, visit https://gerrit.osmocom.org/3085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I850e0dd2fc61d59d56c0dd69ee00b6e19685fb95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 2 07:01:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 2 Jul 2017 07:01:59 +0000 Subject: [MERGED] osmo-bts[master]: l1sap: Don't enqueue PTCCH blocks for loopback In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: l1sap: Don't enqueue PTCCH blocks for loopback ...................................................................... l1sap: Don't enqueue PTCCH blocks for loopback When we're in loopback testing mode for PDTCH, we must make sure to avoid adding PTCCH blocks to the queue. Only PDTCH blocks must be enqueued. For the transmit (downlink) side, we already had the PTCCH check in place. Change-Id: I7ef40d9bdf74a99375bc6568ed9483499664bf6f --- M src/common/l1sap.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 85d1dd1..71690cd 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -967,7 +967,7 @@ lchan = get_lchan_by_chan_nr(trx, chan_nr); if (!lchan) LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); - if (lchan && lchan->loopback) { + if (lchan && lchan->loopback && !L1SAP_IS_PTCCH(fn)) { /* we are in loopback mode (for BER testing) * mode and need to enqeue the frame to be * returned in downlink */ -- To view, visit https://gerrit.osmocom.org/3081 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7ef40d9bdf74a99375bc6568ed9483499664bf6f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sun Jul 2 07:02:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 2 Jul 2017 07:02:29 +0000 Subject: [MERGED] osmo-bts[master]: TRX: permit transmission of all-zero loopback frames In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: permit transmission of all-zero loopback frames ...................................................................... TRX: permit transmission of all-zero loopback frames For some reason, osmo-bts-trx attempted to interpret/validate the contents of the downlink TCH block that it was about to transmit. If such checks are made, they should clearly be in the common part above L1SAP, and not in the bts-model specific part. Also, having the checks in place didn't allow us to send an all-zero downlink block, as is required for detection of uplink FER in a loopback testing setup, e.g. with CMU-300. Change-Id: I6388de98e4a7e20843a1be88a58bba8d2c9aa0d5 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 5 insertions(+), 30 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index a9bcbda..4c3330f 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -471,42 +471,15 @@ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR / HR */ - if (chan != TRXC_TCHF) { /* HR */ + if (chan != TRXC_TCHF) /* HR */ len = 15; - if (msgb_l2len(msg_tch) >= 1 - && (msg_tch->l2h[0] & 0xf0) != 0x00) { - LOGP(DL1C, LOGL_NOTICE, "%s " - "Transmitting 'bad " - "HR frame' trx=%u ts=%u at " - "fn=%u.\n", - trx_chan_desc[chan].name, - l1t->trx->nr, tn, fn); - goto free_bad_msg; - } - break; - } - len = GSM_FR_BYTES; - if (msgb_l2len(msg_tch) >= 1 - && (msg_tch->l2h[0] >> 4) != 0xd) { - LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " - "FR frame' trx=%u ts=%u at fn=%u.\n", - trx_chan_desc[chan].name, - l1t->trx->nr, tn, fn); - goto free_bad_msg; - } + else + len = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ if (chan != TRXC_TCHF) goto inval_mode2; len = GSM_EFR_BYTES; - if (msgb_l2len(msg_tch) >= 1 - && (msg_tch->l2h[0] >> 4) != 0xc) { - LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " - "EFR frame' trx=%u ts=%u at fn=%u.\n", - trx_chan_desc[chan].name, - l1t->trx->nr, tn, fn); - goto free_bad_msg; - } break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ len = osmo_amr_rtp_dec(msg_tch->l2h, msgb_l2len(msg_tch), @@ -1146,10 +1119,12 @@ if (lchan->tch.dtx.ul_sid) return 0; /* DTXu: pause in progress */ memset(tch_data, 0, GSM_FR_BYTES); + tch_data[0] = 0xd0; rc = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ memset(tch_data, 0, GSM_EFR_BYTES); + tch_data[0] = 0xc0; rc = GSM_EFR_BYTES; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ -- To view, visit https://gerrit.osmocom.org/3082 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6388de98e4a7e20843a1be88a58bba8d2c9aa0d5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 2 07:07:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 2 Jul 2017 07:07:32 +0000 Subject: openbsc[master]: Fix BTS number in attribute requests In-Reply-To: References: Message-ID: Patch Set 2: You are sending the GET_ATTRIBUTE OML message to each bts type, and that includes an E1 based BTS. Assuming what that BTS will do when receiving such a message with a "wrong" BTS number can be dangerous. Also, if the calls were specifically added for osmoBTS, why are they not subject to related conditionals? They could simply be issued only in case "OsmoBTS" is selected as bts->type. -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 2 07:08:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 2 Jul 2017 07:08:10 +0000 Subject: openbsc[master]: Fix BTS number in attribute requests In-Reply-To: References: Message-ID: Patch Set 2: > Also, if I understand 3GPP TS 52.021 ?9.3 correctly than we can't > use BTS number in here. Am I mistaken? Yes, we cannot use the BTS number here. -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 08:07:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 08:07:24 +0000 Subject: osmo-bts[master]: l1sap.c: fn_ms_adj: Add err logging and always return GSM_RT... In-Reply-To: References: Message-ID: Patch Set 2: > please clarify with Max rgarding DTX and also ask is help to verify > DTX still works after all related changes. We already discussed some related stuff with Max, and I tested it with DTX enabled and checked it was being used with wireshark. Max do you have any further comment on this? I guess I'll need to update the rtp-amr documentation as in there it explicitly says on the diagrams that we are not receiving all PH-DATA.ind packets, but we should after changing the fBFILevel to -200. I think it's worth adding a reference there about that too. I'll create a subtask to do that. -- To view, visit https://gerrit.osmocom.org/3084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 08:55:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 08:55:59 +0000 Subject: [PATCH] libosmocore[master]: gsm_utils: Add osmo_dump_gsmtime Message-ID: Review at https://gerrit.osmocom.org/3099 gsm_utils: Add osmo_dump_gsmtime Used by osmo-bts. Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/3099/1 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..a879d33 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -168,6 +168,9 @@ /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); +/* Returns static buffer with string representation of a GSM Time */ +char *osmo_dump_gsmtime(const struct gsm_time *tm); + /* GSM TS 03.03 Chapter 2.6 */ enum gprs_tlli_type { TLLI_LOCAL, diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..f565513 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -758,6 +758,16 @@ return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1)); } +char *osmo_dump_gsmtime(const struct gsm_time *tm) +{ + static char buf[64]; + + snprintf(buf, sizeof(buf), "%06u/%02u/%02u/%02u/%02u", + tm->fn, tm->t1, tm->t2, tm->t3, tm->fn%52); + buf[sizeof(buf)-1] = '\0'; + return buf; +} + /*! append range1024 encoded data to bit vector * \param[out] bv Caller-provided output bit-vector * \param[in] r Input Range1024 sructure */ -- To view, visit https://gerrit.osmocom.org/3099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 3 09:02:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 3 Jul 2017 09:02:53 +0000 Subject: [ABANDON] openbsc[master]: bsc_init: add logging for unhandled signals In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: bsc_init: add logging for unhandled signals ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I0ddaec3b017d637027b0478ce3e137becbf25ea7 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 3 09:07:11 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 09:07:11 +0000 Subject: [PATCH] libosmocore[master]: gsm_utils: Add osmo_dump_gsmtime In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3099 to look at the new patch set (#2). gsm_utils: Add osmo_dump_gsmtime Used by osmo-bts. Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c 2 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/3099/2 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..a879d33 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -168,6 +168,9 @@ /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); +/* Returns static buffer with string representation of a GSM Time */ +char *osmo_dump_gsmtime(const struct gsm_time *tm); + /* GSM TS 03.03 Chapter 2.6 */ enum gprs_tlli_type { TLLI_LOCAL, diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..1a7469f 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -90,6 +90,7 @@ #include #include #include +#include #include "../../config.h" @@ -758,6 +759,16 @@ return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1)); } +char *osmo_dump_gsmtime(const struct gsm_time *tm) +{ + static char buf[64]; + + snprintf(buf, sizeof(buf), "%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8, + tm->fn, tm->t1, tm->t2, tm->t3, tm->fn%52); + buf[sizeof(buf)-1] = '\0'; + return buf; +} + /*! append range1024 encoded data to bit vector * \param[out] bv Caller-provided output bit-vector * \param[in] r Input Range1024 sructure */ -- To view, visit https://gerrit.osmocom.org/3099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 3 09:15:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 09:15:22 +0000 Subject: [PATCH] libosmocore[master]: gsm_utils: Add osmo_dump_gsmtime In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3099 to look at the new patch set (#3). gsm_utils: Add osmo_dump_gsmtime Used by osmo-bts, moved from osmo-bts l1sap.c:dump_gsmtime. Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/3099/3 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..a879d33 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -168,6 +168,9 @@ /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); +/* Returns static buffer with string representation of a GSM Time */ +char *osmo_dump_gsmtime(const struct gsm_time *tm); + /* GSM TS 03.03 Chapter 2.6 */ enum gprs_tlli_type { TLLI_LOCAL, diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..2c980d2 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -90,6 +90,7 @@ #include #include #include +#include #include "../../config.h" @@ -758,6 +759,16 @@ return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1)); } +char *osmo_dump_gsmtime(const struct gsm_time *tm) +{ + static char buf[64]; + + snprintf(buf, sizeof(buf), "%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8, + tm->fn, tm->t1, tm->t2, tm->t3, (uint8_t)tm->fn%52); + buf[sizeof(buf)-1] = '\0'; + return buf; +} + /*! append range1024 encoded data to bit vector * \param[out] bv Caller-provided output bit-vector * \param[in] r Input Range1024 sructure */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index e992a4f..ad7e013 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -274,6 +274,7 @@ gsm_fn2gsmtime; gsm_get_octet_len; gsm_gsmtime2fn; +osmo_dump_gsmtime; gsm_milenage; gsm_septet_encode; -- To view, visit https://gerrit.osmocom.org/3099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 3 09:21:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 3 Jul 2017 09:21:58 +0000 Subject: [PATCH] openbsc[master]: Fix BTS attribute requests 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/2868 to look at the new patch set (#3). Fix BTS attribute requests * fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all BTS' as it's explained in 3GPP TS 52.021 ?9.3. * only request attributes from supported (OsmoBTS) types Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Related: OS#2317 --- M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bsc_init.c 2 files changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/2868/3 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 019d039..cf20d7c 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -1590,10 +1590,17 @@ const uint8_t *attr, uint8_t attr_len) { struct abis_om_hdr *oh; - struct msgb *msg = nm_msgb_alloc(); + struct msgb *msg; + + if (bts->type != GSM_BTS_TYPE_OSMOBTS) { + LOGPC(DNM, LOGL_NOTICE, "Getting attributes from BTS%d type %s is not supported.\n", + bts->nr, btstype2str(bts->type)); + return -EINVAL; + } DEBUGP(DNM, "Get Attr (bts=%d)\n", bts->nr); + msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, attr_len, NM_MT_GET_ATTR, obj_class, bts_nr, trx_nr, ts_nr); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index ec87a7b..ead21b4 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -349,12 +349,12 @@ generate_cell_chan_list(ca, trx->bts); /* Request generic BTS-level attributes */ - abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, bts_attr, sizeof(bts_attr)); + abis_nm_get_attr(trx->bts, NM_OC_BTS, 0xFF, 0xFF, 0xFF, bts_attr, sizeof(bts_attr)); llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; /* Request TRX-level attributes */ - abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, cur_trx->bts->nr, cur_trx->nr, 0xFF, + abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, 0, cur_trx->nr, 0xFF, trx_attr, sizeof(trx_attr)); for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jul 3 09:41:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 09:41:35 +0000 Subject: [PATCH] osmo-bts[master]: Use L1P instead of L1C for TCH logging and allocation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3093 to look at the new patch set (#2). Use L1P instead of L1C for TCH logging and allocation L1C is for L1-Control primitives, while TCH channels are L1 Data channels. Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b --- M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_tch.c M src/osmo-bts-sysmo/tch.c 3 files changed, 34 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/93/3093/2 diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 8bed695..c82d6f8 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -61,7 +61,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -95,7 +95,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -126,12 +126,12 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return NULL; } @@ -155,7 +155,7 @@ { if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return 0; } @@ -172,7 +172,7 @@ uint8_t amr_if2_len = payload_len - 2; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -405,31 +405,31 @@ case GsmL1_TchPlType_Amr_SidFirstP1: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstP2: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidUpdateInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " "(%d bytes)\n", payload_len); break; default: - LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", + LOGP(DL1P, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, payload_type)); break; @@ -465,7 +465,7 @@ return 0; err_payload_match: - LOGP(DL1C, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", + LOGP(DL1P, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, payload_type)); return -EINVAL; diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index 5693313..79bf245 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -43,7 +43,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -93,7 +93,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -132,12 +132,12 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return NULL; } @@ -164,7 +164,7 @@ { if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return 0; } @@ -217,13 +217,13 @@ goto err_payload_match; break; default: - LOGP(DL1C, LOGL_NOTICE, + LOGP(DL1P, LOGL_NOTICE, "%s Rx Payload Type %d is unsupported\n", gsm_lchan_name(lchan), payload_type); break; } - LOGP(DL1C, LOGL_DEBUG, "%s Rx codec frame (%u): %s\n", + LOGP(DL1P, LOGL_DEBUG, "%s Rx codec frame (%u): %s\n", gsm_lchan_name(lchan), payload_len, osmo_hexdump(payload, payload_len)); @@ -247,7 +247,7 @@ rmsg = l1_to_rtppayload_amr(payload, payload_len, &lchan->tch.amr_mr); #else - LOGP(DL1C, LOGL_ERROR, "OctPHY only supports FR!\n"); + LOGP(DL1P, LOGL_ERROR, "OctPHY only supports FR!\n"); return -1; #endif break; @@ -260,7 +260,7 @@ return 0; err_payload_match: - LOGP(DL1C, LOGL_ERROR, + LOGP(DL1P, LOGL_ERROR, "%s Rx Payload Type %d incompatible with lchan\n", gsm_lchan_name(lchan), payload_type); return -EINVAL; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index a12b1a7..6333d19 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -58,7 +58,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -113,7 +113,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -200,12 +200,12 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return NULL; } @@ -239,7 +239,7 @@ { if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return 0; } @@ -269,7 +269,7 @@ uint8_t amr_if2_len = payload_len - 2; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -296,7 +296,7 @@ else if (cmr_idx >= amr_mrc->num_modes || cmr_idx > GsmL1_AmrCodecMode_Unset) { /* Make sure the CMR of the phone is in the active codec set */ - LOGP(DL1C, LOGL_NOTICE, "L1->RTP: overriding CMR IDX %u\n", cmr_idx); + LOGP(DL1P, LOGL_NOTICE, "L1->RTP: overriding CMR IDX %u\n", cmr_idx); cmr = AMR_CMR_NONE; } else { cmr = amr_mrc->bts_mode[cmr_idx].mode; @@ -552,31 +552,31 @@ case GsmL1_TchPlType_Amr_SidFirstP1: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstP2: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidUpdateInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " "(%d bytes)\n", payload_len); break; default: - LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", + LOGP(DL1P, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, payload_type)); break; @@ -614,7 +614,7 @@ return 0; err_payload_match: - LOGP(DL1C, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", + LOGP(DL1P, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, payload_type)); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b 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 Mon Jul 3 09:41:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 09:41:35 +0000 Subject: [PATCH] osmo-bts[master]: Use osmo_dump_gsmtime to log fn across different layers 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/3098 to look at the new patch set (#2). Use osmo_dump_gsmtime to log fn across different layers This commit also fixes a missing end of line in the log output of handle_ph_data_ind Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 --- M src/common/l1sap.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 17 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/3098/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index f487d77..b6fcad3 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -798,8 +798,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH-RTS.ind %02u/%02u/%02u chan_nr=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) @@ -955,8 +954,8 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-DATA.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); + DEBUGP(DL1P, "Rx PH-DATA.ind %s chan_nr=%d link_id=%d\n", + osmo_dump_gsmtime(&g_time), chan_nr, link_id); if (ts_is_pdch(&trx->ts[tn])) { lchan = get_lchan_by_chan_nr(trx, chan_nr); @@ -1060,8 +1059,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH.ind %02u/%02u/%02u chan_nr=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) @@ -1212,9 +1210,9 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "TX packet data %02u/%02u/%02u is_ptcch=%d trx=%d ts=%d " - "block_nr=%d, arfcn=%d, len=%d\n", g_time.t1, g_time.t2, - g_time.t3, is_ptcch, ts->trx->nr, ts->nr, block_nr, arfcn, len); + DEBUGP(DL1P, "TX packet data %s is_ptcch=%d trx=%d ts=%d " + "block_nr=%d, arfcn=%d, len=%d\n", osmo_dump_gsmtime(&g_time), + is_ptcch, ts->trx->nr, ts->nr, block_nr, arfcn, len); msg = l1sap_msgb_alloc(len); l1sap = msgb_l1sap_prim(msg); diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 66aa21a..b82a7c6 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -926,6 +926,7 @@ uint8_t chan_nr, link_id; struct osmo_phsap_prim *l1sap; uint32_t fn; + struct gsm_time g_time; uint8_t *data, len; int rc = 0; int8_t rssi; @@ -943,9 +944,11 @@ process_meas_res(trx, chan_nr, &data_ind->measParam, fn); - DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", + gsm_fn2gsmtime(&g_time, fn); + + DEBUGP(DL1P, "Rx PH-DATA.ind %s %s (hL2 %08x): %s\n", get_value_string(lc15bts_l1sapi_names, data_ind->sapi), - (uint32_t)data_ind->hLayer2, + osmo_dump_gsmtime(&g_time), (uint32_t)data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); dump_meas_res(LOGL_DEBUG, &data_ind->measParam); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 299a743..e5e295a 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -927,6 +927,7 @@ struct msgb *sap_msg; struct osmo_phsap_prim *l1sap; uint32_t fn; + struct gsm_time g_time; int rc = 0; chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, @@ -942,9 +943,11 @@ process_meas_res(trx, chan_nr, fn, &data_ind->measParam); - DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", + gsm_fn2gsmtime(&g_time, fn); + + DEBUGP(DL1P, "Rx PH-DATA.ind %s %s (hL2 %08x): %s\n", get_value_string(femtobts_l1sapi_names, data_ind->sapi), - data_ind->hLayer2, + osmo_dump_gsmtime(&g_time), data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); dump_meas_res(LOGL_DEBUG, &data_ind->measParam); -- To view, visit https://gerrit.osmocom.org/3098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 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 Mon Jul 3 09:41:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 09:41:36 +0000 Subject: [PATCH] osmo-bts[master]: Use osmo_dump_gsmtime Message-ID: Review at https://gerrit.osmocom.org/3100 Use osmo_dump_gsmtime Internal l1sap dump_gsmtime has been moved to libosmocore as osmo_dump_gsmtime. Remove use of internal function and replace with the libosmocore version. Depends on libosmocore Ib5452e2c20f53006c0f6d197fb055728947125d8 Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66 --- M src/common/l1sap.c 1 file changed, 4 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/00/3100/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 3f9da4f..f487d77 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -51,16 +52,6 @@ #include #include #include - -static char *dump_gsmtime(const struct gsm_time *tm) -{ - static char buf[64]; - - snprintf(buf, sizeof(buf), "%06u/%02u/%02u/%02u/%02u", - tm->fn, tm->t1, tm->t2, tm->t3, tm->fn%52); - buf[sizeof(buf)-1] = '\0'; - return buf; -} struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) @@ -627,13 +618,13 @@ loop_msg = msgb_dequeue(&lchan->dl_tch_queue); if (!loop_msg) { LOGP(DL1P, LOGL_NOTICE, "%s %s: no looped PDTCH message, sending empty\n", - gsm_lchan_name(lchan), dump_gsmtime(tm)); + gsm_lchan_name(lchan), osmo_dump_gsmtime(tm)); /* empty downlink message */ p = msgb_put(msg, GSM_MACBLOCK_LEN); memset(p, 0, GSM_MACBLOCK_LEN); } else { LOGP(DL1P, LOGL_NOTICE, "%s %s: looped PDTCH message of %u bytes\n", - gsm_lchan_name(lchan), dump_gsmtime(tm), msgb_l2len(loop_msg)); + gsm_lchan_name(lchan), osmo_dump_gsmtime(tm), msgb_l2len(loop_msg)); /* copy over data from queued response message */ p = msgb_put(msg, msgb_l2len(loop_msg)); memcpy(p, msgb_l2(loop_msg), msgb_l2len(loop_msg)); @@ -666,7 +657,7 @@ gsm_fn2gsmtime(&g_time, fn); DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=%d link_id=%d\n", - dump_gsmtime(&g_time), chan_nr, link_id); + osmo_dump_gsmtime(&g_time), chan_nr, link_id); /* reuse PH-RTS.ind for PH-DATA.req */ if (!msg) { -- To view, visit https://gerrit.osmocom.org/3100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 3 09:42:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 09:42:40 +0000 Subject: [ABANDON] osmo-bts[master]: litecell15/tch.c: Use L1P instead of L1C for logging and all... In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: litecell15/tch.c: Use L1P instead of L1C for logging and allocation ...................................................................... Abandoned Merged into I07ea3a7326bfcb62271d58deb0743311f6d97c8b -- To view, visit https://gerrit.osmocom.org/3094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Iecda49dc7e6005acfdaf4bd03599c26ce4bccc73 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 3 09:43:02 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 09:43:02 +0000 Subject: [ABANDON] osmo-bts[master]: octphy/tch.c: Use L1P instead of L1C for logging and allocation In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: octphy/tch.c: Use L1P instead of L1C for logging and allocation ...................................................................... Abandoned Merged into I07ea3a7326bfcb62271d58deb0743311f6d97c8b -- To view, visit https://gerrit.osmocom.org/3095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I8593e9fcd94f1a42f1e09f079d3d40f07bd56307 Gerrit-PatchSet: 1 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 Mon Jul 3 09:47:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 3 Jul 2017 09:47:00 +0000 Subject: [PATCH] osmo-bts[master]: OML: use fom_hdr while handling attr. 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/3090 to look at the new patch set (#2). OML: use fom_hdr while handling attr. request Use Obj. Class and TRX# from abis_om_fom_hdr of incoming request instead of BTS' MO to properly distinguish between BTS-level and TRX-level attributes. Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852 Related: OS#2317 --- M src/common/oml.c 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/90/3090/2 diff --git a/src/common/oml.c b/src/common/oml.c index 8f23f82..20f45e5 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -257,27 +257,29 @@ } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(const struct gsm_bts *bts, struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) +static int oml_tx_attr_resp(struct gsm_bts *bts, const struct abis_om_fom_hdr *foh, const uint8_t *attr, + uint16_t attr_len) { struct msgb *nmsg = oml_msgb_alloc(); uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ int len; - LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n", gsm_abis_mo_name(mo)); + LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n", + get_value_string(abis_nm_obj_class_names, foh->obj_class)); if (!nmsg) return -ENOMEM; - switch (mo->obj_class) { + switch (foh->obj_class) { case NM_OC_BTS: len = handle_attrs_bts(resp, bts, attr, attr_len); break; case NM_OC_BASEB_TRANSC: - len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, mo->obj_inst.trx_nr), attr, attr_len); + len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, foh->obj_inst.trx_nr), attr, attr_len); break; default: LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", - get_value_string(abis_nm_obj_class_names, mo->obj_class)); + get_value_string(abis_nm_obj_class_names, foh->obj_class)); len = -EINVAL; } @@ -290,7 +292,7 @@ /* ?9.4.64 Get Attribute Response Info */ msgb_tl16v_put(nmsg, NM_ATT_GET_ARI, len, resp); - return oml_mo_send_msg(mo, nmsg, NM_MT_GET_ATTR_RESP); + return oml_mo_send_msg(&bts->mo, nmsg, NM_MT_GET_ATTR_RESP); } /* 8.8.1 sending State Changed Event Report */ @@ -540,7 +542,7 @@ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(bts, &bts->mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(bts, foh, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Failed to respond to O&M Get Attributes message: %s\n", strerror(-rc)); switch (-rc) { -- To view, visit https://gerrit.osmocom.org/3090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852 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 Mon Jul 3 09:52:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 3 Jul 2017 09:52:57 +0000 Subject: libosmocore[master]: gsm_utils: Add osmo_dump_gsmtime In-Reply-To: References: Message-ID: Patch Set 3: This seems very similar to 3048. -- To view, visit https://gerrit.osmocom.org/3099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 09:57:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 09:57:28 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 4: As Max pointed out, this is mostly the same as https://gerrit.osmocom.org/#/c/3099/ I guess you can use osmo_dump_gsmtime inside this function and I will also use yours into some patches I'm doing. -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 09:58:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 09:58:57 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 4: > As Max pointed out, this is mostly the same as https://gerrit.osmocom.org/#/c/3099/ > > I guess you can use osmo_dump_gsmtime inside this function and I > will also use yours into some patches I'm doing. Agree? Shall you take mine and rebase on top of it or I can cherry-pick +modify yours on top of my branch. -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 10:08:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 3 Jul 2017 10:08:30 +0000 Subject: osmo-bts[master]: l1sap.c: fn_ms_adj: Add err logging and always return GSM_RT... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 Indeed - updating rtp-amr is definitely necessary. Letme know if you have any questions about it, also - add me as watcher to corresponding ticket(s). -- To view, visit https://gerrit.osmocom.org/3084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 10:33:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 3 Jul 2017 10:33:37 +0000 Subject: [PATCH] libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1526 to look at the new patch set (#6). Add function to generate random identifier The function is a wrapper on top of getrandom() (if available via glibc) or corresponding syscall. If neither is available than insecure random generation is used as a fallback (which is clearly indicated to the caller). It's intended to generate small random data good enough for session identifiers and keys. To generate long-term cryptographic keys it's better to use special crypto libraries like GnuTLS instead. The size of the output is deliberately limited to decrease the chance of entropy pool depletion. It's still possible via successive calls but the caller can find a way to deplete the entropy anyway so it's not our concern. As an example it's used to replace old insecure random number generator in osmo-auc-gen utility. Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Related: OS#1694 --- M configure.ac M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map M utils/osmo-auc-gen.c 5 files changed, 75 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1526/6 diff --git a/configure.ac b/configure.ac index 92544b6..e7e394a 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,9 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) +# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped +AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include ]]) + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..17f89e0 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -38,6 +38,9 @@ #define GSM_MAX_FN (26*51*2048) +/* Max length of random identifier which can be requested via osmo_get_rand_id() */ +#define OSMO_MAX_RAND_ID_LEN 16 + struct gsm_time { uint32_t fn; /* FN count */ uint16_t t1; /* FN div (26*51) */ @@ -60,6 +63,8 @@ const char *gsm_band_name(enum gsm_band band); enum gsm_band gsm_band_parse(const char *mhz); +int osmo_get_rand_id(uint8_t *out, size_t len); + /*! * Decode a sequence of GSM 03.38 encoded 7 bit characters. * diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..36f5e2f 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -90,6 +90,14 @@ #include #include #include +#include +#include + +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) +#include +#elif HAVE_DECL_SYS_GETRANDOM +#include +#endif #include "../../config.h" @@ -386,6 +394,61 @@ return y; } +static inline void fallback_insecure_rand(uint8_t *out, size_t len) +{ + int i; + + srand(time(NULL)); + + for (i = 0; i < len; out[i++] = rand()); +} + +/*! Generate random identifier + * \param[out] out Buffer to be filled with random data + * \param[in] len Number of random bytes required + * \returns 0 on success, or a negative error code on error. + */ +int osmo_get_rand_id(uint8_t *out, size_t len) +{ + int rc; + + /* this function is intended for generating short identifiers only, not arbitrary-length random data */ + if (len > OSMO_MAX_RAND_ID_LEN) + return -E2BIG; + + /* we use /dev/urandom (default when GRND_RANDOM flag is not set) which is fine as (at least on GNU/Linux >= 4.8) + both /dev/(u)random numbers are coming from the same CSPRNG anyway - see also RFC4086 */ +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) + rc = getrandom(out, len, GRND_NONBLOCK); +#elif HAVE_DECL_SYS_GETRANDOM +#pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") + /* FIXME: this can be removed once we bump glibc requirements to 2.25 */ + rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); +#else +#pragma message ("Insecure random fallback is used: no getrandom syscall available!") + /* Fallback for systems without getrandom() syscall */ + rc = 0; +#endif + if (rc < 0) { /* getrandom() failed entirely */ + switch (errno) { + case EAGAIN: /* the requested entropy is not available: fallback to insecure generator and let + application decide if it's OK with */ + fallback_insecure_rand(out, len); + default: /* intentional fall-through */ + return -errno; + } + } + if (rc != len) { /* the system call was interrupted by a signal: this should not actually happen + (according to getrandom(2)) as long as OSMO_MAX_RAND_ID_LEN < 256 because we do not set + GRND_RANDOM but let's be paranoid and check/fallback anyway */ + fallback_insecure_rand(out + rc, len); + + return -EAGAIN; + } + + return 0; +} + /*! Build the RSL uplink measurement IE (3GPP TS 08.58 ? 9.3.25) * \param[in] mru Unidirectional measurement report structure * \param[in] dtxd_used Indicates if DTXd was used during measurement report diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index e992a4f..f66ba3d 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -39,6 +39,7 @@ osmo_sitype_strs; osmo_c4; +osmo_get_rand_id; bitvec_add_range1024; comp128; comp128v2; diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 76c4927..92fc25c 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -34,6 +34,7 @@ #include #include +#include static void dump_triplets_dat(struct osmo_auth_vector *vec) { @@ -225,15 +226,8 @@ } if (!rand_is_set) { - int i; - printf("WARNING: We're using really weak random numbers!\n\n"); - srand(time(NULL)); - - for (i = 0; i < 4; ++i) { - uint32_t r; - r = rand(); - memcpy(&_rand[i*4], &r, 4); - } + if (osmo_get_rand_id(_rand, 16) < 0) + printf("WARNING: We're using really weak random numbers!\n\n"); } if (test_aud.type == OSMO_AUTH_TYPE_NONE || -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 10:37:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 10:37:46 +0000 Subject: osmo-gsm-tester[master]: Add microsecond accuracy to log timestamps In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3025/1/src/osmo_gsm_tester/log.py File src/osmo_gsm_tester/log.py: Line 85: DATEFMT = '%H:%M:%S.%f' it's a pity that there is no format string for milliseconds: I'd prefer having less digits. That can be done with manual formatting like '%03f' % (now.microsecond/1000) ... which changes the DATEFMT semantics, not worth it. Ok then. -- To view, visit https://gerrit.osmocom.org/3025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43bb5c6e9977189251802bc2b078c52eb046bab8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 3 10:38:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 10:38:44 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Power off modem during cleanup() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 wow, so short :) -- To view, visit https://gerrit.osmocom.org/3028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0c509e77ababf385beb8b1d26659ca4d18f9331 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 10:39:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 10:39:46 +0000 Subject: [MERGED] osmo-gsm-tester[master]: ofono_client: Power off modem during cleanup() In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: ofono_client: Power off modem during cleanup() ...................................................................... ofono_client: Power off modem during cleanup() Change-Id: Ic0c509e77ababf385beb8b1d26659ca4d18f9331 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 70fee25..60f98df 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -167,6 +167,7 @@ self.connected_signals = util.listdict() def cleanup(self): + self.set_powered(False) self.unwatch_interfaces() for interface_name in list(self.connected_signals.keys()): self.remove_signals(interface_name) -- To view, visit https://gerrit.osmocom.org/3028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic0c509e77ababf385beb8b1d26659ca4d18f9331 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 3 10:39:56 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 10:39:56 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Add microsecond accuracy to log timestamps In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Add microsecond accuracy to log timestamps ...................................................................... Add microsecond accuracy to log timestamps This is useful while debugging and trying to check events across other outputs such as pcap files, process logs, etc. Change-Id: I43bb5c6e9977189251802bc2b078c52eb046bab8 --- M selftest/process_test.ok.ign M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/process.py 3 files changed, 7 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/selftest/process_test.ok.ign b/selftest/process_test.ok.ign index 0abd7d5..b817f5a 100644 --- a/selftest/process_test.ok.ign +++ b/selftest/process_test.ok.ign @@ -1,7 +1,7 @@ PATH='[^']*' PATH=[$PATH] /tmp/[^/ '"]* [TMP] pid=[0-9]* pid=[PID] -....-..-.._..:..:.. [DATETIME] +....-..-.._..:..:..\....... [DATETIME] '[^']*/selftest/process_test/foo.py' [$0] "[^"]*/selftest/process_test/foo.py" [$0] , line [0-9]* , line [LINE] diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index c4a6629..a9f16c2 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -23,6 +23,7 @@ import traceback import contextlib import atexit +from datetime import datetime # we need this for strftime as the one from time doesn't carry microsecond info from inspect import getframeinfo, stack from .util import is_dict @@ -80,8 +81,8 @@ target.log(origin, category, level, src, messages, named_items) -LONG_DATEFMT = '%Y-%m-%d_%H:%M:%S' -DATEFMT = '%H:%M:%S' +LONG_DATEFMT = '%Y-%m-%d_%H:%M:%S.%f' +DATEFMT = '%H:%M:%S.%f' # may be overridden by regression tests get_process_id = lambda: '%d-%d' % (os.getpid(), time.time()) @@ -105,7 +106,7 @@ all_levels = None # redirected by logging test - get_time_str = lambda self: time.strftime(self.log_time_fmt) + get_time_str = lambda self: datetime.now().strftime(self.log_time_fmt) # sink that gets each complete logging line log_write_func = None diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index d24bf3d..4b68ef5 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -21,6 +21,7 @@ import time import subprocess import signal +from datetime import datetime from . import log, test, event_loop from .util import Dir @@ -55,7 +56,7 @@ path = self.run_dir.new_child(name) f = open(path, 'w') self.dbg(path) - f.write('(launched: %s)\n' % time.strftime(log.LONG_DATEFMT)) + f.write('(launched: %s)\n' % datetime.now().strftime(log.LONG_DATEFMT)) f.flush() self.outputs[name] = (path, f) return f -- To view, visit https://gerrit.osmocom.org/3025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43bb5c6e9977189251802bc2b078c52eb046bab8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 3 11:06:31 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 11:06:31 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 4: > > As Max pointed out, this is mostly the same as https://gerrit.osmocom.org/#/c/3099/ > > > > I guess you can use osmo_dump_gsmtime inside this function and I > > will also use yours into some patches I'm doing. > > Agree? Shall you take mine and rebase on top of it or I can > cherry-pick +modify yours on top of my branch. I am fine with that. -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 11:07:18 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 11:07:18 +0000 Subject: libosmocore[master]: gsm_utils: Add osmo_dump_gsmtime In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 > This seems very similar to 3048. -- To view, visit https://gerrit.osmocom.org/3099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 11:13:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 11:13:38 +0000 Subject: [PATCH] osmo-gsm-tester[master]: suite: Use event_loop.poll in interactive poll Message-ID: Review at https://gerrit.osmocom.org/3101 suite: Use event_loop.poll in interactive poll This way we also poll dbus events from ofono_client Change-Id: I06fe9a78d702ebb05c4ece78e14fcae9e2e74ee2 --- M src/osmo_gsm_tester/suite.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/01/3101/1 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 71b8dc7..66d06fa 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -394,7 +394,7 @@ sys.__stdout__.write(msg) sys.__stdout__.write('\n') sys.__stdout__.flush() - entered = util.input_polling('> ', self.poll) + entered = util.input_polling('> ', event_loop.poll) self.log('prompt entered:', repr(entered)) return entered -- To view, visit https://gerrit.osmocom.org/3101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06fe9a78d702ebb05c4ece78e14fcae9e2e74ee2 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 Jul 3 12:04:01 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 12:04:01 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: Check returncode of osmo_ss7_pointcode_parse() Message-ID: Review at https://gerrit.osmocom.org/3102 vty: Check returncode of osmo_ss7_pointcode_parse() The result of osmo_ss7_pointcode_parse() is currently not checked. This means that -EINVAL could end up as value in the pointcode configuration. Check the return code of osmo_ss7_pointcode_parse() and exit the VTY command with CMD_WARNING if the returned pointcode is < 0 Change-Id: Iae6d92b1d135063dfd0a26bc23a89802cb3b1a78 --- M src/osmo_ss7_vty.c 1 file changed, 51 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/02/3102/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 8e40474..f33303e 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -165,7 +165,11 @@ "Point Code\n") { struct osmo_ss7_instance *inst = vty->index; - uint32_t pc = osmo_ss7_pointcode_parse(inst, argv[0]); + int pc = osmo_ss7_pointcode_parse(inst, argv[0]); + if (pc < 0) { + vty_out(vty, "Invalid point code%s", VTY_NEWLINE); + return CMD_WARNING; + } inst->cfg.primary_pc = pc; return CMD_SUCCESS; @@ -271,10 +275,20 @@ { struct osmo_ss7_route_table *rtable = vty->index; struct osmo_ss7_route *rt; - uint32_t dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); - uint32_t mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); + int dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); + int mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); const char *ls_name = argv[2]; unsigned int argind; + + if (dpc < 0) { + vty_out(vty, "Invalid point code (dpc)%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if (mask < 0) { + vty_out(vty, "Invalid point code (mask)%s", VTY_NEWLINE); + return CMD_WARNING; + } rt = osmo_ss7_route_create(rtable, dpc, mask, ls_name); if (!rt) { @@ -307,8 +321,18 @@ { struct osmo_ss7_route_table *rtable = vty->index; struct osmo_ss7_route *rt; - uint32_t dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); - uint32_t mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); + int dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); + int mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); + + if (dpc < 0) { + vty_out(vty, "Invalid point code (dpc)%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if (mask < 0) { + vty_out(vty, "Invalid point code (mask)%s", VTY_NEWLINE); + return CMD_WARNING; + } rt = osmo_ss7_route_find_dpc_mask(rtable, dpc, mask); if (!rt) { @@ -770,9 +794,16 @@ struct osmo_ss7_as *as = vty->index; struct osmo_ss7_routing_key *rkey = &as->cfg.routing_key; int argind; + int pc; + pc = osmo_ss7_pointcode_parse(as->inst, argv[1]); + if (pc < 0) { + vty_out(vty, "Invalid point code%s", VTY_NEWLINE); + return CMD_WARNING; + } + + rkey->pc = pc; rkey->context = atoi(argv[0]); - rkey->pc = osmo_ss7_pointcode_parse(as->inst, argv[1]); argind = 2; if (argind < argc && !strcmp(argv[argind], "si")) { @@ -799,7 +830,11 @@ "New Point Code\n") { struct osmo_ss7_as *as = vty->index; - uint32_t pc = osmo_ss7_pointcode_parse(as->inst, argv[0]); + int pc = osmo_ss7_pointcode_parse(as->inst, argv[0]); + if (pc < 0) { + vty_out(vty, "Invalid point code%s", VTY_NEWLINE); + return CMD_WARNING; + } if (as->cfg.proto != OSMO_SS7_ASP_PROT_IPA) { vty_out(vty, "Only IPA type AS support point-code override. " @@ -1208,11 +1243,19 @@ DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, "point-code POINT_CODE", "Add point-code Number\n" "PC\n") { + int pc; struct osmo_sccp_addr_entry *entry = (struct osmo_sccp_addr_entry *)vty->index; OSMO_ASSERT(entry); + + pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + if (pc < 0) { + vty_out(vty, "Invalid point code%s", VTY_NEWLINE); + return CMD_WARNING; + } + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; - entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + entry->addr.pc = pc; return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/3102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iae6d92b1d135063dfd0a26bc23a89802cb3b1a78 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 3 12:37:23 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 12:37:23 +0000 Subject: [PATCH] libosmo-sccp[master]: move sccp_addressbook from _sg to _asp Message-ID: Review at https://gerrit.osmocom.org/3103 move sccp_addressbook from _sg to _asp The installation of the vty commands for the sccp addressbook is currently located in osmo_ss7_vty_init_sg(), but should be located in osmo_ss7_vty_init_asp() Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb --- M src/osmo_ss7_vty.c 1 file changed, 20 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/3103/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index f33303e..5e44e1b 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1633,26 +1633,6 @@ void osmo_ss7_vty_init_asp(void) { vty_init_shared(); -} - -void osmo_ss7_vty_init_sg(void) -{ - vty_init_shared(); - - install_node(&rtable_node, NULL); - vty_install_default(L_CS7_RTABLE_NODE); - install_element_ve(&show_cs7_route_cmd); - install_element(L_CS7_NODE, &cs7_route_table_cmd); - install_element(L_CS7_RTABLE_NODE, &cfg_description_cmd); - install_element(L_CS7_RTABLE_NODE, &cs7_rt_upd_cmd); - install_element(L_CS7_RTABLE_NODE, &cs7_rt_rem_cmd); - - install_node(&xua_node, NULL); - vty_install_default(L_CS7_XUA_NODE); - install_element(L_CS7_NODE, &cs7_xua_cmd); - install_element(L_CS7_NODE, &no_cs7_xua_cmd); - install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); - install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); /* Commands for SCCP-Addressbook */ install_node(&sccpaddr_node, NULL); @@ -1687,6 +1667,26 @@ install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } +void osmo_ss7_vty_init_sg(void) +{ + vty_init_shared(); + + install_node(&rtable_node, NULL); + vty_install_default(L_CS7_RTABLE_NODE); + install_element_ve(&show_cs7_route_cmd); + install_element(L_CS7_NODE, &cs7_route_table_cmd); + install_element(L_CS7_RTABLE_NODE, &cfg_description_cmd); + install_element(L_CS7_RTABLE_NODE, &cs7_rt_upd_cmd); + install_element(L_CS7_RTABLE_NODE, &cs7_rt_rem_cmd); + + install_node(&xua_node, NULL); + vty_install_default(L_CS7_XUA_NODE); + install_element(L_CS7_NODE, &cs7_xua_cmd); + install_element(L_CS7_NODE, &no_cs7_xua_cmd); + install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); + install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); +} + void osmo_ss7_set_vty_alloc_ctx(void *ctx) { g_ctx = ctx; -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 3 12:37:58 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 12:37:58 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: move sccp_addressbook from _sg to _asp In-Reply-To: References: Message-ID: vty: move sccp_addressbook from _sg to _asp The installation of the vty commands for the sccp addressbook is currently located in osmo_ss7_vty_init_sg(), but should be located in osmo_ss7_vty_init_asp() Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb --- M src/osmo_ss7_vty.c 1 file changed, 20 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/3103/2 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index f33303e..5e44e1b 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1633,26 +1633,6 @@ void osmo_ss7_vty_init_asp(void) { vty_init_shared(); -} - -void osmo_ss7_vty_init_sg(void) -{ - vty_init_shared(); - - install_node(&rtable_node, NULL); - vty_install_default(L_CS7_RTABLE_NODE); - install_element_ve(&show_cs7_route_cmd); - install_element(L_CS7_NODE, &cs7_route_table_cmd); - install_element(L_CS7_RTABLE_NODE, &cfg_description_cmd); - install_element(L_CS7_RTABLE_NODE, &cs7_rt_upd_cmd); - install_element(L_CS7_RTABLE_NODE, &cs7_rt_rem_cmd); - - install_node(&xua_node, NULL); - vty_install_default(L_CS7_XUA_NODE); - install_element(L_CS7_NODE, &cs7_xua_cmd); - install_element(L_CS7_NODE, &no_cs7_xua_cmd); - install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); - install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); /* Commands for SCCP-Addressbook */ install_node(&sccpaddr_node, NULL); @@ -1687,6 +1667,26 @@ install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } +void osmo_ss7_vty_init_sg(void) +{ + vty_init_shared(); + + install_node(&rtable_node, NULL); + vty_install_default(L_CS7_RTABLE_NODE); + install_element_ve(&show_cs7_route_cmd); + install_element(L_CS7_NODE, &cs7_route_table_cmd); + install_element(L_CS7_RTABLE_NODE, &cfg_description_cmd); + install_element(L_CS7_RTABLE_NODE, &cs7_rt_upd_cmd); + install_element(L_CS7_RTABLE_NODE, &cs7_rt_rem_cmd); + + install_node(&xua_node, NULL); + vty_install_default(L_CS7_XUA_NODE); + install_element(L_CS7_NODE, &cs7_xua_cmd); + install_element(L_CS7_NODE, &no_cs7_xua_cmd); + install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); + install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); +} + void osmo_ss7_set_vty_alloc_ctx(void *ctx) { g_ctx = ctx; -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 3 12:43:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 12:43:56 +0000 Subject: libosmo-sccp[master]: vty: move sccp_addressbook from _sg to _asp In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/3103/2//COMMIT_MSG Commit Message: Line 11: in osmo_ss7_vty_init_asp() would be good to name a reason why it should: we understand _sg to mean signalling gateway, but we also want to use the address book in application server processes like BSC and MSC. https://gerrit.osmocom.org/#/c/3103/2/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 1672: vty_init_shared(); now the _sg does not have an address book anymore? That can't be right. -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 3 12:50:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 12:50:36 +0000 Subject: libosmo-sccp[master]: vty: Check returncode of osmo_ss7_pointcode_parse() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) good, but can be improved: https://gerrit.osmocom.org/#/c/3102/1/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 170: vty_out(vty, "Invalid point code%s", VTY_NEWLINE); also log the invalid point code: argv[0]. Same below. -- To view, visit https://gerrit.osmocom.org/3102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae6d92b1d135063dfd0a26bc23a89802cb3b1a78 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 3 13:32:38 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 13:32:38 +0000 Subject: [PATCH] libosmo-sccp[master]: simple-client/server: Let user decide on which ss7 instance ... Message-ID: Review at https://gerrit.osmocom.org/3104 simple-client/server: Let user decide on which ss7 instance to bind osmo_sccp_simple_client() and osmo_sccp_simple_server() are binding on the ss7 instance with the id 1 by default. If the instance does not exist, it is created automatically. Allow the user to choose an ss7 instance by supplying the id number himself. Add two new functions: osmo_sccp_simple_client_id() osmo_sccp_simple_server_id() Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e --- M include/osmocom/sigtran/osmo_ss7.h M src/sccp_user.c 2 files changed, 36 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/04/3104/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index caf12f5..cd9dc33 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -439,11 +439,21 @@ const char *local_ip, int remote_port, const char *remote_ip); struct osmo_sccp_instance * +osmo_sccp_simple_client_id(void *ctx, uint32_t ss7_id, const char *name, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip, int remote_port, const char *remote_ip); + +struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip); struct osmo_sccp_instance * +osmo_sccp_simple_server_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip); + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, diff --git a/src/sccp_user.c b/src/sccp_user.c index 93b03f6..08709cd 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -236,9 +236,9 @@ ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip) +osmo_sccp_simple_client_id(void *ctx, uint32_t ss7_id, const char *name, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip, int remote_port, const char *remote_ip) { struct osmo_ss7_instance *ss7; struct osmo_ss7_as *as; @@ -252,7 +252,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) { LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); return NULL; @@ -309,14 +309,23 @@ return NULL; } +struct osmo_sccp_instance * +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip, int remote_port, const char *remote_ip) +{ + return osmo_sccp_simple_client_id(ctx, 1, name, pc, prot, local_port, + local_ip, remote_port, remote_ip); +} + /*********************************************************************** * Convenience function for SERVER ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_server(void *ctx, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip) +osmo_sccp_simple_server_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip) { struct osmo_ss7_instance *ss7; struct osmo_xua_server *xs; @@ -325,7 +334,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) return NULL; ss7->cfg.primary_pc = pc; @@ -350,6 +359,15 @@ } struct osmo_sccp_instance * +osmo_sccp_simple_server(void *ctx, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip) +{ + return osmo_sccp_simple_server_id(ctx, 1, pc, prot, + local_port, local_ip); +} + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, -- To view, visit https://gerrit.osmocom.org/3104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 3 13:41:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 13:41:52 +0000 Subject: libosmo-sccp[master]: simple-client/server: Let user decide on which ss7 instance ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (3 comments) functionally perfect, cosmetic tweaks suggested: https://gerrit.osmocom.org/#/c/3104/1//COMMIT_MSG Commit Message: Line 14: himself. Add two new functions: (gender neutrality is preferred. you could drop "himself") https://gerrit.osmocom.org/#/c/3104/1/include/osmocom/sigtran/osmo_ss7.h File include/osmocom/sigtran/osmo_ss7.h: Line 442: osmo_sccp_simple_client_id(void *ctx, uint32_t ss7_id, const char *name, uint32_t pc, I know that this comes from "like simple client, just with an id", but the function name reads like it returns only an ID for an existing client, instead of creating a new client on a separate entity's ID. I'd prefer "osmo_sccp_simple_client_on_ss7_id" to be unambiguous. Line 452: osmo_sccp_simple_server_id(void *ctx, uint32_t ss7_id, uint32_t pc, same -- To view, visit https://gerrit.osmocom.org/3104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 3 14:07:50 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 14:07:50 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: Check returncode of osmo_ss7_pointcode_parse() 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/3102 to look at the new patch set (#2). vty: Check returncode of osmo_ss7_pointcode_parse() The result of osmo_ss7_pointcode_parse() is currently not checked. This means that -EINVAL could end up as value in the pointcode configuration. Check the return code of osmo_ss7_pointcode_parse() and exit the VTY command with CMD_WARNING if the returned pointcode is < 0 Change-Id: Iae6d92b1d135063dfd0a26bc23a89802cb3b1a78 --- M src/osmo_ss7_vty.c 1 file changed, 51 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/02/3102/2 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 8e40474..b06f554 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -165,7 +165,11 @@ "Point Code\n") { struct osmo_ss7_instance *inst = vty->index; - uint32_t pc = osmo_ss7_pointcode_parse(inst, argv[0]); + int pc = osmo_ss7_pointcode_parse(inst, argv[0]); + if (pc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } inst->cfg.primary_pc = pc; return CMD_SUCCESS; @@ -271,10 +275,20 @@ { struct osmo_ss7_route_table *rtable = vty->index; struct osmo_ss7_route *rt; - uint32_t dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); - uint32_t mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); + int dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); + int mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); const char *ls_name = argv[2]; unsigned int argind; + + if (dpc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (mask < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } rt = osmo_ss7_route_create(rtable, dpc, mask, ls_name); if (!rt) { @@ -307,8 +321,18 @@ { struct osmo_ss7_route_table *rtable = vty->index; struct osmo_ss7_route *rt; - uint32_t dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); - uint32_t mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); + int dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); + int mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); + + if (dpc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (mask < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } rt = osmo_ss7_route_find_dpc_mask(rtable, dpc, mask); if (!rt) { @@ -770,9 +794,16 @@ struct osmo_ss7_as *as = vty->index; struct osmo_ss7_routing_key *rkey = &as->cfg.routing_key; int argind; + int pc; + pc = osmo_ss7_pointcode_parse(as->inst, argv[1]); + if (pc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + rkey->pc = pc; rkey->context = atoi(argv[0]); - rkey->pc = osmo_ss7_pointcode_parse(as->inst, argv[1]); argind = 2; if (argind < argc && !strcmp(argv[argind], "si")) { @@ -799,7 +830,11 @@ "New Point Code\n") { struct osmo_ss7_as *as = vty->index; - uint32_t pc = osmo_ss7_pointcode_parse(as->inst, argv[0]); + int pc = osmo_ss7_pointcode_parse(as->inst, argv[0]); + if (pc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } if (as->cfg.proto != OSMO_SS7_ASP_PROT_IPA) { vty_out(vty, "Only IPA type AS support point-code override. " @@ -1208,11 +1243,19 @@ DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, "point-code POINT_CODE", "Add point-code Number\n" "PC\n") { + int pc; struct osmo_sccp_addr_entry *entry = (struct osmo_sccp_addr_entry *)vty->index; OSMO_ASSERT(entry); + + pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + if (pc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; - entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + entry->addr.pc = pc; return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/3102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae6d92b1d135063dfd0a26bc23a89802cb3b1a78 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 14:07:50 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 14:07:50 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: move sccp_addressbook from _sg to _addr 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/3103 to look at the new patch set (#3). vty: move sccp_addressbook from _sg to _addr The installation of the vty commands for the sccp addressbook is currently located in osmo_ss7_vty_init_sg(), which is normally used in signalling gateway applications. It makes sense to put the addressbook feature in a separate function to be able to decide later whether the feature is needed or not. Add new function osmo_ss7_vty_init_addr() Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7_vty.c 2 files changed, 28 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/3103/3 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index caf12f5..f6bfa5d 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -456,6 +456,7 @@ /* VTY related */ struct vty; void osmo_ss7_set_vty_alloc_ctx(void *ctx); +void osmo_ss7_vty_init_addr(void); void osmo_ss7_vty_init_asp(void); void osmo_ss7_vty_init_sg(void); int osmo_ss7_vty_go_parent(struct vty *vty); diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b06f554..517caa5 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1630,31 +1630,9 @@ install_element(L_CS7_AS_NODE, &as_pc_override_cmd); } -void osmo_ss7_vty_init_asp(void) +/* Commands for SCCP-Addressbook */ +void osmo_ss7_vty_init_addr(void) { - vty_init_shared(); -} - -void osmo_ss7_vty_init_sg(void) -{ - vty_init_shared(); - - install_node(&rtable_node, NULL); - vty_install_default(L_CS7_RTABLE_NODE); - install_element_ve(&show_cs7_route_cmd); - install_element(L_CS7_NODE, &cs7_route_table_cmd); - install_element(L_CS7_RTABLE_NODE, &cfg_description_cmd); - install_element(L_CS7_RTABLE_NODE, &cs7_rt_upd_cmd); - install_element(L_CS7_RTABLE_NODE, &cs7_rt_rem_cmd); - - install_node(&xua_node, NULL); - vty_install_default(L_CS7_XUA_NODE); - install_element(L_CS7_NODE, &cs7_xua_cmd); - install_element(L_CS7_NODE, &no_cs7_xua_cmd); - install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); - install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); - - /* Commands for SCCP-Addressbook */ install_node(&sccpaddr_node, NULL); vty_install_default(L_CS7_SCCPADDR_NODE); install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); @@ -1687,6 +1665,31 @@ install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } +void osmo_ss7_vty_init_asp(void) +{ + vty_init_shared(); +} + +void osmo_ss7_vty_init_sg(void) +{ + vty_init_shared(); + + install_node(&rtable_node, NULL); + vty_install_default(L_CS7_RTABLE_NODE); + install_element_ve(&show_cs7_route_cmd); + install_element(L_CS7_NODE, &cs7_route_table_cmd); + install_element(L_CS7_RTABLE_NODE, &cfg_description_cmd); + install_element(L_CS7_RTABLE_NODE, &cs7_rt_upd_cmd); + install_element(L_CS7_RTABLE_NODE, &cs7_rt_rem_cmd); + + install_node(&xua_node, NULL); + vty_install_default(L_CS7_XUA_NODE); + install_element(L_CS7_NODE, &cs7_xua_cmd); + install_element(L_CS7_NODE, &no_cs7_xua_cmd); + install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); + install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); +} + void osmo_ss7_set_vty_alloc_ctx(void *ctx) { g_ctx = ctx; -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 14:23:14 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 14:23:14 +0000 Subject: [PATCH] libosmo-sccp[master]: simple-client/server: be able to decide on which ss7 instanc... 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/3104 to look at the new patch set (#2). simple-client/server: be able to decide on which ss7 instance to bind osmo_sccp_simple_client() and osmo_sccp_simple_server() are binding on the ss7 instance with the id 1 by default. If the instance does not exist, it is created automatically. Allow choosing the ss7 instance by supplying the id number as function parameter. Add two new functions: osmo_sccp_simple_client_id() osmo_sccp_simple_server_id() Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e --- M include/osmocom/sigtran/osmo_ss7.h M src/sccp_user.c 2 files changed, 39 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/04/3104/2 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index caf12f5..091ad4b 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -438,12 +438,22 @@ enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip, int remote_port, const char *remote_ip); +osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, + uint32_t pc, enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip, + int remote_port, const char *remote_ip); + struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip); struct osmo_sccp_instance * +osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip); + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, diff --git a/src/sccp_user.c b/src/sccp_user.c index 93b03f6..669c731 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -236,9 +236,11 @@ ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip) + +osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, + uint32_t pc, enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip, + int remote_port, const char *remote_ip) { struct osmo_ss7_instance *ss7; struct osmo_ss7_as *as; @@ -252,7 +254,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) { LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); return NULL; @@ -309,14 +311,24 @@ return NULL; } +struct osmo_sccp_instance * +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip, int remote_port, const char *remote_ip) +{ + return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, pc, prot, + local_port, local_ip, + remote_port, remote_ip); +} + /*********************************************************************** * Convenience function for SERVER ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_server(void *ctx, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip) +osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip) { struct osmo_ss7_instance *ss7; struct osmo_xua_server *xs; @@ -325,7 +337,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) return NULL; ss7->cfg.primary_pc = pc; @@ -350,6 +362,15 @@ } struct osmo_sccp_instance * +osmo_sccp_simple_server(void *ctx, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip) +{ + return osmo_sccp_simple_server_on_ss7_id(ctx, 1, pc, prot, + local_port, local_ip); +} + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, -- To view, visit https://gerrit.osmocom.org/3104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 14:27:59 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 14:27:59 +0000 Subject: [PATCH] libosmo-sccp[master]: simple-client/server: be able to decide on which ss7 instanc... 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/3104 to look at the new patch set (#3). simple-client/server: be able to decide on which ss7 instance to bind osmo_sccp_simple_client() and osmo_sccp_simple_server() are binding on the ss7 instance with the id 1 by default. If the instance does not exist, it is created automatically. Allow choosing the ss7 instance by supplying the id number as function parameter. Add two new functions: osmo_sccp_simple_client_id() osmo_sccp_simple_server_id() Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e --- M include/osmocom/sigtran/osmo_ss7.h M src/sccp_user.c 2 files changed, 39 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/04/3104/3 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index caf12f5..57a4e06 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -439,11 +439,22 @@ const char *local_ip, int remote_port, const char *remote_ip); struct osmo_sccp_instance * +osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, + uint32_t pc, enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip, + int remote_port, const char *remote_ip); + +struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip); struct osmo_sccp_instance * +osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip); + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, diff --git a/src/sccp_user.c b/src/sccp_user.c index 93b03f6..b21a756 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -236,9 +236,10 @@ ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip) +osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, + uint32_t pc, enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip, + int remote_port, const char *remote_ip) { struct osmo_ss7_instance *ss7; struct osmo_ss7_as *as; @@ -252,7 +253,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) { LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); return NULL; @@ -309,14 +310,24 @@ return NULL; } +struct osmo_sccp_instance * +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip, int remote_port, const char *remote_ip) +{ + return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, pc, prot, + local_port, local_ip, + remote_port, remote_ip); +} + /*********************************************************************** * Convenience function for SERVER ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_server(void *ctx, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip) +osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip) { struct osmo_ss7_instance *ss7; struct osmo_xua_server *xs; @@ -325,7 +336,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) return NULL; ss7->cfg.primary_pc = pc; @@ -350,6 +361,15 @@ } struct osmo_sccp_instance * +osmo_sccp_simple_server(void *ctx, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip) +{ + return osmo_sccp_simple_server_on_ss7_id(ctx, 1, pc, prot, + local_port, local_ip); +} + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, -- To view, visit https://gerrit.osmocom.org/3104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 15:04:50 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 15:04:50 +0000 Subject: [ABANDON] openbsc[master]: lchan: add members for BFI In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: lchan: add members for BFI ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 3 15:05:52 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 15:05:52 +0000 Subject: [ABANDON] osmo-bts[master]: measurement: initalize lchan properly In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: measurement: initalize lchan properly ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I02edc4724f3d272905bee13384628aca18ea9781 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 3 15:06:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 15:06:21 +0000 Subject: [ABANDON] osmo-bts[master]: octphy: record SAACH and TCH BFI In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: octphy: record SAACH and TCH BFI ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Idf044e58863aeab7239ba420b71e1676be62cacb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 3 15:27:06 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 15:27:06 +0000 Subject: [PATCH] osmo-bts[master]: octphy: do not send empty frames to phy In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3060 to look at the new patch set (#2). octphy: do not send empty frames to phy ph_data_req() and ph_tch_req() are generating empty (idle) frames when no data (msg == NULL) is available. Since the phy is able to generate idle frames internally, there is no need to waste Host CPU cycles by doing this in software. Remove the empty frame generation and exit the function cleanly. (Patch by Octasic Inc.) Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838 --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 5 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/60/3060/2 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 8b31630..c36b701 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -536,22 +536,9 @@ mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD_SWAP(data_req); } else { - /* No data available, generate Empty frame Req in l1msg */ - tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *empty_frame_req = - (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *) - msgb_put(l1msg, sizeof(*empty_frame_req)); - - l1if_fill_msg_hdr(&empty_frame_req->Header, l1msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, - cOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CID); - - empty_frame_req->TrxId.byTrxId = pinst->u.octphy.trx_id; - empty_frame_req->LchId.byTimeslotNb = u8Tn; - empty_frame_req->LchId.bySAPI = sapi; - empty_frame_req->LchId.bySubChannelNb = subCh; - empty_frame_req->LchId.byDirection = cOCTVC1_GSM_DIRECTION_ENUM_TX_BTS_MS; - empty_frame_req->ulFrameNumber = u32Fn; - - mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD_SWAP(empty_frame_req); + /* No data available, Don't send Empty frame to PHY */ + rc = 0; + goto done; } rc = l1if_req_compl(fl1h, l1msg, NULL, NULL); @@ -618,24 +605,8 @@ mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD_SWAP(data_req); } else { - tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *empty_frame_req = - (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *) - msgb_put(nmsg, sizeof(*empty_frame_req)); - - mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD_DEF(empty_frame_req); - - l1if_fill_msg_hdr(&empty_frame_req->Header, nmsg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, - cOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CID); - - empty_frame_req->TrxId.byTrxId = pinst->u.octphy.trx_id; - empty_frame_req->LchId.byTimeslotNb = u8Tn; - empty_frame_req->LchId.bySAPI = sapi; - empty_frame_req->LchId.bySubChannelNb = subCh; - empty_frame_req->LchId.byDirection = - cOCTVC1_GSM_DIRECTION_ENUM_TX_BTS_MS; - empty_frame_req->ulFrameNumber = u32Fn; - - mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD_SWAP(empty_frame_req); + /* No data available, Don't send Empty frame to PHY */ + return 0; } return l1if_req_compl(fl1h, nmsg, NULL, NULL); -- To view, visit https://gerrit.osmocom.org/3060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 3 15:28:41 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 3 Jul 2017 15:28:41 +0000 Subject: osmo-bts[master]: octphy: do not send empty frames to phy In-Reply-To: References: Message-ID: Patch Set 2: > I'd be interested why. Is the PHY going to transmit such an empty > message anyway in this case? I asked at octasic, the phy generates the idle frames internally. So this is an optimization. -- To view, visit https://gerrit.osmocom.org/3060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Jul 3 16:34:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 16:34:18 +0000 Subject: [PATCH] osmo-gsm-tester[master]: suite: Print process ending prematurely Message-ID: Review at https://gerrit.osmocom.org/3105 suite: Print process ending prematurely Change-Id: Icec476ccc536611f771dcc7872f5190bbd0572e7 --- M src/osmo_gsm_tester/suite.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/05/3105/1 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 66d06fa..c4a9abc 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -379,7 +379,7 @@ process.log_stdout_tail() process.log_stderr_tail() log.ctx(process) - raise log.Error('Process ended prematurely') + raise log.Error('Process ended prematurely: %s' % process.name()) def prompt(self, *msgs, **msg_details): 'ask for user interaction. Do not use in tests that should run automatically!' -- To view, visit https://gerrit.osmocom.org/3105 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icec476ccc536611f771dcc7872f5190bbd0572e7 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 Jul 3 16:51:44 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 3 Jul 2017 16:51:44 +0000 Subject: [PATCH] osmo-pcu[master]: Copy sysmopcu.service to osmo-pcu Message-ID: Review at https://gerrit.osmocom.org/3106 Copy sysmopcu.service to osmo-pcu This way the name of systemd service file will match the name of the binary similar to OsmoBTS. Add aliases so the user can use both old and new names regardless of which file is installed. Once the corresponding changes to OE recipes are applied old file can be removed. Based on work by Pau Espin Pedrol Change-Id: I2ca6f6c486bd6fcf4d5b3d0a05d25dc04f020c26 --- A contrib/osmo-pcu.service M contrib/sysmopcu.service 2 files changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/3106/1 diff --git a/contrib/osmo-pcu.service b/contrib/osmo-pcu.service new file mode 100644 index 0000000..3066a66 --- /dev/null +++ b/contrib/osmo-pcu.service @@ -0,0 +1,17 @@ +[Unit] +Description=sysmocom sysmoPCU + +[Service] +Type=simple +ExecStart=/usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg +Restart=always +RestartSec=2 +RestartPreventExitStatus=1 + +# The msg queues must be read fast enough +CPUSchedulingPolicy=rr +CPUSchedulingPriority=1 + +[Install] +WantedBy=multi-user.target +Alias=sysmopcu.service diff --git a/contrib/sysmopcu.service b/contrib/sysmopcu.service index 3e3ff07..df8c47e 100644 --- a/contrib/sysmopcu.service +++ b/contrib/sysmopcu.service @@ -14,3 +14,4 @@ [Install] WantedBy=multi-user.target +Alias=osmo-pcu.service -- To view, visit https://gerrit.osmocom.org/3106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2ca6f6c486bd6fcf4d5b3d0a05d25dc04f020c26 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jul 3 16:55:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 16:55:16 +0000 Subject: osmo-pcu[master]: Copy sysmopcu.service to osmo-pcu In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ca6f6c486bd6fcf4d5b3d0a05d25dc04f020c26 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:05:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 3 Jul 2017 17:05:42 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: use proper systemd service name Message-ID: Review at https://gerrit.osmocom.org/3107 OsmoGSMTester: use proper systemd service name Use osmo-bts-sysmo for sysmoBTS systemd service name which is available since 114293a414bd5b7c86622ec8c293c4034c80d243 in OsmoBTS. Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/07/3107/1 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index b703498..4f81892 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -531,7 +531,7 @@ be disabled: ---- -systemctl mask osmo-nitb sysmobts sysmopcu sysmobts-mgr +systemctl mask osmo-nitb osmo-bts-sysmo sysmopcu sysmobts-mgr ---- This stops the stock setup keeping the BTS in operation and hence allows the -- To view, visit https://gerrit.osmocom.org/3107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:07:31 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 3 Jul 2017 17:07:31 +0000 Subject: osmo-gsm-manuals[master]: OsmoGSMTester: use proper systemd service name In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3107/1/OsmoGSMTester/chapters/install.adoc File OsmoGSMTester/chapters/install.adoc: Line 534: systemctl mask osmo-nitb osmo-bts-sysmo sysmopcu sysmobts-mgr I'd change sysmopcu->osmo-pcu-sysmo to on the same commit -- To view, visit https://gerrit.osmocom.org/3107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:08:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 3 Jul 2017 17:08:16 +0000 Subject: osmo-gsm-manuals[master]: OsmoGSMTester: use proper systemd service name In-Reply-To: References: Message-ID: Patch Set 1: Make sense - let's wait till 3106 is merged. -- To view, visit https://gerrit.osmocom.org/3107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:22:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 17:22:31 +0000 Subject: osmo-gsm-tester[master]: suite: Use event_loop.poll in interactive poll In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06fe9a78d702ebb05c4ece78e14fcae9e2e74ee2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:22:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 17:22:34 +0000 Subject: [MERGED] osmo-gsm-tester[master]: suite: Use event_loop.poll in interactive poll In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: suite: Use event_loop.poll in interactive poll ...................................................................... suite: Use event_loop.poll in interactive poll This way we also poll dbus events from ofono_client Change-Id: I06fe9a78d702ebb05c4ece78e14fcae9e2e74ee2 --- M src/osmo_gsm_tester/suite.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 71b8dc7..66d06fa 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -394,7 +394,7 @@ sys.__stdout__.write(msg) sys.__stdout__.write('\n') sys.__stdout__.flush() - entered = util.input_polling('> ', self.poll) + entered = util.input_polling('> ', event_loop.poll) self.log('prompt entered:', repr(entered)) return entered -- To view, visit https://gerrit.osmocom.org/3101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06fe9a78d702ebb05c4ece78e14fcae9e2e74ee2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:23:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 17:23:11 +0000 Subject: osmo-gsm-tester[master]: suite: Print process ending prematurely In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3105 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icec476ccc536611f771dcc7872f5190bbd0572e7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:23:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 17:23:14 +0000 Subject: [MERGED] osmo-gsm-tester[master]: suite: Print process ending prematurely In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: suite: Print process ending prematurely ...................................................................... suite: Print process ending prematurely Change-Id: Icec476ccc536611f771dcc7872f5190bbd0572e7 --- M src/osmo_gsm_tester/suite.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 66d06fa..c4a9abc 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -379,7 +379,7 @@ process.log_stdout_tail() process.log_stderr_tail() log.ctx(process) - raise log.Error('Process ended prematurely') + raise log.Error('Process ended prematurely: %s' % process.name()) def prompt(self, *msgs, **msg_details): 'ask for user interaction. Do not use in tests that should run automatically!' -- To view, visit https://gerrit.osmocom.org/3105 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icec476ccc536611f771dcc7872f5190bbd0572e7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:27:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 17:27:49 +0000 Subject: osmo-bts[master]: Use osmo_dump_gsmtime In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3100/1//COMMIT_MSG Commit Message: Line 7: Use osmo_dump_gsmtime (I think this should say "move dump_gsmtime to libosmocore as osmo_dump_gsmtime"?) -- To view, visit https://gerrit.osmocom.org/3100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:28:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 17:28:54 +0000 Subject: [ABANDON] libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: osmo_sock_get_name(): clearly indicate local and remote ...................................................................... Abandoned for benefit of #3000 -- To view, visit https://gerrit.osmocom.org/3001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Id3e32de19fe07ed5b19ee5e67494926a511266b5 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 17:29:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 17:29:06 +0000 Subject: [MERGED] libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo_sock_get_name(): clearly indicate local and remote ...................................................................... osmo_sock_get_name(): clearly indicate local and remote In a string like 127.0.0.1:2905<->127.0.0.1:60661 it is hard to tell which is the local part. I'd have expected it on the left, but it is actually on the right. To avoid doubt and bypass bikesheds on which side should be what, clearly mark the two sides as remote and local. (r=127.0.0.1:2905<->l=127.0.0.1:60661) Change-Id: I43dcc6a1906429bd0955fd7fe2eb5b8495b592d8 --- M src/socket.c M tests/socket/socket_test.c 2 files changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/socket.c b/src/socket.c index b74edd4..28d9b1c 100644 --- a/src/socket.c +++ b/src/socket.c @@ -607,11 +607,11 @@ if (rc < 0) goto local_only; - return talloc_asprintf(ctx, "(%s:%s<->%s:%s)", hostbuf_r, portbuf_r, + return talloc_asprintf(ctx, "(r=%s:%s<->l=%s:%s)", hostbuf_r, portbuf_r, hostbuf_l, portbuf_l); local_only: - return talloc_asprintf(ctx, "(NULL<->%s:%s)", hostbuf_l, portbuf_l); + return talloc_asprintf(ctx, "(r=NULL<->l=%s:%s)", hostbuf_l, portbuf_l); } #endif /* HAVE_SYS_SOCKET_H */ diff --git a/tests/socket/socket_test.c b/tests/socket/socket_test.c index b56d50c..11ef8da 100644 --- a/tests/socket/socket_test.c +++ b/tests/socket/socket_test.c @@ -49,7 +49,7 @@ * as apparently that won't work on FreeBSD if there's only one * address (e.g. 127.0.0.1) assigned to the entire system, like * the Osmocom FreeBSD build slaves */ - OSMO_ASSERT(!strncmp(name, "(NULL<->", 7)); + OSMO_ASSERT(!strncmp(name, "(r=NULL<->", 9)); talloc_free(name); /* expect it to be blocking */ rc = fcntl(fd, F_GETFL); @@ -87,7 +87,7 @@ * as apparently that won't work on FreeBSD if there's only one * address (e.g. 127.0.0.1) assigned to the entire system, like * the Osmocom FreeBSD build slaves */ - OSMO_ASSERT(!strncmp(name, "(NULL<->", 7)); + OSMO_ASSERT(!strncmp(name, "(r=NULL<->", 9)); talloc_free(name); /* expect it to be blocking */ rc = fcntl(fd, F_GETFL); @@ -116,7 +116,7 @@ /* For some reason, on the jenkins.osmocom.org build slave with * FreeBSD 10 inside a jail, it fails. Works fine on laforge's * FreeBSD 10 or 11 VM at home */ - OSMO_ASSERT(!strncmp(name, "(127.0.0.1:53<->127.0.0.1", 25)); + OSMO_ASSERT(!strncmp(name, "(r=127.0.0.1:53<->l=127.0.0.1", 29)); #endif talloc_free(name); -- To view, visit https://gerrit.osmocom.org/3000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43dcc6a1906429bd0955fd7fe2eb5b8495b592d8 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 Mon Jul 3 20:49:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 20:49:20 +0000 Subject: [PATCH] osmo-iuh[master]: cosmetic: move callers' common switch() into rua_to_scu() Message-ID: Review at https://gerrit.osmocom.org/3108 cosmetic: move callers' common switch() into rua_to_scu() Change-Id: If6274e3738dc04646d0dc18332c12237e6910d18 --- M src/hnbgw_rua.c 1 file changed, 25 insertions(+), 57 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/08/3108/1 diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 47d33f0..6190fd0 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -37,6 +37,7 @@ #include #include #include +#include static int hnbgw_rua_tx(struct hnb_context *ctx, struct msgb *msg) { @@ -159,16 +160,31 @@ -/* forward a RUA message to the SCCP User API to SCCP/SUA */ -static int rua_to_scu(struct hnb_context *hnb, struct hnbgw_cnlink *cn, +/* forward a RUA message to the SCCP User API to SCCP */ +static int rua_to_scu(struct hnb_context *hnb, + CN_DomainIndicator_t cN_DomainIndicator, enum osmo_scu_prim_type type, uint32_t context_id, uint32_t cause, const uint8_t *data, unsigned int len) { - struct msgb *msg = msgb_alloc(1500, "rua_to_sua"); + struct msgb *msg; struct osmo_scu_prim *prim; struct hnbgw_context_map *map; + struct hnbgw_cnlink *cn; int rc; + + switch (cN_DomainIndicator) { + case RUA_CN_DomainIndicator_cs_domain: + cn = hnb->gw->cnlink_cs; + break; + case RUA_CN_DomainIndicator_ps_domain: + cn = hnb->gw->cnlink_ps; + break; + default: + LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n", + cN_DomainIndicator); + return -1; + } if (!cn) { DEBUGP(DRUA, "CN=NULL, discarding message\n"); @@ -280,7 +296,6 @@ { RUA_ConnectIEs_t ies; struct hnb_context *hnb = msg->dst; - struct hnbgw_cnlink *cn; uint32_t context_id; int rc; @@ -290,26 +305,11 @@ context_id = asn1bitstr_to_u24(&ies.context_ID); - /* route to CS (MSC) or PS (SGSN) domain */ - switch (ies.cN_DomainIndicator) { - case RUA_CN_DomainIndicator_cs_domain: - cn = hnb->gw->cnlink_cs; - break; - case RUA_CN_DomainIndicator_ps_domain: - cn = hnb->gw->cnlink_ps; - break; - default: - LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n", - ies.cN_DomainIndicator); - rua_free_connecties(&ies); - return -1; - } - DEBUGP(DRUA, "RUA Connect.req(ctx=0x%x, %s)\n", context_id, ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal"); - rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_CONNECT, + rc = rua_to_scu(hnb, ies.cN_DomainIndicator, OSMO_SCU_PRIM_N_CONNECT, context_id, 0, ies.ranaP_Message.buf, ies.ranaP_Message.size); /* FIXME: what to do with the asn1c-allocated memory */ @@ -322,7 +322,6 @@ { RUA_DisconnectIEs_t ies; struct hnb_context *hnb = msg->dst; - struct hnbgw_cnlink *cn; uint32_t context_id; uint32_t scu_cause; uint8_t *ranap_data = NULL; @@ -339,30 +338,15 @@ DEBUGP(DRUA, "RUA Disconnect.req(ctx=0x%x,cause=%s)\n", context_id, rua_cause_str(&ies.cause)); - /* route to CS (MSC) or PS (SGSN) domain */ - switch (ies.cN_DomainIndicator) { - case RUA_CN_DomainIndicator_cs_domain: - cn = hnb->gw->cnlink_cs; - break; - case RUA_CN_DomainIndicator_ps_domain: - cn = hnb->gw->cnlink_ps; - break; - default: - LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %l\n", - ies.cN_DomainIndicator); - rc = -1; - goto error_free; - } - if (ies.presenceMask & DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT) { ranap_data = ies.ranaP_Message.buf; ranap_len = ies.ranaP_Message.size; } - rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DISCONNECT, + rc = rua_to_scu(hnb, ies.cN_DomainIndicator, + OSMO_SCU_PRIM_N_DISCONNECT, context_id, scu_cause, ranap_data, ranap_len); -error_free: /* FIXME: what to do with the asn1c-allocated memory */ rua_free_disconnecties(&ies); @@ -373,7 +357,6 @@ { RUA_DirectTransferIEs_t ies; struct hnb_context *hnb = msg->dst; - struct hnbgw_cnlink *cn; uint32_t context_id; int rc; @@ -385,31 +368,16 @@ DEBUGP(DRUA, "RUA Data.req(ctx=0x%x)\n", context_id); - /* route to CS (MSC) or PS (SGSN) domain */ - switch (ies.cN_DomainIndicator) { - case RUA_CN_DomainIndicator_cs_domain: - cn = hnb->gw->cnlink_cs; - break; - case RUA_CN_DomainIndicator_ps_domain: - cn = hnb->gw->cnlink_ps; - break; - default: - LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %l\n", - ies.cN_DomainIndicator); - rc = -1; - goto error_free; - } - - rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DATA, + rc = rua_to_scu(hnb, + ies.cN_DomainIndicator, + OSMO_SCU_PRIM_N_DATA, context_id, 0, ies.ranaP_Message.buf, ies.ranaP_Message.size); -error_free: /* FIXME: what to do with the asn1c-allocated memory */ rua_free_directtransferies(&ies); return rc; - } static int rua_rx_init_udt(struct msgb *msg, ANY_t *in) -- To view, visit https://gerrit.osmocom.org/3108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6274e3738dc04646d0dc18332c12237e6910d18 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 20:49:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 20:49:20 +0000 Subject: [PATCH] osmo-iuh[master]: migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA Message-ID: Review at https://gerrit.osmocom.org/3109 migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA libosmo-sigtran now has a "proper" SCCP/M3UA stack, so we can make our hnb-gw 3GPP compliant by switching from the old SUA code to the new universal SCCP user API with support for (currently) M3UA and SUA. Main changes: Use one cn_link to STP: We will connect to the core network using an (Osmo)STP instance that routes to MSC and SGSN, so we want one SCCP link instead of two. The only difference between IuCS and IuPS is a different remote osmo_sccp_addr. This has various effects through the messaging code; the patch is a bit larger than I would like, but it is hard to separate out truly independent smaller changes. CS or PS domain was previously flagged in the separate cn_link, as ctx pointer for two separate sccp_sap_up()s. Now there's just one such ctx, so determine is_ps from the RANAP Domain Indicator, or from the conn's hnbgw_context_map: - Add is_ps to context_map_alloc_by_hnb(). - To find a matching context, the RUA ID alone is no longer sufficient, also match is_ps (possible optimization todo: separate lists). We would send separate CS or PS Reset messages based on the cn_link, instead send both CS and PS Reset at the same time for the single cn_link. This could be adjusted to detect presence of MSC or SGSN instead. Pending: adjust the VTY config to reflect that there is only one remote address. Place a TODO comment for that. Smaller changes: rua_to_scu(): populate called and calling addresses for N_CONNECT and N_UNITDATA. Remove DSUA. Don't build dummy_cn, which is still implemented on SUA. Mark todo to maybe re-include it based on M3UA later. In hnbgw_cnlink, place sccp related items in a separate sub-struct. Do not keep an llist of cn_links, just have the one. Remove iteration and list management. Patch-by: hwelte, nhofmeyr Change-Id: I8ac15fa2fd25bedb26297177e416976a5389b573 --- M include/osmocom/iuh/context_map.h M include/osmocom/iuh/hnbgw.h M include/osmocom/iuh/hnbgw_cn.h M src/context_map.c M src/hnbgw.c M src/hnbgw_cn.c M src/hnbgw_rua.c M src/tests/Makefile.am M src/tests/test_common.c 9 files changed, 132 insertions(+), 133 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/09/3109/1 diff --git a/include/osmocom/iuh/context_map.h b/include/osmocom/iuh/context_map.h index c1a4495..8d957d6 100644 --- a/include/osmocom/iuh/context_map.h +++ b/include/osmocom/iuh/context_map.h @@ -24,6 +24,8 @@ struct hnbgw_cnlink *cn_link; /* RUA contxt ID */ uint32_t rua_ctx_id; + /* False for CS, true for PS */ + bool is_ps; /* SCCP User SAP connection ID */ uint32_t scu_conn_id; @@ -33,6 +35,7 @@ struct hnbgw_context_map * context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id, + bool is_ps, struct hnbgw_cnlink *cn_if_new); struct hnbgw_context_map * diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index 4880d48..db22d97 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -5,6 +5,7 @@ #include #include #include +#include #define DEBUG #include @@ -13,15 +14,16 @@ enum { DMAIN, DHNBAP, - DSUA, DRUA, DRANAP, }; #define HNBGW_LOCAL_IP_DEFAULT "0.0.0.0" +/* TODO: CS and PS now both connect to OsmoSTP, i.e. that's always going to be the same address. Drop the + * duplicity. */ #define HNBGW_IUCS_REMOTE_IP_DEFAULT "127.0.0.1" -#define HNBGW_IUPS_REMOTE_IP_DEFAULT "127.0.0.2" +#define HNBGW_IUPS_REMOTE_IP_DEFAULT "127.0.0.1" /* 25.467 Section 7.1 */ #define IUH_DEFAULT_SCTP_PORT 29169 @@ -63,15 +65,11 @@ struct llist_head list; enum hnbgw_cnlink_state state; struct hnb_gw *gw; - /* are we a PS connection (1) or CS (0) */ - int is_ps; /* timer for re-transmitting the RANAP Reset */ struct osmo_timer_list T_RafC; /* reference to the SCCP User SAP by which we communicate */ - struct osmo_sccp_user *sua_user; - struct osmo_sccp_link *sua_link; - struct osmo_sccp_addr local_addr; - struct osmo_sccp_addr remote_addr; + struct osmo_sccp_instance *sccp; + struct osmo_sccp_user *sccp_user; uint32_t next_conn_id; /* linked list of hnbgw_context_map */ @@ -131,14 +129,17 @@ struct llist_head hnb_list; /* list of struct ue_context */ struct llist_head ue_list; - /* list of struct hnbgw_cnlink */ - struct llist_head cn_list; /* next availble UE Context ID */ uint32_t next_ue_ctx_id; /* currently active CN links for CS and PS */ - struct hnbgw_cnlink *cnlink_cs; - struct hnbgw_cnlink *cnlink_ps; + struct { + struct osmo_sccp_instance *instance; + struct hnbgw_cnlink *cnlink; + struct osmo_sccp_addr local_addr; + struct osmo_sccp_addr remote_addr_cs; + struct osmo_sccp_addr remote_addr_ps; + } sccp; }; extern void *talloc_asn1_ctx; diff --git a/include/osmocom/iuh/hnbgw_cn.h b/include/osmocom/iuh/hnbgw_cn.h index d5bec04..93123f2 100644 --- a/include/osmocom/iuh/hnbgw_cn.h +++ b/include/osmocom/iuh/hnbgw_cn.h @@ -2,4 +2,5 @@ #include -struct hnbgw_cnlink *hnbgw_cnlink_init(struct hnb_gw *gw, const char *host, uint16_t port, int is_ps); +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, + const char *local_ip, uint32_t local_pc); diff --git a/src/context_map.c b/src/context_map.c index 052133c..0960cb9 100644 --- a/src/context_map.c +++ b/src/context_map.c @@ -58,6 +58,7 @@ /* Map from a HNB + ContextID to the SCCP-side Connection ID */ struct hnbgw_context_map * context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id, + bool is_ps, struct hnbgw_cnlink *cn_if_new) { struct hnbgw_context_map *map; @@ -69,7 +70,8 @@ if (map->cn_link != cn_if_new) { continue; } - if (map->rua_ctx_id == rua_ctx_id) { + if (map->rua_ctx_id == rua_ctx_id + && map->is_ps == is_ps) { return map; } } @@ -88,6 +90,7 @@ map->cn_link = cn_if_new; map->hnb_ctx = hnb; map->rua_ctx_id = rua_ctx_id; + map->is_ps = is_ps; map->scu_conn_id = new_scu_conn_id; /* put it into both lists */ @@ -134,31 +137,27 @@ static void context_map_tmr_cb(void *data) { struct hnb_gw *gw = data; - struct hnbgw_cnlink *cn; + struct hnbgw_cnlink *cn = gw->sccp.cnlink; + struct hnbgw_context_map *map; DEBUGP(DMAIN, "Running context mapper garbage collection\n"); - /* iterate over list of core network (links) */ - llist_for_each_entry(cn, &gw->cn_list, list) { - struct hnbgw_context_map *map; - - llist_for_each_entry(map, &cn->map_list, cn_list) { - switch (map->state) { - case MAP_S_RESERVED1: - /* first time we see this reserved - * entry: mark it for stage 2 */ - map->state = MAP_S_RESERVED2; - break; - case MAP_S_RESERVED2: - /* first time we see this reserved - * entry: remove it */ - map->state = MAP_S_NULL; - llist_del(&map->cn_list); - llist_del(&map->hnb_list); - talloc_free(map); - break; - default: - break; - } + llist_for_each_entry(map, &cn->map_list, cn_list) { + switch (map->state) { + case MAP_S_RESERVED1: + /* first time we see this reserved + * entry: mark it for stage 2 */ + map->state = MAP_S_RESERVED2; + break; + case MAP_S_RESERVED2: + /* first time we see this reserved + * entry: remove it */ + map->state = MAP_S_NULL; + llist_del(&map->cn_list); + llist_del(&map->hnb_list); + talloc_free(map); + break; + default: + break; } } /* re-schedule this timer */ diff --git a/src/hnbgw.c b/src/hnbgw.c index 9984927..5d9f87b 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -47,8 +47,7 @@ #include -#include -#include +#include #include #include @@ -82,16 +81,15 @@ gw->config.iucs_remote_ip = talloc_strdup(gw, HNBGW_IUCS_REMOTE_IP_DEFAULT); - gw->config.iucs_remote_port = SUA_PORT; + gw->config.iucs_remote_port = M3UA_PORT; gw->config.iups_remote_ip = talloc_strdup(gw, HNBGW_IUPS_REMOTE_IP_DEFAULT); - gw->config.iups_remote_port = SUA_PORT; + gw->config.iups_remote_port = M3UA_PORT; gw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&gw->hnb_list); INIT_LLIST_HEAD(&gw->ue_list); - INIT_LLIST_HEAD(&gw->cn_list); context_map_init(gw); @@ -330,11 +328,6 @@ .color = "", .description = "Home Node B Application Part", }, - [DSUA] = { - .name = "DSUA", .loglevel = LOGL_DEBUG, .enabled = 1, - .color = "", - .description = "SCCP User Adaptation", - }, [DRUA] = { .name = "DRUA", .loglevel = LOGL_DEBUG, .enabled = 1, .color = "", @@ -382,7 +375,7 @@ static void print_help() { printf(" -h --help This text.\n"); - printf(" -d option --debug=DHNBAP:DSUA:DRUA:DRANAP:DMAIN Enable debugging.\n"); + printf(" -d option --debug=DHNBAP:DRUA:DRANAP:DMAIN 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"); @@ -451,7 +444,7 @@ int main(int argc, char **argv) { - struct osmo_sccp_user *sua_user; + struct osmo_sccp_user *sccp_user; struct osmo_sccp_link *sua_link; struct osmo_stream_srv_link *srv; int rc; @@ -466,6 +459,8 @@ rc = osmo_init_logging(&hnbgw_log_info); if (rc < 0) exit(1); + + osmo_ss7_init(); vty_info.copyright = osmo_hnbgw_copyright; vty_init(&vty_info); @@ -504,19 +499,25 @@ exit(1); } - osmo_sua_set_log_area(DSUA); ranap_set_log_area(DRANAP); OSMO_ASSERT(g_hnb_gw->config.iucs_remote_ip); - g_hnb_gw->cnlink_cs = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iucs_remote_ip, - g_hnb_gw->config.iucs_remote_port, - 0); - OSMO_ASSERT(g_hnb_gw->config.iups_remote_ip); - g_hnb_gw->cnlink_ps = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iups_remote_ip, - g_hnb_gw->config.iups_remote_port, - 1); + rc = hnbgw_cnlink_init(g_hnb_gw, + g_hnb_gw->config.iucs_remote_ip, + g_hnb_gw->config.iucs_remote_port, + "127.0.0.5" /* FIXME: configurable */, + 23 /* FIXME: configurable */); + if (rc < 0) { + LOGP(DMAIN, LOGL_ERROR, "Failed to initialize SCCP link to CN\n"); + exit(1); + } + + osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_cs, + 1 /* FIXME: configurable */, + OSMO_SCCP_SSN_RANAP); + osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_ps, + 2 /* FIXME: configurable */, + OSMO_SCCP_SSN_RANAP); OSMO_ASSERT(g_hnb_gw->config.iuh_local_ip); LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n", diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 4e5b2e0..2fd9d71 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -24,8 +24,7 @@ #include #include -#include -#include +#include #include #include @@ -41,34 +40,32 @@ int hnbgw_cnlink_change_state(struct hnbgw_cnlink *cnlink, enum hnbgw_cnlink_state state); -static int transmit_rst(struct hnbgw_cnlink *cnlink) +static int transmit_rst(struct hnb_gw *gw, RANAP_CN_DomainIndicator_t domain, + struct osmo_sccp_addr *remote_addr) { struct msgb *msg; struct msgb *msgprim; - RANAP_CN_DomainIndicator_t domain; RANAP_Cause_t cause = { .present = RANAP_Cause_PR_transmissionNetwork, .choice. transmissionNetwork = RANAP_CauseTransmissionNetwork_signalling_transport_resource_failure, }; - if (cnlink->is_ps) - domain = RANAP_CN_DomainIndicator_ps_domain; - else - domain = RANAP_CN_DomainIndicator_cs_domain; - msg = ranap_new_msg_reset(domain, &cause); - return osmo_sccp_tx_unitdata_msg(cnlink->sua_link, &cnlink->local_addr, - &cnlink->remote_addr, msg); + return osmo_sccp_tx_unitdata_msg(gw->sccp.cnlink->sccp_user, + &gw->sccp.local_addr, + remote_addr, + msg); } /* Timer callback once T_RafC expires */ static void cnlink_trafc_cb(void *data) { - struct hnbgw_cnlink *cnlink = data; + struct hnb_gw *gw = data; - transmit_rst(cnlink); - hnbgw_cnlink_change_state(cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); + transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.remote_addr_cs); + transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.remote_addr_ps); + hnbgw_cnlink_change_state(gw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); /* The spec states that we should abandon after a configurable * number of times. We decide to simply continue trying */ } @@ -81,7 +78,7 @@ case CNLINK_S_EST_PEND: break; case CNLINK_S_EST_CONF: - cnlink_trafc_cb(cnlink); + cnlink_trafc_cb(cnlink->gw); break; case CNLINK_S_EST_RST_TX_WAIT_ACK: osmo_timer_schedule(&cnlink->T_RafC, 5, 0); @@ -293,7 +290,7 @@ return 0; } - return rua_tx_dt(map->hnb_ctx, map->cn_link->is_ps, map->rua_ctx_id, + return rua_tx_dt(map->hnb_ctx, map->is_ps, map->rua_ctx_id, msgb_l2(oph->msg), msgb_l2len(oph->msg)); } @@ -322,15 +319,15 @@ return 0; } - return rua_tx_disc(map->hnb_ctx, map->cn_link->is_ps, map->rua_ctx_id, + return rua_tx_disc(map->hnb_ctx, map->is_ps, map->rua_ctx_id, &rua_cause, msgb_l2(oph->msg), msgb_l2len(oph->msg)); } /* Entry point for primitives coming up from SCCP User SAP */ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *ctx) { - struct osmo_sccp_link *slink = ctx; - struct hnbgw_cnlink *cnlink = osmo_sccp_link_get_user_priv(slink); + struct osmo_sccp_user *scu = ctx; + struct hnbgw_cnlink *cnlink = osmo_sccp_user_get_priv(scu); struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; int rc; @@ -361,53 +358,48 @@ return 0; } - -/* Set up a link towards the core network for the circuit switched (is_ps == 0) - * or packet switched (is_ps != 0) domain. */ -struct hnbgw_cnlink *hnbgw_cnlink_init(struct hnb_gw *gw, const char *host, uint16_t port, int is_ps) +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, + const char *local_ip, uint32_t local_pc) { - struct hnbgw_cnlink *cnlink = talloc_zero(gw, struct hnbgw_cnlink); + struct hnbgw_cnlink *cnlink; int rc; + OSMO_ASSERT(!gw->sccp.instance); + OSMO_ASSERT(!gw->sccp.cnlink); + + gw->sccp.instance = osmo_sccp_simple_client(gw, "OsmoHNBGW", local_pc, + OSMO_SS7_ASP_PROT_M3UA, 0, local_ip, + stp_port, stp_host); + if (!gw->sccp.instance) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Instance\n"); + return -1; + } + + LOGP(DRUA, LOGL_DEBUG, "SCCP uplink to STP: %s %u\n", stp_host, stp_port); + + osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, + OSMO_SCCP_SSN_RANAP); + + cnlink = talloc_zero(gw, struct hnbgw_cnlink); cnlink->gw = gw; INIT_LLIST_HEAD(&cnlink->map_list); cnlink->T_RafC.cb = cnlink_trafc_cb; - cnlink->T_RafC.data = cnlink; + cnlink->T_RafC.data = gw; cnlink->next_conn_id = 1000; - cnlink->is_ps = is_ps; - osmo_sccp_make_addr_pc_ssn(&cnlink->local_addr, 2, - OSMO_SCCP_SSN_RANAP); - osmo_sccp_make_addr_pc_ssn(&cnlink->remote_addr, 1, - OSMO_SCCP_SSN_RANAP); - LOGP(DRUA, LOGL_DEBUG, "New hnbgw_cnlink %p (gw %p): %s %d %s\n", - cnlink, cnlink->gw, host, port, is_ps? "PS" : "CS"); - - cnlink->sua_user = osmo_sua_user_create(cnlink, sccp_sap_up, cnlink); - if (!cnlink->sua_user) { - LOGP(DMAIN, LOGL_ERROR, "Failed to init SUA\n"); - goto out_free; - } - rc = osmo_sua_client_connect(cnlink->sua_user, host, port); - if (rc < 0) { - LOGP(DMAIN, LOGL_ERROR, "Failed to connect SUA\n"); - goto out_user; - } - cnlink->sua_link = osmo_sua_client_get_link(cnlink->sua_user); - if (!cnlink->sua_link) { - LOGP(DMAIN, LOGL_ERROR, "Failed to get SUA link\n"); - goto out_disconnect; + cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.instance, + "OsmoHNBGW", + sccp_sap_up, OSMO_SCCP_SSN_RANAP, + gw->sccp.local_addr.pc); + if (!cnlink->sccp_user) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP User\n"); + return -1; } - llist_add_tail(&cnlink->list, &gw->cn_list); + /* In sccp_sap_up() we expect the cnlink in the user's priv. */ + osmo_sccp_user_set_priv(cnlink->sccp_user, cnlink); - return cnlink; + gw->sccp.cnlink = cnlink; -out_disconnect: - /* FIXME */ -out_user: - osmo_sua_user_destroy(cnlink->sua_user); -out_free: - talloc_free(cnlink); - return NULL; + return 0; } diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 6190fd0..329f990 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -170,15 +169,19 @@ struct msgb *msg; struct osmo_scu_prim *prim; struct hnbgw_context_map *map; - struct hnbgw_cnlink *cn; + struct hnbgw_cnlink *cn = hnb->gw->sccp.cnlink; + struct osmo_sccp_addr *remote_addr; + bool is_ps; int rc; switch (cN_DomainIndicator) { case RUA_CN_DomainIndicator_cs_domain: - cn = hnb->gw->cnlink_cs; + remote_addr = &hnb->gw->sccp.remote_addr_cs; + is_ps = false; break; case RUA_CN_DomainIndicator_ps_domain: - cn = hnb->gw->cnlink_ps; + remote_addr = &hnb->gw->sccp.remote_addr_ps; + is_ps = true; break; default: LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n", @@ -191,16 +194,19 @@ return 0; } + msg = msgb_alloc(1500, "rua_to_sccp"); + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); osmo_prim_init(&prim->oph, SCCP_SAP_USER, type, PRIM_OP_REQUEST, msg); - map = context_map_alloc_by_hnb(hnb, context_id, cn); + map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn); + OSMO_ASSERT(map); /* add primitive header */ switch (type) { case OSMO_SCU_PRIM_N_CONNECT: - prim->u.connect.called_addr; - prim->u.connect.calling_addr; + prim->u.connect.called_addr = *remote_addr; + prim->u.connect.calling_addr = cn->gw->sccp.local_addr; prim->u.connect.sccp_class = 2; prim->u.connect.conn_id = map->scu_conn_id; break; @@ -212,8 +218,8 @@ prim->u.disconnect.cause = cause; break; case OSMO_SCU_PRIM_N_UNITDATA: - prim->u.unitdata.called_addr; - prim->u.unitdata.calling_addr; + prim->u.unitdata.called_addr = *remote_addr; + prim->u.unitdata.calling_addr = cn->gw->sccp.local_addr; break; default: return -EINVAL; @@ -225,7 +231,7 @@ memcpy(msg->l2h, data, len); } - rc = osmo_sua_user_link_down(cn->sua_link, &prim->oph); + rc = osmo_sccp_user_sap_down(cn->sccp_user, &prim->oph); return rc; } diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index e2bea07..28ad56c 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -5,7 +5,7 @@ COMMON_LIBS = $(OSMOVTY_LIBS) $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) -lsctp -check_PROGRAMS = test-ranap test-helpers test-hnbap hnb-test dummy-cn +check_PROGRAMS = test-ranap test-helpers test-hnbap hnb-test #dummy-cn noinst_HEADERS = test_common.h hnb-test.h hnb-test-layers.h @@ -24,8 +24,9 @@ test_ranap_SOURCES = $(RANAP_FILES) test-ranap.c test_common.c test_ranap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la -dummy_cn_SOURCES = $(RANAP_FILES) test_common.c dummy_cn_sua.c -dummy_cn_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la +# TODO: re-add using SCCP? +#dummy_cn_SOURCES = $(RANAP_FILES) test_common.c dummy_cn_sua.c +#dummy_cn_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la $(top_builddir)/src/libosmo-ranap.la: $(MAKE) -C $(top_builddir)/src libosmo-ranap.la diff --git a/src/tests/test_common.c b/src/tests/test_common.c index ba00709..c8aafdd 100644 --- a/src/tests/test_common.c +++ b/src/tests/test_common.c @@ -62,11 +62,6 @@ .color = "", .description = "RANAP User Adaptation", }, - [DSUA] = { - .name = "SUA", .loglevel = LOGL_DEBUG, .enabled = 1, - .color = "", - .description = "SCCP User Adaptation", - }, }; static const struct log_info test_log_info = { -- To view, visit https://gerrit.osmocom.org/3109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ac15fa2fd25bedb26297177e416976a5389b573 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 20:49:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 20:49:21 +0000 Subject: [PATCH] osmo-iuh[master]: sccp_sap_up(): guard against NULL pointers Message-ID: Review at https://gerrit.osmocom.org/3110 sccp_sap_up(): guard against NULL pointers Change-Id: Icd64b92b00461cace5c476c8bcf69eec3fdbbdd3 --- M src/hnbgw_cn.c 1 file changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/10/3110/1 diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 2fd9d71..8124ce5 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -327,12 +327,27 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *ctx) { struct osmo_sccp_user *scu = ctx; - struct hnbgw_cnlink *cnlink = osmo_sccp_user_get_priv(scu); + struct hnbgw_cnlink *cnlink; struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; int rc; LOGP(DMAIN, LOGL_DEBUG, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + if (!scu) { + LOGP(DMAIN, LOGL_ERROR, + "sccp_sap_up(): NULL osmo_sccp_user, cannot send prim (sap %u prim %u op %d)\n", + oph->sap, oph->primitive, oph->operation); + return -1; + } + + cnlink = osmo_sccp_user_get_priv(scu); + if (!cnlink) { + LOGP(DMAIN, LOGL_ERROR, + "sccp_sap_up(): NULL hnbgw_cnlink, cannot send prim (sap %u prim %u op %d)\n", + oph->sap, oph->primitive, oph->operation); + return -1; + } + switch (OSMO_PRIM_HDR(oph)) { case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): rc = handle_cn_unitdata(cnlink, &prim->u.unitdata, oph); -- To view, visit https://gerrit.osmocom.org/3110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd64b92b00461cace5c476c8bcf69eec3fdbbdd3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 20:49:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 20:49:21 +0000 Subject: [PATCH] osmo-iuh[master]: rua_to_scu(), rua_rx_init_connect(): add debug logging Message-ID: Review at https://gerrit.osmocom.org/3111 rua_to_scu(), rua_rx_init_connect(): add debug logging In rua_to_scu(), log domain indicator and remote address. In rua_rx_init_connect(), add domain indicator to log. Change-Id: Ibe510bf0aca5eadbc0ce6031d3026e770de6559f --- M src/hnbgw_rua.c 1 file changed, 21 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/11/3111/1 diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 329f990..54c455b 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -38,6 +38,18 @@ #include #include +static const char *cn_domain_indicator_to_str(CN_DomainIndicator_t cN_DomainIndicator) +{ + switch (cN_DomainIndicator) { + case RUA_CN_DomainIndicator_cs_domain: + return "IuCS"; + case RUA_CN_DomainIndicator_ps_domain: + return "IuPS"; + default: + return "(unknown-domain)"; + } +} + static int hnbgw_rua_tx(struct hnb_context *ctx, struct msgb *msg) { if (!msg) @@ -202,6 +214,11 @@ map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn); OSMO_ASSERT(map); + DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u\n", + cn_domain_indicator_to_str(cN_DomainIndicator), + osmo_sccp_addr_dump(remote_addr), + map->rua_ctx_id, map->scu_conn_id); + /* add primitive header */ switch (type) { case OSMO_SCU_PRIM_N_CONNECT: @@ -311,8 +328,10 @@ context_id = asn1bitstr_to_u24(&ies.context_ID); - DEBUGP(DRUA, "RUA Connect.req(ctx=0x%x, %s)\n", context_id, - ies.establishment_Cause == RUA_Establishment_Cause_emergency_call + DEBUGP(DRUA, "RUA %s Connect.req(ctx=0x%x, %s)\n", + cn_domain_indicator_to_str(ies.cN_DomainIndicator), + context_id, + ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal"); rc = rua_to_scu(hnb, ies.cN_DomainIndicator, OSMO_SCU_PRIM_N_CONNECT, -- To view, visit https://gerrit.osmocom.org/3111 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe510bf0aca5eadbc0ce6031d3026e770de6559f Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 20:49:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 20:49:21 +0000 Subject: [PATCH] osmo-iuh[master]: rua_to_scu(): add debug log for calling/called addr Message-ID: Review at https://gerrit.osmocom.org/3112 rua_to_scu(): add debug log for calling/called addr This might help in resolving whether we are conforming to SCCP specs regarding our calling/called address choices. Change-Id: Ie91953f7e9033419257d556d3a9f14e125f5c60d --- M src/hnbgw_rua.c 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/12/3112/1 diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 54c455b..b610437 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -226,6 +226,11 @@ prim->u.connect.calling_addr = cn->gw->sccp.local_addr; prim->u.connect.sccp_class = 2; prim->u.connect.conn_id = map->scu_conn_id; + /* Two separate logs because of osmo_sccp_addr_dump(). */ + DEBUGP(DRUA, "RUA to SCCP N_CONNECT: called_addr:%s\n", + osmo_sccp_addr_dump(&prim->u.connect.called_addr)); + DEBUGP(DRUA, "RUA to SCCP N_CONNECT: calling_addr:%s\n", + osmo_sccp_addr_dump(&prim->u.connect.calling_addr)); break; case OSMO_SCU_PRIM_N_DATA: prim->u.data.conn_id = map->scu_conn_id; @@ -237,6 +242,11 @@ case OSMO_SCU_PRIM_N_UNITDATA: prim->u.unitdata.called_addr = *remote_addr; prim->u.unitdata.calling_addr = cn->gw->sccp.local_addr; + /* Two separate logs because of osmo_sccp_addr_dump(). */ + DEBUGP(DRUA, "RUA to SCCP N_UNITDATA: called_addr:%s\n", + osmo_sccp_addr_dump(&prim->u.unitdata.called_addr)); + DEBUGP(DRUA, "RUA to SCCP N_UNITDATA: calling_addr:%s\n", + osmo_sccp_addr_dump(&prim->u.unitdata.calling_addr)); break; default: return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3112 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie91953f7e9033419257d556d3a9f14e125f5c60d Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 20:49:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 20:49:21 +0000 Subject: [PATCH] osmo-iuh[master]: cn unitdata: verify correct remote addr Message-ID: Review at https://gerrit.osmocom.org/3113 cn unitdata: verify correct remote addr When receiving unitdata from the CN, verify that it is indeed coming from the remote address that matches our CS/PS domain settings. This patch came from an earlier stage where the is_ps out-parameter was actually used. While it currently isn't, it doesn't hurt to leave it there. Change-Id: I7190b4c3a05e8bac0eeffa1eab18c9e47429cb17 --- M src/hnbgw_cn.c 1 file changed, 28 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/13/3113/1 diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 8124ce5..9921960 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -240,6 +240,31 @@ return rc; } +static bool osmo_sccp_addr_match(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b) +{ + return (a == b) + || ((a->pc == b->pc) + && (a->ssn == b->ssn)); +} + +static int classify_cn_remote_addr(const struct hnb_gw *gw, + const struct osmo_sccp_addr *cn_remote_addr, + bool *is_ps) +{ + if (osmo_sccp_addr_match(cn_remote_addr, &gw->sccp.remote_addr_cs)) { + if (is_ps) + *is_ps = false; + return 0; + } + if (osmo_sccp_addr_match(cn_remote_addr, &gw->sccp.remote_addr_ps)) { + if (is_ps) + *is_ps = true; + return 0; + } + LOGP(DMAIN, LOGL_ERROR, "Unexpected remote address, matches neither CS nor PS address: %s\n", + osmo_sccp_addr_dump(cn_remote_addr)); + return -1; +} static int handle_cn_unitdata(struct hnbgw_cnlink *cnlink, const struct osmo_scu_unitdata_param *param, @@ -251,6 +276,9 @@ return -1; } + if (classify_cn_remote_addr(cnlink->gw, ¶m->calling_addr, NULL) < 0) + return -1; + return handle_cn_ranap(cnlink, msgb_l2(oph->msg), msgb_l2len(oph->msg)); } -- To view, visit https://gerrit.osmocom.org/3113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7190b4c3a05e8bac0eeffa1eab18c9e47429cb17 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 3 20:49:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 3 Jul 2017 20:49:22 +0000 Subject: [PATCH] osmo-iuh[master]: set RANAP msgb headroom to 512 (times two) Message-ID: Review at https://gerrit.osmocom.org/3114 set RANAP msgb headroom to 512 (times two) With a headroom of 256, the SGSN crashes with: msgb(0x6e3b90): Not enough headroom msgb_push (256 < 264) I'm not perfectly sure what amount of headroom is strictly necessary. The only reason to pick 512 is that it is twice the amount of 256. Change-Id: I9a193846902a0477af0873f78283c4f2bedaf5dd --- M src/ranap_common.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/14/3114/1 diff --git a/src/ranap_common.c b/src/ranap_common.c index a468229..13c913f 100644 --- a/src/ranap_common.c +++ b/src/ranap_common.c @@ -291,7 +291,7 @@ static struct msgb *ranap_msgb_alloc(void) { - return msgb_alloc_headroom(1024+256, 256, "RANAP Tx"); + return msgb_alloc_headroom(1024+512, 512, "RANAP Tx"); } static struct msgb *_ranap_gen_msg(RANAP_RANAP_PDU_t *pdu) -- To view, visit https://gerrit.osmocom.org/3114 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9a193846902a0477af0873f78283c4f2bedaf5dd Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 4 08:13:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 08:13:44 +0000 Subject: [PATCH] osmo-bts[master]: Use osmo_dump_gsmtime to log fn across different layers 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/3098 to look at the new patch set (#3). Use osmo_dump_gsmtime to log fn across different layers This commit also fixes a missing end of line in the log output of handle_ph_data_ind Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 --- M src/common/l1sap.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 17 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/3098/3 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index f487d77..b6fcad3 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -798,8 +798,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH-RTS.ind %02u/%02u/%02u chan_nr=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) @@ -955,8 +954,8 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-DATA.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); + DEBUGP(DL1P, "Rx PH-DATA.ind %s chan_nr=%d link_id=%d\n", + osmo_dump_gsmtime(&g_time), chan_nr, link_id); if (ts_is_pdch(&trx->ts[tn])) { lchan = get_lchan_by_chan_nr(trx, chan_nr); @@ -1060,8 +1059,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH.ind %02u/%02u/%02u chan_nr=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) @@ -1212,9 +1210,9 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "TX packet data %02u/%02u/%02u is_ptcch=%d trx=%d ts=%d " - "block_nr=%d, arfcn=%d, len=%d\n", g_time.t1, g_time.t2, - g_time.t3, is_ptcch, ts->trx->nr, ts->nr, block_nr, arfcn, len); + DEBUGP(DL1P, "TX packet data %s is_ptcch=%d trx=%d ts=%d " + "block_nr=%d, arfcn=%d, len=%d\n", osmo_dump_gsmtime(&g_time), + is_ptcch, ts->trx->nr, ts->nr, block_nr, arfcn, len); msg = l1sap_msgb_alloc(len); l1sap = msgb_l1sap_prim(msg); diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 66aa21a..b82a7c6 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -926,6 +926,7 @@ uint8_t chan_nr, link_id; struct osmo_phsap_prim *l1sap; uint32_t fn; + struct gsm_time g_time; uint8_t *data, len; int rc = 0; int8_t rssi; @@ -943,9 +944,11 @@ process_meas_res(trx, chan_nr, &data_ind->measParam, fn); - DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", + gsm_fn2gsmtime(&g_time, fn); + + DEBUGP(DL1P, "Rx PH-DATA.ind %s %s (hL2 %08x): %s\n", get_value_string(lc15bts_l1sapi_names, data_ind->sapi), - (uint32_t)data_ind->hLayer2, + osmo_dump_gsmtime(&g_time), (uint32_t)data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); dump_meas_res(LOGL_DEBUG, &data_ind->measParam); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 299a743..e5e295a 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -927,6 +927,7 @@ struct msgb *sap_msg; struct osmo_phsap_prim *l1sap; uint32_t fn; + struct gsm_time g_time; int rc = 0; chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, @@ -942,9 +943,11 @@ process_meas_res(trx, chan_nr, fn, &data_ind->measParam); - DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", + gsm_fn2gsmtime(&g_time, fn); + + DEBUGP(DL1P, "Rx PH-DATA.ind %s %s (hL2 %08x): %s\n", get_value_string(femtobts_l1sapi_names, data_ind->sapi), - data_ind->hLayer2, + osmo_dump_gsmtime(&g_time), data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); dump_meas_res(LOGL_DEBUG, &data_ind->measParam); -- To view, visit https://gerrit.osmocom.org/3098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 Gerrit-PatchSet: 3 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 Tue Jul 4 08:13:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 08:13:44 +0000 Subject: [PATCH] osmo-bts[master]: Move dump_gsmtime to libosmocore as osmo_dump_gsmtime 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/3100 to look at the new patch set (#2). Move dump_gsmtime to libosmocore as osmo_dump_gsmtime Internal l1sap dump_gsmtime has been moved to libosmocore as osmo_dump_gsmtime. Remove use of internal function and replace with the libosmocore version. Depends on libosmocore Ib5452e2c20f53006c0f6d197fb055728947125d8 Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66 --- M src/common/l1sap.c 1 file changed, 4 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/00/3100/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 3f9da4f..f487d77 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -51,16 +52,6 @@ #include #include #include - -static char *dump_gsmtime(const struct gsm_time *tm) -{ - static char buf[64]; - - snprintf(buf, sizeof(buf), "%06u/%02u/%02u/%02u/%02u", - tm->fn, tm->t1, tm->t2, tm->t3, tm->fn%52); - buf[sizeof(buf)-1] = '\0'; - return buf; -} struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) @@ -627,13 +618,13 @@ loop_msg = msgb_dequeue(&lchan->dl_tch_queue); if (!loop_msg) { LOGP(DL1P, LOGL_NOTICE, "%s %s: no looped PDTCH message, sending empty\n", - gsm_lchan_name(lchan), dump_gsmtime(tm)); + gsm_lchan_name(lchan), osmo_dump_gsmtime(tm)); /* empty downlink message */ p = msgb_put(msg, GSM_MACBLOCK_LEN); memset(p, 0, GSM_MACBLOCK_LEN); } else { LOGP(DL1P, LOGL_NOTICE, "%s %s: looped PDTCH message of %u bytes\n", - gsm_lchan_name(lchan), dump_gsmtime(tm), msgb_l2len(loop_msg)); + gsm_lchan_name(lchan), osmo_dump_gsmtime(tm), msgb_l2len(loop_msg)); /* copy over data from queued response message */ p = msgb_put(msg, msgb_l2len(loop_msg)); memcpy(p, msgb_l2(loop_msg), msgb_l2len(loop_msg)); @@ -666,7 +657,7 @@ gsm_fn2gsmtime(&g_time, fn); DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=%d link_id=%d\n", - dump_gsmtime(&g_time), chan_nr, link_id); + osmo_dump_gsmtime(&g_time), chan_nr, link_id); /* reuse PH-RTS.ind for PH-DATA.req */ if (!msg) { -- To view, visit https://gerrit.osmocom.org/3100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 4 09:57:21 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 4 Jul 2017 09:57:21 +0000 Subject: osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/3008/5/contrib/jenkins_lc15.sh File contrib/jenkins_lc15.sh: PS5, Line 18: "$deps" "$base" Is it really necessary to pass $deps and $base args? Imho the 4th line takes already care that those two are exported, so build_bts() should be able to simply use them. (Assuming $deps and $base never change during build.) -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 4 10:52:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 4 Jul 2017 10:52:32 +0000 Subject: [PATCH] osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3008 to look at the new patch set (#6). Simplify jenkins build scripts * move duplicated code into separate functions in jenkins_common.sh * use that function in individual builds Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_common.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 6 files changed, 34 insertions(+), 86 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/3008/6 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4ff..95e504f 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -15,26 +15,9 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-trx" "$configure_flags" diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43..d55124f 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -16,9 +16,30 @@ # Get libosmocore for verify_value_string_arrays_are_terminated.py osmo-deps.sh libosmocore -# Get OpenBSC for gsm_data_shared.* -osmo-deps.sh openbsc - cd "$base" "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +# generic project build function, usage: +# build "PROJECT-NAME" "CONFIGURE OPTIONS" +build_bts() { + set +x + echo + echo + echo + echo " =============================== $1 ===============================" + echo + set -x + + shift + cd $deps + osmo-deps.sh openbsc + conf_flags="--with-openbsc=$1/openbsc/openbsc/include" + cd $inst + conf_flags="$conf_flags $*" + autoreconf --install --force + ./configure $conf_flags + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS=$conf_flags $MAKE distcheck || cat-testlogs.sh +} diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d5..da95bb1 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -12,18 +12,7 @@ cd "$deps" osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-lc15 ===============================" -echo -set -x +configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +build_bts "osmo-bts-lc15" "$configure_flags" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 6ad5358..6af03fa 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -12,21 +12,7 @@ cd "$deps" osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy ===============================" -echo -set -x +configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-octphy" "$configure_flags" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004..2f0f31b 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -17,28 +17,11 @@ osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy+trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-octphy+trx" "$configure_flags" diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249..ca4d177 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -14,24 +14,10 @@ osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-sysmo ===============================" -echo -set -x +configure_flags="--enable-sysmocom-bts" -autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-sysmo" "$configure_flags" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: blobb Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 4 10:53:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 4 Jul 2017 10:53:50 +0000 Subject: osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 6: > Is it really necessary to pass $deps and $base args? Good point, updated, thanks. -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 10:54:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 4 Jul 2017 10:54:58 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 4: -Code-Review -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 11:03:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 4 Jul 2017 11:03:33 +0000 Subject: [PATCH] osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3008 to look at the new patch set (#7). Simplify jenkins build scripts * move duplicated code into separate functions in jenkins_common.sh * use that function in individual builds Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_common.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 6 files changed, 34 insertions(+), 86 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/3008/7 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4ff..95e504f 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -15,26 +15,9 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-trx" "$configure_flags" diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43..92da27b 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -16,9 +16,30 @@ # Get libosmocore for verify_value_string_arrays_are_terminated.py osmo-deps.sh libosmocore -# Get OpenBSC for gsm_data_shared.* -osmo-deps.sh openbsc - cd "$base" "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +# generic project build function, usage: +# build "PROJECT-NAME" "CONFIGURE OPTIONS" +build_bts() { + set +x + echo + echo + echo + echo " =============================== $1 ===============================" + echo + set -x + + shift + cd $deps + osmo-deps.sh openbsc + conf_flags="--with-openbsc=$1/openbsc/openbsc/include" + cd $base + conf_flags="$conf_flags $*" + autoreconf --install --force + ./configure $conf_flags + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS=$conf_flags $MAKE distcheck || cat-testlogs.sh +} diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d5..da95bb1 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -12,18 +12,7 @@ cd "$deps" osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-lc15 ===============================" -echo -set -x +configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +build_bts "osmo-bts-lc15" "$configure_flags" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 6ad5358..6af03fa 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -12,21 +12,7 @@ cd "$deps" osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy ===============================" -echo -set -x +configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-octphy" "$configure_flags" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004..2f0f31b 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -17,28 +17,11 @@ osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy+trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-octphy+trx" "$configure_flags" diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249..ca4d177 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -14,24 +14,10 @@ osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-sysmo ===============================" -echo -set -x +configure_flags="--enable-sysmocom-bts" -autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-sysmo" "$configure_flags" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: blobb Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 4 11:11:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 4 Jul 2017 11:11:25 +0000 Subject: [PATCH] osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3008 to look at the new patch set (#8). Simplify jenkins build scripts * move duplicated code into separate functions in jenkins_common.sh * use that function in individual builds Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_common.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 6 files changed, 34 insertions(+), 86 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/3008/8 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4ff..95e504f 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -15,26 +15,9 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-trx" "$configure_flags" diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43..226b2ba 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -16,9 +16,30 @@ # Get libosmocore for verify_value_string_arrays_are_terminated.py osmo-deps.sh libosmocore -# Get OpenBSC for gsm_data_shared.* -osmo-deps.sh openbsc - cd "$base" "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +# generic project build function, usage: +# build "PROJECT-NAME" "CONFIGURE OPTIONS" +build_bts() { + set +x + echo + echo + echo + echo " =============================== $1 ===============================" + echo + set -x + + cd $deps + osmo-deps.sh openbsc + conf_flags="--with-openbsc=$deps/openbsc/openbsc/include" + cd $base + shift + conf_flags="$conf_flags $*" + autoreconf --install --force + ./configure $conf_flags + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS=$conf_flags $MAKE distcheck || cat-testlogs.sh +} diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d5..da95bb1 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -12,18 +12,7 @@ cd "$deps" osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-lc15 ===============================" -echo -set -x +configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +build_bts "osmo-bts-lc15" "$configure_flags" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 6ad5358..6af03fa 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -12,21 +12,7 @@ cd "$deps" osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy ===============================" -echo -set -x +configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-octphy" "$configure_flags" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004..2f0f31b 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -17,28 +17,11 @@ osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy+trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-octphy+trx" "$configure_flags" diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249..ca4d177 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -14,24 +14,10 @@ osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-sysmo ===============================" -echo -set -x +configure_flags="--enable-sysmocom-bts" -autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-sysmo" "$configure_flags" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: blobb Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 4 11:44:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 11:44:49 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: scheduler_trx: Remove trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/3115 cosmetic: scheduler_trx: Remove trailing whitespace Change-Id: Ib057b5e5219ad2acfaee2dcc9ade098daa9ac985 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/15/3115/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 4c3330f..f46ae1a 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -120,9 +120,9 @@ sb_info[0] = ((bsic & 0x3f) << 2) | ((t.t1 & 0x600) >> 9); - sb_info[1] = + sb_info[1] = ((t.t1 & 0x1fe) >> 1); - sb_info[2] = + sb_info[2] = ((t.t1 & 0x001) << 7) | ((t.t2 & 0x1f) << 2) | ((t3p & 0x6) >> 1); @@ -174,7 +174,7 @@ goto got_msg; LOGP(DL1C, LOGL_INFO, "%s has not been served !! No prim for " - "trx=%u ts=%u at fn=%u to transmit.\n", + "trx=%u ts=%u at fn=%u to transmit.\n", trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); no_msg: @@ -270,7 +270,7 @@ goto got_msg; LOGP(DL1C, LOGL_INFO, "%s has not been served !! No prim for " - "trx=%u ts=%u at fn=%u to transmit.\n", + "trx=%u ts=%u at fn=%u to transmit.\n", trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); no_msg: @@ -591,7 +591,7 @@ /* no message at all */ if (!msg_tch && !msg_facch) { LOGP(DL1C, LOGL_INFO, "%s has not been served !! No prim for " - "trx=%u ts=%u at fn=%u to transmit.\n", + "trx=%u ts=%u at fn=%u to transmit.\n", trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); goto send_burst; } @@ -688,7 +688,7 @@ /* no message at all */ if (!msg_tch && !msg_facch && !chan_state->dl_ongoing_facch) { LOGP(DL1C, LOGL_INFO, "%s has not been served !! No prim for " - "trx=%u ts=%u at fn=%u to transmit.\n", + "trx=%u ts=%u at fn=%u to transmit.\n", trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); goto send_burst; } @@ -906,7 +906,7 @@ uint16_t ber10k; int rc; - LOGP(DL1C, LOGL_DEBUG, "PDTCH received %s fn=%u ts=%u trx=%u bid=%u\n", + LOGP(DL1C, LOGL_DEBUG, "PDTCH received %s fn=%u ts=%u trx=%u bid=%u\n", trx_chan_desc[chan].name, fn, tn, l1t->trx->nr, bid); /* allocate burst memory, if not already */ @@ -1012,7 +1012,7 @@ if (chan_state->ho_rach_detect == 1) return rx_rach_fn(l1t, tn, fn, chan, bid, bits, GSM_BURST_LEN, rssi, toa); - LOGP(DL1C, LOGL_DEBUG, "TCH/F received %s fn=%u ts=%u trx=%u bid=%u\n", + LOGP(DL1C, LOGL_DEBUG, "TCH/F received %s fn=%u ts=%u trx=%u bid=%u\n", trx_chan_desc[chan].name, fn, tn, l1t->trx->nr, bid); /* allocate burst memory, if not already */ -- To view, visit https://gerrit.osmocom.org/3115 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib057b5e5219ad2acfaee2dcc9ade098daa9ac985 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 4 11:44:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 11:44:51 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: scheduler_trx.c: Add function to get rid of ugly g... Message-ID: Review at https://gerrit.osmocom.org/3116 cosmetic: scheduler_trx.c: Add function to get rid of ugly goto path Change-Id: I9c2e166e6f182f703ccf49aa883c223e377c8421 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 22 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/16/3116/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index f46ae1a..26b1705 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1585,6 +1585,26 @@ return 0; } +/*! reset clock with current fn and schedule it. Called when trx becomes + * available or when max clock skew is reached */ +static int trx_setup_clock(struct gsm_bts *bts, struct osmo_trx_clock_state *tcs, + struct timespec *tv_now, const struct timespec *interval, uint32_t fn) +{ + tcs->last_fn_timer.fn = fn; + /* call trx cheduler function for new 'last' FN */ + trx_sched_fn(bts, tcs->last_fn_timer.fn); + + /* schedule first FN clock timer */ + timer_ofd_setup(&tcs->fn_timer_ofd, trx_fn_timer_cb, bts); + timer_ofd_schedule(&tcs->fn_timer_ofd, NULL, interval); + + tcs->last_fn_timer.tv = *tv_now; + tcs->last_clk_ind.tv = *tv_now; + tcs->last_clk_ind.fn = fn; + + return 0; +} + /*! called every time we receive a clock indication from TRX */ int trx_sched_clock(struct gsm_bts *bts, uint32_t fn) { @@ -1615,20 +1635,7 @@ /* tell BSC */ check_transceiver_availability(bts, 1); -new_clock: - tcs->last_fn_timer.fn = fn; - /* call trx cheduler function for new 'last' FN */ - trx_sched_fn(bts, tcs->last_fn_timer.fn); - - /* schedule first FN clock timer */ - timer_ofd_setup(&tcs->fn_timer_ofd, trx_fn_timer_cb, bts); - timer_ofd_schedule(&tcs->fn_timer_ofd, NULL, &interval); - - tcs->last_fn_timer.tv = tv_now; - tcs->last_clk_ind.tv = tv_now; - tcs->last_clk_ind.fn = fn; - - return 0; + return trx_setup_clock(bts, tcs, &tv_now, &interval, fn); } /* calculate elapsed time +fn since last timer */ @@ -1663,7 +1670,7 @@ if (elapsed_fn > MAX_FN_SKEW || elapsed_fn < -MAX_FN_SKEW) { LOGP(DL1C, LOGL_NOTICE, "GSM clock skew: old fn=%u, " "new fn=%u\n", tcs->last_fn_timer.fn, fn); - goto new_clock; + return trx_setup_clock(bts, tcs, &tv_now, &interval, fn); } LOGP(DL1C, LOGL_INFO, "GSM clock jitter: %d us (elapsed_fn=%d)\n", -- To view, visit https://gerrit.osmocom.org/3116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c2e166e6f182f703ccf49aa883c223e377c8421 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 4 11:49:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 11:49:42 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: Move error goto path to the end of the function Message-ID: Review at https://gerrit.osmocom.org/3117 cosmetic: Move error goto path to the end of the function Change-Id: I3ad15a9edbfe74de3deb7298441d54fd9d0178ad --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/17/3117/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 26b1705..967e3db 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1549,14 +1549,7 @@ /* check if transceiver is still alive */ if (tcs->fn_without_clock_ind++ == TRX_LOSS_FRAMES) { LOGP(DL1C, LOGL_NOTICE, "No more clock from transceiver\n"); - -no_clock: - timer_ofd_disable(&tcs->fn_timer_ofd); - transceiver_available = 0; - - bts_shutdown(bts, "No clock from osmo-trx"); - - return -1; + goto no_clock; } /* compute actual elapsed time and resulting OS scheduling error */ @@ -1583,6 +1576,14 @@ } return 0; + +no_clock: + timer_ofd_disable(&tcs->fn_timer_ofd); + transceiver_available = 0; + + bts_shutdown(bts, "No clock from osmo-trx"); + + return -1; } /*! reset clock with current fn and schedule it. Called when trx becomes -- To view, visit https://gerrit.osmocom.org/3117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ad15a9edbfe74de3deb7298441d54fd9d0178ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 4 11:51:31 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 4 Jul 2017 11:51:31 +0000 Subject: osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 Looks good to me, but I am not familiar with all the osmo-bts configurations. -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 11:53:12 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 4 Jul 2017 11:53:12 +0000 Subject: [MERGED] osmo-bts[master]: Revert "osmo-bts-sysmo: Include frame number in MEAS IND" In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: Revert "osmo-bts-sysmo: Include frame number in MEAS IND" ...................................................................... Revert "osmo-bts-sysmo: Include frame number in MEAS IND" This reverts commit 3f97e4b1fcdc788345ab7740bd4fb8a3d73f5526. Change-Id: Ib50c813c470bf6ea740fe6667431eaa1a23fdd8d --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 2 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 837fc5c..05805b8 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -897,7 +897,7 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - uint32_t fn, GsmL1_MeasParam_t *m) + GsmL1_MeasParam_t *m) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); @@ -908,11 +908,6 @@ l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); - - /* The MEAS IND data structure expects a logical frame number. On the - * physical radio link, the uplink is delayed by 3 timeslots, we need - * to compensate for that delay. */ - l1sap.u.info.u.meas_ind.fn = fn + 3; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -941,7 +936,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, fn, &data_ind->measParam); + process_meas_res(trx, chan_nr, &data_ind->measParam); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/3051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib50c813c470bf6ea740fe6667431eaa1a23fdd8d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jul 4 11:58:57 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 4 Jul 2017 11:58:57 +0000 Subject: [PATCH] osmo-bts[master]: octphy: remap frame number in MEAS_IND Message-ID: Review at https://gerrit.osmocom.org/3118 octphy: remap frame number in MEAS_IND The octasic phy stamps the SACCH channel that carries the measurmenet indication with the frame number of the last SACCH that falls within the measurement period. The higher layers expect the frame number to be aligned to the SACCH channel after, which marks also the beginning of the next measurement period. Make the octphy code compatible to the higher layers by remapping the measurement indication frame number. Change-Id: I8ecb27c018bf4ad5151878a6ad34026fd0f801a1 --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 52 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/3118/1 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 8b31630..c7a7fe8 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -803,6 +803,57 @@ * handling of messages coming up from PHY ***********************************************************************/ +/* When the measurement indication is received from the phy, the phy will + * automatically stamp it with the frame number that matches the frame + * number of the SACCH channel that marks the end of the measurement + * period. (e.g. fn%104=90, on a TCH/H, TS0). However, the upper layers + * expect the frame number to be aligned to the next SACCH frame after, + * after the end of the measurement period that has just passed. (e.g. + * (fn%104=10, on a TCH/H, TS0). The following function remaps the frame + * number in order to match the higher layers expectations. + * See also: 3GPP TS 05.02 Clause 7 Table 1 of 9 Mapping of logical channels + * onto physical channels (see subclauses 6.3, 6.4, 6.5) */ +static uint32_t translate_tch_meas_rep_fn104_reverse(uint32_t fn) +{ + uint8_t new_fn_mod; + uint8_t fn_mod; + + fn_mod = fn % 104; + + switch (fn_mod) { + case 103: + new_fn_mod = 25; + break; + case 12: + new_fn_mod = 38; + break; + case 25: + new_fn_mod = 51; + break; + case 38: + new_fn_mod = 64; + break; + case 51: + new_fn_mod = 77; + break; + case 64: + new_fn_mod = 90; + break; + case 77: + new_fn_mod = 103; + break; + case 90: + new_fn_mod = 12; + break; + default: + /* No translation for frame numbers + * fall out of the raster */ + new_fn_mod = fn_mod; + } + + return (fn - fn_mod) + new_fn_mod; +} + static void process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, uint32_t fn, uint32_t data_len, tOCTVC1_GSM_MEASUREMENT_INFO * m) @@ -841,7 +892,7 @@ l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) ((m->sRSSIDbm >> 8) * -1); /* copy logical frame number to MEAS IND data structure */ - l1sap.u.info.u.meas_ind.fn = fn; + l1sap.u.info.u.meas_ind.fn = translate_tch_meas_rep_fn104_reverse(fn); /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ -- To view, visit https://gerrit.osmocom.org/3118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ecb27c018bf4ad5151878a6ad34026fd0f801a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:10:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:10:27 +0000 Subject: osmo-bts[master]: cosmetic: Move error goto path to the end of the function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ad15a9edbfe74de3deb7298441d54fd9d0178ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:10:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:10:50 +0000 Subject: osmo-bts[master]: cosmetic: scheduler_trx.c: Add function to get rid of ugly g... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c2e166e6f182f703ccf49aa883c223e377c8421 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:11:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:11:06 +0000 Subject: osmo-bts[master]: cosmetic: scheduler_trx: Remove trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3115 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib057b5e5219ad2acfaee2dcc9ade098daa9ac985 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:12:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:12:08 +0000 Subject: osmo-bts[master]: octphy: remap frame number in MEAS_IND In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3118/1/src/osmo-bts-octphy/l1_if.c File src/osmo-bts-octphy/l1_if.c: Line 816: static uint32_t translate_tch_meas_rep_fn104_reverse(uint32_t fn) what about all the other cases that are != TCH/H? -- To view, visit https://gerrit.osmocom.org/3118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ecb27c018bf4ad5151878a6ad34026fd0f801a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:15:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:15:23 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3048/4/src/gsm/gsm_utils.c File src/gsm/gsm_utils.c: Line 757: static char result[256]; I think this is too large. Please do a more realistic calculaition. Without computing, I'm sure we never even hit 128 or even 64 bytes wen printing four unsigned integers that are modulo a very small value. In fact, it's not more than 2 decimals for each of them, so 4*3=12 is the real size needed. Sizing the buffer to something like 20 or 32 is for sure far sufficient. WE don't want to end up pusing 256 useless bytes on the stack of an OsmocomBB phone... -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:17:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:17:56 +0000 Subject: osmo-bts[master]: Use osmo_dump_gsmtime to log fn across different layers In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:18:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:18:57 +0000 Subject: osmo-iuh[master]: set RANAP msgb headroom to 512 (times two) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3114 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9a193846902a0477af0873f78283c4f2bedaf5dd 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 Jul 4 13:19:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:19:40 +0000 Subject: osmo-iuh[master]: cosmetic: move callers' common switch() into rua_to_scu() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If6274e3738dc04646d0dc18332c12237e6910d18 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 Jul 4 13:22:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:22:31 +0000 Subject: osmo-iuh[master]: migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ac15fa2fd25bedb26297177e416976a5389b573 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 Jul 4 13:23:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:23:00 +0000 Subject: osmo-iuh[master]: sccp_sap_up(): guard against NULL pointers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icd64b92b00461cace5c476c8bcf69eec3fdbbdd3 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 Jul 4 13:23:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:23:17 +0000 Subject: osmo-iuh[master]: rua_to_scu(), rua_rx_init_connect(): add debug logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3111 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibe510bf0aca5eadbc0ce6031d3026e770de6559f 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 Jul 4 13:23:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:23:43 +0000 Subject: osmo-iuh[master]: rua_to_scu(): add debug log for calling/called addr In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3112 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie91953f7e9033419257d556d3a9f14e125f5c60d 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 Jul 4 13:25:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:25:14 +0000 Subject: osmo-iuh[master]: cn unitdata: verify correct remote addr In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3113/1/src/hnbgw_cn.c File src/hnbgw_cn.c: Line 243: static bool osmo_sccp_addr_match(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b) please don't introduce functions with osmo_ prefix which are not part of the library. I understand it's a static function at this point only, but we shouldn't make it too easy for somebody else to later make it non-static and pollute the namespace with possible future clashes of similarly-named functions in the libraries. -- To view, visit https://gerrit.osmocom.org/3113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7190b4c3a05e8bac0eeffa1eab18c9e47429cb17 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh 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 Jul 4 13:28:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:28:16 +0000 Subject: libosmo-sccp[master]: vty: Check returncode of osmo_ss7_pointcode_parse() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae6d92b1d135063dfd0a26bc23a89802cb3b1a78 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:30:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:30:23 +0000 Subject: libosmo-sccp[master]: simple-client/server: be able to decide on which ss7 instanc... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:33:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:33:50 +0000 Subject: osmo-bts[master]: octphy: do not send empty frames to phy In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Tue Jul 4 13:34:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:34:05 +0000 Subject: osmo-pcu[master]: Copy sysmopcu.service to osmo-pcu In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ca6f6c486bd6fcf4d5b3d0a05d25dc04f020c26 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-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:35:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 4 Jul 2017 13:35:34 +0000 Subject: [MERGED] osmo-pcu[master]: Copy sysmopcu.service to osmo-pcu In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Copy sysmopcu.service to osmo-pcu ...................................................................... Copy sysmopcu.service to osmo-pcu This way the name of systemd service file will match the name of the binary similar to OsmoBTS. Add aliases so the user can use both old and new names regardless of which file is installed. Once the corresponding changes to OE recipes are applied old file can be removed. Based on work by Pau Espin Pedrol Change-Id: I2ca6f6c486bd6fcf4d5b3d0a05d25dc04f020c26 --- A contrib/osmo-pcu.service M contrib/sysmopcu.service 2 files changed, 18 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/osmo-pcu.service b/contrib/osmo-pcu.service new file mode 100644 index 0000000..3066a66 --- /dev/null +++ b/contrib/osmo-pcu.service @@ -0,0 +1,17 @@ +[Unit] +Description=sysmocom sysmoPCU + +[Service] +Type=simple +ExecStart=/usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg +Restart=always +RestartSec=2 +RestartPreventExitStatus=1 + +# The msg queues must be read fast enough +CPUSchedulingPolicy=rr +CPUSchedulingPriority=1 + +[Install] +WantedBy=multi-user.target +Alias=sysmopcu.service diff --git a/contrib/sysmopcu.service b/contrib/sysmopcu.service index 3e3ff07..df8c47e 100644 --- a/contrib/sysmopcu.service +++ b/contrib/sysmopcu.service @@ -14,3 +14,4 @@ [Install] WantedBy=multi-user.target +Alias=osmo-pcu.service -- To view, visit https://gerrit.osmocom.org/3106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2ca6f6c486bd6fcf4d5b3d0a05d25dc04f020c26 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:35:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:35:39 +0000 Subject: osmo-bts[master]: Move dump_gsmtime to libosmocore as osmo_dump_gsmtime In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:36:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:36:24 +0000 Subject: [MERGED] osmo-bts[master]: octphy: complete value strings (octphy_cid_vals) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: complete value strings (octphy_cid_vals) ...................................................................... octphy: complete value strings (octphy_cid_vals) The value string table octphy_cid_vals lacks the strings for cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID and cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID (Patch by Octasic Inc.) Change-Id: I9843137b55534a29938d5c2308244a6950de788f --- M src/osmo-bts-octphy/l1_utils.c M src/osmo-bts-octphy/l1_utils.h 2 files changed, 5 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_utils.c b/src/osmo-bts-octphy/l1_utils.c index ac5e217..8a8e155 100644 --- a/src/osmo-bts-octphy/l1_utils.c +++ b/src/osmo-bts-octphy/l1_utils.c @@ -22,6 +22,7 @@ #include "l1_utils.h" #include #include +#include #include const struct value_string octphy_l1sapi_names[23] = @@ -79,7 +80,7 @@ { 0, NULL } }; -const struct value_string octphy_cid_vals[35] = { +const struct value_string octphy_cid_vals[37] = { { cOCTVC1_GSM_MSG_TRX_OPEN_CID, "TRX-OPEN" }, { cOCTVC1_GSM_MSG_TRX_CLOSE_CID, "TRX-CLOSE" }, { cOCTVC1_GSM_MSG_TRX_STATUS_CID, "TRX-STATUS" }, @@ -116,6 +117,8 @@ { cOCTVC1_GSM_MSG_TAP_FILTER_INFO_CID, "TAP-FILTER-INFO" }, { cOCTVC1_GSM_MSG_TAP_FILTER_STATS_CID, "TAP-FILTER-STATS" }, { cOCTVC1_GSM_MSG_TAP_FILTER_MODIFY_CID, "TAP-FILTER-MODIFY" }, + { cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID, "MAIN_MSG_APP_INFO" }, + { cOCTVC1_MAIN_MSG_APPLICATION_INFO_SYSTEM_CID, "MAIN_MSG_APP_INFO_SYSTEM" }, { cOCTVC1_GSM_MSG_TRX_START_LOGICAL_CHANNEL_RAW_DATA_INDICATIONS_CID, "LCHAN-RAW-DATA-START" }, { cOCTVC1_GSM_MSG_TRX_STOP_LOGICAL_CHANNEL_RAW_DATA_INDICATIONS_CID, diff --git a/src/osmo-bts-octphy/l1_utils.h b/src/osmo-bts-octphy/l1_utils.h index cec9f75..d1a8717 100644 --- a/src/osmo-bts-octphy/l1_utils.h +++ b/src/osmo-bts-octphy/l1_utils.h @@ -5,5 +5,5 @@ const struct value_string octphy_l1sapi_names[23]; const struct value_string octphy_dir_names[5]; const struct value_string octphy_clkmgr_state_vals[8]; -const struct value_string octphy_cid_vals[35]; +const struct value_string octphy_cid_vals[37]; const struct value_string octphy_eid_vals[7]; -- To view, visit https://gerrit.osmocom.org/2933 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9843137b55534a29938d5c2308244a6950de788f Gerrit-PatchSet: 4 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 Tue Jul 4 13:36:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:36:42 +0000 Subject: osmo-bts[master]: Use L1P instead of L1C for TCH logging and allocation In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b 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 Tue Jul 4 13:36:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:36:53 +0000 Subject: [MERGED] osmo-bts[master]: Use L1P instead of L1C for TCH logging and allocation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use L1P instead of L1C for TCH logging and allocation ...................................................................... Use L1P instead of L1C for TCH logging and allocation L1C is for L1-Control primitives, while TCH channels are L1 Data channels. Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b --- M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_tch.c M src/osmo-bts-sysmo/tch.c 3 files changed, 34 insertions(+), 34 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 8bed695..c82d6f8 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -61,7 +61,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -95,7 +95,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -126,12 +126,12 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return NULL; } @@ -155,7 +155,7 @@ { if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return 0; } @@ -172,7 +172,7 @@ uint8_t amr_if2_len = payload_len - 2; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -405,31 +405,31 @@ case GsmL1_TchPlType_Amr_SidFirstP1: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstP2: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidUpdateInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " "(%d bytes)\n", payload_len); break; default: - LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", + LOGP(DL1P, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, payload_type)); break; @@ -465,7 +465,7 @@ return 0; err_payload_match: - LOGP(DL1C, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", + LOGP(DL1P, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, payload_type)); return -EINVAL; diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index 5693313..79bf245 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -43,7 +43,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -93,7 +93,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -132,12 +132,12 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return NULL; } @@ -164,7 +164,7 @@ { if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return 0; } @@ -217,13 +217,13 @@ goto err_payload_match; break; default: - LOGP(DL1C, LOGL_NOTICE, + LOGP(DL1P, LOGL_NOTICE, "%s Rx Payload Type %d is unsupported\n", gsm_lchan_name(lchan), payload_type); break; } - LOGP(DL1C, LOGL_DEBUG, "%s Rx codec frame (%u): %s\n", + LOGP(DL1P, LOGL_DEBUG, "%s Rx codec frame (%u): %s\n", gsm_lchan_name(lchan), payload_len, osmo_hexdump(payload, payload_len)); @@ -247,7 +247,7 @@ rmsg = l1_to_rtppayload_amr(payload, payload_len, &lchan->tch.amr_mr); #else - LOGP(DL1C, LOGL_ERROR, "OctPHY only supports FR!\n"); + LOGP(DL1P, LOGL_ERROR, "OctPHY only supports FR!\n"); return -1; #endif break; @@ -260,7 +260,7 @@ return 0; err_payload_match: - LOGP(DL1C, LOGL_ERROR, + LOGP(DL1P, LOGL_ERROR, "%s Rx Payload Type %d incompatible with lchan\n", gsm_lchan_name(lchan), payload_type); return -EINVAL; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index a12b1a7..6333d19 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -58,7 +58,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -113,7 +113,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -200,12 +200,12 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return NULL; } @@ -239,7 +239,7 @@ { if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return 0; } @@ -269,7 +269,7 @@ uint8_t amr_if2_len = payload_len - 2; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -296,7 +296,7 @@ else if (cmr_idx >= amr_mrc->num_modes || cmr_idx > GsmL1_AmrCodecMode_Unset) { /* Make sure the CMR of the phone is in the active codec set */ - LOGP(DL1C, LOGL_NOTICE, "L1->RTP: overriding CMR IDX %u\n", cmr_idx); + LOGP(DL1P, LOGL_NOTICE, "L1->RTP: overriding CMR IDX %u\n", cmr_idx); cmr = AMR_CMR_NONE; } else { cmr = amr_mrc->bts_mode[cmr_idx].mode; @@ -552,31 +552,31 @@ case GsmL1_TchPlType_Amr_SidFirstP1: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstP2: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidUpdateInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " "(%d bytes)\n", payload_len); break; default: - LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", + LOGP(DL1P, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, payload_type)); break; @@ -614,7 +614,7 @@ return 0; err_payload_match: - LOGP(DL1C, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", + LOGP(DL1P, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, payload_type)); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b Gerrit-PatchSet: 3 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 Tue Jul 4 13:36:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:36:53 +0000 Subject: [MERGED] osmo-bts[master]: sysmo, litecell15: Make sure all TCH events are triggered In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sysmo, litecell15: Make sure all TCH events are triggered ...................................................................... sysmo, litecell15: Make sure all TCH events are triggered Change-Id: Ie674c7ec40838af36308c6998f227fa452ace4b4 --- M src/osmo-bts-litecell15/oml.c M src/osmo-bts-sysmo/oml.c 2 files changed, 10 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index d9f613d..7b728f9 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1030,6 +1030,11 @@ case GsmL1_Sapi_TchH: case GsmL1_Sapi_TchF: lchan2lch_par(lch_par, lchan); + /* + * Be sure that every packet is received, even if it + * fails. In this case the length might be lower or 0. + */ + act_req->fBFILevel = -200.0f; break; case GsmL1_Sapi_Ptcch: lch_par->ptcch.u8Bsic = lchan->ts->trx->bts->bsic; diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index e1264af..505a457 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1047,6 +1047,11 @@ case GsmL1_Sapi_TchH: case GsmL1_Sapi_TchF: lchan2lch_par(lch_par, lchan); + /* + * Be sure that every packet is received, even if it + * fails. In this case the length might be lower or 0. + */ + act_req->fBFILevel = -200.0f; break; case GsmL1_Sapi_Ptcch: lch_par->ptcch.u8Bsic = lchan->ts->trx->bts->bsic; -- To view, visit https://gerrit.osmocom.org/3097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie674c7ec40838af36308c6998f227fa452ace4b4 Gerrit-PatchSet: 3 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 Tue Jul 4 13:36:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 13:36:54 +0000 Subject: [MERGED] osmo-bts[master]: Fix annoying trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix annoying trailing whitespace ...................................................................... Fix annoying trailing whitespace This whitespace keeps being automatically fixed by editor, polluting my patches. Change-Id: If0ba1321ed326c1498e3f60b611bd962f2a9484a --- M src/common/pcu_sock.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/oml.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_if.c 5 files changed, 16 insertions(+), 17 deletions(-) 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 1ae6cb6..2755048 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -74,8 +74,8 @@ return NULL; msgb_put(msg, sizeof(struct gsm_pcu_if)); pcu_prim = (struct gsm_pcu_if *) msg->data; - pcu_prim->msg_type = msg_type; - pcu_prim->bts_nr = bts_nr; + pcu_prim->msg_type = msg_type; + pcu_prim->bts_nr = bts_nr; return msg; } @@ -566,7 +566,7 @@ struct gsm_bts_trx *trx; struct gsm_lchan *lchan; - LOGP(DPCU, LOGL_INFO, "%s request received: TRX=%d TX=%d\n", + LOGP(DPCU, LOGL_INFO, "%s request received: TRX=%d TX=%d\n", (act_req->activate) ? "Activate" : "Deactivate", act_req->trx_nr, act_req->ts_nr); diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index d6cffc9..bd9e003 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -2,7 +2,7 @@ /* Copyright (C) 2015 by Yves Godin * Copyright (C) 2016 by Harald Welte - * + * * Based on sysmoBTS: * (C) 2011-2014 by Harald Welte * (C) 2014 by Holger Hans Peter Freyther @@ -1482,21 +1482,21 @@ fl1h->hw_info.ver_minor = rc; rc = lc15bts_option_get(LC15BTS_OPTION_BAND); - if (rc < 0) + if (rc < 0) return rc; switch (rc) { - case LC15BTS_BAND_850: - fl1h->hw_info.band_support = GSM_BAND_850; + case LC15BTS_BAND_850: + fl1h->hw_info.band_support = GSM_BAND_850; break; - case LC15BTS_BAND_900: - fl1h->hw_info.band_support = GSM_BAND_900; + case LC15BTS_BAND_900: + fl1h->hw_info.band_support = GSM_BAND_900; break; - case LC15BTS_BAND_1800: - fl1h->hw_info.band_support = GSM_BAND_1800; + case LC15BTS_BAND_1800: + fl1h->hw_info.band_support = GSM_BAND_1800; break; - case LC15BTS_BAND_1900: - fl1h->hw_info.band_support = GSM_BAND_1900; + case LC15BTS_BAND_1900: + fl1h->hw_info.band_support = GSM_BAND_1900; break; default: return -1; @@ -1576,4 +1576,3 @@ return 0; } - diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 5c53feb..d9f613d 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1,5 +1,5 @@ /* Copyright (C) 2015 by Yves Godin - * + * * Based on sysmoBTS: * (C) 2011 by Harald Welte * (C) 2013-2014 by Holger Hans Peter Freyther diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index c82d6f8..a29733f 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -1,7 +1,7 @@ /* Traffic channel support for NuRAN Wireless Litecell 1.5 BTS L1 */ /* Copyright (C) 2015 by Yves Godin - * + * * Based on sysmoBTS: * (C) 2011-2012 by Harald Welte * diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 8b31630..427acdf 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -1103,7 +1103,7 @@ l1sap->u.data.ber10k = b_total ? BER_10K * b_error / b_total : 0; /* FIXME::burst timing in 1x but PCU is expecting 4X */ - l1sap->u.data.ta_offs_qbits = (data_ind->MeasurementInfo.sBurstTiming * 4); + l1sap->u.data.ta_offs_qbits = (data_ind->MeasurementInfo.sBurstTiming * 4); snr = data_ind->MeasurementInfo.sSNRDb; /* FIXME: better converion formulae for SnR -> C / I? l1sap->u.data.lqual_cb = (snr ? snr : (snr - 65536)) * 10 / 256; -- To view, visit https://gerrit.osmocom.org/3096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If0ba1321ed326c1498e3f60b611bd962f2a9484a Gerrit-PatchSet: 3 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 Tue Jul 4 13:39:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 4 Jul 2017 13:39:53 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: use proper systemd service names 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/3107 to look at the new patch set (#2). OsmoGSMTester: use proper systemd service names * use osmo-bts-sysmo for sysmoBTS systemd service name which is available since 114293a414bd5b7c86622ec8c293c4034c80d243 * use osmo-pcu for OsmoPCU systemd service name which is available since 241f5bcb00f9c6fee4200a3aea9aa497bf0d3eee Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/07/3107/2 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index b703498..e843482 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -531,7 +531,7 @@ be disabled: ---- -systemctl mask osmo-nitb sysmobts sysmopcu sysmobts-mgr +systemctl mask osmo-nitb osmo-bts-sysmo osmo-pcu sysmobts-mgr ---- This stops the stock setup keeping the BTS in operation and hence allows the -- To view, visit https://gerrit.osmocom.org/3107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 4 13:59:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 13:59:13 +0000 Subject: osmo-gsm-manuals[master]: OsmoGSMTester: use proper systemd service names In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 14:18:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 4 Jul 2017 14:18:24 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: so should we go for this kind of patch, or should I push another version that does it unconditionally? My preference would be to go for the latter, to have a "sane default" configureation. -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 14:58:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 14:58:54 +0000 Subject: [PATCH] osmo-trx[master]: cosmetic: transciever: Remove trailing whitespaces Message-ID: Review at https://gerrit.osmocom.org/3119 cosmetic: transciever: Remove trailing whitespaces Change-Id: Ib3fbe768048b2a34a75ace9688e306720e67019a --- M Transceiver52M/Transceiver.cpp 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/19/3119/1 diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 61da416..d5b75d7 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -429,7 +429,7 @@ case V: state->fillerModulus[timeslot] = 51; break; - //case V: + //case V: case VII: state->fillerModulus[timeslot] = 102; break; @@ -544,7 +544,7 @@ /* * Pull bursts from the FIFO and handle according to the slot - * and burst correlation type. Equalzation is currently disabled. + * and burst correlation type. Equalzation is currently disabled. */ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, double &RSSI, bool &isRssiValid, double &timingOffset, double &noise, @@ -655,7 +655,7 @@ mTxPriorityQueues[i].clear(); } - + void Transceiver::driveControl(size_t chan) { int MAX_PACKET_LENGTH = 100; @@ -804,7 +804,7 @@ LOG(WARNING) << "bogus message on control interface"; sprintf(response,"RSP SETSLOT 1 %d %d",timeslot,corrCode); return; - } + } mStates[chan].chanType[timeslot] = (ChannelCombination) corrCode; setModulus(timeslot, chan); sprintf(response,"RSP SETSLOT 0 %d %d",timeslot,corrCode); @@ -852,14 +852,14 @@ frameNum = (frameNum << 8) | (0x0ff & buffer[i+1]); LOG(DEBUG) << "rcvd. burst at: " << GSM::Time(frameNum,timeSlot); - + int RSSI = (int) buffer[5]; BitVector newBurst(burstLen); BitVector::iterator itr = newBurst.begin(); char *bufferItr = buffer+6; - while (itr < newBurst.end()) + while (itr < newBurst.end()) *itr++ = *bufferItr++; - + GSM::Time currTime = GSM::Time(frameNum,timeSlot); addRadioVector(chan, newBurst, RSSI, currTime); @@ -945,7 +945,7 @@ { /** - Features a carefully controlled latency mechanism, to + Features a carefully controlled latency mechanism, to assure that transmit packets arrive at the radio/USRP before they need to be transmitted. @@ -956,7 +956,7 @@ RadioClock *radioClock = (mRadioInterface->getClock()); - + if (mOn) { //radioClock->wait(); // wait until clock updates LOG(DEBUG) << "radio clock " << radioClock->get(); -- To view, visit https://gerrit.osmocom.org/3119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3fbe768048b2a34a75ace9688e306720e67019a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 4 14:58:56 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 14:58:56 +0000 Subject: [PATCH] osmo-trx[master]: transceiver: Avoid sending clock indications when trx is not... Message-ID: Review at https://gerrit.osmocom.org/3120 transceiver: Avoid sending clock indications when trx is not powered on Otherwise this fools osmo-bts-trx clock sanity check because it is always sending a clock indication with the same fn when it issues any commands during the time in between CMD POWEOFF and RSP POWERON. Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 --- M Transceiver52M/Transceiver.cpp 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/20/3120/1 diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index d5b75d7..bbfcc26 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -677,9 +677,6 @@ sscanf(buffer,"%3s %s",cmdcheck,command); - if (!chan) - writeClockInterface(); - if (strcmp(cmdcheck,"CMD")!=0) { LOG(WARNING) << "bogus message on control interface"; return; -- To view, visit https://gerrit.osmocom.org/3120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 4 16:01:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 16:01:16 +0000 Subject: [PATCH] osmo-trx[master]: transceiver: Avoid sending clock indications when trx is not... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3120 to look at the new patch set (#2). transceiver: Avoid sending clock indications when trx is not powered on Otherwise this fools osmo-bts-trx clock skew check because it is always sending a clock indication with the same fn when it issues any commands during the time in between CMD POWEOFF and RSP POWERON. Also delay send of first IND CLOCK until we start serving frames, otherwise we send it then wait a long time until start sending the next ones and that also makes osmo-bts-trx unhappy because it expects to receive an IND CLOCK aprox at least every 400 frames. Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 --- M Transceiver52M/Transceiver.cpp M Transceiver52M/Transceiver.h 2 files changed, 6 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/20/3120/2 diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index d5b75d7..bf2dd6e 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -121,7 +121,7 @@ mClockSocket(wBasePort, wTRXAddress, mBasePort + 100), mTransmitLatency(wTransmitLatency), mRadioInterface(wRadioInterface), rssiOffset(wRssiOffset), - mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mEdge(false), mOn(false), + mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mEdge(false), mOn(false), mForceClockInterface(false), mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(0), mMaxExpectedDelayNB(0), mWriteBurstToDiskMask(0) { @@ -273,7 +273,7 @@ TxUpperLoopAdapter, (void*) chan); } - writeClockInterface(); + mForceClockInterface = true; mOn = true; return true; } @@ -677,9 +677,6 @@ sscanf(buffer,"%3s %s",cmdcheck,command); - if (!chan) - writeClockInterface(); - if (strcmp(cmdcheck,"CMD")!=0) { LOG(WARNING) << "bogus message on control interface"; return; @@ -873,9 +870,9 @@ { if (!mRadioInterface->driveReceiveRadio()) { usleep(100000); - } else { - if (mTransmitDeadlineClock > mLastClockUpdateTime + GSM::Time(216,0)) - writeClockInterface(); + } else if (mForceClockInterface || mTransmitDeadlineClock > mLastClockUpdateTime + GSM::Time(216,0)) { + mForceClockInterface = false; + writeClockInterface(); } } diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index 26d6c3c..1eb1d1d 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -208,6 +208,7 @@ bool mEdge; bool mOn; ///< flag to indicate that transceiver is powered on + bool mForceClockInterface; ///< flag to indicate whether IND CLOCK shall be sent unconditionally after transceiver is started bool mHandover[8][8]; ///< expect handover to the timeslot/subslot double mTxFreq; ///< the transmit frequency double mRxFreq; ///< the receive frequency -- To view, visit https://gerrit.osmocom.org/3120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 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 Tue Jul 4 16:01:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 16:01:16 +0000 Subject: [PATCH] osmo-trx[master]: cosmetic: transciever: Remove trailing whitespaces In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3119 to look at the new patch set (#2). cosmetic: transciever: Remove trailing whitespaces Change-Id: Ib3fbe768048b2a34a75ace9688e306720e67019a --- M Transceiver52M/Transceiver.cpp M Transceiver52M/Transceiver.h 2 files changed, 11 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/19/3119/2 diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 61da416..d5b75d7 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -429,7 +429,7 @@ case V: state->fillerModulus[timeslot] = 51; break; - //case V: + //case V: case VII: state->fillerModulus[timeslot] = 102; break; @@ -544,7 +544,7 @@ /* * Pull bursts from the FIFO and handle according to the slot - * and burst correlation type. Equalzation is currently disabled. + * and burst correlation type. Equalzation is currently disabled. */ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, double &RSSI, bool &isRssiValid, double &timingOffset, double &noise, @@ -655,7 +655,7 @@ mTxPriorityQueues[i].clear(); } - + void Transceiver::driveControl(size_t chan) { int MAX_PACKET_LENGTH = 100; @@ -804,7 +804,7 @@ LOG(WARNING) << "bogus message on control interface"; sprintf(response,"RSP SETSLOT 1 %d %d",timeslot,corrCode); return; - } + } mStates[chan].chanType[timeslot] = (ChannelCombination) corrCode; setModulus(timeslot, chan); sprintf(response,"RSP SETSLOT 0 %d %d",timeslot,corrCode); @@ -852,14 +852,14 @@ frameNum = (frameNum << 8) | (0x0ff & buffer[i+1]); LOG(DEBUG) << "rcvd. burst at: " << GSM::Time(frameNum,timeSlot); - + int RSSI = (int) buffer[5]; BitVector newBurst(burstLen); BitVector::iterator itr = newBurst.begin(); char *bufferItr = buffer+6; - while (itr < newBurst.end()) + while (itr < newBurst.end()) *itr++ = *bufferItr++; - + GSM::Time currTime = GSM::Time(frameNum,timeSlot); addRadioVector(chan, newBurst, RSSI, currTime); @@ -945,7 +945,7 @@ { /** - Features a carefully controlled latency mechanism, to + Features a carefully controlled latency mechanism, to assure that transmit packets arrive at the radio/USRP before they need to be transmitted. @@ -956,7 +956,7 @@ RadioClock *radioClock = (mRadioInterface->getClock()); - + if (mOn) { //radioClock->wait(); // wait until clock updates LOG(DEBUG) << "radio clock " << radioClock->get(); diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index 6f9cb92..26d6c3c 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -89,7 +89,7 @@ /** The Transceiver class, responsible for physical layer of basestation */ class Transceiver { public: - /** Transceiver constructor + /** Transceiver constructor @param wBasePort base port number of UDP sockets @param TRXAddress IP address of the TRX manager, as a string @param wSPS number of samples per GSM symbol @@ -169,7 +169,7 @@ GSM::Time mTransmitLatency; ///< latency between basestation clock and transmit deadline clock GSM::Time mLatencyUpdateTime; ///< last time latency was updated - GSM::Time mTransmitDeadlineClock; ///< deadline for pushing bursts into transmit FIFO + GSM::Time mTransmitDeadlineClock; ///< deadline for pushing bursts into transmit FIFO GSM::Time mLastClockUpdateTime; ///< last time clock update was sent up to core RadioInterface *mRadioInterface; ///< associated radioInterface object @@ -275,4 +275,3 @@ /** transmit queueing thread loop */ void *TxUpperLoopAdapter(TransceiverChannel *); - -- To view, visit https://gerrit.osmocom.org/3119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib3fbe768048b2a34a75ace9688e306720e67019a 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 Tue Jul 4 16:22:04 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 4 Jul 2017 16:22:04 +0000 Subject: [PATCH] libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() 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/3048 to look at the new patch set (#5). utils: add function gsm_fn_as_gsmtime_str() Convert a given frame number into a printable string that displays the sub components of the frame number. Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map 3 files changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/3048/5 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..b218331 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -165,6 +165,9 @@ /* Convert from frame number to GSM time */ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn); +/* Parse GSM Frame Number into printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn); + /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..d8ca9b3 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -749,6 +749,21 @@ time->tc = (time->fn / 51) % 8; } +/*! Parse GSM Frame Number into printable string + * \param[in] fn GSM Frame Number + * \returns pointer to printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn) +{ + static char result[20]; + struct gsm_time time; + + gsm_fn2gsmtime(&time, fn); + snprintf(result, sizeof(result), "%02u/%02u/%02u/%02u", time.t1, time.t2, + time.t3, time.tc); + + return result; +} + /*! Encode decoded \ref gsm_time to Frame Number * \param[in] time GSM Time in decoded structure * \returns GSM Frame Number */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index e992a4f..29e023c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -272,6 +272,7 @@ gsm_band_name; gsm_band_parse; gsm_fn2gsmtime; +gsm_fn_as_gsmtime_str; gsm_get_octet_len; gsm_gsmtime2fn; -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jul 4 17:16:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 4 Jul 2017 17:16:15 +0000 Subject: [PATCH] osmo-trx[master]: transceiver: Avoid sending clock indications when trx is not... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3120 to look at the new patch set (#3). transceiver: Avoid sending clock indications when trx is not powered on Stop calling writeClockInterface() when receiving commands in Transceiver::driveControl, otherwise it fools osmo-bts-trx clock skew check because it is always sending a clock indication with the same fn when it issues any commands during the time in between CMD POWEROFF and RSP POWERON, because fn is not increased during that period. Also use mForceClockInterface flag to delay delivery of first IND CLOCK until we start serving frames, otherwise the first one is sent and only after a long period of time the next clock indications are sent, when the radio starts to process bursts. That makes osmo-bts-trx unhappy because it expects to receive an IND CLOCK aprox at least every 400 frames. This way also we send the first IND CLOCK after the RSP POWERON 0 response. Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 --- M Transceiver52M/Transceiver.cpp M Transceiver52M/Transceiver.h 2 files changed, 6 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/20/3120/3 diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index d5b75d7..bf2dd6e 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -121,7 +121,7 @@ mClockSocket(wBasePort, wTRXAddress, mBasePort + 100), mTransmitLatency(wTransmitLatency), mRadioInterface(wRadioInterface), rssiOffset(wRssiOffset), - mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mEdge(false), mOn(false), + mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mEdge(false), mOn(false), mForceClockInterface(false), mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(0), mMaxExpectedDelayNB(0), mWriteBurstToDiskMask(0) { @@ -273,7 +273,7 @@ TxUpperLoopAdapter, (void*) chan); } - writeClockInterface(); + mForceClockInterface = true; mOn = true; return true; } @@ -677,9 +677,6 @@ sscanf(buffer,"%3s %s",cmdcheck,command); - if (!chan) - writeClockInterface(); - if (strcmp(cmdcheck,"CMD")!=0) { LOG(WARNING) << "bogus message on control interface"; return; @@ -873,9 +870,9 @@ { if (!mRadioInterface->driveReceiveRadio()) { usleep(100000); - } else { - if (mTransmitDeadlineClock > mLastClockUpdateTime + GSM::Time(216,0)) - writeClockInterface(); + } else if (mForceClockInterface || mTransmitDeadlineClock > mLastClockUpdateTime + GSM::Time(216,0)) { + mForceClockInterface = false; + writeClockInterface(); } } diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index 26d6c3c..1eb1d1d 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -208,6 +208,7 @@ bool mEdge; bool mOn; ///< flag to indicate that transceiver is powered on + bool mForceClockInterface; ///< flag to indicate whether IND CLOCK shall be sent unconditionally after transceiver is started bool mHandover[8][8]; ///< expect handover to the timeslot/subslot double mTxFreq; ///< the transmit frequency double mRxFreq; ///< the receive frequency -- To view, visit https://gerrit.osmocom.org/3120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 4 18:03:51 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 4 Jul 2017 18:03:51 +0000 Subject: osmo-bts[master]: cosmetic: scheduler_trx.c: Add function to get rid of ugly g... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 I did the same in my simplified version of scheduler for OsmocomBB. -- To view, visit https://gerrit.osmocom.org/3116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c2e166e6f182f703ccf49aa883c223e377c8421 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: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 4 18:04:13 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 4 Jul 2017 18:04:13 +0000 Subject: osmo-bts[master]: cosmetic: Move error goto path to the end of the function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ad15a9edbfe74de3deb7298441d54fd9d0178ad 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: Vadim Yanitskiy Gerrit-HasComments: No From admin at opensuse.org Tue Jul 4 19:55:14 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 04 Jul 2017 19:55:14 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/i586 In-Reply-To: References: Message-ID: <595bf2c4c0451_1ff1e86f84773132@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 286s] | [ 286s] | This file was extended by libosmocore config.status 0.9.6.20170704, which was [ 286s] | generated by GNU Autoconf 2.69. Invocation command line was [ 286s] | [ 286s] | CONFIG_FILES = [ 286s] | CONFIG_HEADERS = [ 286s] | CONFIG_LINKS = [ 286s] | CONFIG_COMMANDS = [ 286s] | $ ./config.status Doxyfile.core [ 286s] | [ 286s] | on build30 [ 286s] | [ 286s] | config.status:1171: creating Doxyfile.core [ 286s] [ 286s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 286s] make[1]: *** [override_dh_auto_test] Error 1 [ 286s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 286s] debian/rules:15: recipe for target 'build' failed [ 286s] make: *** [build] Error 2 [ 286s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 286s] [ 286s] build30 failed "build libosmocore_0.9.6.20170704.dsc" at Tue Jul 4 19:55:02 UTC 2017. [ 286s] [ 286s] ### VM INTERACTION START ### [ 289s] [ 266.506624] reboot: Power down [ 290s] ### VM INTERACTION END ### [ 290s] [ 290s] build30 failed "build libosmocore_0.9.6.20170704.dsc" at Tue Jul 4 19:55:06 UTC 2017. [ 290s] -- 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 Jul 5 08:13:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 08:13:26 +0000 Subject: osmo-trx[master]: transceiver: Avoid sending clock indications when trx is not... In-Reply-To: References: Message-ID: Patch Set 3: Yesterday evening I built osmo-trx used by osmo-gsm-tester with this patch enabled, and since then (built 1146) the osmo-gsm-tester with osmo-bts-trx seems a lot more stable: http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/ -- To view, visit https://gerrit.osmocom.org/3120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 08:57:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 08:57:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: contrib: Fix removal of doc directories Message-ID: Review at https://gerrit.osmocom.org/3121 contrib: Fix removal of doc directories The docs are actually not removed because the shell takes {libosmocore,libosmo-sccp} as a string literal if found inside quote marks, see [1] for more information. [1] https://unix.stackexchange.com/questions/67757/wildcards-inside-quotes Change-Id: Ida8941525db2d6a80539ffda29fb4fa74dbb1e16 --- M contrib/jenkins-build-common.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/21/3121/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 895cd63..efc621a 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -141,7 +141,7 @@ create_bin_tgz() { # don't package documentation -- the libosmocore docs can be up to 16 Mb large, # a significant amount compared to the binaries - rm -rf "$prefix_real/share/doc/{libosmocore,libosmo-sccp}" || true + rm -rf "$prefix_real/share/doc/"{libosmocore,libosmo-sccp} || true # build the archive that is going to be copied to the tester cd "$prefix_real" -- To view, visit https://gerrit.osmocom.org/3121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida8941525db2d6a80539ffda29fb4fa74dbb1e16 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 5 09:01:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 09:01:03 +0000 Subject: [PATCH] osmo-gsm-tester[master]: default-suites: Add smpp Message-ID: Review at https://gerrit.osmocom.org/3122 default-suites: Add smpp No need to run it for several BTS as the focus here is testing the core network and interoperation with different BTS is already tested with the sms suite. This way we avoid lossing extra time running the default suite set. Change-Id: Ie6458801ec1ecce63e08617d1e449047dc496e16 --- M example/default-suites.conf 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/3122/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index 50cbec2..4c2827b 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -2,3 +2,4 @@ - aoip_sms:sysmo - sms:trx - aoip_sms:trx +- smpp -- To view, visit https://gerrit.osmocom.org/3122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6458801ec1ecce63e08617d1e449047dc496e16 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 5 09:32:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 09:32:08 +0000 Subject: [PATCH] osmo-bts[master]: sysmo: Remove non longer valid -p option from help Message-ID: Review at https://gerrit.osmocom.org/3123 sysmo: Remove non longer valid -p option from help The dsp-trace-flags command line argument was removed in 9684099ae905e6e61cbc326035d0b37c480f6172 Change-Id: I8dbcdc7080ca3f7d7968aeef24422faa75d925fe --- M src/osmo-bts-sysmo/main.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/23/3123/1 diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index a8b7b50..ce12d63 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -120,7 +120,6 @@ void bts_model_print_help() { printf( - " -p --dsp-trace Set DSP trace flags\n" " -w --hw-version Print the targeted HW Version\n" " -M --pcu-direct Force PCU to access message queue for " "PDCH dchannel directly\n" -- To view, visit https://gerrit.osmocom.org/3123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8dbcdc7080ca3f7d7968aeef24422faa75d925fe Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 5 09:59:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 09:59:51 +0000 Subject: [PATCH] osmo-gsm-tester[master]: default-suites: Add smpp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3122 to look at the new patch set (#2). default-suites: Add smpp No need to run it for several BTS as the focus here is testing the core network and interoperation with different BTS is already tested with the sms suite. This way we avoid lossing extra time running the default suite set. Change-Id: Ie6458801ec1ecce63e08617d1e449047dc496e16 --- M example/default-suites.conf 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/3122/2 diff --git a/example/default-suites.conf b/example/default-suites.conf index 50cbec2..eba7dea 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -2,3 +2,5 @@ - aoip_sms:sysmo - sms:trx - aoip_sms:trx +- smpp +- aoip_smpp -- To view, visit https://gerrit.osmocom.org/3122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie6458801ec1ecce63e08617d1e449047dc496e16 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 5 10:07:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 10:07:48 +0000 Subject: osmo-trx[master]: transceiver: Avoid sending clock indications when trx is not... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 This patch appears to be the solution to making osmo-bts-trx stable in the osmo-gsm-tester. I would appreciate this being merged. -- To view, visit https://gerrit.osmocom.org/3120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 10:24:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 10:24:22 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: smpp.adoc: Small improvements Message-ID: Review at https://gerrit.osmocom.org/3124 smpp.adoc: Small improvements Change-Id: I594b89094413758146bb25f5262902e263f8f3d1 --- M OsmoNITB/chapters/smpp.adoc 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/24/3124/1 diff --git a/OsmoNITB/chapters/smpp.adoc b/OsmoNITB/chapters/smpp.adoc index 91f8c07..eacbb80 100644 --- a/OsmoNITB/chapters/smpp.adoc +++ b/OsmoNITB/chapters/smpp.adoc @@ -22,15 +22,16 @@ There is a `smpp` vty node at the top level of the OsmoNITB -configuration. Under this node, the global SMPP configuration is +configuration. Under this node, the global SMPP configuration is performed. -Use the `local-tcp-port` command to define the TCP port at which the +Use the `local-tcp-ip` command to define the TCP IP and port at which the OsmoNITB internal SMSC should listen for incoming SMPP connections. The -default port assigned to SMPP is 2775. +default behaviour is to listen on all IPs (0.0.0.0), and the default port +assigned to SMPP is 2775. -Use the `system-id` command to define the System ID of the SMSC. +Use the `system-id` command to define the System ID of the SMSC. Use the `policy` parameter to define whether only explicitly configured ESMEs are permitted to access the SMSC (`closed`), or whether any -- To view, visit https://gerrit.osmocom.org/3124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I594b89094413758146bb25f5262902e263f8f3d1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 5 10:54:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 10:54:05 +0000 Subject: [PATCH] osmo-iuh[master]: jenkins: build from libosmo-netif master Message-ID: Review at https://gerrit.osmocom.org/3125 jenkins: build from libosmo-netif master After merge of the sysmocom/sctp branch to master, it was forgotten to change this build script to move along to master. Change-Id: I473d1361b99ff0ff8adba9326b0e2dfbc48a3aef --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/25/3125/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 06f170b..bf2c7cb 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -18,7 +18,7 @@ export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmo-abis -osmo-build-dep.sh libosmo-netif sysmocom/sctp +osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp sysmocom/iu osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/3125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I473d1361b99ff0ff8adba9326b0e2dfbc48a3aef Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:03:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:03:08 +0000 Subject: osmo-iuh[master]: jenkins: build from libosmo-netif master In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I473d1361b99ff0ff8adba9326b0e2dfbc48a3aef Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh 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 Jul 5 11:03:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:03:14 +0000 Subject: [MERGED] osmo-iuh[master]: jenkins: build from libosmo-netif master In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: build from libosmo-netif master ...................................................................... jenkins: build from libosmo-netif master After merge of the sysmocom/sctp branch to master, it was forgotten to change this build script to move along to master. Change-Id: I473d1361b99ff0ff8adba9326b0e2dfbc48a3aef --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 06f170b..bf2c7cb 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -18,7 +18,7 @@ export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmo-abis -osmo-build-dep.sh libosmo-netif sysmocom/sctp +osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp sysmocom/iu osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/3125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I473d1361b99ff0ff8adba9326b0e2dfbc48a3aef Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:05:05 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 5 Jul 2017 11:05:05 +0000 Subject: [PATCH] openbsc[master]: smpp: fix return cause Message-ID: Review at https://gerrit.osmocom.org/3126 smpp: fix return cause Return cause 38 when default SMPP route is unavailable. This is better than cause 1. Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.c M openbsc/src/libmsc/smpp_smsc.h 4 files changed, 13 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/3126/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index aa2030f..acf425a 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -294,6 +294,7 @@ if (smpp_first) { rc = smpp_try_deliver(gsms, conn, deferred); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) + /* unknown subscriber, try local */ goto try_local; if (rc < 0) { LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index f94968a..3246d79 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -708,11 +708,11 @@ dst.npi = sms->dst.npi; memcpy(dst.addr, sms->dst.addr, sizeof(dst.addr)); - esme = smpp_route(g_smsc, &dst); - if (!esme) - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rc = smpp_route(g_smsc, &dst, &esme); + if (!rc) + rc = deliver_to_esme(esme, sms, conn); - return deliver_to_esme(esme, sms, conn, deferred); + return rc; } struct smsc *smsc_from_vty(struct vty *v) diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 48a1192..812b661 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -270,8 +270,7 @@ } /*! \brief try to find a SMPP route (ESME) for given destination */ -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest) +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **pesme) { struct osmo_smpp_route *r; struct osmo_smpp_acl *acl = NULL; @@ -314,15 +313,17 @@ struct osmo_esme *esme; DEBUGP(DSMPP, "ACL even has ESME, we can route to it!\n"); esme = acl->esme; - if (esme->bind_flags & ESME_BIND_RX) - return esme; - else + if (esme->bind_flags & ESME_BIND_RX) { + *pesme = esme; + return 0; + } else LOGP(DSMPP, LOGL_NOTICE, "[%s] is matching route, " "but not bound for Rx, discarding MO SMS\n", esme->system_id); } - return NULL; + *pesme = NULL; + return (acl) ? 38 /* network out of order */ : 1 /* number unsassigned */; } diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index d8e82e4..c9209ef 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -126,8 +126,7 @@ void smpp_esme_get(struct osmo_esme *esme); void smpp_esme_put(struct osmo_esme *esme); -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest); +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **emse); struct osmo_smpp_acl *smpp_acl_alloc(struct smsc *smsc, const char *sys_id); struct osmo_smpp_acl *smpp_acl_by_system_id(struct smsc *smsc, -- To view, visit https://gerrit.osmocom.org/3126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:05:05 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 5 Jul 2017 11:05:05 +0000 Subject: [PATCH] openbsc[master]: transaction: reject calls from unidentified subscribers Message-ID: Review at https://gerrit.osmocom.org/3127 transaction: reject calls from unidentified subscribers A valid subscriber is indespensible when allocating a new transaction. Return NULL if no subscriber is supplied. This will cause unidentified subscribers to be rejected. Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d --- M openbsc/src/libmsc/transaction.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/3127/1 diff --git a/openbsc/src/libmsc/transaction.c b/openbsc/src/libmsc/transaction.c index dba4bed..f9dc1a3 100644 --- a/openbsc/src/libmsc/transaction.c +++ b/openbsc/src/libmsc/transaction.c @@ -70,6 +70,10 @@ DEBUGP(DCC, "subscr=%p, net=%p\n", subscr, net); + /* a valid subscriber is indispensable */ + if (subscr == NULL) + return NULL; + trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:05:06 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 5 Jul 2017 11:05:06 +0000 Subject: [PATCH] openbsc[master]: 04.08: find a portable way to obtain the timezone offset Message-ID: Review at https://gerrit.osmocom.org/3128 04.08: find a portable way to obtain the timezone offset Portable GMT offset calculation to display correct time on GSM. Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 --- M openbsc/src/libmsc/gsm_04_08.c 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/3128/1 diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 89108e4..f1b2a4b 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -861,12 +861,20 @@ else { /* Need to get GSM offset and convert into 15 min units */ /* This probably breaks if gmtoff returns a value not evenly divisible by 15? */ - local_time = localtime(&cur_t); #ifdef HAVE_TM_GMTOFF_IN_TM + local_time = localtime(&cur_t); tzunits = (local_time->tm_gmtoff/60)/15; #else -#warning find a portable way to obtain the timezone offset - tzunits = 0; + /* #warning find a portable way to obtain the timezone offset + * this should be portable */ + time_t utc; + double offsetFromUTC; + utc = mktime(gmt_time); + local_time = localtime(&cur_t); + offsetFromUTC = difftime(cur_t, utc); + if (local_time->tm_isdst) + offsetFromUTC += 3600.0; + tzunits = ((int)offsetFromUTC) / 60 / 15; #endif if (tzunits < 0) { tzunits = tzunits/-1; -- To view, visit https://gerrit.osmocom.org/3128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:05:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:05:38 +0000 Subject: [PATCH] osmo-iuh[master]: migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA 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/3109 to look at the new patch set (#2). migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA libosmo-sigtran now has a "proper" SCCP/M3UA stack, so we can make our hnb-gw 3GPP compliant by switching from the old SUA code to the new universal SCCP user API with support for (currently) M3UA and SUA. Main changes: Use one cn_link to STP: We will connect to the core network using an (Osmo)STP instance that routes to MSC and SGSN, so we want one SCCP link instead of two. The only difference between IuCS and IuPS is a different remote osmo_sccp_addr. This has various effects through the messaging code; the patch is a bit larger than I would like, but it is hard to separate out truly independent smaller changes. CS or PS domain was previously flagged in the separate cn_link, as ctx pointer for two separate sccp_sap_up()s. Now there's just one such ctx, so determine is_ps from the RANAP Domain Indicator, or from the conn's hnbgw_context_map: - Add is_ps to context_map_alloc_by_hnb(). - To find a matching context, the RUA ID alone is no longer sufficient, also match is_ps (possible optimization todo: separate lists). We would send separate CS or PS Reset messages based on the cn_link, instead send both CS and PS Reset at the same time for the single cn_link. This could be adjusted to detect presence of MSC or SGSN instead. Pending: adjust the VTY config to reflect that there is only one remote address. Place a TODO comment for that. Smaller changes: rua_to_scu(): populate called and calling addresses for N_CONNECT and N_UNITDATA. Remove DSUA. Don't build dummy_cn, which is still implemented on SUA. Mark todo to maybe re-include it based on M3UA later. In hnbgw_cnlink, place sccp related items in a separate sub-struct. Do not keep an llist of cn_links, just have the one. Remove iteration and list management. Change jenkins script to build libosmo-sccp master. Patch-by: hwelte, nhofmeyr Change-Id: I8ac15fa2fd25bedb26297177e416976a5389b573 --- M contrib/jenkins.sh M include/osmocom/iuh/context_map.h M include/osmocom/iuh/hnbgw.h M include/osmocom/iuh/hnbgw_cn.h M src/context_map.c M src/hnbgw.c M src/hnbgw_cn.c M src/hnbgw_rua.c M src/tests/Makefile.am M src/tests/test_common.c 10 files changed, 133 insertions(+), 134 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/09/3109/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index bf2c7cb..b500e1c 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -19,7 +19,7 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif -osmo-build-dep.sh libosmo-sccp sysmocom/iu +osmo-build-dep.sh libosmo-sccp osmo-build-dep.sh libasn1c # the asn1c binary is used by the 'regen' target below diff --git a/include/osmocom/iuh/context_map.h b/include/osmocom/iuh/context_map.h index c1a4495..8d957d6 100644 --- a/include/osmocom/iuh/context_map.h +++ b/include/osmocom/iuh/context_map.h @@ -24,6 +24,8 @@ struct hnbgw_cnlink *cn_link; /* RUA contxt ID */ uint32_t rua_ctx_id; + /* False for CS, true for PS */ + bool is_ps; /* SCCP User SAP connection ID */ uint32_t scu_conn_id; @@ -33,6 +35,7 @@ struct hnbgw_context_map * context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id, + bool is_ps, struct hnbgw_cnlink *cn_if_new); struct hnbgw_context_map * diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index 4880d48..db22d97 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -5,6 +5,7 @@ #include #include #include +#include #define DEBUG #include @@ -13,15 +14,16 @@ enum { DMAIN, DHNBAP, - DSUA, DRUA, DRANAP, }; #define HNBGW_LOCAL_IP_DEFAULT "0.0.0.0" +/* TODO: CS and PS now both connect to OsmoSTP, i.e. that's always going to be the same address. Drop the + * duplicity. */ #define HNBGW_IUCS_REMOTE_IP_DEFAULT "127.0.0.1" -#define HNBGW_IUPS_REMOTE_IP_DEFAULT "127.0.0.2" +#define HNBGW_IUPS_REMOTE_IP_DEFAULT "127.0.0.1" /* 25.467 Section 7.1 */ #define IUH_DEFAULT_SCTP_PORT 29169 @@ -63,15 +65,11 @@ struct llist_head list; enum hnbgw_cnlink_state state; struct hnb_gw *gw; - /* are we a PS connection (1) or CS (0) */ - int is_ps; /* timer for re-transmitting the RANAP Reset */ struct osmo_timer_list T_RafC; /* reference to the SCCP User SAP by which we communicate */ - struct osmo_sccp_user *sua_user; - struct osmo_sccp_link *sua_link; - struct osmo_sccp_addr local_addr; - struct osmo_sccp_addr remote_addr; + struct osmo_sccp_instance *sccp; + struct osmo_sccp_user *sccp_user; uint32_t next_conn_id; /* linked list of hnbgw_context_map */ @@ -131,14 +129,17 @@ struct llist_head hnb_list; /* list of struct ue_context */ struct llist_head ue_list; - /* list of struct hnbgw_cnlink */ - struct llist_head cn_list; /* next availble UE Context ID */ uint32_t next_ue_ctx_id; /* currently active CN links for CS and PS */ - struct hnbgw_cnlink *cnlink_cs; - struct hnbgw_cnlink *cnlink_ps; + struct { + struct osmo_sccp_instance *instance; + struct hnbgw_cnlink *cnlink; + struct osmo_sccp_addr local_addr; + struct osmo_sccp_addr remote_addr_cs; + struct osmo_sccp_addr remote_addr_ps; + } sccp; }; extern void *talloc_asn1_ctx; diff --git a/include/osmocom/iuh/hnbgw_cn.h b/include/osmocom/iuh/hnbgw_cn.h index d5bec04..93123f2 100644 --- a/include/osmocom/iuh/hnbgw_cn.h +++ b/include/osmocom/iuh/hnbgw_cn.h @@ -2,4 +2,5 @@ #include -struct hnbgw_cnlink *hnbgw_cnlink_init(struct hnb_gw *gw, const char *host, uint16_t port, int is_ps); +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, + const char *local_ip, uint32_t local_pc); diff --git a/src/context_map.c b/src/context_map.c index 052133c..0960cb9 100644 --- a/src/context_map.c +++ b/src/context_map.c @@ -58,6 +58,7 @@ /* Map from a HNB + ContextID to the SCCP-side Connection ID */ struct hnbgw_context_map * context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id, + bool is_ps, struct hnbgw_cnlink *cn_if_new) { struct hnbgw_context_map *map; @@ -69,7 +70,8 @@ if (map->cn_link != cn_if_new) { continue; } - if (map->rua_ctx_id == rua_ctx_id) { + if (map->rua_ctx_id == rua_ctx_id + && map->is_ps == is_ps) { return map; } } @@ -88,6 +90,7 @@ map->cn_link = cn_if_new; map->hnb_ctx = hnb; map->rua_ctx_id = rua_ctx_id; + map->is_ps = is_ps; map->scu_conn_id = new_scu_conn_id; /* put it into both lists */ @@ -134,31 +137,27 @@ static void context_map_tmr_cb(void *data) { struct hnb_gw *gw = data; - struct hnbgw_cnlink *cn; + struct hnbgw_cnlink *cn = gw->sccp.cnlink; + struct hnbgw_context_map *map; DEBUGP(DMAIN, "Running context mapper garbage collection\n"); - /* iterate over list of core network (links) */ - llist_for_each_entry(cn, &gw->cn_list, list) { - struct hnbgw_context_map *map; - - llist_for_each_entry(map, &cn->map_list, cn_list) { - switch (map->state) { - case MAP_S_RESERVED1: - /* first time we see this reserved - * entry: mark it for stage 2 */ - map->state = MAP_S_RESERVED2; - break; - case MAP_S_RESERVED2: - /* first time we see this reserved - * entry: remove it */ - map->state = MAP_S_NULL; - llist_del(&map->cn_list); - llist_del(&map->hnb_list); - talloc_free(map); - break; - default: - break; - } + llist_for_each_entry(map, &cn->map_list, cn_list) { + switch (map->state) { + case MAP_S_RESERVED1: + /* first time we see this reserved + * entry: mark it for stage 2 */ + map->state = MAP_S_RESERVED2; + break; + case MAP_S_RESERVED2: + /* first time we see this reserved + * entry: remove it */ + map->state = MAP_S_NULL; + llist_del(&map->cn_list); + llist_del(&map->hnb_list); + talloc_free(map); + break; + default: + break; } } /* re-schedule this timer */ diff --git a/src/hnbgw.c b/src/hnbgw.c index 9984927..5d9f87b 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -47,8 +47,7 @@ #include -#include -#include +#include #include #include @@ -82,16 +81,15 @@ gw->config.iucs_remote_ip = talloc_strdup(gw, HNBGW_IUCS_REMOTE_IP_DEFAULT); - gw->config.iucs_remote_port = SUA_PORT; + gw->config.iucs_remote_port = M3UA_PORT; gw->config.iups_remote_ip = talloc_strdup(gw, HNBGW_IUPS_REMOTE_IP_DEFAULT); - gw->config.iups_remote_port = SUA_PORT; + gw->config.iups_remote_port = M3UA_PORT; gw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&gw->hnb_list); INIT_LLIST_HEAD(&gw->ue_list); - INIT_LLIST_HEAD(&gw->cn_list); context_map_init(gw); @@ -330,11 +328,6 @@ .color = "", .description = "Home Node B Application Part", }, - [DSUA] = { - .name = "DSUA", .loglevel = LOGL_DEBUG, .enabled = 1, - .color = "", - .description = "SCCP User Adaptation", - }, [DRUA] = { .name = "DRUA", .loglevel = LOGL_DEBUG, .enabled = 1, .color = "", @@ -382,7 +375,7 @@ static void print_help() { printf(" -h --help This text.\n"); - printf(" -d option --debug=DHNBAP:DSUA:DRUA:DRANAP:DMAIN Enable debugging.\n"); + printf(" -d option --debug=DHNBAP:DRUA:DRANAP:DMAIN 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"); @@ -451,7 +444,7 @@ int main(int argc, char **argv) { - struct osmo_sccp_user *sua_user; + struct osmo_sccp_user *sccp_user; struct osmo_sccp_link *sua_link; struct osmo_stream_srv_link *srv; int rc; @@ -466,6 +459,8 @@ rc = osmo_init_logging(&hnbgw_log_info); if (rc < 0) exit(1); + + osmo_ss7_init(); vty_info.copyright = osmo_hnbgw_copyright; vty_init(&vty_info); @@ -504,19 +499,25 @@ exit(1); } - osmo_sua_set_log_area(DSUA); ranap_set_log_area(DRANAP); OSMO_ASSERT(g_hnb_gw->config.iucs_remote_ip); - g_hnb_gw->cnlink_cs = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iucs_remote_ip, - g_hnb_gw->config.iucs_remote_port, - 0); - OSMO_ASSERT(g_hnb_gw->config.iups_remote_ip); - g_hnb_gw->cnlink_ps = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iups_remote_ip, - g_hnb_gw->config.iups_remote_port, - 1); + rc = hnbgw_cnlink_init(g_hnb_gw, + g_hnb_gw->config.iucs_remote_ip, + g_hnb_gw->config.iucs_remote_port, + "127.0.0.5" /* FIXME: configurable */, + 23 /* FIXME: configurable */); + if (rc < 0) { + LOGP(DMAIN, LOGL_ERROR, "Failed to initialize SCCP link to CN\n"); + exit(1); + } + + osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_cs, + 1 /* FIXME: configurable */, + OSMO_SCCP_SSN_RANAP); + osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_ps, + 2 /* FIXME: configurable */, + OSMO_SCCP_SSN_RANAP); OSMO_ASSERT(g_hnb_gw->config.iuh_local_ip); LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n", diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 4e5b2e0..2fd9d71 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -24,8 +24,7 @@ #include #include -#include -#include +#include #include #include @@ -41,34 +40,32 @@ int hnbgw_cnlink_change_state(struct hnbgw_cnlink *cnlink, enum hnbgw_cnlink_state state); -static int transmit_rst(struct hnbgw_cnlink *cnlink) +static int transmit_rst(struct hnb_gw *gw, RANAP_CN_DomainIndicator_t domain, + struct osmo_sccp_addr *remote_addr) { struct msgb *msg; struct msgb *msgprim; - RANAP_CN_DomainIndicator_t domain; RANAP_Cause_t cause = { .present = RANAP_Cause_PR_transmissionNetwork, .choice. transmissionNetwork = RANAP_CauseTransmissionNetwork_signalling_transport_resource_failure, }; - if (cnlink->is_ps) - domain = RANAP_CN_DomainIndicator_ps_domain; - else - domain = RANAP_CN_DomainIndicator_cs_domain; - msg = ranap_new_msg_reset(domain, &cause); - return osmo_sccp_tx_unitdata_msg(cnlink->sua_link, &cnlink->local_addr, - &cnlink->remote_addr, msg); + return osmo_sccp_tx_unitdata_msg(gw->sccp.cnlink->sccp_user, + &gw->sccp.local_addr, + remote_addr, + msg); } /* Timer callback once T_RafC expires */ static void cnlink_trafc_cb(void *data) { - struct hnbgw_cnlink *cnlink = data; + struct hnb_gw *gw = data; - transmit_rst(cnlink); - hnbgw_cnlink_change_state(cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); + transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.remote_addr_cs); + transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.remote_addr_ps); + hnbgw_cnlink_change_state(gw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); /* The spec states that we should abandon after a configurable * number of times. We decide to simply continue trying */ } @@ -81,7 +78,7 @@ case CNLINK_S_EST_PEND: break; case CNLINK_S_EST_CONF: - cnlink_trafc_cb(cnlink); + cnlink_trafc_cb(cnlink->gw); break; case CNLINK_S_EST_RST_TX_WAIT_ACK: osmo_timer_schedule(&cnlink->T_RafC, 5, 0); @@ -293,7 +290,7 @@ return 0; } - return rua_tx_dt(map->hnb_ctx, map->cn_link->is_ps, map->rua_ctx_id, + return rua_tx_dt(map->hnb_ctx, map->is_ps, map->rua_ctx_id, msgb_l2(oph->msg), msgb_l2len(oph->msg)); } @@ -322,15 +319,15 @@ return 0; } - return rua_tx_disc(map->hnb_ctx, map->cn_link->is_ps, map->rua_ctx_id, + return rua_tx_disc(map->hnb_ctx, map->is_ps, map->rua_ctx_id, &rua_cause, msgb_l2(oph->msg), msgb_l2len(oph->msg)); } /* Entry point for primitives coming up from SCCP User SAP */ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *ctx) { - struct osmo_sccp_link *slink = ctx; - struct hnbgw_cnlink *cnlink = osmo_sccp_link_get_user_priv(slink); + struct osmo_sccp_user *scu = ctx; + struct hnbgw_cnlink *cnlink = osmo_sccp_user_get_priv(scu); struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; int rc; @@ -361,53 +358,48 @@ return 0; } - -/* Set up a link towards the core network for the circuit switched (is_ps == 0) - * or packet switched (is_ps != 0) domain. */ -struct hnbgw_cnlink *hnbgw_cnlink_init(struct hnb_gw *gw, const char *host, uint16_t port, int is_ps) +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, + const char *local_ip, uint32_t local_pc) { - struct hnbgw_cnlink *cnlink = talloc_zero(gw, struct hnbgw_cnlink); + struct hnbgw_cnlink *cnlink; int rc; + OSMO_ASSERT(!gw->sccp.instance); + OSMO_ASSERT(!gw->sccp.cnlink); + + gw->sccp.instance = osmo_sccp_simple_client(gw, "OsmoHNBGW", local_pc, + OSMO_SS7_ASP_PROT_M3UA, 0, local_ip, + stp_port, stp_host); + if (!gw->sccp.instance) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Instance\n"); + return -1; + } + + LOGP(DRUA, LOGL_DEBUG, "SCCP uplink to STP: %s %u\n", stp_host, stp_port); + + osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, + OSMO_SCCP_SSN_RANAP); + + cnlink = talloc_zero(gw, struct hnbgw_cnlink); cnlink->gw = gw; INIT_LLIST_HEAD(&cnlink->map_list); cnlink->T_RafC.cb = cnlink_trafc_cb; - cnlink->T_RafC.data = cnlink; + cnlink->T_RafC.data = gw; cnlink->next_conn_id = 1000; - cnlink->is_ps = is_ps; - osmo_sccp_make_addr_pc_ssn(&cnlink->local_addr, 2, - OSMO_SCCP_SSN_RANAP); - osmo_sccp_make_addr_pc_ssn(&cnlink->remote_addr, 1, - OSMO_SCCP_SSN_RANAP); - LOGP(DRUA, LOGL_DEBUG, "New hnbgw_cnlink %p (gw %p): %s %d %s\n", - cnlink, cnlink->gw, host, port, is_ps? "PS" : "CS"); - - cnlink->sua_user = osmo_sua_user_create(cnlink, sccp_sap_up, cnlink); - if (!cnlink->sua_user) { - LOGP(DMAIN, LOGL_ERROR, "Failed to init SUA\n"); - goto out_free; - } - rc = osmo_sua_client_connect(cnlink->sua_user, host, port); - if (rc < 0) { - LOGP(DMAIN, LOGL_ERROR, "Failed to connect SUA\n"); - goto out_user; - } - cnlink->sua_link = osmo_sua_client_get_link(cnlink->sua_user); - if (!cnlink->sua_link) { - LOGP(DMAIN, LOGL_ERROR, "Failed to get SUA link\n"); - goto out_disconnect; + cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.instance, + "OsmoHNBGW", + sccp_sap_up, OSMO_SCCP_SSN_RANAP, + gw->sccp.local_addr.pc); + if (!cnlink->sccp_user) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP User\n"); + return -1; } - llist_add_tail(&cnlink->list, &gw->cn_list); + /* In sccp_sap_up() we expect the cnlink in the user's priv. */ + osmo_sccp_user_set_priv(cnlink->sccp_user, cnlink); - return cnlink; + gw->sccp.cnlink = cnlink; -out_disconnect: - /* FIXME */ -out_user: - osmo_sua_user_destroy(cnlink->sua_user); -out_free: - talloc_free(cnlink); - return NULL; + return 0; } diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 6190fd0..329f990 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -170,15 +169,19 @@ struct msgb *msg; struct osmo_scu_prim *prim; struct hnbgw_context_map *map; - struct hnbgw_cnlink *cn; + struct hnbgw_cnlink *cn = hnb->gw->sccp.cnlink; + struct osmo_sccp_addr *remote_addr; + bool is_ps; int rc; switch (cN_DomainIndicator) { case RUA_CN_DomainIndicator_cs_domain: - cn = hnb->gw->cnlink_cs; + remote_addr = &hnb->gw->sccp.remote_addr_cs; + is_ps = false; break; case RUA_CN_DomainIndicator_ps_domain: - cn = hnb->gw->cnlink_ps; + remote_addr = &hnb->gw->sccp.remote_addr_ps; + is_ps = true; break; default: LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n", @@ -191,16 +194,19 @@ return 0; } + msg = msgb_alloc(1500, "rua_to_sccp"); + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); osmo_prim_init(&prim->oph, SCCP_SAP_USER, type, PRIM_OP_REQUEST, msg); - map = context_map_alloc_by_hnb(hnb, context_id, cn); + map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn); + OSMO_ASSERT(map); /* add primitive header */ switch (type) { case OSMO_SCU_PRIM_N_CONNECT: - prim->u.connect.called_addr; - prim->u.connect.calling_addr; + prim->u.connect.called_addr = *remote_addr; + prim->u.connect.calling_addr = cn->gw->sccp.local_addr; prim->u.connect.sccp_class = 2; prim->u.connect.conn_id = map->scu_conn_id; break; @@ -212,8 +218,8 @@ prim->u.disconnect.cause = cause; break; case OSMO_SCU_PRIM_N_UNITDATA: - prim->u.unitdata.called_addr; - prim->u.unitdata.calling_addr; + prim->u.unitdata.called_addr = *remote_addr; + prim->u.unitdata.calling_addr = cn->gw->sccp.local_addr; break; default: return -EINVAL; @@ -225,7 +231,7 @@ memcpy(msg->l2h, data, len); } - rc = osmo_sua_user_link_down(cn->sua_link, &prim->oph); + rc = osmo_sccp_user_sap_down(cn->sccp_user, &prim->oph); return rc; } diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index e2bea07..28ad56c 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -5,7 +5,7 @@ COMMON_LIBS = $(OSMOVTY_LIBS) $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) -lsctp -check_PROGRAMS = test-ranap test-helpers test-hnbap hnb-test dummy-cn +check_PROGRAMS = test-ranap test-helpers test-hnbap hnb-test #dummy-cn noinst_HEADERS = test_common.h hnb-test.h hnb-test-layers.h @@ -24,8 +24,9 @@ test_ranap_SOURCES = $(RANAP_FILES) test-ranap.c test_common.c test_ranap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la -dummy_cn_SOURCES = $(RANAP_FILES) test_common.c dummy_cn_sua.c -dummy_cn_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la +# TODO: re-add using SCCP? +#dummy_cn_SOURCES = $(RANAP_FILES) test_common.c dummy_cn_sua.c +#dummy_cn_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la $(top_builddir)/src/libosmo-ranap.la: $(MAKE) -C $(top_builddir)/src libosmo-ranap.la diff --git a/src/tests/test_common.c b/src/tests/test_common.c index ba00709..c8aafdd 100644 --- a/src/tests/test_common.c +++ b/src/tests/test_common.c @@ -62,11 +62,6 @@ .color = "", .description = "RANAP User Adaptation", }, - [DSUA] = { - .name = "SUA", .loglevel = LOGL_DEBUG, .enabled = 1, - .color = "", - .description = "SCCP User Adaptation", - }, }; static const struct log_info test_log_info = { -- To view, visit https://gerrit.osmocom.org/3109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8ac15fa2fd25bedb26297177e416976a5389b573 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:05:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:05:38 +0000 Subject: [PATCH] osmo-iuh[master]: cn unitdata: verify correct remote addr 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/3113 to look at the new patch set (#2). cn unitdata: verify correct remote addr When receiving unitdata from the CN, verify that it is indeed coming from the remote address that matches our CS/PS domain settings. This patch came from an earlier stage where the is_ps out-parameter was actually used. While it currently isn't, it doesn't hurt to leave it there. Change-Id: I7190b4c3a05e8bac0eeffa1eab18c9e47429cb17 --- M src/hnbgw_cn.c 1 file changed, 28 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/13/3113/2 diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 8124ce5..e967260 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -240,6 +240,31 @@ return rc; } +static bool pc_and_ssn_match(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b) +{ + return (a == b) + || ((a->pc == b->pc) + && (a->ssn == b->ssn)); +} + +static int classify_cn_remote_addr(const struct hnb_gw *gw, + const struct osmo_sccp_addr *cn_remote_addr, + bool *is_ps) +{ + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_cs)) { + if (is_ps) + *is_ps = false; + return 0; + } + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_ps)) { + if (is_ps) + *is_ps = true; + return 0; + } + LOGP(DMAIN, LOGL_ERROR, "Unexpected remote address, matches neither CS nor PS address: %s\n", + osmo_sccp_addr_dump(cn_remote_addr)); + return -1; +} static int handle_cn_unitdata(struct hnbgw_cnlink *cnlink, const struct osmo_scu_unitdata_param *param, @@ -251,6 +276,9 @@ return -1; } + if (classify_cn_remote_addr(cnlink->gw, ¶m->calling_addr, NULL) < 0) + return -1; + return handle_cn_ranap(cnlink, msgb_l2(oph->msg), msgb_l2len(oph->msg)); } -- To view, visit https://gerrit.osmocom.org/3113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7190b4c3a05e8bac0eeffa1eab18c9e47429cb17 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:07:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:07:32 +0000 Subject: osmo-iuh[master]: migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 In the new patch set, only the jenkins.sh script is modified to build libosmo-sccp master instead of a legacy branch. Hence re-adding Harald's +2. -- To view, visit https://gerrit.osmocom.org/3109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ac15fa2fd25bedb26297177e416976a5389b573 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh 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 Jul 5 11:09:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:09:35 +0000 Subject: osmo-gsm-tester[master]: contrib: Fix removal of doc directories In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 argh! there's a patch I failed to test. Thanks! -- To view, visit https://gerrit.osmocom.org/3121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida8941525db2d6a80539ffda29fb4fa74dbb1e16 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:09:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:09:48 +0000 Subject: [MERGED] osmo-gsm-tester[master]: contrib: Fix removal of doc directories In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: contrib: Fix removal of doc directories ...................................................................... contrib: Fix removal of doc directories The docs are actually not removed because the shell takes {libosmocore,libosmo-sccp} as a string literal if found inside quote marks, see [1] for more information. [1] https://unix.stackexchange.com/questions/67757/wildcards-inside-quotes Change-Id: Ida8941525db2d6a80539ffda29fb4fa74dbb1e16 --- M contrib/jenkins-build-common.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 895cd63..efc621a 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -141,7 +141,7 @@ create_bin_tgz() { # don't package documentation -- the libosmocore docs can be up to 16 Mb large, # a significant amount compared to the binaries - rm -rf "$prefix_real/share/doc/{libosmocore,libosmo-sccp}" || true + rm -rf "$prefix_real/share/doc/"{libosmocore,libosmo-sccp} || true # build the archive that is going to be copied to the tester cd "$prefix_real" -- To view, visit https://gerrit.osmocom.org/3121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida8941525db2d6a80539ffda29fb4fa74dbb1e16 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:12:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:12:29 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: smpp.adoc: describe VTY cmd 'local-tcp-ip' instead of 'local... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3124 to look at the new patch set (#2). smpp.adoc: describe VTY cmd 'local-tcp-ip' instead of 'local-tcp-port' Change-Id: I594b89094413758146bb25f5262902e263f8f3d1 --- M OsmoNITB/chapters/smpp.adoc 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/24/3124/2 diff --git a/OsmoNITB/chapters/smpp.adoc b/OsmoNITB/chapters/smpp.adoc index 91f8c07..eacbb80 100644 --- a/OsmoNITB/chapters/smpp.adoc +++ b/OsmoNITB/chapters/smpp.adoc @@ -22,15 +22,16 @@ There is a `smpp` vty node at the top level of the OsmoNITB -configuration. Under this node, the global SMPP configuration is +configuration. Under this node, the global SMPP configuration is performed. -Use the `local-tcp-port` command to define the TCP port at which the +Use the `local-tcp-ip` command to define the TCP IP and port at which the OsmoNITB internal SMSC should listen for incoming SMPP connections. The -default port assigned to SMPP is 2775. +default behaviour is to listen on all IPs (0.0.0.0), and the default port +assigned to SMPP is 2775. -Use the `system-id` command to define the System ID of the SMSC. +Use the `system-id` command to define the System ID of the SMSC. Use the `policy` parameter to define whether only explicitly configured ESMEs are permitted to access the SMSC (`closed`), or whether any -- To view, visit https://gerrit.osmocom.org/3124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I594b89094413758146bb25f5262902e263f8f3d1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:12:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:12:33 +0000 Subject: osmo-gsm-manuals[master]: smpp.adoc: describe VTY cmd 'local-tcp-ip' instead of 'local... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I594b89094413758146bb25f5262902e263f8f3d1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:12:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:12:36 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: smpp.adoc: describe VTY cmd 'local-tcp-ip' instead of 'local... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: smpp.adoc: describe VTY cmd 'local-tcp-ip' instead of 'local-tcp-port' ...................................................................... smpp.adoc: describe VTY cmd 'local-tcp-ip' instead of 'local-tcp-port' Change-Id: I594b89094413758146bb25f5262902e263f8f3d1 --- M OsmoNITB/chapters/smpp.adoc 1 file changed, 5 insertions(+), 4 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoNITB/chapters/smpp.adoc b/OsmoNITB/chapters/smpp.adoc index 91f8c07..eacbb80 100644 --- a/OsmoNITB/chapters/smpp.adoc +++ b/OsmoNITB/chapters/smpp.adoc @@ -22,15 +22,16 @@ There is a `smpp` vty node at the top level of the OsmoNITB -configuration. Under this node, the global SMPP configuration is +configuration. Under this node, the global SMPP configuration is performed. -Use the `local-tcp-port` command to define the TCP port at which the +Use the `local-tcp-ip` command to define the TCP IP and port at which the OsmoNITB internal SMSC should listen for incoming SMPP connections. The -default port assigned to SMPP is 2775. +default behaviour is to listen on all IPs (0.0.0.0), and the default port +assigned to SMPP is 2775. -Use the `system-id` command to define the System ID of the SMSC. +Use the `system-id` command to define the System ID of the SMSC. Use the `policy` parameter to define whether only explicitly configured ESMEs are permitted to access the SMSC (`closed`), or whether any -- To view, visit https://gerrit.osmocom.org/3124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I594b89094413758146bb25f5262902e263f8f3d1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:24:58 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 5 Jul 2017 11:24:58 +0000 Subject: [PATCH] openbsc[master]: smpp: fix return cause In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3126 to look at the new patch set (#2). smpp: fix return cause Return cause 38 when default SMPP route is unavailable. This is better than cause 1. Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.c M openbsc/src/libmsc/smpp_smsc.h 4 files changed, 13 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/3126/2 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index aa2030f..acf425a 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -294,6 +294,7 @@ if (smpp_first) { rc = smpp_try_deliver(gsms, conn, deferred); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) + /* unknown subscriber, try local */ goto try_local; if (rc < 0) { LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index f94968a..fd26c63 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -708,11 +708,11 @@ dst.npi = sms->dst.npi; memcpy(dst.addr, sms->dst.addr, sizeof(dst.addr)); - esme = smpp_route(g_smsc, &dst); - if (!esme) - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rc = smpp_route(g_smsc, &dst, &esme); + if (!rc) + rc = deliver_to_esme(esme, sms, conn, deferred); - return deliver_to_esme(esme, sms, conn, deferred); + return rc; } struct smsc *smsc_from_vty(struct vty *v) diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 48a1192..812b661 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -270,8 +270,7 @@ } /*! \brief try to find a SMPP route (ESME) for given destination */ -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest) +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **pesme) { struct osmo_smpp_route *r; struct osmo_smpp_acl *acl = NULL; @@ -314,15 +313,17 @@ struct osmo_esme *esme; DEBUGP(DSMPP, "ACL even has ESME, we can route to it!\n"); esme = acl->esme; - if (esme->bind_flags & ESME_BIND_RX) - return esme; - else + if (esme->bind_flags & ESME_BIND_RX) { + *pesme = esme; + return 0; + } else LOGP(DSMPP, LOGL_NOTICE, "[%s] is matching route, " "but not bound for Rx, discarding MO SMS\n", esme->system_id); } - return NULL; + *pesme = NULL; + return (acl) ? 38 /* network out of order */ : 1 /* number unsassigned */; } diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index d8e82e4..c9209ef 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -126,8 +126,7 @@ void smpp_esme_get(struct osmo_esme *esme); void smpp_esme_put(struct osmo_esme *esme); -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest); +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **emse); struct osmo_smpp_acl *smpp_acl_alloc(struct smsc *smsc, const char *sys_id); struct osmo_smpp_acl *smpp_acl_by_system_id(struct smsc *smsc, -- To view, visit https://gerrit.osmocom.org/3126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:25:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 5 Jul 2017 11:25:05 +0000 Subject: osmo-gsm-tester[master]: default-suites: Add smpp In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6458801ec1ecce63e08617d1e449047dc496e16 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:35:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 11:35:44 +0000 Subject: [MERGED] osmo-gsm-tester[master]: default-suites: Add smpp In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: default-suites: Add smpp ...................................................................... default-suites: Add smpp No need to run it for several BTS as the focus here is testing the core network and interoperation with different BTS is already tested with the sms suite. This way we avoid lossing extra time running the default suite set. Change-Id: Ie6458801ec1ecce63e08617d1e449047dc496e16 --- M example/default-suites.conf 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/default-suites.conf b/example/default-suites.conf index 50cbec2..eba7dea 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -2,3 +2,5 @@ - aoip_sms:sysmo - sms:trx - aoip_sms:trx +- smpp +- aoip_smpp -- To view, visit https://gerrit.osmocom.org/3122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6458801ec1ecce63e08617d1e449047dc496e16 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:40:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 11:40:36 +0000 Subject: [PATCH] osmo-gsm-tester[master]: esme: run_method_expect_failure: Check failure in server res... Message-ID: Review at https://gerrit.osmocom.org/3129 esme: run_method_expect_failure: Check failure in server response We can now enable the esme_ms_sms test part which asserts that sending an SMS to an msisdn with unknown destination triggers an error. Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e --- M src/osmo_gsm_tester/esme.py M suites/smpp/esme_ms_sms.py 2 files changed, 17 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/29/3129/1 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index f92863d..5d3bf37 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -108,14 +108,26 @@ self.client.disconnect() self.connected = False - def run_method_expect_failure(self, errcode, method, *args): + # Used in 'run_method_expect_failure', defined here because lambda functions cannot contain assigments: + def trigger_message_sent(self): + self.message_sent = True + + def run_method_expect_failure(self, errcode, method, *args, check_smsc_resp=False): + old_func = self.client.message_sent_handler try: method(*args) + if check_smsc_resp: # failure is contained in SMS response to our query, wait for it + self.message_sent = False + self.client.set_message_sent_handler(self.trigger_message_sent) + event_loop.wait(self, lambda: self.message_sent == True, timeout=10) #it should not succeed, raise an exception: raise log.Error('SMPP Failure: %s should have failed with SMPP error %d (%s) but succeeded.' % (method, errcode, smpplib.consts.DESCRIPTIONS[errcode])) except smpplib.exceptions.PDUError as e: if e.args[1] != errcode: raise e + self.dbg('Expected failure triggered: %d' % errcode) + finally: + self.client.set_message_sent_handler(old_func) def sms_send(self, sms_obj): parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms.py index bc9d7d4..b6e7868 100755 --- a/suites/smpp/esme_ms_sms.py +++ b/suites/smpp/esme_ms_sms.py @@ -41,9 +41,9 @@ # FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) -# wrong_msisdn = ms.msisdn + esme.msisdn -# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) -# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg, check_smsc_resp=True) esme.disconnect() -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:42:31 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 5 Jul 2017 11:42:31 +0000 Subject: [PATCH] libosmo-sccp[master]: simple-client/server: be able to decide on which ss7 instanc... 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/3104 to look at the new patch set (#4). simple-client/server: be able to decide on which ss7 instance to bind osmo_sccp_simple_client() and osmo_sccp_simple_server() are binding on the ss7 instance with the id 1 by default. If the instance does not exist, it is created automatically. Allow choosing the ss7 instance by supplying the id number as function parameter. Add two new functions: osmo_sccp_simple_client_on_ss7_id() osmo_sccp_simple_server_on_ss7_id() Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e --- M include/osmocom/sigtran/osmo_ss7.h M src/sccp_user.c 2 files changed, 39 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/04/3104/4 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index caf12f5..57a4e06 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -439,11 +439,22 @@ const char *local_ip, int remote_port, const char *remote_ip); struct osmo_sccp_instance * +osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, + uint32_t pc, enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip, + int remote_port, const char *remote_ip); + +struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip); struct osmo_sccp_instance * +osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip); + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, diff --git a/src/sccp_user.c b/src/sccp_user.c index 93b03f6..b21a756 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -236,9 +236,10 @@ ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip) +osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, + uint32_t pc, enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip, + int remote_port, const char *remote_ip) { struct osmo_ss7_instance *ss7; struct osmo_ss7_as *as; @@ -252,7 +253,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) { LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); return NULL; @@ -309,14 +310,24 @@ return NULL; } +struct osmo_sccp_instance * +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip, int remote_port, const char *remote_ip) +{ + return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, pc, prot, + local_port, local_ip, + remote_port, remote_ip); +} + /*********************************************************************** * Convenience function for SERVER ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_server(void *ctx, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip) +osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip) { struct osmo_ss7_instance *ss7; struct osmo_xua_server *xs; @@ -325,7 +336,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) return NULL; ss7->cfg.primary_pc = pc; @@ -350,6 +361,15 @@ } struct osmo_sccp_instance * +osmo_sccp_simple_server(void *ctx, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip) +{ + return osmo_sccp_simple_server_on_ss7_id(ctx, 1, pc, prot, + local_port, local_ip); +} + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, -- To view, visit https://gerrit.osmocom.org/3104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:43:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 11:43:34 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile Message-ID: Review at https://gerrit.osmocom.org/3130 Add release target to Makefile Add simple helper target to automate following release steps: * cleanup TODO-RELEASE * update debian/changelog * git commit and tag * git tag sign Note: it requires bumpversion package to be installed. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/1 diff --git a/Makefile.am b/Makefile.am index b8de3ca..bfd409a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,24 @@ EXTRA_DIST = git-version-gen .version README.md +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') + +release: + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION)" + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS + if HAVE_DOXYGEN html_DATA = $(top_builddir)/doc/html.tar -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jul 5 11:47:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 11:47:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: esme: run_method_expect_failure: Check failure in server res... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3129 to look at the new patch set (#2). esme: run_method_expect_failure: Check failure in server response We can now enable the esme_ms_sms test part which asserts that sending an SMS to an msisdn with unknown destination triggers an error. Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e --- M src/osmo_gsm_tester/esme.py M suites/aoip_smpp/esme_ms_sms.py M suites/smpp/esme_ms_sms.py 3 files changed, 21 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/29/3129/2 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index f92863d..5d3bf37 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -108,14 +108,26 @@ self.client.disconnect() self.connected = False - def run_method_expect_failure(self, errcode, method, *args): + # Used in 'run_method_expect_failure', defined here because lambda functions cannot contain assigments: + def trigger_message_sent(self): + self.message_sent = True + + def run_method_expect_failure(self, errcode, method, *args, check_smsc_resp=False): + old_func = self.client.message_sent_handler try: method(*args) + if check_smsc_resp: # failure is contained in SMS response to our query, wait for it + self.message_sent = False + self.client.set_message_sent_handler(self.trigger_message_sent) + event_loop.wait(self, lambda: self.message_sent == True, timeout=10) #it should not succeed, raise an exception: raise log.Error('SMPP Failure: %s should have failed with SMPP error %d (%s) but succeeded.' % (method, errcode, smpplib.consts.DESCRIPTIONS[errcode])) except smpplib.exceptions.PDUError as e: if e.args[1] != errcode: raise e + self.dbg('Expected failure triggered: %d' % errcode) + finally: + self.client.set_message_sent_handler(old_func) def sms_send(self, sms_obj): parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) diff --git a/suites/aoip_smpp/esme_ms_sms.py b/suites/aoip_smpp/esme_ms_sms.py index 7f9ef18..0ec757e 100755 --- a/suites/aoip_smpp/esme_ms_sms.py +++ b/suites/aoip_smpp/esme_ms_sms.py @@ -47,10 +47,9 @@ esme.sms_send(msg) wait(ms.sms_was_received, msg) -# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) -# wrong_msisdn = ms.msisdn + esme.msisdn -# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) -# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg, check_smsc_resp=True) esme.disconnect() diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms.py index bc9d7d4..ad1c58c 100755 --- a/suites/smpp/esme_ms_sms.py +++ b/suites/smpp/esme_ms_sms.py @@ -39,11 +39,9 @@ esme.sms_send(msg) wait(ms.sms_was_received, msg) - -# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) -# wrong_msisdn = ms.msisdn + esme.msisdn -# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) -# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg, check_smsc_resp=True) esme.disconnect() -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 5 12:14:18 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 5 Jul 2017 12:14:18 +0000 Subject: [PATCH] openbsc[master]: smpp: fix return cause In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3126 to look at the new patch set (#3). smpp: fix return cause Return cause 38 when default SMPP route is unavailable. This is better than cause 1. Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.c M openbsc/src/libmsc/smpp_smsc.h 4 files changed, 14 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/3126/3 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index aa2030f..acf425a 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -294,6 +294,7 @@ if (smpp_first) { rc = smpp_try_deliver(gsms, conn, deferred); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) + /* unknown subscriber, try local */ goto try_local; if (rc < 0) { LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index f94968a..f7d1441 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -702,17 +702,18 @@ { struct osmo_esme *esme; struct osmo_smpp_addr dst; + int rc; memset(&dst, 0, sizeof(dst)); dst.ton = sms->dst.ton; dst.npi = sms->dst.npi; memcpy(dst.addr, sms->dst.addr, sizeof(dst.addr)); - esme = smpp_route(g_smsc, &dst); - if (!esme) - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rc = smpp_route(g_smsc, &dst, &esme); + if (!rc) + rc = deliver_to_esme(esme, sms, conn, deferred); - return deliver_to_esme(esme, sms, conn, deferred); + return rc; } struct smsc *smsc_from_vty(struct vty *v) diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 48a1192..812b661 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -270,8 +270,7 @@ } /*! \brief try to find a SMPP route (ESME) for given destination */ -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest) +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **pesme) { struct osmo_smpp_route *r; struct osmo_smpp_acl *acl = NULL; @@ -314,15 +313,17 @@ struct osmo_esme *esme; DEBUGP(DSMPP, "ACL even has ESME, we can route to it!\n"); esme = acl->esme; - if (esme->bind_flags & ESME_BIND_RX) - return esme; - else + if (esme->bind_flags & ESME_BIND_RX) { + *pesme = esme; + return 0; + } else LOGP(DSMPP, LOGL_NOTICE, "[%s] is matching route, " "but not bound for Rx, discarding MO SMS\n", esme->system_id); } - return NULL; + *pesme = NULL; + return (acl) ? 38 /* network out of order */ : 1 /* number unsassigned */; } diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index d8e82e4..c9209ef 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -126,8 +126,7 @@ void smpp_esme_get(struct osmo_esme *esme); void smpp_esme_put(struct osmo_esme *esme); -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest); +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **emse); struct osmo_smpp_acl *smpp_acl_alloc(struct smsc *smsc, const char *sys_id); struct osmo_smpp_acl *smpp_acl_by_system_id(struct smsc *smsc, -- To view, visit https://gerrit.osmocom.org/3126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 5 13:10:09 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 5 Jul 2017 13:10:09 +0000 Subject: osmo-trx[master]: transceiver: Avoid sending clock indications when trx is not... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 13:13:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 13:13:59 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#2). Add release target to Makefile Add simple helper target to automate following release steps: * cleanup TODO-RELEASE * update debian/changelog * git commit and tag * git tag sign Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control M debian/libosmocore-dev.install A osmo-release.mk 5 files changed, 33 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/2 diff --git a/Makefile.am b/Makefile.am index b8de3ca..3a71e3a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,9 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md +EXTRA_DIST = git-version-gen .version README.md osmo-release.mk + + at RELMAKE@ if HAVE_DOXYGEN diff --git a/configure.ac b/configure.ac index 92544b6..97f2490 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/debian/libosmocore-dev.install b/debian/libosmocore-dev.install index 465f933..96094f6 100644 --- a/debian/libosmocore-dev.install +++ b/debian/libosmocore-dev.install @@ -3,3 +3,4 @@ usr/lib/*/lib*.so usr/lib/*/lib*.la usr/lib/*/pkgconfig/* +osmo-release.mk usr/include diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..69c8102 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,24 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +endif + +release: +ifeq ($(LIBVERS),) + @echo "Releasing non-library projects is not yet supported" +else + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION)" + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 5 13:15:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 13:15:21 +0000 Subject: [PATCH] libosmo-abis[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3131 Use release helper from libosmocore Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/31/3131/1 diff --git a/Makefile.am b/Makefile.am index 9e24bef..a8774c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,3 +13,5 @@ echo $(VERSION) > $(distdir)/.tarball-version EXTRA_DIST = .version README.md + + at RELMAKE@ diff --git a/configure.ac b/configure.ac index 535d1c3..f612fe9 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jul 5 13:22:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 13:22:02 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#3). Add release target to Makefile Add simple helper target to automate following release steps: * cleanup TODO-RELEASE * update debian/changelog * git commit and tag * git tag sign Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control M debian/libosmocore-dev.install A osmo-release.mk 5 files changed, 33 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/3 diff --git a/Makefile.am b/Makefile.am index b8de3ca..3a71e3a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,9 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md +EXTRA_DIST = git-version-gen .version README.md osmo-release.mk + + at RELMAKE@ if HAVE_DOXYGEN diff --git a/configure.ac b/configure.ac index 92544b6..641f852 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/debian/libosmocore-dev.install b/debian/libosmocore-dev.install index 465f933..96094f6 100644 --- a/debian/libosmocore-dev.install +++ b/debian/libosmocore-dev.install @@ -3,3 +3,4 @@ usr/lib/*/lib*.so usr/lib/*/lib*.la usr/lib/*/pkgconfig/* +osmo-release.mk usr/include diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..69c8102 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,24 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +endif + +release: +ifeq ($(LIBVERS),) + @echo "Releasing non-library projects is not yet supported" +else + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION)" + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 5 13:35:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 13:35:02 +0000 Subject: [PATCH] libosmo-abis[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3131 to look at the new patch set (#2). Use release helper from libosmocore Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/31/3131/2 diff --git a/Makefile.am b/Makefile.am index 9e24bef..a8774c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,3 +13,5 @@ echo $(VERSION) > $(distdir)/.tarball-version EXTRA_DIST = .version README.md + + at RELMAKE@ diff --git a/configure.ac b/configure.ac index 535d1c3..f2e90e3 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 5 14:55:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 14:55:39 +0000 Subject: osmo-gsm-tester[master]: esme: run_method_expect_failure: Check failure in server res... In-Reply-To: References: Message-ID: Patch Set 2: Don't review yet, I'll do further changes needed to implement store&forward too. -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 14:59:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 14:59:31 +0000 Subject: [PATCH] libosmocore[master]: Cleanup jenkins build scripts Message-ID: Review at https://gerrit.osmocom.org/3132 Cleanup jenkins build scripts * reorder builds to avoid rm -rf invocation * avoid useless double autoreconf * move common parts into shared helper * move common build steps into separate function Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh A contrib/jenkins_common.sh 3 files changed, 29 insertions(+), 46 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/3132/1 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index 510b0e9..507652f 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -1,33 +1,16 @@ #!/bin/sh -set -ex +. $(dirname "$0")/jenkins_common.sh -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - -autoreconf --install --force -./configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh +build() { + $1 --enable-static --prefix=/usr/local/arm-none-eabi --host=arm-none-eabi --enable-embedded --disable-shared CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" + $MAKE $PARALLEL_MAKE || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir +build ../configure -../configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh +cd .. +build ./configure diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6a72840..4a26630 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,30 +1,23 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex +. $(dirname "$0")/jenkins_common.sh -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +ENABLE_SANITIZE="--enable-sanitize" if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" -else - ENABLE_SANITIZE="--enable-sanitize" fi -autoreconf --install --force -./configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh +build() { + $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" + $MAKE $PARALLEL_MAKE check || cat-testlogs.sh + $MAKE distcheck || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir -../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh +build ../configure $ENABLE_SANITIZE + +cd .. +build ./configure $ENABLE_SANITIZE diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..c7bc7f6 --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -ex + +./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +autoreconf --install --force -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jul 5 15:28:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 15:28:02 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#4). Add release target to Makefile Add simple helper target to automate following release steps: * cleanup TODO-RELEASE * update debian/changelog * git commit and tag * git tag sign Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control M debian/libosmocore-dev.install A osmo-release.mk 5 files changed, 32 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/4 diff --git a/Makefile.am b/Makefile.am index b8de3ca..c94b5c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,8 @@ EXTRA_DIST = git-version-gen .version README.md + at RELMAKE@ + if HAVE_DOXYGEN html_DATA = $(top_builddir)/doc/html.tar diff --git a/configure.ac b/configure.ac index 92544b6..641f852 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/debian/libosmocore-dev.install b/debian/libosmocore-dev.install index 465f933..96094f6 100644 --- a/debian/libosmocore-dev.install +++ b/debian/libosmocore-dev.install @@ -3,3 +3,4 @@ usr/lib/*/lib*.so usr/lib/*/lib*.la usr/lib/*/pkgconfig/* +osmo-release.mk usr/include diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..69c8102 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,24 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +endif + +release: +ifeq ($(LIBVERS),) + @echo "Releasing non-library projects is not yet supported" +else + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION)" + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 5 15:31:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 15:31:51 +0000 Subject: openbsc[master]: smpp: fix return cause In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3126/3/openbsc/src/libmsc/smpp_smsc.c File openbsc/src/libmsc/smpp_smsc.c: Line 326: return (acl) ? 38 /* network out of order */ : 1 /* number unsassigned */; Can we use define instead of numbers in here? This would also eliminate the need for comments in here. -- To view, visit https://gerrit.osmocom.org/3126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 5 15:34:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 15:34:41 +0000 Subject: openbsc[master]: 04.08: find a portable way to obtain the timezone offset In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3128/3/openbsc/src/libmsc/gsm_04_08.c File openbsc/src/libmsc/gsm_04_08.c: Line 868: /* #warning find a portable way to obtain the timezone offset I think you can safely remove the old warning. -- To view, visit https://gerrit.osmocom.org/3128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 5 15:37:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 5 Jul 2017 15:37:27 +0000 Subject: openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3127/3/openbsc/src/libmsc/transaction.c File openbsc/src/libmsc/transaction.c: Line 74: if (subscr == NULL) Is this normal? Should we log smth or caller takes care of it? -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:14:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 18:14:53 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_scoc: Fix trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/3134 sccp_scoc: Fix trailing whitespace Change-Id: Ia93bb7d59e4e2c31b693e2c3424d34386762d02e --- M src/sccp_scoc.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/34/3134/1 diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 628b63b..3a2cb47 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -122,7 +122,7 @@ }; /*********************************************************************** - * various helper functions + * various helper functions ***********************************************************************/ enum sccp_connection_state { @@ -1596,7 +1596,7 @@ } } -/*! \brief Main entrance function for primitives from SCCP User +/*! \brief Main entrance function for primitives from SCCP User * \param[in] scu SCCP User sending us the primitive * \param[in] oph Osmocom primitive sent by the user * \returns 0 on success; negative on error */ -- To view, visit https://gerrit.osmocom.org/3134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia93bb7d59e4e2c31b693e2c3424d34386762d02e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:14:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 18:14:53 +0000 Subject: [PATCH] libosmo-sccp[master]: configure.ac: Fix C(PP)FLAGS for BSD build Message-ID: Review at https://gerrit.osmocom.org/3133 configure.ac: Fix C(PP)FLAGS for BSD build Issue first found in libosmocore. It seems the BSD build doesn't use bash which means using += to append to a variable doesn't work correctly. Change-Id: I33f6b9de4990de0c4d3a6fc0bd7df632094e79ac --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/33/3133/1 diff --git a/configure.ac b/configure.ac index 36cbb59..200f55d 100644 --- a/configure.ac +++ b/configure.ac @@ -53,8 +53,8 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) -CFLAGS+=" -Wall" -CPPFLAGS+=" -Wall" +CFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CFLAGS -Wall" AC_OUTPUT( libosmo-sigtran.pc -- To view, visit https://gerrit.osmocom.org/3133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33f6b9de4990de0c4d3a6fc0bd7df632094e79ac Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:14:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 5 Jul 2017 18:14:54 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_scoc: Fix compilation warning and leave a pragma message Message-ID: Review at https://gerrit.osmocom.org/3135 sccp_scoc: Fix compilation warning and leave a pragma message Following warning was being printed: warning: statement will never be executed [-Wswitch-unreachable] The code in there seems not to be finished, so better leave the code and a pragma message to get notified when we compile. Change-Id: I4e2c482803954c984cb6792b11b4ea0fe674e269 --- M src/sccp_scoc.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/35/3135/1 diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 3a2cb47..3d43448 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -938,10 +938,10 @@ struct osmo_scu_prim *prim = NULL; switch (event) { - /* TODO: internal disco */ +#pragma message ("TODO: internal disco: send N-DISCONNECT.ind to user") /* send N-DISCONNECT.ind to user */ - scu_gen_encode_and_send(conn, event, xua, OSMO_SCU_PRIM_N_DISCONNECT, - PRIM_OP_INDICATION); + /*scu_gen_encode_and_send(conn, event, xua, OSMO_SCU_PRIM_N_DISCONNECT, + PRIM_OP_INDICATION);*/ /* fall-through */ case SCOC_E_SCU_N_DISC_REQ: prim = data; -- To view, visit https://gerrit.osmocom.org/3135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4e2c482803954c984cb6792b11b4ea0fe674e269 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:19:23 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 5 Jul 2017 18:19:23 +0000 Subject: osmo-trx[master]: cosmetic: transciever: Remove trailing whitespaces In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3fbe768048b2a34a75ace9688e306720e67019a Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:19:58 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 5 Jul 2017 18:19:58 +0000 Subject: osmo-trx[master]: transceiver: Avoid sending clock indications when trx is not... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:20:08 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 5 Jul 2017 18:20:08 +0000 Subject: [MERGED] osmo-trx[master]: transceiver: Avoid sending clock indications when trx is not... In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: transceiver: Avoid sending clock indications when trx is not powered on ...................................................................... transceiver: Avoid sending clock indications when trx is not powered on Stop calling writeClockInterface() when receiving commands in Transceiver::driveControl, otherwise it fools osmo-bts-trx clock skew check because it is always sending a clock indication with the same fn when it issues any commands during the time in between CMD POWEROFF and RSP POWERON, because fn is not increased during that period. Also use mForceClockInterface flag to delay delivery of first IND CLOCK until we start serving frames, otherwise the first one is sent and only after a long period of time the next clock indications are sent, when the radio starts to process bursts. That makes osmo-bts-trx unhappy because it expects to receive an IND CLOCK aprox at least every 400 frames. This way also we send the first IND CLOCK after the RSP POWERON 0 response. Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 --- M Transceiver52M/Transceiver.cpp M Transceiver52M/Transceiver.h 2 files changed, 6 insertions(+), 8 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Alexander Chemeris: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index d5b75d7..bf2dd6e 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -121,7 +121,7 @@ mClockSocket(wBasePort, wTRXAddress, mBasePort + 100), mTransmitLatency(wTransmitLatency), mRadioInterface(wRadioInterface), rssiOffset(wRssiOffset), - mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mEdge(false), mOn(false), + mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mEdge(false), mOn(false), mForceClockInterface(false), mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(0), mMaxExpectedDelayNB(0), mWriteBurstToDiskMask(0) { @@ -273,7 +273,7 @@ TxUpperLoopAdapter, (void*) chan); } - writeClockInterface(); + mForceClockInterface = true; mOn = true; return true; } @@ -677,9 +677,6 @@ sscanf(buffer,"%3s %s",cmdcheck,command); - if (!chan) - writeClockInterface(); - if (strcmp(cmdcheck,"CMD")!=0) { LOG(WARNING) << "bogus message on control interface"; return; @@ -873,9 +870,9 @@ { if (!mRadioInterface->driveReceiveRadio()) { usleep(100000); - } else { - if (mTransmitDeadlineClock > mLastClockUpdateTime + GSM::Time(216,0)) - writeClockInterface(); + } else if (mForceClockInterface || mTransmitDeadlineClock > mLastClockUpdateTime + GSM::Time(216,0)) { + mForceClockInterface = false; + writeClockInterface(); } } diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index 26d6c3c..1eb1d1d 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -208,6 +208,7 @@ bool mEdge; bool mOn; ///< flag to indicate that transceiver is powered on + bool mForceClockInterface; ///< flag to indicate whether IND CLOCK shall be sent unconditionally after transceiver is started bool mHandover[8][8]; ///< expect handover to the timeslot/subslot double mTxFreq; ///< the transmit frequency double mRxFreq; ///< the receive frequency -- To view, visit https://gerrit.osmocom.org/3120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:20:09 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 5 Jul 2017 18:20:09 +0000 Subject: [MERGED] osmo-trx[master]: cosmetic: transciever: Remove trailing whitespaces In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: cosmetic: transciever: Remove trailing whitespaces ...................................................................... cosmetic: transciever: Remove trailing whitespaces Change-Id: Ib3fbe768048b2a34a75ace9688e306720e67019a --- M Transceiver52M/Transceiver.cpp M Transceiver52M/Transceiver.h 2 files changed, 11 insertions(+), 12 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 61da416..d5b75d7 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -429,7 +429,7 @@ case V: state->fillerModulus[timeslot] = 51; break; - //case V: + //case V: case VII: state->fillerModulus[timeslot] = 102; break; @@ -544,7 +544,7 @@ /* * Pull bursts from the FIFO and handle according to the slot - * and burst correlation type. Equalzation is currently disabled. + * and burst correlation type. Equalzation is currently disabled. */ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, double &RSSI, bool &isRssiValid, double &timingOffset, double &noise, @@ -655,7 +655,7 @@ mTxPriorityQueues[i].clear(); } - + void Transceiver::driveControl(size_t chan) { int MAX_PACKET_LENGTH = 100; @@ -804,7 +804,7 @@ LOG(WARNING) << "bogus message on control interface"; sprintf(response,"RSP SETSLOT 1 %d %d",timeslot,corrCode); return; - } + } mStates[chan].chanType[timeslot] = (ChannelCombination) corrCode; setModulus(timeslot, chan); sprintf(response,"RSP SETSLOT 0 %d %d",timeslot,corrCode); @@ -852,14 +852,14 @@ frameNum = (frameNum << 8) | (0x0ff & buffer[i+1]); LOG(DEBUG) << "rcvd. burst at: " << GSM::Time(frameNum,timeSlot); - + int RSSI = (int) buffer[5]; BitVector newBurst(burstLen); BitVector::iterator itr = newBurst.begin(); char *bufferItr = buffer+6; - while (itr < newBurst.end()) + while (itr < newBurst.end()) *itr++ = *bufferItr++; - + GSM::Time currTime = GSM::Time(frameNum,timeSlot); addRadioVector(chan, newBurst, RSSI, currTime); @@ -945,7 +945,7 @@ { /** - Features a carefully controlled latency mechanism, to + Features a carefully controlled latency mechanism, to assure that transmit packets arrive at the radio/USRP before they need to be transmitted. @@ -956,7 +956,7 @@ RadioClock *radioClock = (mRadioInterface->getClock()); - + if (mOn) { //radioClock->wait(); // wait until clock updates LOG(DEBUG) << "radio clock " << radioClock->get(); diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index 6f9cb92..26d6c3c 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -89,7 +89,7 @@ /** The Transceiver class, responsible for physical layer of basestation */ class Transceiver { public: - /** Transceiver constructor + /** Transceiver constructor @param wBasePort base port number of UDP sockets @param TRXAddress IP address of the TRX manager, as a string @param wSPS number of samples per GSM symbol @@ -169,7 +169,7 @@ GSM::Time mTransmitLatency; ///< latency between basestation clock and transmit deadline clock GSM::Time mLatencyUpdateTime; ///< last time latency was updated - GSM::Time mTransmitDeadlineClock; ///< deadline for pushing bursts into transmit FIFO + GSM::Time mTransmitDeadlineClock; ///< deadline for pushing bursts into transmit FIFO GSM::Time mLastClockUpdateTime; ///< last time clock update was sent up to core RadioInterface *mRadioInterface; ///< associated radioInterface object @@ -275,4 +275,3 @@ /** transmit queueing thread loop */ void *TxUpperLoopAdapter(TransceiverChannel *); - -- To view, visit https://gerrit.osmocom.org/3119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib3fbe768048b2a34a75ace9688e306720e67019a Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:29:08 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 5 Jul 2017 18:29:08 +0000 Subject: osmo-trx[master]: LimeSDR: Fix sample value range In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/3075/1/Transceiver52M/UHDDevice.cpp File Transceiver52M/UHDDevice.cpp: PS1, Line 1188: 32767 Is there a reason to not use SHRT_MAX instead of 32767 here? PS1, Line 1197: 32767 Line can be removed unless there is a good reason not to use SHRT_MAX. -- To view, visit https://gerrit.osmocom.org/3075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:30:23 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 5 Jul 2017 18:30:23 +0000 Subject: osmo-trx[master]: deb: remove unused dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:30:54 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 5 Jul 2017 18:30:54 +0000 Subject: osmo-trx[master]: LimeSDR: change tx window type to TX_WINDOW_FIXED In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8de5b165ccd72a62b0f16655618e24ca740d9637 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:31:09 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 5 Jul 2017 18:31:09 +0000 Subject: osmo-trx[master]: LimeSDR: Change device detection to work with USB and PCIe v... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie43610de0b2196d84caf09717ec8c8ca75ab926d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:41:38 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 5 Jul 2017 18:41:38 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: > so should we go for this kind of patch, or should I push another > version that does it unconditionally? My preference would be to go > for the latter, to have a "sane default" configureation. My only concern with default RR priority is that it requires proper permissions or root access. Otherwise we should go with what works. There is code duplication on the priority setting. I'm fine with the raw POSIX version, but I would like to remove the priority scheduling calls to UHD if we go with that approach. -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 5 18:49:04 2017 From: gerrit-no-reply at lists.osmocom.org (allesklar2) Date: Wed, 5 Jul 2017 18:49:04 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) > (4 comments) > > Thnaks a lot for your contribution! It is very much appreciated, > please forgitve me missing it in the patch review so far. It's > not usual that it waits for three weeks. If you hsould see that > again, feel free to send a "ping" either by private mail or here as > a "reply" on the patch. Thanks for your comments. I revised my patch and fixed the most things. https://gerrit.osmocom.org/#/c/2817/1/src/phy/tetra_burst.c File src/phy/tetra_burst.c: Line 305: #if 0 /* not used */ > not used by whom? why? I think more context is needed here. also, it seems You are right, it is not necessary for DMO. I comment it out because the code runs faster and it is not used in "tetra_burst_sync.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: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: allesklar2 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 5 19:53:19 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Wed, 5 Jul 2017 19:53:19 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 3: > (1 comment) Abstract the fact away whether the dependency was provided by compilation from source or by extraction of an artifact tar-ball. One artifact tar-ball should contain the result of a make install run of a single library to an empty directory. >From a dependency consummation perspective the rest does not change. You extract the content of an artifact tar file (or make install) to a distinct directory and do that for all artifacts. Those directories are then stowed to a final destination directory which is then the sole directory where the package to be built searches for its dependencies. -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 08:28:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 08:28:32 +0000 Subject: [MERGED] osmo-trx[master]: deb: remove unused dependency In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: deb: remove unused dependency ...................................................................... deb: remove unused dependency The libdbd dependency is not used because libsqlite3 is used directly - adjust debian/control to match. Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7 Related: OS#1929 --- M debian/control 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Alexander Chemeris: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 0e3b714..12da64a 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,6 @@ Build-Depends: debhelper (>= 9), autotools-dev, autoconf-archive, - libdbd-sqlite3, libsqlite3-dev, pkg-config, dh-autoreconf, @@ -20,7 +19,7 @@ Package: osmo-trx Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libdbd-sqlite3 +Depends: ${shlibs:Depends}, ${misc:Depends}, libsqlite3-0 Description: SDR transceiver that implements Layer 1 of a GSM BTS OsmoTRX is a software-defined radio transceiver that implements the Layer 1 physical layer of a BTS comprising the following 3GPP specifications: -- To view, visit https://gerrit.osmocom.org/3079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jul 6 08:33:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 08:33:31 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: Does osmo-gsm-tester use sudo to run osmo-trx? -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 08:33:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 08:33:44 +0000 Subject: [PATCH] libosmo-sccp[master]: contrib: Enable -Werror by default Message-ID: Review at https://gerrit.osmocom.org/3136 contrib: Enable -Werror by default Change-Id: I16a8ca7f0bfabeed6a9b58cda5e60bd58889f74d --- M configure.ac M contrib/jenkins.sh 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/36/3136/1 diff --git a/configure.ac b/configure.ac index 200f55d..7e3e03e 100644 --- a/configure.ac +++ b/configure.ac @@ -54,7 +54,7 @@ AC_SUBST(SYMBOL_VISIBILITY) CFLAGS="$CFLAGS -Wall" -CPPFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CPPFLAGS -Wall" AC_OUTPUT( libosmo-sigtran.pc diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 668a58b..897c464 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,7 +29,7 @@ set -x autoreconf --install --force -./configure +./configure CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16a8ca7f0bfabeed6a9b58cda5e60bd58889f74d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 08:34:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 08:34:32 +0000 Subject: [PATCH] libosmo-abis[master]: configure.ac: Fix C(PP)FLAGS for BSD build Message-ID: Review at https://gerrit.osmocom.org/3137 configure.ac: Fix C(PP)FLAGS for BSD build Issue first found in libosmocore. It seems the BSD build doesn't use bash which means using += to append to a variable doesn't work correctly. Change-Id: Id509351104bc7466114d4b9be450814254110f44 --- M configure.ac 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/37/3137/1 diff --git a/configure.ac b/configure.ac index 535d1c3..9b62f3e 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ AC_CONFIG_MACRO_DIR([m4]) -CFLAGS+=" -Wall" -CPPFLAGS+=" -Wall" +CFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CPPFLAGS -Wall" # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" @@ -58,8 +58,8 @@ [sanitize=$enableval], [sanitize="no"]) if test x"$sanitize" = x"yes" then - CFLAGS+=" -fsanitize=address -fsanitize=undefined" - CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" + CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" + CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" fi _cflags_save=$CFLAGS -- To view, visit https://gerrit.osmocom.org/3137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id509351104bc7466114d4b9be450814254110f44 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 08:34:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 08:34:32 +0000 Subject: [PATCH] libosmo-abis[master]: contrib: Enable -Werror by default Message-ID: Review at https://gerrit.osmocom.org/3138 contrib: Enable -Werror by default Change-Id: I065b18dd6c4f7616f981aa4273e68e23825a7294 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/38/3138/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f1019e4..5c90b51 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,7 +26,7 @@ set -x autoreconf --install --force -./configure --enable-sanitize +./configure --enable-sanitize CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I065b18dd6c4f7616f981aa4273e68e23825a7294 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 08:35:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 08:35:19 +0000 Subject: [PATCH] libosmo-netif[master]: configure.ac: Use -Wall in C(PP)FLAGS Message-ID: Review at https://gerrit.osmocom.org/3139 configure.ac: Use -Wall in C(PP)FLAGS Change-Id: Ia1d7e99541089a92e6bc17798a94ac756047aeba --- M configure.ac 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/39/3139/1 diff --git a/configure.ac b/configure.ac index 8cd2238..6aac872 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,9 @@ AC_CONFIG_MACRO_DIR([m4]) +CFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CPPFLAGS -Wall" + dnl checks for header files AC_HEADER_STDC AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h) -- To view, visit https://gerrit.osmocom.org/3139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1d7e99541089a92e6bc17798a94ac756047aeba Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 08:35:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 08:35:20 +0000 Subject: [PATCH] libosmo-netif[master]: contrib: Enable -Werror by default Message-ID: Review at https://gerrit.osmocom.org/3140 contrib: Enable -Werror by default Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/40/3140/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2fce993..c5a26ea 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -28,7 +28,7 @@ set -x autoreconf --install --force -./configure +./configure CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 08:49:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 08:49:35 +0000 Subject: [PATCH] libosmocore[master]: configure.ac: Add --disable-doxygen flag Message-ID: Review at https://gerrit.osmocom.org/3141 configure.ac: Add --disable-doxygen flag This flag, when set, allows to unconditionally disable doxygen documentation generation, even if doxygen command is found. Change-Id: Iba1440292116af27b267c7a1fbec1c2336784efe --- M configure.ac 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/41/3141/1 diff --git a/configure.ac b/configure.ac index 92544b6..96757df 100644 --- a/configure.ac +++ b/configure.ac @@ -59,8 +59,14 @@ AC_CHECK_LIB(execinfo, backtrace, BACKTRACE_LIB=-lexecinfo, BACKTRACE_LIB=) AC_SUBST(BACKTRACE_LIB) +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) AC_PATH_PROG(DOXYGEN,doxygen,false) -AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" -- To view, visit https://gerrit.osmocom.org/3141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba1440292116af27b267c7a1fbec1c2336784efe Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 08:50:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 08:50:00 +0000 Subject: [PATCH] libosmo-netif[master]: configure.ac: Add --disable-doxygen flag Message-ID: Review at https://gerrit.osmocom.org/3142 configure.ac: Add --disable-doxygen flag This flag, when set, allows to unconditionally disable doxygen documentation generation, even if doxygen command is found. Change-Id: I16b3502be3e32274f548da6a2a0b0363dd3bfe5d --- M configure.ac 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/42/3142/1 diff --git a/configure.ac b/configure.ac index 8cd2238..362d792 100644 --- a/configure.ac +++ b/configure.ac @@ -63,8 +63,14 @@ AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) AC_PATH_PROG(DOXYGEN,doxygen,false) -AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") AC_OUTPUT( libosmo-netif.pc -- To view, visit https://gerrit.osmocom.org/3142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16b3502be3e32274f548da6a2a0b0363dd3bfe5d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 10:22:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 10:22:15 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#5). Add release target to Makefile Add simple helper target to automate following release steps: * cleanup TODO-RELEASE * update debian/changelog * git commit and tag * git tag sign Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control M debian/libosmocore-dev.install A osmo-release.mk 5 files changed, 35 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/5 diff --git a/Makefile.am b/Makefile.am index b8de3ca..c94b5c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,8 @@ EXTRA_DIST = git-version-gen .version README.md + at RELMAKE@ + if HAVE_DOXYGEN html_DATA = $(top_builddir)/doc/html.tar diff --git a/configure.ac b/configure.ac index 92544b6..641f852 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/debian/libosmocore-dev.install b/debian/libosmocore-dev.install index 465f933..96094f6 100644 --- a/debian/libosmocore-dev.install +++ b/debian/libosmocore-dev.install @@ -3,3 +3,4 @@ usr/lib/*/lib*.so usr/lib/*/lib*.la usr/lib/*/pkgconfig/* +osmo-release.mk usr/include diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..5050037 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,27 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +endif + +release: +ifeq ($(NEW_VERSION),) + @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) +endif + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." +ifeq ($(LIBVERS),) + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge +else + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION)" + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Thu Jul 6 10:29:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 10:29:52 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#6). Add release target to Makefile Add simple helper target to automate basic release steps: * version bump * prepare release commit * git commit, tag and sign For library projects: * update debian/changelog from TODO-RELEASE * cleanup TODO-RELEASE For non-library projects: * update debian/changelog from git log Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control M debian/libosmocore-dev.install A osmo-release.mk 5 files changed, 35 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/6 diff --git a/Makefile.am b/Makefile.am index b8de3ca..c94b5c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,8 @@ EXTRA_DIST = git-version-gen .version README.md + at RELMAKE@ + if HAVE_DOXYGEN html_DATA = $(top_builddir)/doc/html.tar diff --git a/configure.ac b/configure.ac index 92544b6..641f852 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/debian/libosmocore-dev.install b/debian/libosmocore-dev.install index 465f933..96094f6 100644 --- a/debian/libosmocore-dev.install +++ b/debian/libosmocore-dev.install @@ -3,3 +3,4 @@ usr/lib/*/lib*.so usr/lib/*/lib*.la usr/lib/*/pkgconfig/* +osmo-release.mk usr/include diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..5050037 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,27 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +endif + +release: +ifeq ($(NEW_VERSION),) + @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) +endif + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." +ifeq ($(LIBVERS),) + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge +else + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION)" + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Thu Jul 6 10:31:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 10:31:12 +0000 Subject: [PATCH] osmo-bts[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3143 Use release helper from libosmocore Change-Id: Ib8efd2095fcf759276299b516d495219105c1f2b Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/3143/1 diff --git a/Makefile.am b/Makefile.am index 5598c4a..0f85151 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,3 +14,5 @@ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmobts-mgr.cfg \ README.md + + at RELMAKE@ diff --git a/configure.ac b/configure.ac index b848605..b2700d5 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8efd2095fcf759276299b516d495219105c1f2b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 6 11:20:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 11:20:57 +0000 Subject: libosmocore[master]: configure.ac: Add --disable-doxygen flag In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba1440292116af27b267c7a1fbec1c2336784efe Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 11:23:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 11:23:03 +0000 Subject: libosmo-netif[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif 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 Jul 6 11:27:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 11:27:18 +0000 Subject: libosmocore[master]: configure.ac: Add --disable-doxygen flag In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3141/1/configure.ac File configure.ac: Line 69: AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") could also use the and operator of 'test': test $DOXYGEN != false -a "x$doxygen" = "xyes" but nevermind. -- To view, visit https://gerrit.osmocom.org/3141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba1440292116af27b267c7a1fbec1c2336784efe Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 6 11:28:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 11:28:45 +0000 Subject: libosmo-netif[master]: configure.ac: Add --disable-doxygen flag In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16b3502be3e32274f548da6a2a0b0363dd3bfe5d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 11:51:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 11:51:34 +0000 Subject: [PATCH] openbsc[master]: smpp_smsc.c: Log on sending deliver_sm message Message-ID: Review at https://gerrit.osmocom.org/3144 smpp_smsc.c: Log on sending deliver_sm message Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 --- M openbsc/src/libmsc/smpp_smsc.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/44/3144/1 diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 48a1192..4c2e4aa 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -654,6 +654,9 @@ { deliver->sequence_number = esme_inc_seq_nr(esme); + LOGP(DSMPP, LOGL_DEBUG, "[%s] Tx DELIVER-SM (from %s)\n", + esme->system_id, deliver->source_addr); + return PACK_AND_SEND(esme, deliver); } -- To view, visit https://gerrit.osmocom.org/3144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 11:56:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 11:56:44 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: on osmo-gsm-tester we use /etc/security/limits.d as documented in http://ftp.osmocom.org/docs/latest/osmo-gsm-tester-manual.pdf in 3.3.2 Allow Realtime Priority -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 12:00:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 12:00:36 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: i.e. there is a group that is given realtime priority permissions, which the jenkins user is a member of. -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 12:06:26 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 6 Jul 2017 12:06:26 +0000 Subject: [PATCH] openbsc[master]: smpp: fix return cause In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3126 to look at the new patch set (#4). smpp: fix return cause Return cause 38 when default SMPP route is unavailable. This is better than cause 1. Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.c M openbsc/src/libmsc/smpp_smsc.h 4 files changed, 17 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/3126/4 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index aa2030f..acf425a 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -294,6 +294,7 @@ if (smpp_first) { rc = smpp_try_deliver(gsms, conn, deferred); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) + /* unknown subscriber, try local */ goto try_local; if (rc < 0) { LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index f94968a..f7d1441 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -702,17 +702,18 @@ { struct osmo_esme *esme; struct osmo_smpp_addr dst; + int rc; memset(&dst, 0, sizeof(dst)); dst.ton = sms->dst.ton; dst.npi = sms->dst.npi; memcpy(dst.addr, sms->dst.addr, sizeof(dst.addr)); - esme = smpp_route(g_smsc, &dst); - if (!esme) - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rc = smpp_route(g_smsc, &dst, &esme); + if (!rc) + rc = deliver_to_esme(esme, sms, conn, deferred); - return deliver_to_esme(esme, sms, conn, deferred); + return rc; } struct smsc *smsc_from_vty(struct vty *v) diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 48a1192..8d55c45 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -270,8 +270,7 @@ } /*! \brief try to find a SMPP route (ESME) for given destination */ -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest) +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **pesme) { struct osmo_smpp_route *r; struct osmo_smpp_acl *acl = NULL; @@ -314,15 +313,20 @@ struct osmo_esme *esme; DEBUGP(DSMPP, "ACL even has ESME, we can route to it!\n"); esme = acl->esme; - if (esme->bind_flags & ESME_BIND_RX) - return esme; - else + if (esme->bind_flags & ESME_BIND_RX) { + *pesme = esme; + return 0; + } else LOGP(DSMPP, LOGL_NOTICE, "[%s] is matching route, " "but not bound for Rx, discarding MO SMS\n", esme->system_id); } - return NULL; + *pesme = NULL; + if (acl) + return GSM48_CC_CAUSE_NETWORK_OOO; + else + return GSM48_CC_CAUSE_UNASSIGNED_NR; } diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index d8e82e4..c9209ef 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -126,8 +126,7 @@ void smpp_esme_get(struct osmo_esme *esme); void smpp_esme_put(struct osmo_esme *esme); -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest); +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **emse); struct osmo_smpp_acl *smpp_acl_alloc(struct smsc *smsc, const char *sys_id); struct osmo_smpp_acl *smpp_acl_by_system_id(struct smsc *smsc, -- To view, visit https://gerrit.osmocom.org/3126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 6 12:06:26 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 6 Jul 2017 12:06:26 +0000 Subject: [PATCH] openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3127 to look at the new patch set (#4). transaction: reject calls from unidentified subscribers A valid subscriber is indespensible when allocating a new transaction. Return NULL if no subscriber is supplied. This will cause unidentified subscribers to be rejected. Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d --- M openbsc/src/libmsc/transaction.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/3127/4 diff --git a/openbsc/src/libmsc/transaction.c b/openbsc/src/libmsc/transaction.c index dba4bed..dcff9d0 100644 --- a/openbsc/src/libmsc/transaction.c +++ b/openbsc/src/libmsc/transaction.c @@ -70,6 +70,13 @@ DEBUGP(DCC, "subscr=%p, net=%p\n", subscr, net); + /* a valid subscriber is indispensable */ + if (subscr == NULL) { + DEBUGP(DCC, + "unable to alloc transaction, invalid subscriber (NULL)\n"); + return NULL; + } + trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 6 12:06:26 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 6 Jul 2017 12:06:26 +0000 Subject: [PATCH] openbsc[master]: 04.08: find a portable way to obtain the timezone offset In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3128 to look at the new patch set (#4). 04.08: find a portable way to obtain the timezone offset Portable GMT offset calculation to display correct time on GSM. Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 --- M openbsc/src/libmsc/gsm_04_08.c 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/3128/4 diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 89108e4..f926223 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -861,12 +861,19 @@ else { /* Need to get GSM offset and convert into 15 min units */ /* This probably breaks if gmtoff returns a value not evenly divisible by 15? */ - local_time = localtime(&cur_t); #ifdef HAVE_TM_GMTOFF_IN_TM + local_time = localtime(&cur_t); tzunits = (local_time->tm_gmtoff/60)/15; #else -#warning find a portable way to obtain the timezone offset - tzunits = 0; + /* find timezone offset */ + time_t utc; + double offsetFromUTC; + utc = mktime(gmt_time); + local_time = localtime(&cur_t); + offsetFromUTC = difftime(cur_t, utc); + if (local_time->tm_isdst) + offsetFromUTC += 3600.0; + tzunits = ((int)offsetFromUTC) / 60 / 15; #endif if (tzunits < 0) { tzunits = tzunits/-1; -- To view, visit https://gerrit.osmocom.org/3128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 6 12:11:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 12:11:01 +0000 Subject: libosmocore[master]: configure.ac: Add --disable-doxygen flag In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3141/1/configure.ac File configure.ac: Line 69: AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") > could also use the and operator of 'test': I could, I already checked. From "man test": NOTE: Binary -a and -o are inherently ambiguous. Use 'test EXPR1 && test EXPR2' or 'test EXPR1 || test EXPR2' instead. -- To view, visit https://gerrit.osmocom.org/3141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba1440292116af27b267c7a1fbec1c2336784efe Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 6 12:11:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 12:11:18 +0000 Subject: [MERGED] libosmocore[master]: configure.ac: Add --disable-doxygen flag In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: configure.ac: Add --disable-doxygen flag ...................................................................... configure.ac: Add --disable-doxygen flag This flag, when set, allows to unconditionally disable doxygen documentation generation, even if doxygen command is found. Change-Id: Iba1440292116af27b267c7a1fbec1c2336784efe --- M configure.ac 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 92544b6..96757df 100644 --- a/configure.ac +++ b/configure.ac @@ -59,8 +59,14 @@ AC_CHECK_LIB(execinfo, backtrace, BACKTRACE_LIB=-lexecinfo, BACKTRACE_LIB=) AC_SUBST(BACKTRACE_LIB) +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) AC_PATH_PROG(DOXYGEN,doxygen,false) -AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" -- To view, visit https://gerrit.osmocom.org/3141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba1440292116af27b267c7a1fbec1c2336784efe Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 12:11:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 12:11:34 +0000 Subject: [MERGED] libosmo-netif[master]: configure.ac: Add --disable-doxygen flag In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: configure.ac: Add --disable-doxygen flag ...................................................................... configure.ac: Add --disable-doxygen flag This flag, when set, allows to unconditionally disable doxygen documentation generation, even if doxygen command is found. Change-Id: I16b3502be3e32274f548da6a2a0b0363dd3bfe5d --- M configure.ac 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 8cd2238..362d792 100644 --- a/configure.ac +++ b/configure.ac @@ -63,8 +63,14 @@ AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) AC_PATH_PROG(DOXYGEN,doxygen,false) -AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") AC_OUTPUT( libosmo-netif.pc -- To view, visit https://gerrit.osmocom.org/3142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I16b3502be3e32274f548da6a2a0b0363dd3bfe5d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 13:46:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 13:46:50 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#7). Add release target to Makefile Add simple helper target to automate basic release steps: * version bump * prepare release commit * git commit, tag and sign For library projects: * update debian/changelog from TODO-RELEASE * cleanup TODO-RELEASE For non-library projects: * update debian/changelog from git log Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control M debian/libosmocore-dev.install A osmo-release.mk 5 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/7 diff --git a/Makefile.am b/Makefile.am index b8de3ca..c94b5c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,8 @@ EXTRA_DIST = git-version-gen .version README.md + at RELMAKE@ + if HAVE_DOXYGEN html_DATA = $(top_builddir)/doc/html.tar diff --git a/configure.ac b/configure.ac index 92544b6..641f852 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/debian/libosmocore-dev.install b/debian/libosmocore-dev.install index 465f933..96094f6 100644 --- a/debian/libosmocore-dev.install +++ b/debian/libosmocore-dev.install @@ -3,3 +3,4 @@ usr/lib/*/lib*.so usr/lib/*/lib*.la usr/lib/*/pkgconfig/* +osmo-release.mk usr/include diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..4407c86 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,28 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +ISODATE := $(shell date -I) +endif + +release: +ifeq ($(NEW_VERSION),) + @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) +endif + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." +ifeq ($(LIBVERS),) + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge +else + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)." + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Thu Jul 6 13:53:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 13:53:18 +0000 Subject: [MERGED] osmo-iuh[master]: rua_to_scu(): add debug log for calling/called addr In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rua_to_scu(): add debug log for calling/called addr ...................................................................... rua_to_scu(): add debug log for calling/called addr This might help in resolving whether we are conforming to SCCP specs regarding our calling/called address choices. Change-Id: Ie91953f7e9033419257d556d3a9f14e125f5c60d --- M src/hnbgw_rua.c 1 file changed, 10 insertions(+), 0 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 54c455b..b610437 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -226,6 +226,11 @@ prim->u.connect.calling_addr = cn->gw->sccp.local_addr; prim->u.connect.sccp_class = 2; prim->u.connect.conn_id = map->scu_conn_id; + /* Two separate logs because of osmo_sccp_addr_dump(). */ + DEBUGP(DRUA, "RUA to SCCP N_CONNECT: called_addr:%s\n", + osmo_sccp_addr_dump(&prim->u.connect.called_addr)); + DEBUGP(DRUA, "RUA to SCCP N_CONNECT: calling_addr:%s\n", + osmo_sccp_addr_dump(&prim->u.connect.calling_addr)); break; case OSMO_SCU_PRIM_N_DATA: prim->u.data.conn_id = map->scu_conn_id; @@ -237,6 +242,11 @@ case OSMO_SCU_PRIM_N_UNITDATA: prim->u.unitdata.called_addr = *remote_addr; prim->u.unitdata.calling_addr = cn->gw->sccp.local_addr; + /* Two separate logs because of osmo_sccp_addr_dump(). */ + DEBUGP(DRUA, "RUA to SCCP N_UNITDATA: called_addr:%s\n", + osmo_sccp_addr_dump(&prim->u.unitdata.called_addr)); + DEBUGP(DRUA, "RUA to SCCP N_UNITDATA: calling_addr:%s\n", + osmo_sccp_addr_dump(&prim->u.unitdata.calling_addr)); break; default: return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3112 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie91953f7e9033419257d556d3a9f14e125f5c60d Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh 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 Jul 6 13:53:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 13:53:18 +0000 Subject: [MERGED] osmo-iuh[master]: rua_to_scu(), rua_rx_init_connect(): add debug logging In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rua_to_scu(), rua_rx_init_connect(): add debug logging ...................................................................... rua_to_scu(), rua_rx_init_connect(): add debug logging In rua_to_scu(), log domain indicator and remote address. In rua_rx_init_connect(), add domain indicator to log. Change-Id: Ibe510bf0aca5eadbc0ce6031d3026e770de6559f --- M src/hnbgw_rua.c 1 file changed, 21 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 329f990..54c455b 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -38,6 +38,18 @@ #include #include +static const char *cn_domain_indicator_to_str(CN_DomainIndicator_t cN_DomainIndicator) +{ + switch (cN_DomainIndicator) { + case RUA_CN_DomainIndicator_cs_domain: + return "IuCS"; + case RUA_CN_DomainIndicator_ps_domain: + return "IuPS"; + default: + return "(unknown-domain)"; + } +} + static int hnbgw_rua_tx(struct hnb_context *ctx, struct msgb *msg) { if (!msg) @@ -202,6 +214,11 @@ map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn); OSMO_ASSERT(map); + DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u\n", + cn_domain_indicator_to_str(cN_DomainIndicator), + osmo_sccp_addr_dump(remote_addr), + map->rua_ctx_id, map->scu_conn_id); + /* add primitive header */ switch (type) { case OSMO_SCU_PRIM_N_CONNECT: @@ -311,8 +328,10 @@ context_id = asn1bitstr_to_u24(&ies.context_ID); - DEBUGP(DRUA, "RUA Connect.req(ctx=0x%x, %s)\n", context_id, - ies.establishment_Cause == RUA_Establishment_Cause_emergency_call + DEBUGP(DRUA, "RUA %s Connect.req(ctx=0x%x, %s)\n", + cn_domain_indicator_to_str(ies.cN_DomainIndicator), + context_id, + ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal"); rc = rua_to_scu(hnb, ies.cN_DomainIndicator, OSMO_SCU_PRIM_N_CONNECT, -- To view, visit https://gerrit.osmocom.org/3111 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe510bf0aca5eadbc0ce6031d3026e770de6559f Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh 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 Jul 6 13:53:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 13:53:19 +0000 Subject: [MERGED] osmo-iuh[master]: sccp_sap_up(): guard against NULL pointers In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: sccp_sap_up(): guard against NULL pointers ...................................................................... sccp_sap_up(): guard against NULL pointers Change-Id: Icd64b92b00461cace5c476c8bcf69eec3fdbbdd3 --- M src/hnbgw_cn.c 1 file changed, 16 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 2fd9d71..8124ce5 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -327,12 +327,27 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *ctx) { struct osmo_sccp_user *scu = ctx; - struct hnbgw_cnlink *cnlink = osmo_sccp_user_get_priv(scu); + struct hnbgw_cnlink *cnlink; struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; int rc; LOGP(DMAIN, LOGL_DEBUG, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + if (!scu) { + LOGP(DMAIN, LOGL_ERROR, + "sccp_sap_up(): NULL osmo_sccp_user, cannot send prim (sap %u prim %u op %d)\n", + oph->sap, oph->primitive, oph->operation); + return -1; + } + + cnlink = osmo_sccp_user_get_priv(scu); + if (!cnlink) { + LOGP(DMAIN, LOGL_ERROR, + "sccp_sap_up(): NULL hnbgw_cnlink, cannot send prim (sap %u prim %u op %d)\n", + oph->sap, oph->primitive, oph->operation); + return -1; + } + switch (OSMO_PRIM_HDR(oph)) { case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): rc = handle_cn_unitdata(cnlink, &prim->u.unitdata, oph); -- To view, visit https://gerrit.osmocom.org/3110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icd64b92b00461cace5c476c8bcf69eec3fdbbdd3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh 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 Jul 6 13:53:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 13:53:19 +0000 Subject: [MERGED] osmo-iuh[master]: migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA ...................................................................... migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA libosmo-sigtran now has a "proper" SCCP/M3UA stack, so we can make our hnb-gw 3GPP compliant by switching from the old SUA code to the new universal SCCP user API with support for (currently) M3UA and SUA. Main changes: Use one cn_link to STP: We will connect to the core network using an (Osmo)STP instance that routes to MSC and SGSN, so we want one SCCP link instead of two. The only difference between IuCS and IuPS is a different remote osmo_sccp_addr. This has various effects through the messaging code; the patch is a bit larger than I would like, but it is hard to separate out truly independent smaller changes. CS or PS domain was previously flagged in the separate cn_link, as ctx pointer for two separate sccp_sap_up()s. Now there's just one such ctx, so determine is_ps from the RANAP Domain Indicator, or from the conn's hnbgw_context_map: - Add is_ps to context_map_alloc_by_hnb(). - To find a matching context, the RUA ID alone is no longer sufficient, also match is_ps (possible optimization todo: separate lists). We would send separate CS or PS Reset messages based on the cn_link, instead send both CS and PS Reset at the same time for the single cn_link. This could be adjusted to detect presence of MSC or SGSN instead. Pending: adjust the VTY config to reflect that there is only one remote address. Place a TODO comment for that. Smaller changes: rua_to_scu(): populate called and calling addresses for N_CONNECT and N_UNITDATA. Remove DSUA. Don't build dummy_cn, which is still implemented on SUA. Mark todo to maybe re-include it based on M3UA later. In hnbgw_cnlink, place sccp related items in a separate sub-struct. Do not keep an llist of cn_links, just have the one. Remove iteration and list management. Change jenkins script to build libosmo-sccp master. Patch-by: hwelte, nhofmeyr Change-Id: I8ac15fa2fd25bedb26297177e416976a5389b573 --- M contrib/jenkins.sh M include/osmocom/iuh/context_map.h M include/osmocom/iuh/hnbgw.h M include/osmocom/iuh/hnbgw_cn.h M src/context_map.c M src/hnbgw.c M src/hnbgw_cn.c M src/hnbgw_rua.c M src/tests/Makefile.am M src/tests/test_common.c 10 files changed, 133 insertions(+), 134 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index bf2c7cb..b500e1c 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -19,7 +19,7 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif -osmo-build-dep.sh libosmo-sccp sysmocom/iu +osmo-build-dep.sh libosmo-sccp osmo-build-dep.sh libasn1c # the asn1c binary is used by the 'regen' target below diff --git a/include/osmocom/iuh/context_map.h b/include/osmocom/iuh/context_map.h index c1a4495..8d957d6 100644 --- a/include/osmocom/iuh/context_map.h +++ b/include/osmocom/iuh/context_map.h @@ -24,6 +24,8 @@ struct hnbgw_cnlink *cn_link; /* RUA contxt ID */ uint32_t rua_ctx_id; + /* False for CS, true for PS */ + bool is_ps; /* SCCP User SAP connection ID */ uint32_t scu_conn_id; @@ -33,6 +35,7 @@ struct hnbgw_context_map * context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id, + bool is_ps, struct hnbgw_cnlink *cn_if_new); struct hnbgw_context_map * diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index 4880d48..db22d97 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -5,6 +5,7 @@ #include #include #include +#include #define DEBUG #include @@ -13,15 +14,16 @@ enum { DMAIN, DHNBAP, - DSUA, DRUA, DRANAP, }; #define HNBGW_LOCAL_IP_DEFAULT "0.0.0.0" +/* TODO: CS and PS now both connect to OsmoSTP, i.e. that's always going to be the same address. Drop the + * duplicity. */ #define HNBGW_IUCS_REMOTE_IP_DEFAULT "127.0.0.1" -#define HNBGW_IUPS_REMOTE_IP_DEFAULT "127.0.0.2" +#define HNBGW_IUPS_REMOTE_IP_DEFAULT "127.0.0.1" /* 25.467 Section 7.1 */ #define IUH_DEFAULT_SCTP_PORT 29169 @@ -63,15 +65,11 @@ struct llist_head list; enum hnbgw_cnlink_state state; struct hnb_gw *gw; - /* are we a PS connection (1) or CS (0) */ - int is_ps; /* timer for re-transmitting the RANAP Reset */ struct osmo_timer_list T_RafC; /* reference to the SCCP User SAP by which we communicate */ - struct osmo_sccp_user *sua_user; - struct osmo_sccp_link *sua_link; - struct osmo_sccp_addr local_addr; - struct osmo_sccp_addr remote_addr; + struct osmo_sccp_instance *sccp; + struct osmo_sccp_user *sccp_user; uint32_t next_conn_id; /* linked list of hnbgw_context_map */ @@ -131,14 +129,17 @@ struct llist_head hnb_list; /* list of struct ue_context */ struct llist_head ue_list; - /* list of struct hnbgw_cnlink */ - struct llist_head cn_list; /* next availble UE Context ID */ uint32_t next_ue_ctx_id; /* currently active CN links for CS and PS */ - struct hnbgw_cnlink *cnlink_cs; - struct hnbgw_cnlink *cnlink_ps; + struct { + struct osmo_sccp_instance *instance; + struct hnbgw_cnlink *cnlink; + struct osmo_sccp_addr local_addr; + struct osmo_sccp_addr remote_addr_cs; + struct osmo_sccp_addr remote_addr_ps; + } sccp; }; extern void *talloc_asn1_ctx; diff --git a/include/osmocom/iuh/hnbgw_cn.h b/include/osmocom/iuh/hnbgw_cn.h index d5bec04..93123f2 100644 --- a/include/osmocom/iuh/hnbgw_cn.h +++ b/include/osmocom/iuh/hnbgw_cn.h @@ -2,4 +2,5 @@ #include -struct hnbgw_cnlink *hnbgw_cnlink_init(struct hnb_gw *gw, const char *host, uint16_t port, int is_ps); +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, + const char *local_ip, uint32_t local_pc); diff --git a/src/context_map.c b/src/context_map.c index 052133c..0960cb9 100644 --- a/src/context_map.c +++ b/src/context_map.c @@ -58,6 +58,7 @@ /* Map from a HNB + ContextID to the SCCP-side Connection ID */ struct hnbgw_context_map * context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id, + bool is_ps, struct hnbgw_cnlink *cn_if_new) { struct hnbgw_context_map *map; @@ -69,7 +70,8 @@ if (map->cn_link != cn_if_new) { continue; } - if (map->rua_ctx_id == rua_ctx_id) { + if (map->rua_ctx_id == rua_ctx_id + && map->is_ps == is_ps) { return map; } } @@ -88,6 +90,7 @@ map->cn_link = cn_if_new; map->hnb_ctx = hnb; map->rua_ctx_id = rua_ctx_id; + map->is_ps = is_ps; map->scu_conn_id = new_scu_conn_id; /* put it into both lists */ @@ -134,31 +137,27 @@ static void context_map_tmr_cb(void *data) { struct hnb_gw *gw = data; - struct hnbgw_cnlink *cn; + struct hnbgw_cnlink *cn = gw->sccp.cnlink; + struct hnbgw_context_map *map; DEBUGP(DMAIN, "Running context mapper garbage collection\n"); - /* iterate over list of core network (links) */ - llist_for_each_entry(cn, &gw->cn_list, list) { - struct hnbgw_context_map *map; - - llist_for_each_entry(map, &cn->map_list, cn_list) { - switch (map->state) { - case MAP_S_RESERVED1: - /* first time we see this reserved - * entry: mark it for stage 2 */ - map->state = MAP_S_RESERVED2; - break; - case MAP_S_RESERVED2: - /* first time we see this reserved - * entry: remove it */ - map->state = MAP_S_NULL; - llist_del(&map->cn_list); - llist_del(&map->hnb_list); - talloc_free(map); - break; - default: - break; - } + llist_for_each_entry(map, &cn->map_list, cn_list) { + switch (map->state) { + case MAP_S_RESERVED1: + /* first time we see this reserved + * entry: mark it for stage 2 */ + map->state = MAP_S_RESERVED2; + break; + case MAP_S_RESERVED2: + /* first time we see this reserved + * entry: remove it */ + map->state = MAP_S_NULL; + llist_del(&map->cn_list); + llist_del(&map->hnb_list); + talloc_free(map); + break; + default: + break; } } /* re-schedule this timer */ diff --git a/src/hnbgw.c b/src/hnbgw.c index 9984927..5d9f87b 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -47,8 +47,7 @@ #include -#include -#include +#include #include #include @@ -82,16 +81,15 @@ gw->config.iucs_remote_ip = talloc_strdup(gw, HNBGW_IUCS_REMOTE_IP_DEFAULT); - gw->config.iucs_remote_port = SUA_PORT; + gw->config.iucs_remote_port = M3UA_PORT; gw->config.iups_remote_ip = talloc_strdup(gw, HNBGW_IUPS_REMOTE_IP_DEFAULT); - gw->config.iups_remote_port = SUA_PORT; + gw->config.iups_remote_port = M3UA_PORT; gw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&gw->hnb_list); INIT_LLIST_HEAD(&gw->ue_list); - INIT_LLIST_HEAD(&gw->cn_list); context_map_init(gw); @@ -330,11 +328,6 @@ .color = "", .description = "Home Node B Application Part", }, - [DSUA] = { - .name = "DSUA", .loglevel = LOGL_DEBUG, .enabled = 1, - .color = "", - .description = "SCCP User Adaptation", - }, [DRUA] = { .name = "DRUA", .loglevel = LOGL_DEBUG, .enabled = 1, .color = "", @@ -382,7 +375,7 @@ static void print_help() { printf(" -h --help This text.\n"); - printf(" -d option --debug=DHNBAP:DSUA:DRUA:DRANAP:DMAIN Enable debugging.\n"); + printf(" -d option --debug=DHNBAP:DRUA:DRANAP:DMAIN 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"); @@ -451,7 +444,7 @@ int main(int argc, char **argv) { - struct osmo_sccp_user *sua_user; + struct osmo_sccp_user *sccp_user; struct osmo_sccp_link *sua_link; struct osmo_stream_srv_link *srv; int rc; @@ -466,6 +459,8 @@ rc = osmo_init_logging(&hnbgw_log_info); if (rc < 0) exit(1); + + osmo_ss7_init(); vty_info.copyright = osmo_hnbgw_copyright; vty_init(&vty_info); @@ -504,19 +499,25 @@ exit(1); } - osmo_sua_set_log_area(DSUA); ranap_set_log_area(DRANAP); OSMO_ASSERT(g_hnb_gw->config.iucs_remote_ip); - g_hnb_gw->cnlink_cs = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iucs_remote_ip, - g_hnb_gw->config.iucs_remote_port, - 0); - OSMO_ASSERT(g_hnb_gw->config.iups_remote_ip); - g_hnb_gw->cnlink_ps = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iups_remote_ip, - g_hnb_gw->config.iups_remote_port, - 1); + rc = hnbgw_cnlink_init(g_hnb_gw, + g_hnb_gw->config.iucs_remote_ip, + g_hnb_gw->config.iucs_remote_port, + "127.0.0.5" /* FIXME: configurable */, + 23 /* FIXME: configurable */); + if (rc < 0) { + LOGP(DMAIN, LOGL_ERROR, "Failed to initialize SCCP link to CN\n"); + exit(1); + } + + osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_cs, + 1 /* FIXME: configurable */, + OSMO_SCCP_SSN_RANAP); + osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_ps, + 2 /* FIXME: configurable */, + OSMO_SCCP_SSN_RANAP); OSMO_ASSERT(g_hnb_gw->config.iuh_local_ip); LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n", diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 4e5b2e0..2fd9d71 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -24,8 +24,7 @@ #include #include -#include -#include +#include #include #include @@ -41,34 +40,32 @@ int hnbgw_cnlink_change_state(struct hnbgw_cnlink *cnlink, enum hnbgw_cnlink_state state); -static int transmit_rst(struct hnbgw_cnlink *cnlink) +static int transmit_rst(struct hnb_gw *gw, RANAP_CN_DomainIndicator_t domain, + struct osmo_sccp_addr *remote_addr) { struct msgb *msg; struct msgb *msgprim; - RANAP_CN_DomainIndicator_t domain; RANAP_Cause_t cause = { .present = RANAP_Cause_PR_transmissionNetwork, .choice. transmissionNetwork = RANAP_CauseTransmissionNetwork_signalling_transport_resource_failure, }; - if (cnlink->is_ps) - domain = RANAP_CN_DomainIndicator_ps_domain; - else - domain = RANAP_CN_DomainIndicator_cs_domain; - msg = ranap_new_msg_reset(domain, &cause); - return osmo_sccp_tx_unitdata_msg(cnlink->sua_link, &cnlink->local_addr, - &cnlink->remote_addr, msg); + return osmo_sccp_tx_unitdata_msg(gw->sccp.cnlink->sccp_user, + &gw->sccp.local_addr, + remote_addr, + msg); } /* Timer callback once T_RafC expires */ static void cnlink_trafc_cb(void *data) { - struct hnbgw_cnlink *cnlink = data; + struct hnb_gw *gw = data; - transmit_rst(cnlink); - hnbgw_cnlink_change_state(cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); + transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.remote_addr_cs); + transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.remote_addr_ps); + hnbgw_cnlink_change_state(gw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); /* The spec states that we should abandon after a configurable * number of times. We decide to simply continue trying */ } @@ -81,7 +78,7 @@ case CNLINK_S_EST_PEND: break; case CNLINK_S_EST_CONF: - cnlink_trafc_cb(cnlink); + cnlink_trafc_cb(cnlink->gw); break; case CNLINK_S_EST_RST_TX_WAIT_ACK: osmo_timer_schedule(&cnlink->T_RafC, 5, 0); @@ -293,7 +290,7 @@ return 0; } - return rua_tx_dt(map->hnb_ctx, map->cn_link->is_ps, map->rua_ctx_id, + return rua_tx_dt(map->hnb_ctx, map->is_ps, map->rua_ctx_id, msgb_l2(oph->msg), msgb_l2len(oph->msg)); } @@ -322,15 +319,15 @@ return 0; } - return rua_tx_disc(map->hnb_ctx, map->cn_link->is_ps, map->rua_ctx_id, + return rua_tx_disc(map->hnb_ctx, map->is_ps, map->rua_ctx_id, &rua_cause, msgb_l2(oph->msg), msgb_l2len(oph->msg)); } /* Entry point for primitives coming up from SCCP User SAP */ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *ctx) { - struct osmo_sccp_link *slink = ctx; - struct hnbgw_cnlink *cnlink = osmo_sccp_link_get_user_priv(slink); + struct osmo_sccp_user *scu = ctx; + struct hnbgw_cnlink *cnlink = osmo_sccp_user_get_priv(scu); struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; int rc; @@ -361,53 +358,48 @@ return 0; } - -/* Set up a link towards the core network for the circuit switched (is_ps == 0) - * or packet switched (is_ps != 0) domain. */ -struct hnbgw_cnlink *hnbgw_cnlink_init(struct hnb_gw *gw, const char *host, uint16_t port, int is_ps) +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, + const char *local_ip, uint32_t local_pc) { - struct hnbgw_cnlink *cnlink = talloc_zero(gw, struct hnbgw_cnlink); + struct hnbgw_cnlink *cnlink; int rc; + OSMO_ASSERT(!gw->sccp.instance); + OSMO_ASSERT(!gw->sccp.cnlink); + + gw->sccp.instance = osmo_sccp_simple_client(gw, "OsmoHNBGW", local_pc, + OSMO_SS7_ASP_PROT_M3UA, 0, local_ip, + stp_port, stp_host); + if (!gw->sccp.instance) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Instance\n"); + return -1; + } + + LOGP(DRUA, LOGL_DEBUG, "SCCP uplink to STP: %s %u\n", stp_host, stp_port); + + osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, + OSMO_SCCP_SSN_RANAP); + + cnlink = talloc_zero(gw, struct hnbgw_cnlink); cnlink->gw = gw; INIT_LLIST_HEAD(&cnlink->map_list); cnlink->T_RafC.cb = cnlink_trafc_cb; - cnlink->T_RafC.data = cnlink; + cnlink->T_RafC.data = gw; cnlink->next_conn_id = 1000; - cnlink->is_ps = is_ps; - osmo_sccp_make_addr_pc_ssn(&cnlink->local_addr, 2, - OSMO_SCCP_SSN_RANAP); - osmo_sccp_make_addr_pc_ssn(&cnlink->remote_addr, 1, - OSMO_SCCP_SSN_RANAP); - LOGP(DRUA, LOGL_DEBUG, "New hnbgw_cnlink %p (gw %p): %s %d %s\n", - cnlink, cnlink->gw, host, port, is_ps? "PS" : "CS"); - - cnlink->sua_user = osmo_sua_user_create(cnlink, sccp_sap_up, cnlink); - if (!cnlink->sua_user) { - LOGP(DMAIN, LOGL_ERROR, "Failed to init SUA\n"); - goto out_free; - } - rc = osmo_sua_client_connect(cnlink->sua_user, host, port); - if (rc < 0) { - LOGP(DMAIN, LOGL_ERROR, "Failed to connect SUA\n"); - goto out_user; - } - cnlink->sua_link = osmo_sua_client_get_link(cnlink->sua_user); - if (!cnlink->sua_link) { - LOGP(DMAIN, LOGL_ERROR, "Failed to get SUA link\n"); - goto out_disconnect; + cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.instance, + "OsmoHNBGW", + sccp_sap_up, OSMO_SCCP_SSN_RANAP, + gw->sccp.local_addr.pc); + if (!cnlink->sccp_user) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP User\n"); + return -1; } - llist_add_tail(&cnlink->list, &gw->cn_list); + /* In sccp_sap_up() we expect the cnlink in the user's priv. */ + osmo_sccp_user_set_priv(cnlink->sccp_user, cnlink); - return cnlink; + gw->sccp.cnlink = cnlink; -out_disconnect: - /* FIXME */ -out_user: - osmo_sua_user_destroy(cnlink->sua_user); -out_free: - talloc_free(cnlink); - return NULL; + return 0; } diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 6190fd0..329f990 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -170,15 +169,19 @@ struct msgb *msg; struct osmo_scu_prim *prim; struct hnbgw_context_map *map; - struct hnbgw_cnlink *cn; + struct hnbgw_cnlink *cn = hnb->gw->sccp.cnlink; + struct osmo_sccp_addr *remote_addr; + bool is_ps; int rc; switch (cN_DomainIndicator) { case RUA_CN_DomainIndicator_cs_domain: - cn = hnb->gw->cnlink_cs; + remote_addr = &hnb->gw->sccp.remote_addr_cs; + is_ps = false; break; case RUA_CN_DomainIndicator_ps_domain: - cn = hnb->gw->cnlink_ps; + remote_addr = &hnb->gw->sccp.remote_addr_ps; + is_ps = true; break; default: LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n", @@ -191,16 +194,19 @@ return 0; } + msg = msgb_alloc(1500, "rua_to_sccp"); + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); osmo_prim_init(&prim->oph, SCCP_SAP_USER, type, PRIM_OP_REQUEST, msg); - map = context_map_alloc_by_hnb(hnb, context_id, cn); + map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn); + OSMO_ASSERT(map); /* add primitive header */ switch (type) { case OSMO_SCU_PRIM_N_CONNECT: - prim->u.connect.called_addr; - prim->u.connect.calling_addr; + prim->u.connect.called_addr = *remote_addr; + prim->u.connect.calling_addr = cn->gw->sccp.local_addr; prim->u.connect.sccp_class = 2; prim->u.connect.conn_id = map->scu_conn_id; break; @@ -212,8 +218,8 @@ prim->u.disconnect.cause = cause; break; case OSMO_SCU_PRIM_N_UNITDATA: - prim->u.unitdata.called_addr; - prim->u.unitdata.calling_addr; + prim->u.unitdata.called_addr = *remote_addr; + prim->u.unitdata.calling_addr = cn->gw->sccp.local_addr; break; default: return -EINVAL; @@ -225,7 +231,7 @@ memcpy(msg->l2h, data, len); } - rc = osmo_sua_user_link_down(cn->sua_link, &prim->oph); + rc = osmo_sccp_user_sap_down(cn->sccp_user, &prim->oph); return rc; } diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index e2bea07..28ad56c 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -5,7 +5,7 @@ COMMON_LIBS = $(OSMOVTY_LIBS) $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) -lsctp -check_PROGRAMS = test-ranap test-helpers test-hnbap hnb-test dummy-cn +check_PROGRAMS = test-ranap test-helpers test-hnbap hnb-test #dummy-cn noinst_HEADERS = test_common.h hnb-test.h hnb-test-layers.h @@ -24,8 +24,9 @@ test_ranap_SOURCES = $(RANAP_FILES) test-ranap.c test_common.c test_ranap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la -dummy_cn_SOURCES = $(RANAP_FILES) test_common.c dummy_cn_sua.c -dummy_cn_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la +# TODO: re-add using SCCP? +#dummy_cn_SOURCES = $(RANAP_FILES) test_common.c dummy_cn_sua.c +#dummy_cn_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la $(top_builddir)/src/libosmo-ranap.la: $(MAKE) -C $(top_builddir)/src libosmo-ranap.la diff --git a/src/tests/test_common.c b/src/tests/test_common.c index ba00709..c8aafdd 100644 --- a/src/tests/test_common.c +++ b/src/tests/test_common.c @@ -62,11 +62,6 @@ .color = "", .description = "RANAP User Adaptation", }, - [DSUA] = { - .name = "SUA", .loglevel = LOGL_DEBUG, .enabled = 1, - .color = "", - .description = "SCCP User Adaptation", - }, }; static const struct log_info test_log_info = { -- To view, visit https://gerrit.osmocom.org/3109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ac15fa2fd25bedb26297177e416976a5389b573 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh 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 Jul 6 13:53:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 13:53:19 +0000 Subject: [MERGED] osmo-iuh[master]: cosmetic: move callers' common switch() into rua_to_scu() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: move callers' common switch() into rua_to_scu() ...................................................................... cosmetic: move callers' common switch() into rua_to_scu() Change-Id: If6274e3738dc04646d0dc18332c12237e6910d18 --- M src/hnbgw_rua.c 1 file changed, 25 insertions(+), 57 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 47d33f0..6190fd0 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -37,6 +37,7 @@ #include #include #include +#include static int hnbgw_rua_tx(struct hnb_context *ctx, struct msgb *msg) { @@ -159,16 +160,31 @@ -/* forward a RUA message to the SCCP User API to SCCP/SUA */ -static int rua_to_scu(struct hnb_context *hnb, struct hnbgw_cnlink *cn, +/* forward a RUA message to the SCCP User API to SCCP */ +static int rua_to_scu(struct hnb_context *hnb, + CN_DomainIndicator_t cN_DomainIndicator, enum osmo_scu_prim_type type, uint32_t context_id, uint32_t cause, const uint8_t *data, unsigned int len) { - struct msgb *msg = msgb_alloc(1500, "rua_to_sua"); + struct msgb *msg; struct osmo_scu_prim *prim; struct hnbgw_context_map *map; + struct hnbgw_cnlink *cn; int rc; + + switch (cN_DomainIndicator) { + case RUA_CN_DomainIndicator_cs_domain: + cn = hnb->gw->cnlink_cs; + break; + case RUA_CN_DomainIndicator_ps_domain: + cn = hnb->gw->cnlink_ps; + break; + default: + LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n", + cN_DomainIndicator); + return -1; + } if (!cn) { DEBUGP(DRUA, "CN=NULL, discarding message\n"); @@ -280,7 +296,6 @@ { RUA_ConnectIEs_t ies; struct hnb_context *hnb = msg->dst; - struct hnbgw_cnlink *cn; uint32_t context_id; int rc; @@ -290,26 +305,11 @@ context_id = asn1bitstr_to_u24(&ies.context_ID); - /* route to CS (MSC) or PS (SGSN) domain */ - switch (ies.cN_DomainIndicator) { - case RUA_CN_DomainIndicator_cs_domain: - cn = hnb->gw->cnlink_cs; - break; - case RUA_CN_DomainIndicator_ps_domain: - cn = hnb->gw->cnlink_ps; - break; - default: - LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n", - ies.cN_DomainIndicator); - rua_free_connecties(&ies); - return -1; - } - DEBUGP(DRUA, "RUA Connect.req(ctx=0x%x, %s)\n", context_id, ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal"); - rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_CONNECT, + rc = rua_to_scu(hnb, ies.cN_DomainIndicator, OSMO_SCU_PRIM_N_CONNECT, context_id, 0, ies.ranaP_Message.buf, ies.ranaP_Message.size); /* FIXME: what to do with the asn1c-allocated memory */ @@ -322,7 +322,6 @@ { RUA_DisconnectIEs_t ies; struct hnb_context *hnb = msg->dst; - struct hnbgw_cnlink *cn; uint32_t context_id; uint32_t scu_cause; uint8_t *ranap_data = NULL; @@ -339,30 +338,15 @@ DEBUGP(DRUA, "RUA Disconnect.req(ctx=0x%x,cause=%s)\n", context_id, rua_cause_str(&ies.cause)); - /* route to CS (MSC) or PS (SGSN) domain */ - switch (ies.cN_DomainIndicator) { - case RUA_CN_DomainIndicator_cs_domain: - cn = hnb->gw->cnlink_cs; - break; - case RUA_CN_DomainIndicator_ps_domain: - cn = hnb->gw->cnlink_ps; - break; - default: - LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %l\n", - ies.cN_DomainIndicator); - rc = -1; - goto error_free; - } - if (ies.presenceMask & DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT) { ranap_data = ies.ranaP_Message.buf; ranap_len = ies.ranaP_Message.size; } - rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DISCONNECT, + rc = rua_to_scu(hnb, ies.cN_DomainIndicator, + OSMO_SCU_PRIM_N_DISCONNECT, context_id, scu_cause, ranap_data, ranap_len); -error_free: /* FIXME: what to do with the asn1c-allocated memory */ rua_free_disconnecties(&ies); @@ -373,7 +357,6 @@ { RUA_DirectTransferIEs_t ies; struct hnb_context *hnb = msg->dst; - struct hnbgw_cnlink *cn; uint32_t context_id; int rc; @@ -385,31 +368,16 @@ DEBUGP(DRUA, "RUA Data.req(ctx=0x%x)\n", context_id); - /* route to CS (MSC) or PS (SGSN) domain */ - switch (ies.cN_DomainIndicator) { - case RUA_CN_DomainIndicator_cs_domain: - cn = hnb->gw->cnlink_cs; - break; - case RUA_CN_DomainIndicator_ps_domain: - cn = hnb->gw->cnlink_ps; - break; - default: - LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %l\n", - ies.cN_DomainIndicator); - rc = -1; - goto error_free; - } - - rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DATA, + rc = rua_to_scu(hnb, + ies.cN_DomainIndicator, + OSMO_SCU_PRIM_N_DATA, context_id, 0, ies.ranaP_Message.buf, ies.ranaP_Message.size); -error_free: /* FIXME: what to do with the asn1c-allocated memory */ rua_free_directtransferies(&ies); return rc; - } static int rua_rx_init_udt(struct msgb *msg, ANY_t *in) -- To view, visit https://gerrit.osmocom.org/3108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If6274e3738dc04646d0dc18332c12237e6910d18 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh 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 Jul 6 14:16:04 2017 From: gerrit-no-reply at lists.osmocom.org (allesklar2) Date: Thu, 6 Jul 2017 14:16:04 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) > onee question though: This is submitted for the sq5bpf-rebase > branch (which was basically just a quick test by me some time ago), > but should actually go in master, or is there any specific > dependency? If so, please explain. There is no special dependency. I just stated developing on the sq5bpf-rebase-branch for other reasons. Now I decided to first commit my code here and wait for feedback. I through it would end in a mess if I start committing the same stuff in two branches. https://gerrit.osmocom.org/#/c/2817/1/src/conv_enc_test.c File src/conv_enc_test.c: PS1, Line 53: void dp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned int len, void *priv) : { : } > Why this is empty? I have not figured out why yet, but without this function I get some error during the compilation. -- To view, visit https://gerrit.osmocom.org/2817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: allesklar2 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 6 14:18:26 2017 From: gerrit-no-reply at lists.osmocom.org (allesklar2) Date: Thu, 6 Jul 2017 14:18:26 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support In-Reply-To: References: Message-ID: Patch Set 1: Do you see my updated code or do I have to push a button somewhere? -- To view, visit https://gerrit.osmocom.org/2817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: allesklar2 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 14:32:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 14:32:47 +0000 Subject: [MERGED] osmo-iuh[master]: set RANAP msgb headroom to 512 (times two) In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: set RANAP msgb headroom to 512 (times two) ...................................................................... set RANAP msgb headroom to 512 (times two) With a headroom of 256, the SGSN crashes with: msgb(0x6e3b90): Not enough headroom msgb_push (256 < 264) I'm not perfectly sure what amount of headroom is strictly necessary. The only reason to pick 512 is that it is twice the amount of 256. Change-Id: I9a193846902a0477af0873f78283c4f2bedaf5dd --- M src/ranap_common.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ranap_common.c b/src/ranap_common.c index a468229..13c913f 100644 --- a/src/ranap_common.c +++ b/src/ranap_common.c @@ -291,7 +291,7 @@ static struct msgb *ranap_msgb_alloc(void) { - return msgb_alloc_headroom(1024+256, 256, "RANAP Tx"); + return msgb_alloc_headroom(1024+512, 512, "RANAP Tx"); } static struct msgb *_ranap_gen_msg(RANAP_RANAP_PDU_t *pdu) -- To view, visit https://gerrit.osmocom.org/3114 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9a193846902a0477af0873f78283c4f2bedaf5dd Gerrit-PatchSet: 3 Gerrit-Project: osmo-iuh 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 Jul 6 14:51:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 14:51:51 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Remove currently broken everything logging option Message-ID: Review at https://gerrit.osmocom.org/3145 Remove currently broken everything logging option Change-Id: I52e370d59274e29502cd23690f0d5c73aa3a4cc7 Related: OS#71 --- M common/chapters/vty.adoc 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/45/3145/1 diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index 931cd1f..d84d5cf 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -246,7 +246,7 @@ logging print extended-timestamp (0|1) logging print category (0|1) logging set-log-mask MASK - logging level (all|rll|cc|mm|rr|rsl|nm|mncc|pag|meas|sccp|msc|mgcp|ho|db|ref|gprs|ns|bssgp|llc|sndcp|nat|ctrl|smpp|filter|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats) (everything|debug|info|notice|error|fatal) + logging level (all|rll|cc|mm|rr|rsl|nm|mncc|pag|meas|sccp|msc|mgcp|ho|db|ref|gprs|ns|bssgp|llc|sndcp|nat|ctrl|smpp|filter|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats) (debug|info|notice|error|fatal) show logging vty show alarms show stats -- To view, visit https://gerrit.osmocom.org/3145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52e370d59274e29502cd23690f0d5c73aa3a4cc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 6 14:59:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 14:59:44 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Improve SMPP supported features and test coverage In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3129 to look at the new patch set (#3). Improve SMPP supported features and test coverage esme: Add several bits to handle logic required by tests: - Allow specifying the mode used to send an sms - Add a parameter to ask to receive a Delivery receipt for that message - Add sms_send_wait_resp API, which waits until the response message for a given smpp message is received when sending an sms. - Add receipt_was_received API, which together with message_received_handler maintains state of the delivery receipts we asked for and were still not received. However, the check needs to be disabled for now because OsmoNITB doens't seem to be sending stuff properly, see OsmoNITB #2353. - On message_received_handler, also print alert_notification messages, to show that there's actually a bug in OsmoNITB, see #2352. Move old esme_ms_sms to esme_ms_sms_transaction, and explicitly state that we are using that mode. On the same test, we can now enable the part which asserts that sending an SMS to an msisdn with unknown destination triggers an error. The issue was mainly that the error had to come from the SMSC server response, not from the sent message, so we have to wait for the response to have the failure triggered. Finally, add esme_ms_sms_storeforward, which tests features for sms sent using that mode, and uses the APIs described above. Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e --- M src/osmo_gsm_tester/esme.py A suites/aoip_smpp/esme_ms_sms_storeforward.py R suites/aoip_smpp/esme_ms_sms_transaction.py A suites/smpp/esme_ms_sms_storeforward.py R suites/smpp/esme_ms_sms_transaction.py 5 files changed, 178 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/29/3129/3 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index f92863d..5a8dd0e 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -19,6 +19,7 @@ import smpplib.gsm import smpplib.client +import smpplib.command import smpplib.consts import smpplib.exceptions @@ -35,6 +36,9 @@ client = None smsc = None + MSGMODE_TRANSACTION = smpplib.consts.SMPP_MSGMODE_FORWARD + MSGMODE_STOREFORWARD = smpplib.consts.SMPP_MSGMODE_STOREFORWARD + def __init__(self, msisdn): self.msisdn = msisdn # Get last characters of msisdn to stay inside MAX_SYS_ID_LEN. Similar to modulus operator. @@ -44,6 +48,8 @@ self.connected = False self.bound = False self.listening = False + self.references_pending_receipt = [] + self.next_user_message_reference = 1 def __del__(self): try: @@ -89,9 +95,8 @@ self.disconnect() self.client = smpplib.client.Client(host, port, timeout=None) self.client.set_message_sent_handler( - lambda pdu: self.dbg('message sent:', repr(pdu)) ) - self.client.set_message_received_handler( - lambda pdu: self.dbg('message received:', repr(pdu)) ) + lambda pdu: self.dbg('message sent unhandled resp:', pdu.sequence) ) + self.client.set_message_received_handler(self.message_received_handler) self.client.connect() self.connected = True self.client.bind_transceiver(system_id=self.system_id, password=self.password) @@ -108,6 +113,19 @@ self.client.disconnect() self.connected = False + def message_received_handler(self, pdu, *args): + self.dbg('message received:', seq=pdu.sequence) + if isinstance(pdu, smpplib.command.AlertNotification): + self.dbg('message received: AlertNotification:', ms_availability_status=pdu.ms_availability_status) + elif isinstance(pdu, smpplib.command.DeliverSM): + self.dbg('message received:', user_message_reference=pdu.user_message_reference, references_pending_receipt=self.references_pending_receipt) + self.references_pending_receipt.remove(pdu.user_message_reference) + + def receipt_was_received(self, umref): + # return umref not in self.references_pending_receipt + self.log('FIXME: wait_receipt disabled because receipts are not received, see OsmoNITB #2353') + return True + def run_method_expect_failure(self, errcode, method, *args): try: method(*args) @@ -116,11 +134,14 @@ except smpplib.exceptions.PDUError as e: if e.args[1] != errcode: raise e + self.dbg('Expected failure triggered: %d' % errcode) - def sms_send(self, sms_obj): + def sms_send(self, sms_obj, mode, receipt=False): parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) - + seqs = [] self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) + umref = self.next_user_message_reference + self.next_user_message_reference += 1 for part in parts: pdu = self.client.send_message( source_addr_ton=smpplib.consts.SMPP_TON_INTL, @@ -131,8 +152,30 @@ destination_addr=sms_obj.dst_msisdn(), short_message=part, data_coding=encoding_flag, - esm_class=smpplib.consts.SMPP_MSGMODE_FORWARD, - registered_delivery=False, + esm_class=mode, + registered_delivery=receipt, + user_message_reference=umref, ) + self.dbg('sent part with seq', pdu.sequence) + seqs.append(pdu.sequence) + if receipt: + self.references_pending_receipt.append(umref) + return umref, seqs + + def process_pdus_pending(self, pdu, **kwargs): + self.dbg('message sent resp with seq', pdu.sequence, ', pdus_pending:', self.pdus_pending) + self.pdus_pending.remove(pdu.sequence) + + def sms_send_wait_resp(self, sms_obj, mode, receipt=False): + try: + old_func = self.client.message_sent_handler + umref, self.pdus_pending = self.sms_send(sms_obj, mode, receipt) + self.dbg('pdus_pending:', self.pdus_pending) + self.client.set_message_sent_handler(self.process_pdus_pending) + event_loop.wait(self, lambda: len(self.pdus_pending) == 0, timeout=10) + return umref + finally: + self.client.set_message_sent_handler(old_func) + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py new file mode 100755 index 0000000..3e7e4f8 --- /dev/null +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * When SMS is sent in 'store & forward' mode, ESME fails to send an SMS to non registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to a not yet registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'store & forward' mode, ESME receives a SMS receipt if it asked for it. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +bsc.bts_add(bts) + +ms = suite.modem() +esme = suite.esme() +msc.smsc.esme_add(esme) + +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +esme.connect() +hlr.subscriber_add(ms) + +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending sms with wrong msisdn %s, it will fail' % 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) + +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) + +print('checking MS can receive SMS while registered...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send already-registered message') +umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) +wait(ms.sms_was_received, msg) +print('Waiting to receive and consume sms receipt with reference', umref) +wait(esme.receipt_was_received, umref) +esme.disconnect() diff --git a/suites/aoip_smpp/esme_ms_sms.py b/suites/aoip_smpp/esme_ms_sms_transaction.py similarity index 65% rename from suites/aoip_smpp/esme_ms_sms.py rename to suites/aoip_smpp/esme_ms_sms_transaction.py index 7f9ef18..8bcfb6b 100755 --- a/suites/aoip_smpp/esme_ms_sms.py +++ b/suites/aoip_smpp/esme_ms_sms_transaction.py @@ -3,7 +3,8 @@ # This test checks following use-cases: # * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously # defined in its configuration file. -# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. +# * When SMS is sent in 'transaction' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'transaction' mode, ESME fails to send an SMS to non registered MS. from osmo_gsm_tester.test import * @@ -39,18 +40,17 @@ print('sending first sms...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) print('sending second sms (unicode chars not in gsm aplhabet)...') msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) -# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) -# wrong_msisdn = ms.msisdn + esme.msisdn -# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) -# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_TRANSACTION) esme.disconnect() diff --git a/suites/smpp/esme_ms_sms_storeforward.py b/suites/smpp/esme_ms_sms_storeforward.py new file mode 100755 index 0000000..5ff6ad3 --- /dev/null +++ b/suites/smpp/esme_ms_sms_storeforward.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * When SMS is sent in 'store & forward' mode, ESME fails to send an SMS to non registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to a not yet registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'store & forward' mode, ESME receives a SMS receipt if it asked for it. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() +esme = suite.esme() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.smsc.esme_add(esme) +nitb.start() +bts.start() + +esme.connect() +nitb.subscriber_add(ms) + +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending sms with wrong msisdn %s, it will fail' % 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) + +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(nitb.mcc_mnc()) +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.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) + +print('checking MS can receive SMS while registered...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send already-registered message') +umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) +wait(ms.sms_was_received, msg) +print('Waiting to receive and consume sms receipt with reference', umref) +wait(esme.receipt_was_received, umref) +esme.disconnect() diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms_transaction.py similarity index 62% rename from suites/smpp/esme_ms_sms.py rename to suites/smpp/esme_ms_sms_transaction.py index bc9d7d4..a147754 100755 --- a/suites/smpp/esme_ms_sms.py +++ b/suites/smpp/esme_ms_sms_transaction.py @@ -3,7 +3,8 @@ # This test checks following use-cases: # * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously # defined in its configuration file. -# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. +# * When SMS is sent in 'transaction' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'transaction' mode, ESME fails to send an SMS to non registered MS. from osmo_gsm_tester.test import * @@ -31,19 +32,17 @@ print('sending first sms...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) print('sending second sms (unicode chars not in gsm aplhabet)...') msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) - -# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) -# wrong_msisdn = ms.msisdn + esme.msisdn -# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) -# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_TRANSACTION) esme.disconnect() -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 14:59:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 14:59:45 +0000 Subject: [PATCH] osmo-gsm-tester[master]: aoip_smpp: Disable check in esme_ms_sms_storeforward due to ... Message-ID: Review at https://gerrit.osmocom.org/3146 aoip_smpp: Disable check in esme_ms_sms_storeforward due to known issue A test case checked in that test is known to be failing at the moment due to missing correct implementation bits for AoIP software. Comment it in a separate commit so that is easy to revert it once we have it implemented. See OsmoSMSC #2354 for more information. Change-Id: I12f8dbe1d6dc9a554438fda1e38b2e5e3245c320 --- M suites/aoip_smpp/esme_ms_sms_storeforward.py 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/46/3146/1 diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py index 3e7e4f8..308ebf3 100755 --- a/suites/aoip_smpp/esme_ms_sms_storeforward.py +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -39,17 +39,18 @@ 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) -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) +# 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('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/3146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I12f8dbe1d6dc9a554438fda1e38b2e5e3245c320 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 14:59:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 14:59:45 +0000 Subject: libosmo-netif[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: Some compilation warnings ned to be fixed for BSD/clang before this one can be merged. -- To view, visit https://gerrit.osmocom.org/3140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 14:59:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 14:59:48 +0000 Subject: libosmo-abis[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: Some compilation warnings ned to be fixed for BSD/clang before this one can be merged. -- To view, visit https://gerrit.osmocom.org/3138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I065b18dd6c4f7616f981aa4273e68e23825a7294 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Jul 6 15:01:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 15:01:40 +0000 Subject: osmo-gsm-tester[master]: Improve SMPP supported features and test coverage In-Reply-To: References: Message-ID: Patch Set 3: It can now be reviewed. -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 15:12:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 15:12:24 +0000 Subject: openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 4 Gerrit-Project: openbsc 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 Jul 6 15:18:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 15:18:16 +0000 Subject: [PATCH] libosmocore[master]: Deprecate wrappers around loglevel_strs Message-ID: Review at https://gerrit.osmocom.org/3147 Deprecate wrappers around loglevel_strs Add deprecation notice for public API use: it shouldn't be used outside of libosmocore anyway. Change-Id: I792e30dc44f027fd94e1f65af19fe08bac52b95c Related: OS#71 --- M include/osmocom/core/logging.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/3147/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 68a9c13..e058a57 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -306,8 +306,8 @@ 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); -int log_parse_level(const char *lvl); -const char *log_level_str(unsigned int lvl); +int log_parse_level(const char *lvl) OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE; +const char *log_level_str(unsigned int lvl) OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE; int log_parse_category(const char *category); void log_set_category_filter(struct log_target *target, int category, int enable, int level); -- To view, visit https://gerrit.osmocom.org/3147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I792e30dc44f027fd94e1f65af19fe08bac52b95c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 6 15:18:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 15:18:17 +0000 Subject: [PATCH] libosmocore[master]: Ignore broken everything log level Message-ID: Review at https://gerrit.osmocom.org/3148 Ignore broken everything log level Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f Related: OS#71 --- M src/vty/logging_vty.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/3148/1 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 758f0b9..01480b1 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -213,6 +213,11 @@ return CMD_WARNING; } + if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */ + vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE); + return CMD_SUCCESS; + } + /* Check for special case where we want to set global log level */ if (!strcmp(argv[0], "all")) { log_set_log_level(tgt, level); @@ -730,8 +735,10 @@ osmo_str2lower(cat_lower, osmo_log_info->cat[i].name+1); osmo_str2lower(level_lower, log_level_str(cat->loglevel)); - vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, - VTY_NEWLINE); + if (strcmp(level_lower, "everything") != 0) /* FIXME: remove this check once 'everything' is phased out */ + vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE); + else + LOGP(DLSTATS, LOGL_ERROR, "logging level everything is deprecated and should not be used\n"); } /* FIXME: levels */ -- To view, visit https://gerrit.osmocom.org/3148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 6 15:20:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 15:20:49 +0000 Subject: openbsc[master]: smpp_smsc.c: Log on sending deliver_sm message In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 15:28:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 15:28:05 +0000 Subject: libosmocore[master]: vty: fix "logging level ... everything" option In-Reply-To: References: Message-ID: Patch Set 10: Deprecation patch is available in #3148 , please also commet in OS#71 to make sure we're on the same page with regards to deprecation/replacement. -- To view, visit https://gerrit.osmocom.org/1582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib51987fb2f64a70fca130f3799dc8fd71cc7085c Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 15:56:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 6 Jul 2017 15:56:24 +0000 Subject: [PATCH] osmo-gsm-tester[master]: contrib: Disable doxygen doc generation Message-ID: Review at https://gerrit.osmocom.org/3149 contrib: Disable doxygen doc generation The --disable-doxygen was recently added to libosmocore and libosmo-netif. No need to manually remove documentation anymore. Change-Id: I3ca3dd1c115fc6784e4dc26a5ff5bf35d65b4e22 --- M contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh 6 files changed, 7 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/49/3149/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index efc621a..3e30873 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -139,10 +139,6 @@ } create_bin_tgz() { - # don't package documentation -- the libosmocore docs can be up to 16 Mb large, - # a significant amount compared to the binaries - rm -rf "$prefix_real/share/doc/"{libosmocore,libosmo-sccp} || true - # build the archive that is going to be copied to the tester cd "$prefix_real" this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index dad2151..f286368 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -16,7 +16,7 @@ # for gsm_data_shared.h have_repo openbsc -build_repo libosmocore --disable-pcsc +build_repo libosmocore --disable-pcsc --disable-doxygen build_repo libosmo-abis build_repo osmo-bts --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 3e61b70..c4bdcaf 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -7,7 +7,7 @@ # for gsm_data_shared.* have_repo openbsc -build_repo libosmocore +build_repo libosmocore --disable-doxygen build_repo libosmo-abis build_repo osmo-trx --without-sse build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 8207451..67e135f 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -4,7 +4,7 @@ name="osmo-hlr" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore +build_repo libosmocore --disable-doxygen build_repo libosmo-abis build_repo osmo-hlr diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index f9710c0..dddacc7 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -4,9 +4,9 @@ name="osmo-msc" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore +build_repo libosmocore --disable-doxygen build_repo libosmo-abis -build_repo libosmo-netif +build_repo libosmo-netif --disable-doxygen build_repo openggsn build_repo libsmpp34 build_repo libosmo-sccp diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 76fd6ba..2f26a20 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -4,9 +4,9 @@ name="osmo-nitb" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore +build_repo libosmocore --disable-doxygen build_repo libosmo-abis -build_repo libosmo-netif +build_repo libosmo-netif --disable-doxygen build_repo openggsn build_repo libsmpp34 build_repo libosmo-sccp -- To view, visit https://gerrit.osmocom.org/3149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ca3dd1c115fc6784e4dc26a5ff5bf35d65b4e22 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 6 17:51:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 6 Jul 2017 17:51:58 +0000 Subject: [PATCH] osmo-pcu[master]: Move DL scheduling and RTS handler to trx level Message-ID: Review at https://gerrit.osmocom.org/3150 Move DL scheduling and RTS handler to trx level Use TRX object directly instead of BTS singleton and trx_no. Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Related: OS#1541 --- M src/gprs_rlcmac.h M src/gprs_rlcmac_sched.cpp M src/pcu_l1_if.cpp M tests/tbf/TbfTest.cpp 4 files changed, 42 insertions(+), 51 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/50/3150/1 diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..3d825a8 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -89,9 +89,7 @@ int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len, const char *imsi); -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr); +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr); int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class = 0); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a21c023..a8392cb 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,12 +25,10 @@ #include "pcu_utils.h" -static uint32_t sched_poll(BTS *bts, - uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, - struct gprs_rlcmac_tbf **poll_tbf, - struct gprs_rlcmac_tbf **ul_ass_tbf, - struct gprs_rlcmac_tbf **dl_ass_tbf, - struct gprs_rlcmac_ul_tbf **ul_ack_tbf) +static uint32_t sched_poll(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_tbf **poll_tbf, + struct gprs_rlcmac_tbf **ul_ass_tbf, struct gprs_rlcmac_tbf **dl_ass_tbf, + struct gprs_rlcmac_ul_tbf **ul_ack_tbf) { struct gprs_rlcmac_ul_tbf *ul_tbf; struct gprs_rlcmac_dl_tbf *dl_tbf; @@ -42,11 +40,11 @@ if ((block_nr % 3) == 2) poll_fn ++; poll_fn = poll_fn % GSM_MAX_FN; - llist_for_each(pos, &bts->ul_tbfs()) { + llist_for_each(pos, &trx->bts->ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); OSMO_ASSERT(ul_tbf); /* this trx, this ts */ - if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) + if (ul_tbf->trx->trx_no != trx->trx_no || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -62,11 +60,11 @@ *ul_ass_tbf = ul_tbf; #warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" } - llist_for_each(pos, &bts->dl_tbfs()) { + llist_for_each(pos, &trx->bts->dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); OSMO_ASSERT(dl_tbf); /* this trx, this ts */ - if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) + if (dl_tbf->trx->trx_no != trx->trx_no || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -206,9 +204,8 @@ return NULL; } -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) +static struct msgb *sched_select_downlink(struct gprs_rlcmac_trx *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; @@ -225,7 +222,7 @@ 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); + OSMO_MIN(BTS::TIMER_T3190_MSEC/2, trx->bts->bts_data()->dl_tbf_idle_msec); const int age_thresh2 = msecs_to_frames(high_prio_msecs); /* select downlink resource */ @@ -277,7 +274,7 @@ if (prio_tbf) { LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling data message at " "RTS for DL TFI=%d (TRX=%d, TS=%d) prio=%d\n", - prio_tfi, trx, ts, max_prio); + prio_tfi, trx->trx_no, ts, max_prio); /* next TBF to handle resource is the next one */ pdch->next_dl_tfi = (prio_tfi + 1) & 31; /* generate DL data block */ @@ -307,9 +304,7 @@ return msg; } -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr) +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr) { struct gprs_rlcmac_pdch *pdch; struct gprs_rlcmac_tbf *poll_tbf = NULL, *dl_ass_tbf = NULL, @@ -319,51 +314,49 @@ struct msgb *msg = NULL; uint32_t poll_fn, sba_fn; - if (trx >= 8 || ts >= 8) + if (trx->trx_no >= 8 || ts >= 8) return -EINVAL; - pdch = &bts->trx[trx].pdch[ts]; + pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { LOGP(DRLCMACSCHED, LOGL_ERROR, "Received RTS on disabled PDCH: " - "TRX=%d TS=%d\n", trx, ts); + "TRX=%d TS=%d\n", trx->trx_no, ts); return -EIO; } /* store last frame number of RTS */ pdch->last_rts_fn = fn; - poll_fn = sched_poll(bts->bts, trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, - &dl_ass_tbf, &ul_ack_tbf); + poll_fn = sched_poll(trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, &dl_ass_tbf, &ul_ack_tbf); /* check uplink resource for polling */ if (poll_tbf) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "polling at FN=%d of %s\n", trx, ts, fn, + "polling at FN=%d of %s\n", trx->trx_no, ts, fn, block_nr, poll_fn, tbf_name(poll_tbf)); /* use free USF */ /* else. check for sba */ - else if ((sba_fn = bts->bts->sba()->sched(trx, ts, fn, block_nr) != 0xffffffff)) + else if ((sba_fn = trx->bts->sba()->sched(trx->trx_no, ts, fn, block_nr) != 0xffffffff)) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "single block allocation at FN=%d\n", trx, ts, fn, + "single block allocation at FN=%d\n", trx->trx_no, ts, fn, block_nr, sba_fn); /* use free USF */ /* else, we search for uplink resource */ else - usf = sched_select_uplink(trx, ts, fn, block_nr, pdch); + usf = sched_select_uplink(trx->trx_no, ts, fn, block_nr, pdch); /* Prio 1: select control message */ - msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, - dl_ass_tbf, ul_ack_tbf); + msg = sched_select_ctrl_msg(trx->trx_no, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); if (msg) - bts->bts->rlc_sent_control(); + trx->bts->rlc_sent_control(); /* Prio 2: select data message for downlink */ if (!msg) { - msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); + msg = sched_select_downlink(trx, ts, fn, block_nr, pdch); if (msg) - bts->bts->rlc_sent(); + trx->bts->rlc_sent(); } /* Prio 3: send dummy contol message */ @@ -371,13 +364,13 @@ /* increase counter */ msg = sched_dummy(); if (msg) - bts->bts->rlc_sent_dummy(); + trx->bts->rlc_sent_dummy(); } if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + trx->bts->rlc_dl_bytes(msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); @@ -387,7 +380,7 @@ gprs_bssgp_update_frames_sent(); /* send PDTCH/PACCH to L1 */ - pcu_l1if_tx_pdtch(msg, trx, ts, bts->trx[trx].arfcn, fn, block_nr); + pcu_l1if_tx_pdtch(msg, trx->trx_no, ts, trx->arfcn, fn, block_nr); return 0; } diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index c2c6cc6..c3b4a49 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -308,11 +308,13 @@ } // FIXME: remove this, when changed from c++ to c. -extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx, uint8_t ts, +extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx_no, uint8_t ts, uint32_t fn, uint8_t block_nr) { - return gprs_rlcmac_rcv_rts_block(bts_main_data(), - trx, ts, fn, block_nr); + struct gprs_rlcmac_bts *bts = bts_main_data(); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + return gprs_rlcmac_rcv_rts_block(trx, ts, fn, block_nr); } static int pcu_rx_rts_req(struct gsm_pcu_if_rts_req *rts_req) diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..417dfee 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -203,7 +203,8 @@ uint32_t *fn, uint8_t *block_nr = NULL) { uint8_t bn = fn2bn(*fn); - gprs_rlcmac_rcv_rts_block(bts, trx_no, ts_no, *fn, bn); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); *fn = fn_add_blocks(*fn, 1); bn += 1; if (block_nr) @@ -1651,9 +1652,8 @@ for (ts_no = 0 ; ts_no < 8; ts_no += 1) { if (!(slots & (1 << ts_no))) continue; - gprs_rlcmac_rcv_rts_block(the_bts->bts_data(), - dl_tbf->trx->trx_no, ts_no, - *fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts->bts_data()->trx[dl_tbf->trx->trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); } *fn = fn_add_blocks(*fn, 1); } @@ -3230,9 +3230,8 @@ /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); @@ -3307,9 +3306,8 @@ /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 6 18:08:07 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 6 Jul 2017 18:08:07 +0000 Subject: osmo-trx[master]: deb: remove unused dependency In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) So a -1 from me. https://gerrit.osmocom.org/#/c/3079/2/debian/control File debian/control: Line 8 yes Line 22: Depends: ${shlibs:Depends}, ${misc:Depends}, libsqlite3-0 That is wrong. ${shlibs:Depends} will add dependencies for all libraries linked against.. e.g. the package name might be libsqlire3-1 in the future? -- To view, visit https://gerrit.osmocom.org/3079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 6 20:10:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 20:10:16 +0000 Subject: osmo-gsm-tester[master]: contrib: Disable doxygen doc generation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ca3dd1c115fc6784e4dc26a5ff5bf35d65b4e22 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 20:10:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 20:10:18 +0000 Subject: [MERGED] osmo-gsm-tester[master]: contrib: Disable doxygen doc generation In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: contrib: Disable doxygen doc generation ...................................................................... contrib: Disable doxygen doc generation The --disable-doxygen was recently added to libosmocore and libosmo-netif. No need to manually remove documentation anymore. Change-Id: I3ca3dd1c115fc6784e4dc26a5ff5bf35d65b4e22 --- M contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh 6 files changed, 7 insertions(+), 11 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index efc621a..3e30873 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -139,10 +139,6 @@ } create_bin_tgz() { - # don't package documentation -- the libosmocore docs can be up to 16 Mb large, - # a significant amount compared to the binaries - rm -rf "$prefix_real/share/doc/"{libosmocore,libosmo-sccp} || true - # build the archive that is going to be copied to the tester cd "$prefix_real" this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index dad2151..f286368 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -16,7 +16,7 @@ # for gsm_data_shared.h have_repo openbsc -build_repo libosmocore --disable-pcsc +build_repo libosmocore --disable-pcsc --disable-doxygen build_repo libosmo-abis build_repo osmo-bts --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 3e61b70..c4bdcaf 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -7,7 +7,7 @@ # for gsm_data_shared.* have_repo openbsc -build_repo libosmocore +build_repo libosmocore --disable-doxygen build_repo libosmo-abis build_repo osmo-trx --without-sse build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 8207451..67e135f 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -4,7 +4,7 @@ name="osmo-hlr" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore +build_repo libosmocore --disable-doxygen build_repo libosmo-abis build_repo osmo-hlr diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index f9710c0..dddacc7 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -4,9 +4,9 @@ name="osmo-msc" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore +build_repo libosmocore --disable-doxygen build_repo libosmo-abis -build_repo libosmo-netif +build_repo libosmo-netif --disable-doxygen build_repo openggsn build_repo libsmpp34 build_repo libosmo-sccp diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 76fd6ba..2f26a20 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -4,9 +4,9 @@ name="osmo-nitb" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore +build_repo libosmocore --disable-doxygen build_repo libosmo-abis -build_repo libosmo-netif +build_repo libosmo-netif --disable-doxygen build_repo openggsn build_repo libsmpp34 build_repo libosmo-sccp -- To view, visit https://gerrit.osmocom.org/3149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ca3dd1c115fc6784e4dc26a5ff5bf35d65b4e22 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 6 20:11:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 20:11:53 +0000 Subject: libosmo-sccp[master]: simple-client/server: be able to decide on which ss7 instanc... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 6 20:12:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 20:12:04 +0000 Subject: [MERGED] libosmo-sccp[master]: simple-client/server: be able to decide on which ss7 instanc... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: simple-client/server: be able to decide on which ss7 instance to bind ...................................................................... simple-client/server: be able to decide on which ss7 instance to bind osmo_sccp_simple_client() and osmo_sccp_simple_server() are binding on the ss7 instance with the id 1 by default. If the instance does not exist, it is created automatically. Allow choosing the ss7 instance by supplying the id number as function parameter. Add two new functions: osmo_sccp_simple_client_on_ss7_id() osmo_sccp_simple_server_on_ss7_id() Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e --- M include/osmocom/sigtran/osmo_ss7.h M src/sccp_user.c 2 files changed, 39 insertions(+), 8 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index caf12f5..57a4e06 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -439,11 +439,22 @@ const char *local_ip, int remote_port, const char *remote_ip); struct osmo_sccp_instance * +osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, + uint32_t pc, enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip, + int remote_port, const char *remote_ip); + +struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip); struct osmo_sccp_instance * +osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip); + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, diff --git a/src/sccp_user.c b/src/sccp_user.c index 93b03f6..b21a756 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -236,9 +236,10 @@ ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip) +osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, + uint32_t pc, enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip, + int remote_port, const char *remote_ip) { struct osmo_ss7_instance *ss7; struct osmo_ss7_as *as; @@ -252,7 +253,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) { LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); return NULL; @@ -309,14 +310,24 @@ return NULL; } +struct osmo_sccp_instance * +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip, int remote_port, const char *remote_ip) +{ + return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, pc, prot, + local_port, local_ip, + remote_port, remote_ip); +} + /*********************************************************************** * Convenience function for SERVER ***********************************************************************/ struct osmo_sccp_instance * -osmo_sccp_simple_server(void *ctx, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip) +osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, + enum osmo_ss7_asp_protocol prot, + int local_port, const char *local_ip) { struct osmo_ss7_instance *ss7; struct osmo_xua_server *xs; @@ -325,7 +336,7 @@ local_port = osmo_ss7_asp_protocol_port(prot); /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, 1); + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); if (!ss7) return NULL; ss7->cfg.primary_pc = pc; @@ -350,6 +361,15 @@ } struct osmo_sccp_instance * +osmo_sccp_simple_server(void *ctx, uint32_t pc, + enum osmo_ss7_asp_protocol prot, int local_port, + const char *local_ip) +{ + return osmo_sccp_simple_server_on_ss7_id(ctx, 1, pc, prot, + local_port, local_ip); +} + +struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, -- To view, visit https://gerrit.osmocom.org/3104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62e608253212415bddbb4c7dcf5d3b5e79c8d28e Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 6 23:05:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 6 Jul 2017 23:05:58 +0000 Subject: libosmo-sccp[master]: vty: move sccp_addressbook from _sg to _addr In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3103/3/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 1635: { problem: this function osmo_ss7_vty_init_addr() cannot be called independently: it depends on the L_CS7_NODE to be installed first. The other functions of the same form, _init_asp and _init_sg, each call vty_init_shared() and thus make sure that the L_CS7_NODE is indeed installed. This difference in behavior isn't clear. I guess easiest would be to simply move the address book init into vty_init_shared() and have it always available. Why would a caller require the address book to not be available? Another solution in line with a recent mail of mine on openbsc@ would be to place the address book on its own, outside of the 'cs7-instance'. In that case this _init_addr() could be fully independent. -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 6 23:16:42 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 6 Jul 2017 23:16:42 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: sgsn: Fix numbering of QoS and add basic description for APN Message-ID: Review at https://gerrit.osmocom.org/3151 sgsn: Fix numbering of QoS and add basic description for APN QoS was supposed to be 13 as 12 has been used for the APN. Fix that and document the APN. Change-Id: Ib6113aa7c59841aada424e2cafd94ed88c7badc7 --- M OsmoSGSN/chapters/gsup.adoc 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/51/3151/1 diff --git a/OsmoSGSN/chapters/gsup.adoc b/OsmoSGSN/chapters/gsup.adoc index f496b84..9110f08 100644 --- a/OsmoSGSN/chapters/gsup.adoc +++ b/OsmoSGSN/chapters/gsup.adoc @@ -501,7 +501,7 @@ | |Length of PDP Info IE||M|V|1 |10|PDP Context ID|<>|C|TLV|3 |11|PDP Type|<>|C|TLV|4 -|12|Access Point Name|3GPP TS 04.08, Ch. 10.5.6.1|C|TLV|3-102 +|12|Access Point Name|<>|C|TLV|3-102 |13|Quality of Service|<>|O|TLV|1-20 |=== @@ -690,7 +690,8 @@ |0x09|HLR Number|<> |0x10|PDP Context ID|<> |0x11|PDP Type|<> -|0x12|QoS|<> +|0x12|Access Point Name|<> +|0x13|QoS|<> |0x20|RAND|<> |0x21|SRES|<> |0x22|Kc|<> @@ -772,6 +773,12 @@ } ---- +[[gsup-ie-apn]] +==== Access Point Name + +This encodes the Access Point Name of a PDP Context. The encoding +is defined in 3GPP TS 23.003. + [[gsup-ie-qos]] ==== Quality of Service Subscribed Service -- To view, visit https://gerrit.osmocom.org/3151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6113aa7c59841aada424e2cafd94ed88c7badc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Thu Jul 6 23:16:42 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 6 Jul 2017 23:16:42 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: sgsn: Add charging characteristics to GSUP Message-ID: Review at https://gerrit.osmocom.org/3152 sgsn: Add charging characteristics to GSUP Reserve a new IE for the charging characteristics. We need to handle them as a GGSN might otherwise reject the PDP context creation. For the SGSN it is enough to send the two octets as it. Pick the 0x1X range for the IEs as it is used with the PDP contexts. Change-Id: I1d7423582e154728a240cf15c32772a06822f4ad --- M OsmoSGSN/chapters/gsup.adoc 1 file changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/52/3152/1 diff --git a/OsmoSGSN/chapters/gsup.adoc b/OsmoSGSN/chapters/gsup.adoc index 9110f08..733b60e 100644 --- a/OsmoSGSN/chapters/gsup.adoc +++ b/OsmoSGSN/chapters/gsup.adoc @@ -390,6 +390,7 @@ |09|HLR Number|<>|O|TLV|0-9 |04|PDP info complete|<>|M|TLV|2 |05|PDP info|<>|0-10|TLV| +|14|PDP-Charging Characteristics|<>|O|TLV|4 |=== If the PDP info complete IE is present, the old PDP info list shall be cleared. @@ -503,6 +504,7 @@ |11|PDP Type|<>|C|TLV|4 |12|Access Point Name|<>|C|TLV|3-102 |13|Quality of Service|<>|O|TLV|1-20 +|14|PDP-Charging Characteristics|<>|O|TLV|4 |=== The conditional IE are mandantory unless mentioned otherwise. @@ -692,6 +694,7 @@ |0x11|PDP Type|<> |0x12|Access Point Name|<> |0x13|QoS|<> +|0x14|PDP-Charging Characteristics|<> |0x20|RAND|<> |0x21|SRES|<> |0x22|Kc|<> @@ -802,6 +805,27 @@ } ---- + +[[gsup-ie-charging]] +==== PDP-Charging Characteristics + +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. + +[packetdiag] +---- +{ + colwidth = 8 + node_height = 24 + + 0-3: Profile Index + 4-15: Behavior +} +---- + + [[gsup-ie-hlr]] ==== HLR Number encoded as 3GPP TS 09.02 ISDN-AddressString -- To view, visit https://gerrit.osmocom.org/3152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d7423582e154728a240cf15c32772a06822f4ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Fri Jul 7 08:22:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 7 Jul 2017 08:22:10 +0000 Subject: osmo-trx[master]: deb: remove unused dependency In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/3079/2/debian/control File debian/control: Line 8 > yes Could you elaborate? It's much easier to follow up on feedback which consists of entire sentences. Line 22: Depends: ${shlibs:Depends}, ${misc:Depends}, libsqlite3-0 > That is wrong. ${shlibs:Depends} will add dependencies for all libraries li You mean we can simply drop libsqlite3-0 in here? -- To view, visit https://gerrit.osmocom.org/3079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jul 7 08:34:05 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 7 Jul 2017 08:34:05 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: make addressbook available for _sg and _asp 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/3103 to look at the new patch set (#4). vty: make addressbook available for _sg and _asp The installation of the vty commands for the sccp addressbook is currently located in osmo_ss7_vty_init_sg(), which is normally only used in signalling gateway applications. An ASP would lack the addressbook functionality. Make SCCP addressbook available for bos SG and ASP Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb --- M src/osmo_ss7_vty.c 1 file changed, 37 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/3103/4 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b06f554..9a4e963 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1587,6 +1587,41 @@ } } +/* Commands for SCCP-Addressbook */ +static void vty_init_addr(void) +{ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); +} + static void vty_init_shared(void) { install_element_ve(&show_cs7_user_cmd); @@ -1628,6 +1663,8 @@ install_element(L_CS7_AS_NODE, &as_qos_class_cmd); install_element(L_CS7_AS_NODE, &as_rout_key_cmd); install_element(L_CS7_AS_NODE, &as_pc_override_cmd); + + vty_init_addr(); } void osmo_ss7_vty_init_asp(void) @@ -1653,38 +1690,6 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); - - /* Commands for SCCP-Addressbook */ - install_node(&sccpaddr_node, NULL); - vty_install_default(L_CS7_SCCPADDR_NODE); - install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); - install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); - install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); -#if 0 - /* FIXME: IP-Address based SCCP-Routing is currently not supported, - * so we leave the related VTY options out for now */ - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); -#endif - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); -#if 0 - /* FIXME: IP-Address based SCCP-Routing is currently not supported, - * so we leave the related VTY options out for now */ - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); -#endif - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); - install_node(&sccpaddr_gt_node, NULL); - vty_install_default(L_CS7_SCCPADDR_GT_NODE); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jul 7 09:41:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 7 Jul 2017 09:41:17 +0000 Subject: [PATCH] osmo-pcu[master]: Move DL scheduling and RTS handler to trx level In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3150 to look at the new patch set (#2). Move DL scheduling and RTS handler to trx level Use TRX object directly instead of BTS singleton and trx_no. This is necessary to facilitate the move of UL/DL TBF lists to TRX level. Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Related: OS#1541 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_sched.cpp M src/pcu_l1_if.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp 8 files changed, 55 insertions(+), 65 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/50/3150/2 diff --git a/src/bts.cpp b/src/bts.cpp index 1d27284..e66699f 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1425,8 +1425,7 @@ egprs_ms_class, tlli, ta, ms); if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); + handle_tbf_reject(get_trx(), ms, tlli, ts_no); return; } diff --git a/src/bts.h b/src/bts.h index 78ed002..7983fa2 100644 --- a/src/bts.h +++ b/src/bts.h @@ -76,7 +76,7 @@ gprs_rlcmac_bts *bts_data() const; BTS *bts() const; uint8_t trx_no() const; - + gprs_rlcmac_trx *get_trx(); struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); @@ -671,6 +671,11 @@ return trx->bts->bts_data(); } +inline gprs_rlcmac_trx *gprs_rlcmac_pdch::get_trx() +{ + return trx; +} + inline uint8_t gprs_rlcmac_pdch::trx_no() const { return trx->trx_no; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..3d825a8 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -89,9 +89,7 @@ int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len, const char *imsi); -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr); +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr); int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class = 0); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a21c023..a8392cb 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,12 +25,10 @@ #include "pcu_utils.h" -static uint32_t sched_poll(BTS *bts, - uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, - struct gprs_rlcmac_tbf **poll_tbf, - struct gprs_rlcmac_tbf **ul_ass_tbf, - struct gprs_rlcmac_tbf **dl_ass_tbf, - struct gprs_rlcmac_ul_tbf **ul_ack_tbf) +static uint32_t sched_poll(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_tbf **poll_tbf, + struct gprs_rlcmac_tbf **ul_ass_tbf, struct gprs_rlcmac_tbf **dl_ass_tbf, + struct gprs_rlcmac_ul_tbf **ul_ack_tbf) { struct gprs_rlcmac_ul_tbf *ul_tbf; struct gprs_rlcmac_dl_tbf *dl_tbf; @@ -42,11 +40,11 @@ if ((block_nr % 3) == 2) poll_fn ++; poll_fn = poll_fn % GSM_MAX_FN; - llist_for_each(pos, &bts->ul_tbfs()) { + llist_for_each(pos, &trx->bts->ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); OSMO_ASSERT(ul_tbf); /* this trx, this ts */ - if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) + if (ul_tbf->trx->trx_no != trx->trx_no || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -62,11 +60,11 @@ *ul_ass_tbf = ul_tbf; #warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" } - llist_for_each(pos, &bts->dl_tbfs()) { + llist_for_each(pos, &trx->bts->dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); OSMO_ASSERT(dl_tbf); /* this trx, this ts */ - if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) + if (dl_tbf->trx->trx_no != trx->trx_no || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -206,9 +204,8 @@ return NULL; } -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) +static struct msgb *sched_select_downlink(struct gprs_rlcmac_trx *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; @@ -225,7 +222,7 @@ 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); + OSMO_MIN(BTS::TIMER_T3190_MSEC/2, trx->bts->bts_data()->dl_tbf_idle_msec); const int age_thresh2 = msecs_to_frames(high_prio_msecs); /* select downlink resource */ @@ -277,7 +274,7 @@ if (prio_tbf) { LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling data message at " "RTS for DL TFI=%d (TRX=%d, TS=%d) prio=%d\n", - prio_tfi, trx, ts, max_prio); + prio_tfi, trx->trx_no, ts, max_prio); /* next TBF to handle resource is the next one */ pdch->next_dl_tfi = (prio_tfi + 1) & 31; /* generate DL data block */ @@ -307,9 +304,7 @@ return msg; } -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr) +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr) { struct gprs_rlcmac_pdch *pdch; struct gprs_rlcmac_tbf *poll_tbf = NULL, *dl_ass_tbf = NULL, @@ -319,51 +314,49 @@ struct msgb *msg = NULL; uint32_t poll_fn, sba_fn; - if (trx >= 8 || ts >= 8) + if (trx->trx_no >= 8 || ts >= 8) return -EINVAL; - pdch = &bts->trx[trx].pdch[ts]; + pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { LOGP(DRLCMACSCHED, LOGL_ERROR, "Received RTS on disabled PDCH: " - "TRX=%d TS=%d\n", trx, ts); + "TRX=%d TS=%d\n", trx->trx_no, ts); return -EIO; } /* store last frame number of RTS */ pdch->last_rts_fn = fn; - poll_fn = sched_poll(bts->bts, trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, - &dl_ass_tbf, &ul_ack_tbf); + poll_fn = sched_poll(trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, &dl_ass_tbf, &ul_ack_tbf); /* check uplink resource for polling */ if (poll_tbf) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "polling at FN=%d of %s\n", trx, ts, fn, + "polling at FN=%d of %s\n", trx->trx_no, ts, fn, block_nr, poll_fn, tbf_name(poll_tbf)); /* use free USF */ /* else. check for sba */ - else if ((sba_fn = bts->bts->sba()->sched(trx, ts, fn, block_nr) != 0xffffffff)) + else if ((sba_fn = trx->bts->sba()->sched(trx->trx_no, ts, fn, block_nr) != 0xffffffff)) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "single block allocation at FN=%d\n", trx, ts, fn, + "single block allocation at FN=%d\n", trx->trx_no, ts, fn, block_nr, sba_fn); /* use free USF */ /* else, we search for uplink resource */ else - usf = sched_select_uplink(trx, ts, fn, block_nr, pdch); + usf = sched_select_uplink(trx->trx_no, ts, fn, block_nr, pdch); /* Prio 1: select control message */ - msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, - dl_ass_tbf, ul_ack_tbf); + msg = sched_select_ctrl_msg(trx->trx_no, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); if (msg) - bts->bts->rlc_sent_control(); + trx->bts->rlc_sent_control(); /* Prio 2: select data message for downlink */ if (!msg) { - msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); + msg = sched_select_downlink(trx, ts, fn, block_nr, pdch); if (msg) - bts->bts->rlc_sent(); + trx->bts->rlc_sent(); } /* Prio 3: send dummy contol message */ @@ -371,13 +364,13 @@ /* increase counter */ msg = sched_dummy(); if (msg) - bts->bts->rlc_sent_dummy(); + trx->bts->rlc_sent_dummy(); } if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + trx->bts->rlc_dl_bytes(msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); @@ -387,7 +380,7 @@ gprs_bssgp_update_frames_sent(); /* send PDTCH/PACCH to L1 */ - pcu_l1if_tx_pdtch(msg, trx, ts, bts->trx[trx].arfcn, fn, block_nr); + pcu_l1if_tx_pdtch(msg, trx->trx_no, ts, trx->arfcn, fn, block_nr); return 0; } diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index c2c6cc6..c3b4a49 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -308,11 +308,13 @@ } // FIXME: remove this, when changed from c++ to c. -extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx, uint8_t ts, +extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx_no, uint8_t ts, uint32_t fn, uint8_t block_nr) { - return gprs_rlcmac_rcv_rts_block(bts_main_data(), - trx, ts, fn, block_nr); + struct gprs_rlcmac_bts *bts = bts_main_data(); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + return gprs_rlcmac_rcv_rts_block(trx, ts, fn, block_nr); } static int pcu_rx_rts_req(struct gsm_pcu_if_rts_req *rts_req) diff --git a/src/tbf.cpp b/src/tbf.cpp index 48e8289..2e7c65b 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1407,24 +1407,22 @@ return ts == control_ts; } -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) +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts) { struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); if (!ul_tbf) return ul_tbf; talloc_set_destructor(ul_tbf, ul_tbf_dtor); - new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); + new (ul_tbf) gprs_rlcmac_ul_tbf(trx->bts); if (!ms) - ms = bts->bts->ms_alloc(0, 0); + ms = trx->bts->ms_alloc(0, 0); ms->set_tlli(tlli); - llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); + llist_add(&ul_tbf->list(), &trx->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); diff --git a/src/tbf.h b/src/tbf.h index 09e3122..ee9648a 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -317,8 +317,7 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf); -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_no); +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts_no); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..886856a 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -203,7 +203,8 @@ uint32_t *fn, uint8_t *block_nr = NULL) { uint8_t bn = fn2bn(*fn); - gprs_rlcmac_rcv_rts_block(bts, trx_no, ts_no, *fn, bn); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); *fn = fn_add_blocks(*fn, 1); bn += 1; if (block_nr) @@ -1651,9 +1652,8 @@ for (ts_no = 0 ; ts_no < 8; ts_no += 1) { if (!(slots & (1 << ts_no))) continue; - gprs_rlcmac_rcv_rts_block(the_bts->bts_data(), - dl_tbf->trx->trx_no, ts_no, - *fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts->bts_data()->trx[dl_tbf->trx->trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); } *fn = fn_add_blocks(*fn, 1); } @@ -3222,17 +3222,14 @@ setup_bts(&the_bts, ts_no, 4); int rc = 0; - - ul_tbf = handle_tbf_reject(the_bts.bts_data(), NULL, tlli, - trx_no, ts_no); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + ul_tbf = handle_tbf_reject(trx, NULL, tlli, ts_no); OSMO_ASSERT(ul_tbf != 0); /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); @@ -3307,9 +3304,8 @@ /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf 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 Jul 7 11:21:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 7 Jul 2017 11:21:23 +0000 Subject: [PATCH] osmo-pcu[master]: Ignore test binaries using mask Message-ID: Review at https://gerrit.osmocom.org/3153 Ignore test binaries using mask Change-Id: Ic7930c6e715447e91572f7ed6b0d2bb2238cf367 --- M .gitignore 1 file changed, 2 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/3153/1 diff --git a/.gitignore b/.gitignore index 234ef0b..58a7879 100644 --- a/.gitignore +++ b/.gitignore @@ -34,18 +34,10 @@ .dirstamp tests/atconfig tests/package.m4 -tests/alloc/AllocTest -tests/rlcmac/RLCMACTest -tests/tbf/TbfTest -tests/types/TypesTest -tests/ms/MsTest -tests/llist/LListTest -tests/codel/codel_test -tests/emu/pcu_emu +tests/*/*Test +tests/*/*_test tests/testsuite tests/testsuite.log -tests/edge/EdgeTest -tests/llc/LlcTest # ignore debian files .tarball-version -- To view, visit https://gerrit.osmocom.org/3153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7930c6e715447e91572f7ed6b0d2bb2238cf367 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jul 7 12:46:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 7 Jul 2017 12:46:32 +0000 Subject: [PATCH] osmo-pcu[master]: Remove TBF knowledge from rcv_control*dl_ack_nack Message-ID: Review at https://gerrit.osmocom.org/3154 Remove TBF knowledge from rcv_control*dl_ack_nack Do not access TBF internals directly from rcv_control*dl_ack_nack() - wrap corresponding code into TBF-DL method. Change-Id: I3d1b5782001e45617b4a960612fcfc249904b37c Related: OS#1539 --- M src/bts.cpp M src/tbf.h M src/tbf_dl.cpp 3 files changed, 34 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/54/3154/1 diff --git a/src/bts.cpp b/src/bts.cpp index e66699f..9847e9b 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1175,17 +1175,11 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink ack " - "for %s\n", tbf_name(tbf)); - } - /* reset N3105 */ - tbf->n3105 = 0; - tbf->stop_t3191(); + + if (tbf->handle_ack_nack()) + LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink ack for %s\n", tbf_name(tbf)); + LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] %s Packet Downlink Ack/Nack\n", tbf_name(tbf)); - tbf->poll_state = GPRS_RLCMAC_POLL_NONE; bits.data = bits_data; bits.data_len = sizeof(bits_data); @@ -1263,19 +1257,13 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered EGPRS downlink ack " - "for %s\n", tbf_name(tbf)); - } - /* reset N3105 */ - tbf->n3105 = 0; - tbf->stop_t3191(); + + if (tbf->handle_ack_nack()) + LOGP(DRLCMAC, LOGL_NOTICE, "Recovered EGPRS downlink ack for %s\n", tbf_name(tbf)); + LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] %s EGPRS Packet Downlink Ack/Nack\n", tbf_name(tbf)); - tbf->poll_state = GPRS_RLCMAC_POLL_NONE; LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " diff --git a/src/tbf.h b/src/tbf.h index ee9648a..64cfa91 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -423,6 +423,8 @@ 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); struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts); + void clear_poll_timeout_flag(); + bool handle_ack_nack(); void request_dl_ack(); bool need_control_ts() const; bool have_data() const; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 24c6385..a894789 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -609,6 +609,29 @@ 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(); + ack_recovered = true; + } + + /* reset N3105 */ + n3105 = 0; + stop_t3191(); + poll_state = GPRS_RLCMAC_POLL_NONE; + + return ack_recovered; +} + struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block( const uint32_t fn, const uint8_t ts, int index, int index2) @@ -807,8 +830,7 @@ if (is_final) tbf_timer_start(this, 3191, bts_data()->t3191, 0); - /* 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; -- To view, visit https://gerrit.osmocom.org/3154 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d1b5782001e45617b4a960612fcfc249904b37c Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jul 7 12:46:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 7 Jul 2017 12:46:32 +0000 Subject: [PATCH] osmo-pcu[master]: Encapsulate handling of UL ACK timeout Message-ID: Review at https://gerrit.osmocom.org/3155 Encapsulate handling of UL ACK timeout Use helper methods instead checking and manipulating flag directly. Change-Id: Ia3f009c52118db95b38a077e08eecda844e7f8d1 Related: OS#1539 --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_ul.cpp 4 files changed, 39 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/55/3155/1 diff --git a/src/bts.cpp b/src/bts.cpp index 9847e9b..799188b 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -978,6 +978,7 @@ 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) @@ -1004,16 +1005,12 @@ tbf->poll_state = GPRS_RLCMAC_POLL_NONE; /* check if this control ack belongs to packet uplink ack */ - if (tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { + ul_tbf = as_ul_tbf(tbf); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { LOGP(DRLCMAC, LOGL_DEBUG, "TBF: [UPLINK] END %s\n", tbf_name(tbf)); - tbf->ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; - if ((tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink " - "ack for UL %s\n", tbf_name(tbf)); - } + if (ul_tbf->ctrl_ack_to_toggle()) + LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink ack for UL %s\n", tbf_name(tbf)); + tbf_free(tbf); return; } diff --git a/src/tbf.cpp b/src/tbf.cpp index 2e7c65b..fa67e41 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -607,27 +607,25 @@ void gprs_rlcmac_tbf::poll_timeout() { + gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); + LOGP(DRLCMAC, LOGL_NOTICE, "%s poll timeout for FN=%d, TS=%d (curr FN %d)\n", tbf_name(this), poll_fn, poll_ts, bts->current_frame_number()); poll_state = GPRS_RLCMAC_POLL_NONE; - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " - "PACKET CONTROL ACK for PACKET UPLINK ACK\n"); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { + if (!ul_tbf->ctrl_ack_to_toggle()) { + LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); } - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); bts->pkt_ul_ack_nack_poll_timedout(); if (state_is(GPRS_RLCMAC_FINISHED)) { - gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, - "- N3103 exceeded\n"); + "- N3103 exceeded\n"); bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); @@ -640,10 +638,10 @@ } else if (ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) { if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS))) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " - "PACKET CONTROL ACK for PACKET UPLINK " - "ASSIGNMENT.\n"); - rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); + "PACKET CONTROL ACK for PACKET UPLINK " + "ASSIGNMENT.\n"); + rlcmac_diag(); + state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; diff --git a/src/tbf.h b/src/tbf.h index 64cfa91..dba6dbd 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -502,6 +502,8 @@ gprs_rlcmac_ul_tbf(BTS *bts); struct msgb *create_ul_ack(uint32_t fn, uint8_t ts); + bool ctrl_ack_to_toggle(); + bool handle_ctrl_ack(); /* blocks were acked */ int rcv_data_block_acknowledged( diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1eee41a..1e0898a 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -95,6 +95,27 @@ return 0; } +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); + 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 */ +} + +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; + return true; + } + + return false; +} struct msgb *gprs_rlcmac_ul_tbf::create_ul_ack(uint32_t fn, uint8_t ts) { -- To view, visit https://gerrit.osmocom.org/3155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3f009c52118db95b38a077e08eecda844e7f8d1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jul 7 13:36:28 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 7 Jul 2017 13:36:28 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) > Do you see my updated code or do I have to push a button somewhere? Nope. See https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for details. https://gerrit.osmocom.org/#/c/2817/1/src/conv_enc_test.c File src/conv_enc_test.c: PS1, Line 53: void dp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned int len, void *priv) : { : } > I have not figured out why yet, but without this function I get some error Just a hint: you can use grep to find, where this function is being called, and drop corresponding line(s). -- To view, visit https://gerrit.osmocom.org/2817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: allesklar2 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jul 7 15:12:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 7 Jul 2017 15:12:37 +0000 Subject: [PATCH] osmo-pcu[master]: Separate channel request responder into function Message-ID: Review at https://gerrit.osmocom.org/3156 Separate channel request responder into function Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 Related: OS#1539 --- M src/bts.cpp 1 file changed, 22 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/56/3156/1 diff --git a/src/bts.cpp b/src/bts.cpp index 799188b..6ed6674 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1147,6 +1147,24 @@ } } +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->ul_ass_state = 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; + } +} + 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 */ @@ -1201,27 +1219,9 @@ return; } /* check for channel request */ - if (ack_nack->Exist_Channel_Request_Description) { + if (ack_nack->Exist_Channel_Request_Description) + sched_ul_ass_or_rej(bts(), bts_data(), 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->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we pacekt access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; - } - } /* get measurements */ if (tbf->ms()) { get_meas(&meas, &ack_nack->Channel_Quality_Report); @@ -1306,27 +1306,8 @@ } /* check for channel request */ - if (ack_nack->Exist_ChannelRequestDescription) { - - 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->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we send packet access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; - } - } + if (ack_nack->Exist_ChannelRequestDescription) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); /* get measurements */ if (tbf->ms()) { -- To view, visit https://gerrit.osmocom.org/3156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jul 7 15:59:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 7 Jul 2017 15:59:38 +0000 Subject: [PATCH] osmo-pcu[master]: Move common code 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/3156 to look at the new patch set (#2). Move common code into functions * separate channel request responder into inline function * move generic TBF poll check into inline function Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 Related: OS#1539 --- M src/bts.cpp 1 file changed, 36 insertions(+), 57 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/56/3156/2 diff --git a/src/bts.cpp b/src/bts.cpp index 799188b..21d5b17 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -360,39 +360,37 @@ return 0; } +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 + && tbf->poll_fn == fn && tbf->trx->trx_no == trx_no && tbf->poll_ts == ts) + return true; + + return false; +} + gprs_rlcmac_dl_tbf *BTS::dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) { - struct gprs_rlcmac_dl_tbf *tbf; LListHead *pos; /* only one TBF can poll on specific TS/FN, because scheduler can only * schedule one downlink control block (with polling) at a FN per TS */ llist_for_each(pos, &m_dl_tbfs) { - tbf = as_dl_tbf(pos->entry()); - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) - && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && tbf->poll_fn == fn && tbf->trx->trx_no == trx - && tbf->poll_ts == ts) { - return tbf; - } + if (tbf_check(pos->entry(), fn, trx, ts)) + return as_dl_tbf(pos->entry()); } return NULL; } + gprs_rlcmac_ul_tbf *BTS::ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) { - struct gprs_rlcmac_ul_tbf *tbf; LListHead *pos; /* only one TBF can poll on specific TS/FN, because scheduler can only * schedule one downlink control block (with polling) at a FN per TS */ llist_for_each(pos, &m_ul_tbfs) { - tbf = as_ul_tbf(pos->entry()); - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) - && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && tbf->poll_fn == fn && tbf->trx->trx_no == trx - && tbf->poll_ts == ts) { - return tbf; - } + if (tbf_check(pos->entry(), fn, trx, ts)) + return as_ul_tbf(pos->entry()); } return NULL; } @@ -1147,6 +1145,24 @@ } } +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->ul_ass_state = 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; + } +} + 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 */ @@ -1201,27 +1217,9 @@ return; } /* check for channel request */ - if (ack_nack->Exist_Channel_Request_Description) { + if (ack_nack->Exist_Channel_Request_Description) + sched_ul_ass_or_rej(bts(), bts_data(), 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->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we pacekt access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; - } - } /* get measurements */ if (tbf->ms()) { get_meas(&meas, &ack_nack->Channel_Quality_Report); @@ -1306,27 +1304,8 @@ } /* check for channel request */ - if (ack_nack->Exist_ChannelRequestDescription) { - - 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->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we send packet access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; - } - } + if (ack_nack->Exist_ChannelRequestDescription) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); /* get measurements */ if (tbf->ms()) { -- To view, visit https://gerrit.osmocom.org/3156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 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 Jul 7 16:27:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 7 Jul 2017 16:27:51 +0000 Subject: [PATCH] osmo-pcu[master]: Move DL assignment to TBF-DL Message-ID: Review at https://gerrit.osmocom.org/3157 Move DL assignment to TBF-DL This function does not really belongs to BTS and it heavily relies on direct access to TBF-DL members anyway. Change-Id: I04584103018675a2f35cfb565473bfd81a208d7c Closes: OS#1540 --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp 5 files changed, 38 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/57/3157/1 diff --git a/src/bts.cpp b/src/bts.cpp index 21d5b17..5f7d9e8 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -768,40 +768,6 @@ return sb; } -/* depending on the current TBF, we assign on PACCH or AGCH */ -void BTS::trigger_dl_ass( - struct gprs_rlcmac_dl_tbf *dl_tbf, - struct gprs_rlcmac_tbf *old_tbf) -{ - /* stop pending timer */ - dl_tbf->stop_timer(); - - /* check for downlink tbf: */ - if (old_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "Send dowlink assignment on " - "PACCH, because %s exists\n", tbf_name(old_tbf)); - old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; - - old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); - - /* change state */ - dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - if (!(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); - /* start timer */ - tbf_timer_start(dl_tbf, 0, Tassign_pacch); - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "Send dowlink assignment for %s on PCH, no TBF exist (IMSI=%s)\n", tbf_name(dl_tbf), dl_tbf->imsi()); - dl_tbf->was_releasing = dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); - /* change state */ - dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); - /* send immediate assignment */ - dl_tbf->bts->snd_dl_ass(dl_tbf, 0, dl_tbf->imsi()); - dl_tbf->m_wait_confirm = 1; - } -} - void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi) { int plen; diff --git a/src/bts.h b/src/bts.h index 7983fa2..f742def 100644 --- a/src/bts.h +++ b/src/bts.h @@ -354,7 +354,6 @@ int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, enum ph_burst_type burst_type); - void trigger_dl_ass(gprs_rlcmac_dl_tbf *tbf, gprs_rlcmac_tbf *old_tbf); void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi); GprsMsStorage &ms_store(); @@ -478,7 +477,6 @@ /* list of downlink TBFs */ LListHead m_dl_tbfs; -private: /* disable copying to avoid slicing */ BTS(const BTS&); BTS& operator=(const BTS&); diff --git a/src/tbf.cpp b/src/tbf.cpp index fa67e41..b2acb11 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -992,7 +992,7 @@ dl_tbf->update(); - dl_tbf->bts->trigger_dl_ass(dl_tbf, dl_tbf); + dl_tbf->trigger_ass(dl_tbf); } else LOGP(DRLCMAC, LOGL_NOTICE, "%s Continue flow after " "IMM.ASS confirm\n", tbf_name(dl_tbf)); @@ -1280,7 +1280,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "%s Trigger downlink assignment on PACCH\n", tbf_name(this)); - bts->trigger_dl_ass(new_tbf, this); + new_tbf->trigger_ass(this); return 0; } diff --git a/src/tbf.h b/src/tbf.h index dba6dbd..cd8d694 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -423,6 +423,7 @@ 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); 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(); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index a894789..375d642 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -167,7 +167,7 @@ * we don't use old_downlink, so the possible uplink is used * to trigger downlink assignment. if there is no uplink, * AGCH is used. */ - dl_tbf->bts->trigger_dl_ass(dl_tbf, old_ul_tbf); + dl_tbf->trigger_ass(old_ul_tbf); *tbf = dl_tbf; return 0; } @@ -486,6 +486,40 @@ return create_dl_acked_block(fn, ts, bsn, bsn2); } +/* depending on the current TBF, we assign on PACCH or AGCH */ +void gprs_rlcmac_dl_tbf::trigger_ass(struct gprs_rlcmac_tbf *old_tbf) +{ + /* stop pending timer */ + stop_timer(); + + /* check for downlink tbf: */ + if (old_tbf) { + LOGP(DRLCMACDL, LOGL_DEBUG, "Send dowlink assignment on PACCH, because %s exists\n", tbf_name(old_tbf)); + old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + 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); + + /* start timer */ + tbf_timer_start(this, 0, Tassign_pacch); + } else { + LOGP(DRLCMACDL, LOGL_DEBUG, "Send dowlink assignment for %s on PCH, no TBF exist (IMSI=%s)\n", + tbf_name(this), imsi()); + was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); + + /* change state */ + set_state(GPRS_RLCMAC_ASSIGN); + state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + + /* send immediate assignment */ + bts->snd_dl_ass(this, 0, imsi()); + m_wait_confirm = 1; + } +} + void gprs_rlcmac_dl_tbf::schedule_next_frame() { struct msgb *msg; -- To view, visit https://gerrit.osmocom.org/3157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04584103018675a2f35cfb565473bfd81a208d7c Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jul 7 17:04:56 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 7 Jul 2017 17:04:56 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support In-Reply-To: References: Message-ID: Patch Set 1: > you can use grep to find git grep -n func-name is better because it looks only into version-controlled files :) -- To view, visit https://gerrit.osmocom.org/2817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: allesklar2 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 7 18:49:01 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 7 Jul 2017 18:49:01 +0000 Subject: [PATCH] libosmocore[master]: gsup: Add encoding/decoding for the pdp charging characteris... Message-ID: Review at https://gerrit.osmocom.org/3158 gsup: Add encoding/decoding for the pdp charging characteristics These fields can be in the ISD and the PDP Context inofmration. Store pointers to this IE in both cases. It needs to be used by the SGSN when opening a PDP context. Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c 2 files changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/3158/1 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 886ea5d..890bff3 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -51,6 +51,7 @@ OSMO_GSUP_PDP_TYPE_IE = 0x11, OSMO_GSUP_ACCESS_POINT_NAME_IE = 0x12, OSMO_GSUP_PDP_QOS_IE = 0x13, + OSMO_GSUP_CHARG_CHAR_IE = 0x14, OSMO_GSUP_RAND_IE = 0x20, OSMO_GSUP_SRES_IE = 0x21, OSMO_GSUP_KC_IE = 0x22, @@ -127,6 +128,11 @@ const uint8_t *qos_enc; /*! length (in octets) of qos_enc */ size_t qos_enc_len; + /*! PDP Charging Characteristics, still in encoded form. Can be NULL if no + * PDP Charging Characteristics */ + const uint8_t *pdp_charg_enc; + /*! length (in octets) of pdp_charg_enc */ + size_t pdp_charg_enc_len; }; /*! parsed/decoded GSUP protocol message */ @@ -148,6 +154,8 @@ const uint8_t *auts; const uint8_t *rand; enum osmo_gsup_cn_domain cn_domain; + const uint8_t *pdp_charg_enc; + size_t pdp_charg_enc_len; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 2629eb7..e34b2ec 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -103,6 +103,11 @@ pdp_info->qos_enc_len = value_len; break; + case OSMO_GSUP_CHARG_CHAR_IE: + pdp_info->pdp_charg_enc = value; + pdp_info->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_ERROR, "GSUP IE type %d not expected in PDP info\n", iei); @@ -375,6 +380,11 @@ gsup_msg->cn_domain = *value; break; + case OSMO_GSUP_CHARG_CHAR_IE: + gsup_msg->pdp_charg_enc = value; + gsup_msg->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_NOTICE, "GSUP IE type %d unknown\n", iei); -- To view, visit https://gerrit.osmocom.org/3158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Fri Jul 7 18:51:22 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 7 Jul 2017 18:51:22 +0000 Subject: [PATCH] libosmocore[master]: gsup: Add encoding/decoding for the pdp charging characteris... In-Reply-To: References: Message-ID: gsup: Add encoding/decoding for the pdp charging characteristics These fields can be in the ISD and the PDP Context inofmration. Store pointers to this IE in both cases. It needs to be used by the SGSN when opening a PDP context. Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M tests/gsup/gsup_test.c 3 files changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/3158/2 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 886ea5d..890bff3 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -51,6 +51,7 @@ OSMO_GSUP_PDP_TYPE_IE = 0x11, OSMO_GSUP_ACCESS_POINT_NAME_IE = 0x12, OSMO_GSUP_PDP_QOS_IE = 0x13, + OSMO_GSUP_CHARG_CHAR_IE = 0x14, OSMO_GSUP_RAND_IE = 0x20, OSMO_GSUP_SRES_IE = 0x21, OSMO_GSUP_KC_IE = 0x22, @@ -127,6 +128,11 @@ const uint8_t *qos_enc; /*! length (in octets) of qos_enc */ size_t qos_enc_len; + /*! PDP Charging Characteristics, still in encoded form. Can be NULL if no + * PDP Charging Characteristics */ + const uint8_t *pdp_charg_enc; + /*! length (in octets) of pdp_charg_enc */ + size_t pdp_charg_enc_len; }; /*! parsed/decoded GSUP protocol message */ @@ -148,6 +154,8 @@ const uint8_t *auts; const uint8_t *rand; enum osmo_gsup_cn_domain cn_domain; + const uint8_t *pdp_charg_enc; + size_t pdp_charg_enc_len; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 2629eb7..e34b2ec 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -103,6 +103,11 @@ pdp_info->qos_enc_len = value_len; break; + case OSMO_GSUP_CHARG_CHAR_IE: + pdp_info->pdp_charg_enc = value; + pdp_info->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_ERROR, "GSUP IE type %d not expected in PDP info\n", iei); @@ -375,6 +380,11 @@ gsup_msg->cn_domain = *value; break; + case OSMO_GSUP_CHARG_CHAR_IE: + gsup_msg->pdp_charg_enc = value; + gsup_msg->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_NOTICE, "GSUP IE type %d unknown\n", iei); diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index a950ca3..3b360ac 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -69,15 +69,18 @@ 0x09, 0x07, /* HLR-Number of the subscriber */ 0x91, 0x83, 0x52, 0x38, 0x48, 0x83, 0x93, 0x04, 0x00, /* PDP info complete */ - 0x05, 0x15, + 0x05, 0x19, 0x10, 0x01, 0x01, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x09, 0x04, 't', 'e', 's', 't', 0x03, 'a', 'p', 'n', 0x13, 0x01, 0x02, + 0x14, 0x02, 0xFF, 0x23, 0x05, 0x11, 0x10, 0x01, 0x02, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x08, 0x03, 'f', 'o', 'o', 0x03, 'a', 'p', 'n', + 0x14, 0x02, + 0xAE, 0xFF }; static const uint8_t location_cancellation_req[] = { -- To view, visit https://gerrit.osmocom.org/3158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 7 18:54:09 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 7 Jul 2017 18:54:09 +0000 Subject: osmo-trx[master]: deb: remove unused dependency In-Reply-To: References: Message-ID: Patch Set 2: > (2 comments) The "yes" means. This part of the patch is good. And the second part is that debian will extract the library dependencies from binaries and then will look-up which installed package provides them and will then add them to the depends. This is done with the macro/command/variable I have cited. One example in OpenBSC.. We don't need to manually depend on libdbi.so.X as we link to it.. but as we need the libdbd sqlite3 plugin we will need to manually add it (no direct linking) -- To view, visit https://gerrit.osmocom.org/3079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 7 19:13:10 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 7 Jul 2017 19:13:10 +0000 Subject: [PATCH] libosmocore[master]: gsup: Add encoding/decoding for the pdp charging characteris... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3158 to look at the new patch set (#3). gsup: Add encoding/decoding for the pdp charging characteristics These fields can be in the ISD and the PDP Context inofmration. Store pointers to this IE in both cases. It needs to be used by the SGSN when opening a PDP context. Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M tests/gsup/gsup_test.c 3 files changed, 32 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/3158/3 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 886ea5d..890bff3 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -51,6 +51,7 @@ OSMO_GSUP_PDP_TYPE_IE = 0x11, OSMO_GSUP_ACCESS_POINT_NAME_IE = 0x12, OSMO_GSUP_PDP_QOS_IE = 0x13, + OSMO_GSUP_CHARG_CHAR_IE = 0x14, OSMO_GSUP_RAND_IE = 0x20, OSMO_GSUP_SRES_IE = 0x21, OSMO_GSUP_KC_IE = 0x22, @@ -127,6 +128,11 @@ const uint8_t *qos_enc; /*! length (in octets) of qos_enc */ size_t qos_enc_len; + /*! PDP Charging Characteristics, still in encoded form. Can be NULL if no + * PDP Charging Characteristics */ + const uint8_t *pdp_charg_enc; + /*! length (in octets) of pdp_charg_enc */ + size_t pdp_charg_enc_len; }; /*! parsed/decoded GSUP protocol message */ @@ -148,6 +154,8 @@ const uint8_t *auts; const uint8_t *rand; enum osmo_gsup_cn_domain cn_domain; + const uint8_t *pdp_charg_enc; + size_t pdp_charg_enc_len; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 2629eb7..f06e5c8 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -103,6 +103,11 @@ pdp_info->qos_enc_len = value_len; break; + case OSMO_GSUP_CHARG_CHAR_IE: + pdp_info->pdp_charg_enc = value; + pdp_info->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_ERROR, "GSUP IE type %d not expected in PDP info\n", iei); @@ -375,6 +380,11 @@ gsup_msg->cn_domain = *value; break; + case OSMO_GSUP_CHARG_CHAR_IE: + gsup_msg->pdp_charg_enc = value; + gsup_msg->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_NOTICE, "GSUP IE type %d unknown\n", iei); @@ -413,6 +423,11 @@ if (pdp_info->qos_enc) { msgb_tlv_put(msg, OSMO_GSUP_PDP_QOS_IE, pdp_info->qos_enc_len, pdp_info->qos_enc); + } + + if (pdp_info->pdp_charg_enc) { + msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE, + pdp_info->pdp_charg_enc, pdp_info->pdp_charg_enc_len); } /* Update length field */ @@ -540,6 +555,11 @@ uint8_t dn = gsup_msg->cn_domain; msgb_tlv_put(msg, OSMO_GSUP_CN_DOMAIN_IE, 1, &dn); } + + if (gsup_msg->pdp_charg_enc) { + msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE, + gsup_msg->pdp_charg_enc, gsup_msg->pdp_charg_enc_len); + } } /*! @} */ diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index a950ca3..3b360ac 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -69,15 +69,18 @@ 0x09, 0x07, /* HLR-Number of the subscriber */ 0x91, 0x83, 0x52, 0x38, 0x48, 0x83, 0x93, 0x04, 0x00, /* PDP info complete */ - 0x05, 0x15, + 0x05, 0x19, 0x10, 0x01, 0x01, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x09, 0x04, 't', 'e', 's', 't', 0x03, 'a', 'p', 'n', 0x13, 0x01, 0x02, + 0x14, 0x02, 0xFF, 0x23, 0x05, 0x11, 0x10, 0x01, 0x02, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x08, 0x03, 'f', 'o', 'o', 0x03, 'a', 'p', 'n', + 0x14, 0x02, + 0xAE, 0xFF }; static const uint8_t location_cancellation_req[] = { -- To view, visit https://gerrit.osmocom.org/3158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 7 19:20:56 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 7 Jul 2017 19:20:56 +0000 Subject: [PATCH] libosmocore[master]: gsup: Add encoding/decoding for the pdp charging characteris... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3158 to look at the new patch set (#4). gsup: Add encoding/decoding for the pdp charging characteristics These fields can be in the ISD and the PDP Context inofmration. Store pointers to this IE in both cases. It needs to be used by the SGSN when opening a PDP context. Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M tests/gsup/gsup_test.c 3 files changed, 32 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/3158/4 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 886ea5d..890bff3 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -51,6 +51,7 @@ OSMO_GSUP_PDP_TYPE_IE = 0x11, OSMO_GSUP_ACCESS_POINT_NAME_IE = 0x12, OSMO_GSUP_PDP_QOS_IE = 0x13, + OSMO_GSUP_CHARG_CHAR_IE = 0x14, OSMO_GSUP_RAND_IE = 0x20, OSMO_GSUP_SRES_IE = 0x21, OSMO_GSUP_KC_IE = 0x22, @@ -127,6 +128,11 @@ const uint8_t *qos_enc; /*! length (in octets) of qos_enc */ size_t qos_enc_len; + /*! PDP Charging Characteristics, still in encoded form. Can be NULL if no + * PDP Charging Characteristics */ + const uint8_t *pdp_charg_enc; + /*! length (in octets) of pdp_charg_enc */ + size_t pdp_charg_enc_len; }; /*! parsed/decoded GSUP protocol message */ @@ -148,6 +154,8 @@ const uint8_t *auts; const uint8_t *rand; enum osmo_gsup_cn_domain cn_domain; + const uint8_t *pdp_charg_enc; + size_t pdp_charg_enc_len; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 2629eb7..685c91f 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -103,6 +103,11 @@ pdp_info->qos_enc_len = value_len; break; + case OSMO_GSUP_CHARG_CHAR_IE: + pdp_info->pdp_charg_enc = value; + pdp_info->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_ERROR, "GSUP IE type %d not expected in PDP info\n", iei); @@ -375,6 +380,11 @@ gsup_msg->cn_domain = *value; break; + case OSMO_GSUP_CHARG_CHAR_IE: + gsup_msg->pdp_charg_enc = value; + gsup_msg->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_NOTICE, "GSUP IE type %d unknown\n", iei); @@ -413,6 +423,11 @@ if (pdp_info->qos_enc) { msgb_tlv_put(msg, OSMO_GSUP_PDP_QOS_IE, pdp_info->qos_enc_len, pdp_info->qos_enc); + } + + if (pdp_info->pdp_charg_enc) { + msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE, + pdp_info->pdp_charg_enc_len, pdp_info->pdp_charg_enc); } /* Update length field */ @@ -540,6 +555,11 @@ uint8_t dn = gsup_msg->cn_domain; msgb_tlv_put(msg, OSMO_GSUP_CN_DOMAIN_IE, 1, &dn); } + + if (gsup_msg->pdp_charg_enc) { + msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE, + gsup_msg->pdp_charg_enc_len, gsup_msg->pdp_charg_enc); + } } /*! @} */ diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index a950ca3..3b360ac 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -69,15 +69,18 @@ 0x09, 0x07, /* HLR-Number of the subscriber */ 0x91, 0x83, 0x52, 0x38, 0x48, 0x83, 0x93, 0x04, 0x00, /* PDP info complete */ - 0x05, 0x15, + 0x05, 0x19, 0x10, 0x01, 0x01, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x09, 0x04, 't', 'e', 's', 't', 0x03, 'a', 'p', 'n', 0x13, 0x01, 0x02, + 0x14, 0x02, 0xFF, 0x23, 0x05, 0x11, 0x10, 0x01, 0x02, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x08, 0x03, 'f', 'o', 'o', 0x03, 'a', 'p', 'n', + 0x14, 0x02, + 0xAE, 0xFF }; static const uint8_t location_cancellation_req[] = { -- To view, visit https://gerrit.osmocom.org/3158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 7 19:54:48 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 7 Jul 2017 19:54:48 +0000 Subject: [PATCH] libosmocore[master]: gsup: Add encoding/decoding for the pdp charging characteris... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3158 to look at the new patch set (#5). gsup: Add encoding/decoding for the pdp charging characteristics These fields can be in the ISD and the PDP Context inofmration. Store pointers to this IE in both cases. It needs to be used by the SGSN when opening a PDP context. Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M tests/gsup/gsup_test.c M tests/gsup/gsup_test.err 4 files changed, 36 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/3158/5 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 886ea5d..890bff3 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -51,6 +51,7 @@ OSMO_GSUP_PDP_TYPE_IE = 0x11, OSMO_GSUP_ACCESS_POINT_NAME_IE = 0x12, OSMO_GSUP_PDP_QOS_IE = 0x13, + OSMO_GSUP_CHARG_CHAR_IE = 0x14, OSMO_GSUP_RAND_IE = 0x20, OSMO_GSUP_SRES_IE = 0x21, OSMO_GSUP_KC_IE = 0x22, @@ -127,6 +128,11 @@ const uint8_t *qos_enc; /*! length (in octets) of qos_enc */ size_t qos_enc_len; + /*! PDP Charging Characteristics, still in encoded form. Can be NULL if no + * PDP Charging Characteristics */ + const uint8_t *pdp_charg_enc; + /*! length (in octets) of pdp_charg_enc */ + size_t pdp_charg_enc_len; }; /*! parsed/decoded GSUP protocol message */ @@ -148,6 +154,8 @@ const uint8_t *auts; const uint8_t *rand; enum osmo_gsup_cn_domain cn_domain; + const uint8_t *pdp_charg_enc; + size_t pdp_charg_enc_len; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 2629eb7..685c91f 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -103,6 +103,11 @@ pdp_info->qos_enc_len = value_len; break; + case OSMO_GSUP_CHARG_CHAR_IE: + pdp_info->pdp_charg_enc = value; + pdp_info->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_ERROR, "GSUP IE type %d not expected in PDP info\n", iei); @@ -375,6 +380,11 @@ gsup_msg->cn_domain = *value; break; + case OSMO_GSUP_CHARG_CHAR_IE: + gsup_msg->pdp_charg_enc = value; + gsup_msg->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_NOTICE, "GSUP IE type %d unknown\n", iei); @@ -413,6 +423,11 @@ if (pdp_info->qos_enc) { msgb_tlv_put(msg, OSMO_GSUP_PDP_QOS_IE, pdp_info->qos_enc_len, pdp_info->qos_enc); + } + + if (pdp_info->pdp_charg_enc) { + msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE, + pdp_info->pdp_charg_enc_len, pdp_info->pdp_charg_enc); } /* Update length field */ @@ -540,6 +555,11 @@ uint8_t dn = gsup_msg->cn_domain; msgb_tlv_put(msg, OSMO_GSUP_CN_DOMAIN_IE, 1, &dn); } + + if (gsup_msg->pdp_charg_enc) { + msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE, + gsup_msg->pdp_charg_enc_len, gsup_msg->pdp_charg_enc); + } } /*! @} */ diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index a950ca3..3b360ac 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -69,15 +69,18 @@ 0x09, 0x07, /* HLR-Number of the subscriber */ 0x91, 0x83, 0x52, 0x38, 0x48, 0x83, 0x93, 0x04, 0x00, /* PDP info complete */ - 0x05, 0x15, + 0x05, 0x19, 0x10, 0x01, 0x01, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x09, 0x04, 't', 'e', 's', 't', 0x03, 'a', 'p', 'n', 0x13, 0x01, 0x02, + 0x14, 0x02, 0xFF, 0x23, 0x05, 0x11, 0x10, 0x01, 0x02, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x08, 0x03, 'f', 'o', 'o', 0x03, 'a', 'p', 'n', + 0x14, 0x02, + 0xAE, 0xFF }; static const uint8_t location_cancellation_req[] = { diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err index 6cd8627..05c64fe 100644 --- a/tests/gsup/gsup_test.err +++ b/tests/gsup/gsup_test.err @@ -13,8 +13,8 @@ generated message: 05 01 08 21 43 65 87 09 21 43 f5 02 01 07 original message: 05 01 08 21 43 65 87 09 21 43 f5 02 01 07 IMSI: 123456789012345 - generated message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 15 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e - original message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 15 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e + generated message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 19 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 14 02 ff 23 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e 14 02 ae ff + original message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 19 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 14 02 ff 23 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e 14 02 ae ff IMSI: 123456789012345 generated message: 1c 01 08 21 43 65 87 09 21 43 f5 06 01 00 original message: 1c 01 08 21 43 65 87 09 21 43 f5 06 01 00 @@ -45,7 +45,7 @@ message 2: tested 83 truncations, 81 parse failures message 3: tested 11 truncations, 11 parse failures message 4: tested 14 truncations, 13 parse failures - message 5: tested 73 truncations, 68 parse failures + message 5: tested 81 truncations, 75 parse failures message 6: tested 14 truncations, 13 parse failures message 7: tested 14 truncations, 13 parse failures message 8: tested 11 truncations, 11 parse failures @@ -60,7 +60,7 @@ message 2: tested 21248 modifications, 2571 parse failures message 3: tested 2816 modifications, 510 parse failures message 4: tested 3584 modifications, 768 parse failures - message 5: tested 18688 modifications, 3505 parse failures + message 5: tested 20736 modifications, 4010 parse failures message 6: tested 3584 modifications, 769 parse failures message 7: tested 3584 modifications, 768 parse failures message 8: tested 2816 modifications, 510 parse failures -- To view, visit https://gerrit.osmocom.org/3158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 09:04:41 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 8 Jul 2017 09:04:41 +0000 Subject: [PATCH] openbsc[master]: libmsc: Fix VTY output for handover counters. Message-ID: Review at https://gerrit.osmocom.org/3159 libmsc: Fix VTY output for handover counters. Handover countrs belong to BSC, but we mistakenly take values from MSC counters. Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 --- M openbsc/src/libmsc/vty_interface_layer3.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/59/3159/1 diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index e503291..042da9c 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -833,11 +833,11 @@ VTY_NEWLINE); vty_out(vty, "Handover : %lu attempted, %lu no_channel, %lu timeout, " "%lu completed, %lu failed%s", - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, VTY_NEWLINE); vty_out(vty, "SMS MO : %lu submitted, %lu no receiver%s", net->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED].current, -- To view, visit https://gerrit.osmocom.org/3159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:20:49 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 8 Jul 2017 10:20:49 +0000 Subject: openbsc[master]: libmsc: Fix VTY output for handover counters. In-Reply-To: References: Message-ID: Patch Set 1: I'm not sure I read Jenkins correctly, but it looks like the build failure is not related to my patch? -- To view, visit https://gerrit.osmocom.org/3159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:27:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:27:31 +0000 Subject: openbsc[master]: libmsc: Fix VTY output for handover counters. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:28:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:28:14 +0000 Subject: libosmocore[master]: gsup: Add encoding/decoding for the pdp charging characteris... In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:28:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:28:57 +0000 Subject: openbsc[master]: 04.08: find a portable way to obtain the timezone offset In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 Gerrit-PatchSet: 4 Gerrit-Project: openbsc 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 Sat Jul 8 10:29:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:29:35 +0000 Subject: libosmo-sccp[master]: vty: Check returncode of osmo_ss7_pointcode_parse() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae6d92b1d135063dfd0a26bc23a89802cb3b1a78 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:29:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:29:38 +0000 Subject: [MERGED] libosmo-sccp[master]: vty: Check returncode of osmo_ss7_pointcode_parse() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: Check returncode of osmo_ss7_pointcode_parse() ...................................................................... vty: Check returncode of osmo_ss7_pointcode_parse() The result of osmo_ss7_pointcode_parse() is currently not checked. This means that -EINVAL could end up as value in the pointcode configuration. Check the return code of osmo_ss7_pointcode_parse() and exit the VTY command with CMD_WARNING if the returned pointcode is < 0 Change-Id: Iae6d92b1d135063dfd0a26bc23a89802cb3b1a78 --- M src/osmo_ss7_vty.c 1 file changed, 51 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 8e40474..b06f554 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -165,7 +165,11 @@ "Point Code\n") { struct osmo_ss7_instance *inst = vty->index; - uint32_t pc = osmo_ss7_pointcode_parse(inst, argv[0]); + int pc = osmo_ss7_pointcode_parse(inst, argv[0]); + if (pc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } inst->cfg.primary_pc = pc; return CMD_SUCCESS; @@ -271,10 +275,20 @@ { struct osmo_ss7_route_table *rtable = vty->index; struct osmo_ss7_route *rt; - uint32_t dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); - uint32_t mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); + int dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); + int mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); const char *ls_name = argv[2]; unsigned int argind; + + if (dpc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (mask < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } rt = osmo_ss7_route_create(rtable, dpc, mask, ls_name); if (!rt) { @@ -307,8 +321,18 @@ { struct osmo_ss7_route_table *rtable = vty->index; struct osmo_ss7_route *rt; - uint32_t dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); - uint32_t mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); + int dpc = osmo_ss7_pointcode_parse(rtable->inst, argv[0]); + int mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); + + if (dpc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (mask < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } rt = osmo_ss7_route_find_dpc_mask(rtable, dpc, mask); if (!rt) { @@ -770,9 +794,16 @@ struct osmo_ss7_as *as = vty->index; struct osmo_ss7_routing_key *rkey = &as->cfg.routing_key; int argind; + int pc; + pc = osmo_ss7_pointcode_parse(as->inst, argv[1]); + if (pc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + rkey->pc = pc; rkey->context = atoi(argv[0]); - rkey->pc = osmo_ss7_pointcode_parse(as->inst, argv[1]); argind = 2; if (argind < argc && !strcmp(argv[argind], "si")) { @@ -799,7 +830,11 @@ "New Point Code\n") { struct osmo_ss7_as *as = vty->index; - uint32_t pc = osmo_ss7_pointcode_parse(as->inst, argv[0]); + int pc = osmo_ss7_pointcode_parse(as->inst, argv[0]); + if (pc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } if (as->cfg.proto != OSMO_SS7_ASP_PROT_IPA) { vty_out(vty, "Only IPA type AS support point-code override. " @@ -1208,11 +1243,19 @@ DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, "point-code POINT_CODE", "Add point-code Number\n" "PC\n") { + int pc; struct osmo_sccp_addr_entry *entry = (struct osmo_sccp_addr_entry *)vty->index; OSMO_ASSERT(entry); + + pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + if (pc < 0) { + vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; - entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + entry->addr.pc = pc; return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/3102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iae6d92b1d135063dfd0a26bc23a89802cb3b1a78 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:29:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:29:59 +0000 Subject: osmo-gsm-manuals[master]: sgsn: Add charging characteristics to GSUP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1d7423582e154728a240cf15c32772a06822f4ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:30:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:30:29 +0000 Subject: osmo-gsm-manuals[master]: sgsn: Fix numbering of QoS and add basic description for APN In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6113aa7c59841aada424e2cafd94ed88c7badc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:30:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:30:31 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: sgsn: Fix numbering of QoS and add basic description for APN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsn: Fix numbering of QoS and add basic description for APN ...................................................................... sgsn: Fix numbering of QoS and add basic description for APN QoS was supposed to be 13 as 12 has been used for the APN. Fix that and document the APN. Change-Id: Ib6113aa7c59841aada424e2cafd94ed88c7badc7 --- M OsmoSGSN/chapters/gsup.adoc 1 file changed, 9 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoSGSN/chapters/gsup.adoc b/OsmoSGSN/chapters/gsup.adoc index f496b84..9110f08 100644 --- a/OsmoSGSN/chapters/gsup.adoc +++ b/OsmoSGSN/chapters/gsup.adoc @@ -501,7 +501,7 @@ | |Length of PDP Info IE||M|V|1 |10|PDP Context ID|<>|C|TLV|3 |11|PDP Type|<>|C|TLV|4 -|12|Access Point Name|3GPP TS 04.08, Ch. 10.5.6.1|C|TLV|3-102 +|12|Access Point Name|<>|C|TLV|3-102 |13|Quality of Service|<>|O|TLV|1-20 |=== @@ -690,7 +690,8 @@ |0x09|HLR Number|<> |0x10|PDP Context ID|<> |0x11|PDP Type|<> -|0x12|QoS|<> +|0x12|Access Point Name|<> +|0x13|QoS|<> |0x20|RAND|<> |0x21|SRES|<> |0x22|Kc|<> @@ -772,6 +773,12 @@ } ---- +[[gsup-ie-apn]] +==== Access Point Name + +This encodes the Access Point Name of a PDP Context. The encoding +is defined in 3GPP TS 23.003. + [[gsup-ie-qos]] ==== Quality of Service Subscribed Service -- To view, visit https://gerrit.osmocom.org/3151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6113aa7c59841aada424e2cafd94ed88c7badc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:30:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:30:35 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: sgsn: Add charging characteristics to GSUP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add charging characteristics to GSUP ...................................................................... sgsn: Add charging characteristics to GSUP Reserve a new IE for the charging characteristics. We need to handle them as a GGSN might otherwise reject the PDP context creation. For the SGSN it is enough to send the two octets as it. Pick the 0x1X range for the IEs as it is used with the PDP contexts. Change-Id: I1d7423582e154728a240cf15c32772a06822f4ad --- M OsmoSGSN/chapters/gsup.adoc 1 file changed, 24 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoSGSN/chapters/gsup.adoc b/OsmoSGSN/chapters/gsup.adoc index 9110f08..733b60e 100644 --- a/OsmoSGSN/chapters/gsup.adoc +++ b/OsmoSGSN/chapters/gsup.adoc @@ -390,6 +390,7 @@ |09|HLR Number|<>|O|TLV|0-9 |04|PDP info complete|<>|M|TLV|2 |05|PDP info|<>|0-10|TLV| +|14|PDP-Charging Characteristics|<>|O|TLV|4 |=== If the PDP info complete IE is present, the old PDP info list shall be cleared. @@ -503,6 +504,7 @@ |11|PDP Type|<>|C|TLV|4 |12|Access Point Name|<>|C|TLV|3-102 |13|Quality of Service|<>|O|TLV|1-20 +|14|PDP-Charging Characteristics|<>|O|TLV|4 |=== The conditional IE are mandantory unless mentioned otherwise. @@ -692,6 +694,7 @@ |0x11|PDP Type|<> |0x12|Access Point Name|<> |0x13|QoS|<> +|0x14|PDP-Charging Characteristics|<> |0x20|RAND|<> |0x21|SRES|<> |0x22|Kc|<> @@ -802,6 +805,27 @@ } ---- + +[[gsup-ie-charging]] +==== PDP-Charging Characteristics + +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. + +[packetdiag] +---- +{ + colwidth = 8 + node_height = 24 + + 0-3: Profile Index + 4-15: Behavior +} +---- + + [[gsup-ie-hlr]] ==== HLR Number encoded as 3GPP TS 09.02 ISDN-AddressString -- To view, visit https://gerrit.osmocom.org/3152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1d7423582e154728a240cf15c32772a06822f4ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:31:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:31:10 +0000 Subject: [MERGED] libosmocore[master]: gsup: Add encoding/decoding for the pdp charging characteris... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsup: Add encoding/decoding for the pdp charging characteristics ...................................................................... gsup: Add encoding/decoding for the pdp charging characteristics These fields can be in the ISD and the PDP Context inofmration. Store pointers to this IE in both cases. It needs to be used by the SGSN when opening a PDP context. Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M tests/gsup/gsup_test.c M tests/gsup/gsup_test.err 4 files changed, 36 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 886ea5d..890bff3 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -51,6 +51,7 @@ OSMO_GSUP_PDP_TYPE_IE = 0x11, OSMO_GSUP_ACCESS_POINT_NAME_IE = 0x12, OSMO_GSUP_PDP_QOS_IE = 0x13, + OSMO_GSUP_CHARG_CHAR_IE = 0x14, OSMO_GSUP_RAND_IE = 0x20, OSMO_GSUP_SRES_IE = 0x21, OSMO_GSUP_KC_IE = 0x22, @@ -127,6 +128,11 @@ const uint8_t *qos_enc; /*! length (in octets) of qos_enc */ size_t qos_enc_len; + /*! PDP Charging Characteristics, still in encoded form. Can be NULL if no + * PDP Charging Characteristics */ + const uint8_t *pdp_charg_enc; + /*! length (in octets) of pdp_charg_enc */ + size_t pdp_charg_enc_len; }; /*! parsed/decoded GSUP protocol message */ @@ -148,6 +154,8 @@ const uint8_t *auts; const uint8_t *rand; enum osmo_gsup_cn_domain cn_domain; + const uint8_t *pdp_charg_enc; + size_t pdp_charg_enc_len; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 2629eb7..685c91f 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -103,6 +103,11 @@ pdp_info->qos_enc_len = value_len; break; + case OSMO_GSUP_CHARG_CHAR_IE: + pdp_info->pdp_charg_enc = value; + pdp_info->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_ERROR, "GSUP IE type %d not expected in PDP info\n", iei); @@ -375,6 +380,11 @@ gsup_msg->cn_domain = *value; break; + case OSMO_GSUP_CHARG_CHAR_IE: + gsup_msg->pdp_charg_enc = value; + gsup_msg->pdp_charg_enc_len = value_len; + break; + default: LOGP(DLGSUP, LOGL_NOTICE, "GSUP IE type %d unknown\n", iei); @@ -413,6 +423,11 @@ if (pdp_info->qos_enc) { msgb_tlv_put(msg, OSMO_GSUP_PDP_QOS_IE, pdp_info->qos_enc_len, pdp_info->qos_enc); + } + + if (pdp_info->pdp_charg_enc) { + msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE, + pdp_info->pdp_charg_enc_len, pdp_info->pdp_charg_enc); } /* Update length field */ @@ -540,6 +555,11 @@ uint8_t dn = gsup_msg->cn_domain; msgb_tlv_put(msg, OSMO_GSUP_CN_DOMAIN_IE, 1, &dn); } + + if (gsup_msg->pdp_charg_enc) { + msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE, + gsup_msg->pdp_charg_enc_len, gsup_msg->pdp_charg_enc); + } } /*! @} */ diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index a950ca3..3b360ac 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -69,15 +69,18 @@ 0x09, 0x07, /* HLR-Number of the subscriber */ 0x91, 0x83, 0x52, 0x38, 0x48, 0x83, 0x93, 0x04, 0x00, /* PDP info complete */ - 0x05, 0x15, + 0x05, 0x19, 0x10, 0x01, 0x01, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x09, 0x04, 't', 'e', 's', 't', 0x03, 'a', 'p', 'n', 0x13, 0x01, 0x02, + 0x14, 0x02, 0xFF, 0x23, 0x05, 0x11, 0x10, 0x01, 0x02, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x08, 0x03, 'f', 'o', 'o', 0x03, 'a', 'p', 'n', + 0x14, 0x02, + 0xAE, 0xFF }; static const uint8_t location_cancellation_req[] = { diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err index 6cd8627..05c64fe 100644 --- a/tests/gsup/gsup_test.err +++ b/tests/gsup/gsup_test.err @@ -13,8 +13,8 @@ generated message: 05 01 08 21 43 65 87 09 21 43 f5 02 01 07 original message: 05 01 08 21 43 65 87 09 21 43 f5 02 01 07 IMSI: 123456789012345 - generated message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 15 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e - original message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 15 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e + generated message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 19 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 14 02 ff 23 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e 14 02 ae ff + original message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 19 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 14 02 ff 23 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e 14 02 ae ff IMSI: 123456789012345 generated message: 1c 01 08 21 43 65 87 09 21 43 f5 06 01 00 original message: 1c 01 08 21 43 65 87 09 21 43 f5 06 01 00 @@ -45,7 +45,7 @@ message 2: tested 83 truncations, 81 parse failures message 3: tested 11 truncations, 11 parse failures message 4: tested 14 truncations, 13 parse failures - message 5: tested 73 truncations, 68 parse failures + message 5: tested 81 truncations, 75 parse failures message 6: tested 14 truncations, 13 parse failures message 7: tested 14 truncations, 13 parse failures message 8: tested 11 truncations, 11 parse failures @@ -60,7 +60,7 @@ message 2: tested 21248 modifications, 2571 parse failures message 3: tested 2816 modifications, 510 parse failures message 4: tested 3584 modifications, 768 parse failures - message 5: tested 18688 modifications, 3505 parse failures + message 5: tested 20736 modifications, 4010 parse failures message 6: tested 3584 modifications, 769 parse failures message 7: tested 3584 modifications, 768 parse failures message 8: tested 2816 modifications, 510 parse failures -- To view, visit https://gerrit.osmocom.org/3158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:31:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:31:54 +0000 Subject: osmo-pcu[master]: Ignore test binaries using mask In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3153/1/.gitignore File .gitignore: PS1, Line 44: pcu_emu doesn't match the new pattern, does it? -- To view, visit https://gerrit.osmocom.org/3153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic7930c6e715447e91572f7ed6b0d2bb2238cf367 Gerrit-PatchSet: 1 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 Jul 8 10:32:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:32:59 +0000 Subject: osmo-pcu[master]: Move DL assignment to TBF-DL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04584103018675a2f35cfb565473bfd81a208d7c 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 Sat Jul 8 10:33:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:33:29 +0000 Subject: osmo-pcu[master]: Move common code into functions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 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 Sat Jul 8 10:34:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:34:05 +0000 Subject: osmo-pcu[master]: Encapsulate handling of UL ACK timeout In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3f009c52118db95b38a077e08eecda844e7f8d1 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 Sat Jul 8 10:34:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:34:34 +0000 Subject: osmo-pcu[master]: Remove TBF knowledge from rcv_control*dl_ack_nack In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3154 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d1b5782001e45617b4a960612fcfc249904b37c 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 Sat Jul 8 10:35:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:35:53 +0000 Subject: osmo-pcu[master]: Move DL scheduling and RTS handler to trx level In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf 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 Sat Jul 8 10:37:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:37:44 +0000 Subject: osmo-gsm-tester[master]: aoip_smpp: Disable check in esme_ms_sms_storeforward due to ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I12f8dbe1d6dc9a554438fda1e38b2e5e3245c320 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 Sat Jul 8 10:38:58 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 8 Jul 2017 10:38:58 +0000 Subject: openbsc[master]: libmsc: Fix VTY output for handover counters. In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:39:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:39:06 +0000 Subject: openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/3127/4/openbsc/src/libmsc/transaction.c File openbsc/src/libmsc/transaction.c: Line 75: DEBUGP(DCC, I think this should be INFO or probably even NOTICE level, as it is not something that relates to debugging the software, but a rather serious uncommon event that might require some investigation? -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:39:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:39:24 +0000 Subject: openbsc[master]: smpp_smsc.c: Log on sending deliver_sm message In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:39:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:39:25 +0000 Subject: [MERGED] openbsc[master]: smpp_smsc.c: Log on sending deliver_sm message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: smpp_smsc.c: Log on sending deliver_sm message ...................................................................... smpp_smsc.c: Log on sending deliver_sm message Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 --- M openbsc/src/libmsc/smpp_smsc.c 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/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 48a1192..4c2e4aa 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -654,6 +654,9 @@ { deliver->sequence_number = esme_inc_seq_nr(esme); + LOGP(DSMPP, LOGL_DEBUG, "[%s] Tx DELIVER-SM (from %s)\n", + esme->system_id, deliver->source_addr); + return PACK_AND_SEND(esme, deliver); } -- To view, visit https://gerrit.osmocom.org/3144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:39:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:39:43 +0000 Subject: libosmocore[master]: Deprecate wrappers around loglevel_strs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I792e30dc44f027fd94e1f65af19fe08bac52b95c 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 Sat Jul 8 10:39:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:39:45 +0000 Subject: [MERGED] libosmocore[master]: Deprecate wrappers around loglevel_strs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Deprecate wrappers around loglevel_strs ...................................................................... Deprecate wrappers around loglevel_strs Add deprecation notice for public API use: it shouldn't be used outside of libosmocore anyway. Change-Id: I792e30dc44f027fd94e1f65af19fe08bac52b95c Related: OS#71 --- M include/osmocom/core/logging.h 1 file changed, 2 insertions(+), 2 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 68a9c13..e058a57 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -306,8 +306,8 @@ 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); -int log_parse_level(const char *lvl); -const char *log_level_str(unsigned int lvl); +int log_parse_level(const char *lvl) OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE; +const char *log_level_str(unsigned int lvl) OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE; int log_parse_category(const char *category); void log_set_category_filter(struct log_target *target, int category, int enable, int level); -- To view, visit https://gerrit.osmocom.org/3147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I792e30dc44f027fd94e1f65af19fe08bac52b95c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:40:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:40:03 +0000 Subject: libosmocore[master]: Ignore broken everything log level In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:40:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:40:35 +0000 Subject: libosmo-abis[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I065b18dd6c4f7616f981aa4273e68e23825a7294 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:40:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:40:49 +0000 Subject: libosmo-abis[master]: configure.ac: Fix C(PP)FLAGS for BSD build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id509351104bc7466114d4b9be450814254110f44 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:40:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:40:54 +0000 Subject: [MERGED] libosmo-abis[master]: configure.ac: Fix C(PP)FLAGS for BSD build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Fix C(PP)FLAGS for BSD build ...................................................................... configure.ac: Fix C(PP)FLAGS for BSD build Issue first found in libosmocore. It seems the BSD build doesn't use bash which means using += to append to a variable doesn't work correctly. Change-Id: Id509351104bc7466114d4b9be450814254110f44 --- M configure.ac 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 535d1c3..9b62f3e 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ AC_CONFIG_MACRO_DIR([m4]) -CFLAGS+=" -Wall" -CPPFLAGS+=" -Wall" +CFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CPPFLAGS -Wall" # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" @@ -58,8 +58,8 @@ [sanitize=$enableval], [sanitize="no"]) if test x"$sanitize" = x"yes" then - CFLAGS+=" -fsanitize=address -fsanitize=undefined" - CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" + CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" + CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" fi _cflags_save=$CFLAGS -- To view, visit https://gerrit.osmocom.org/3137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id509351104bc7466114d4b9be450814254110f44 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:41:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:41:03 +0000 Subject: libosmo-netif[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:41:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:41:06 +0000 Subject: libosmo-netif[master]: configure.ac: Use -Wall in C(PP)FLAGS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia1d7e99541089a92e6bc17798a94ac756047aeba Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:41:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:41:09 +0000 Subject: [MERGED] libosmo-netif[master]: configure.ac: Use -Wall in C(PP)FLAGS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Use -Wall in C(PP)FLAGS ...................................................................... configure.ac: Use -Wall in C(PP)FLAGS Change-Id: Ia1d7e99541089a92e6bc17798a94ac756047aeba --- 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 362d792..175ab63 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,9 @@ AC_CONFIG_MACRO_DIR([m4]) +CFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CPPFLAGS -Wall" + dnl checks for header files AC_HEADER_STDC AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h) -- To view, visit https://gerrit.osmocom.org/3139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia1d7e99541089a92e6bc17798a94ac756047aeba Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:43:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:43:43 +0000 Subject: libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:43:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:43:53 +0000 Subject: osmo-bts[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8efd2095fcf759276299b516d495219105c1f2b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:43:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:43:56 +0000 Subject: libosmo-abis[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:44:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:44:09 +0000 Subject: osmo-gsm-manuals[master]: Remove currently broken everything logging option In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I52e370d59274e29502cd23690f0d5c73aa3a4cc7 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 Sat Jul 8 10:44:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:44:11 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Remove currently broken everything logging option In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove currently broken everything logging option ...................................................................... Remove currently broken everything logging option Change-Id: I52e370d59274e29502cd23690f0d5c73aa3a4cc7 Related: OS#71 --- M common/chapters/vty.adoc 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index 931cd1f..d84d5cf 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -246,7 +246,7 @@ logging print extended-timestamp (0|1) logging print category (0|1) logging set-log-mask MASK - logging level (all|rll|cc|mm|rr|rsl|nm|mncc|pag|meas|sccp|msc|mgcp|ho|db|ref|gprs|ns|bssgp|llc|sndcp|nat|ctrl|smpp|filter|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats) (everything|debug|info|notice|error|fatal) + logging level (all|rll|cc|mm|rr|rsl|nm|mncc|pag|meas|sccp|msc|mgcp|ho|db|ref|gprs|ns|bssgp|llc|sndcp|nat|ctrl|smpp|filter|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats) (debug|info|notice|error|fatal) show logging vty show alarms show stats -- To view, visit https://gerrit.osmocom.org/3145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I52e370d59274e29502cd23690f0d5c73aa3a4cc7 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 Sat Jul 8 10:45:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:45:06 +0000 Subject: openbsc[master]: smpp: fix return cause In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 Gerrit-PatchSet: 4 Gerrit-Project: openbsc 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 Sat Jul 8 10:45:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:45:09 +0000 Subject: [MERGED] openbsc[master]: smpp: fix return cause In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: smpp: fix return cause ...................................................................... smpp: fix return cause Return cause 38 when default SMPP route is unavailable. This is better than cause 1. Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.c M openbsc/src/libmsc/smpp_smsc.h 4 files changed, 17 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index aa2030f..acf425a 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -294,6 +294,7 @@ if (smpp_first) { rc = smpp_try_deliver(gsms, conn, deferred); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) + /* unknown subscriber, try local */ goto try_local; if (rc < 0) { LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index f94968a..f7d1441 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -702,17 +702,18 @@ { struct osmo_esme *esme; struct osmo_smpp_addr dst; + int rc; memset(&dst, 0, sizeof(dst)); dst.ton = sms->dst.ton; dst.npi = sms->dst.npi; memcpy(dst.addr, sms->dst.addr, sizeof(dst.addr)); - esme = smpp_route(g_smsc, &dst); - if (!esme) - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rc = smpp_route(g_smsc, &dst, &esme); + if (!rc) + rc = deliver_to_esme(esme, sms, conn, deferred); - return deliver_to_esme(esme, sms, conn, deferred); + return rc; } struct smsc *smsc_from_vty(struct vty *v) diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 4c2e4aa..04afc49 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -270,8 +270,7 @@ } /*! \brief try to find a SMPP route (ESME) for given destination */ -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest) +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **pesme) { struct osmo_smpp_route *r; struct osmo_smpp_acl *acl = NULL; @@ -314,15 +313,20 @@ struct osmo_esme *esme; DEBUGP(DSMPP, "ACL even has ESME, we can route to it!\n"); esme = acl->esme; - if (esme->bind_flags & ESME_BIND_RX) - return esme; - else + if (esme->bind_flags & ESME_BIND_RX) { + *pesme = esme; + return 0; + } else LOGP(DSMPP, LOGL_NOTICE, "[%s] is matching route, " "but not bound for Rx, discarding MO SMS\n", esme->system_id); } - return NULL; + *pesme = NULL; + if (acl) + return GSM48_CC_CAUSE_NETWORK_OOO; + else + return GSM48_CC_CAUSE_UNASSIGNED_NR; } diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index d8e82e4..c9209ef 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -126,8 +126,7 @@ void smpp_esme_get(struct osmo_esme *esme); void smpp_esme_put(struct osmo_esme *esme); -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest); +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **emse); struct osmo_smpp_acl *smpp_acl_alloc(struct smsc *smsc, const char *sys_id); struct osmo_smpp_acl *smpp_acl_by_system_id(struct smsc *smsc, -- To view, visit https://gerrit.osmocom.org/3126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:45:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:45:48 +0000 Subject: libosmo-sccp[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16a8ca7f0bfabeed6a9b58cda5e60bd58889f74d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:45:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:45:56 +0000 Subject: libosmo-sccp[master]: configure.ac: Fix C(PP)FLAGS for BSD build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33f6b9de4990de0c4d3a6fc0bd7df632094e79ac Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:45:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:45:59 +0000 Subject: libosmo-sccp[master]: sccp_scoc: Fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia93bb7d59e4e2c31b693e2c3424d34386762d02e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:46:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:46:22 +0000 Subject: libosmo-sccp[master]: sccp_scoc: Fix compilation warning and leave a pragma message In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e2c482803954c984cb6792b11b4ea0fe674e269 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:46:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:46:31 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_scoc: Fix compilation warning and leave a pragma message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_scoc: Fix compilation warning and leave a pragma message ...................................................................... sccp_scoc: Fix compilation warning and leave a pragma message Following warning was being printed: warning: statement will never be executed [-Wswitch-unreachable] The code in there seems not to be finished, so better leave the code and a pragma message to get notified when we compile. Change-Id: I4e2c482803954c984cb6792b11b4ea0fe674e269 --- M src/sccp_scoc.c 1 file changed, 3 insertions(+), 3 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 3a2cb47..3d43448 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -938,10 +938,10 @@ struct osmo_scu_prim *prim = NULL; switch (event) { - /* TODO: internal disco */ +#pragma message ("TODO: internal disco: send N-DISCONNECT.ind to user") /* send N-DISCONNECT.ind to user */ - scu_gen_encode_and_send(conn, event, xua, OSMO_SCU_PRIM_N_DISCONNECT, - PRIM_OP_INDICATION); + /*scu_gen_encode_and_send(conn, event, xua, OSMO_SCU_PRIM_N_DISCONNECT, + PRIM_OP_INDICATION);*/ /* fall-through */ case SCOC_E_SCU_N_DISC_REQ: prim = data; -- To view, visit https://gerrit.osmocom.org/3135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4e2c482803954c984cb6792b11b4ea0fe674e269 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:46:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:46:32 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_scoc: Fix trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_scoc: Fix trailing whitespace ...................................................................... sccp_scoc: Fix trailing whitespace Change-Id: Ia93bb7d59e4e2c31b693e2c3424d34386762d02e --- M src/sccp_scoc.c 1 file changed, 2 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 628b63b..3a2cb47 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -122,7 +122,7 @@ }; /*********************************************************************** - * various helper functions + * various helper functions ***********************************************************************/ enum sccp_connection_state { @@ -1596,7 +1596,7 @@ } } -/*! \brief Main entrance function for primitives from SCCP User +/*! \brief Main entrance function for primitives from SCCP User * \param[in] scu SCCP User sending us the primitive * \param[in] oph Osmocom primitive sent by the user * \returns 0 on success; negative on error */ -- To view, visit https://gerrit.osmocom.org/3134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia93bb7d59e4e2c31b693e2c3424d34386762d02e Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:46:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:46:32 +0000 Subject: [MERGED] libosmo-sccp[master]: configure.ac: Fix C(PP)FLAGS for BSD build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Fix C(PP)FLAGS for BSD build ...................................................................... configure.ac: Fix C(PP)FLAGS for BSD build Issue first found in libosmocore. It seems the BSD build doesn't use bash which means using += to append to a variable doesn't work correctly. Change-Id: I33f6b9de4990de0c4d3a6fc0bd7df632094e79ac --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 36cbb59..200f55d 100644 --- a/configure.ac +++ b/configure.ac @@ -53,8 +53,8 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) -CFLAGS+=" -Wall" -CPPFLAGS+=" -Wall" +CFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CFLAGS -Wall" AC_OUTPUT( libosmo-sigtran.pc -- To view, visit https://gerrit.osmocom.org/3133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33f6b9de4990de0c4d3a6fc0bd7df632094e79ac Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 8 10:46:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 8 Jul 2017 10:46:32 +0000 Subject: [MERGED] libosmo-sccp[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: contrib: Enable -Werror by default ...................................................................... contrib: Enable -Werror by default Change-Id: I16a8ca7f0bfabeed6a9b58cda5e60bd58889f74d --- M configure.ac M contrib/jenkins.sh 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 200f55d..7e3e03e 100644 --- a/configure.ac +++ b/configure.ac @@ -54,7 +54,7 @@ AC_SUBST(SYMBOL_VISIBILITY) CFLAGS="$CFLAGS -Wall" -CPPFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CPPFLAGS -Wall" AC_OUTPUT( libosmo-sigtran.pc diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 668a58b..897c464 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,7 +29,7 @@ set -x autoreconf --install --force -./configure +./configure CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I16a8ca7f0bfabeed6a9b58cda5e60bd58889f74d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Sat Jul 8 19:54:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 08 Jul 2017 19:54:46 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5961389f87b68_5caec8af78867261@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 251s] | [ 251s] | This file was extended by libosmocore config.status 0.9.6.20170708, which was [ 251s] | generated by GNU Autoconf 2.69. Invocation command line was [ 251s] | [ 251s] | CONFIG_FILES = [ 251s] | CONFIG_HEADERS = [ 251s] | CONFIG_LINKS = [ 251s] | CONFIG_COMMANDS = [ 251s] | $ ./config.status Doxyfile.core [ 251s] | [ 251s] | on build36 [ 251s] | [ 251s] | config.status:1171: creating Doxyfile.core [ 251s] [ 251s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 251s] make[1]: *** [override_dh_auto_test] Error 1 [ 251s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 251s] debian/rules:15: recipe for target 'build' failed [ 251s] make: *** [build] Error 2 [ 251s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 251s] [ 251s] build36 failed "build libosmocore_0.9.6.20170708.dsc" at Sat Jul 8 19:54:25 UTC 2017. [ 251s] [ 251s] ### VM INTERACTION START ### [ 254s] [ 233.853006] reboot: Power down [ 255s] ### VM INTERACTION END ### [ 255s] [ 255s] build36 failed "build libosmocore_0.9.6.20170708.dsc" at Sat Jul 8 19:54:30 UTC 2017. [ 255s] -- 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 Jul 9 10:48:29 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 10:48:29 +0000 Subject: [PATCH] libosmocore[master]: gsm_04_08/sgsn: Add another IE for internal usage in the sgsn Message-ID: Review at https://gerrit.osmocom.org/3160 gsm_04_08/sgsn: Add another IE for internal usage in the sgsn The PDP charging characteristics will be returned from the PDP selection code and be used in the SGSN. It is following the same approach as the QoS and PDP addr. It is a bit of a pity that we have to define this in a different project. Change-Id: I7815c5dfd7b7fb0ea78d816ebfb3abfbf0090afe --- M include/osmocom/gsm/protocol/gsm_04_08_gprs.h 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/3160/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index 13820a7..61304c0 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -112,6 +112,7 @@ /* Fake IEs that are not present on the Layer3 air interface, * but which we use to simplify internal APIs */ + OSMO_IE_GSM_CHARG_CHAR = 0xfc, OSMO_IE_GSM_REQ_QOS = 0xfd, OSMO_IE_GSM_REQ_PDP_ADDR = 0xfe, OSMO_IE_GSM_SUB_QOS = 0xff, -- To view, visit https://gerrit.osmocom.org/3160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7815c5dfd7b7fb0ea78d816ebfb3abfbf0090afe Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Sun Jul 9 11:30:18 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 11:30:18 +0000 Subject: [PATCH] openbsc[master]: sgsn: Fill the cch_pdp with a value coming from the tlv stru... Message-ID: Review at https://gerrit.osmocom.org/3161 sgsn: Fill the cch_pdp with a value coming from the tlv structure For some GGSNs we need to insert the PDP Charging Characteristics that were returned. We receive these values from GSUP and will fill them into the tlv structure when finding the ggsn context. Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 --- M openbsc/include/openbsc/gprs_sgsn.h M openbsc/src/gprs/gprs_sgsn.c M openbsc/src/gprs/gprs_subscriber.c M openbsc/src/gprs/sgsn_libgtp.c 4 files changed, 40 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/61/3161/1 diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index fd86174..25ddf0c 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -407,6 +407,9 @@ uint8_t hlr[9]; size_t hlr_len; + + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; #define SGSN_ERROR_CAUSE_NONE (-1) diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 071dd97..fbea5b9 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -698,10 +698,21 @@ sgsn_auth_update(mmctx); } -static void insert_qos(struct tlv_parsed *tp, struct sgsn_subscriber_pdp_data *pdp) +static void insert_extra(struct tlv_parsed *tp, + struct sgsn_subscriber_data *data, + struct sgsn_subscriber_pdp_data *pdp) { tp->lv[OSMO_IE_GSM_SUB_QOS].len = pdp->qos_subscribed_len; tp->lv[OSMO_IE_GSM_SUB_QOS].val = pdp->qos_subscribed; + + /* Prefer PDP charging characteristics of per subscriber one */ + if (pdp->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(pdp->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &pdp->pdp_charg[0]; + } else if (data->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(data->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &data->pdp_charg[0]; + } } /** @@ -750,7 +761,7 @@ { allow_any_apn = 1; selected_apn_str = ""; - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); continue; } if (!llist_empty(&sgsn_apn_ctxts)) { @@ -759,7 +770,7 @@ if (apn_ctx == NULL) continue; } - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = pdp->apn_str; break; } @@ -767,13 +778,13 @@ /* Check whether the given APN is granted */ llist_for_each_entry(pdp, &mmctx->subscr->sgsn_data->pdp_list, list) { if (strcmp(pdp->apn_str, "*") == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; allow_any_apn = 1; continue; } if (strcasecmp(pdp->apn_str, req_apn_str) == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; break; } diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c index 1bb5141..c90ba70 100644 --- a/openbsc/src/gprs/gprs_subscriber.c +++ b/openbsc/src/gprs/gprs_subscriber.c @@ -324,6 +324,13 @@ } } + if (gsup_msg->pdp_charg_enc && gsup_msg->pdp_charg_enc_len >= sizeof(sdata->pdp_charg)) { + memcpy(&sdata->pdp_charg, gsup_msg->pdp_charg_enc, sizeof(sdata->pdp_charg)); + sdata->has_pdp_charg = 1; + } else { + sdata->has_pdp_charg = 0; + } + if (gsup_msg->pdp_info_compl) { rc = gprs_subscr_pdp_data_clear(subscr); if (rc > 0) @@ -367,6 +374,13 @@ pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + + if (pdp_info->pdp_charg_enc && pdp_info->pdp_charg_enc_len >= sizeof(pdp_data->pdp_charg)) { + memcpy(&pdp_data->pdp_charg, pdp_info->pdp_charg_enc, sizeof(pdp_data->pdp_charg)); + pdp_data->has_pdp_charg = 1; + } else { + pdp_data->has_pdp_charg = 0; + } } } diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 001e611..90ac48a 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -234,6 +234,13 @@ memcpy(pdp->qos_req.v, qos, pdp->qos_req.l); } + /* charging characteristics if present */ + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) { + OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); + memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), + TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); + } + /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); memcpy(pdp->gsnlc.v, &sgsn->cfg.gtp_listenaddr.sin_addr, -- To view, visit https://gerrit.osmocom.org/3161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Sun Jul 9 11:31:48 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 11:31:48 +0000 Subject: openbsc[master]: sgsn: Fill the cch_pdp with a value coming from the tlv stru... In-Reply-To: References: Message-ID: Patch Set 1: Depends on https://gerrit.osmocom.org/#/c/3160/ and has not been tested/compile tested yet.. using jenkins to do that ;) -- To view, visit https://gerrit.osmocom.org/3161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 9 11:39:16 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 11:39:16 +0000 Subject: [PATCH] openbsc[master]: sgsn: Fill the cch_pdp with a value coming from the tlv stru... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3161 to look at the new patch set (#2). sgsn: Fill the cch_pdp with a value coming from the tlv structure For some GGSNs we need to insert the PDP Charging Characteristics that were returned. We receive these values from GSUP and will fill them into the tlv structure when finding the ggsn context. Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 --- M openbsc/include/openbsc/gprs_sgsn.h M openbsc/src/gprs/gprs_sgsn.c M openbsc/src/gprs/gprs_subscriber.c M openbsc/src/gprs/sgsn_libgtp.c 4 files changed, 42 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/61/3161/2 diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index fd86174..4e49c08 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -393,6 +393,8 @@ char apn_str[GSM_APN_LENGTH]; uint8_t qos_subscribed[20]; size_t qos_subscribed_len; + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; struct sgsn_subscriber_data { @@ -407,6 +409,9 @@ uint8_t hlr[9]; size_t hlr_len; + + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; #define SGSN_ERROR_CAUSE_NONE (-1) diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 071dd97..fbea5b9 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -698,10 +698,21 @@ sgsn_auth_update(mmctx); } -static void insert_qos(struct tlv_parsed *tp, struct sgsn_subscriber_pdp_data *pdp) +static void insert_extra(struct tlv_parsed *tp, + struct sgsn_subscriber_data *data, + struct sgsn_subscriber_pdp_data *pdp) { tp->lv[OSMO_IE_GSM_SUB_QOS].len = pdp->qos_subscribed_len; tp->lv[OSMO_IE_GSM_SUB_QOS].val = pdp->qos_subscribed; + + /* Prefer PDP charging characteristics of per subscriber one */ + if (pdp->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(pdp->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &pdp->pdp_charg[0]; + } else if (data->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(data->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &data->pdp_charg[0]; + } } /** @@ -750,7 +761,7 @@ { allow_any_apn = 1; selected_apn_str = ""; - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); continue; } if (!llist_empty(&sgsn_apn_ctxts)) { @@ -759,7 +770,7 @@ if (apn_ctx == NULL) continue; } - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = pdp->apn_str; break; } @@ -767,13 +778,13 @@ /* Check whether the given APN is granted */ llist_for_each_entry(pdp, &mmctx->subscr->sgsn_data->pdp_list, list) { if (strcmp(pdp->apn_str, "*") == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; allow_any_apn = 1; continue; } if (strcasecmp(pdp->apn_str, req_apn_str) == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; break; } diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c index 1bb5141..c90ba70 100644 --- a/openbsc/src/gprs/gprs_subscriber.c +++ b/openbsc/src/gprs/gprs_subscriber.c @@ -324,6 +324,13 @@ } } + if (gsup_msg->pdp_charg_enc && gsup_msg->pdp_charg_enc_len >= sizeof(sdata->pdp_charg)) { + memcpy(&sdata->pdp_charg, gsup_msg->pdp_charg_enc, sizeof(sdata->pdp_charg)); + sdata->has_pdp_charg = 1; + } else { + sdata->has_pdp_charg = 0; + } + if (gsup_msg->pdp_info_compl) { rc = gprs_subscr_pdp_data_clear(subscr); if (rc > 0) @@ -367,6 +374,13 @@ pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + + if (pdp_info->pdp_charg_enc && pdp_info->pdp_charg_enc_len >= sizeof(pdp_data->pdp_charg)) { + memcpy(&pdp_data->pdp_charg, pdp_info->pdp_charg_enc, sizeof(pdp_data->pdp_charg)); + pdp_data->has_pdp_charg = 1; + } else { + pdp_data->has_pdp_charg = 0; + } } } diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 001e611..90ac48a 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -234,6 +234,13 @@ memcpy(pdp->qos_req.v, qos, pdp->qos_req.l); } + /* charging characteristics if present */ + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) { + OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); + memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), + TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); + } + /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); memcpy(pdp->gsnlc.v, &sgsn->cfg.gtp_listenaddr.sin_addr, -- To view, visit https://gerrit.osmocom.org/3161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 9 20:58:53 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 20:58:53 +0000 Subject: libosmo-abis[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Let's imagine we have bumped the SOVERSION of libosmocore. And made a new release and libosmo-abis is using new API. Will your script point out that configure.ac needs to update the min version? E.g. as part of building the 201705-sdk I tried the documentation notes to rebuild osmo-bts and it should fail at configure time with the versions of libosmocore pre-installed by the SDK being too old.. instead it bombs out at compile time as some enums got renamed... I think bumping the minversion at release time is the right time... -- To view, visit https://gerrit.osmocom.org/3131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 9 21:00:05 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 21:00:05 +0000 Subject: libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3130/7/osmo-release.mk File osmo-release.mk: Line 21: @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" Instewad of printing text no-one will read. Fail? -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jul 9 21:00:33 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 21:00:33 +0000 Subject: libosmo-netif[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 9 21:01:30 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 21:01:30 +0000 Subject: libosmo-netif[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: The FreeBSD warning about %hu vs. %u looks correct. ;) -- To view, visit https://gerrit.osmocom.org/3140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 9 21:03:25 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 21:03:25 +0000 Subject: openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Patch Set 4: Who called it with a NULL subscr? Do you think it is approriate to call this function with a NULL subscriber? If nonnull attribute wouldn't influence the optimizer I would say let's mark the parameter as non NULL. -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter 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 Sun Jul 9 21:07:04 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 21:07:04 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 9 21:08:01 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 21:08:01 +0000 Subject: osmo-bts[master]: sysmo: Remove non longer valid -p option from help In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8dbcdc7080ca3f7d7968aeef24422faa75d925fe Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 9 21:12:41 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 9 Jul 2017 21:12:41 +0000 Subject: openbsc[master]: Fix BTS attribute requests In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/2868/3/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 1595: if (bts->type != GSM_BTS_TYPE_OSMOBTS) { hmm having learned from nanobts->sysmobts checks... we should avoid direct bts->type comparisons... -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jul 9 22:53:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 9 Jul 2017 22:53:16 +0000 Subject: [MERGED] osmo-bts[master]: sysmo: Remove non longer valid -p option from help In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sysmo: Remove non longer valid -p option from help ...................................................................... sysmo: Remove non longer valid -p option from help The dsp-trace-flags command line argument was removed in 9684099ae905e6e61cbc326035d0b37c480f6172 Change-Id: I8dbcdc7080ca3f7d7968aeef24422faa75d925fe --- M src/osmo-bts-sysmo/main.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index a8b7b50..ce12d63 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -120,7 +120,6 @@ void bts_model_print_help() { printf( - " -p --dsp-trace Set DSP trace flags\n" " -w --hw-version Print the targeted HW Version\n" " -M --pcu-direct Force PCU to access message queue for " "PDCH dchannel directly\n" -- To view, visit https://gerrit.osmocom.org/3123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8dbcdc7080ca3f7d7968aeef24422faa75d925fe Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 9 22:54:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 9 Jul 2017 22:54:18 +0000 Subject: openbsc[master]: sgsn: Fill the cch_pdp with a value coming from the tlv stru... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 9 22:55:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 9 Jul 2017 22:55:15 +0000 Subject: libosmocore[master]: gsm_04_08/sgsn: Add another IE for internal usage in the sgsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7815c5dfd7b7fb0ea78d816ebfb3abfbf0090afe Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 9 22:55:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 9 Jul 2017 22:55:18 +0000 Subject: [MERGED] libosmocore[master]: gsm_04_08/sgsn: Add another IE for internal usage in the sgsn In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm_04_08/sgsn: Add another IE for internal usage in the sgsn ...................................................................... gsm_04_08/sgsn: Add another IE for internal usage in the sgsn The PDP charging characteristics will be returned from the PDP selection code and be used in the SGSN. It is following the same approach as the QoS and PDP addr. It is a bit of a pity that we have to define this in a different project. Change-Id: I7815c5dfd7b7fb0ea78d816ebfb3abfbf0090afe --- M include/osmocom/gsm/protocol/gsm_04_08_gprs.h 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index 13820a7..61304c0 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -112,6 +112,7 @@ /* Fake IEs that are not present on the Layer3 air interface, * but which we use to simplify internal APIs */ + OSMO_IE_GSM_CHARG_CHAR = 0xfc, OSMO_IE_GSM_REQ_QOS = 0xfd, OSMO_IE_GSM_REQ_PDP_ADDR = 0xfe, OSMO_IE_GSM_SUB_QOS = 0xff, -- To view, visit https://gerrit.osmocom.org/3160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7815c5dfd7b7fb0ea78d816ebfb3abfbf0090afe Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 9 23:39:56 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 9 Jul 2017 23:39:56 +0000 Subject: libosmo-netif[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: Indeed, I'll merge this once I fix the warnings. -- To view, visit https://gerrit.osmocom.org/3140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 07:43:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 07:43:53 +0000 Subject: libosmocore[master]: gsm_utils: Add osmo_dump_gsmtime In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 07:44:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 07:44:13 +0000 Subject: [MERGED] libosmocore[master]: gsm_utils: Add osmo_dump_gsmtime In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm_utils: Add osmo_dump_gsmtime ...................................................................... gsm_utils: Add osmo_dump_gsmtime Used by osmo-bts, moved from osmo-bts l1sap.c:dump_gsmtime. Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map 3 files changed, 15 insertions(+), 0 deletions(-) Approvals: dexter: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..a879d33 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -168,6 +168,9 @@ /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); +/* Returns static buffer with string representation of a GSM Time */ +char *osmo_dump_gsmtime(const struct gsm_time *tm); + /* GSM TS 03.03 Chapter 2.6 */ enum gprs_tlli_type { TLLI_LOCAL, diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..2c980d2 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -90,6 +90,7 @@ #include #include #include +#include #include "../../config.h" @@ -758,6 +759,16 @@ return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1)); } +char *osmo_dump_gsmtime(const struct gsm_time *tm) +{ + static char buf[64]; + + snprintf(buf, sizeof(buf), "%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8, + tm->fn, tm->t1, tm->t2, tm->t3, (uint8_t)tm->fn%52); + buf[sizeof(buf)-1] = '\0'; + return buf; +} + /*! append range1024 encoded data to bit vector * \param[out] bv Caller-provided output bit-vector * \param[in] r Input Range1024 sructure */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index e992a4f..ad7e013 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -274,6 +274,7 @@ gsm_fn2gsmtime; gsm_get_octet_len; gsm_gsmtime2fn; +osmo_dump_gsmtime; gsm_milenage; gsm_septet_encode; -- To view, visit https://gerrit.osmocom.org/3099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 10 07:44:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 07:44:43 +0000 Subject: [PATCH] libosmocore[master]: Add pseudo-random bit sequence generator to libosmcoore Message-ID: Review at https://gerrit.osmocom.org/3162 Add pseudo-random bit sequence generator to libosmcoore These PRBS sequences are specified in ITU-T O.150. They are typically used as test data to be transmitted for BER (bit error rate) testing. Change-Id: I227b6a6e86a251460ecb816afa9a7439d5fb94d1 --- M include/Makefile.am A include/osmocom/core/prbs.h M src/Makefile.am A src/prbs.c M tests/Makefile.am A tests/prbs/prbs_test.c A tests/prbs/prbs_test.ok M tests/testsuite.at 8 files changed, 172 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/3162/1 diff --git a/include/Makefile.am b/include/Makefile.am index e0c1a2b..4e92d55 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -31,6 +31,7 @@ osmocom/core/macaddr.h \ osmocom/core/msgb.h \ osmocom/core/panic.h \ + osmocom/core/prbs.h \ osmocom/core/prim.h \ osmocom/core/process.h \ osmocom/core/rate_ctr.h \ diff --git a/include/osmocom/core/prbs.h b/include/osmocom/core/prbs.h new file mode 100644 index 0000000..aaca17d --- /dev/null +++ b/include/osmocom/core/prbs.h @@ -0,0 +1,25 @@ +#pragma once +#include +#include + +/*! \brief definition of a PRBS sequence */ +struct osmo_prbs { + const char *name; /*!< human-readable name */ + unsigned int len; /*!< length in bits */ + uint64_t coeff; /*!< coefficients */ +}; + +/*! \brief state of a given PRBS sequence generator */ +struct osmo_prbs_state { + const struct osmo_prbs *prbs; + uint64_t state; +}; + +extern const struct osmo_prbs osmo_prbs7; +extern const struct osmo_prbs osmo_prbs9; +extern const struct osmo_prbs osmo_prbs11; +extern const struct osmo_prbs osmo_prbs15; + +void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs); +ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state); +int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state); diff --git a/src/Makefile.am b/src/Makefile.am index d8fceca..8e7ef4b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,7 +21,7 @@ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ - conv_acc.c conv_acc_generic.c sercomm.c + conv_acc.c conv_acc_generic.c sercomm.c prbs.c if HAVE_SSE3 libosmocore_la_SOURCES += conv_acc_sse.c diff --git a/src/prbs.c b/src/prbs.c new file mode 100644 index 0000000..be52fd4 --- /dev/null +++ b/src/prbs.c @@ -0,0 +1,74 @@ +/* Osmocom implementation of pseudo-random bit sequence generation */ +/* (C) 2017 by Harald Welte */ + +#include +#include +#include +#include + +/*! \brief PRBS-7 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs7 = { + /* x^7 + x^6 + 1 */ + .name = "PRBS-7", + .len = 7, + .coeff = (1<<6) | (1<<5), +}; + +/*! \brief PRBS-9 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs9 = { + /* x^9 + x^5 + 1 */ + .name = "PRBS-9", + .len = 9, + .coeff = (1<<8) | (1<<4), +}; + +/*! \brief PRBS-11 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs11 = { + /* x^11 + x^9 + 1 */ + .name = "PRBS-11", + .len = 11, + .coeff = (1<<10) | (1<<8), +}; + +/*! \brief PRBS-15 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs15 = { + /* x^15 + x^14+ 1 */ + .name = "PRBS-15", + .len = 15, + .coeff = (1<<14) | (1<<13), +}; + +/*! \brief Initialize the given caller-allocated PRBS state */ +void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs) +{ + memset(st, 0, sizeof(*st)); + st->prbs = prbs; + st->state = 1; +} + +static void osmo_prbs_process_bit(struct osmo_prbs_state *state, ubit_t bit) +{ + state->state >>= 1; + if (bit) + state->state ^= state->prbs->coeff; +} + +/*! \brief Get the next bit out of given PRBS instance */ +ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state) +{ + ubit_t result = state->state & 0x1; + osmo_prbs_process_bit(state, result); + + return result; +} + +/*! \brief Fill buffer of unpacked bits with next bits out of given PRBS instance */ +int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state) +{ + unsigned int i; + + for (i = 0; i < out_len; i++) + out[i] = osmo_prbs_get_ubit(state); + + return i; +} diff --git a/tests/Makefile.am b/tests/Makefile.am index 158c37e..37378fb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test + stats/stats_test prbs/prbs_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -183,6 +183,9 @@ sercomm_sercomm_test_SOURCES = sercomm/sercomm_test.c sercomm_sercomm_test_LDADD = $(top_builddir)/src/libosmocore.la +prbs_prbs_test_SOURCES = prbs/prbs_test.c +prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -226,7 +229,7 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/prbs/prbs_test.c b/tests/prbs/prbs_test.c new file mode 100644 index 0000000..bfe3526 --- /dev/null +++ b/tests/prbs/prbs_test.c @@ -0,0 +1,44 @@ +#include +#include +#include + +static void dump_bits(const ubit_t *bits, unsigned int num_bits) +{ + unsigned int i; + + for (i = 0; i < num_bits; i++) { + if (bits[i]) + fputc('1', stdout); + else + fputc('0', stdout); + } + fputc('\n',stdout); +} + +static void test_prbs(const struct osmo_prbs *prbs) +{ + struct osmo_prbs_state st; + unsigned int i; + + printf("Testing PRBS sequence generation '%s'\n", prbs->name); + osmo_prbs_state_init(&st, prbs); + + /* 2 lines */ + for (i = 0; i < 2; i++) { + unsigned int seq_len = (1 << prbs->len)-1; + ubit_t bits[seq_len]; + memset(bits, 0, sizeof(bits)); + osmo_prbs_get_ubits(bits, sizeof(bits), &st); + dump_bits(bits, sizeof(bits)); + } + + printf("\n"); +} + +int main(int argc, char **argv) +{ + test_prbs(&osmo_prbs7); + test_prbs(&osmo_prbs9); + test_prbs(&osmo_prbs11); + test_prbs(&osmo_prbs15); +} diff --git a/tests/prbs/prbs_test.ok b/tests/prbs/prbs_test.ok new file mode 100644 index 0000000..e0c587c --- /dev/null +++ b/tests/prbs/prbs_test.ok @@ -0,0 +1,16 @@ +Testing PRBS sequence generation 'PRBS-7' +1000001100001010001111001000101100111010100111110100001110001001001101101011011110110001101001011101110011001010101111111000000 +1000001100001010001111001000101100111010100111110100001110001001001101101011011110110001101001011101110011001010101111111000000 + +Testing PRBS sequence generation 'PRBS-9' +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 + +Testing PRBS sequence generation 'PRBS-11' +1000000001010000001000100001010101001000000011010000011100100011011101011101010001010000101000100100010101101010000110000100111100101110011100101111011100100101011101100001010111001000010111010010010100110110001111011101100101010111100000010011000010111110010010001110110101101011000110001110111101101010010110000110011100111111011110000101001100100011111101011000010001110010101101110000110101100111000111110110110001011011101001101010011110000111001100110111111111010000000100100000101101000100110010101111110000100001100101001111100011100011011011011101101101010110110000011011100011101011011010001101100101110111100101010011100000111011000110101110111000101010110100000011001000011111010011000100111110101110001000101101010100110000001111100001100011001111011111100101000011100010011011010111101100010010111010110010100011110001011001101001111110011100001111011001100101111111100100000011101000011010010011100110111011111010101000100000010101000010000010010100010110001010011101000111010010110100110011001111111111100000000011000000011110000011001100011111111011000000101110000100101100101100111100111110011110001111001101100111110111110001010001101000101110010100101110001100101101111100110100011111001011000111001110110111101011010010001100110101111111000100000110101000111000010110110010011011110111101001010010011000110111110111010001010100101000001100010001111010101100100000111101000110010010111110110010001011110101001001000011011010011101100111010111110100010001001010101011000000001110000001101100001110111001101010111110000010001100010101111010000100100100101101101100110110111111011010000101100100100111101101110010110101110011000101111110100100001001101001011110011001001111111011100000101011000100001110101001101000011110010011001110111111101010000010000100010100101010001100000101111000100100110101101111000110100110111001111010111100100010011101010111010000010100100010001101010101110000000101100000100111000101110110100101011001100001111111001100000111111000110000110111100111010011110100111001001110111011101010101010000000000 +1000000001010000001000100001010101001000000011010000011100100011011101011101010001010000101000100100010101101010000110000100111100101110011100101111011100100101011101100001010111001000010111010010010100110110001111011101100101010111100000010011000010111110010010001110110101101011000110001110111101101010010110000110011100111111011110000101001100100011111101011000010001110010101101110000110101100111000111110110110001011011101001101010011110000111001100110111111111010000000100100000101101000100110010101111110000100001100101001111100011100011011011011101101101010110110000011011100011101011011010001101100101110111100101010011100000111011000110101110111000101010110100000011001000011111010011000100111110101110001000101101010100110000001111100001100011001111011111100101000011100010011011010111101100010010111010110010100011110001011001101001111110011100001111011001100101111111100100000011101000011010010011100110111011111010101000100000010101000010000010010100010110001010011101000111010010110100110011001111111111100000000011000000011110000011001100011111111011000000101110000100101100101100111100111110011110001111001101100111110111110001010001101000101110010100101110001100101101111100110100011111001011000111001110110111101011010010001100110101111111000100000110101000111000010110110010011011110111101001010010011000110111110111010001010100101000001100010001111010101100100000111101000110010010111110110010001011110101001001000011011010011101100111010111110100010001001010101011000000001110000001101100001110111001101010111110000010001100010101111010000100100100101101101100110110111111011010000101100100100111101101110010110101110011000101111110100100001001101001011110011001001111111011100000101011000100001110101001101000011110010011001110111111101010000010000100010100101010001100000101111000100100110101101111000110100110111001111010111100100010011101010111010000010100100010001101010101110000000101100000100111000101110110100101011001100001111111001100000111111000110000110111100111010011110100111001001110111011101010101010000000000 + +Testing PRBS sequence generation 'PRBS-15' +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 + diff --git a/tests/testsuite.at b/tests/testsuite.at index 63027d9..f148cf5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -280,3 +280,9 @@ cat $abs_srcdir/sercomm/sercomm_test.ok > expout AT_CHECK([$abs_top_builddir/tests/sercomm/sercomm_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([prbs]) +AT_KEYWORDS([prbs]) +cat $abs_srcdir/prbs/prbs_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3162 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I227b6a6e86a251460ecb816afa9a7439d5fb94d1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 07:46:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 07:46:10 +0000 Subject: [PATCH] osmo-bts[master]: Allow passing low link quality buffers to upper layers In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3056 to look at the new patch set (#6). Allow passing low link quality buffers to upper layers We want to always call l1if_tch_rx and l1sap_up in order to avoid losing triggering events on the upper layer. With this change, the upper layer will increase correctly seq + ts for RTP. It will then send an RTP packet with only the header and no payload, which is not correct but at least we avoid drifting the RTP clock. Upcoming patch in the series solves this issue. This patch assumes that we are not lossing data events from the physical layer and that we receive an event every 20ms, even if the MS is not transmitting due to DTX. Depends on libosmocore If4ae20c22b881e94585dad710f17b9e37f77bf82 Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 --- M include/osmo-bts/l1sap.h M src/common/l1sap.c M src/common/pcu_sock.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-octphy/l1_tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 9 files changed, 49 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/3056/6 diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 6373ba8..4e9c9e2 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -85,7 +85,8 @@ extern uint8_t gsmtap_sapi_acch; int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, - struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn); + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn, + uint16_t ber10k, int16_t lqual_cb); #define msgb_l1sap_prim(msg) ((struct osmo_phsap_prim *)(msg)->l1h) diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 71690cd..b05ed72 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -135,11 +135,12 @@ } int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, - struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn) + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn, + uint16_t ber10k, int16_t lqual_cb) { struct osmo_phsap_prim *l1sap; - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", + LOGP(DL1P, LOGL_DEBUG, "%s Rx -> RTP: %s\n", gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); rmsg->l2h = rmsg->data; @@ -150,6 +151,8 @@ rmsg); l1sap->u.tch.chan_nr = chan_nr; l1sap->u.tch.fn = fn; + l1sap->u.tch.ber10k = ber10k; + l1sap->u.tch.lqual_cb = lqual_cb; return l1sap_up(trx, l1sap); } diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 2755048..a4ddc05 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -329,11 +330,18 @@ struct gsm_pcu_if *pcu_prim; struct gsm_pcu_if_data *data_ind; struct gsm_bts *bts = ts->trx->bts; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); LOGP(DPCU, LOGL_DEBUG, "Sending data indication: is_ptcch=%d arfcn=%d " "block=%d data=%s\n", is_ptcch, arfcn, block_nr, osmo_hexdump(data, len)); + if (lqual / 10 < btsb->min_qual_norm) { + LOGP(DPCU, LOGL_DEBUG, "Link quality %"PRId16" is below threshold %f, dropping packet\n", + lqual, btsb->min_qual_norm); + return 0; + } + msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_IND, bts->nr); if (!msg) return -ENOMEM; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index bd9e003..66aa21a 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -923,7 +923,6 @@ struct msgb *l1p_msg) { struct gsm_bts_trx *trx = lc15l1_hdl_trx(fl1); - struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); uint8_t chan_nr, link_id; struct osmo_phsap_prim *l1sap; uint32_t fn; @@ -943,12 +942,6 @@ link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, &data_ind->measParam, fn); - - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(lc15bts_l1sapi_names, data_ind->sapi), diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index a29733f..c61712f 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -369,9 +369,12 @@ return -EAGAIN; if (data_ind->msgUnitParam.u8Size < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; @@ -459,8 +462,9 @@ } if (rmsg) - return add_l1sap_header(trx, rmsg, lchan, chan_nr, - data_ind->u32Fn); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); return 0; diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 427acdf..5785b9a 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -1050,8 +1050,6 @@ process_meas_res(trx, chan_nr, fn, data_ind->Data.ulDataLength, &data_ind->MeasurementInfo); - /* FIXME: check min_qual_norm! */ - DEBUGP(DL1C, "Rx PH-DATA.ind %s: %s data_len:%d \n", get_value_string(octphy_l1sapi_names, sapi), osmo_hexdump(data_ind->Data.abyDataContent, diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index 79bf245..38fb9fb 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -188,16 +188,25 @@ uint32_t payload_type = data_ind->Data.ulPayloadType; uint8_t *payload = data_ind->Data.abyDataContent; + uint16_t b_total = data_ind->MeasurementInfo.usBERTotalBitCnt; + uint16_t b_error = data_ind->MeasurementInfo.usBERCnt; + uint16_t ber10k = b_total ? BER_10K * b_error / b_total : 0; + int16_t lqual_cb = 0; /* FIXME: check min_qual_norm! */ + uint8_t payload_len; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; if (data_ind->Data.ulDataLength < 1) { - LOGP(DL1C, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->Data.ulFrameNumber, + ber10k, lqual_cb); } + payload_len = data_ind->Data.ulDataLength; switch (payload_type) { @@ -255,7 +264,8 @@ if (rmsg) return add_l1sap_header(trx, rmsg, lchan, chan_nr, - data_ind->Data.ulFrameNumber); + data_ind->Data.ulFrameNumber, + ber10k, lqual_cb); return 0; diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 05805b8..72d64ea 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -918,7 +918,6 @@ struct msgb *l1p_msg) { struct gsm_bts_trx *trx = femtol1_hdl_trx(fl1); - struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); uint8_t chan_nr, link_id; struct msgb *sap_msg; struct osmo_phsap_prim *l1sap; @@ -937,12 +936,6 @@ link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, &data_ind->measParam); - - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(femtobts_l1sapi_names, data_ind->sapi), @@ -969,7 +962,7 @@ l1sap->u.data.chan_nr = chan_nr; l1sap->u.data.fn = fn; l1sap->u.data.rssi = (int8_t) (data_ind->measParam.fRssi); - if (!pcu_direct) { + if (!pcu_direct) { /* FIXME: if pcu_direct=1, then this is not set, what to do in pcu_tx_data_ind() in this case ?*/ l1sap->u.data.ber10k = data_ind->measParam.fBer * 10000; l1sap->u.data.ta_offs_qbits = data_ind->measParam.i16BurstTiming; l1sap->u.data.lqual_cb = data_ind->measParam.fLinkQuality * 10; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 6333d19..b65628f 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -514,9 +514,12 @@ return -EAGAIN; if (data_ind->msgUnitParam.u8Size < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; @@ -605,11 +608,13 @@ return 0; rmsg = l1_to_rtppayload_amr(sid_first, len, lchan); break; + /* FIXME: what about GsmL1_TchPlType_Amr_SidBad? not well documented. */ } if (rmsg) - return add_l1sap_header(trx, rmsg, lchan, chan_nr, - data_ind->u32Fn); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); return 0; -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 6 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 Jul 10 07:53:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 07:53:29 +0000 Subject: osmo-bts[master]: Allow passing low link quality buffers to upper layers In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 6 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 Jul 10 08:24:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 08:24:41 +0000 Subject: [MERGED] osmo-bts[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore Change-Id: Ib8efd2095fcf759276299b516d495219105c1f2b Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 5598c4a..0f85151 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,3 +14,5 @@ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmobts-mgr.cfg \ README.md + + at RELMAKE@ diff --git a/configure.ac b/configure.ac index b848605..b2700d5 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8efd2095fcf759276299b516d495219105c1f2b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jul 10 08:37:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 08:37:11 +0000 Subject: libosmo-abis[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: > bumped the SOVERSION of libosmocore You mean *_LIBVERSION? > Will your script point out that configure.ac needs to update the min version? You mean to update "PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0)" entry? No, moreover, I'm not quite sure how this can be automated at all. Any advices would be greatly appreciated. > I think bumping the minversion at release time is the right time That's possible with the current implementation but not enforced. I'd like to leave that decision with the person making the release: the intention is not to make 100% non-interactive release procedure - just to make it easier by automating repetitive steps. -- To view, visit https://gerrit.osmocom.org/3131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 08:41:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 08:41:30 +0000 Subject: libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/3130/7/osmo-release.mk File osmo-release.mk: Line 21: @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" > Instewad of printing text no-one will read. Fail? What exactly should we check for in this case? The LIBVERSION might have been bumped in one of the previous commits. LIBVERSION for different parts might have been bumped over several commits. The commit messages have arbitrary format. I'd love to automate that too but right now I'm not sure how this can be done reliably. Any ideas? -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 10 08:43:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 08:43:58 +0000 Subject: osmo-bts[master]: l1sap.c: fn_ms_adj: Add err logging and always return GSM_RT... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 08:44:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 08:44:03 +0000 Subject: [MERGED] osmo-bts[master]: l1sap.c: fn_ms_adj: Add err logging and always return GSM_RT... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION ...................................................................... l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION After latest changes, l2 expects to receive an event for every TCH frame, that is, no TCH frame event should be lost on that layer. We should now then be safe returning always GSM_RTP_DURATION. The code which used to calculate the variable duration is left there to assert that indeed we are not longer having this kind of issues. Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 --- M src/common/l1sap.c 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index bb27457..3f9da4f 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -87,10 +88,6 @@ { uint32_t samples_passed, r; - /* don't adjust duration when DTX is not enabled */ - if (lchan->ts->trx->bts->dtxu == GSM48_DTX_SHALL_NOT_BE_USED) - return GSM_RTP_DURATION; - if (lchan->tch.last_fn != LCHAN_FN_DUMMY) { /* 12/13 frames usable for audio in TCH, 160 samples per RTP packet, @@ -100,7 +97,11 @@ GSM_RTP_DURATION */ r = samples_passed + GSM_RTP_DURATION / 2; r -= r % GSM_RTP_DURATION; - return r; + + if (r != GSM_RTP_DURATION) + LOGP(DL1P, LOGL_ERROR, "RTP clock out of sync with lower layer:" + " %"PRIu32" vs %d (%"PRIu32"->%"PRIu32")\n", + r, GSM_RTP_DURATION, lchan->tch.last_fn, fn); } return GSM_RTP_DURATION; } -- To view, visit https://gerrit.osmocom.org/3084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 10 08:44:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 08:44:03 +0000 Subject: [MERGED] osmo-bts[master]: l1sap.c: Avoid sending RTP frame with empty payload In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: l1sap.c: Avoid sending RTP frame with empty payload ...................................................................... l1sap.c: Avoid sending RTP frame with empty payload Depends on libosmo-abis Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc --- M src/common/l1sap.c 1 file changed, 26 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index b05ed72..bb27457 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1061,6 +1061,7 @@ struct gsm_lchan *lchan; uint8_t chan_nr; uint32_t fn; + struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); chan_nr = tch_ind->chan_nr; fn = tch_ind->fn; @@ -1076,22 +1077,33 @@ msgb_pull(msg, sizeof(*l1sap)); - /* hand msg to RTP code for transmission */ - if (lchan->abis_ip.rtp_socket) - osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, - msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); - - /* if loopback is enabled, also queue received RTP data */ - if (lchan->loopback) { - /* make sure the queue doesn't get too long */ - queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); - /* add new frame to queue */ - msgb_enqueue(&lchan->dl_tch_queue, msg); - /* Return 1 to signal that we're still using msg and it should not be freed */ - return 1; + /* Low level layers always call us when TCH content is expected, even if + * the content is not available due to decoding issues. Content not + * available is expected as empty payload. We also check if quality is + * good enough. */ + if (msg->len && tch_ind->lqual_cb / 10 >= btsb->min_qual_norm) { + /* hand msg to RTP code for transmission */ + if (lchan->abis_ip.rtp_socket) + osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, + msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); + /* if loopback is enabled, also queue received RTP data */ + if (lchan->loopback) { + /* make sure the queue doesn't get too long */ + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); + /* add new frame to queue */ + msgb_enqueue(&lchan->dl_tch_queue, msg); + /* Return 1 to signal that we're still using msg and it should not be freed */ + return 1; + } + /* Only clear the marker bit once we have sent a RTP packet with it */ + lchan->rtp_tx_marker = false; + } else { + DEBUGP(DL1P, "Skipping RTP frame with lost payload\n"); + if (lchan->abis_ip.rtp_socket) + osmo_rtp_skipped_frame(lchan->abis_ip.rtp_socket, fn_ms_adj(fn, lchan)); + lchan->rtp_tx_marker = true; } - lchan->rtp_tx_marker = false; lchan->tch.last_fn = fn; return 0; } -- To view, visit https://gerrit.osmocom.org/3071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc Gerrit-PatchSet: 8 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 Mon Jul 10 08:44:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 08:44:04 +0000 Subject: [MERGED] osmo-bts[master]: Move dump_gsmtime to libosmocore as osmo_dump_gsmtime In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Move dump_gsmtime to libosmocore as osmo_dump_gsmtime ...................................................................... Move dump_gsmtime to libosmocore as osmo_dump_gsmtime Internal l1sap dump_gsmtime has been moved to libosmocore as osmo_dump_gsmtime. Remove use of internal function and replace with the libosmocore version. Depends on libosmocore Ib5452e2c20f53006c0f6d197fb055728947125d8 Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66 --- M src/common/l1sap.c 1 file changed, 4 insertions(+), 13 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 3f9da4f..f487d77 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -51,16 +52,6 @@ #include #include #include - -static char *dump_gsmtime(const struct gsm_time *tm) -{ - static char buf[64]; - - snprintf(buf, sizeof(buf), "%06u/%02u/%02u/%02u/%02u", - tm->fn, tm->t1, tm->t2, tm->t3, tm->fn%52); - buf[sizeof(buf)-1] = '\0'; - return buf; -} struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) @@ -627,13 +618,13 @@ loop_msg = msgb_dequeue(&lchan->dl_tch_queue); if (!loop_msg) { LOGP(DL1P, LOGL_NOTICE, "%s %s: no looped PDTCH message, sending empty\n", - gsm_lchan_name(lchan), dump_gsmtime(tm)); + gsm_lchan_name(lchan), osmo_dump_gsmtime(tm)); /* empty downlink message */ p = msgb_put(msg, GSM_MACBLOCK_LEN); memset(p, 0, GSM_MACBLOCK_LEN); } else { LOGP(DL1P, LOGL_NOTICE, "%s %s: looped PDTCH message of %u bytes\n", - gsm_lchan_name(lchan), dump_gsmtime(tm), msgb_l2len(loop_msg)); + gsm_lchan_name(lchan), osmo_dump_gsmtime(tm), msgb_l2len(loop_msg)); /* copy over data from queued response message */ p = msgb_put(msg, msgb_l2len(loop_msg)); memcpy(p, msgb_l2(loop_msg), msgb_l2len(loop_msg)); @@ -666,7 +657,7 @@ gsm_fn2gsmtime(&g_time, fn); DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=%d link_id=%d\n", - dump_gsmtime(&g_time), chan_nr, link_id); + osmo_dump_gsmtime(&g_time), chan_nr, link_id); /* reuse PH-RTS.ind for PH-DATA.req */ if (!msg) { -- To view, visit https://gerrit.osmocom.org/3100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 10 08:44:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 08:44:04 +0000 Subject: [MERGED] osmo-bts[master]: Use osmo_dump_gsmtime to log fn across different layers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use osmo_dump_gsmtime to log fn across different layers ...................................................................... Use osmo_dump_gsmtime to log fn across different layers This commit also fixes a missing end of line in the log output of handle_ph_data_ind Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 --- M src/common/l1sap.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 17 insertions(+), 13 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 f487d77..b6fcad3 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -798,8 +798,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH-RTS.ind %02u/%02u/%02u chan_nr=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) @@ -955,8 +954,8 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-DATA.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); + DEBUGP(DL1P, "Rx PH-DATA.ind %s chan_nr=%d link_id=%d\n", + osmo_dump_gsmtime(&g_time), chan_nr, link_id); if (ts_is_pdch(&trx->ts[tn])) { lchan = get_lchan_by_chan_nr(trx, chan_nr); @@ -1060,8 +1059,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH.ind %02u/%02u/%02u chan_nr=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) @@ -1212,9 +1210,9 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "TX packet data %02u/%02u/%02u is_ptcch=%d trx=%d ts=%d " - "block_nr=%d, arfcn=%d, len=%d\n", g_time.t1, g_time.t2, - g_time.t3, is_ptcch, ts->trx->nr, ts->nr, block_nr, arfcn, len); + DEBUGP(DL1P, "TX packet data %s is_ptcch=%d trx=%d ts=%d " + "block_nr=%d, arfcn=%d, len=%d\n", osmo_dump_gsmtime(&g_time), + is_ptcch, ts->trx->nr, ts->nr, block_nr, arfcn, len); msg = l1sap_msgb_alloc(len); l1sap = msgb_l1sap_prim(msg); diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 66aa21a..b82a7c6 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -926,6 +926,7 @@ uint8_t chan_nr, link_id; struct osmo_phsap_prim *l1sap; uint32_t fn; + struct gsm_time g_time; uint8_t *data, len; int rc = 0; int8_t rssi; @@ -943,9 +944,11 @@ process_meas_res(trx, chan_nr, &data_ind->measParam, fn); - DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", + gsm_fn2gsmtime(&g_time, fn); + + DEBUGP(DL1P, "Rx PH-DATA.ind %s %s (hL2 %08x): %s\n", get_value_string(lc15bts_l1sapi_names, data_ind->sapi), - (uint32_t)data_ind->hLayer2, + osmo_dump_gsmtime(&g_time), (uint32_t)data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); dump_meas_res(LOGL_DEBUG, &data_ind->measParam); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 72d64ea..94fb679 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -922,6 +922,7 @@ struct msgb *sap_msg; struct osmo_phsap_prim *l1sap; uint32_t fn; + struct gsm_time g_time; int rc = 0; chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, @@ -937,9 +938,11 @@ process_meas_res(trx, chan_nr, &data_ind->measParam); - DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", + gsm_fn2gsmtime(&g_time, fn); + + DEBUGP(DL1P, "Rx PH-DATA.ind %s %s (hL2 %08x): %s\n", get_value_string(femtobts_l1sapi_names, data_ind->sapi), - data_ind->hLayer2, + osmo_dump_gsmtime(&g_time), data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); dump_meas_res(LOGL_DEBUG, &data_ind->measParam); -- To view, visit https://gerrit.osmocom.org/3098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 08:44:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 08:44:04 +0000 Subject: [MERGED] osmo-bts[master]: Allow passing low link quality buffers to upper layers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Allow passing low link quality buffers to upper layers ...................................................................... Allow passing low link quality buffers to upper layers We want to always call l1if_tch_rx and l1sap_up in order to avoid losing triggering events on the upper layer. With this change, the upper layer will increase correctly seq + ts for RTP. It will then send an RTP packet with only the header and no payload, which is not correct but at least we avoid drifting the RTP clock. Upcoming patch in the series solves this issue. This patch assumes that we are not lossing data events from the physical layer and that we receive an event every 20ms, even if the MS is not transmitting due to DTX. Depends on libosmocore If4ae20c22b881e94585dad710f17b9e37f77bf82 Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 --- M include/osmo-bts/l1sap.h M src/common/l1sap.c M src/common/pcu_sock.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-octphy/l1_tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 9 files changed, 49 insertions(+), 34 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 6373ba8..4e9c9e2 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -85,7 +85,8 @@ extern uint8_t gsmtap_sapi_acch; int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, - struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn); + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn, + uint16_t ber10k, int16_t lqual_cb); #define msgb_l1sap_prim(msg) ((struct osmo_phsap_prim *)(msg)->l1h) diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 71690cd..b05ed72 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -135,11 +135,12 @@ } int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, - struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn) + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn, + uint16_t ber10k, int16_t lqual_cb) { struct osmo_phsap_prim *l1sap; - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", + LOGP(DL1P, LOGL_DEBUG, "%s Rx -> RTP: %s\n", gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); rmsg->l2h = rmsg->data; @@ -150,6 +151,8 @@ rmsg); l1sap->u.tch.chan_nr = chan_nr; l1sap->u.tch.fn = fn; + l1sap->u.tch.ber10k = ber10k; + l1sap->u.tch.lqual_cb = lqual_cb; return l1sap_up(trx, l1sap); } diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 2755048..a4ddc05 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -329,11 +330,18 @@ struct gsm_pcu_if *pcu_prim; struct gsm_pcu_if_data *data_ind; struct gsm_bts *bts = ts->trx->bts; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); LOGP(DPCU, LOGL_DEBUG, "Sending data indication: is_ptcch=%d arfcn=%d " "block=%d data=%s\n", is_ptcch, arfcn, block_nr, osmo_hexdump(data, len)); + if (lqual / 10 < btsb->min_qual_norm) { + LOGP(DPCU, LOGL_DEBUG, "Link quality %"PRId16" is below threshold %f, dropping packet\n", + lqual, btsb->min_qual_norm); + return 0; + } + msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_IND, bts->nr); if (!msg) return -ENOMEM; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index bd9e003..66aa21a 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -923,7 +923,6 @@ struct msgb *l1p_msg) { struct gsm_bts_trx *trx = lc15l1_hdl_trx(fl1); - struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); uint8_t chan_nr, link_id; struct osmo_phsap_prim *l1sap; uint32_t fn; @@ -943,12 +942,6 @@ link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, &data_ind->measParam, fn); - - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(lc15bts_l1sapi_names, data_ind->sapi), diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index a29733f..c61712f 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -369,9 +369,12 @@ return -EAGAIN; if (data_ind->msgUnitParam.u8Size < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; @@ -459,8 +462,9 @@ } if (rmsg) - return add_l1sap_header(trx, rmsg, lchan, chan_nr, - data_ind->u32Fn); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); return 0; diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 427acdf..5785b9a 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -1050,8 +1050,6 @@ process_meas_res(trx, chan_nr, fn, data_ind->Data.ulDataLength, &data_ind->MeasurementInfo); - /* FIXME: check min_qual_norm! */ - DEBUGP(DL1C, "Rx PH-DATA.ind %s: %s data_len:%d \n", get_value_string(octphy_l1sapi_names, sapi), osmo_hexdump(data_ind->Data.abyDataContent, diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index 79bf245..38fb9fb 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -188,16 +188,25 @@ uint32_t payload_type = data_ind->Data.ulPayloadType; uint8_t *payload = data_ind->Data.abyDataContent; + uint16_t b_total = data_ind->MeasurementInfo.usBERTotalBitCnt; + uint16_t b_error = data_ind->MeasurementInfo.usBERCnt; + uint16_t ber10k = b_total ? BER_10K * b_error / b_total : 0; + int16_t lqual_cb = 0; /* FIXME: check min_qual_norm! */ + uint8_t payload_len; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; if (data_ind->Data.ulDataLength < 1) { - LOGP(DL1C, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->Data.ulFrameNumber, + ber10k, lqual_cb); } + payload_len = data_ind->Data.ulDataLength; switch (payload_type) { @@ -255,7 +264,8 @@ if (rmsg) return add_l1sap_header(trx, rmsg, lchan, chan_nr, - data_ind->Data.ulFrameNumber); + data_ind->Data.ulFrameNumber, + ber10k, lqual_cb); return 0; diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 05805b8..72d64ea 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -918,7 +918,6 @@ struct msgb *l1p_msg) { struct gsm_bts_trx *trx = femtol1_hdl_trx(fl1); - struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); uint8_t chan_nr, link_id; struct msgb *sap_msg; struct osmo_phsap_prim *l1sap; @@ -937,12 +936,6 @@ link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, &data_ind->measParam); - - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(femtobts_l1sapi_names, data_ind->sapi), @@ -969,7 +962,7 @@ l1sap->u.data.chan_nr = chan_nr; l1sap->u.data.fn = fn; l1sap->u.data.rssi = (int8_t) (data_ind->measParam.fRssi); - if (!pcu_direct) { + if (!pcu_direct) { /* FIXME: if pcu_direct=1, then this is not set, what to do in pcu_tx_data_ind() in this case ?*/ l1sap->u.data.ber10k = data_ind->measParam.fBer * 10000; l1sap->u.data.ta_offs_qbits = data_ind->measParam.i16BurstTiming; l1sap->u.data.lqual_cb = data_ind->measParam.fLinkQuality * 10; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 6333d19..b65628f 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -514,9 +514,12 @@ return -EAGAIN; if (data_ind->msgUnitParam.u8Size < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; @@ -605,11 +608,13 @@ return 0; rmsg = l1_to_rtppayload_amr(sid_first, len, lchan); break; + /* FIXME: what about GsmL1_TchPlType_Amr_SidBad? not well documented. */ } if (rmsg) - return add_l1sap_header(trx, rmsg, lchan, chan_nr, - data_ind->u32Fn); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); return 0; -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 7 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 Jul 10 08:45:41 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 08:45:41 +0000 Subject: [MERGED] osmo-bts[master]: octphy: do not send empty frames to phy In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: octphy: do not send empty frames to phy ...................................................................... octphy: do not send empty frames to phy ph_data_req() and ph_tch_req() are generating empty (idle) frames when no data (msg == NULL) is available. Since the phy is able to generate idle frames internally, there is no need to waste Host CPU cycles by doing this in software. Remove the empty frame generation and exit the function cleanly. (Patch by Octasic Inc.) Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838 --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 5 insertions(+), 34 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 5785b9a..740d808 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -536,22 +536,9 @@ mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD_SWAP(data_req); } else { - /* No data available, generate Empty frame Req in l1msg */ - tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *empty_frame_req = - (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *) - msgb_put(l1msg, sizeof(*empty_frame_req)); - - l1if_fill_msg_hdr(&empty_frame_req->Header, l1msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, - cOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CID); - - empty_frame_req->TrxId.byTrxId = pinst->u.octphy.trx_id; - empty_frame_req->LchId.byTimeslotNb = u8Tn; - empty_frame_req->LchId.bySAPI = sapi; - empty_frame_req->LchId.bySubChannelNb = subCh; - empty_frame_req->LchId.byDirection = cOCTVC1_GSM_DIRECTION_ENUM_TX_BTS_MS; - empty_frame_req->ulFrameNumber = u32Fn; - - mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD_SWAP(empty_frame_req); + /* No data available, Don't send Empty frame to PHY */ + rc = 0; + goto done; } rc = l1if_req_compl(fl1h, l1msg, NULL, NULL); @@ -618,24 +605,8 @@ mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD_SWAP(data_req); } else { - tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *empty_frame_req = - (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *) - msgb_put(nmsg, sizeof(*empty_frame_req)); - - mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD_DEF(empty_frame_req); - - l1if_fill_msg_hdr(&empty_frame_req->Header, nmsg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, - cOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CID); - - empty_frame_req->TrxId.byTrxId = pinst->u.octphy.trx_id; - empty_frame_req->LchId.byTimeslotNb = u8Tn; - empty_frame_req->LchId.bySAPI = sapi; - empty_frame_req->LchId.bySubChannelNb = subCh; - empty_frame_req->LchId.byDirection = - cOCTVC1_GSM_DIRECTION_ENUM_TX_BTS_MS; - empty_frame_req->ulFrameNumber = u32Fn; - - mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD_SWAP(empty_frame_req); + /* No data available, Don't send Empty frame to PHY */ + return 0; } return l1if_req_compl(fl1h, nmsg, NULL, NULL); -- To view, visit https://gerrit.osmocom.org/3060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 10 08:49:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 08:49:18 +0000 Subject: [PATCH] osmo-pcu[master]: Ignore test binaries using mask In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3153 to look at the new patch set (#2). Ignore test binaries using mask Change-Id: Ic7930c6e715447e91572f7ed6b0d2bb2238cf367 --- M .gitignore 1 file changed, 2 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/3153/2 diff --git a/.gitignore b/.gitignore index 234ef0b..24098d6 100644 --- a/.gitignore +++ b/.gitignore @@ -34,18 +34,11 @@ .dirstamp tests/atconfig tests/package.m4 -tests/alloc/AllocTest -tests/rlcmac/RLCMACTest -tests/tbf/TbfTest -tests/types/TypesTest -tests/ms/MsTest -tests/llist/LListTest -tests/codel/codel_test +tests/*/*Test +tests/*/*_test tests/emu/pcu_emu tests/testsuite tests/testsuite.log -tests/edge/EdgeTest -tests/llc/LlcTest # ignore debian files .tarball-version -- To view, visit https://gerrit.osmocom.org/3153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic7930c6e715447e91572f7ed6b0d2bb2238cf367 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 Jul 10 09:31:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 09:31:02 +0000 Subject: [PATCH] osmo-pcu[master]: Encapsulate handling of UL ACK timeout 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/3155 to look at the new patch set (#2). Encapsulate handling of UL ACK timeout Use helper methods instead checking and manipulating flag directly. Change-Id: Ia3f009c52118db95b38a077e08eecda844e7f8d1 Related: OS#1539 --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_ul.cpp 4 files changed, 39 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/55/3155/2 diff --git a/src/bts.cpp b/src/bts.cpp index 9847e9b..799188b 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -978,6 +978,7 @@ 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) @@ -1004,16 +1005,12 @@ tbf->poll_state = GPRS_RLCMAC_POLL_NONE; /* check if this control ack belongs to packet uplink ack */ - if (tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { + ul_tbf = as_ul_tbf(tbf); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { LOGP(DRLCMAC, LOGL_DEBUG, "TBF: [UPLINK] END %s\n", tbf_name(tbf)); - tbf->ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; - if ((tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink " - "ack for UL %s\n", tbf_name(tbf)); - } + if (ul_tbf->ctrl_ack_to_toggle()) + LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink ack for UL %s\n", tbf_name(tbf)); + tbf_free(tbf); return; } diff --git a/src/tbf.cpp b/src/tbf.cpp index 2e7c65b..fa67e41 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -607,27 +607,25 @@ void gprs_rlcmac_tbf::poll_timeout() { + gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); + LOGP(DRLCMAC, LOGL_NOTICE, "%s poll timeout for FN=%d, TS=%d (curr FN %d)\n", tbf_name(this), poll_fn, poll_ts, bts->current_frame_number()); poll_state = GPRS_RLCMAC_POLL_NONE; - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " - "PACKET CONTROL ACK for PACKET UPLINK ACK\n"); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { + if (!ul_tbf->ctrl_ack_to_toggle()) { + LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); } - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); bts->pkt_ul_ack_nack_poll_timedout(); if (state_is(GPRS_RLCMAC_FINISHED)) { - gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, - "- N3103 exceeded\n"); + "- N3103 exceeded\n"); bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); @@ -640,10 +638,10 @@ } else if (ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) { if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS))) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " - "PACKET CONTROL ACK for PACKET UPLINK " - "ASSIGNMENT.\n"); - rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); + "PACKET CONTROL ACK for PACKET UPLINK " + "ASSIGNMENT.\n"); + rlcmac_diag(); + state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; diff --git a/src/tbf.h b/src/tbf.h index 64cfa91..dba6dbd 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -502,6 +502,8 @@ gprs_rlcmac_ul_tbf(BTS *bts); struct msgb *create_ul_ack(uint32_t fn, uint8_t ts); + bool ctrl_ack_to_toggle(); + bool handle_ctrl_ack(); /* blocks were acked */ int rcv_data_block_acknowledged( diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1eee41a..1e0898a 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -95,6 +95,27 @@ return 0; } +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); + 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 */ +} + +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; + return true; + } + + return false; +} struct msgb *gprs_rlcmac_ul_tbf::create_ul_ack(uint32_t fn, uint8_t ts) { -- To view, visit https://gerrit.osmocom.org/3155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia3f009c52118db95b38a077e08eecda844e7f8d1 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 Jul 10 09:31:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 09:31:02 +0000 Subject: [PATCH] osmo-pcu[master]: Move common code 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/3156 to look at the new patch set (#3). Move common code into functions * separate channel request responder into inline function * move generic TBF poll check into inline function Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 Related: OS#1539 --- M src/bts.cpp 1 file changed, 36 insertions(+), 57 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/56/3156/3 diff --git a/src/bts.cpp b/src/bts.cpp index 799188b..21d5b17 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -360,39 +360,37 @@ return 0; } +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 + && tbf->poll_fn == fn && tbf->trx->trx_no == trx_no && tbf->poll_ts == ts) + return true; + + return false; +} + gprs_rlcmac_dl_tbf *BTS::dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) { - struct gprs_rlcmac_dl_tbf *tbf; LListHead *pos; /* only one TBF can poll on specific TS/FN, because scheduler can only * schedule one downlink control block (with polling) at a FN per TS */ llist_for_each(pos, &m_dl_tbfs) { - tbf = as_dl_tbf(pos->entry()); - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) - && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && tbf->poll_fn == fn && tbf->trx->trx_no == trx - && tbf->poll_ts == ts) { - return tbf; - } + if (tbf_check(pos->entry(), fn, trx, ts)) + return as_dl_tbf(pos->entry()); } return NULL; } + gprs_rlcmac_ul_tbf *BTS::ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) { - struct gprs_rlcmac_ul_tbf *tbf; LListHead *pos; /* only one TBF can poll on specific TS/FN, because scheduler can only * schedule one downlink control block (with polling) at a FN per TS */ llist_for_each(pos, &m_ul_tbfs) { - tbf = as_ul_tbf(pos->entry()); - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) - && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && tbf->poll_fn == fn && tbf->trx->trx_no == trx - && tbf->poll_ts == ts) { - return tbf; - } + if (tbf_check(pos->entry(), fn, trx, ts)) + return as_ul_tbf(pos->entry()); } return NULL; } @@ -1147,6 +1145,24 @@ } } +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->ul_ass_state = 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; + } +} + 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 */ @@ -1201,27 +1217,9 @@ return; } /* check for channel request */ - if (ack_nack->Exist_Channel_Request_Description) { + if (ack_nack->Exist_Channel_Request_Description) + sched_ul_ass_or_rej(bts(), bts_data(), 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->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we pacekt access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; - } - } /* get measurements */ if (tbf->ms()) { get_meas(&meas, &ack_nack->Channel_Quality_Report); @@ -1306,27 +1304,8 @@ } /* check for channel request */ - if (ack_nack->Exist_ChannelRequestDescription) { - - 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->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we send packet access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; - } - } + if (ack_nack->Exist_ChannelRequestDescription) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); /* get measurements */ if (tbf->ms()) { -- To view, visit https://gerrit.osmocom.org/3156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 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 Jul 10 09:31:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 09:31:02 +0000 Subject: [PATCH] osmo-pcu[master]: Move DL assignment to TBF-DL 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/3157 to look at the new patch set (#2). Move DL assignment to TBF-DL This function does not really belongs to BTS and it heavily relies on direct access to TBF-DL members anyway. Change-Id: I04584103018675a2f35cfb565473bfd81a208d7c Closes: OS#1540 --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp 5 files changed, 38 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/57/3157/2 diff --git a/src/bts.cpp b/src/bts.cpp index 21d5b17..5f7d9e8 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -768,40 +768,6 @@ return sb; } -/* depending on the current TBF, we assign on PACCH or AGCH */ -void BTS::trigger_dl_ass( - struct gprs_rlcmac_dl_tbf *dl_tbf, - struct gprs_rlcmac_tbf *old_tbf) -{ - /* stop pending timer */ - dl_tbf->stop_timer(); - - /* check for downlink tbf: */ - if (old_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "Send dowlink assignment on " - "PACCH, because %s exists\n", tbf_name(old_tbf)); - old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; - - old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); - - /* change state */ - dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - if (!(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); - /* start timer */ - tbf_timer_start(dl_tbf, 0, Tassign_pacch); - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "Send dowlink assignment for %s on PCH, no TBF exist (IMSI=%s)\n", tbf_name(dl_tbf), dl_tbf->imsi()); - dl_tbf->was_releasing = dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); - /* change state */ - dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); - /* send immediate assignment */ - dl_tbf->bts->snd_dl_ass(dl_tbf, 0, dl_tbf->imsi()); - dl_tbf->m_wait_confirm = 1; - } -} - void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi) { int plen; diff --git a/src/bts.h b/src/bts.h index 7983fa2..f742def 100644 --- a/src/bts.h +++ b/src/bts.h @@ -354,7 +354,6 @@ int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, enum ph_burst_type burst_type); - void trigger_dl_ass(gprs_rlcmac_dl_tbf *tbf, gprs_rlcmac_tbf *old_tbf); void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi); GprsMsStorage &ms_store(); @@ -478,7 +477,6 @@ /* list of downlink TBFs */ LListHead m_dl_tbfs; -private: /* disable copying to avoid slicing */ BTS(const BTS&); BTS& operator=(const BTS&); diff --git a/src/tbf.cpp b/src/tbf.cpp index fa67e41..b2acb11 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -992,7 +992,7 @@ dl_tbf->update(); - dl_tbf->bts->trigger_dl_ass(dl_tbf, dl_tbf); + dl_tbf->trigger_ass(dl_tbf); } else LOGP(DRLCMAC, LOGL_NOTICE, "%s Continue flow after " "IMM.ASS confirm\n", tbf_name(dl_tbf)); @@ -1280,7 +1280,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "%s Trigger downlink assignment on PACCH\n", tbf_name(this)); - bts->trigger_dl_ass(new_tbf, this); + new_tbf->trigger_ass(this); return 0; } diff --git a/src/tbf.h b/src/tbf.h index dba6dbd..cd8d694 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -423,6 +423,7 @@ 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); 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(); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index a894789..375d642 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -167,7 +167,7 @@ * we don't use old_downlink, so the possible uplink is used * to trigger downlink assignment. if there is no uplink, * AGCH is used. */ - dl_tbf->bts->trigger_dl_ass(dl_tbf, old_ul_tbf); + dl_tbf->trigger_ass(old_ul_tbf); *tbf = dl_tbf; return 0; } @@ -486,6 +486,40 @@ return create_dl_acked_block(fn, ts, bsn, bsn2); } +/* depending on the current TBF, we assign on PACCH or AGCH */ +void gprs_rlcmac_dl_tbf::trigger_ass(struct gprs_rlcmac_tbf *old_tbf) +{ + /* stop pending timer */ + stop_timer(); + + /* check for downlink tbf: */ + if (old_tbf) { + LOGP(DRLCMACDL, LOGL_DEBUG, "Send dowlink assignment on PACCH, because %s exists\n", tbf_name(old_tbf)); + old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + 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); + + /* start timer */ + tbf_timer_start(this, 0, Tassign_pacch); + } else { + LOGP(DRLCMACDL, LOGL_DEBUG, "Send dowlink assignment for %s on PCH, no TBF exist (IMSI=%s)\n", + tbf_name(this), imsi()); + was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); + + /* change state */ + set_state(GPRS_RLCMAC_ASSIGN); + state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + + /* send immediate assignment */ + bts->snd_dl_ass(this, 0, imsi()); + m_wait_confirm = 1; + } +} + void gprs_rlcmac_dl_tbf::schedule_next_frame() { struct msgb *msg; -- To view, visit https://gerrit.osmocom.org/3157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I04584103018675a2f35cfb565473bfd81a208d7c 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 Jul 10 09:32:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 09:32:20 +0000 Subject: osmo-pcu[master]: Ignore test binaries using mask In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic7930c6e715447e91572f7ed6b0d2bb2238cf367 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 Jul 10 09:32:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 09:32:22 +0000 Subject: [MERGED] osmo-pcu[master]: Ignore test binaries using mask In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Ignore test binaries using mask ...................................................................... Ignore test binaries using mask Change-Id: Ic7930c6e715447e91572f7ed6b0d2bb2238cf367 --- M .gitignore 1 file changed, 2 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 234ef0b..24098d6 100644 --- a/.gitignore +++ b/.gitignore @@ -34,18 +34,11 @@ .dirstamp tests/atconfig tests/package.m4 -tests/alloc/AllocTest -tests/rlcmac/RLCMACTest -tests/tbf/TbfTest -tests/types/TypesTest -tests/ms/MsTest -tests/llist/LListTest -tests/codel/codel_test +tests/*/*Test +tests/*/*_test tests/emu/pcu_emu tests/testsuite tests/testsuite.log -tests/edge/EdgeTest -tests/llc/LlcTest # ignore debian files .tarball-version -- To view, visit https://gerrit.osmocom.org/3153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic7930c6e715447e91572f7ed6b0d2bb2238cf367 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 Jul 10 09:33:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 09:33:33 +0000 Subject: [PATCH] libosmocore[master]: Add pseudo-random bit sequence generator to libosmcoore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3162 to look at the new patch set (#2). Add pseudo-random bit sequence generator to libosmcoore These PRBS sequences are specified in ITU-T O.150. They are typically used as test data to be transmitted for BER (bit error rate) testing. Change-Id: I227b6a6e86a251460ecb816afa9a7439d5fb94d1 --- M include/Makefile.am A include/osmocom/core/prbs.h M src/Makefile.am A src/prbs.c M tests/Makefile.am A tests/prbs/prbs_test.c A tests/prbs/prbs_test.ok M tests/testsuite.at 8 files changed, 174 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/3162/2 diff --git a/include/Makefile.am b/include/Makefile.am index e0c1a2b..4e92d55 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -31,6 +31,7 @@ osmocom/core/macaddr.h \ osmocom/core/msgb.h \ osmocom/core/panic.h \ + osmocom/core/prbs.h \ osmocom/core/prim.h \ osmocom/core/process.h \ osmocom/core/rate_ctr.h \ diff --git a/include/osmocom/core/prbs.h b/include/osmocom/core/prbs.h new file mode 100644 index 0000000..aaca17d --- /dev/null +++ b/include/osmocom/core/prbs.h @@ -0,0 +1,25 @@ +#pragma once +#include +#include + +/*! \brief definition of a PRBS sequence */ +struct osmo_prbs { + const char *name; /*!< human-readable name */ + unsigned int len; /*!< length in bits */ + uint64_t coeff; /*!< coefficients */ +}; + +/*! \brief state of a given PRBS sequence generator */ +struct osmo_prbs_state { + const struct osmo_prbs *prbs; + uint64_t state; +}; + +extern const struct osmo_prbs osmo_prbs7; +extern const struct osmo_prbs osmo_prbs9; +extern const struct osmo_prbs osmo_prbs11; +extern const struct osmo_prbs osmo_prbs15; + +void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs); +ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state); +int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state); diff --git a/src/Makefile.am b/src/Makefile.am index d8fceca..8e7ef4b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,7 +21,7 @@ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ - conv_acc.c conv_acc_generic.c sercomm.c + conv_acc.c conv_acc_generic.c sercomm.c prbs.c if HAVE_SSE3 libosmocore_la_SOURCES += conv_acc_sse.c diff --git a/src/prbs.c b/src/prbs.c new file mode 100644 index 0000000..be52fd4 --- /dev/null +++ b/src/prbs.c @@ -0,0 +1,74 @@ +/* Osmocom implementation of pseudo-random bit sequence generation */ +/* (C) 2017 by Harald Welte */ + +#include +#include +#include +#include + +/*! \brief PRBS-7 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs7 = { + /* x^7 + x^6 + 1 */ + .name = "PRBS-7", + .len = 7, + .coeff = (1<<6) | (1<<5), +}; + +/*! \brief PRBS-9 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs9 = { + /* x^9 + x^5 + 1 */ + .name = "PRBS-9", + .len = 9, + .coeff = (1<<8) | (1<<4), +}; + +/*! \brief PRBS-11 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs11 = { + /* x^11 + x^9 + 1 */ + .name = "PRBS-11", + .len = 11, + .coeff = (1<<10) | (1<<8), +}; + +/*! \brief PRBS-15 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs15 = { + /* x^15 + x^14+ 1 */ + .name = "PRBS-15", + .len = 15, + .coeff = (1<<14) | (1<<13), +}; + +/*! \brief Initialize the given caller-allocated PRBS state */ +void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs) +{ + memset(st, 0, sizeof(*st)); + st->prbs = prbs; + st->state = 1; +} + +static void osmo_prbs_process_bit(struct osmo_prbs_state *state, ubit_t bit) +{ + state->state >>= 1; + if (bit) + state->state ^= state->prbs->coeff; +} + +/*! \brief Get the next bit out of given PRBS instance */ +ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state) +{ + ubit_t result = state->state & 0x1; + osmo_prbs_process_bit(state, result); + + return result; +} + +/*! \brief Fill buffer of unpacked bits with next bits out of given PRBS instance */ +int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state) +{ + unsigned int i; + + for (i = 0; i < out_len; i++) + out[i] = osmo_prbs_get_ubit(state); + + return i; +} diff --git a/tests/Makefile.am b/tests/Makefile.am index 158c37e..37378fb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test + stats/stats_test prbs/prbs_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -183,6 +183,9 @@ sercomm_sercomm_test_SOURCES = sercomm/sercomm_test.c sercomm_sercomm_test_LDADD = $(top_builddir)/src/libosmocore.la +prbs_prbs_test_SOURCES = prbs/prbs_test.c +prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -226,7 +229,7 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/prbs/prbs_test.c b/tests/prbs/prbs_test.c new file mode 100644 index 0000000..b57401d --- /dev/null +++ b/tests/prbs/prbs_test.c @@ -0,0 +1,46 @@ +#include +#include +#include + +static void dump_bits(const ubit_t *bits, unsigned int num_bits) +{ + unsigned int i; + + for (i = 0; i < num_bits; i++) { + if (bits[i]) + fputc('1', stdout); + else + fputc('0', stdout); + } + fputc('\n',stdout); +} + +static void test_prbs(const struct osmo_prbs *prbs) +{ + struct osmo_prbs_state st; + unsigned int i; + + printf("Testing PRBS sequence generation '%s'\n", prbs->name); + osmo_prbs_state_init(&st, prbs); + + /* 2 lines */ + for (i = 0; i < 2; i++) { + unsigned int seq_len = (1 << prbs->len)-1; + ubit_t bits[seq_len]; + memset(bits, 0, sizeof(bits)); + osmo_prbs_get_ubits(bits, sizeof(bits), &st); + dump_bits(bits, sizeof(bits)); + } + + printf("\n"); +} + +int main(int argc, char **argv) +{ + test_prbs(&osmo_prbs7); + test_prbs(&osmo_prbs9); + test_prbs(&osmo_prbs11); + test_prbs(&osmo_prbs15); + + exit(0); +} diff --git a/tests/prbs/prbs_test.ok b/tests/prbs/prbs_test.ok new file mode 100644 index 0000000..e0c587c --- /dev/null +++ b/tests/prbs/prbs_test.ok @@ -0,0 +1,16 @@ +Testing PRBS sequence generation 'PRBS-7' +1000001100001010001111001000101100111010100111110100001110001001001101101011011110110001101001011101110011001010101111111000000 +1000001100001010001111001000101100111010100111110100001110001001001101101011011110110001101001011101110011001010101111111000000 + +Testing PRBS sequence generation 'PRBS-9' +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 + +Testing PRBS sequence generation 'PRBS-11' +1000000001010000001000100001010101001000000011010000011100100011011101011101010001010000101000100100010101101010000110000100111100101110011100101111011100100101011101100001010111001000010111010010010100110110001111011101100101010111100000010011000010111110010010001110110101101011000110001110111101101010010110000110011100111111011110000101001100100011111101011000010001110010101101110000110101100111000111110110110001011011101001101010011110000111001100110111111111010000000100100000101101000100110010101111110000100001100101001111100011100011011011011101101101010110110000011011100011101011011010001101100101110111100101010011100000111011000110101110111000101010110100000011001000011111010011000100111110101110001000101101010100110000001111100001100011001111011111100101000011100010011011010111101100010010111010110010100011110001011001101001111110011100001111011001100101111111100100000011101000011010010011100110111011111010101000100000010101000010000010010100010110001010011101000111010010110100110011001111111111100000000011000000011110000011001100011111111011000000101110000100101100101100111100111110011110001111001101100111110111110001010001101000101110010100101110001100101101111100110100011111001011000111001110110111101011010010001100110101111111000100000110101000111000010110110010011011110111101001010010011000110111110111010001010100101000001100010001111010101100100000111101000110010010111110110010001011110101001001000011011010011101100111010111110100010001001010101011000000001110000001101100001110111001101010111110000010001100010101111010000100100100101101101100110110111111011010000101100100100111101101110010110101110011000101111110100100001001101001011110011001001111111011100000101011000100001110101001101000011110010011001110111111101010000010000100010100101010001100000101111000100100110101101111000110100110111001111010111100100010011101010111010000010100100010001101010101110000000101100000100111000101110110100101011001100001111111001100000111111000110000110111100111010011110100111001001110111011101010101010000000000 +1000000001010000001000100001010101001000000011010000011100100011011101011101010001010000101000100100010101101010000110000100111100101110011100101111011100100101011101100001010111001000010111010010010100110110001111011101100101010111100000010011000010111110010010001110110101101011000110001110111101101010010110000110011100111111011110000101001100100011111101011000010001110010101101110000110101100111000111110110110001011011101001101010011110000111001100110111111111010000000100100000101101000100110010101111110000100001100101001111100011100011011011011101101101010110110000011011100011101011011010001101100101110111100101010011100000111011000110101110111000101010110100000011001000011111010011000100111110101110001000101101010100110000001111100001100011001111011111100101000011100010011011010111101100010010111010110010100011110001011001101001111110011100001111011001100101111111100100000011101000011010010011100110111011111010101000100000010101000010000010010100010110001010011101000111010010110100110011001111111111100000000011000000011110000011001100011111111011000000101110000100101100101100111100111110011110001111001101100111110111110001010001101000101110010100101110001100101101111100110100011111001011000111001110110111101011010010001100110101111111000100000110101000111000010110110010011011110111101001010010011000110111110111010001010100101000001100010001111010101100100000111101000110010010111110110010001011110101001001000011011010011101100111010111110100010001001010101011000000001110000001101100001110111001101010111110000010001100010101111010000100100100101101101100110110111111011010000101100100100111101101110010110101110011000101111110100100001001101001011110011001001111111011100000101011000100001110101001101000011110010011001110111111101010000010000100010100101010001100000101111000100100110101101111000110100110111001111010111100100010011101010111010000010100100010001101010101110000000101100000100111000101110110100101011001100001111111001100000111111000110000110111100111010011110100111001001110111011101010101010000000000 + +Testing PRBS sequence generation 'PRBS-15' +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 + diff --git a/tests/testsuite.at b/tests/testsuite.at index 63027d9..f148cf5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -280,3 +280,9 @@ cat $abs_srcdir/sercomm/sercomm_test.ok > expout AT_CHECK([$abs_top_builddir/tests/sercomm/sercomm_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([prbs]) +AT_KEYWORDS([prbs]) +cat $abs_srcdir/prbs/prbs_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3162 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I227b6a6e86a251460ecb816afa9a7439d5fb94d1 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 Mon Jul 10 09:34:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 09:34:32 +0000 Subject: [MERGED] osmo-trx[master]: LimeSDR: Change device detection to work with USB and PCIe v... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LimeSDR: Change device detection to work with USB and PCIe versions ...................................................................... LimeSDR: Change device detection to work with USB and PCIe versions Modified to match current master by Harald Welte. Change-Id: Ie43610de0b2196d84caf09717ec8c8ca75ab926d --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 9ab96f6..1ee4804 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -528,7 +528,7 @@ { "X310", { X3XX, TX_WINDOW_FIXED } }, { "USRP2", { USRP2, TX_WINDOW_FIXED } }, { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, - { "STREAM", { LIMESDR, TX_WINDOW_USRP1 } }, + { "LimeSDR", { LIMESDR, TX_WINDOW_USRP1 } }, }; // Compare UHD motherboard and device strings */ -- To view, visit https://gerrit.osmocom.org/3073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie43610de0b2196d84caf09717ec8c8ca75ab926d Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jul 10 09:37:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 09:37:33 +0000 Subject: [PATCH] libosmocore[master]: Ignore broken everything log 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/3148 to look at the new patch set (#3). Ignore broken everything log level * when reading config file (or vty command) ignore "logging level .. everything" level * when writing config file, skip "logging level .. everything" level In both cases print corresponding deprecation warning. The "everything" level is not working as advertised for quite some time anyway. This will allow us to gradually deprecate broken "everything" parameter giving users enough time to update their config files before removing it entirely. Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f Related: OS#71 --- M src/vty/logging_vty.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/3148/3 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 758f0b9..01480b1 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -213,6 +213,11 @@ return CMD_WARNING; } + if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */ + vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE); + return CMD_SUCCESS; + } + /* Check for special case where we want to set global log level */ if (!strcmp(argv[0], "all")) { log_set_log_level(tgt, level); @@ -730,8 +735,10 @@ osmo_str2lower(cat_lower, osmo_log_info->cat[i].name+1); osmo_str2lower(level_lower, log_level_str(cat->loglevel)); - vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, - VTY_NEWLINE); + if (strcmp(level_lower, "everything") != 0) /* FIXME: remove this check once 'everything' is phased out */ + vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE); + else + LOGP(DLSTATS, LOGL_ERROR, "logging level everything is deprecated and should not be used\n"); } /* FIXME: levels */ -- To view, visit https://gerrit.osmocom.org/3148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jul 10 09:39:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 09:39:53 +0000 Subject: [MERGED] osmo-pcu[master]: Remove TBF knowledge from rcv_control*dl_ack_nack In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove TBF knowledge from rcv_control*dl_ack_nack ...................................................................... Remove TBF knowledge from rcv_control*dl_ack_nack Do not access TBF internals directly from rcv_control*dl_ack_nack() - wrap corresponding code into TBF-DL method. Change-Id: I3d1b5782001e45617b4a960612fcfc249904b37c Related: OS#1539 --- M src/bts.cpp M src/tbf.h M src/tbf_dl.cpp 3 files changed, 34 insertions(+), 22 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 1d27284..5192646 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1175,17 +1175,11 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink ack " - "for %s\n", tbf_name(tbf)); - } - /* reset N3105 */ - tbf->n3105 = 0; - tbf->stop_t3191(); + + if (tbf->handle_ack_nack()) + LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink ack for %s\n", tbf_name(tbf)); + LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] %s Packet Downlink Ack/Nack\n", tbf_name(tbf)); - tbf->poll_state = GPRS_RLCMAC_POLL_NONE; bits.data = bits_data; bits.data_len = sizeof(bits_data); @@ -1263,19 +1257,13 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered EGPRS downlink ack " - "for %s\n", tbf_name(tbf)); - } - /* reset N3105 */ - tbf->n3105 = 0; - tbf->stop_t3191(); + + if (tbf->handle_ack_nack()) + LOGP(DRLCMAC, LOGL_NOTICE, "Recovered EGPRS downlink ack for %s\n", tbf_name(tbf)); + LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] %s EGPRS Packet Downlink Ack/Nack\n", tbf_name(tbf)); - tbf->poll_state = GPRS_RLCMAC_POLL_NONE; LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " diff --git a/src/tbf.h b/src/tbf.h index 09e3122..87aa7a5 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -424,6 +424,8 @@ 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); struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts); + void clear_poll_timeout_flag(); + bool handle_ack_nack(); void request_dl_ack(); bool need_control_ts() const; bool have_data() const; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 24c6385..a894789 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -609,6 +609,29 @@ 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(); + ack_recovered = true; + } + + /* reset N3105 */ + n3105 = 0; + stop_t3191(); + poll_state = GPRS_RLCMAC_POLL_NONE; + + return ack_recovered; +} + struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block( const uint32_t fn, const uint8_t ts, int index, int index2) @@ -807,8 +830,7 @@ if (is_final) tbf_timer_start(this, 3191, bts_data()->t3191, 0); - /* 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; -- To view, visit https://gerrit.osmocom.org/3154 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3d1b5782001e45617b4a960612fcfc249904b37c 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 Jul 10 09:42:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 09:42:06 +0000 Subject: [MERGED] osmo-trx[master]: LimeSDR: change tx window type to TX_WINDOW_FIXED In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LimeSDR: change tx window type to TX_WINDOW_FIXED ...................................................................... LimeSDR: change tx window type to TX_WINDOW_FIXED It seems that TX_WINDOW_USRP1 is for devices that do not support tx sync to timestamp. LimeSDR supports it. Changing to TX_WINDOW_FIXED greatly reduces number of "dumping stale buffer" messages Modified to match current master by Harald Welte. Change-Id: I8de5b165ccd72a62b0f16655618e24ca740d9637 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 1ee4804..a69d6c3 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -528,7 +528,7 @@ { "X310", { X3XX, TX_WINDOW_FIXED } }, { "USRP2", { USRP2, TX_WINDOW_FIXED } }, { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, - { "LimeSDR", { LIMESDR, TX_WINDOW_USRP1 } }, + { "LimeSDR", { LIMESDR, TX_WINDOW_FIXED } }, }; // Compare UHD motherboard and device strings */ -- To view, visit https://gerrit.osmocom.org/3074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8de5b165ccd72a62b0f16655618e24ca740d9637 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jul 10 09:46:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 09:46:07 +0000 Subject: [PATCH] osmo-trx[master]: LimeSDR: Fix sample value range In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3075 to look at the new patch set (#2). LimeSDR: Fix sample value range when "sc16" stream arg is passed to SoapyUHD sample value range is -32768 to 32767 Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/75/3075/2 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index a69d6c3..778c772 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -1185,7 +1185,7 @@ double uhd_device::fullScaleInputValue() { if (dev_type == LIMESDR) - return (double) 2047 * LIMESDR_TX_AMPL; + return (double) SHRT_MAX * LIMESDR_TX_AMPL; if (dev_type == UMTRX) return (double) SHRT_MAX * UMTRX_TX_AMPL; else @@ -1194,7 +1194,6 @@ double uhd_device::fullScaleOutputValue() { - if (dev_type == LIMESDR) return (double) 2047; return (double) SHRT_MAX; } -- To view, visit https://gerrit.osmocom.org/3075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jul 10 09:52:09 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 09:52:09 +0000 Subject: openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Patch Set 4: (2 comments) > Who called it with a NULL subscr? Do you think it is approriate to > call this function with a NULL subscriber? > > If nonnull attribute wouldn't influence the optimizer I would say > let's mark the parameter as non NULL. I am not entirely sure, subscr==NULL is definetly an exception. I will ask Mr. Bolsee for some background information on this patch. https://gerrit.osmocom.org/#/c/3127/3/openbsc/src/libmsc/transaction.c File openbsc/src/libmsc/transaction.c: Line 74: if (subscr == NULL) { > Is this normal? Should we log smth or caller takes care of it? Done https://gerrit.osmocom.org/#/c/3127/4/openbsc/src/libmsc/transaction.c File openbsc/src/libmsc/transaction.c: Line 75: DEBUGP(DCC, > I think this should be INFO or probably even NOTICE level, as it is not som Done -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 10 10:03:12 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 10:03:12 +0000 Subject: [PATCH] openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3127 to look at the new patch set (#5). transaction: reject calls from unidentified subscribers A valid subscriber is indespensible when allocating a new transaction. Return NULL if no subscriber is supplied. This will cause unidentified subscribers to be rejected. Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d --- M openbsc/src/libmsc/transaction.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/3127/5 diff --git a/openbsc/src/libmsc/transaction.c b/openbsc/src/libmsc/transaction.c index dba4bed..5580e63 100644 --- a/openbsc/src/libmsc/transaction.c +++ b/openbsc/src/libmsc/transaction.c @@ -70,6 +70,13 @@ DEBUGP(DCC, "subscr=%p, net=%p\n", subscr, net); + /* a valid subscriber is indispensable */ + if (subscr == NULL) { + DEBUGP(LOGL_NOTICE, + "unable to alloc transaction, invalid subscriber (NULL)\n"); + return NULL; + } + trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 10 10:09:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 10:09:00 +0000 Subject: openbsc[master]: Fix BTS attribute requests In-Reply-To: References: Message-ID: Patch Set 3: > we should avoid direct bts->type comparisons What would you propose instead? Also, what kind of problems you foresee in this case? -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 3 Gerrit-Project: openbsc 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 Mon Jul 10 10:12:17 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 10:12:17 +0000 Subject: [PATCH] openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3127 to look at the new patch set (#6). transaction: reject calls from unidentified subscribers A valid subscriber is indespensible when allocating a new transaction. Return NULL if no subscriber is supplied. This will cause unidentified subscribers to be rejected. Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d --- M openbsc/src/libmsc/transaction.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/3127/6 diff --git a/openbsc/src/libmsc/transaction.c b/openbsc/src/libmsc/transaction.c index dba4bed..4b46e22 100644 --- a/openbsc/src/libmsc/transaction.c +++ b/openbsc/src/libmsc/transaction.c @@ -70,6 +70,13 @@ DEBUGP(DCC, "subscr=%p, net=%p\n", subscr, net); + /* a valid subscriber is indispensable */ + if (subscr == NULL) { + LOGP(DCC, LOGL_NOTICE, + "unable to alloc transaction, invalid subscriber (NULL)\n"); + return NULL; + } + trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 10 11:05:50 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 11:05:50 +0000 Subject: [PATCH] osmo-bts[master]: measurement: fix measurment report 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/3053 to look at the new patch set (#6). measurement: fix measurment report The end of the measurement reporting period is not aligned with the SACCH block where the results are reported. The tables that are used to detect the end of the measurement period are therefore wrong. The frame number of the SACCH block must be used and not the TDMA frame number (modulo 104) of the measurement reporing interval. The tables are oriented to the frame number of the first SACCH block, at the beginning of an interval. However, when a SACCH block is received it will always contain the result of the recently passed measurement reporting period. To match the tables, introduce another lookup table to remap each SACCH block that ends to the matching beginning block number. Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 --- M configure.ac M src/common/measurement.c M tests/Makefile.am A tests/meas/meas_test.c A tests/meas/meas_test.ok A tests/meas/sysmobts_fr_samples.h M tests/testsuite.at 7 files changed, 3,438 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/3053/6 diff --git a/configure.ac b/configure.ac index b2700d5..64231b3 100644 --- a/configure.ac +++ b/configure.ac @@ -192,4 +192,5 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/meas/Makefile Makefile) diff --git a/src/common/measurement.c b/src/common/measurement.c index dba3543..3b32bf2 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -23,18 +23,27 @@ * 6 6 and 7 78 to 77 90, 12, 38, 64 * 7 6 and 7 91 to 90 103, 25, 51, 77 */ -/* measurement period ends at fn % 104 == ? */ static const uint8_t tchf_meas_rep_fn104[] = { - [0] = 103, - [1] = 12, - [2] = 25, - [3] = 38, - [4] = 51, - [5] = 64, - [6] = 77, - [7] = 90, + [0] = 90, + [1] = 103, + [2] = 12, + [3] = 25, + [4] = 38, + [5] = 51, + [6] = 64, + [7] = 77, }; static const uint8_t tchh0_meas_rep_fn104[] = { + [0] = 90, + [1] = 90, + [2] = 12, + [3] = 12, + [4] = 38, + [5] = 38, + [6] = 64, + [7] = 64, +}; +static const uint8_t tchh1_meas_rep_fn104[] = { [0] = 103, [1] = 103, [2] = 25, @@ -43,16 +52,6 @@ [5] = 51, [6] = 77, [7] = 77, -}; -static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12, - [1] = 12, - [2] = 38, - [3] = 38, - [4] = 64, - [5] = 64, - [6] = 90, - [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan @@ -86,6 +85,46 @@ [3] = 36 + 18 }; +/* Note: The reporting of the measurement results is done via the SACCH channel. + * The measurement interval is not alligned with the interval in which the + * SACCH is tranmitted. When we receive the measurement indication with the + * SACCH block, the coresponding measurement interval will already have ended + * and we will get the results late, but on spot with the beginning of the + * next measurement interval. + * + * For example: We get a measurement indication on FN%104=38 in TS=2. Then we + * will have to look at 3GPP TS 45.008, secton 8.4.1 (or 3GPP TS 05.02 Clause 7 + * Table 1 of 9) what value we need to feed into the lookup tables in order to + * detect the measurement period ending. In this example the "real" ending + * was on FN%104=12. This is the value we have to look for in + * tchf_meas_rep_fn104 to know that a measurement period has just ended. */ + +/* See also 3GPP TS 05.02 Clause 7 Table 1 of 9: + * Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5) */ +static uint8_t translate_tch_meas_rep_fn104(uint8_t fn_mod) +{ + switch (fn_mod) { + case 25: + return 103; + case 38: + return 12; + case 51: + return 25; + case 64: + return 38; + case 77: + return 51; + case 90: + return 64; + case 103: + return 77; + case 12: + return 90; + } + + /* Invalid / not of interest */ + return 0; +} /* determine if a measurement period ends at the given frame number */ static int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn) @@ -102,12 +141,12 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (tchf_meas_rep_fn104[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_TCH_H: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (lchan->nr == 0) tbl = tchh0_meas_rep_fn104; else @@ -132,9 +171,11 @@ break; } - DEBUGP(DMEAS, - "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", - gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + if (rc == 1) { + DEBUGP(DMEAS, + "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", + gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + } return rc; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 5b6f65e..d2b4181 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power +SUBDIRS = paging cipher agch misc handover tx_power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c new file mode 100644 index 0000000..c87350b --- /dev/null +++ b/tests/meas/meas_test.c @@ -0,0 +1,222 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct gsm_bts *bts; +struct gsm_bts_trx *trx; + +struct fn_sample { + uint32_t fn; + uint8_t ts; + uint8_t ss; + int rc; +}; + +#include "sysmobts_fr_samples.h" + +void test_fn_sample(struct fn_sample *s, unsigned int len, uint8_t pchan, uint8_t tsmap) +{ + int rc; + struct gsm_lchan *lchan; + unsigned int i; + unsigned int delta = 0; + uint8_t tsmap_result = 0; + uint32_t fn_prev = 0; + struct gsm_time gsm_time; + + + printf("\n\n"); + printf("===========================================================\n"); + + for (i = 0; i < len; i++) { + + lchan = &trx->ts[s[i].ts].lchan[s[i].ss]; + trx->ts[s[i].ts].pchan = pchan; + lchan->meas.num_ul_meas = 1; + + rc = lchan_meas_check_compute(lchan, s[i].fn); + if (rc) { + gsm_fn2gsmtime(&gsm_time, s[i].fn); + fprintf(stdout, "Testing: ts[%i]->lchan[%i], fn=%u=>%s, fn%%104=%u, rc=%i, delta=%i\n", s[i].ts, + s[i].ss, s[i].fn, osmo_dump_gsmtime(&gsm_time), s[i].fn % 104, rc, s[i].fn - fn_prev); + fn_prev = s[i].fn; + tsmap_result |= (1 << s[i].ts); + } else + delta++; + + /* If the test data set provides a return + * code, we check that as well */ + if (s[i].rc != -1) + OSMO_ASSERT(s[i].rc == rc); + } + + /* Make sure that we exactly trigger on the right frames + * timeslots must match exactlty to what we expect */ + OSMO_ASSERT(tsmap_result == tsmap); +} + +int main(int argc, char **argv) +{ + void *tall_bts_ctx; + + tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); + msgb_talloc_ctx_init(tall_bts_ctx, 0); + + bts_log_init(NULL); + osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; + + bts = gsm_bts_alloc(tall_bts_ctx); + if (!bts) { + fprintf(stderr, "Failed to create BTS structure\n"); + exit(1); + } + trx = gsm_bts_trx_alloc(bts); + if (!trx) { + fprintf(stderr, "Failed to TRX structure\n"); + exit(1); + } + + if (bts_init(bts) < 0) { + fprintf(stderr, "unable to to open bts\n"); + exit(1); + } + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test full rate */ + test_fn_sample(test_fn_tch_f_ts_2_3, ARRAY_SIZE(test_fn_tch_f_ts_2_3), GSM_PCHAN_TCH_F, (1 << 2) | (1 << 3)); + test_fn_sample(test_fn_tch_f_ts_4_5, ARRAY_SIZE(test_fn_tch_f_ts_4_5), GSM_PCHAN_TCH_F, (1 << 4) | (1 << 5)); + test_fn_sample(test_fn_tch_f_ts_6_7, ARRAY_SIZE(test_fn_tch_f_ts_6_7), GSM_PCHAN_TCH_F, (1 << 6) | (1 << 7)); + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test half rate */ + test_fn_sample(test_fn_tch_h_ts_2_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_2_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 2)); + test_fn_sample(test_fn_tch_h_ts_3_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_3_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 3)); + test_fn_sample(test_fn_tch_h_ts_4_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_4_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 4)); + test_fn_sample(test_fn_tch_h_ts_5_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_5_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 5)); + test_fn_sample(test_fn_tch_h_ts_6_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_6_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 6)); + test_fn_sample(test_fn_tch_h_ts_7_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_7_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 7)); + + printf("Success\n"); + + return 0; +} + +/* Stubs */ +void bts_model_abis_close(struct gsm_bts *bts) +{ +} + +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int obj_kind, void *obj) +{ + return 0; +} + +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + return 0; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj, uint8_t adm_state) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +void trx_get_hlayer1(void) +{ +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return 0; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return 0; +} + +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) +{ + return 0; +} diff --git a/tests/meas/meas_test.ok b/tests/meas/meas_test.ok new file mode 100644 index 0000000..2b76604 --- /dev/null +++ b/tests/meas/meas_test.ok @@ -0,0 +1,542 @@ + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=10958 +Testing: ts[2]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=104 +Testing: ts[3]->lchan[0], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11595=>011595/08/25/18/23, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11686=>011686/08/12/07/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11699=>011699/08/25/20/23, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11790=>011790/08/12/09/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11803=>011803/08/25/22/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11894=>011894/08/12/11/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11907=>011907/08/25/24/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11998=>011998/09/12/13/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12011=>012011/09/25/26/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12102=>012102/09/12/15/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12115=>012115/09/25/28/31, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12206=>012206/09/12/17/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12219=>012219/09/25/30/31, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12310=>012310/09/12/19/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12323=>012323/09/25/32/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12414=>012414/09/12/21/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12427=>012427/09/25/34/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12518=>012518/09/12/23/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12531=>012531/09/25/36/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12622=>012622/09/12/25/26, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12635=>012635/09/25/38/39, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=5888=>005888/04/12/23/00, fn%104=64, rc=1, delta=5888 +Testing: ts[4]->lchan[0], fn=5992=>005992/04/12/25/00, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6096=>006096/04/12/27/00, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6200=>006200/04/12/29/04, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=6213=>006213/04/25/42/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6304=>006304/04/12/31/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6317=>006317/04/25/44/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6408=>006408/04/12/33/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6421=>006421/04/25/46/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6512=>006512/04/12/35/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6525=>006525/04/25/48/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6616=>006616/04/12/37/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6629=>006629/04/25/50/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6720=>006720/05/12/39/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6733=>006733/05/25/01/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6824=>006824/05/12/41/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6837=>006837/05/25/03/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6928=>006928/05/12/43/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6941=>006941/05/25/05/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7032=>007032/05/12/45/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7045=>007045/05/25/07/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7136=>007136/05/12/47/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7149=>007149/05/25/09/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7240=>007240/05/12/49/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7253=>007253/05/25/11/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7344=>007344/05/12/00/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7357=>007357/05/25/13/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7448=>007448/05/12/02/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7461=>007461/05/25/15/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7552=>007552/05/12/04/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7565=>007565/05/25/17/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7656=>007656/05/12/06/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7669=>007669/05/25/19/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7773=>007773/05/25/21/41, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7877=>007877/05/25/23/41, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7981=>007981/06/25/25/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8085=>008085/06/25/27/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>008592/06/12/24/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8605=>008605/06/25/37/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>008696/06/12/26/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8709=>008709/06/25/39/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>008800/06/12/28/44, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8813=>008813/06/25/41/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>008904/06/12/30/44, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8917=>008917/06/25/43/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>009008/06/12/32/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9021=>009021/06/25/45/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>009112/06/12/34/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9125=>009125/06/25/47/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>009216/06/12/36/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9229=>009229/06/25/49/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>009320/07/12/38/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9333=>009333/07/25/00/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>009424/07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9437=>009437/07/25/02/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>009528/07/12/42/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9541=>009541/07/25/04/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>009632/07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9645=>009645/07/25/06/17, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8618=>008618/06/12/50/14, fn%104=90, rc=1, delta=8618 +Testing: ts[6]->lchan[0], fn=8722=>008722/06/12/01/18, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8826=>008826/06/12/03/18, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8930=>008930/06/12/05/18, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=8943=>008943/06/25/18/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>009034/06/12/07/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9047=>009047/06/25/20/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>009138/06/12/09/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9151=>009151/06/25/22/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>009242/06/12/11/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9255=>009255/06/25/24/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>009346/07/12/13/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9359=>009359/07/25/26/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>009450/07/12/15/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9463=>009463/07/25/28/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>009554/07/12/17/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9567=>009567/07/25/30/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>009658/07/12/19/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9671=>009671/07/25/32/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>009762/07/12/21/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9775=>009775/07/25/34/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>009866/07/12/23/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9879=>009879/07/25/36/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>009970/07/12/25/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9983=>009983/07/25/38/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>010074/07/12/27/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10087=>010087/07/25/40/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>010178/07/12/29/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10191=>010191/07/25/42/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>010282/07/12/31/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10295=>010295/07/25/44/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>010386/07/12/33/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10399=>010399/07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>010490/07/12/35/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10503=>010503/07/25/48/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>010594/07/12/37/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10607=>010607/07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>010698/08/12/39/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10711=>010711/08/25/01/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>010802/08/12/41/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10815=>010815/08/25/03/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>010906/08/12/43/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10919=>010919/08/25/05/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>011010/08/12/45/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11023=>011023/08/25/07/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>011114/08/12/47/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11127=>011127/08/25/09/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>011218/08/12/49/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11231=>011231/08/25/11/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>011322/08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11335=>011335/08/25/13/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>011426/08/12/02/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11439=>011439/08/25/15/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>011530/08/12/04/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11543=>011543/08/25/17/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11634=>011634/08/12/06/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11647=>011647/08/25/19/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11738=>011738/08/12/08/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11751=>011751/08/25/21/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11842=>011842/08/12/10/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11855=>011855/08/25/23/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11946=>011946/09/12/12/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11959=>011959/09/25/25/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12050=>012050/09/12/14/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12063=>012063/09/25/27/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12154=>012154/09/12/16/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12167=>012167/09/25/29/31, fn%104=103, rc=1, delta=13 + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=8982=>008982/06/12/06/22, fn%104=38, rc=1, delta=8982 +Testing: ts[2]->lchan[0], fn=9086=>009086/06/12/08/22, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9190=>009190/06/12/10/22, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9294=>009294/07/12/12/26, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9398=>009398/07/12/14/26, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[1], fn=9411=>009411/07/25/27/39, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9502=>009502/07/12/16/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9515=>009515/07/25/29/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9606=>009606/07/12/18/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9619=>009619/07/25/31/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9710=>009710/07/12/20/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9723=>009723/07/25/33/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9814=>009814/07/12/22/34, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9827=>009827/07/25/35/47, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9918=>009918/07/12/24/34, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9931=>009931/07/25/37/47, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10022=>010022/07/12/26/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10035=>010035/07/25/39/51, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10126=>010126/07/12/28/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10139=>010139/07/25/41/51, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10230=>010230/07/12/30/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10243=>010243/07/25/43/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10334=>010334/07/12/32/42, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10347=>010347/07/25/45/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10438=>010438/07/12/34/42, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10451=>010451/07/25/47/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10542=>010542/07/12/36/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10555=>010555/07/25/49/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10646=>010646/08/12/38/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10659=>010659/08/25/00/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10750=>010750/08/12/40/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10763=>010763/08/25/02/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10854=>010854/08/12/42/50, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10867=>010867/08/25/04/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10971=>010971/08/25/06/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11075=>011075/08/25/08/15, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11179=>011179/08/25/10/15, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11283=>011283/08/25/12/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11387=>011387/08/25/14/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 + + +=========================================================== +Testing: ts[3]->lchan[0], fn=10022=>010022/07/12/26/38, fn%104=38, rc=1, delta=10022 +Testing: ts[3]->lchan[1], fn=10035=>010035/07/25/39/51, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10126=>010126/07/12/28/38, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10139=>010139/07/25/41/51, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10230=>010230/07/12/30/38, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10243=>010243/07/25/43/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10334=>010334/07/12/32/42, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10347=>010347/07/25/45/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10438=>010438/07/12/34/42, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10451=>010451/07/25/47/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10542=>010542/07/12/36/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10555=>010555/07/25/49/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10646=>010646/08/12/38/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10659=>010659/08/25/00/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10750=>010750/08/12/40/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10763=>010763/08/25/02/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10854=>010854/08/12/42/50, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10867=>010867/08/25/04/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10971=>010971/08/25/06/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11075=>011075/08/25/08/15, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11179=>011179/08/25/10/15, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11283=>011283/08/25/12/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11387=>011387/08/25/14/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11595=>011595/08/25/18/23, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11686=>011686/08/12/07/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11699=>011699/08/25/20/23, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11790=>011790/08/12/09/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11803=>011803/08/25/22/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11894=>011894/08/12/11/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11907=>011907/08/25/24/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11998=>011998/09/12/13/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12011=>012011/09/25/26/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=12102=>012102/09/12/15/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12115=>012115/09/25/28/31, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=7760 +Testing: ts[4]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[1], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>008592/06/12/24/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8605=>008605/06/25/37/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>008696/06/12/26/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8709=>008709/06/25/39/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>008800/06/12/28/44, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8813=>008813/06/25/41/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>008904/06/12/30/44, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8917=>008917/06/25/43/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>009008/06/12/32/48, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9021=>009021/06/25/45/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>009112/06/12/34/48, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9125=>009125/06/25/47/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>009216/06/12/36/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9229=>009229/06/25/49/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>009320/07/12/38/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9333=>009333/07/25/00/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>009424/07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9437=>009437/07/25/02/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>009528/07/12/42/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9541=>009541/07/25/04/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>009632/07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9645=>009645/07/25/06/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9736=>009736/07/12/46/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9749=>009749/07/25/08/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9840=>009840/07/12/48/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9853=>009853/07/25/10/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9944=>009944/07/12/50/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9957=>009957/07/25/12/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10048=>010048/07/12/01/12, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10061=>010061/07/25/14/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10152=>010152/07/12/03/12, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10165=>010165/07/25/16/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10256=>010256/07/12/05/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10269=>010269/07/25/18/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10360=>010360/07/12/07/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10373=>010373/07/25/20/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10464=>010464/07/12/09/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10477=>010477/07/25/22/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10568=>010568/07/12/11/20, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10581=>010581/07/25/24/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10672=>010672/08/12/13/20, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10685=>010685/08/25/26/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10776=>010776/08/12/15/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10789=>010789/08/25/28/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10880=>010880/08/12/17/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10893=>010893/08/25/30/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10984=>010984/08/12/19/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10997=>010997/08/25/32/37, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[5]->lchan[0], fn=5264=>005264/03/12/11/40, fn%104=64, rc=1, delta=5264 +Testing: ts[5]->lchan[0], fn=5368=>005368/04/12/13/40, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5472=>005472/04/12/15/44, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5576=>005576/04/12/17/44, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5680=>005680/04/12/19/48, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[1], fn=5693=>005693/04/25/32/09, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5784=>005784/04/12/21/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5797=>005797/04/25/34/09, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5888=>005888/04/12/23/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5901=>005901/04/25/36/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5992=>005992/04/12/25/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6005=>006005/04/25/38/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6096=>006096/04/12/27/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6109=>006109/04/25/40/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6200=>006200/04/12/29/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6213=>006213/04/25/42/17, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6304=>006304/04/12/31/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6317=>006317/04/25/44/17, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6408=>006408/04/12/33/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6421=>006421/04/25/46/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6512=>006512/04/12/35/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6525=>006525/04/25/48/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6616=>006616/04/12/37/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6629=>006629/04/25/50/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6720=>006720/05/12/39/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6733=>006733/05/25/01/25, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6824=>006824/05/12/41/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6837=>006837/05/25/03/25, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6928=>006928/05/12/43/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6941=>006941/05/25/05/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7032=>007032/05/12/45/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7045=>007045/05/25/07/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7136=>007136/05/12/47/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7149=>007149/05/25/09/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7240=>007240/05/12/49/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7253=>007253/05/25/11/33, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7344=>007344/05/12/00/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7357=>007357/05/25/13/33, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7448=>007448/05/12/02/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7461=>007461/05/25/15/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7552=>007552/05/12/04/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7565=>007565/05/25/17/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7656=>007656/05/12/06/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7669=>007669/05/25/19/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7773=>007773/05/25/21/41, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7877=>007877/05/25/23/41, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7981=>007981/06/25/25/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8085=>008085/06/25/27/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8098=>008098/06/12/40/06, fn%104=90, rc=1, delta=8098 +Testing: ts[6]->lchan[0], fn=8202=>008202/06/12/42/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8306=>008306/06/12/44/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8410=>008410/06/12/46/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[1], fn=8423=>008423/06/25/08/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8514=>008514/06/12/48/14, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8527=>008527/06/25/10/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8618=>008618/06/12/50/14, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8631=>008631/06/25/12/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8722=>008722/06/12/01/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8735=>008735/06/25/14/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8826=>008826/06/12/03/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8839=>008839/06/25/16/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8930=>008930/06/12/05/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8943=>008943/06/25/18/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>009034/06/12/07/22, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9047=>009047/06/25/20/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>009138/06/12/09/22, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9151=>009151/06/25/22/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>009242/06/12/11/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9255=>009255/06/25/24/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>009346/07/12/13/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9359=>009359/07/25/26/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>009450/07/12/15/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9463=>009463/07/25/28/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>009554/07/12/17/30, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9567=>009567/07/25/30/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>009658/07/12/19/30, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9671=>009671/07/25/32/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>009762/07/12/21/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9775=>009775/07/25/34/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>009866/07/12/23/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9879=>009879/07/25/36/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>009970/07/12/25/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9983=>009983/07/25/38/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>010074/07/12/27/38, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10087=>010087/07/25/40/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>010178/07/12/29/38, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10191=>010191/07/25/42/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>010282/07/12/31/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10295=>010295/07/25/44/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>010386/07/12/33/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10399=>010399/07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>010490/07/12/35/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10503=>010503/07/25/48/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>010594/07/12/37/46, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10607=>010607/07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>010698/08/12/39/46, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10711=>010711/08/25/01/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>010802/08/12/41/50, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10815=>010815/08/25/03/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>010906/08/12/43/50, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10919=>010919/08/25/05/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>011010/08/12/45/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11023=>011023/08/25/07/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>011114/08/12/47/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11127=>011127/08/25/09/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>011218/08/12/49/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11231=>011231/08/25/11/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>011322/08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11335=>011335/08/25/13/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>011426/08/12/02/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11439=>011439/08/25/15/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>011530/08/12/04/10, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11543=>011543/08/25/17/23, fn%104=103, rc=1, delta=13 + + +=========================================================== +Testing: ts[7]->lchan[0], fn=11738=>011738/08/12/08/10, fn%104=90, rc=1, delta=11738 +Testing: ts[7]->lchan[0], fn=11842=>011842/08/12/10/14, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=11946=>011946/09/12/12/14, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=12050=>012050/09/12/14/18, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[1], fn=12063=>012063/09/25/27/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12154=>012154/09/12/16/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12167=>012167/09/25/29/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12258=>012258/09/12/18/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12271=>012271/09/25/31/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12362=>012362/09/12/20/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12375=>012375/09/25/33/35, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12466=>012466/09/12/22/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12479=>012479/09/25/35/35, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12570=>012570/09/12/24/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12583=>012583/09/25/37/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12674=>012674/09/12/26/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12687=>012687/09/25/39/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12778=>012778/09/12/28/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12791=>012791/09/25/41/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12882=>012882/09/12/30/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12895=>012895/09/25/43/43, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12986=>012986/09/12/32/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12999=>012999/09/25/45/43, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13090=>013090/09/12/34/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13103=>013103/09/25/47/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13194=>013194/09/12/36/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13207=>013207/09/25/49/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13298=>013298/10/12/38/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13311=>013311/10/25/00/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13402=>013402/10/12/40/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13415=>013415/10/25/02/51, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13506=>013506/10/12/42/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13519=>013519/10/25/04/51, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13610=>013610/10/12/44/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13623=>013623/10/25/06/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13714=>013714/10/12/46/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13727=>013727/10/25/08/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13818=>013818/10/12/48/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13831=>013831/10/25/10/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13922=>013922/10/12/50/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13935=>013935/10/25/12/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14026=>014026/10/12/01/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14039=>014039/10/25/14/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14130=>014130/10/12/03/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14143=>014143/10/25/16/11, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14234=>014234/10/12/05/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14247=>014247/10/25/18/11, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14338=>014338/10/12/07/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14351=>014351/10/25/20/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14442=>014442/10/12/09/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14455=>014455/10/25/22/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14546=>014546/10/12/11/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14559=>014559/10/25/24/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14650=>014650/11/12/13/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14663=>014663/11/25/26/19, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14754=>014754/11/12/15/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14767=>014767/11/25/28/19, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14858=>014858/11/12/17/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14871=>014871/11/25/30/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14962=>014962/11/12/19/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14975=>014975/11/25/32/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15066=>015066/11/12/21/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15079=>015079/11/25/34/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15170=>015170/11/12/23/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15183=>015183/11/25/36/27, fn%104=103, rc=1, delta=13 +Success diff --git a/tests/meas/sysmobts_fr_samples.h b/tests/meas/sysmobts_fr_samples.h new file mode 100644 index 0000000..ee70bd7 --- /dev/null +++ b/tests/meas/sysmobts_fr_samples.h @@ -0,0 +1,2601 @@ +/* The following dataset was generated using a sysmobts in order to have + * some real data from a real phy to test against. */ + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS2 and TS3 */ +struct fn_sample test_fn_tch_f_ts_2_3[] = { +{10954,2,0,-1},{10959,2,0,-1},{10972,2,0,-1},{10976,2,0,-1},{10980,2,0,-1}, +{10985,2,0,-1},{10989,2,0,-1},{10993,2,0,-1},{10998,2,0,-1},{11002,2,0,-1}, +{11006,2,0,-1},{11011,2,0,-1},{11015,2,0,-1},{11019,2,0,-1},{11024,2,0,-1}, +{11028,2,0,-1},{10958,2,0,-1},{11032,2,0,-1},{11037,2,0,-1},{11041,2,0,-1}, +{11045,2,0,-1},{11050,2,0,-1},{11054,2,0,-1},{11058,2,0,-1},{11063,2,0,-1}, +{11067,2,0,-1},{11071,2,0,-1},{11076,2,0,-1},{11080,2,0,-1},{11084,2,0,-1}, +{11089,2,0,-1},{11093,2,0,-1},{11097,2,0,-1},{11102,2,0,-1},{11106,2,0,-1}, +{11110,2,0,-1},{11115,2,0,-1},{11119,2,0,-1},{11123,2,0,-1},{11128,2,0,-1}, +{11132,2,0,-1},{11062,2,0,-1},{11136,2,0,-1},{11141,2,0,-1},{11145,2,0,-1}, +{11149,2,0,-1},{11154,2,0,-1},{11158,2,0,-1},{11162,2,0,-1},{11167,2,0,-1}, +{11171,2,0,-1},{11175,2,0,-1},{11180,2,0,-1},{11184,2,0,-1},{11188,2,0,-1}, +{11193,2,0,-1},{11197,2,0,-1},{11201,2,0,-1},{11206,2,0,-1},{11210,2,0,-1}, +{11214,2,0,-1},{11219,2,0,-1},{11223,2,0,-1},{11227,2,0,-1},{11232,2,0,-1}, +{11236,2,0,-1},{11166,2,0,-1},{11240,2,0,-1},{11245,2,0,-1},{11249,2,0,-1}, +{11253,2,0,-1},{11258,2,0,-1},{11262,2,0,-1},{11266,2,0,-1},{11271,2,0,-1}, +{11275,2,0,-1},{11279,2,0,-1},{11284,2,0,-1},{11288,2,0,-1},{11292,2,0,-1}, +{11297,2,0,-1},{11301,2,0,-1},{11305,2,0,-1},{11310,2,0,-1},{11314,2,0,-1}, +{11318,2,0,-1},{11323,2,0,-1},{11327,2,0,-1},{11331,2,0,-1},{11336,2,0,-1}, +{11340,2,0,-1},{11270,2,0,-1},{11344,2,0,-1},{11349,2,0,-1},{11353,2,0,-1}, +{11357,2,0,-1},{11362,2,0,-1},{11366,2,0,-1},{11370,2,0,-1},{11375,2,0,-1}, +{11379,2,0,-1},{11383,2,0,-1},{11388,2,0,-1},{11392,2,0,-1},{11396,2,0,-1}, +{11401,2,0,-1},{11405,2,0,-1},{11409,2,0,-1},{11414,2,0,-1},{11418,2,0,-1}, +{11422,2,0,-1},{11427,2,0,-1},{11431,2,0,-1},{11431,3,0,-1},{11435,2,0,-1}, +{11435,3,0,-1},{11440,2,0,-1},{11440,3,0,-1},{11444,2,0,-1},{11444,3,0,-1}, +{11374,2,0,-1},{11448,2,0,-1},{11448,3,0,-1},{11453,2,0,-1},{11453,3,0,-1}, +{11457,2,0,-1},{11457,3,0,-1},{11461,2,0,-1},{11461,3,0,-1},{11466,2,0,-1}, +{11466,3,0,-1},{11470,2,0,-1},{11470,3,0,-1},{11474,2,0,-1},{11474,3,0,-1}, +{11479,2,0,-1},{11479,3,0,-1},{11483,2,0,-1},{11483,3,0,-1},{11487,2,0,-1}, +{11487,3,0,-1},{11492,2,0,-1},{11492,3,0,-1},{11496,2,0,-1},{11496,3,0,-1}, +{11500,2,0,-1},{11500,3,0,-1},{11505,2,0,-1},{11505,3,0,-1},{11509,2,0,-1}, +{11509,3,0,-1},{11513,2,0,-1},{11513,3,0,-1},{11518,2,0,-1},{11518,3,0,-1}, +{11522,2,0,-1},{11522,3,0,-1},{11526,2,0,-1},{11526,3,0,-1},{11531,2,0,-1}, +{11531,3,0,-1},{11535,2,0,-1},{11535,3,0,-1},{11539,2,0,-1},{11539,3,0,-1}, +{11544,2,0,-1},{11544,3,0,-1},{11548,2,0,-1},{11548,3,0,-1},{11478,2,0,-1}, +{11552,2,0,-1},{11552,3,0,-1},{11557,2,0,-1},{11557,3,0,-1},{11561,2,0,-1}, +{11561,3,0,-1},{11491,3,0,-1},{11565,2,0,-1},{11565,3,0,-1},{11570,2,0,-1}, +{11570,3,0,-1},{11574,2,0,-1},{11574,3,0,-1},{11578,2,0,-1},{11578,3,0,-1}, +{11583,2,0,-1},{11583,3,0,-1},{11587,2,0,-1},{11587,3,0,-1},{11591,2,0,-1}, +{11591,3,0,-1},{11596,2,0,-1},{11596,3,0,-1},{11600,2,0,-1},{11600,3,0,-1}, +{11604,2,0,-1},{11604,3,0,-1},{11609,2,0,-1},{11609,3,0,-1},{11613,2,0,-1}, +{11613,3,0,-1},{11617,2,0,-1},{11617,3,0,-1},{11622,2,0,-1},{11622,3,0,-1}, +{11626,2,0,-1},{11626,3,0,-1},{11630,2,0,-1},{11630,3,0,-1},{11635,2,0,-1}, +{11635,3,0,-1},{11639,2,0,-1},{11639,3,0,-1},{11643,2,0,-1},{11643,3,0,-1}, +{11648,2,0,-1},{11648,3,0,-1},{11652,2,0,-1},{11652,3,0,-1},{11582,2,0,-1}, +{11656,2,0,-1},{11656,3,0,-1},{11661,2,0,-1},{11661,3,0,-1},{11665,2,0,-1}, +{11665,3,0,-1},{11595,3,0,-1},{11669,2,0,-1},{11669,3,0,-1},{11674,2,0,-1}, +{11674,3,0,-1},{11678,2,0,-1},{11678,3,0,-1},{11682,2,0,-1},{11682,3,0,-1}, +{11687,2,0,-1},{11687,3,0,-1},{11691,2,0,-1},{11691,3,0,-1},{11695,2,0,-1}, +{11695,3,0,-1},{11700,2,0,-1},{11700,3,0,-1},{11704,2,0,-1},{11704,3,0,-1}, +{11708,2,0,-1},{11708,3,0,-1},{11713,2,0,-1},{11713,3,0,-1},{11717,2,0,-1}, +{11717,3,0,-1},{11721,2,0,-1},{11721,3,0,-1},{11726,2,0,-1},{11726,3,0,-1}, +{11730,2,0,-1},{11730,3,0,-1},{11734,2,0,-1},{11734,3,0,-1},{11739,2,0,-1}, +{11739,3,0,-1},{11743,2,0,-1},{11743,3,0,-1},{11747,2,0,-1},{11747,3,0,-1}, +{11752,2,0,-1},{11752,3,0,-1},{11756,2,0,-1},{11756,3,0,-1},{11686,2,0,-1}, +{11760,2,0,-1},{11760,3,0,-1},{11765,2,0,-1},{11765,3,0,-1},{11769,2,0,-1}, +{11769,3,0,-1},{11699,3,0,-1},{11773,2,0,-1},{11773,3,0,-1},{11778,2,0,-1}, +{11778,3,0,-1},{11782,2,0,-1},{11782,3,0,-1},{11786,2,0,-1},{11786,3,0,-1}, +{11791,2,0,-1},{11791,3,0,-1},{11795,2,0,-1},{11795,3,0,-1},{11799,2,0,-1}, +{11799,3,0,-1},{11804,2,0,-1},{11804,3,0,-1},{11808,2,0,-1},{11808,3,0,-1}, +{11812,2,0,-1},{11812,3,0,-1},{11817,2,0,-1},{11817,3,0,-1},{11821,2,0,-1}, +{11821,3,0,-1},{11825,2,0,-1},{11825,3,0,-1},{11830,2,0,-1},{11830,3,0,-1}, +{11834,2,0,-1},{11834,3,0,-1},{11838,2,0,-1},{11838,3,0,-1},{11843,2,0,-1}, +{11843,3,0,-1},{11847,2,0,-1},{11847,3,0,-1},{11851,2,0,-1},{11851,3,0,-1}, +{11856,2,0,-1},{11856,3,0,-1},{11860,2,0,-1},{11860,3,0,-1},{11790,2,0,-1}, +{11864,2,0,-1},{11864,3,0,-1},{11869,2,0,-1},{11869,3,0,-1},{11873,2,0,-1}, +{11873,3,0,-1},{11803,3,0,-1},{11877,2,0,-1},{11877,3,0,-1},{11882,2,0,-1}, +{11882,3,0,-1},{11886,2,0,-1},{11886,3,0,-1},{11890,2,0,-1},{11890,3,0,-1}, +{11895,2,0,-1},{11895,3,0,-1},{11899,2,0,-1},{11899,3,0,-1},{11903,2,0,-1}, +{11903,3,0,-1},{11908,2,0,-1},{11908,3,0,-1},{11912,2,0,-1},{11912,3,0,-1}, +{11916,2,0,-1},{11916,3,0,-1},{11921,2,0,-1},{11921,3,0,-1},{11925,2,0,-1}, +{11925,3,0,-1},{11929,2,0,-1},{11929,3,0,-1},{11934,2,0,-1},{11934,3,0,-1}, +{11938,2,0,-1},{11938,3,0,-1},{11942,2,0,-1},{11942,3,0,-1},{11947,2,0,-1}, +{11947,3,0,-1},{11951,2,0,-1},{11951,3,0,-1},{11955,2,0,-1},{11955,3,0,-1}, +{11960,2,0,-1},{11960,3,0,-1},{11964,2,0,-1},{11964,3,0,-1},{11894,2,0,-1}, +{11968,2,0,-1},{11968,3,0,-1},{11973,2,0,-1},{11973,3,0,-1},{11977,2,0,-1}, +{11977,3,0,-1},{11907,3,0,-1},{11981,2,0,-1},{11981,3,0,-1},{11986,2,0,-1}, +{11986,3,0,-1},{11990,2,0,-1},{11990,3,0,-1},{11994,2,0,-1},{11994,3,0,-1}, +{11999,2,0,-1},{11999,3,0,-1},{12003,2,0,-1},{12003,3,0,-1},{12007,2,0,-1}, +{12007,3,0,-1},{12012,2,0,-1},{12012,3,0,-1},{12016,2,0,-1},{12016,3,0,-1}, +{12020,2,0,-1},{12020,3,0,-1},{12025,2,0,-1},{12025,3,0,-1},{12029,2,0,-1}, +{12029,3,0,-1},{12033,2,0,-1},{12033,3,0,-1},{12038,2,0,-1},{12038,3,0,-1}, +{12042,2,0,-1},{12042,3,0,-1},{12046,2,0,-1},{12046,3,0,-1},{12051,2,0,-1}, +{12051,3,0,-1},{12055,2,0,-1},{12055,3,0,-1},{12059,2,0,-1},{12059,3,0,-1}, +{12064,2,0,-1},{12064,3,0,-1},{12068,2,0,-1},{12068,3,0,-1},{11998,2,0,-1}, +{12072,2,0,-1},{12072,3,0,-1},{12077,2,0,-1},{12077,3,0,-1},{12081,2,0,-1}, +{12081,3,0,-1},{12011,3,0,-1},{12085,2,0,-1},{12085,3,0,-1},{12090,2,0,-1}, +{12090,3,0,-1},{12094,2,0,-1},{12094,3,0,-1},{12098,2,0,-1},{12098,3,0,-1}, +{12103,2,0,-1},{12103,3,0,-1},{12107,2,0,-1},{12107,3,0,-1},{12111,2,0,-1}, +{12111,3,0,-1},{12116,2,0,-1},{12116,3,0,-1},{12120,2,0,-1},{12120,3,0,-1}, +{12124,2,0,-1},{12124,3,0,-1},{12129,2,0,-1},{12129,3,0,-1},{12133,2,0,-1}, +{12133,3,0,-1},{12137,2,0,-1},{12137,3,0,-1},{12142,2,0,-1},{12142,3,0,-1}, +{12146,2,0,-1},{12146,3,0,-1},{12150,2,0,-1},{12150,3,0,-1},{12155,2,0,-1}, +{12155,3,0,-1},{12159,2,0,-1},{12159,3,0,-1},{12163,2,0,-1},{12163,3,0,-1}, +{12168,2,0,-1},{12168,3,0,-1},{12172,2,0,-1},{12172,3,0,-1},{12102,2,0,-1}, +{12176,2,0,-1},{12176,3,0,-1},{12181,2,0,-1},{12181,3,0,-1},{12185,2,0,-1}, +{12185,3,0,-1},{12115,3,0,-1},{12189,2,0,-1},{12189,3,0,-1},{12194,2,0,-1}, +{12194,3,0,-1},{12198,2,0,-1},{12198,3,0,-1},{12202,2,0,-1},{12202,3,0,-1}, +{12207,2,0,-1},{12207,3,0,-1},{12211,2,0,-1},{12211,3,0,-1},{12215,2,0,-1}, +{12215,3,0,-1},{12220,2,0,-1},{12220,3,0,-1},{12224,2,0,-1},{12224,3,0,-1}, +{12228,2,0,-1},{12228,3,0,-1},{12233,2,0,-1},{12233,3,0,-1},{12237,2,0,-1}, +{12237,3,0,-1},{12241,2,0,-1},{12241,3,0,-1},{12246,2,0,-1},{12246,3,0,-1}, +{12250,2,0,-1},{12250,3,0,-1},{12254,2,0,-1},{12254,3,0,-1},{12259,2,0,-1}, +{12259,3,0,-1},{12263,2,0,-1},{12263,3,0,-1},{12267,2,0,-1},{12267,3,0,-1}, +{12272,2,0,-1},{12272,3,0,-1},{12276,2,0,-1},{12276,3,0,-1},{12206,2,0,-1}, +{12280,2,0,-1},{12280,3,0,-1},{12285,2,0,-1},{12285,3,0,-1},{12289,2,0,-1}, +{12289,3,0,-1},{12219,3,0,-1},{12293,2,0,-1},{12293,3,0,-1},{12298,2,0,-1}, +{12298,3,0,-1},{12302,2,0,-1},{12302,3,0,-1},{12306,2,0,-1},{12306,3,0,-1}, +{12311,2,0,-1},{12311,3,0,-1},{12315,2,0,-1},{12315,3,0,-1},{12319,2,0,-1}, +{12319,3,0,-1},{12324,2,0,-1},{12324,3,0,-1},{12328,2,0,-1},{12328,3,0,-1}, +{12332,2,0,-1},{12332,3,0,-1},{12337,2,0,-1},{12337,3,0,-1},{12341,2,0,-1}, +{12341,3,0,-1},{12345,2,0,-1},{12345,3,0,-1},{12350,2,0,-1},{12350,3,0,-1}, +{12354,2,0,-1},{12354,3,0,-1},{12358,2,0,-1},{12358,3,0,-1},{12363,2,0,-1}, +{12363,3,0,-1},{12367,2,0,-1},{12367,3,0,-1},{12371,2,0,-1},{12371,3,0,-1}, +{12376,2,0,-1},{12376,3,0,-1},{12380,2,0,-1},{12380,3,0,-1},{12310,2,0,-1}, +{12384,2,0,-1},{12384,3,0,-1},{12389,2,0,-1},{12389,3,0,-1},{12393,2,0,-1}, +{12393,3,0,-1},{12323,3,0,-1},{12397,2,0,-1},{12397,3,0,-1},{12402,2,0,-1}, +{12402,3,0,-1},{12406,2,0,-1},{12406,3,0,-1},{12410,2,0,-1},{12410,3,0,-1}, +{12415,2,0,-1},{12415,3,0,-1},{12419,2,0,-1},{12419,3,0,-1},{12423,2,0,-1}, +{12423,3,0,-1},{12428,2,0,-1},{12428,3,0,-1},{12432,2,0,-1},{12432,3,0,-1}, +{12436,2,0,-1},{12436,3,0,-1},{12441,2,0,-1},{12441,3,0,-1},{12445,2,0,-1}, +{12445,3,0,-1},{12449,2,0,-1},{12449,3,0,-1},{12454,2,0,-1},{12454,3,0,-1}, +{12458,2,0,-1},{12458,3,0,-1},{12462,2,0,-1},{12462,3,0,-1},{12467,2,0,-1}, +{12467,3,0,-1},{12471,2,0,-1},{12471,3,0,-1},{12475,2,0,-1},{12475,3,0,-1}, +{12480,2,0,-1},{12480,3,0,-1},{12484,2,0,-1},{12484,3,0,-1},{12414,2,0,-1}, +{12488,2,0,-1},{12488,3,0,-1},{12493,2,0,-1},{12493,3,0,-1},{12497,2,0,-1}, +{12497,3,0,-1},{12427,3,0,-1},{12501,2,0,-1},{12501,3,0,-1},{12506,2,0,-1}, +{12506,3,0,-1},{12510,2,0,-1},{12510,3,0,-1},{12514,2,0,-1},{12514,3,0,-1}, +{12519,2,0,-1},{12519,3,0,-1},{12523,2,0,-1},{12523,3,0,-1},{12527,2,0,-1}, +{12527,3,0,-1},{12532,2,0,-1},{12532,3,0,-1},{12536,2,0,-1},{12536,3,0,-1}, +{12540,2,0,-1},{12540,3,0,-1},{12545,2,0,-1},{12545,3,0,-1},{12549,2,0,-1}, +{12549,3,0,-1},{12553,2,0,-1},{12553,3,0,-1},{12558,2,0,-1},{12558,3,0,-1}, +{12562,2,0,-1},{12562,3,0,-1},{12566,2,0,-1},{12566,3,0,-1},{12571,2,0,-1}, +{12571,3,0,-1},{12575,2,0,-1},{12575,3,0,-1},{12579,2,0,-1},{12579,3,0,-1}, +{12584,2,0,-1},{12584,3,0,-1},{12588,2,0,-1},{12588,3,0,-1},{12518,2,0,-1}, +{12592,2,0,-1},{12592,3,0,-1},{12597,2,0,-1},{12597,3,0,-1},{12601,2,0,-1}, +{12601,3,0,-1},{12531,3,0,-1},{12605,2,0,-1},{12605,3,0,-1},{12610,2,0,-1}, +{12610,3,0,-1},{12614,2,0,-1},{12614,3,0,-1},{12618,2,0,-1},{12618,3,0,-1}, +{12623,2,0,-1},{12623,3,0,-1},{12627,2,0,-1},{12627,3,0,-1},{12631,2,0,-1}, +{12631,3,0,-1},{12636,2,0,-1},{12636,3,0,-1},{12640,2,0,-1},{12640,3,0,-1}, +{12644,2,0,-1},{12644,3,0,-1},{12649,2,0,-1},{12649,3,0,-1},{12653,2,0,-1}, +{12653,3,0,-1},{12657,2,0,-1},{12657,3,0,-1},{12662,2,0,-1},{12662,3,0,-1}, +{12666,2,0,-1},{12666,3,0,-1},{12670,2,0,-1},{12670,3,0,-1},{12675,2,0,-1}, +{12675,3,0,-1},{12679,2,0,-1},{12679,3,0,-1},{12683,2,0,-1},{12683,3,0,-1}, +{12688,2,0,-1},{12688,3,0,-1},{12692,2,0,-1},{12692,3,0,-1},{12622,2,0,-1}, +{12696,2,0,-1},{12696,3,0,-1},{12701,2,0,-1},{12701,3,0,-1},{12705,2,0,-1}, +{12705,3,0,-1},{12635,3,0,-1},{12709,2,0,-1},{12709,3,0,-1},{12714,2,0,-1}, +{12714,3,0,-1},{12718,2,0,-1},{12718,3,0,-1},{12722,2,0,-1},{12722,3,0,-1}, +{12727,2,0,-1},{12727,3,0,-1},{12731,2,0,-1},{12731,3,0,-1},{12735,2,0,-1}, +{12735,3,0,-1},{12740,2,0,-1},{12740,3,0,-1},{12744,2,0,-1},{12744,3,0,-1}, +{12748,2,0,-1},{12748,3,0,-1},{12753,2,0,-1},{12753,3,0,-1},{12757,2,0,-1}, +{12757,3,0,-1},{12761,2,0,-1},{12761,3,0,-1},{12766,2,0,-1},{12766,3,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS4 and TS5 */ +struct fn_sample test_fn_tch_f_ts_4_5[] = { +{3407,0,1,-1},{3427,0,1,-1},{3458,0,1,-1},{3509,0,1,-1},{3529,0,1,-1}, +{3560,0,1,-1},{3611,0,1,-1},{3662,0,1,-1},{3713,0,1,-1},{3764,0,1,-1}, +{3780,0,2,-1},{3821,0,2,-1},{3872,0,2,-1},{3882,0,2,-1},{3923,0,2,-1}, +{3974,0,2,-1},{3984,0,2,-1},{4025,0,2,-1},{4076,0,2,-1},{4127,0,2,-1}, +{4178,0,2,-1},{5871,4,0,-1},{5876,4,0,-1},{5880,4,0,-1},{5884,4,0,-1}, +{5889,4,0,-1},{5893,4,0,-1},{5897,4,0,-1},{5902,4,0,-1},{5906,4,0,-1}, +{5910,4,0,-1},{5915,4,0,-1},{5919,4,0,-1},{5923,4,0,-1},{5928,4,0,-1}, +{5932,4,0,-1},{5936,4,0,-1},{5941,4,0,-1},{5945,4,0,-1},{5949,4,0,-1}, +{5954,4,0,-1},{5958,4,0,-1},{5888,4,0,-1},{5962,4,0,-1},{5967,4,0,-1}, +{5971,4,0,-1},{5975,4,0,-1},{5980,4,0,-1},{5984,4,0,-1},{5988,4,0,-1}, +{5993,4,0,-1},{5997,4,0,-1},{6001,4,0,-1},{6006,4,0,-1},{6010,4,0,-1}, +{6014,4,0,-1},{6019,4,0,-1},{6023,4,0,-1},{6027,4,0,-1},{6032,4,0,-1}, +{6036,4,0,-1},{6040,4,0,-1},{6045,4,0,-1},{6049,4,0,-1},{6053,4,0,-1}, +{6058,4,0,-1},{6062,4,0,-1},{5992,4,0,-1},{6066,4,0,-1},{6071,4,0,-1}, +{6075,4,0,-1},{6079,4,0,-1},{6084,4,0,-1},{6088,4,0,-1},{6092,4,0,-1}, +{6097,4,0,-1},{6101,4,0,-1},{6105,4,0,-1},{6110,4,0,-1},{6114,4,0,-1}, +{6118,4,0,-1},{6123,4,0,-1},{6127,4,0,-1},{6131,4,0,-1},{6136,4,0,-1}, +{6140,4,0,-1},{6144,4,0,-1},{6149,4,0,-1},{6153,4,0,-1},{6157,4,0,-1}, +{6162,4,0,-1},{6166,4,0,-1},{6096,4,0,-1},{6170,4,0,-1},{6175,4,0,-1}, +{6175,5,0,-1},{6179,4,0,-1},{6179,5,0,-1},{6183,4,0,-1},{6183,5,0,-1}, +{6188,4,0,-1},{6188,5,0,-1},{6192,4,0,-1},{6192,5,0,-1},{6196,4,0,-1}, +{6196,5,0,-1},{6201,4,0,-1},{6201,5,0,-1},{6205,4,0,-1},{6205,5,0,-1}, +{6209,4,0,-1},{6209,5,0,-1},{6214,4,0,-1},{6214,5,0,-1},{6218,4,0,-1}, +{6218,5,0,-1},{6222,4,0,-1},{6222,5,0,-1},{6227,4,0,-1},{6227,5,0,-1}, +{6231,4,0,-1},{6231,5,0,-1},{6235,4,0,-1},{6235,5,0,-1},{6240,4,0,-1}, +{6240,5,0,-1},{6244,4,0,-1},{6244,5,0,-1},{6248,4,0,-1},{6248,5,0,-1}, +{6253,4,0,-1},{6253,5,0,-1},{6257,4,0,-1},{6257,5,0,-1},{6261,4,0,-1}, +{6261,5,0,-1},{6266,4,0,-1},{6266,5,0,-1},{6270,4,0,-1},{6270,5,0,-1}, +{6200,4,0,-1},{6274,4,0,-1},{6274,5,0,-1},{6279,4,0,-1},{6279,5,0,-1}, +{6283,4,0,-1},{6283,5,0,-1},{6213,5,0,-1},{6287,4,0,-1},{6287,5,0,-1}, +{6292,4,0,-1},{6292,5,0,-1},{6296,4,0,-1},{6296,5,0,-1},{6300,4,0,-1}, +{6300,5,0,-1},{6305,4,0,-1},{6305,5,0,-1},{6309,4,0,-1},{6309,5,0,-1}, +{6313,4,0,-1},{6313,5,0,-1},{6318,4,0,-1},{6318,5,0,-1},{6322,4,0,-1}, +{6322,5,0,-1},{6326,4,0,-1},{6326,5,0,-1},{6331,4,0,-1},{6331,5,0,-1}, +{6335,4,0,-1},{6335,5,0,-1},{6339,4,0,-1},{6339,5,0,-1},{6344,4,0,-1}, +{6344,5,0,-1},{6348,4,0,-1},{6348,5,0,-1},{6352,4,0,-1},{6352,5,0,-1}, +{6357,4,0,-1},{6357,5,0,-1},{6361,4,0,-1},{6361,5,0,-1},{6365,4,0,-1}, +{6365,5,0,-1},{6370,4,0,-1},{6370,5,0,-1},{6374,4,0,-1},{6374,5,0,-1}, +{6304,4,0,-1},{6378,4,0,-1},{6378,5,0,-1},{6383,4,0,-1},{6383,5,0,-1}, +{6387,4,0,-1},{6387,5,0,-1},{6317,5,0,-1},{6391,4,0,-1},{6391,5,0,-1}, +{6396,4,0,-1},{6396,5,0,-1},{6400,4,0,-1},{6400,5,0,-1},{6404,4,0,-1}, +{6404,5,0,-1},{6409,4,0,-1},{6409,5,0,-1},{6413,4,0,-1},{6413,5,0,-1}, +{6417,4,0,-1},{6417,5,0,-1},{6422,4,0,-1},{6422,5,0,-1},{6426,4,0,-1}, +{6426,5,0,-1},{6430,4,0,-1},{6430,5,0,-1},{6435,4,0,-1},{6435,5,0,-1}, +{6439,4,0,-1},{6439,5,0,-1},{6443,4,0,-1},{6443,5,0,-1},{6448,4,0,-1}, +{6448,5,0,-1},{6452,4,0,-1},{6452,5,0,-1},{6456,4,0,-1},{6456,5,0,-1}, +{6461,4,0,-1},{6461,5,0,-1},{6465,4,0,-1},{6465,5,0,-1},{6469,4,0,-1}, +{6469,5,0,-1},{6474,4,0,-1},{6474,5,0,-1},{6478,4,0,-1},{6478,5,0,-1}, +{6408,4,0,-1},{6482,4,0,-1},{6482,5,0,-1},{6487,4,0,-1},{6487,5,0,-1}, +{6491,4,0,-1},{6491,5,0,-1},{6421,5,0,-1},{6495,4,0,-1},{6495,5,0,-1}, +{6500,4,0,-1},{6500,5,0,-1},{6504,4,0,-1},{6504,5,0,-1},{6508,4,0,-1}, +{6508,5,0,-1},{6513,4,0,-1},{6513,5,0,-1},{6517,4,0,-1},{6517,5,0,-1}, +{6521,4,0,-1},{6521,5,0,-1},{6526,4,0,-1},{6526,5,0,-1},{6530,4,0,-1}, +{6530,5,0,-1},{6534,4,0,-1},{6534,5,0,-1},{6539,4,0,-1},{6539,5,0,-1}, +{6543,4,0,-1},{6543,5,0,-1},{6547,4,0,-1},{6547,5,0,-1},{6552,4,0,-1}, +{6552,5,0,-1},{6556,4,0,-1},{6556,5,0,-1},{6560,4,0,-1},{6560,5,0,-1}, +{6565,4,0,-1},{6565,5,0,-1},{6569,4,0,-1},{6569,5,0,-1},{6573,4,0,-1}, +{6573,5,0,-1},{6578,4,0,-1},{6578,5,0,-1},{6582,4,0,-1},{6582,5,0,-1}, +{6512,4,0,-1},{6586,4,0,-1},{6586,5,0,-1},{6591,4,0,-1},{6591,5,0,-1}, +{6595,4,0,-1},{6595,5,0,-1},{6525,5,0,-1},{6599,4,0,-1},{6599,5,0,-1}, +{6604,4,0,-1},{6604,5,0,-1},{6608,4,0,-1},{6608,5,0,-1},{6612,4,0,-1}, +{6612,5,0,-1},{6617,4,0,-1},{6617,5,0,-1},{6621,4,0,-1},{6621,5,0,-1}, +{6625,4,0,-1},{6625,5,0,-1},{6630,4,0,-1},{6630,5,0,-1},{6634,4,0,-1}, +{6634,5,0,-1},{6638,4,0,-1},{6638,5,0,-1},{6643,4,0,-1},{6643,5,0,-1}, +{6647,4,0,-1},{6647,5,0,-1},{6651,4,0,-1},{6651,5,0,-1},{6656,4,0,-1}, +{6656,5,0,-1},{6660,4,0,-1},{6660,5,0,-1},{6664,4,0,-1},{6664,5,0,-1}, +{6669,4,0,-1},{6669,5,0,-1},{6673,4,0,-1},{6673,5,0,-1},{6677,4,0,-1}, +{6677,5,0,-1},{6682,4,0,-1},{6682,5,0,-1},{6686,4,0,-1},{6686,5,0,-1}, +{6616,4,0,-1},{6690,4,0,-1},{6690,5,0,-1},{6695,4,0,-1},{6695,5,0,-1}, +{6699,4,0,-1},{6699,5,0,-1},{6629,5,0,-1},{6703,4,0,-1},{6703,5,0,-1}, +{6708,4,0,-1},{6708,5,0,-1},{6712,4,0,-1},{6712,5,0,-1},{6716,4,0,-1}, +{6716,5,0,-1},{6721,4,0,-1},{6721,5,0,-1},{6725,4,0,-1},{6725,5,0,-1}, +{6729,4,0,-1},{6729,5,0,-1},{6734,4,0,-1},{6734,5,0,-1},{6738,4,0,-1}, +{6738,5,0,-1},{6742,4,0,-1},{6742,5,0,-1},{6747,4,0,-1},{6747,5,0,-1}, +{6751,4,0,-1},{6751,5,0,-1},{6755,4,0,-1},{6755,5,0,-1},{6760,4,0,-1}, +{6760,5,0,-1},{6764,4,0,-1},{6764,5,0,-1},{6768,4,0,-1},{6768,5,0,-1}, +{6773,4,0,-1},{6773,5,0,-1},{6777,4,0,-1},{6777,5,0,-1},{6781,4,0,-1}, +{6781,5,0,-1},{6786,4,0,-1},{6786,5,0,-1},{6790,4,0,-1},{6790,5,0,-1}, +{6720,4,0,-1},{6794,4,0,-1},{6794,5,0,-1},{6799,4,0,-1},{6799,5,0,-1}, +{6803,4,0,-1},{6803,5,0,-1},{6733,5,0,-1},{6807,4,0,-1},{6807,5,0,-1}, +{6812,4,0,-1},{6812,5,0,-1},{6816,4,0,-1},{6816,5,0,-1},{6820,4,0,-1}, +{6820,5,0,-1},{6825,4,0,-1},{6825,5,0,-1},{6829,4,0,-1},{6829,5,0,-1}, +{6833,4,0,-1},{6833,5,0,-1},{6838,4,0,-1},{6838,5,0,-1},{6842,4,0,-1}, +{6842,5,0,-1},{6846,4,0,-1},{6846,5,0,-1},{6851,4,0,-1},{6851,5,0,-1}, +{6855,4,0,-1},{6855,5,0,-1},{6859,4,0,-1},{6859,5,0,-1},{6864,4,0,-1}, +{6864,5,0,-1},{6868,4,0,-1},{6868,5,0,-1},{6872,4,0,-1},{6872,5,0,-1}, +{6877,4,0,-1},{6877,5,0,-1},{6881,4,0,-1},{6881,5,0,-1},{6885,4,0,-1}, +{6885,5,0,-1},{6890,4,0,-1},{6890,5,0,-1},{6894,4,0,-1},{6894,5,0,-1}, +{6824,4,0,-1},{6898,4,0,-1},{6898,5,0,-1},{6903,4,0,-1},{6903,5,0,-1}, +{6907,4,0,-1},{6907,5,0,-1},{6837,5,0,-1},{6911,4,0,-1},{6911,5,0,-1}, +{6916,4,0,-1},{6916,5,0,-1},{6920,4,0,-1},{6920,5,0,-1},{6924,4,0,-1}, +{6924,5,0,-1},{6929,4,0,-1},{6929,5,0,-1},{6933,4,0,-1},{6933,5,0,-1}, +{6937,4,0,-1},{6937,5,0,-1},{6942,4,0,-1},{6942,5,0,-1},{6946,4,0,-1}, +{6946,5,0,-1},{6950,4,0,-1},{6950,5,0,-1},{6955,4,0,-1},{6955,5,0,-1}, +{6959,4,0,-1},{6959,5,0,-1},{6963,4,0,-1},{6963,5,0,-1},{6968,4,0,-1}, +{6968,5,0,-1},{6972,4,0,-1},{6972,5,0,-1},{6976,4,0,-1},{6976,5,0,-1}, +{6981,4,0,-1},{6981,5,0,-1},{6985,4,0,-1},{6985,5,0,-1},{6989,4,0,-1}, +{6989,5,0,-1},{6994,4,0,-1},{6994,5,0,-1},{6998,4,0,-1},{6998,5,0,-1}, +{6928,4,0,-1},{7002,4,0,-1},{7002,5,0,-1},{7007,4,0,-1},{7007,5,0,-1}, +{7011,4,0,-1},{7011,5,0,-1},{6941,5,0,-1},{7015,4,0,-1},{7015,5,0,-1}, +{7020,4,0,-1},{7020,5,0,-1},{7024,4,0,-1},{7024,5,0,-1},{7028,4,0,-1}, +{7028,5,0,-1},{7033,4,0,-1},{7033,5,0,-1},{7037,4,0,-1},{7037,5,0,-1}, +{7041,4,0,-1},{7041,5,0,-1},{7046,4,0,-1},{7046,5,0,-1},{7050,4,0,-1}, +{7050,5,0,-1},{7054,4,0,-1},{7054,5,0,-1},{7059,4,0,-1},{7059,5,0,-1}, +{7063,4,0,-1},{7063,5,0,-1},{7067,4,0,-1},{7067,5,0,-1},{7072,4,0,-1}, +{7072,5,0,-1},{7076,4,0,-1},{7076,5,0,-1},{7080,4,0,-1},{7080,5,0,-1}, +{7085,4,0,-1},{7085,5,0,-1},{7089,4,0,-1},{7089,5,0,-1},{7093,4,0,-1}, +{7093,5,0,-1},{7098,4,0,-1},{7098,5,0,-1},{7102,4,0,-1},{7102,5,0,-1}, +{7032,4,0,-1},{7106,4,0,-1},{7106,5,0,-1},{7111,4,0,-1},{7111,5,0,-1}, +{7115,4,0,-1},{7115,5,0,-1},{7045,5,0,-1},{7119,4,0,-1},{7119,5,0,-1}, +{7124,4,0,-1},{7124,5,0,-1},{7128,4,0,-1},{7128,5,0,-1},{7132,4,0,-1}, +{7132,5,0,-1},{7137,4,0,-1},{7137,5,0,-1},{7141,4,0,-1},{7141,5,0,-1}, +{7145,4,0,-1},{7145,5,0,-1},{7150,4,0,-1},{7150,5,0,-1},{7154,4,0,-1}, +{7154,5,0,-1},{7158,4,0,-1},{7158,5,0,-1},{7163,4,0,-1},{7163,5,0,-1}, +{7167,4,0,-1},{7167,5,0,-1},{7171,4,0,-1},{7171,5,0,-1},{7176,4,0,-1}, +{7176,5,0,-1},{7180,4,0,-1},{7180,5,0,-1},{7184,4,0,-1},{7184,5,0,-1}, +{7189,4,0,-1},{7189,5,0,-1},{7193,4,0,-1},{7193,5,0,-1},{7197,4,0,-1}, +{7197,5,0,-1},{7202,4,0,-1},{7202,5,0,-1},{7206,4,0,-1},{7206,5,0,-1}, +{7136,4,0,-1},{7210,4,0,-1},{7210,5,0,-1},{7215,4,0,-1},{7215,5,0,-1}, +{7219,4,0,-1},{7219,5,0,-1},{7149,5,0,-1},{7223,4,0,-1},{7223,5,0,-1}, +{7228,4,0,-1},{7228,5,0,-1},{7232,4,0,-1},{7232,5,0,-1},{7236,4,0,-1}, +{7236,5,0,-1},{7241,4,0,-1},{7241,5,0,-1},{7245,4,0,-1},{7245,5,0,-1}, +{7249,4,0,-1},{7249,5,0,-1},{7254,4,0,-1},{7254,5,0,-1},{7258,4,0,-1}, +{7258,5,0,-1},{7262,4,0,-1},{7262,5,0,-1},{7267,4,0,-1},{7267,5,0,-1}, +{7271,4,0,-1},{7271,5,0,-1},{7275,4,0,-1},{7275,5,0,-1},{7280,4,0,-1}, +{7280,5,0,-1},{7284,4,0,-1},{7284,5,0,-1},{7288,4,0,-1},{7288,5,0,-1}, +{7293,4,0,-1},{7293,5,0,-1},{7297,4,0,-1},{7297,5,0,-1},{7301,4,0,-1}, +{7301,5,0,-1},{7306,4,0,-1},{7306,5,0,-1},{7310,4,0,-1},{7310,5,0,-1}, +{7240,4,0,-1},{7314,4,0,-1},{7314,5,0,-1},{7319,4,0,-1},{7319,5,0,-1}, +{7323,4,0,-1},{7323,5,0,-1},{7253,5,0,-1},{7327,4,0,-1},{7327,5,0,-1}, +{7332,4,0,-1},{7332,5,0,-1},{7336,4,0,-1},{7336,5,0,-1},{7340,4,0,-1}, +{7340,5,0,-1},{7345,4,0,-1},{7345,5,0,-1},{7349,4,0,-1},{7349,5,0,-1}, +{7353,4,0,-1},{7353,5,0,-1},{7358,4,0,-1},{7358,5,0,-1},{7362,4,0,-1}, +{7362,5,0,-1},{7366,4,0,-1},{7366,5,0,-1},{7371,4,0,-1},{7371,5,0,-1}, +{7375,4,0,-1},{7375,5,0,-1},{7379,4,0,-1},{7379,5,0,-1},{7384,4,0,-1}, +{7384,5,0,-1},{7388,4,0,-1},{7388,5,0,-1},{7392,4,0,-1},{7392,5,0,-1}, +{7397,4,0,-1},{7397,5,0,-1},{7401,4,0,-1},{7401,5,0,-1},{7405,4,0,-1}, +{7405,5,0,-1},{7410,4,0,-1},{7410,5,0,-1},{7414,4,0,-1},{7414,5,0,-1}, +{7344,4,0,-1},{7418,4,0,-1},{7418,5,0,-1},{7423,4,0,-1},{7423,5,0,-1}, +{7427,4,0,-1},{7427,5,0,-1},{7357,5,0,-1},{7431,4,0,-1},{7431,5,0,-1}, +{7436,4,0,-1},{7436,5,0,-1},{7440,4,0,-1},{7440,5,0,-1},{7444,4,0,-1}, +{7444,5,0,-1},{7449,4,0,-1},{7449,5,0,-1},{7453,4,0,-1},{7453,5,0,-1}, +{7457,4,0,-1},{7457,5,0,-1},{7462,4,0,-1},{7462,5,0,-1},{7466,4,0,-1}, +{7466,5,0,-1},{7470,4,0,-1},{7470,5,0,-1},{7475,4,0,-1},{7475,5,0,-1}, +{7479,4,0,-1},{7479,5,0,-1},{7483,4,0,-1},{7483,5,0,-1},{7488,4,0,-1}, +{7488,5,0,-1},{7492,4,0,-1},{7492,5,0,-1},{7496,4,0,-1},{7496,5,0,-1}, +{7501,4,0,-1},{7501,5,0,-1},{7505,4,0,-1},{7505,5,0,-1},{7509,4,0,-1}, +{7509,5,0,-1},{7514,4,0,-1},{7514,5,0,-1},{7518,4,0,-1},{7518,5,0,-1}, +{7448,4,0,-1},{7522,4,0,-1},{7522,5,0,-1},{7527,4,0,-1},{7527,5,0,-1}, +{7531,4,0,-1},{7531,5,0,-1},{7461,5,0,-1},{7535,4,0,-1},{7535,5,0,-1}, +{7540,4,0,-1},{7540,5,0,-1},{7544,4,0,-1},{7544,5,0,-1},{7548,4,0,-1}, +{7548,5,0,-1},{7553,4,0,-1},{7553,5,0,-1},{7557,4,0,-1},{7557,5,0,-1}, +{7561,4,0,-1},{7561,5,0,-1},{7566,4,0,-1},{7566,5,0,-1},{7570,4,0,-1}, +{7570,5,0,-1},{7574,4,0,-1},{7574,5,0,-1},{7579,4,0,-1},{7579,5,0,-1}, +{7583,4,0,-1},{7583,5,0,-1},{7587,4,0,-1},{7587,5,0,-1},{7592,4,0,-1}, +{7592,5,0,-1},{7596,4,0,-1},{7596,5,0,-1},{7600,4,0,-1},{7600,5,0,-1}, +{7605,4,0,-1},{7605,5,0,-1},{7609,4,0,-1},{7609,5,0,-1},{7613,4,0,-1}, +{7613,5,0,-1},{7618,4,0,-1},{7618,5,0,-1},{7622,4,0,-1},{7622,5,0,-1}, +{7552,4,0,-1},{7626,4,0,-1},{7626,5,0,-1},{7631,4,0,-1},{7631,5,0,-1}, +{7635,4,0,-1},{7635,5,0,-1},{7565,5,0,-1},{7639,4,0,-1},{7639,5,0,-1}, +{7644,4,0,-1},{7644,5,0,-1},{7648,4,0,-1},{7648,5,0,-1},{7652,4,0,-1}, +{7652,5,0,-1},{7657,4,0,-1},{7657,5,0,-1},{7661,4,0,-1},{7661,5,0,-1}, +{7665,4,0,-1},{7665,5,0,-1},{7670,4,0,-1},{7670,5,0,-1},{7674,4,0,-1}, +{7674,5,0,-1},{7678,4,0,-1},{7678,5,0,-1},{7683,4,0,-1},{7683,5,0,-1}, +{7687,4,0,-1},{7687,5,0,-1},{7691,4,0,-1},{7691,5,0,-1},{7696,4,0,-1}, +{7696,5,0,-1},{7700,4,0,-1},{7700,5,0,-1},{7704,4,0,-1},{7704,5,0,-1}, +{7709,4,0,-1},{7709,5,0,-1},{7713,4,0,-1},{7713,5,0,-1},{7717,4,0,-1}, +{7717,5,0,-1},{7722,4,0,-1},{7722,5,0,-1},{7726,4,0,-1},{7726,5,0,-1}, +{7656,4,0,-1},{7730,4,0,-1},{7730,5,0,-1},{7735,4,0,-1},{7735,5,0,-1}, +{7739,4,0,-1},{7739,5,0,-1},{7669,5,0,-1},{7743,4,0,-1},{7743,5,0,-1}, +{7748,4,0,-1},{7748,5,0,-1},{7752,4,0,-1},{7752,5,0,-1},{7756,4,0,-1}, +{7756,5,0,-1},{7761,4,0,-1},{7761,5,0,-1},{7765,4,0,-1},{7765,5,0,-1}, +{7769,4,0,-1},{7769,5,0,-1},{7774,4,0,-1},{7774,5,0,-1},{7778,4,0,-1}, +{7778,5,0,-1},{7782,4,0,-1},{7782,5,0,-1},{7787,4,0,-1},{7787,5,0,-1}, +{7791,4,0,-1},{7791,5,0,-1},{7795,4,0,-1},{7795,5,0,-1},{7800,4,0,-1}, +{7800,5,0,-1},{7804,4,0,-1},{7804,5,0,-1},{7808,4,0,-1},{7808,5,0,-1}, +{7813,4,0,-1},{7813,5,0,-1},{7817,4,0,-1},{7817,5,0,-1},{7821,4,0,-1}, +{7821,5,0,-1},{7826,4,0,-1},{7826,5,0,-1},{7830,4,0,-1},{7830,5,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7834,5,0,-1},{7839,4,0,-1},{7839,5,0,-1}, +{7843,4,0,-1},{7843,5,0,-1},{7773,5,0,-1},{7847,4,0,-1},{7847,5,0,-1}, +{7852,4,0,-1},{7852,5,0,-1},{7856,4,0,-1},{7856,5,0,-1},{7860,4,0,-1}, +{7860,5,0,-1},{7865,4,0,-1},{7865,5,0,-1},{7869,4,0,-1},{7869,5,0,-1}, +{7873,4,0,-1},{7873,5,0,-1},{7878,4,0,-1},{7878,5,0,-1},{7882,4,0,-1}, +{7882,5,0,-1},{7886,4,0,-1},{7886,5,0,-1},{7891,4,0,-1},{7891,5,0,-1}, +{7895,4,0,-1},{7895,5,0,-1},{7899,4,0,-1},{7899,5,0,-1},{7904,4,0,-1}, +{7904,5,0,-1},{7908,4,0,-1},{7908,5,0,-1},{7912,4,0,-1},{7912,5,0,-1}, +{7917,4,0,-1},{7917,5,0,-1},{7921,4,0,-1},{7921,5,0,-1},{7925,4,0,-1}, +{7925,5,0,-1},{7930,4,0,-1},{7930,5,0,-1},{7934,4,0,-1},{7934,5,0,-1}, +{7864,4,0,-1},{7938,4,0,-1},{7938,5,0,-1},{7943,4,0,-1},{7943,5,0,-1}, +{7947,4,0,-1},{7947,5,0,-1},{7877,5,0,-1},{7951,4,0,-1},{7951,5,0,-1}, +{7956,4,0,-1},{7956,5,0,-1},{7960,4,0,-1},{7960,5,0,-1},{7964,4,0,-1}, +{7964,5,0,-1},{7969,4,0,-1},{7969,5,0,-1},{7973,4,0,-1},{7973,5,0,-1}, +{7977,4,0,-1},{7977,5,0,-1},{7982,4,0,-1},{7982,5,0,-1},{7986,4,0,-1}, +{7986,5,0,-1},{7990,4,0,-1},{7990,5,0,-1},{7995,4,0,-1},{7995,5,0,-1}, +{7999,4,0,-1},{7999,5,0,-1},{8003,4,0,-1},{8003,5,0,-1},{8008,4,0,-1}, +{8008,5,0,-1},{8012,4,0,-1},{8012,5,0,-1},{8016,4,0,-1},{8016,5,0,-1}, +{8021,4,0,-1},{8021,5,0,-1},{8025,4,0,-1},{8025,5,0,-1},{8029,4,0,-1}, +{8029,5,0,-1},{8034,4,0,-1},{8034,5,0,-1},{8038,4,0,-1},{8038,5,0,-1}, +{7968,4,0,-1},{8042,4,0,-1},{8042,5,0,-1},{8047,4,0,-1},{8047,5,0,-1}, +{8051,4,0,-1},{8051,5,0,-1},{7981,5,0,-1},{8055,4,0,-1},{8055,5,0,-1}, +{8060,4,0,-1},{8060,5,0,-1},{8064,4,0,-1},{8064,5,0,-1},{8068,4,0,-1}, +{8068,5,0,-1},{8073,4,0,-1},{8073,5,0,-1},{8077,4,0,-1},{8077,5,0,-1}, +{8081,4,0,-1},{8081,5,0,-1},{8086,4,0,-1},{8086,5,0,-1},{8090,4,0,-1}, +{8090,5,0,-1},{8094,4,0,-1},{8094,5,0,-1},{8099,4,0,-1},{8099,5,0,-1}, +{8103,4,0,-1},{8103,5,0,-1},{8107,4,0,-1},{8107,5,0,-1},{8112,4,0,-1}, +{8112,5,0,-1},{8116,4,0,-1},{8116,5,0,-1},{8120,4,0,-1},{8120,5,0,-1}, +{8125,4,0,-1},{8125,5,0,-1},{8129,4,0,-1},{8129,5,0,-1},{8133,4,0,-1}, +{8133,5,0,-1},{8138,4,0,-1},{8138,5,0,-1},{8142,4,0,-1},{8142,5,0,-1}, +{8072,4,0,-1},{8146,4,0,-1},{8146,5,0,-1},{8151,4,0,-1},{8151,5,0,-1}, +{8155,4,0,-1},{8155,5,0,-1},{8085,5,0,-1},{8159,4,0,-1},{8159,5,0,-1}, +{8164,4,0,-1},{8164,5,0,-1},{8168,4,0,-1},{8168,5,0,-1},{8172,4,0,-1}, +{8172,5,0,-1},{8177,4,0,-1},{8177,5,0,-1},{8181,4,0,-1},{8181,5,0,-1}, +{8185,4,0,-1},{8185,5,0,-1},{8190,4,0,-1},{8190,5,0,-1},{8194,4,0,-1}, +{8194,5,0,-1},{8198,4,0,-1},{8198,5,0,-1},{8203,4,0,-1},{8203,5,0,-1}, +{8207,4,0,-1},{8207,5,0,-1},{8211,4,0,-1},{8211,5,0,-1},{8216,4,0,-1}, +{8216,5,0,-1},{8220,4,0,-1},{8220,5,0,-1},{8224,4,0,-1},{8224,5,0,-1}, +{8229,4,0,-1},{8229,5,0,-1},{8233,4,0,-1},{8233,5,0,-1},{8237,4,0,-1}, +{8237,5,0,-1},{8242,4,0,-1},{8242,5,0,-1},{8246,4,0,-1},{8246,5,0,-1}, +{8176,4,0,-1},{8250,4,0,-1},{8250,5,0,-1},{8255,4,0,-1},{8255,5,0,-1}, +{8259,4,0,-1},{8259,5,0,-1},{8189,5,0,-1},{8263,4,0,-1},{8263,5,0,-1}, +{8268,4,0,-1},{8268,5,0,-1},{8272,4,0,-1},{8272,5,0,-1},{8276,4,0,-1}, +{8276,5,0,-1},{8281,4,0,-1},{8281,5,0,-1},{8285,4,0,-1},{8285,5,0,-1}, +{8289,4,0,-1},{8289,5,0,-1},{8294,4,0,-1},{8294,5,0,-1},{8298,4,0,-1}, +{8298,5,0,-1},{8302,4,0,-1},{8302,5,0,-1},{8307,4,0,-1},{8307,5,0,-1}, +{8311,4,0,-1},{8311,5,0,-1},{8315,4,0,-1},{8315,5,0,-1},{8320,4,0,-1}, +{8320,5,0,-1},{8324,4,0,-1},{8324,5,0,-1},{8328,4,0,-1},{8328,5,0,-1}, +{8333,4,0,-1},{8333,5,0,-1},{8337,4,0,-1},{8337,5,0,-1},{8341,4,0,-1}, +{8341,5,0,-1},{8346,4,0,-1},{8346,5,0,-1},{8350,4,0,-1},{8350,5,0,-1}, +{8280,4,0,-1},{8354,4,0,-1},{8354,5,0,-1},{8359,4,0,-1},{8359,5,0,-1}, +{8363,4,0,-1},{8363,5,0,-1},{8293,5,0,-1},{8367,4,0,-1},{8367,5,0,-1}, +{8372,4,0,-1},{8372,5,0,-1},{8376,4,0,-1},{8376,5,0,-1},{8380,4,0,-1}, +{8380,5,0,-1},{8385,4,0,-1},{8385,5,0,-1},{8389,4,0,-1},{8389,5,0,-1}, +{8393,4,0,-1},{8393,5,0,-1},{8398,4,0,-1},{8398,5,0,-1},{8402,4,0,-1}, +{8402,5,0,-1},{8406,4,0,-1},{8406,5,0,-1},{8411,4,0,-1},{8411,5,0,-1}, +{8415,4,0,-1},{8415,5,0,-1},{8419,4,0,-1},{8419,5,0,-1},{8424,4,0,-1}, +{8424,5,0,-1},{8428,4,0,-1},{8428,5,0,-1},{8432,4,0,-1},{8432,5,0,-1}, +{8437,4,0,-1},{8437,5,0,-1},{8441,4,0,-1},{8441,5,0,-1},{8445,4,0,-1}, +{8445,5,0,-1},{8450,4,0,-1},{8450,5,0,-1},{8454,4,0,-1},{8454,5,0,-1}, +{8384,4,0,-1},{8458,4,0,-1},{8458,5,0,-1},{8463,4,0,-1},{8463,5,0,-1}, +{8467,4,0,-1},{8467,5,0,-1},{8397,5,0,-1},{8471,4,0,-1},{8471,5,0,-1}, +{8476,4,0,-1},{8476,5,0,-1},{8480,4,0,-1},{8480,5,0,-1},{8484,4,0,-1}, +{8484,5,0,-1},{8489,4,0,-1},{8489,5,0,-1},{8493,4,0,-1},{8493,5,0,-1}, +{8497,4,0,-1},{8497,5,0,-1},{8502,4,0,-1},{8502,5,0,-1},{8506,4,0,-1}, +{8506,5,0,-1},{8510,4,0,-1},{8510,5,0,-1},{8515,4,0,-1},{8515,5,0,-1}, +{8519,4,0,-1},{8519,5,0,-1},{8523,4,0,-1},{8523,5,0,-1},{8528,4,0,-1}, +{8528,5,0,-1},{8532,4,0,-1},{8532,5,0,-1},{8536,4,0,-1},{8536,5,0,-1}, +{8541,4,0,-1},{8541,5,0,-1},{8545,4,0,-1},{8545,5,0,-1},{8549,4,0,-1}, +{8549,5,0,-1},{8554,4,0,-1},{8554,5,0,-1},{8558,4,0,-1},{8558,5,0,-1}, +{8488,4,0,-1},{8562,4,0,-1},{8562,5,0,-1},{8567,4,0,-1},{8567,5,0,-1}, +{8571,4,0,-1},{8571,5,0,-1},{8501,5,0,-1},{8575,4,0,-1},{8575,5,0,-1}, +{8580,4,0,-1},{8580,5,0,-1},{8584,4,0,-1},{8584,5,0,-1},{8588,4,0,-1}, +{8588,5,0,-1},{8593,4,0,-1},{8593,5,0,-1},{8597,4,0,-1},{8597,5,0,-1}, +{8601,4,0,-1},{8601,5,0,-1},{8606,4,0,-1},{8606,5,0,-1},{8610,4,0,-1}, +{8610,5,0,-1},{8614,4,0,-1},{8614,5,0,-1},{8619,4,0,-1},{8619,5,0,-1}, +{8623,4,0,-1},{8623,5,0,-1},{8627,4,0,-1},{8627,5,0,-1},{8632,4,0,-1}, +{8632,5,0,-1},{8636,4,0,-1},{8636,5,0,-1},{8640,4,0,-1},{8640,5,0,-1}, +{8645,4,0,-1},{8645,5,0,-1},{8649,4,0,-1},{8649,5,0,-1},{8653,4,0,-1}, +{8653,5,0,-1},{8658,4,0,-1},{8658,5,0,-1},{8662,4,0,-1},{8662,5,0,-1}, +{8592,4,0,-1},{8666,4,0,-1},{8666,5,0,-1},{8671,4,0,-1},{8671,5,0,-1}, +{8675,4,0,-1},{8675,5,0,-1},{8605,5,0,-1},{8679,4,0,-1},{8679,5,0,-1}, +{8684,4,0,-1},{8684,5,0,-1},{8688,4,0,-1},{8688,5,0,-1},{8692,4,0,-1}, +{8692,5,0,-1},{8697,4,0,-1},{8697,5,0,-1},{8701,4,0,-1},{8701,5,0,-1}, +{8705,4,0,-1},{8705,5,0,-1},{8710,4,0,-1},{8710,5,0,-1},{8714,4,0,-1}, +{8714,5,0,-1},{8718,4,0,-1},{8718,5,0,-1},{8723,4,0,-1},{8723,5,0,-1}, +{8727,4,0,-1},{8727,5,0,-1},{8731,4,0,-1},{8731,5,0,-1},{8736,4,0,-1}, +{8736,5,0,-1},{8740,4,0,-1},{8740,5,0,-1},{8744,4,0,-1},{8744,5,0,-1}, +{8749,4,0,-1},{8749,5,0,-1},{8753,4,0,-1},{8753,5,0,-1},{8757,4,0,-1}, +{8757,5,0,-1},{8762,4,0,-1},{8762,5,0,-1},{8766,4,0,-1},{8766,5,0,-1}, +{8696,4,0,-1},{8770,4,0,-1},{8770,5,0,-1},{8775,4,0,-1},{8775,5,0,-1}, +{8779,4,0,-1},{8779,5,0,-1},{8709,5,0,-1},{8783,4,0,-1},{8783,5,0,-1}, +{8788,4,0,-1},{8788,5,0,-1},{8792,4,0,-1},{8792,5,0,-1},{8796,4,0,-1}, +{8796,5,0,-1},{8801,4,0,-1},{8801,5,0,-1},{8805,4,0,-1},{8805,5,0,-1}, +{8809,4,0,-1},{8809,5,0,-1},{8814,4,0,-1},{8814,5,0,-1},{8818,4,0,-1}, +{8818,5,0,-1},{8822,4,0,-1},{8822,5,0,-1},{8827,4,0,-1},{8827,5,0,-1}, +{8831,4,0,-1},{8831,5,0,-1},{8835,4,0,-1},{8835,5,0,-1},{8840,4,0,-1}, +{8840,5,0,-1},{8844,4,0,-1},{8844,5,0,-1},{8848,4,0,-1},{8848,5,0,-1}, +{8853,4,0,-1},{8853,5,0,-1},{8857,4,0,-1},{8857,5,0,-1},{8861,4,0,-1}, +{8861,5,0,-1},{8866,4,0,-1},{8866,5,0,-1},{8870,4,0,-1},{8870,5,0,-1}, +{8800,4,0,-1},{8874,4,0,-1},{8874,5,0,-1},{8879,4,0,-1},{8879,5,0,-1}, +{8883,4,0,-1},{8883,5,0,-1},{8813,5,0,-1},{8887,4,0,-1},{8887,5,0,-1}, +{8892,4,0,-1},{8892,5,0,-1},{8896,4,0,-1},{8896,5,0,-1},{8900,4,0,-1}, +{8900,5,0,-1},{8905,4,0,-1},{8905,5,0,-1},{8909,4,0,-1},{8909,5,0,-1}, +{8913,4,0,-1},{8913,5,0,-1},{8918,4,0,-1},{8918,5,0,-1},{8922,4,0,-1}, +{8922,5,0,-1},{8926,4,0,-1},{8926,5,0,-1},{8931,4,0,-1},{8931,5,0,-1}, +{8935,4,0,-1},{8935,5,0,-1},{8939,4,0,-1},{8939,5,0,-1},{8944,4,0,-1}, +{8944,5,0,-1},{8948,4,0,-1},{8948,5,0,-1},{8952,4,0,-1},{8952,5,0,-1}, +{8957,4,0,-1},{8957,5,0,-1},{8961,4,0,-1},{8961,5,0,-1},{8965,4,0,-1}, +{8965,5,0,-1},{8970,4,0,-1},{8970,5,0,-1},{8974,4,0,-1},{8974,5,0,-1}, +{8904,4,0,-1},{8978,4,0,-1},{8978,5,0,-1},{8983,4,0,-1},{8983,5,0,-1}, +{8987,4,0,-1},{8987,5,0,-1},{8917,5,0,-1},{8991,4,0,-1},{8991,5,0,-1}, +{8996,4,0,-1},{8996,5,0,-1},{9000,4,0,-1},{9000,5,0,-1},{9004,4,0,-1}, +{9004,5,0,-1},{9009,4,0,-1},{9009,5,0,-1},{9013,4,0,-1},{9013,5,0,-1}, +{9017,4,0,-1},{9017,5,0,-1},{9022,4,0,-1},{9022,5,0,-1},{9026,4,0,-1}, +{9026,5,0,-1},{9030,4,0,-1},{9030,5,0,-1},{9035,4,0,-1},{9035,5,0,-1}, +{9039,4,0,-1},{9039,5,0,-1},{9043,4,0,-1},{9043,5,0,-1},{9048,4,0,-1}, +{9048,5,0,-1},{9052,4,0,-1},{9052,5,0,-1},{9056,4,0,-1},{9056,5,0,-1}, +{9061,4,0,-1},{9061,5,0,-1},{9065,4,0,-1},{9065,5,0,-1},{9069,4,0,-1}, +{9069,5,0,-1},{9074,4,0,-1},{9074,5,0,-1},{9078,4,0,-1},{9078,5,0,-1}, +{9008,4,0,-1},{9082,4,0,-1},{9082,5,0,-1},{9087,4,0,-1},{9087,5,0,-1}, +{9091,4,0,-1},{9091,5,0,-1},{9021,5,0,-1},{9095,4,0,-1},{9095,5,0,-1}, +{9100,4,0,-1},{9100,5,0,-1},{9104,4,0,-1},{9104,5,0,-1},{9108,4,0,-1}, +{9108,5,0,-1},{9113,4,0,-1},{9113,5,0,-1},{9117,4,0,-1},{9117,5,0,-1}, +{9121,4,0,-1},{9121,5,0,-1},{9126,4,0,-1},{9126,5,0,-1},{9130,4,0,-1}, +{9130,5,0,-1},{9134,4,0,-1},{9134,5,0,-1},{9139,4,0,-1},{9139,5,0,-1}, +{9143,4,0,-1},{9143,5,0,-1},{9147,4,0,-1},{9147,5,0,-1},{9152,4,0,-1}, +{9152,5,0,-1},{9156,4,0,-1},{9156,5,0,-1},{9160,4,0,-1},{9160,5,0,-1}, +{9165,4,0,-1},{9165,5,0,-1},{9169,4,0,-1},{9169,5,0,-1},{9173,4,0,-1}, +{9173,5,0,-1},{9178,4,0,-1},{9178,5,0,-1},{9182,4,0,-1},{9182,5,0,-1}, +{9112,4,0,-1},{9186,4,0,-1},{9186,5,0,-1},{9191,4,0,-1},{9191,5,0,-1}, +{9195,4,0,-1},{9195,5,0,-1},{9125,5,0,-1},{9199,4,0,-1},{9199,5,0,-1}, +{9204,4,0,-1},{9204,5,0,-1},{9208,4,0,-1},{9208,5,0,-1},{9212,4,0,-1}, +{9212,5,0,-1},{9217,4,0,-1},{9217,5,0,-1},{9221,4,0,-1},{9221,5,0,-1}, +{9225,4,0,-1},{9225,5,0,-1},{9230,4,0,-1},{9230,5,0,-1},{9234,4,0,-1}, +{9234,5,0,-1},{9238,4,0,-1},{9238,5,0,-1},{9243,4,0,-1},{9243,5,0,-1}, +{9247,4,0,-1},{9247,5,0,-1},{9251,4,0,-1},{9251,5,0,-1},{9256,4,0,-1}, +{9256,5,0,-1},{9260,4,0,-1},{9260,5,0,-1},{9264,4,0,-1},{9264,5,0,-1}, +{9269,4,0,-1},{9269,5,0,-1},{9273,4,0,-1},{9273,5,0,-1},{9277,4,0,-1}, +{9277,5,0,-1},{9282,4,0,-1},{9282,5,0,-1},{9286,4,0,-1},{9286,5,0,-1}, +{9216,4,0,-1},{9290,4,0,-1},{9290,5,0,-1},{9295,4,0,-1},{9295,5,0,-1}, +{9299,4,0,-1},{9299,5,0,-1},{9229,5,0,-1},{9303,4,0,-1},{9303,5,0,-1}, +{9308,4,0,-1},{9308,5,0,-1},{9312,4,0,-1},{9312,5,0,-1},{9316,4,0,-1}, +{9316,5,0,-1},{9321,4,0,-1},{9321,5,0,-1},{9325,4,0,-1},{9325,5,0,-1}, +{9329,4,0,-1},{9329,5,0,-1},{9334,4,0,-1},{9334,5,0,-1},{9338,4,0,-1}, +{9338,5,0,-1},{9342,4,0,-1},{9342,5,0,-1},{9347,4,0,-1},{9347,5,0,-1}, +{9351,4,0,-1},{9351,5,0,-1},{9355,4,0,-1},{9355,5,0,-1},{9360,4,0,-1}, +{9360,5,0,-1},{9364,4,0,-1},{9364,5,0,-1},{9368,4,0,-1},{9368,5,0,-1}, +{9373,4,0,-1},{9373,5,0,-1},{9377,4,0,-1},{9377,5,0,-1},{9381,4,0,-1}, +{9381,5,0,-1},{9386,4,0,-1},{9386,5,0,-1},{9390,4,0,-1},{9390,5,0,-1}, +{9320,4,0,-1},{9394,4,0,-1},{9394,5,0,-1},{9399,4,0,-1},{9399,5,0,-1}, +{9403,4,0,-1},{9403,5,0,-1},{9333,5,0,-1},{9407,4,0,-1},{9407,5,0,-1}, +{9412,4,0,-1},{9412,5,0,-1},{9416,4,0,-1},{9416,5,0,-1},{9420,4,0,-1}, +{9420,5,0,-1},{9425,4,0,-1},{9425,5,0,-1},{9429,4,0,-1},{9429,5,0,-1}, +{9433,4,0,-1},{9433,5,0,-1},{9438,4,0,-1},{9438,5,0,-1},{9442,4,0,-1}, +{9442,5,0,-1},{9446,4,0,-1},{9446,5,0,-1},{9451,4,0,-1},{9451,5,0,-1}, +{9455,4,0,-1},{9455,5,0,-1},{9459,4,0,-1},{9459,5,0,-1},{9464,4,0,-1}, +{9464,5,0,-1},{9468,4,0,-1},{9468,5,0,-1},{9472,4,0,-1},{9472,5,0,-1}, +{9477,4,0,-1},{9477,5,0,-1},{9481,4,0,-1},{9481,5,0,-1},{9485,4,0,-1}, +{9485,5,0,-1},{9490,4,0,-1},{9490,5,0,-1},{9494,4,0,-1},{9494,5,0,-1}, +{9424,4,0,-1},{9498,4,0,-1},{9498,5,0,-1},{9503,4,0,-1},{9503,5,0,-1}, +{9507,4,0,-1},{9507,5,0,-1},{9437,5,0,-1},{9511,4,0,-1},{9511,5,0,-1}, +{9516,4,0,-1},{9516,5,0,-1},{9520,4,0,-1},{9520,5,0,-1},{9524,4,0,-1}, +{9524,5,0,-1},{9529,4,0,-1},{9529,5,0,-1},{9533,4,0,-1},{9533,5,0,-1}, +{9537,4,0,-1},{9537,5,0,-1},{9542,4,0,-1},{9542,5,0,-1},{9546,4,0,-1}, +{9546,5,0,-1},{9550,4,0,-1},{9550,5,0,-1},{9555,4,0,-1},{9555,5,0,-1}, +{9559,4,0,-1},{9559,5,0,-1},{9563,4,0,-1},{9563,5,0,-1},{9568,4,0,-1}, +{9568,5,0,-1},{9572,4,0,-1},{9572,5,0,-1},{9576,4,0,-1},{9576,5,0,-1}, +{9581,4,0,-1},{9581,5,0,-1},{9585,4,0,-1},{9585,5,0,-1},{9589,4,0,-1}, +{9589,5,0,-1},{9594,4,0,-1},{9594,5,0,-1},{9598,4,0,-1},{9598,5,0,-1}, +{9528,4,0,-1},{9602,4,0,-1},{9602,5,0,-1},{9607,4,0,-1},{9607,5,0,-1}, +{9611,4,0,-1},{9611,5,0,-1},{9541,5,0,-1},{9615,4,0,-1},{9615,5,0,-1}, +{9620,4,0,-1},{9620,5,0,-1},{9624,4,0,-1},{9624,5,0,-1},{9628,4,0,-1}, +{9628,5,0,-1},{9633,4,0,-1},{9633,5,0,-1},{9637,4,0,-1},{9637,5,0,-1}, +{9641,4,0,-1},{9641,5,0,-1},{9646,4,0,-1},{9646,5,0,-1},{9650,4,0,-1}, +{9650,5,0,-1},{9654,4,0,-1},{9654,5,0,-1},{9659,4,0,-1},{9659,5,0,-1}, +{9663,4,0,-1},{9663,5,0,-1},{9667,4,0,-1},{9667,5,0,-1},{9672,4,0,-1}, +{9672,5,0,-1},{9676,4,0,-1},{9676,5,0,-1},{9680,4,0,-1},{9680,5,0,-1}, +{9685,4,0,-1},{9689,4,0,-1},{9689,5,0,-1},{9693,4,0,-1},{9698,4,0,-1}, +{9702,4,0,-1},{9632,4,0,-1},{9706,4,0,-1},{9706,5,0,-1},{9711,4,0,-1}, +{9711,5,0,-1},{9715,4,0,-1},{9715,5,0,-1},{9645,5,0,-1},{9719,4,0,-1}, +{9719,5,0,-1},{9724,4,0,-1},{9724,5,0,-1},{9728,4,0,-1},{9728,5,0,-1}, +{9732,4,0,-1},{9737,4,0,-1},{9741,4,0,-1},{9741,5,0,-1},{9745,4,0,-1}, +{9745,5,0,-1},{9750,4,0,-1},{9754,4,0,-1},{9758,4,0,-1},{9763,4,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS6 and TS7 */ +struct fn_sample test_fn_tch_f_ts_6_7[] = { +{4753,0,1,-1},{4784,0,1,-1},{4835,0,1,-1},{4855,0,1,-1},{4886,0,1,-1}, +{4937,0,1,-1},{4957,0,1,-1},{4988,0,1,-1},{5039,0,1,-1},{5090,0,1,-1}, +{5141,0,1,-1},{5198,0,2,-1},{5208,0,2,-1},{5249,0,2,-1},{5300,0,2,-1}, +{5310,0,2,-1},{5351,0,2,-1},{5402,0,2,-1},{5453,0,2,-1},{5504,0,2,-1}, +{5555,0,2,-1},{8597,6,0,-1},{8627,6,0,-1},{8632,6,0,-1},{8636,6,0,-1}, +{8640,6,0,-1},{8645,6,0,-1},{8649,6,0,-1},{8653,6,0,-1},{8658,6,0,-1}, +{8662,6,0,-1},{8666,6,0,-1},{8671,6,0,-1},{8675,6,0,-1},{8679,6,0,-1}, +{8684,6,0,-1},{8688,6,0,-1},{8618,6,0,-1},{8692,6,0,-1},{8697,6,0,-1}, +{8701,6,0,-1},{8705,6,0,-1},{8710,6,0,-1},{8714,6,0,-1},{8718,6,0,-1}, +{8723,6,0,-1},{8727,6,0,-1},{8731,6,0,-1},{8736,6,0,-1},{8740,6,0,-1}, +{8744,6,0,-1},{8749,6,0,-1},{8753,6,0,-1},{8757,6,0,-1},{8762,6,0,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8775,6,0,-1},{8779,6,0,-1},{8783,6,0,-1}, +{8788,6,0,-1},{8792,6,0,-1},{8722,6,0,-1},{8796,6,0,-1},{8801,6,0,-1}, +{8805,6,0,-1},{8809,6,0,-1},{8814,6,0,-1},{8818,6,0,-1},{8822,6,0,-1}, +{8827,6,0,-1},{8831,6,0,-1},{8835,6,0,-1},{8840,6,0,-1},{8844,6,0,-1}, +{8848,6,0,-1},{8853,6,0,-1},{8857,6,0,-1},{8861,6,0,-1},{8866,6,0,-1}, +{8870,6,0,-1},{8874,6,0,-1},{8874,7,0,-1},{8879,6,0,-1},{8879,7,0,-1}, +{8883,6,0,-1},{8883,7,0,-1},{8887,6,0,-1},{8887,7,0,-1},{8892,6,0,-1}, +{8892,7,0,-1},{8896,6,0,-1},{8896,7,0,-1},{8826,6,0,-1},{8900,6,0,-1}, +{8900,7,0,-1},{8905,6,0,-1},{8905,7,0,-1},{8909,6,0,-1},{8909,7,0,-1}, +{8913,6,0,-1},{8913,7,0,-1},{8918,6,0,-1},{8918,7,0,-1},{8922,6,0,-1}, +{8922,7,0,-1},{8926,6,0,-1},{8926,7,0,-1},{8931,6,0,-1},{8931,7,0,-1}, +{8935,6,0,-1},{8935,7,0,-1},{8939,6,0,-1},{8939,7,0,-1},{8944,6,0,-1}, +{8944,7,0,-1},{8948,6,0,-1},{8948,7,0,-1},{8952,6,0,-1},{8952,7,0,-1}, +{8957,6,0,-1},{8957,7,0,-1},{8961,6,0,-1},{8961,7,0,-1},{8965,6,0,-1}, +{8965,7,0,-1},{8970,6,0,-1},{8970,7,0,-1},{8974,6,0,-1},{8974,7,0,-1}, +{8978,6,0,-1},{8978,7,0,-1},{8983,6,0,-1},{8983,7,0,-1},{8987,6,0,-1}, +{8987,7,0,-1},{8991,6,0,-1},{8991,7,0,-1},{8996,6,0,-1},{8996,7,0,-1}, +{9000,6,0,-1},{9000,7,0,-1},{8930,6,0,-1},{9004,6,0,-1},{9004,7,0,-1}, +{9009,6,0,-1},{9009,7,0,-1},{9013,6,0,-1},{9013,7,0,-1},{8943,7,0,-1}, +{9017,6,0,-1},{9017,7,0,-1},{9022,6,0,-1},{9022,7,0,-1},{9026,6,0,-1}, +{9026,7,0,-1},{9030,6,0,-1},{9030,7,0,-1},{9035,6,0,-1},{9035,7,0,-1}, +{9039,6,0,-1},{9039,7,0,-1},{9043,6,0,-1},{9043,7,0,-1},{9048,6,0,-1}, +{9048,7,0,-1},{9052,6,0,-1},{9052,7,0,-1},{9056,6,0,-1},{9056,7,0,-1}, +{9061,6,0,-1},{9061,7,0,-1},{9065,6,0,-1},{9065,7,0,-1},{9069,6,0,-1}, +{9069,7,0,-1},{9074,6,0,-1},{9074,7,0,-1},{9078,6,0,-1},{9078,7,0,-1}, +{9082,6,0,-1},{9082,7,0,-1},{9087,6,0,-1},{9087,7,0,-1},{9091,6,0,-1}, +{9091,7,0,-1},{9095,6,0,-1},{9095,7,0,-1},{9100,6,0,-1},{9100,7,0,-1}, +{9104,6,0,-1},{9104,7,0,-1},{9034,6,0,-1},{9108,6,0,-1},{9108,7,0,-1}, +{9113,6,0,-1},{9113,7,0,-1},{9117,6,0,-1},{9117,7,0,-1},{9047,7,0,-1}, +{9121,6,0,-1},{9121,7,0,-1},{9126,6,0,-1},{9126,7,0,-1},{9130,6,0,-1}, +{9130,7,0,-1},{9134,6,0,-1},{9134,7,0,-1},{9139,6,0,-1},{9139,7,0,-1}, +{9143,6,0,-1},{9143,7,0,-1},{9147,6,0,-1},{9147,7,0,-1},{9152,6,0,-1}, +{9152,7,0,-1},{9156,6,0,-1},{9156,7,0,-1},{9160,6,0,-1},{9160,7,0,-1}, +{9165,6,0,-1},{9165,7,0,-1},{9169,6,0,-1},{9169,7,0,-1},{9173,6,0,-1}, +{9173,7,0,-1},{9178,6,0,-1},{9178,7,0,-1},{9182,6,0,-1},{9182,7,0,-1}, +{9186,6,0,-1},{9186,7,0,-1},{9191,6,0,-1},{9191,7,0,-1},{9195,6,0,-1}, +{9195,7,0,-1},{9199,6,0,-1},{9199,7,0,-1},{9204,6,0,-1},{9204,7,0,-1}, +{9208,6,0,-1},{9208,7,0,-1},{9138,6,0,-1},{9212,6,0,-1},{9212,7,0,-1}, +{9217,6,0,-1},{9217,7,0,-1},{9221,6,0,-1},{9221,7,0,-1},{9151,7,0,-1}, +{9225,6,0,-1},{9225,7,0,-1},{9230,6,0,-1},{9230,7,0,-1},{9234,6,0,-1}, +{9234,7,0,-1},{9238,6,0,-1},{9238,7,0,-1},{9243,6,0,-1},{9243,7,0,-1}, +{9247,6,0,-1},{9247,7,0,-1},{9251,6,0,-1},{9251,7,0,-1},{9256,6,0,-1}, +{9256,7,0,-1},{9260,6,0,-1},{9260,7,0,-1},{9264,6,0,-1},{9264,7,0,-1}, +{9269,6,0,-1},{9269,7,0,-1},{9273,6,0,-1},{9273,7,0,-1},{9277,6,0,-1}, +{9277,7,0,-1},{9282,6,0,-1},{9282,7,0,-1},{9286,6,0,-1},{9286,7,0,-1}, +{9290,6,0,-1},{9290,7,0,-1},{9295,6,0,-1},{9295,7,0,-1},{9299,6,0,-1}, +{9299,7,0,-1},{9303,6,0,-1},{9303,7,0,-1},{9308,6,0,-1},{9308,7,0,-1}, +{9312,6,0,-1},{9312,7,0,-1},{9242,6,0,-1},{9316,6,0,-1},{9316,7,0,-1}, +{9321,6,0,-1},{9321,7,0,-1},{9325,6,0,-1},{9325,7,0,-1},{9255,7,0,-1}, +{9329,6,0,-1},{9329,7,0,-1},{9334,6,0,-1},{9334,7,0,-1},{9338,6,0,-1}, +{9338,7,0,-1},{9342,6,0,-1},{9342,7,0,-1},{9347,6,0,-1},{9347,7,0,-1}, +{9351,6,0,-1},{9351,7,0,-1},{9355,6,0,-1},{9355,7,0,-1},{9360,6,0,-1}, +{9360,7,0,-1},{9364,6,0,-1},{9364,7,0,-1},{9368,6,0,-1},{9368,7,0,-1}, +{9373,6,0,-1},{9373,7,0,-1},{9377,6,0,-1},{9377,7,0,-1},{9381,6,0,-1}, +{9381,7,0,-1},{9386,6,0,-1},{9386,7,0,-1},{9390,6,0,-1},{9390,7,0,-1}, +{9394,6,0,-1},{9394,7,0,-1},{9399,6,0,-1},{9399,7,0,-1},{9403,6,0,-1}, +{9403,7,0,-1},{9407,6,0,-1},{9407,7,0,-1},{9412,6,0,-1},{9412,7,0,-1}, +{9416,6,0,-1},{9416,7,0,-1},{9346,6,0,-1},{9420,6,0,-1},{9420,7,0,-1}, +{9425,6,0,-1},{9425,7,0,-1},{9429,6,0,-1},{9429,7,0,-1},{9359,7,0,-1}, +{9433,6,0,-1},{9433,7,0,-1},{9438,6,0,-1},{9438,7,0,-1},{9442,6,0,-1}, +{9442,7,0,-1},{9446,6,0,-1},{9446,7,0,-1},{9451,6,0,-1},{9451,7,0,-1}, +{9455,6,0,-1},{9455,7,0,-1},{9459,6,0,-1},{9459,7,0,-1},{9464,6,0,-1}, +{9464,7,0,-1},{9468,6,0,-1},{9468,7,0,-1},{9472,6,0,-1},{9472,7,0,-1}, +{9477,6,0,-1},{9477,7,0,-1},{9481,6,0,-1},{9481,7,0,-1},{9485,6,0,-1}, +{9485,7,0,-1},{9490,6,0,-1},{9490,7,0,-1},{9494,6,0,-1},{9494,7,0,-1}, +{9498,6,0,-1},{9498,7,0,-1},{9503,6,0,-1},{9503,7,0,-1},{9507,6,0,-1}, +{9507,7,0,-1},{9511,6,0,-1},{9511,7,0,-1},{9516,6,0,-1},{9516,7,0,-1}, +{9520,6,0,-1},{9520,7,0,-1},{9450,6,0,-1},{9524,6,0,-1},{9524,7,0,-1}, +{9529,6,0,-1},{9529,7,0,-1},{9533,6,0,-1},{9533,7,0,-1},{9463,7,0,-1}, +{9537,6,0,-1},{9537,7,0,-1},{9542,6,0,-1},{9542,7,0,-1},{9546,6,0,-1}, +{9546,7,0,-1},{9550,6,0,-1},{9550,7,0,-1},{9555,6,0,-1},{9555,7,0,-1}, +{9559,6,0,-1},{9559,7,0,-1},{9563,6,0,-1},{9563,7,0,-1},{9568,6,0,-1}, +{9568,7,0,-1},{9572,6,0,-1},{9572,7,0,-1},{9576,6,0,-1},{9576,7,0,-1}, +{9581,6,0,-1},{9581,7,0,-1},{9585,6,0,-1},{9585,7,0,-1},{9589,6,0,-1}, +{9589,7,0,-1},{9594,6,0,-1},{9594,7,0,-1},{9598,6,0,-1},{9598,7,0,-1}, +{9602,6,0,-1},{9602,7,0,-1},{9607,6,0,-1},{9607,7,0,-1},{9611,6,0,-1}, +{9611,7,0,-1},{9615,6,0,-1},{9615,7,0,-1},{9620,6,0,-1},{9620,7,0,-1}, +{9624,6,0,-1},{9624,7,0,-1},{9554,6,0,-1},{9628,6,0,-1},{9628,7,0,-1}, +{9633,6,0,-1},{9633,7,0,-1},{9637,6,0,-1},{9637,7,0,-1},{9567,7,0,-1}, +{9641,6,0,-1},{9641,7,0,-1},{9646,6,0,-1},{9646,7,0,-1},{9650,6,0,-1}, +{9650,7,0,-1},{9654,6,0,-1},{9654,7,0,-1},{9659,6,0,-1},{9659,7,0,-1}, +{9663,6,0,-1},{9663,7,0,-1},{9667,6,0,-1},{9667,7,0,-1},{9672,6,0,-1}, +{9672,7,0,-1},{9676,6,0,-1},{9676,7,0,-1},{9680,6,0,-1},{9680,7,0,-1}, +{9685,6,0,-1},{9685,7,0,-1},{9689,6,0,-1},{9689,7,0,-1},{9693,6,0,-1}, +{9693,7,0,-1},{9698,6,0,-1},{9698,7,0,-1},{9702,6,0,-1},{9702,7,0,-1}, +{9706,6,0,-1},{9706,7,0,-1},{9711,6,0,-1},{9711,7,0,-1},{9715,6,0,-1}, +{9715,7,0,-1},{9719,6,0,-1},{9719,7,0,-1},{9724,6,0,-1},{9724,7,0,-1}, +{9728,6,0,-1},{9728,7,0,-1},{9658,6,0,-1},{9732,6,0,-1},{9732,7,0,-1}, +{9737,6,0,-1},{9737,7,0,-1},{9741,6,0,-1},{9741,7,0,-1},{9671,7,0,-1}, +{9745,6,0,-1},{9745,7,0,-1},{9750,6,0,-1},{9750,7,0,-1},{9754,6,0,-1}, +{9754,7,0,-1},{9758,6,0,-1},{9758,7,0,-1},{9763,6,0,-1},{9763,7,0,-1}, +{9767,6,0,-1},{9767,7,0,-1},{9771,6,0,-1},{9771,7,0,-1},{9776,6,0,-1}, +{9776,7,0,-1},{9780,6,0,-1},{9780,7,0,-1},{9784,6,0,-1},{9784,7,0,-1}, +{9789,6,0,-1},{9789,7,0,-1},{9793,6,0,-1},{9793,7,0,-1},{9797,6,0,-1}, +{9797,7,0,-1},{9802,6,0,-1},{9802,7,0,-1},{9806,6,0,-1},{9806,7,0,-1}, +{9810,6,0,-1},{9810,7,0,-1},{9815,6,0,-1},{9815,7,0,-1},{9819,6,0,-1}, +{9819,7,0,-1},{9823,6,0,-1},{9823,7,0,-1},{9828,6,0,-1},{9828,7,0,-1}, +{9832,6,0,-1},{9832,7,0,-1},{9762,6,0,-1},{9836,6,0,-1},{9836,7,0,-1}, +{9841,6,0,-1},{9841,7,0,-1},{9845,6,0,-1},{9845,7,0,-1},{9775,7,0,-1}, +{9849,6,0,-1},{9849,7,0,-1},{9854,6,0,-1},{9854,7,0,-1},{9858,6,0,-1}, +{9858,7,0,-1},{9862,6,0,-1},{9862,7,0,-1},{9867,6,0,-1},{9867,7,0,-1}, +{9871,6,0,-1},{9871,7,0,-1},{9875,6,0,-1},{9875,7,0,-1},{9880,6,0,-1}, +{9880,7,0,-1},{9884,6,0,-1},{9884,7,0,-1},{9888,6,0,-1},{9888,7,0,-1}, +{9893,6,0,-1},{9893,7,0,-1},{9897,6,0,-1},{9897,7,0,-1},{9901,6,0,-1}, +{9901,7,0,-1},{9906,6,0,-1},{9906,7,0,-1},{9910,6,0,-1},{9910,7,0,-1}, +{9914,6,0,-1},{9914,7,0,-1},{9919,6,0,-1},{9919,7,0,-1},{9923,6,0,-1}, +{9923,7,0,-1},{9927,6,0,-1},{9927,7,0,-1},{9932,6,0,-1},{9932,7,0,-1}, +{9936,6,0,-1},{9936,7,0,-1},{9866,6,0,-1},{9940,6,0,-1},{9940,7,0,-1}, +{9945,6,0,-1},{9945,7,0,-1},{9949,6,0,-1},{9949,7,0,-1},{9879,7,0,-1}, +{9953,6,0,-1},{9953,7,0,-1},{9958,6,0,-1},{9958,7,0,-1},{9962,6,0,-1}, +{9962,7,0,-1},{9966,6,0,-1},{9966,7,0,-1},{9971,6,0,-1},{9971,7,0,-1}, +{9975,6,0,-1},{9975,7,0,-1},{9979,6,0,-1},{9979,7,0,-1},{9984,6,0,-1}, +{9984,7,0,-1},{9988,6,0,-1},{9988,7,0,-1},{9992,6,0,-1},{9992,7,0,-1}, +{9997,6,0,-1},{9997,7,0,-1},{10001,6,0,-1},{10001,7,0,-1},{10005,6,0,-1}, +{10005,7,0,-1},{10010,6,0,-1},{10010,7,0,-1},{10014,6,0,-1},{10014,7,0,-1}, +{10018,6,0,-1},{10018,7,0,-1},{10023,6,0,-1},{10023,7,0,-1},{10027,6,0,-1}, +{10027,7,0,-1},{10031,6,0,-1},{10031,7,0,-1},{10036,6,0,-1},{10036,7,0,-1}, +{10040,6,0,-1},{10040,7,0,-1},{9970,6,0,-1},{10044,6,0,-1},{10044,7,0,-1}, +{10049,6,0,-1},{10049,7,0,-1},{10053,6,0,-1},{10053,7,0,-1},{9983,7,0,-1}, +{10057,6,0,-1},{10057,7,0,-1},{10062,6,0,-1},{10062,7,0,-1},{10066,6,0,-1}, +{10066,7,0,-1},{10070,6,0,-1},{10070,7,0,-1},{10075,6,0,-1},{10075,7,0,-1}, +{10079,6,0,-1},{10079,7,0,-1},{10083,6,0,-1},{10083,7,0,-1},{10088,6,0,-1}, +{10088,7,0,-1},{10092,6,0,-1},{10092,7,0,-1},{10096,6,0,-1},{10096,7,0,-1}, +{10101,6,0,-1},{10101,7,0,-1},{10105,6,0,-1},{10105,7,0,-1},{10109,6,0,-1}, +{10109,7,0,-1},{10114,6,0,-1},{10114,7,0,-1},{10118,6,0,-1},{10118,7,0,-1}, +{10122,6,0,-1},{10122,7,0,-1},{10127,6,0,-1},{10127,7,0,-1},{10131,6,0,-1}, +{10131,7,0,-1},{10135,6,0,-1},{10135,7,0,-1},{10140,6,0,-1},{10140,7,0,-1}, +{10144,6,0,-1},{10144,7,0,-1},{10074,6,0,-1},{10148,6,0,-1},{10148,7,0,-1}, +{10153,6,0,-1},{10153,7,0,-1},{10157,6,0,-1},{10157,7,0,-1},{10087,7,0,-1}, +{10161,6,0,-1},{10161,7,0,-1},{10166,6,0,-1},{10166,7,0,-1},{10170,6,0,-1}, +{10170,7,0,-1},{10174,6,0,-1},{10174,7,0,-1},{10179,6,0,-1},{10179,7,0,-1}, +{10183,6,0,-1},{10183,7,0,-1},{10187,6,0,-1},{10187,7,0,-1},{10192,6,0,-1}, +{10192,7,0,-1},{10196,6,0,-1},{10196,7,0,-1},{10200,6,0,-1},{10200,7,0,-1}, +{10205,6,0,-1},{10205,7,0,-1},{10209,6,0,-1},{10209,7,0,-1},{10213,6,0,-1}, +{10213,7,0,-1},{10218,6,0,-1},{10218,7,0,-1},{10222,6,0,-1},{10222,7,0,-1}, +{10226,6,0,-1},{10226,7,0,-1},{10231,6,0,-1},{10231,7,0,-1},{10235,6,0,-1}, +{10235,7,0,-1},{10239,6,0,-1},{10239,7,0,-1},{10244,6,0,-1},{10244,7,0,-1}, +{10248,6,0,-1},{10248,7,0,-1},{10178,6,0,-1},{10252,6,0,-1},{10252,7,0,-1}, +{10257,6,0,-1},{10257,7,0,-1},{10261,6,0,-1},{10261,7,0,-1},{10191,7,0,-1}, +{10265,6,0,-1},{10265,7,0,-1},{10270,6,0,-1},{10270,7,0,-1},{10274,6,0,-1}, +{10274,7,0,-1},{10278,6,0,-1},{10278,7,0,-1},{10283,6,0,-1},{10283,7,0,-1}, +{10287,6,0,-1},{10287,7,0,-1},{10291,6,0,-1},{10291,7,0,-1},{10296,6,0,-1}, +{10296,7,0,-1},{10300,6,0,-1},{10300,7,0,-1},{10304,6,0,-1},{10304,7,0,-1}, +{10309,6,0,-1},{10309,7,0,-1},{10313,6,0,-1},{10313,7,0,-1},{10317,6,0,-1}, +{10317,7,0,-1},{10322,6,0,-1},{10322,7,0,-1},{10326,6,0,-1},{10326,7,0,-1}, +{10330,6,0,-1},{10330,7,0,-1},{10335,6,0,-1},{10335,7,0,-1},{10339,6,0,-1}, +{10339,7,0,-1},{10343,6,0,-1},{10343,7,0,-1},{10348,6,0,-1},{10348,7,0,-1}, +{10352,6,0,-1},{10352,7,0,-1},{10282,6,0,-1},{10356,6,0,-1},{10356,7,0,-1}, +{10361,6,0,-1},{10361,7,0,-1},{10365,6,0,-1},{10365,7,0,-1},{10295,7,0,-1}, +{10369,6,0,-1},{10369,7,0,-1},{10374,6,0,-1},{10374,7,0,-1},{10378,6,0,-1}, +{10378,7,0,-1},{10382,6,0,-1},{10382,7,0,-1},{10387,6,0,-1},{10387,7,0,-1}, +{10391,6,0,-1},{10391,7,0,-1},{10395,6,0,-1},{10395,7,0,-1},{10400,6,0,-1}, +{10400,7,0,-1},{10404,6,0,-1},{10404,7,0,-1},{10408,6,0,-1},{10408,7,0,-1}, +{10413,6,0,-1},{10413,7,0,-1},{10417,6,0,-1},{10417,7,0,-1},{10421,6,0,-1}, +{10421,7,0,-1},{10426,6,0,-1},{10426,7,0,-1},{10430,6,0,-1},{10430,7,0,-1}, +{10434,6,0,-1},{10434,7,0,-1},{10439,6,0,-1},{10439,7,0,-1},{10443,6,0,-1}, +{10443,7,0,-1},{10447,6,0,-1},{10447,7,0,-1},{10452,6,0,-1},{10452,7,0,-1}, +{10456,6,0,-1},{10456,7,0,-1},{10386,6,0,-1},{10460,6,0,-1},{10460,7,0,-1}, +{10465,6,0,-1},{10465,7,0,-1},{10469,6,0,-1},{10469,7,0,-1},{10399,7,0,-1}, +{10473,6,0,-1},{10473,7,0,-1},{10478,6,0,-1},{10478,7,0,-1},{10482,6,0,-1}, +{10482,7,0,-1},{10486,6,0,-1},{10486,7,0,-1},{10491,6,0,-1},{10491,7,0,-1}, +{10495,6,0,-1},{10495,7,0,-1},{10499,6,0,-1},{10499,7,0,-1},{10504,6,0,-1}, +{10504,7,0,-1},{10508,6,0,-1},{10508,7,0,-1},{10512,6,0,-1},{10512,7,0,-1}, +{10517,6,0,-1},{10517,7,0,-1},{10521,6,0,-1},{10521,7,0,-1},{10525,6,0,-1}, +{10525,7,0,-1},{10530,6,0,-1},{10530,7,0,-1},{10534,6,0,-1},{10534,7,0,-1}, +{10538,6,0,-1},{10538,7,0,-1},{10543,6,0,-1},{10543,7,0,-1},{10547,6,0,-1}, +{10547,7,0,-1},{10551,6,0,-1},{10551,7,0,-1},{10556,6,0,-1},{10556,7,0,-1}, +{10560,6,0,-1},{10560,7,0,-1},{10490,6,0,-1},{10564,6,0,-1},{10564,7,0,-1}, +{10569,6,0,-1},{10569,7,0,-1},{10573,6,0,-1},{10573,7,0,-1},{10503,7,0,-1}, +{10577,6,0,-1},{10577,7,0,-1},{10582,6,0,-1},{10582,7,0,-1},{10586,6,0,-1}, +{10586,7,0,-1},{10590,6,0,-1},{10590,7,0,-1},{10595,6,0,-1},{10595,7,0,-1}, +{10599,6,0,-1},{10599,7,0,-1},{10603,6,0,-1},{10603,7,0,-1},{10608,6,0,-1}, +{10608,7,0,-1},{10612,6,0,-1},{10612,7,0,-1},{10616,6,0,-1},{10616,7,0,-1}, +{10621,6,0,-1},{10621,7,0,-1},{10625,6,0,-1},{10625,7,0,-1},{10629,6,0,-1}, +{10629,7,0,-1},{10634,6,0,-1},{10634,7,0,-1},{10638,6,0,-1},{10638,7,0,-1}, +{10642,6,0,-1},{10642,7,0,-1},{10647,6,0,-1},{10647,7,0,-1},{10651,6,0,-1}, +{10651,7,0,-1},{10655,6,0,-1},{10655,7,0,-1},{10660,6,0,-1},{10660,7,0,-1}, +{10664,6,0,-1},{10664,7,0,-1},{10594,6,0,-1},{10668,6,0,-1},{10668,7,0,-1}, +{10673,6,0,-1},{10673,7,0,-1},{10677,6,0,-1},{10677,7,0,-1},{10607,7,0,-1}, +{10681,6,0,-1},{10681,7,0,-1},{10686,6,0,-1},{10686,7,0,-1},{10690,6,0,-1}, +{10690,7,0,-1},{10694,6,0,-1},{10694,7,0,-1},{10699,6,0,-1},{10699,7,0,-1}, +{10703,6,0,-1},{10703,7,0,-1},{10707,6,0,-1},{10707,7,0,-1},{10712,6,0,-1}, +{10712,7,0,-1},{10716,6,0,-1},{10716,7,0,-1},{10720,6,0,-1},{10720,7,0,-1}, +{10725,6,0,-1},{10725,7,0,-1},{10729,6,0,-1},{10729,7,0,-1},{10733,6,0,-1}, +{10733,7,0,-1},{10738,6,0,-1},{10738,7,0,-1},{10742,6,0,-1},{10742,7,0,-1}, +{10746,6,0,-1},{10746,7,0,-1},{10751,6,0,-1},{10751,7,0,-1},{10755,6,0,-1}, +{10755,7,0,-1},{10759,6,0,-1},{10759,7,0,-1},{10764,6,0,-1},{10764,7,0,-1}, +{10768,6,0,-1},{10768,7,0,-1},{10698,6,0,-1},{10772,6,0,-1},{10772,7,0,-1}, +{10777,6,0,-1},{10777,7,0,-1},{10781,6,0,-1},{10781,7,0,-1},{10711,7,0,-1}, +{10785,6,0,-1},{10785,7,0,-1},{10790,6,0,-1},{10790,7,0,-1},{10794,6,0,-1}, +{10794,7,0,-1},{10798,6,0,-1},{10798,7,0,-1},{10803,6,0,-1},{10803,7,0,-1}, +{10807,6,0,-1},{10807,7,0,-1},{10811,6,0,-1},{10811,7,0,-1},{10816,6,0,-1}, +{10816,7,0,-1},{10820,6,0,-1},{10820,7,0,-1},{10824,6,0,-1},{10824,7,0,-1}, +{10829,6,0,-1},{10829,7,0,-1},{10833,6,0,-1},{10833,7,0,-1},{10837,6,0,-1}, +{10837,7,0,-1},{10842,6,0,-1},{10842,7,0,-1},{10846,6,0,-1},{10846,7,0,-1}, +{10850,6,0,-1},{10850,7,0,-1},{10855,6,0,-1},{10855,7,0,-1},{10859,6,0,-1}, +{10859,7,0,-1},{10863,6,0,-1},{10863,7,0,-1},{10868,6,0,-1},{10868,7,0,-1}, +{10872,6,0,-1},{10872,7,0,-1},{10802,6,0,-1},{10876,6,0,-1},{10876,7,0,-1}, +{10881,6,0,-1},{10881,7,0,-1},{10885,6,0,-1},{10885,7,0,-1},{10815,7,0,-1}, +{10889,6,0,-1},{10889,7,0,-1},{10894,6,0,-1},{10894,7,0,-1},{10898,6,0,-1}, +{10898,7,0,-1},{10902,6,0,-1},{10902,7,0,-1},{10907,6,0,-1},{10907,7,0,-1}, +{10911,6,0,-1},{10911,7,0,-1},{10915,6,0,-1},{10915,7,0,-1},{10920,6,0,-1}, +{10920,7,0,-1},{10924,6,0,-1},{10924,7,0,-1},{10928,6,0,-1},{10928,7,0,-1}, +{10933,6,0,-1},{10933,7,0,-1},{10937,6,0,-1},{10937,7,0,-1},{10941,6,0,-1}, +{10941,7,0,-1},{10946,6,0,-1},{10946,7,0,-1},{10950,6,0,-1},{10950,7,0,-1}, +{10954,6,0,-1},{10954,7,0,-1},{10959,6,0,-1},{10959,7,0,-1},{10963,6,0,-1}, +{10963,7,0,-1},{10967,6,0,-1},{10967,7,0,-1},{10972,6,0,-1},{10972,7,0,-1}, +{10976,6,0,-1},{10976,7,0,-1},{10906,6,0,-1},{10980,6,0,-1},{10980,7,0,-1}, +{10985,6,0,-1},{10985,7,0,-1},{10989,6,0,-1},{10989,7,0,-1},{10919,7,0,-1}, +{10993,6,0,-1},{10993,7,0,-1},{10998,6,0,-1},{10998,7,0,-1},{11002,6,0,-1}, +{11002,7,0,-1},{11006,6,0,-1},{11006,7,0,-1},{11011,6,0,-1},{11011,7,0,-1}, +{11015,6,0,-1},{11015,7,0,-1},{11019,6,0,-1},{11019,7,0,-1},{11024,6,0,-1}, +{11024,7,0,-1},{11028,6,0,-1},{11028,7,0,-1},{11032,6,0,-1},{11032,7,0,-1}, +{11037,6,0,-1},{11037,7,0,-1},{11041,6,0,-1},{11041,7,0,-1},{11045,6,0,-1}, +{11045,7,0,-1},{11050,6,0,-1},{11050,7,0,-1},{11054,6,0,-1},{11054,7,0,-1}, +{11058,6,0,-1},{11058,7,0,-1},{11063,6,0,-1},{11063,7,0,-1},{11067,6,0,-1}, +{11067,7,0,-1},{11071,6,0,-1},{11071,7,0,-1},{11076,6,0,-1},{11076,7,0,-1}, +{11080,6,0,-1},{11080,7,0,-1},{11010,6,0,-1},{11084,6,0,-1},{11084,7,0,-1}, +{11089,6,0,-1},{11089,7,0,-1},{11093,6,0,-1},{11093,7,0,-1},{11023,7,0,-1}, +{11097,6,0,-1},{11097,7,0,-1},{11102,6,0,-1},{11102,7,0,-1},{11106,6,0,-1}, +{11106,7,0,-1},{11110,6,0,-1},{11110,7,0,-1},{11115,6,0,-1},{11115,7,0,-1}, +{11119,6,0,-1},{11119,7,0,-1},{11123,6,0,-1},{11123,7,0,-1},{11128,6,0,-1}, +{11128,7,0,-1},{11132,6,0,-1},{11132,7,0,-1},{11136,6,0,-1},{11136,7,0,-1}, +{11141,6,0,-1},{11141,7,0,-1},{11145,6,0,-1},{11145,7,0,-1},{11149,6,0,-1}, +{11149,7,0,-1},{11154,6,0,-1},{11154,7,0,-1},{11158,6,0,-1},{11158,7,0,-1}, +{11162,6,0,-1},{11162,7,0,-1},{11167,6,0,-1},{11167,7,0,-1},{11171,6,0,-1}, +{11171,7,0,-1},{11175,6,0,-1},{11175,7,0,-1},{11180,6,0,-1},{11180,7,0,-1}, +{11184,6,0,-1},{11184,7,0,-1},{11114,6,0,-1},{11188,6,0,-1},{11188,7,0,-1}, +{11193,6,0,-1},{11193,7,0,-1},{11197,6,0,-1},{11197,7,0,-1},{11127,7,0,-1}, +{11201,6,0,-1},{11201,7,0,-1},{11206,6,0,-1},{11206,7,0,-1},{11210,6,0,-1}, +{11210,7,0,-1},{11214,6,0,-1},{11214,7,0,-1},{11219,6,0,-1},{11219,7,0,-1}, +{11223,6,0,-1},{11223,7,0,-1},{11227,6,0,-1},{11227,7,0,-1},{11232,6,0,-1}, +{11232,7,0,-1},{11236,6,0,-1},{11236,7,0,-1},{11240,6,0,-1},{11240,7,0,-1}, +{11245,6,0,-1},{11245,7,0,-1},{11249,6,0,-1},{11249,7,0,-1},{11253,6,0,-1}, +{11253,7,0,-1},{11258,6,0,-1},{11258,7,0,-1},{11262,6,0,-1},{11262,7,0,-1}, +{11266,6,0,-1},{11266,7,0,-1},{11271,6,0,-1},{11271,7,0,-1},{11275,6,0,-1}, +{11275,7,0,-1},{11279,6,0,-1},{11279,7,0,-1},{11284,6,0,-1},{11284,7,0,-1}, +{11288,6,0,-1},{11288,7,0,-1},{11218,6,0,-1},{11292,6,0,-1},{11292,7,0,-1}, +{11297,6,0,-1},{11297,7,0,-1},{11301,6,0,-1},{11301,7,0,-1},{11231,7,0,-1}, +{11305,6,0,-1},{11305,7,0,-1},{11310,6,0,-1},{11310,7,0,-1},{11314,6,0,-1}, +{11314,7,0,-1},{11318,6,0,-1},{11318,7,0,-1},{11323,6,0,-1},{11323,7,0,-1}, +{11327,6,0,-1},{11327,7,0,-1},{11331,6,0,-1},{11331,7,0,-1},{11336,6,0,-1}, +{11336,7,0,-1},{11340,6,0,-1},{11340,7,0,-1},{11344,6,0,-1},{11344,7,0,-1}, +{11349,6,0,-1},{11349,7,0,-1},{11353,6,0,-1},{11353,7,0,-1},{11357,6,0,-1}, +{11357,7,0,-1},{11362,6,0,-1},{11362,7,0,-1},{11366,6,0,-1},{11366,7,0,-1}, +{11370,6,0,-1},{11370,7,0,-1},{11375,6,0,-1},{11375,7,0,-1},{11379,6,0,-1}, +{11379,7,0,-1},{11383,6,0,-1},{11383,7,0,-1},{11388,6,0,-1},{11388,7,0,-1}, +{11392,6,0,-1},{11392,7,0,-1},{11322,6,0,-1},{11396,6,0,-1},{11396,7,0,-1}, +{11401,6,0,-1},{11401,7,0,-1},{11405,6,0,-1},{11405,7,0,-1},{11335,7,0,-1}, +{11409,6,0,-1},{11409,7,0,-1},{11414,6,0,-1},{11414,7,0,-1},{11418,6,0,-1}, +{11418,7,0,-1},{11422,6,0,-1},{11422,7,0,-1},{11427,6,0,-1},{11427,7,0,-1}, +{11431,6,0,-1},{11431,7,0,-1},{11435,6,0,-1},{11435,7,0,-1},{11440,6,0,-1}, +{11440,7,0,-1},{11444,6,0,-1},{11444,7,0,-1},{11448,6,0,-1},{11448,7,0,-1}, +{11453,6,0,-1},{11453,7,0,-1},{11457,6,0,-1},{11457,7,0,-1},{11461,6,0,-1}, +{11461,7,0,-1},{11466,6,0,-1},{11466,7,0,-1},{11470,6,0,-1},{11470,7,0,-1}, +{11474,6,0,-1},{11474,7,0,-1},{11479,6,0,-1},{11479,7,0,-1},{11483,6,0,-1}, +{11483,7,0,-1},{11487,6,0,-1},{11487,7,0,-1},{11492,6,0,-1},{11492,7,0,-1}, +{11496,6,0,-1},{11496,7,0,-1},{11426,6,0,-1},{11500,6,0,-1},{11500,7,0,-1}, +{11505,6,0,-1},{11505,7,0,-1},{11509,6,0,-1},{11509,7,0,-1},{11439,7,0,-1}, +{11513,6,0,-1},{11513,7,0,-1},{11518,6,0,-1},{11518,7,0,-1},{11522,6,0,-1}, +{11522,7,0,-1},{11526,6,0,-1},{11526,7,0,-1},{11531,6,0,-1},{11531,7,0,-1}, +{11535,6,0,-1},{11535,7,0,-1},{11539,6,0,-1},{11539,7,0,-1},{11544,6,0,-1}, +{11544,7,0,-1},{11548,6,0,-1},{11548,7,0,-1},{11552,6,0,-1},{11552,7,0,-1}, +{11557,6,0,-1},{11557,7,0,-1},{11561,6,0,-1},{11561,7,0,-1},{11565,6,0,-1}, +{11565,7,0,-1},{11570,6,0,-1},{11570,7,0,-1},{11574,6,0,-1},{11574,7,0,-1}, +{11578,6,0,-1},{11578,7,0,-1},{11583,6,0,-1},{11583,7,0,-1},{11587,6,0,-1}, +{11587,7,0,-1},{11591,6,0,-1},{11591,7,0,-1},{11596,6,0,-1},{11596,7,0,-1}, +{11600,6,0,-1},{11600,7,0,-1},{11530,6,0,-1},{11604,6,0,-1},{11604,7,0,-1}, +{11609,6,0,-1},{11609,7,0,-1},{11613,6,0,-1},{11613,7,0,-1},{11543,7,0,-1}, +{11617,6,0,-1},{11617,7,0,-1},{11622,6,0,-1},{11622,7,0,-1},{11626,6,0,-1}, +{11626,7,0,-1},{11630,6,0,-1},{11630,7,0,-1},{11635,6,0,-1},{11635,7,0,-1}, +{11639,6,0,-1},{11639,7,0,-1},{11643,6,0,-1},{11643,7,0,-1},{11648,6,0,-1}, +{11648,7,0,-1},{11652,6,0,-1},{11652,7,0,-1},{11656,6,0,-1},{11656,7,0,-1}, +{11661,6,0,-1},{11661,7,0,-1},{11665,6,0,-1},{11665,7,0,-1},{11669,6,0,-1}, +{11669,7,0,-1},{11674,6,0,-1},{11674,7,0,-1},{11678,6,0,-1},{11678,7,0,-1}, +{11682,6,0,-1},{11682,7,0,-1},{11687,6,0,-1},{11687,7,0,-1},{11691,6,0,-1}, +{11691,7,0,-1},{11695,6,0,-1},{11695,7,0,-1},{11700,6,0,-1},{11700,7,0,-1}, +{11704,6,0,-1},{11704,7,0,-1},{11634,6,0,-1},{11708,6,0,-1},{11708,7,0,-1}, +{11713,6,0,-1},{11713,7,0,-1},{11717,6,0,-1},{11717,7,0,-1},{11647,7,0,-1}, +{11721,6,0,-1},{11721,7,0,-1},{11726,6,0,-1},{11726,7,0,-1},{11730,6,0,-1}, +{11730,7,0,-1},{11734,6,0,-1},{11734,7,0,-1},{11739,6,0,-1},{11739,7,0,-1}, +{11743,6,0,-1},{11743,7,0,-1},{11747,6,0,-1},{11747,7,0,-1},{11752,6,0,-1}, +{11752,7,0,-1},{11756,6,0,-1},{11756,7,0,-1},{11760,6,0,-1},{11760,7,0,-1}, +{11765,6,0,-1},{11765,7,0,-1},{11769,6,0,-1},{11769,7,0,-1},{11773,6,0,-1}, +{11773,7,0,-1},{11778,6,0,-1},{11778,7,0,-1},{11782,6,0,-1},{11782,7,0,-1}, +{11786,6,0,-1},{11786,7,0,-1},{11791,6,0,-1},{11791,7,0,-1},{11795,6,0,-1}, +{11795,7,0,-1},{11799,6,0,-1},{11799,7,0,-1},{11804,6,0,-1},{11804,7,0,-1}, +{11808,6,0,-1},{11808,7,0,-1},{11738,6,0,-1},{11812,6,0,-1},{11812,7,0,-1}, +{11817,6,0,-1},{11817,7,0,-1},{11821,6,0,-1},{11821,7,0,-1},{11751,7,0,-1}, +{11825,6,0,-1},{11825,7,0,-1},{11830,6,0,-1},{11830,7,0,-1},{11834,6,0,-1}, +{11834,7,0,-1},{11838,6,0,-1},{11838,7,0,-1},{11843,6,0,-1},{11843,7,0,-1}, +{11847,6,0,-1},{11847,7,0,-1},{11851,6,0,-1},{11851,7,0,-1},{11856,6,0,-1}, +{11856,7,0,-1},{11860,6,0,-1},{11860,7,0,-1},{11864,6,0,-1},{11864,7,0,-1}, +{11869,6,0,-1},{11869,7,0,-1},{11873,6,0,-1},{11873,7,0,-1},{11877,6,0,-1}, +{11877,7,0,-1},{11882,6,0,-1},{11882,7,0,-1},{11886,6,0,-1},{11886,7,0,-1}, +{11890,6,0,-1},{11890,7,0,-1},{11895,6,0,-1},{11895,7,0,-1},{11899,6,0,-1}, +{11899,7,0,-1},{11903,6,0,-1},{11903,7,0,-1},{11908,6,0,-1},{11908,7,0,-1}, +{11912,6,0,-1},{11912,7,0,-1},{11842,6,0,-1},{11916,6,0,-1},{11916,7,0,-1}, +{11921,6,0,-1},{11921,7,0,-1},{11925,6,0,-1},{11925,7,0,-1},{11855,7,0,-1}, +{11929,6,0,-1},{11929,7,0,-1},{11934,6,0,-1},{11934,7,0,-1},{11938,6,0,-1}, +{11938,7,0,-1},{11942,6,0,-1},{11942,7,0,-1},{11947,6,0,-1},{11947,7,0,-1}, +{11951,6,0,-1},{11951,7,0,-1},{11955,6,0,-1},{11955,7,0,-1},{11960,6,0,-1}, +{11960,7,0,-1},{11964,6,0,-1},{11964,7,0,-1},{11968,6,0,-1},{11968,7,0,-1}, +{11973,6,0,-1},{11973,7,0,-1},{11977,6,0,-1},{11977,7,0,-1},{11981,6,0,-1}, +{11981,7,0,-1},{11986,6,0,-1},{11986,7,0,-1},{11990,6,0,-1},{11990,7,0,-1}, +{11994,6,0,-1},{11994,7,0,-1},{11999,6,0,-1},{11999,7,0,-1},{12003,6,0,-1}, +{12003,7,0,-1},{12007,6,0,-1},{12007,7,0,-1},{12012,6,0,-1},{12012,7,0,-1}, +{12016,6,0,-1},{12016,7,0,-1},{11946,6,0,-1},{12020,6,0,-1},{12020,7,0,-1}, +{12025,6,0,-1},{12025,7,0,-1},{12029,6,0,-1},{12029,7,0,-1},{11959,7,0,-1}, +{12033,6,0,-1},{12033,7,0,-1},{12038,6,0,-1},{12038,7,0,-1},{12042,6,0,-1}, +{12042,7,0,-1},{12046,6,0,-1},{12046,7,0,-1},{12051,6,0,-1},{12051,7,0,-1}, +{12055,6,0,-1},{12055,7,0,-1},{12059,6,0,-1},{12059,7,0,-1},{12064,6,0,-1}, +{12064,7,0,-1},{12068,6,0,-1},{12068,7,0,-1},{12072,6,0,-1},{12072,7,0,-1}, +{12077,6,0,-1},{12077,7,0,-1},{12081,6,0,-1},{12081,7,0,-1},{12085,6,0,-1}, +{12085,7,0,-1},{12090,6,0,-1},{12090,7,0,-1},{12094,6,0,-1},{12094,7,0,-1}, +{12098,6,0,-1},{12098,7,0,-1},{12103,6,0,-1},{12103,7,0,-1},{12107,6,0,-1}, +{12107,7,0,-1},{12111,6,0,-1},{12111,7,0,-1},{12116,6,0,-1},{12116,7,0,-1}, +{12120,6,0,-1},{12120,7,0,-1},{12050,6,0,-1},{12124,6,0,-1},{12124,7,0,-1}, +{12129,6,0,-1},{12129,7,0,-1},{12133,6,0,-1},{12133,7,0,-1},{12063,7,0,-1}, +{12137,6,0,-1},{12137,7,0,-1},{12142,6,0,-1},{12142,7,0,-1},{12146,6,0,-1}, +{12146,7,0,-1},{12150,6,0,-1},{12150,7,0,-1},{12155,6,0,-1},{12155,7,0,-1}, +{12159,6,0,-1},{12159,7,0,-1},{12163,6,0,-1},{12163,7,0,-1},{12168,6,0,-1}, +{12168,7,0,-1},{12172,6,0,-1},{12172,7,0,-1},{12176,6,0,-1},{12176,7,0,-1}, +{12181,6,0,-1},{12181,7,0,-1},{12185,6,0,-1},{12185,7,0,-1},{12189,6,0,-1}, +{12189,7,0,-1},{12194,6,0,-1},{12194,7,0,-1},{12198,6,0,-1},{12198,7,0,-1}, +{12202,6,0,-1},{12202,7,0,-1},{12207,6,0,-1},{12207,7,0,-1},{12211,6,0,-1}, +{12211,7,0,-1},{12215,6,0,-1},{12215,7,0,-1},{12220,6,0,-1},{12220,7,0,-1}, +{12224,6,0,-1},{12224,7,0,-1},{12154,6,0,-1},{12228,6,0,-1},{12228,7,0,-1}, +{12233,6,0,-1},{12233,7,0,-1},{12237,6,0,-1},{12237,7,0,-1},{12167,7,0,-1}, +{12241,6,0,-1},{12241,7,0,-1},{12246,6,0,-1},{12246,7,0,-1},{12250,7,0,-1}, +{12254,7,0,-1},{12259,6,0,-1},{12259,7,0,-1},{12263,7,0,-1},{12267,7,0,-1}, +{12272,6,0,-1},{12272,7,0,-1},{12276,6,0,-1},{12276,7,0,-1},{12280,6,0,-1}, +{12280,7,0,-1},{12285,6,0,-1},{12285,7,0,-1},{12289,7,0,-1},{12293,7,0,-1}, +{12298,7,0,-1},{12302,7,0,-1},{12306,6,0,-1},{12306,7,0,-1},{12311,6,0,-1}, +{12311,7,0,-1},{12315,7,0,-1},{12319,7,0,-1},{12324,7,0,-1},{12328,7,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS2, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_2_ss0_ss1[] = { +{8252,0,1,-1},{8987,2,0,-1},{8996,2,0,-1},{9004,2,0,-1},{9013,2,0,-1}, +{9022,2,0,-1},{9030,2,0,-1},{9039,2,0,-1},{9043,2,0,-1},{9048,2,0,-1}, +{8982,2,0,-1},{9056,2,0,-1},{9065,2,0,-1},{9074,2,0,-1},{9082,2,0,-1}, +{9091,2,0,-1},{9100,2,0,-1},{9108,2,0,-1},{9117,2,0,-1},{9126,2,0,-1}, +{9134,2,0,-1},{9143,2,0,-1},{9152,2,0,-1},{9086,2,0,-1},{9160,2,0,-1}, +{9169,2,0,-1},{9173,2,0,-1},{9178,2,0,-1},{9182,2,0,-1},{9186,2,0,-1}, +{9191,2,0,-1},{9195,2,0,-1},{9199,2,0,-1},{9204,2,0,-1},{9208,2,0,-1}, +{9212,2,0,-1},{9217,2,0,-1},{9221,2,0,-1},{9225,2,0,-1},{9230,2,0,-1}, +{9234,2,0,-1},{9238,2,0,-1},{9243,2,0,-1},{9247,2,0,-1},{9251,2,0,-1}, +{9256,2,0,-1},{9190,2,0,-1},{9260,2,0,-1},{9264,2,0,-1},{9269,2,0,-1}, +{9273,2,0,-1},{9277,2,0,-1},{9282,2,0,-1},{9286,2,0,-1},{9290,2,0,-1}, +{9295,2,0,-1},{9299,2,0,-1},{9303,2,0,-1},{9308,2,0,-1},{9312,2,0,-1}, +{9316,2,0,-1},{9321,2,0,-1},{9325,2,0,-1},{9329,2,0,-1},{9334,2,0,-1}, +{9338,2,0,-1},{9342,2,0,-1},{9347,2,0,-1},{9351,2,0,-1},{9355,2,0,-1}, +{9360,2,0,-1},{9294,2,0,-1},{9364,2,0,-1},{9368,2,0,-1},{9369,2,1,-1}, +{9373,2,0,-1},{9377,2,0,-1},{9381,2,0,-1},{9382,2,1,-1},{9386,2,0,-1}, +{9390,2,0,-1},{9391,2,1,-1},{9394,2,0,-1},{9395,2,1,-1},{9399,2,0,-1}, +{9403,2,0,-1},{9404,2,1,-1},{9407,2,0,-1},{9412,2,0,-1},{9413,2,1,-1}, +{9416,2,0,-1},{9420,2,0,-1},{9421,2,1,-1},{9425,2,0,-1},{9429,2,0,-1}, +{9430,2,1,-1},{9433,2,0,-1},{9438,2,0,-1},{9439,2,1,-1},{9442,2,0,-1}, +{9446,2,0,-1},{9447,2,1,-1},{9451,2,0,-1},{9455,2,0,-1},{9456,2,1,-1}, +{9459,2,0,-1},{9464,2,0,-1},{9465,2,1,-1},{9398,2,0,-1},{9468,2,0,-1}, +{9472,2,0,-1},{9473,2,1,-1},{9477,2,0,-1},{9411,2,1,-1},{9481,2,0,-1}, +{9482,2,1,-1},{9485,2,0,-1},{9490,2,0,-1},{9491,2,1,-1},{9494,2,0,-1}, +{9498,2,0,-1},{9499,2,1,-1},{9503,2,0,-1},{9504,2,1,-1},{9507,2,0,-1}, +{9508,2,1,-1},{9511,2,0,-1},{9512,2,1,-1},{9516,2,0,-1},{9517,2,1,-1}, +{9520,2,0,-1},{9521,2,1,-1},{9524,2,0,-1},{9525,2,1,-1},{9529,2,0,-1}, +{9533,2,0,-1},{9534,2,1,-1},{9537,2,0,-1},{9538,2,1,-1},{9542,2,0,-1}, +{9543,2,1,-1},{9546,2,0,-1},{9547,2,1,-1},{9550,2,0,-1},{9551,2,1,-1}, +{9555,2,0,-1},{9556,2,1,-1},{9559,2,0,-1},{9560,2,1,-1},{9563,2,0,-1}, +{9564,2,1,-1},{9568,2,0,-1},{9569,2,1,-1},{9502,2,0,-1},{9573,2,1,-1}, +{9576,2,0,-1},{9577,2,1,-1},{9581,2,0,-1},{9582,2,1,-1},{9515,2,1,-1}, +{9585,2,0,-1},{9586,2,1,-1},{9589,2,0,-1},{9590,2,1,-1},{9594,2,0,-1}, +{9595,2,1,-1},{9598,2,0,-1},{9599,2,1,-1},{9602,2,0,-1},{9603,2,1,-1}, +{9607,2,0,-1},{9608,2,1,-1},{9611,2,0,-1},{9612,2,1,-1},{9615,2,0,-1}, +{9616,2,1,-1},{9620,2,0,-1},{9621,2,1,-1},{9624,2,0,-1},{9625,2,1,-1}, +{9628,2,0,-1},{9629,2,1,-1},{9633,2,0,-1},{9634,2,1,-1},{9637,2,0,-1}, +{9638,2,1,-1},{9641,2,0,-1},{9642,2,1,-1},{9646,2,0,-1},{9647,2,1,-1}, +{9650,2,0,-1},{9651,2,1,-1},{9654,2,0,-1},{9655,2,1,-1},{9659,2,0,-1}, +{9660,2,1,-1},{9663,2,0,-1},{9664,2,1,-1},{9667,2,0,-1},{9668,2,1,-1}, +{9672,2,0,-1},{9673,2,1,-1},{9606,2,0,-1},{9676,2,0,-1},{9677,2,1,-1}, +{9680,2,0,-1},{9681,2,1,-1},{9685,2,0,-1},{9686,2,1,-1},{9619,2,1,-1}, +{9689,2,0,-1},{9690,2,1,-1},{9693,2,0,-1},{9694,2,1,-1},{9698,2,0,-1}, +{9699,2,1,-1},{9702,2,0,-1},{9703,2,1,-1},{9706,2,0,-1},{9707,2,1,-1}, +{9711,2,0,-1},{9712,2,1,-1},{9715,2,0,-1},{9716,2,1,-1},{9719,2,0,-1}, +{9724,2,0,-1},{9725,2,1,-1},{9728,2,0,-1},{9729,2,1,-1},{9732,2,0,-1}, +{9733,2,1,-1},{9737,2,0,-1},{9738,2,1,-1},{9741,2,0,-1},{9742,2,1,-1}, +{9745,2,0,-1},{9746,2,1,-1},{9750,2,0,-1},{9751,2,1,-1},{9754,2,0,-1}, +{9755,2,1,-1},{9758,2,0,-1},{9759,2,1,-1},{9764,2,1,-1},{9767,2,0,-1}, +{9768,2,1,-1},{9771,2,0,-1},{9776,2,0,-1},{9777,2,1,-1},{9710,2,0,-1}, +{9780,2,0,-1},{9781,2,1,-1},{9784,2,0,-1},{9785,2,1,-1},{9789,2,0,-1}, +{9790,2,1,-1},{9723,2,1,-1},{9793,2,0,-1},{9794,2,1,-1},{9797,2,0,-1}, +{9798,2,1,-1},{9802,2,0,-1},{9803,2,1,-1},{9806,2,0,-1},{9807,2,1,-1}, +{9810,2,0,-1},{9811,2,1,-1},{9815,2,0,-1},{9816,2,1,-1},{9819,2,0,-1}, +{9820,2,1,-1},{9823,2,0,-1},{9824,2,1,-1},{9828,2,0,-1},{9829,2,1,-1}, +{9832,2,0,-1},{9833,2,1,-1},{9836,2,0,-1},{9837,2,1,-1},{9841,2,0,-1}, +{9842,2,1,-1},{9845,2,0,-1},{9846,2,1,-1},{9849,2,0,-1},{9850,2,1,-1}, +{9854,2,0,-1},{9855,2,1,-1},{9858,2,0,-1},{9859,2,1,-1},{9862,2,0,-1}, +{9863,2,1,-1},{9867,2,0,-1},{9868,2,1,-1},{9871,2,0,-1},{9872,2,1,-1}, +{9875,2,0,-1},{9876,2,1,-1},{9880,2,0,-1},{9881,2,1,-1},{9814,2,0,-1}, +{9884,2,0,-1},{9885,2,1,-1},{9888,2,0,-1},{9889,2,1,-1},{9893,2,0,-1}, +{9894,2,1,-1},{9827,2,1,-1},{9897,2,0,-1},{9898,2,1,-1},{9901,2,0,-1}, +{9902,2,1,-1},{9906,2,0,-1},{9907,2,1,-1},{9910,2,0,-1},{9911,2,1,-1}, +{9914,2,0,-1},{9915,2,1,-1},{9919,2,0,-1},{9920,2,1,-1},{9923,2,0,-1}, +{9924,2,1,-1},{9927,2,0,-1},{9928,2,1,-1},{9932,2,0,-1},{9933,2,1,-1}, +{9936,2,0,-1},{9937,2,1,-1},{9940,2,0,-1},{9941,2,1,-1},{9945,2,0,-1}, +{9946,2,1,-1},{9949,2,0,-1},{9950,2,1,-1},{9953,2,0,-1},{9954,2,1,-1}, +{9958,2,0,-1},{9959,2,1,-1},{9962,2,0,-1},{9963,2,1,-1},{9966,2,0,-1}, +{9967,2,1,-1},{9971,2,0,-1},{9972,2,1,-1},{9975,2,0,-1},{9976,2,1,-1}, +{9979,2,0,-1},{9980,2,1,-1},{9984,2,0,-1},{9985,2,1,-1},{9918,2,0,-1}, +{9988,2,0,-1},{9989,2,1,-1},{9992,2,0,-1},{9993,2,1,-1},{9997,2,0,-1}, +{9998,2,1,-1},{9931,2,1,-1},{10001,2,0,-1},{10002,2,1,-1},{10005,2,0,-1}, +{10006,2,1,-1},{10010,2,0,-1},{10011,2,1,-1},{10014,2,0,-1},{10015,2,1,-1}, +{10018,2,0,-1},{10019,2,1,-1},{10023,2,0,-1},{10024,2,1,-1},{10027,2,0,-1}, +{10028,2,1,-1},{10031,2,0,-1},{10032,2,1,-1},{10036,2,0,-1},{10037,2,1,-1}, +{10040,2,0,-1},{10041,2,1,-1},{10044,2,0,-1},{10045,2,1,-1},{10049,2,0,-1}, +{10050,2,1,-1},{10053,2,0,-1},{10054,2,1,-1},{10057,2,0,-1},{10058,2,1,-1}, +{10062,2,0,-1},{10063,2,1,-1},{10066,2,0,-1},{10067,2,1,-1},{10070,2,0,-1}, +{10071,2,1,-1},{10075,2,0,-1},{10076,2,1,-1},{10079,2,0,-1},{10080,2,1,-1}, +{10083,2,0,-1},{10084,2,1,-1},{10088,2,0,-1},{10089,2,1,-1},{10022,2,0,-1}, +{10092,2,0,-1},{10093,2,1,-1},{10096,2,0,-1},{10097,2,1,-1},{10101,2,0,-1}, +{10102,2,1,-1},{10035,2,1,-1},{10105,2,0,-1},{10106,2,1,-1},{10109,2,0,-1}, +{10110,2,1,-1},{10114,2,0,-1},{10115,2,1,-1},{10118,2,0,-1},{10119,2,1,-1}, +{10122,2,0,-1},{10123,2,1,-1},{10127,2,0,-1},{10128,2,1,-1},{10131,2,0,-1}, +{10132,2,1,-1},{10135,2,0,-1},{10136,2,1,-1},{10140,2,0,-1},{10141,2,1,-1}, +{10144,2,0,-1},{10145,2,1,-1},{10148,2,0,-1},{10149,2,1,-1},{10153,2,0,-1}, +{10154,2,1,-1},{10157,2,0,-1},{10158,2,1,-1},{10161,2,0,-1},{10162,2,1,-1}, +{10166,2,0,-1},{10167,2,1,-1},{10170,2,0,-1},{10171,2,1,-1},{10174,2,0,-1}, +{10175,2,1,-1},{10179,2,0,-1},{10180,2,1,-1},{10183,2,0,-1},{10184,2,1,-1}, +{10187,2,0,-1},{10188,2,1,-1},{10192,2,0,-1},{10193,2,1,-1},{10126,2,0,-1}, +{10196,2,0,-1},{10197,2,1,-1},{10200,2,0,-1},{10201,2,1,-1},{10205,2,0,-1}, +{10206,2,1,-1},{10139,2,1,-1},{10209,2,0,-1},{10210,2,1,-1},{10213,2,0,-1}, +{10214,2,1,-1},{10218,2,0,-1},{10219,2,1,-1},{10222,2,0,-1},{10223,2,1,-1}, +{10226,2,0,-1},{10227,2,1,-1},{10231,2,0,-1},{10232,2,1,-1},{10235,2,0,-1}, +{10236,2,1,-1},{10239,2,0,-1},{10240,2,1,-1},{10244,2,0,-1},{10245,2,1,-1}, +{10248,2,0,-1},{10249,2,1,-1},{10252,2,0,-1},{10253,2,1,-1},{10257,2,0,-1}, +{10258,2,1,-1},{10261,2,0,-1},{10262,2,1,-1},{10265,2,0,-1},{10266,2,1,-1}, +{10270,2,0,-1},{10271,2,1,-1},{10274,2,0,-1},{10275,2,1,-1},{10278,2,0,-1}, +{10279,2,1,-1},{10283,2,0,-1},{10284,2,1,-1},{10287,2,0,-1},{10288,2,1,-1}, +{10291,2,0,-1},{10292,2,1,-1},{10296,2,0,-1},{10297,2,1,-1},{10230,2,0,-1}, +{10300,2,0,-1},{10301,2,1,-1},{10304,2,0,-1},{10305,2,1,-1},{10309,2,0,-1}, +{10310,2,1,-1},{10243,2,1,-1},{10313,2,0,-1},{10314,2,1,-1},{10317,2,0,-1}, +{10318,2,1,-1},{10322,2,0,-1},{10323,2,1,-1},{10326,2,0,-1},{10327,2,1,-1}, +{10330,2,0,-1},{10331,2,1,-1},{10335,2,0,-1},{10336,2,1,-1},{10339,2,0,-1}, +{10340,2,1,-1},{10343,2,0,-1},{10344,2,1,-1},{10348,2,0,-1},{10349,2,1,-1}, +{10352,2,0,-1},{10353,2,1,-1},{10356,2,0,-1},{10357,2,1,-1},{10361,2,0,-1}, +{10362,2,1,-1},{10365,2,0,-1},{10366,2,1,-1},{10369,2,0,-1},{10370,2,1,-1}, +{10374,2,0,-1},{10375,2,1,-1},{10378,2,0,-1},{10379,2,1,-1},{10382,2,0,-1}, +{10383,2,1,-1},{10387,2,0,-1},{10388,2,1,-1},{10391,2,0,-1},{10392,2,1,-1}, +{10395,2,0,-1},{10396,2,1,-1},{10400,2,0,-1},{10401,2,1,-1},{10334,2,0,-1}, +{10404,2,0,-1},{10405,2,1,-1},{10408,2,0,-1},{10409,2,1,-1},{10413,2,0,-1}, +{10414,2,1,-1},{10347,2,1,-1},{10417,2,0,-1},{10418,2,1,-1},{10421,2,0,-1}, +{10422,2,1,-1},{10426,2,0,-1},{10427,2,1,-1},{10430,2,0,-1},{10431,2,1,-1}, +{10434,2,0,-1},{10435,2,1,-1},{10439,2,0,-1},{10440,2,1,-1},{10443,2,0,-1}, +{10444,2,1,-1},{10447,2,0,-1},{10448,2,1,-1},{10452,2,0,-1},{10453,2,1,-1}, +{10456,2,0,-1},{10457,2,1,-1},{10460,2,0,-1},{10461,2,1,-1},{10465,2,0,-1}, +{10466,2,1,-1},{10469,2,0,-1},{10470,2,1,-1},{10473,2,0,-1},{10474,2,1,-1}, +{10478,2,0,-1},{10479,2,1,-1},{10482,2,0,-1},{10483,2,1,-1},{10486,2,0,-1}, +{10487,2,1,-1},{10491,2,0,-1},{10492,2,1,-1},{10495,2,0,-1},{10496,2,1,-1}, +{10499,2,0,-1},{10500,2,1,-1},{10504,2,0,-1},{10505,2,1,-1},{10438,2,0,-1}, +{10508,2,0,-1},{10509,2,1,-1},{10512,2,0,-1},{10513,2,1,-1},{10517,2,0,-1}, +{10518,2,1,-1},{10451,2,1,-1},{10521,2,0,-1},{10522,2,1,-1},{10525,2,0,-1}, +{10526,2,1,-1},{10530,2,0,-1},{10531,2,1,-1},{10534,2,0,-1},{10535,2,1,-1}, +{10538,2,0,-1},{10539,2,1,-1},{10543,2,0,-1},{10544,2,1,-1},{10547,2,0,-1}, +{10548,2,1,-1},{10551,2,0,-1},{10552,2,1,-1},{10556,2,0,-1},{10557,2,1,-1}, +{10560,2,0,-1},{10561,2,1,-1},{10564,2,0,-1},{10565,2,1,-1},{10569,2,0,-1}, +{10570,2,1,-1},{10573,2,0,-1},{10574,2,1,-1},{10577,2,0,-1},{10578,2,1,-1}, +{10582,2,0,-1},{10583,2,1,-1},{10586,2,0,-1},{10587,2,1,-1},{10590,2,0,-1}, +{10591,2,1,-1},{10595,2,0,-1},{10596,2,1,-1},{10599,2,0,-1},{10600,2,1,-1}, +{10603,2,0,-1},{10604,2,1,-1},{10608,2,0,-1},{10609,2,1,-1},{10542,2,0,-1}, +{10612,2,0,-1},{10613,2,1,-1},{10616,2,0,-1},{10617,2,1,-1},{10621,2,0,-1}, +{10622,2,1,-1},{10555,2,1,-1},{10625,2,0,-1},{10626,2,1,-1},{10629,2,0,-1}, +{10630,2,1,-1},{10634,2,0,-1},{10635,2,1,-1},{10638,2,0,-1},{10639,2,1,-1}, +{10642,2,0,-1},{10643,2,1,-1},{10647,2,0,-1},{10648,2,1,-1},{10651,2,0,-1}, +{10652,2,1,-1},{10655,2,0,-1},{10656,2,1,-1},{10660,2,0,-1},{10661,2,1,-1}, +{10664,2,0,-1},{10665,2,1,-1},{10668,2,0,-1},{10669,2,1,-1},{10673,2,0,-1}, +{10674,2,1,-1},{10677,2,0,-1},{10678,2,1,-1},{10681,2,0,-1},{10682,2,1,-1}, +{10686,2,0,-1},{10687,2,1,-1},{10690,2,0,-1},{10691,2,1,-1},{10694,2,0,-1}, +{10695,2,1,-1},{10699,2,0,-1},{10700,2,1,-1},{10703,2,0,-1},{10704,2,1,-1}, +{10707,2,0,-1},{10708,2,1,-1},{10712,2,0,-1},{10713,2,1,-1},{10646,2,0,-1}, +{10716,2,0,-1},{10717,2,1,-1},{10720,2,0,-1},{10721,2,1,-1},{10725,2,0,-1}, +{10726,2,1,-1},{10659,2,1,-1},{10729,2,0,-1},{10730,2,1,-1},{10733,2,0,-1}, +{10734,2,1,-1},{10738,2,0,-1},{10739,2,1,-1},{10742,2,0,-1},{10743,2,1,-1}, +{10746,2,0,-1},{10747,2,1,-1},{10751,2,0,-1},{10752,2,1,-1},{10755,2,0,-1}, +{10756,2,1,-1},{10759,2,0,-1},{10760,2,1,-1},{10764,2,0,-1},{10765,2,1,-1}, +{10768,2,0,-1},{10769,2,1,-1},{10772,2,0,-1},{10773,2,1,-1},{10777,2,0,-1}, +{10778,2,1,-1},{10781,2,0,-1},{10782,2,1,-1},{10785,2,0,-1},{10786,2,1,-1}, +{10790,2,0,-1},{10791,2,1,-1},{10794,2,0,-1},{10795,2,1,-1},{10798,2,0,-1}, +{10799,2,1,-1},{10803,2,0,-1},{10804,2,1,-1},{10807,2,0,-1},{10808,2,1,-1}, +{10811,2,0,-1},{10812,2,1,-1},{10816,2,0,-1},{10817,2,1,-1},{10750,2,0,-1}, +{10820,2,0,-1},{10821,2,1,-1},{10824,2,0,-1},{10825,2,1,-1},{10829,2,0,-1}, +{10830,2,1,-1},{10763,2,1,-1},{10833,2,0,-1},{10834,2,1,-1},{10837,2,0,-1}, +{10838,2,1,-1},{10842,2,0,-1},{10843,2,1,-1},{10846,2,0,-1},{10847,2,1,-1}, +{10850,2,0,-1},{10851,2,1,-1},{10855,2,0,-1},{10856,2,1,-1},{10859,2,0,-1}, +{10860,2,1,-1},{10863,2,0,-1},{10864,2,1,-1},{10868,2,0,-1},{10869,2,1,-1}, +{10872,2,0,-1},{10873,2,1,-1},{10876,2,0,-1},{10877,2,1,-1},{10881,2,0,-1}, +{10882,2,1,-1},{10885,2,0,-1},{10886,2,1,-1},{10889,2,0,-1},{10890,2,1,-1}, +{10894,2,0,-1},{10895,2,1,-1},{10898,2,0,-1},{10899,2,1,-1},{10902,2,0,-1}, +{10903,2,1,-1},{10907,2,0,-1},{10908,2,1,-1},{10911,2,0,-1},{10912,2,1,-1}, +{10915,2,0,-1},{10916,2,1,-1},{10920,2,0,-1},{10921,2,1,-1},{10854,2,0,-1}, +{10924,2,0,-1},{10925,2,1,-1},{10928,2,0,-1},{10929,2,1,-1},{10933,2,0,-1}, +{10934,2,1,-1},{10867,2,1,-1},{10937,2,0,-1},{10938,2,1,-1},{10941,2,0,-1}, +{10942,2,1,-1},{10946,2,0,-1},{10947,2,1,-1},{10950,2,0,-1},{10951,2,1,-1}, +{10954,2,0,-1},{10955,2,1,-1},{10959,2,0,-1},{10960,2,1,-1},{10963,2,0,-1}, +{10964,2,1,-1},{10967,2,0,-1},{10968,2,1,-1},{10972,2,0,-1},{10973,2,1,-1}, +{10976,2,0,-1},{10977,2,1,-1},{10980,2,0,-1},{10981,2,1,-1},{10985,2,0,-1}, +{10986,2,1,-1},{10989,2,0,-1},{10990,2,1,-1},{10993,2,0,-1},{10994,2,1,-1}, +{10998,2,0,-1},{10999,2,1,-1},{11002,2,0,-1},{11003,2,1,-1},{11006,2,0,-1}, +{11007,2,1,-1},{11011,2,0,-1},{11012,2,1,-1},{11015,2,0,-1},{11016,2,1,-1}, +{11019,2,0,-1},{11020,2,1,-1},{11024,2,0,-1},{11025,2,1,-1},{10958,2,0,-1}, +{11028,2,0,-1},{11029,2,1,-1},{11032,2,0,-1},{11033,2,1,-1},{11037,2,0,-1}, +{11038,2,1,-1},{10971,2,1,-1},{11041,2,0,-1},{11042,2,1,-1},{11045,2,0,-1}, +{11046,2,1,-1},{11050,2,0,-1},{11051,2,1,-1},{11054,2,0,-1},{11055,2,1,-1}, +{11058,2,0,-1},{11059,2,1,-1},{11063,2,0,-1},{11064,2,1,-1},{11067,2,0,-1}, +{11068,2,1,-1},{11071,2,0,-1},{11072,2,1,-1},{11076,2,0,-1},{11077,2,1,-1}, +{11080,2,0,-1},{11081,2,1,-1},{11084,2,0,-1},{11085,2,1,-1},{11089,2,0,-1}, +{11090,2,1,-1},{11093,2,0,-1},{11094,2,1,-1},{11097,2,0,-1},{11098,2,1,-1}, +{11102,2,0,-1},{11103,2,1,-1},{11106,2,0,-1},{11107,2,1,-1},{11110,2,0,-1}, +{11111,2,1,-1},{11115,2,0,-1},{11116,2,1,-1},{11119,2,0,-1},{11120,2,1,-1}, +{11123,2,0,-1},{11124,2,1,-1},{11128,2,0,-1},{11129,2,1,-1},{11062,2,0,-1}, +{11132,2,0,-1},{11133,2,1,-1},{11136,2,0,-1},{11137,2,1,-1},{11141,2,0,-1}, +{11142,2,1,-1},{11075,2,1,-1},{11145,2,0,-1},{11146,2,1,-1},{11149,2,0,-1}, +{11150,2,1,-1},{11154,2,0,-1},{11155,2,1,-1},{11158,2,0,-1},{11159,2,1,-1}, +{11162,2,0,-1},{11163,2,1,-1},{11167,2,0,-1},{11168,2,1,-1},{11171,2,0,-1}, +{11172,2,1,-1},{11175,2,0,-1},{11176,2,1,-1},{11180,2,0,-1},{11181,2,1,-1}, +{11184,2,0,-1},{11185,2,1,-1},{11188,2,0,-1},{11189,2,1,-1},{11193,2,0,-1}, +{11194,2,1,-1},{11197,2,0,-1},{11198,2,1,-1},{11201,2,0,-1},{11202,2,1,-1}, +{11206,2,0,-1},{11207,2,1,-1},{11210,2,0,-1},{11211,2,1,-1},{11214,2,0,-1}, +{11215,2,1,-1},{11219,2,0,-1},{11220,2,1,-1},{11223,2,0,-1},{11224,2,1,-1}, +{11227,2,0,-1},{11228,2,1,-1},{11232,2,0,-1},{11233,2,1,-1},{11166,2,0,-1}, +{11236,2,0,-1},{11237,2,1,-1},{11240,2,0,-1},{11241,2,1,-1},{11245,2,0,-1}, +{11246,2,1,-1},{11179,2,1,-1},{11249,2,0,-1},{11250,2,1,-1},{11253,2,0,-1}, +{11254,2,1,-1},{11258,2,0,-1},{11259,2,1,-1},{11262,2,0,-1},{11263,2,1,-1}, +{11266,2,0,-1},{11267,2,1,-1},{11271,2,0,-1},{11272,2,1,-1},{11275,2,0,-1}, +{11276,2,1,-1},{11279,2,0,-1},{11280,2,1,-1},{11284,2,0,-1},{11285,2,1,-1}, +{11288,2,0,-1},{11289,2,1,-1},{11292,2,0,-1},{11293,2,1,-1},{11297,2,0,-1}, +{11298,2,1,-1},{11301,2,0,-1},{11302,2,1,-1},{11305,2,0,-1},{11306,2,1,-1}, +{11310,2,0,-1},{11311,2,1,-1},{11314,2,0,-1},{11315,2,1,-1},{11318,2,0,-1}, +{11319,2,1,-1},{11323,2,0,-1},{11324,2,1,-1},{11327,2,0,-1},{11328,2,1,-1}, +{11331,2,0,-1},{11332,2,1,-1},{11336,2,0,-1},{11337,2,1,-1},{11270,2,0,-1}, +{11340,2,0,-1},{11341,2,1,-1},{11344,2,0,-1},{11345,2,1,-1},{11349,2,0,-1}, +{11350,2,1,-1},{11283,2,1,-1},{11353,2,0,-1},{11354,2,1,-1},{11357,2,0,-1}, +{11358,2,1,-1},{11362,2,0,-1},{11363,2,1,-1},{11366,2,0,-1},{11367,2,1,-1}, +{11370,2,0,-1},{11371,2,1,-1},{11375,2,0,-1},{11376,2,1,-1},{11379,2,0,-1}, +{11380,2,1,-1},{11383,2,0,-1},{11384,2,1,-1},{11388,2,0,-1},{11389,2,1,-1}, +{11392,2,0,-1},{11393,2,1,-1},{11396,2,0,-1},{11397,2,1,-1},{11401,2,0,-1}, +{11402,2,1,-1},{11405,2,0,-1},{11406,2,1,-1},{11409,2,0,-1},{11410,2,1,-1}, +{11414,2,0,-1},{11415,2,1,-1},{11418,2,0,-1},{11419,2,1,-1},{11422,2,0,-1}, +{11423,2,1,-1},{11427,2,0,-1},{11428,2,1,-1},{11431,2,0,-1},{11432,2,1,-1}, +{11435,2,0,-1},{11436,2,1,-1},{11440,2,0,-1},{11441,2,1,-1},{11374,2,0,-1}, +{11444,2,0,-1},{11445,2,1,-1},{11448,2,0,-1},{11449,2,1,-1},{11453,2,0,-1}, +{11454,2,1,-1},{11387,2,1,-1},{11457,2,0,-1},{11458,2,1,-1},{11461,2,0,-1}, +{11462,2,1,-1},{11466,2,0,-1},{11467,2,1,-1},{11470,2,0,-1},{11471,2,1,-1}, +{11474,2,0,-1},{11475,2,1,-1},{11479,2,0,-1},{11480,2,1,-1},{11483,2,0,-1}, +{11484,2,1,-1},{11487,2,0,-1},{11488,2,1,-1},{11492,2,0,-1},{11493,2,1,-1}, +{11496,2,0,-1},{11497,2,1,-1},{11500,2,0,-1},{11501,2,1,-1},{11505,2,0,-1}, +{11506,2,1,-1},{11509,2,0,-1},{11510,2,1,-1},{11513,2,0,-1},{11514,2,1,-1}, +{11518,2,0,-1},{11519,2,1,-1},{11522,2,0,-1},{11523,2,1,-1},{11526,2,0,-1}, +{11527,2,1,-1},{11531,2,0,-1},{11532,2,1,-1},{11535,2,0,-1},{11536,2,1,-1}, +{11539,2,0,-1},{11540,2,1,-1},{11544,2,0,-1},{11545,2,1,-1},{11478,2,0,-1}, +{11548,2,0,-1},{11549,2,1,-1},{11552,2,0,-1},{11553,2,1,-1},{11557,2,0,-1}, +{11558,2,1,-1},{11491,2,1,-1},{11561,2,0,-1},{11562,2,1,-1},{11565,2,0,-1}, +{11566,2,1,-1},{11570,2,0,-1},{11571,2,1,-1},{11574,2,0,-1},{11575,2,1,-1}, +{11578,2,0,-1},{11579,2,1,-1},{11583,2,0,-1},{11584,2,1,-1},{11587,2,0,-1}, +{11588,2,1,-1},{11591,2,0,-1},{11596,2,0,-1},{11597,2,1,-1},{11600,2,0,-1}, +{11601,2,1,-1},{11604,2,0,-1},{11605,2,1,-1},{11609,2,0,-1},{11610,2,1,-1}, +{11613,2,0,-1},{11614,2,1,-1},{11617,2,0,-1},{11618,2,1,-1},{11622,2,0,-1}, +{11623,2,1,-1},{11626,2,0,-1},{11627,2,1,-1},{11630,2,0,-1},{11631,2,1,-1}, +{11635,2,0,-1},{11636,2,1,-1},{11639,2,0,-1},{11640,2,1,-1},{11648,2,0,-1}, +{11649,2,1,-1},{11582,2,0,-1},{11652,2,0,-1},{11653,2,1,-1},{11656,2,0,-1}, +{11657,2,1,-1},{11661,2,0,-1},{11662,2,1,-1},{11665,2,0,-1},{11666,2,1,-1}, +{11669,2,0,-1},{11670,2,1,-1},{11674,2,0,-1},{11675,2,1,-1},{11678,2,0,-1}, +{11679,2,1,-1},{11682,2,0,-1},{11683,2,1,-1},{11687,2,0,-1},{11688,2,1,-1}, +{11691,2,0,-1},{11692,2,1,-1},{11700,2,0,-1},{11704,2,0,-1},{11708,2,0,-1}, +{11713,2,0,-1},{11717,2,0,-1},{11721,2,0,-1},{11726,2,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS3, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_3_ss0_ss1[] = { +{10001,3,0,-1},{10002,3,1,-1},{10005,3,0,-1},{10006,3,1,-1},{10010,3,0,-1}, +{10011,3,1,-1},{10014,3,0,-1},{10015,3,1,-1},{10018,3,0,-1},{10019,3,1,-1}, +{10023,3,0,-1},{10024,3,1,-1},{10027,3,0,-1},{10028,3,1,-1},{10031,3,0,-1}, +{10032,3,1,-1},{10036,3,0,-1},{10037,3,1,-1},{10040,3,0,-1},{10041,3,1,-1}, +{10044,3,0,-1},{10045,3,1,-1},{10049,3,0,-1},{10050,3,1,-1},{10053,3,0,-1}, +{10054,3,1,-1},{10057,3,0,-1},{10058,3,1,-1},{10062,3,0,-1},{10063,3,1,-1}, +{10066,3,0,-1},{10067,3,1,-1},{10070,3,0,-1},{10071,3,1,-1},{10075,3,0,-1}, +{10076,3,1,-1},{10079,3,0,-1},{10080,3,1,-1},{10083,3,0,-1},{10084,3,1,-1}, +{10088,3,0,-1},{10089,3,1,-1},{10022,3,0,-1},{10092,3,0,-1},{10093,3,1,-1}, +{10096,3,0,-1},{10097,3,1,-1},{10101,3,0,-1},{10102,3,1,-1},{10035,3,1,-1}, +{10105,3,0,-1},{10106,3,1,-1},{10109,3,0,-1},{10110,3,1,-1},{10114,3,0,-1}, +{10115,3,1,-1},{10118,3,0,-1},{10119,3,1,-1},{10122,3,0,-1},{10123,3,1,-1}, +{10127,3,0,-1},{10128,3,1,-1},{10131,3,0,-1},{10132,3,1,-1},{10135,3,0,-1}, +{10136,3,1,-1},{10140,3,0,-1},{10141,3,1,-1},{10144,3,0,-1},{10145,3,1,-1}, +{10148,3,0,-1},{10149,3,1,-1},{10153,3,0,-1},{10154,3,1,-1},{10157,3,0,-1}, +{10158,3,1,-1},{10161,3,0,-1},{10162,3,1,-1},{10166,3,0,-1},{10167,3,1,-1}, +{10170,3,0,-1},{10171,3,1,-1},{10174,3,0,-1},{10175,3,1,-1},{10179,3,0,-1}, +{10180,3,1,-1},{10183,3,0,-1},{10184,3,1,-1},{10187,3,0,-1},{10188,3,1,-1}, +{10192,3,0,-1},{10193,3,1,-1},{10126,3,0,-1},{10196,3,0,-1},{10197,3,1,-1}, +{10200,3,0,-1},{10201,3,1,-1},{10205,3,0,-1},{10206,3,1,-1},{10139,3,1,-1}, +{10209,3,0,-1},{10210,3,1,-1},{10213,3,0,-1},{10214,3,1,-1},{10218,3,0,-1}, +{10219,3,1,-1},{10222,3,0,-1},{10223,3,1,-1},{10226,3,0,-1},{10227,3,1,-1}, +{10231,3,0,-1},{10232,3,1,-1},{10235,3,0,-1},{10236,3,1,-1},{10239,3,0,-1}, +{10240,3,1,-1},{10244,3,0,-1},{10245,3,1,-1},{10248,3,0,-1},{10249,3,1,-1}, +{10252,3,0,-1},{10253,3,1,-1},{10257,3,0,-1},{10258,3,1,-1},{10261,3,0,-1}, +{10262,3,1,-1},{10265,3,0,-1},{10266,3,1,-1},{10270,3,0,-1},{10271,3,1,-1}, +{10274,3,0,-1},{10275,3,1,-1},{10278,3,0,-1},{10279,3,1,-1},{10283,3,0,-1}, +{10284,3,1,-1},{10287,3,0,-1},{10288,3,1,-1},{10291,3,0,-1},{10292,3,1,-1}, +{10296,3,0,-1},{10297,3,1,-1},{10230,3,0,-1},{10300,3,0,-1},{10301,3,1,-1}, +{10304,3,0,-1},{10305,3,1,-1},{10309,3,0,-1},{10310,3,1,-1},{10243,3,1,-1}, +{10313,3,0,-1},{10314,3,1,-1},{10317,3,0,-1},{10318,3,1,-1},{10322,3,0,-1}, +{10323,3,1,-1},{10326,3,0,-1},{10327,3,1,-1},{10330,3,0,-1},{10331,3,1,-1}, +{10335,3,0,-1},{10336,3,1,-1},{10339,3,0,-1},{10340,3,1,-1},{10343,3,0,-1}, +{10344,3,1,-1},{10348,3,0,-1},{10349,3,1,-1},{10352,3,0,-1},{10353,3,1,-1}, +{10356,3,0,-1},{10357,3,1,-1},{10361,3,0,-1},{10362,3,1,-1},{10365,3,0,-1}, +{10366,3,1,-1},{10369,3,0,-1},{10370,3,1,-1},{10374,3,0,-1},{10375,3,1,-1}, +{10378,3,0,-1},{10379,3,1,-1},{10382,3,0,-1},{10383,3,1,-1},{10387,3,0,-1}, +{10388,3,1,-1},{10391,3,0,-1},{10392,3,1,-1},{10395,3,0,-1},{10396,3,1,-1}, +{10400,3,0,-1},{10401,3,1,-1},{10334,3,0,-1},{10404,3,0,-1},{10405,3,1,-1}, +{10408,3,0,-1},{10409,3,1,-1},{10413,3,0,-1},{10414,3,1,-1},{10347,3,1,-1}, +{10417,3,0,-1},{10418,3,1,-1},{10421,3,0,-1},{10422,3,1,-1},{10426,3,0,-1}, +{10427,3,1,-1},{10430,3,0,-1},{10431,3,1,-1},{10434,3,0,-1},{10435,3,1,-1}, +{10439,3,0,-1},{10440,3,1,-1},{10443,3,0,-1},{10444,3,1,-1},{10447,3,0,-1}, +{10448,3,1,-1},{10452,3,0,-1},{10453,3,1,-1},{10456,3,0,-1},{10457,3,1,-1}, +{10460,3,0,-1},{10461,3,1,-1},{10465,3,0,-1},{10466,3,1,-1},{10469,3,0,-1}, +{10470,3,1,-1},{10473,3,0,-1},{10474,3,1,-1},{10478,3,0,-1},{10479,3,1,-1}, +{10482,3,0,-1},{10483,3,1,-1},{10486,3,0,-1},{10487,3,1,-1},{10491,3,0,-1}, +{10492,3,1,-1},{10495,3,0,-1},{10496,3,1,-1},{10499,3,0,-1},{10500,3,1,-1}, +{10504,3,0,-1},{10505,3,1,-1},{10438,3,0,-1},{10508,3,0,-1},{10509,3,1,-1}, +{10512,3,0,-1},{10513,3,1,-1},{10517,3,0,-1},{10518,3,1,-1},{10451,3,1,-1}, +{10521,3,0,-1},{10522,3,1,-1},{10525,3,0,-1},{10526,3,1,-1},{10530,3,0,-1}, +{10531,3,1,-1},{10534,3,0,-1},{10535,3,1,-1},{10538,3,0,-1},{10539,3,1,-1}, +{10543,3,0,-1},{10544,3,1,-1},{10547,3,0,-1},{10548,3,1,-1},{10551,3,0,-1}, +{10552,3,1,-1},{10556,3,0,-1},{10557,3,1,-1},{10560,3,0,-1},{10561,3,1,-1}, +{10564,3,0,-1},{10565,3,1,-1},{10569,3,0,-1},{10570,3,1,-1},{10573,3,0,-1}, +{10574,3,1,-1},{10577,3,0,-1},{10578,3,1,-1},{10582,3,0,-1},{10583,3,1,-1}, +{10586,3,0,-1},{10587,3,1,-1},{10590,3,0,-1},{10591,3,1,-1},{10595,3,0,-1}, +{10596,3,1,-1},{10599,3,0,-1},{10600,3,1,-1},{10603,3,0,-1},{10604,3,1,-1}, +{10608,3,0,-1},{10609,3,1,-1},{10542,3,0,-1},{10612,3,0,-1},{10613,3,1,-1}, +{10616,3,0,-1},{10617,3,1,-1},{10621,3,0,-1},{10622,3,1,-1},{10555,3,1,-1}, +{10625,3,0,-1},{10626,3,1,-1},{10629,3,0,-1},{10630,3,1,-1},{10634,3,0,-1}, +{10635,3,1,-1},{10638,3,0,-1},{10639,3,1,-1},{10642,3,0,-1},{10643,3,1,-1}, +{10647,3,0,-1},{10648,3,1,-1},{10651,3,0,-1},{10652,3,1,-1},{10655,3,0,-1}, +{10656,3,1,-1},{10660,3,0,-1},{10661,3,1,-1},{10664,3,0,-1},{10665,3,1,-1}, +{10668,3,0,-1},{10669,3,1,-1},{10673,3,0,-1},{10674,3,1,-1},{10677,3,0,-1}, +{10678,3,1,-1},{10681,3,0,-1},{10682,3,1,-1},{10686,3,0,-1},{10687,3,1,-1}, +{10690,3,0,-1},{10691,3,1,-1},{10694,3,0,-1},{10695,3,1,-1},{10699,3,0,-1}, +{10700,3,1,-1},{10703,3,0,-1},{10704,3,1,-1},{10707,3,0,-1},{10708,3,1,-1}, +{10712,3,0,-1},{10713,3,1,-1},{10646,3,0,-1},{10716,3,0,-1},{10717,3,1,-1}, +{10720,3,0,-1},{10721,3,1,-1},{10725,3,0,-1},{10726,3,1,-1},{10659,3,1,-1}, +{10729,3,0,-1},{10730,3,1,-1},{10733,3,0,-1},{10734,3,1,-1},{10738,3,0,-1}, +{10739,3,1,-1},{10742,3,0,-1},{10743,3,1,-1},{10746,3,0,-1},{10747,3,1,-1}, +{10751,3,0,-1},{10752,3,1,-1},{10755,3,0,-1},{10756,3,1,-1},{10759,3,0,-1}, +{10760,3,1,-1},{10764,3,0,-1},{10765,3,1,-1},{10768,3,0,-1},{10769,3,1,-1}, +{10772,3,0,-1},{10773,3,1,-1},{10777,3,0,-1},{10778,3,1,-1},{10781,3,0,-1}, +{10782,3,1,-1},{10785,3,0,-1},{10786,3,1,-1},{10790,3,0,-1},{10791,3,1,-1}, +{10794,3,0,-1},{10795,3,1,-1},{10798,3,0,-1},{10799,3,1,-1},{10803,3,0,-1}, +{10804,3,1,-1},{10807,3,0,-1},{10808,3,1,-1},{10811,3,0,-1},{10812,3,1,-1}, +{10816,3,0,-1},{10817,3,1,-1},{10750,3,0,-1},{10820,3,0,-1},{10821,3,1,-1}, +{10824,3,0,-1},{10825,3,1,-1},{10829,3,0,-1},{10830,3,1,-1},{10763,3,1,-1}, +{10833,3,0,-1},{10834,3,1,-1},{10837,3,0,-1},{10838,3,1,-1},{10842,3,0,-1}, +{10843,3,1,-1},{10846,3,0,-1},{10847,3,1,-1},{10850,3,0,-1},{10851,3,1,-1}, +{10855,3,0,-1},{10856,3,1,-1},{10859,3,0,-1},{10860,3,1,-1},{10863,3,0,-1}, +{10864,3,1,-1},{10868,3,0,-1},{10869,3,1,-1},{10872,3,0,-1},{10873,3,1,-1}, +{10876,3,0,-1},{10877,3,1,-1},{10881,3,0,-1},{10882,3,1,-1},{10885,3,0,-1}, +{10886,3,1,-1},{10889,3,0,-1},{10890,3,1,-1},{10894,3,0,-1},{10895,3,1,-1}, +{10898,3,0,-1},{10899,3,1,-1},{10902,3,0,-1},{10903,3,1,-1},{10907,3,0,-1}, +{10908,3,1,-1},{10911,3,0,-1},{10912,3,1,-1},{10915,3,0,-1},{10916,3,1,-1}, +{10920,3,0,-1},{10921,3,1,-1},{10854,3,0,-1},{10924,3,0,-1},{10925,3,1,-1}, +{10928,3,0,-1},{10929,3,1,-1},{10933,3,0,-1},{10934,3,1,-1},{10867,3,1,-1}, +{10937,3,0,-1},{10938,3,1,-1},{10941,3,0,-1},{10942,3,1,-1},{10946,3,0,-1}, +{10947,3,1,-1},{10950,3,0,-1},{10951,3,1,-1},{10954,3,0,-1},{10955,3,1,-1}, +{10959,3,0,-1},{10960,3,1,-1},{10963,3,0,-1},{10964,3,1,-1},{10967,3,0,-1}, +{10968,3,1,-1},{10972,3,0,-1},{10973,3,1,-1},{10976,3,0,-1},{10977,3,1,-1}, +{10980,3,0,-1},{10981,3,1,-1},{10985,3,0,-1},{10986,3,1,-1},{10989,3,0,-1}, +{10990,3,1,-1},{10993,3,0,-1},{10994,3,1,-1},{10998,3,0,-1},{10999,3,1,-1}, +{11002,3,0,-1},{11003,3,1,-1},{11006,3,0,-1},{11007,3,1,-1},{11011,3,0,-1}, +{11012,3,1,-1},{11015,3,0,-1},{11016,3,1,-1},{11019,3,0,-1},{11020,3,1,-1}, +{11024,3,0,-1},{11025,3,1,-1},{10958,3,0,-1},{11028,3,0,-1},{11029,3,1,-1}, +{11032,3,0,-1},{11033,3,1,-1},{11037,3,0,-1},{11038,3,1,-1},{10971,3,1,-1}, +{11041,3,0,-1},{11042,3,1,-1},{11045,3,0,-1},{11046,3,1,-1},{11050,3,0,-1}, +{11051,3,1,-1},{11054,3,0,-1},{11055,3,1,-1},{11058,3,0,-1},{11059,3,1,-1}, +{11063,3,0,-1},{11064,3,1,-1},{11067,3,0,-1},{11068,3,1,-1},{11071,3,0,-1}, +{11072,3,1,-1},{11076,3,0,-1},{11077,3,1,-1},{11080,3,0,-1},{11081,3,1,-1}, +{11084,3,0,-1},{11085,3,1,-1},{11089,3,0,-1},{11090,3,1,-1},{11093,3,0,-1}, +{11094,3,1,-1},{11097,3,0,-1},{11098,3,1,-1},{11102,3,0,-1},{11103,3,1,-1}, +{11106,3,0,-1},{11107,3,1,-1},{11110,3,0,-1},{11111,3,1,-1},{11115,3,0,-1}, +{11116,3,1,-1},{11119,3,0,-1},{11120,3,1,-1},{11123,3,0,-1},{11124,3,1,-1}, +{11128,3,0,-1},{11129,3,1,-1},{11062,3,0,-1},{11132,3,0,-1},{11133,3,1,-1}, +{11136,3,0,-1},{11137,3,1,-1},{11141,3,0,-1},{11142,3,1,-1},{11075,3,1,-1}, +{11145,3,0,-1},{11146,3,1,-1},{11149,3,0,-1},{11150,3,1,-1},{11154,3,0,-1}, +{11155,3,1,-1},{11158,3,0,-1},{11159,3,1,-1},{11162,3,0,-1},{11163,3,1,-1}, +{11167,3,0,-1},{11168,3,1,-1},{11171,3,0,-1},{11172,3,1,-1},{11175,3,0,-1}, +{11176,3,1,-1},{11180,3,0,-1},{11181,3,1,-1},{11184,3,0,-1},{11185,3,1,-1}, +{11188,3,0,-1},{11189,3,1,-1},{11193,3,0,-1},{11194,3,1,-1},{11197,3,0,-1}, +{11198,3,1,-1},{11201,3,0,-1},{11202,3,1,-1},{11206,3,0,-1},{11207,3,1,-1}, +{11210,3,0,-1},{11211,3,1,-1},{11214,3,0,-1},{11215,3,1,-1},{11219,3,0,-1}, +{11220,3,1,-1},{11223,3,0,-1},{11224,3,1,-1},{11227,3,0,-1},{11228,3,1,-1}, +{11232,3,0,-1},{11233,3,1,-1},{11166,3,0,-1},{11236,3,0,-1},{11237,3,1,-1}, +{11240,3,0,-1},{11241,3,1,-1},{11245,3,0,-1},{11246,3,1,-1},{11179,3,1,-1}, +{11249,3,0,-1},{11250,3,1,-1},{11253,3,0,-1},{11254,3,1,-1},{11258,3,0,-1}, +{11259,3,1,-1},{11262,3,0,-1},{11263,3,1,-1},{11266,3,0,-1},{11267,3,1,-1}, +{11271,3,0,-1},{11272,3,1,-1},{11275,3,0,-1},{11276,3,1,-1},{11279,3,0,-1}, +{11280,3,1,-1},{11284,3,0,-1},{11285,3,1,-1},{11288,3,0,-1},{11289,3,1,-1}, +{11292,3,0,-1},{11293,3,1,-1},{11297,3,0,-1},{11298,3,1,-1},{11301,3,0,-1}, +{11302,3,1,-1},{11305,3,0,-1},{11306,3,1,-1},{11310,3,0,-1},{11311,3,1,-1}, +{11314,3,0,-1},{11315,3,1,-1},{11318,3,0,-1},{11319,3,1,-1},{11323,3,0,-1}, +{11324,3,1,-1},{11327,3,0,-1},{11328,3,1,-1},{11331,3,0,-1},{11332,3,1,-1}, +{11336,3,0,-1},{11337,3,1,-1},{11270,3,0,-1},{11340,3,0,-1},{11341,3,1,-1}, +{11344,3,0,-1},{11345,3,1,-1},{11349,3,0,-1},{11350,3,1,-1},{11283,3,1,-1}, +{11353,3,0,-1},{11354,3,1,-1},{11357,3,0,-1},{11358,3,1,-1},{11362,3,0,-1}, +{11363,3,1,-1},{11366,3,0,-1},{11367,3,1,-1},{11370,3,0,-1},{11371,3,1,-1}, +{11375,3,0,-1},{11376,3,1,-1},{11379,3,0,-1},{11380,3,1,-1},{11383,3,0,-1}, +{11384,3,1,-1},{11388,3,0,-1},{11389,3,1,-1},{11392,3,0,-1},{11393,3,1,-1}, +{11396,3,0,-1},{11397,3,1,-1},{11401,3,0,-1},{11402,3,1,-1},{11405,3,0,-1}, +{11406,3,1,-1},{11409,3,0,-1},{11410,3,1,-1},{11414,3,0,-1},{11415,3,1,-1}, +{11418,3,0,-1},{11419,3,1,-1},{11422,3,0,-1},{11423,3,1,-1},{11427,3,0,-1}, +{11428,3,1,-1},{11431,3,0,-1},{11432,3,1,-1},{11435,3,0,-1},{11436,3,1,-1}, +{11440,3,0,-1},{11441,3,1,-1},{11374,3,0,-1},{11444,3,0,-1},{11445,3,1,-1}, +{11448,3,0,-1},{11449,3,1,-1},{11453,3,0,-1},{11454,3,1,-1},{11387,3,1,-1}, +{11457,3,0,-1},{11458,3,1,-1},{11461,3,0,-1},{11462,3,1,-1},{11466,3,0,-1}, +{11467,3,1,-1},{11470,3,0,-1},{11471,3,1,-1},{11474,3,0,-1},{11475,3,1,-1}, +{11479,3,0,-1},{11480,3,1,-1},{11483,3,0,-1},{11484,3,1,-1},{11487,3,0,-1}, +{11488,3,1,-1},{11492,3,0,-1},{11493,3,1,-1},{11496,3,0,-1},{11497,3,1,-1}, +{11500,3,0,-1},{11501,3,1,-1},{11505,3,0,-1},{11506,3,1,-1},{11509,3,0,-1}, +{11510,3,1,-1},{11513,3,0,-1},{11514,3,1,-1},{11518,3,0,-1},{11519,3,1,-1}, +{11522,3,0,-1},{11523,3,1,-1},{11526,3,0,-1},{11527,3,1,-1},{11531,3,0,-1}, +{11532,3,1,-1},{11535,3,0,-1},{11536,3,1,-1},{11539,3,0,-1},{11540,3,1,-1}, +{11544,3,0,-1},{11545,3,1,-1},{11478,3,0,-1},{11548,3,0,-1},{11549,3,1,-1}, +{11552,3,0,-1},{11553,3,1,-1},{11557,3,0,-1},{11558,3,1,-1},{11491,3,1,-1}, +{11561,3,0,-1},{11562,3,1,-1},{11565,3,0,-1},{11566,3,1,-1},{11570,3,0,-1}, +{11571,3,1,-1},{11574,3,0,-1},{11575,3,1,-1},{11578,3,0,-1},{11579,3,1,-1}, +{11583,3,0,-1},{11584,3,1,-1},{11587,3,0,-1},{11588,3,1,-1},{11591,3,0,-1}, +{11592,3,1,-1},{11596,3,0,-1},{11597,3,1,-1},{11600,3,0,-1},{11601,3,1,-1}, +{11604,3,0,-1},{11605,3,1,-1},{11609,3,0,-1},{11610,3,1,-1},{11613,3,0,-1}, +{11614,3,1,-1},{11617,3,0,-1},{11618,3,1,-1},{11622,3,0,-1},{11623,3,1,-1}, +{11626,3,0,-1},{11627,3,1,-1},{11630,3,0,-1},{11631,3,1,-1},{11635,3,0,-1}, +{11636,3,1,-1},{11639,3,0,-1},{11640,3,1,-1},{11643,3,0,-1},{11644,3,1,-1}, +{11648,3,0,-1},{11649,3,1,-1},{11582,3,0,-1},{11652,3,0,-1},{11653,3,1,-1}, +{11656,3,0,-1},{11657,3,1,-1},{11661,3,0,-1},{11662,3,1,-1},{11595,3,1,-1}, +{11665,3,0,-1},{11666,3,1,-1},{11669,3,0,-1},{11670,3,1,-1},{11674,3,0,-1}, +{11675,3,1,-1},{11678,3,0,-1},{11679,3,1,-1},{11682,3,0,-1},{11683,3,1,-1}, +{11687,3,0,-1},{11688,3,1,-1},{11691,3,0,-1},{11692,3,1,-1},{11695,3,0,-1}, +{11696,3,1,-1},{11700,3,0,-1},{11701,3,1,-1},{11704,3,0,-1},{11705,3,1,-1}, +{11708,3,0,-1},{11709,3,1,-1},{11713,3,0,-1},{11714,3,1,-1},{11717,3,0,-1}, +{11718,3,1,-1},{11721,3,0,-1},{11722,3,1,-1},{11726,3,0,-1},{11727,3,1,-1}, +{11730,3,0,-1},{11731,3,1,-1},{11734,3,0,-1},{11735,3,1,-1},{11739,3,0,-1}, +{11740,3,1,-1},{11743,3,0,-1},{11744,3,1,-1},{11747,3,0,-1},{11748,3,1,-1}, +{11752,3,0,-1},{11753,3,1,-1},{11686,3,0,-1},{11756,3,0,-1},{11757,3,1,-1}, +{11760,3,0,-1},{11761,3,1,-1},{11765,3,0,-1},{11766,3,1,-1},{11699,3,1,-1}, +{11769,3,0,-1},{11770,3,1,-1},{11773,3,0,-1},{11774,3,1,-1},{11778,3,0,-1}, +{11779,3,1,-1},{11782,3,0,-1},{11783,3,1,-1},{11786,3,0,-1},{11787,3,1,-1}, +{11791,3,0,-1},{11792,3,1,-1},{11795,3,0,-1},{11796,3,1,-1},{11799,3,0,-1}, +{11800,3,1,-1},{11804,3,0,-1},{11805,3,1,-1},{11808,3,0,-1},{11809,3,1,-1}, +{11812,3,0,-1},{11813,3,1,-1},{11817,3,0,-1},{11818,3,1,-1},{11821,3,0,-1}, +{11822,3,1,-1},{11825,3,0,-1},{11826,3,1,-1},{11830,3,0,-1},{11831,3,1,-1}, +{11834,3,0,-1},{11835,3,1,-1},{11838,3,0,-1},{11839,3,1,-1},{11843,3,0,-1}, +{11844,3,1,-1},{11847,3,0,-1},{11848,3,1,-1},{11851,3,0,-1},{11852,3,1,-1}, +{11856,3,0,-1},{11857,3,1,-1},{11790,3,0,-1},{11860,3,0,-1},{11861,3,1,-1}, +{11864,3,0,-1},{11865,3,1,-1},{11869,3,0,-1},{11870,3,1,-1},{11803,3,1,-1}, +{11873,3,0,-1},{11874,3,1,-1},{11877,3,0,-1},{11878,3,1,-1},{11882,3,0,-1}, +{11883,3,1,-1},{11886,3,0,-1},{11887,3,1,-1},{11890,3,0,-1},{11891,3,1,-1}, +{11895,3,0,-1},{11896,3,1,-1},{11899,3,0,-1},{11900,3,1,-1},{11903,3,0,-1}, +{11904,3,1,-1},{11908,3,0,-1},{11909,3,1,-1},{11912,3,0,-1},{11913,3,1,-1}, +{11916,3,0,-1},{11917,3,1,-1},{11921,3,0,-1},{11922,3,1,-1},{11925,3,0,-1}, +{11926,3,1,-1},{11929,3,0,-1},{11930,3,1,-1},{11934,3,0,-1},{11935,3,1,-1}, +{11938,3,0,-1},{11939,3,1,-1},{11942,3,0,-1},{11943,3,1,-1},{11947,3,0,-1}, +{11948,3,1,-1},{11951,3,0,-1},{11952,3,1,-1},{11955,3,0,-1},{11956,3,1,-1}, +{11960,3,0,-1},{11961,3,1,-1},{11894,3,0,-1},{11964,3,0,-1},{11965,3,1,-1}, +{11968,3,0,-1},{11969,3,1,-1},{11973,3,0,-1},{11974,3,1,-1},{11907,3,1,-1}, +{11977,3,0,-1},{11978,3,1,-1},{11981,3,0,-1},{11982,3,1,-1},{11986,3,0,-1}, +{11987,3,1,-1},{11990,3,0,-1},{11991,3,1,-1},{11994,3,0,-1},{11995,3,1,-1}, +{11999,3,0,-1},{12000,3,1,-1},{12003,3,0,-1},{12004,3,1,-1},{12007,3,0,-1}, +{12008,3,1,-1},{12012,3,0,-1},{12013,3,1,-1},{12016,3,0,-1},{12017,3,1,-1}, +{12020,3,0,-1},{12021,3,1,-1},{12025,3,0,-1},{12026,3,1,-1},{12029,3,0,-1}, +{12030,3,1,-1},{12033,3,0,-1},{12034,3,1,-1},{12038,3,0,-1},{12039,3,1,-1}, +{12042,3,0,-1},{12043,3,1,-1},{12046,3,0,-1},{12047,3,1,-1},{12051,3,0,-1}, +{12052,3,1,-1},{12055,3,0,-1},{12056,3,1,-1},{12059,3,0,-1},{12060,3,1,-1}, +{12064,3,0,-1},{12065,3,1,-1},{11998,3,0,-1},{12068,3,0,-1},{12069,3,1,-1}, +{12072,3,0,-1},{12073,3,1,-1},{12077,3,0,-1},{12078,3,1,-1},{12011,3,1,-1}, +{12081,3,0,-1},{12082,3,1,-1},{12085,3,0,-1},{12086,3,1,-1},{12090,3,0,-1}, +{12091,3,1,-1},{12094,3,0,-1},{12095,3,1,-1},{12098,3,0,-1},{12099,3,1,-1}, +{12103,3,0,-1},{12104,3,1,-1},{12107,3,0,-1},{12108,3,1,-1},{12111,3,0,-1}, +{12112,3,1,-1},{12116,3,0,-1},{12117,3,1,-1},{12120,3,0,-1},{12121,3,1,-1}, +{12124,3,0,-1},{12125,3,1,-1},{12129,3,0,-1},{12130,3,1,-1},{12133,3,0,-1}, +{12134,3,1,-1},{12137,3,0,-1},{12138,3,1,-1},{12142,3,0,-1},{12143,3,1,-1}, +{12146,3,0,-1},{12147,3,1,-1},{12150,3,0,-1},{12151,3,1,-1},{12155,3,0,-1}, +{12156,3,1,-1},{12159,3,0,-1},{12160,3,1,-1},{12164,3,1,-1},{12168,3,0,-1}, +{12169,3,1,-1},{12102,3,0,-1},{12172,3,0,-1},{12173,3,1,-1},{12176,3,0,-1}, +{12177,3,1,-1},{12181,3,0,-1},{12182,3,1,-1},{12115,3,1,-1},{12185,3,0,-1}, +{12186,3,1,-1},{12189,3,0,-1},{12190,3,1,-1},{12194,3,0,-1},{12195,3,1,-1}, +{12198,3,0,-1},{12199,3,1,-1},{12202,3,0,-1},{12203,3,1,-1},{12207,3,0,-1}, +{12208,3,1,-1},{12211,3,0,-1},{12212,3,1,-1},{12216,3,1,-1},{12220,3,0,-1}, +{12221,3,1,-1},{12224,3,0,-1},{12225,3,1,-1},{12228,3,0,-1},{12229,3,1,-1}, +{12233,3,0,-1},{12234,3,1,-1},{12237,3,0,-1},{12238,3,1,-1},{12241,3,0,-1}, +{12242,3,1,-1},{12246,3,0,-1},{12247,3,1,-1},{12250,3,0,-1},{12251,3,1,-1}, +{12254,3,0,-1},{12255,3,1,-1},{12260,3,1,-1},{12264,3,1,-1},{12268,3,1,-1}, +{12273,3,1,-1},{12281,3,1,-1},{12286,3,1,-1},{12290,3,1,-1},{12294,3,1,-1}, +{12299,3,1,-1},{12303,3,1,-1},{12307,3,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_4_ss0_ss1[] = { +{7704,4,0,-1},{7713,4,0,-1},{7722,4,0,-1},{7730,4,0,-1},{7739,4,0,-1}, +{7748,4,0,-1},{7756,4,0,-1},{7765,4,0,-1},{7774,4,0,-1},{7782,4,0,-1}, +{7791,4,0,-1},{7800,4,0,-1},{7808,4,0,-1},{7817,4,0,-1},{7826,4,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7843,4,0,-1},{7852,4,0,-1},{7860,4,0,-1}, +{7865,4,0,-1},{7869,4,0,-1},{7873,4,0,-1},{7878,4,0,-1},{7882,4,0,-1}, +{7886,4,0,-1},{7891,4,0,-1},{7895,4,0,-1},{7899,4,0,-1},{7904,4,0,-1}, +{7908,4,0,-1},{7912,4,0,-1},{7917,4,0,-1},{7921,4,0,-1},{7925,4,0,-1}, +{7930,4,0,-1},{7864,4,0,-1},{7934,4,0,-1},{7938,4,0,-1},{7943,4,0,-1}, +{7947,4,0,-1},{7951,4,0,-1},{7956,4,0,-1},{7960,4,0,-1},{7964,4,0,-1}, +{7969,4,0,-1},{7973,4,0,-1},{7977,4,0,-1},{7982,4,0,-1},{7986,4,0,-1}, +{7990,4,0,-1},{7995,4,0,-1},{7999,4,0,-1},{8003,4,0,-1},{8008,4,0,-1}, +{8012,4,0,-1},{8016,4,0,-1},{8021,4,0,-1},{8025,4,0,-1},{8029,4,0,-1}, +{8034,4,0,-1},{7968,4,0,-1},{8038,4,0,-1},{8042,4,0,-1},{8047,4,0,-1}, +{8051,4,0,-1},{8055,4,0,-1},{8060,4,0,-1},{8064,4,0,-1},{8068,4,0,-1}, +{8073,4,0,-1},{8077,4,0,-1},{8081,4,0,-1},{8086,4,0,-1},{8090,4,0,-1}, +{8094,4,0,-1},{8099,4,0,-1},{8103,4,0,-1},{8107,4,0,-1},{8112,4,0,-1}, +{8116,4,0,-1},{8120,4,0,-1},{8121,4,1,-1},{8125,4,0,-1},{8129,4,0,-1}, +{8130,4,1,-1},{8133,4,0,-1},{8138,4,0,-1},{8139,4,1,-1},{8072,4,0,-1}, +{8142,4,0,-1},{8146,4,0,-1},{8147,4,1,-1},{8151,4,0,-1},{8155,4,0,-1}, +{8156,4,1,-1},{8159,4,0,-1},{8164,4,0,-1},{8165,4,1,-1},{8168,4,0,-1}, +{8172,4,0,-1},{8173,4,1,-1},{8177,4,0,-1},{8181,4,0,-1},{8182,4,1,-1}, +{8185,4,0,-1},{8190,4,0,-1},{8191,4,1,-1},{8194,4,0,-1},{8198,4,0,-1}, +{8199,4,1,-1},{8203,4,0,-1},{8207,4,0,-1},{8208,4,1,-1},{8211,4,0,-1}, +{8216,4,0,-1},{8217,4,1,-1},{8220,4,0,-1},{8224,4,0,-1},{8225,4,1,-1}, +{8229,4,0,-1},{8230,4,1,-1},{8233,4,0,-1},{8234,4,1,-1},{8237,4,0,-1}, +{8238,4,1,-1},{8242,4,0,-1},{8243,4,1,-1},{8176,4,0,-1},{8246,4,0,-1}, +{8247,4,1,-1},{8250,4,0,-1},{8251,4,1,-1},{8255,4,0,-1},{8189,4,1,-1}, +{8259,4,0,-1},{8260,4,1,-1},{8263,4,0,-1},{8264,4,1,-1},{8268,4,0,-1}, +{8269,4,1,-1},{8272,4,0,-1},{8273,4,1,-1},{8276,4,0,-1},{8277,4,1,-1}, +{8281,4,0,-1},{8282,4,1,-1},{8285,4,0,-1},{8286,4,1,-1},{8289,4,0,-1}, +{8290,4,1,-1},{8294,4,0,-1},{8295,4,1,-1},{8299,4,1,-1},{8302,4,0,-1}, +{8303,4,1,-1},{8307,4,0,-1},{8308,4,1,-1},{8311,4,0,-1},{8312,4,1,-1}, +{8315,4,0,-1},{8316,4,1,-1},{8320,4,0,-1},{8321,4,1,-1},{8324,4,0,-1}, +{8325,4,1,-1},{8328,4,0,-1},{8329,4,1,-1},{8333,4,0,-1},{8334,4,1,-1}, +{8337,4,0,-1},{8338,4,1,-1},{8341,4,0,-1},{8342,4,1,-1},{8346,4,0,-1}, +{8347,4,1,-1},{8280,4,0,-1},{8350,4,0,-1},{8351,4,1,-1},{8354,4,0,-1}, +{8355,4,1,-1},{8359,4,0,-1},{8360,4,1,-1},{8293,4,1,-1},{8363,4,0,-1}, +{8364,4,1,-1},{8367,4,0,-1},{8368,4,1,-1},{8372,4,0,-1},{8373,4,1,-1}, +{8376,4,0,-1},{8377,4,1,-1},{8380,4,0,-1},{8381,4,1,-1},{8385,4,0,-1}, +{8386,4,1,-1},{8389,4,0,-1},{8390,4,1,-1},{8393,4,0,-1},{8394,4,1,-1}, +{8398,4,0,-1},{8399,4,1,-1},{8402,4,0,-1},{8403,4,1,-1},{8406,4,0,-1}, +{8407,4,1,-1},{8411,4,0,-1},{8412,4,1,-1},{8415,4,0,-1},{8416,4,1,-1}, +{8419,4,0,-1},{8420,4,1,-1},{8424,4,0,-1},{8425,4,1,-1},{8428,4,0,-1}, +{8429,4,1,-1},{8432,4,0,-1},{8433,4,1,-1},{8437,4,0,-1},{8438,4,1,-1}, +{8441,4,0,-1},{8442,4,1,-1},{8445,4,0,-1},{8446,4,1,-1},{8450,4,0,-1}, +{8451,4,1,-1},{8384,4,0,-1},{8454,4,0,-1},{8455,4,1,-1},{8458,4,0,-1}, +{8459,4,1,-1},{8463,4,0,-1},{8397,4,1,-1},{8467,4,0,-1},{8468,4,1,-1}, +{8471,4,0,-1},{8472,4,1,-1},{8476,4,0,-1},{8477,4,1,-1},{8480,4,0,-1}, +{8481,4,1,-1},{8484,4,0,-1},{8485,4,1,-1},{8489,4,0,-1},{8490,4,1,-1}, +{8493,4,0,-1},{8494,4,1,-1},{8497,4,0,-1},{8498,4,1,-1},{8502,4,0,-1}, +{8503,4,1,-1},{8507,4,1,-1},{8510,4,0,-1},{8511,4,1,-1},{8515,4,0,-1}, +{8519,4,0,-1},{8520,4,1,-1},{8523,4,0,-1},{8524,4,1,-1},{8528,4,0,-1}, +{8529,4,1,-1},{8532,4,0,-1},{8533,4,1,-1},{8536,4,0,-1},{8537,4,1,-1}, +{8541,4,0,-1},{8542,4,1,-1},{8545,4,0,-1},{8546,4,1,-1},{8549,4,0,-1}, +{8550,4,1,-1},{8554,4,0,-1},{8555,4,1,-1},{8488,4,0,-1},{8558,4,0,-1}, +{8559,4,1,-1},{8562,4,0,-1},{8563,4,1,-1},{8567,4,0,-1},{8568,4,1,-1}, +{8501,4,1,-1},{8571,4,0,-1},{8572,4,1,-1},{8575,4,0,-1},{8576,4,1,-1}, +{8580,4,0,-1},{8581,4,1,-1},{8584,4,0,-1},{8585,4,1,-1},{8588,4,0,-1}, +{8589,4,1,-1},{8593,4,0,-1},{8594,4,1,-1},{8597,4,0,-1},{8598,4,1,-1}, +{8601,4,0,-1},{8602,4,1,-1},{8606,4,0,-1},{8607,4,1,-1},{8610,4,0,-1}, +{8611,4,1,-1},{8614,4,0,-1},{8615,4,1,-1},{8619,4,0,-1},{8620,4,1,-1}, +{8623,4,0,-1},{8624,4,1,-1},{8627,4,0,-1},{8628,4,1,-1},{8632,4,0,-1}, +{8633,4,1,-1},{8636,4,0,-1},{8637,4,1,-1},{8640,4,0,-1},{8641,4,1,-1}, +{8645,4,0,-1},{8646,4,1,-1},{8649,4,0,-1},{8650,4,1,-1},{8653,4,0,-1}, +{8654,4,1,-1},{8658,4,0,-1},{8659,4,1,-1},{8592,4,0,-1},{8662,4,0,-1}, +{8663,4,1,-1},{8666,4,0,-1},{8667,4,1,-1},{8671,4,0,-1},{8672,4,1,-1}, +{8605,4,1,-1},{8675,4,0,-1},{8676,4,1,-1},{8679,4,0,-1},{8680,4,1,-1}, +{8684,4,0,-1},{8685,4,1,-1},{8688,4,0,-1},{8689,4,1,-1},{8692,4,0,-1}, +{8693,4,1,-1},{8697,4,0,-1},{8698,4,1,-1},{8701,4,0,-1},{8702,4,1,-1}, +{8705,4,0,-1},{8706,4,1,-1},{8710,4,0,-1},{8711,4,1,-1},{8714,4,0,-1}, +{8715,4,1,-1},{8718,4,0,-1},{8719,4,1,-1},{8723,4,0,-1},{8724,4,1,-1}, +{8727,4,0,-1},{8728,4,1,-1},{8731,4,0,-1},{8732,4,1,-1},{8736,4,0,-1}, +{8737,4,1,-1},{8740,4,0,-1},{8741,4,1,-1},{8744,4,0,-1},{8745,4,1,-1}, +{8749,4,0,-1},{8750,4,1,-1},{8753,4,0,-1},{8754,4,1,-1},{8757,4,0,-1}, +{8758,4,1,-1},{8762,4,0,-1},{8763,4,1,-1},{8696,4,0,-1},{8766,4,0,-1}, +{8767,4,1,-1},{8770,4,0,-1},{8771,4,1,-1},{8775,4,0,-1},{8776,4,1,-1}, +{8709,4,1,-1},{8779,4,0,-1},{8780,4,1,-1},{8783,4,0,-1},{8784,4,1,-1}, +{8788,4,0,-1},{8789,4,1,-1},{8792,4,0,-1},{8793,4,1,-1},{8796,4,0,-1}, +{8797,4,1,-1},{8801,4,0,-1},{8802,4,1,-1},{8805,4,0,-1},{8806,4,1,-1}, +{8809,4,0,-1},{8810,4,1,-1},{8814,4,0,-1},{8815,4,1,-1},{8818,4,0,-1}, +{8819,4,1,-1},{8822,4,0,-1},{8823,4,1,-1},{8827,4,0,-1},{8828,4,1,-1}, +{8831,4,0,-1},{8832,4,1,-1},{8835,4,0,-1},{8836,4,1,-1},{8840,4,0,-1}, +{8841,4,1,-1},{8844,4,0,-1},{8845,4,1,-1},{8848,4,0,-1},{8849,4,1,-1}, +{8853,4,0,-1},{8854,4,1,-1},{8857,4,0,-1},{8858,4,1,-1},{8861,4,0,-1}, +{8862,4,1,-1},{8866,4,0,-1},{8867,4,1,-1},{8800,4,0,-1},{8870,4,0,-1}, +{8871,4,1,-1},{8874,4,0,-1},{8875,4,1,-1},{8879,4,0,-1},{8880,4,1,-1}, +{8813,4,1,-1},{8883,4,0,-1},{8884,4,1,-1},{8887,4,0,-1},{8888,4,1,-1}, +{8892,4,0,-1},{8893,4,1,-1},{8896,4,0,-1},{8897,4,1,-1},{8900,4,0,-1}, +{8901,4,1,-1},{8905,4,0,-1},{8906,4,1,-1},{8909,4,0,-1},{8910,4,1,-1}, +{8913,4,0,-1},{8914,4,1,-1},{8918,4,0,-1},{8919,4,1,-1},{8922,4,0,-1}, +{8923,4,1,-1},{8926,4,0,-1},{8927,4,1,-1},{8931,4,0,-1},{8932,4,1,-1}, +{8935,4,0,-1},{8936,4,1,-1},{8939,4,0,-1},{8940,4,1,-1},{8944,4,0,-1}, +{8945,4,1,-1},{8948,4,0,-1},{8949,4,1,-1},{8952,4,0,-1},{8953,4,1,-1}, +{8957,4,0,-1},{8958,4,1,-1},{8961,4,0,-1},{8962,4,1,-1},{8965,4,0,-1}, +{8966,4,1,-1},{8970,4,0,-1},{8971,4,1,-1},{8904,4,0,-1},{8974,4,0,-1}, +{8975,4,1,-1},{8978,4,0,-1},{8979,4,1,-1},{8983,4,0,-1},{8984,4,1,-1}, +{8917,4,1,-1},{8987,4,0,-1},{8988,4,1,-1},{8991,4,0,-1},{8992,4,1,-1}, +{8996,4,0,-1},{8997,4,1,-1},{9000,4,0,-1},{9001,4,1,-1},{9004,4,0,-1}, +{9005,4,1,-1},{9009,4,0,-1},{9010,4,1,-1},{9013,4,0,-1},{9014,4,1,-1}, +{9017,4,0,-1},{9018,4,1,-1},{9022,4,0,-1},{9023,4,1,-1},{9026,4,0,-1}, +{9027,4,1,-1},{9030,4,0,-1},{9031,4,1,-1},{9035,4,0,-1},{9036,4,1,-1}, +{9039,4,0,-1},{9040,4,1,-1},{9043,4,0,-1},{9044,4,1,-1},{9048,4,0,-1}, +{9049,4,1,-1},{9052,4,0,-1},{9053,4,1,-1},{9056,4,0,-1},{9057,4,1,-1}, +{9061,4,0,-1},{9062,4,1,-1},{9065,4,0,-1},{9066,4,1,-1},{9069,4,0,-1}, +{9070,4,1,-1},{9074,4,0,-1},{9075,4,1,-1},{9008,4,0,-1},{9078,4,0,-1}, +{9079,4,1,-1},{9082,4,0,-1},{9083,4,1,-1},{9087,4,0,-1},{9088,4,1,-1}, +{9021,4,1,-1},{9091,4,0,-1},{9092,4,1,-1},{9095,4,0,-1},{9096,4,1,-1}, +{9100,4,0,-1},{9101,4,1,-1},{9104,4,0,-1},{9105,4,1,-1},{9108,4,0,-1}, +{9109,4,1,-1},{9113,4,0,-1},{9114,4,1,-1},{9117,4,0,-1},{9118,4,1,-1}, +{9121,4,0,-1},{9122,4,1,-1},{9126,4,0,-1},{9127,4,1,-1},{9130,4,0,-1}, +{9131,4,1,-1},{9134,4,0,-1},{9135,4,1,-1},{9139,4,0,-1},{9140,4,1,-1}, +{9143,4,0,-1},{9144,4,1,-1},{9147,4,0,-1},{9148,4,1,-1},{9152,4,0,-1}, +{9153,4,1,-1},{9156,4,0,-1},{9157,4,1,-1},{9160,4,0,-1},{9161,4,1,-1}, +{9165,4,0,-1},{9166,4,1,-1},{9169,4,0,-1},{9170,4,1,-1},{9173,4,0,-1}, +{9174,4,1,-1},{9178,4,0,-1},{9179,4,1,-1},{9112,4,0,-1},{9182,4,0,-1}, +{9183,4,1,-1},{9186,4,0,-1},{9187,4,1,-1},{9191,4,0,-1},{9192,4,1,-1}, +{9125,4,1,-1},{9195,4,0,-1},{9196,4,1,-1},{9199,4,0,-1},{9200,4,1,-1}, +{9204,4,0,-1},{9205,4,1,-1},{9208,4,0,-1},{9209,4,1,-1},{9212,4,0,-1}, +{9213,4,1,-1},{9217,4,0,-1},{9218,4,1,-1},{9221,4,0,-1},{9222,4,1,-1}, +{9225,4,0,-1},{9226,4,1,-1},{9230,4,0,-1},{9231,4,1,-1},{9234,4,0,-1}, +{9235,4,1,-1},{9238,4,0,-1},{9239,4,1,-1},{9243,4,0,-1},{9244,4,1,-1}, +{9247,4,0,-1},{9248,4,1,-1},{9251,4,0,-1},{9252,4,1,-1},{9256,4,0,-1}, +{9257,4,1,-1},{9260,4,0,-1},{9261,4,1,-1},{9264,4,0,-1},{9265,4,1,-1}, +{9269,4,0,-1},{9270,4,1,-1},{9273,4,0,-1},{9274,4,1,-1},{9277,4,0,-1}, +{9278,4,1,-1},{9282,4,0,-1},{9283,4,1,-1},{9216,4,0,-1},{9286,4,0,-1}, +{9287,4,1,-1},{9290,4,0,-1},{9291,4,1,-1},{9295,4,0,-1},{9296,4,1,-1}, +{9229,4,1,-1},{9299,4,0,-1},{9300,4,1,-1},{9303,4,0,-1},{9304,4,1,-1}, +{9308,4,0,-1},{9309,4,1,-1},{9312,4,0,-1},{9313,4,1,-1},{9316,4,0,-1}, +{9317,4,1,-1},{9321,4,0,-1},{9322,4,1,-1},{9325,4,0,-1},{9326,4,1,-1}, +{9329,4,0,-1},{9330,4,1,-1},{9334,4,0,-1},{9335,4,1,-1},{9338,4,0,-1}, +{9339,4,1,-1},{9342,4,0,-1},{9343,4,1,-1},{9347,4,0,-1},{9348,4,1,-1}, +{9351,4,0,-1},{9352,4,1,-1},{9355,4,0,-1},{9356,4,1,-1},{9360,4,0,-1}, +{9361,4,1,-1},{9364,4,0,-1},{9365,4,1,-1},{9368,4,0,-1},{9369,4,1,-1}, +{9373,4,0,-1},{9374,4,1,-1},{9377,4,0,-1},{9378,4,1,-1},{9381,4,0,-1}, +{9382,4,1,-1},{9386,4,0,-1},{9387,4,1,-1},{9320,4,0,-1},{9390,4,0,-1}, +{9391,4,1,-1},{9394,4,0,-1},{9395,4,1,-1},{9399,4,0,-1},{9400,4,1,-1}, +{9333,4,1,-1},{9403,4,0,-1},{9404,4,1,-1},{9407,4,0,-1},{9408,4,1,-1}, +{9412,4,0,-1},{9413,4,1,-1},{9416,4,0,-1},{9417,4,1,-1},{9420,4,0,-1}, +{9421,4,1,-1},{9425,4,0,-1},{9426,4,1,-1},{9429,4,0,-1},{9430,4,1,-1}, +{9433,4,0,-1},{9434,4,1,-1},{9438,4,0,-1},{9439,4,1,-1},{9442,4,0,-1}, +{9443,4,1,-1},{9446,4,0,-1},{9447,4,1,-1},{9451,4,0,-1},{9452,4,1,-1}, +{9455,4,0,-1},{9456,4,1,-1},{9459,4,0,-1},{9460,4,1,-1},{9464,4,0,-1}, +{9465,4,1,-1},{9468,4,0,-1},{9469,4,1,-1},{9472,4,0,-1},{9473,4,1,-1}, +{9477,4,0,-1},{9478,4,1,-1},{9481,4,0,-1},{9482,4,1,-1},{9485,4,0,-1}, +{9486,4,1,-1},{9490,4,0,-1},{9491,4,1,-1},{9424,4,0,-1},{9494,4,0,-1}, +{9495,4,1,-1},{9498,4,0,-1},{9499,4,1,-1},{9503,4,0,-1},{9504,4,1,-1}, +{9437,4,1,-1},{9507,4,0,-1},{9508,4,1,-1},{9511,4,0,-1},{9512,4,1,-1}, +{9516,4,0,-1},{9517,4,1,-1},{9520,4,0,-1},{9521,4,1,-1},{9524,4,0,-1}, +{9525,4,1,-1},{9529,4,0,-1},{9530,4,1,-1},{9533,4,0,-1},{9534,4,1,-1}, +{9537,4,0,-1},{9538,4,1,-1},{9542,4,0,-1},{9543,4,1,-1},{9546,4,0,-1}, +{9547,4,1,-1},{9550,4,0,-1},{9551,4,1,-1},{9555,4,0,-1},{9556,4,1,-1}, +{9559,4,0,-1},{9560,4,1,-1},{9563,4,0,-1},{9564,4,1,-1},{9568,4,0,-1}, +{9569,4,1,-1},{9572,4,0,-1},{9573,4,1,-1},{9576,4,0,-1},{9577,4,1,-1}, +{9581,4,0,-1},{9582,4,1,-1},{9585,4,0,-1},{9586,4,1,-1},{9589,4,0,-1}, +{9590,4,1,-1},{9594,4,0,-1},{9595,4,1,-1},{9528,4,0,-1},{9598,4,0,-1}, +{9599,4,1,-1},{9602,4,0,-1},{9603,4,1,-1},{9607,4,0,-1},{9608,4,1,-1}, +{9541,4,1,-1},{9611,4,0,-1},{9612,4,1,-1},{9615,4,0,-1},{9616,4,1,-1}, +{9620,4,0,-1},{9621,4,1,-1},{9624,4,0,-1},{9625,4,1,-1},{9628,4,0,-1}, +{9629,4,1,-1},{9633,4,0,-1},{9634,4,1,-1},{9637,4,0,-1},{9638,4,1,-1}, +{9641,4,0,-1},{9642,4,1,-1},{9646,4,0,-1},{9647,4,1,-1},{9650,4,0,-1}, +{9651,4,1,-1},{9654,4,0,-1},{9655,4,1,-1},{9659,4,0,-1},{9660,4,1,-1}, +{9663,4,0,-1},{9664,4,1,-1},{9667,4,0,-1},{9668,4,1,-1},{9672,4,0,-1}, +{9673,4,1,-1},{9676,4,0,-1},{9677,4,1,-1},{9680,4,0,-1},{9681,4,1,-1}, +{9685,4,0,-1},{9686,4,1,-1},{9689,4,0,-1},{9690,4,1,-1},{9693,4,0,-1}, +{9694,4,1,-1},{9698,4,0,-1},{9699,4,1,-1},{9632,4,0,-1},{9702,4,0,-1}, +{9703,4,1,-1},{9706,4,0,-1},{9707,4,1,-1},{9711,4,0,-1},{9712,4,1,-1}, +{9645,4,1,-1},{9715,4,0,-1},{9716,4,1,-1},{9719,4,0,-1},{9720,4,1,-1}, +{9724,4,0,-1},{9725,4,1,-1},{9728,4,0,-1},{9729,4,1,-1},{9732,4,0,-1}, +{9733,4,1,-1},{9737,4,0,-1},{9738,4,1,-1},{9741,4,0,-1},{9742,4,1,-1}, +{9745,4,0,-1},{9746,4,1,-1},{9750,4,0,-1},{9751,4,1,-1},{9754,4,0,-1}, +{9755,4,1,-1},{9758,4,0,-1},{9759,4,1,-1},{9763,4,0,-1},{9764,4,1,-1}, +{9767,4,0,-1},{9768,4,1,-1},{9771,4,0,-1},{9772,4,1,-1},{9776,4,0,-1}, +{9777,4,1,-1},{9780,4,0,-1},{9781,4,1,-1},{9784,4,0,-1},{9785,4,1,-1}, +{9789,4,0,-1},{9790,4,1,-1},{9793,4,0,-1},{9794,4,1,-1},{9797,4,0,-1}, +{9798,4,1,-1},{9802,4,0,-1},{9803,4,1,-1},{9736,4,0,-1},{9806,4,0,-1}, +{9807,4,1,-1},{9810,4,0,-1},{9811,4,1,-1},{9815,4,0,-1},{9816,4,1,-1}, +{9749,4,1,-1},{9819,4,0,-1},{9820,4,1,-1},{9823,4,0,-1},{9824,4,1,-1}, +{9828,4,0,-1},{9829,4,1,-1},{9832,4,0,-1},{9833,4,1,-1},{9836,4,0,-1}, +{9837,4,1,-1},{9841,4,0,-1},{9842,4,1,-1},{9845,4,0,-1},{9846,4,1,-1}, +{9849,4,0,-1},{9850,4,1,-1},{9854,4,0,-1},{9855,4,1,-1},{9858,4,0,-1}, +{9859,4,1,-1},{9862,4,0,-1},{9863,4,1,-1},{9867,4,0,-1},{9868,4,1,-1}, +{9871,4,0,-1},{9872,4,1,-1},{9875,4,0,-1},{9876,4,1,-1},{9880,4,0,-1}, +{9881,4,1,-1},{9884,4,0,-1},{9885,4,1,-1},{9888,4,0,-1},{9889,4,1,-1}, +{9893,4,0,-1},{9894,4,1,-1},{9897,4,0,-1},{9898,4,1,-1},{9901,4,0,-1}, +{9902,4,1,-1},{9906,4,0,-1},{9907,4,1,-1},{9840,4,0,-1},{9910,4,0,-1}, +{9911,4,1,-1},{9914,4,0,-1},{9915,4,1,-1},{9919,4,0,-1},{9920,4,1,-1}, +{9853,4,1,-1},{9923,4,0,-1},{9924,4,1,-1},{9927,4,0,-1},{9928,4,1,-1}, +{9932,4,0,-1},{9933,4,1,-1},{9936,4,0,-1},{9937,4,1,-1},{9940,4,0,-1}, +{9941,4,1,-1},{9945,4,0,-1},{9946,4,1,-1},{9949,4,0,-1},{9950,4,1,-1}, +{9953,4,0,-1},{9954,4,1,-1},{9958,4,0,-1},{9959,4,1,-1},{9962,4,0,-1}, +{9963,4,1,-1},{9966,4,0,-1},{9967,4,1,-1},{9971,4,0,-1},{9972,4,1,-1}, +{9975,4,0,-1},{9976,4,1,-1},{9979,4,0,-1},{9980,4,1,-1},{9984,4,0,-1}, +{9985,4,1,-1},{9988,4,0,-1},{9989,4,1,-1},{9992,4,0,-1},{9993,4,1,-1}, +{9997,4,0,-1},{9998,4,1,-1},{10001,4,0,-1},{10002,4,1,-1},{10005,4,0,-1}, +{10006,4,1,-1},{10010,4,0,-1},{10011,4,1,-1},{9944,4,0,-1},{10014,4,0,-1}, +{10015,4,1,-1},{10018,4,0,-1},{10019,4,1,-1},{10023,4,0,-1},{10024,4,1,-1}, +{9957,4,1,-1},{10027,4,0,-1},{10028,4,1,-1},{10031,4,0,-1},{10032,4,1,-1}, +{10036,4,0,-1},{10037,4,1,-1},{10040,4,0,-1},{10041,4,1,-1},{10044,4,0,-1}, +{10045,4,1,-1},{10049,4,0,-1},{10050,4,1,-1},{10053,4,0,-1},{10054,4,1,-1}, +{10057,4,0,-1},{10058,4,1,-1},{10062,4,0,-1},{10063,4,1,-1},{10066,4,0,-1}, +{10067,4,1,-1},{10070,4,0,-1},{10071,4,1,-1},{10075,4,0,-1},{10076,4,1,-1}, +{10079,4,0,-1},{10080,4,1,-1},{10083,4,0,-1},{10084,4,1,-1},{10088,4,0,-1}, +{10089,4,1,-1},{10092,4,0,-1},{10093,4,1,-1},{10096,4,0,-1},{10097,4,1,-1}, +{10101,4,0,-1},{10102,4,1,-1},{10105,4,0,-1},{10106,4,1,-1},{10109,4,0,-1}, +{10110,4,1,-1},{10114,4,0,-1},{10115,4,1,-1},{10048,4,0,-1},{10118,4,0,-1}, +{10119,4,1,-1},{10122,4,0,-1},{10123,4,1,-1},{10127,4,0,-1},{10128,4,1,-1}, +{10061,4,1,-1},{10131,4,0,-1},{10132,4,1,-1},{10135,4,0,-1},{10136,4,1,-1}, +{10140,4,0,-1},{10141,4,1,-1},{10144,4,0,-1},{10145,4,1,-1},{10148,4,0,-1}, +{10149,4,1,-1},{10153,4,0,-1},{10154,4,1,-1},{10157,4,0,-1},{10158,4,1,-1}, +{10161,4,0,-1},{10162,4,1,-1},{10166,4,0,-1},{10167,4,1,-1},{10170,4,0,-1}, +{10171,4,1,-1},{10174,4,0,-1},{10175,4,1,-1},{10179,4,0,-1},{10180,4,1,-1}, +{10183,4,0,-1},{10184,4,1,-1},{10187,4,0,-1},{10188,4,1,-1},{10192,4,0,-1}, +{10193,4,1,-1},{10196,4,0,-1},{10197,4,1,-1},{10200,4,0,-1},{10201,4,1,-1}, +{10205,4,0,-1},{10206,4,1,-1},{10209,4,0,-1},{10210,4,1,-1},{10213,4,0,-1}, +{10214,4,1,-1},{10218,4,0,-1},{10219,4,1,-1},{10152,4,0,-1},{10222,4,0,-1}, +{10223,4,1,-1},{10226,4,0,-1},{10227,4,1,-1},{10231,4,0,-1},{10232,4,1,-1}, +{10165,4,1,-1},{10235,4,0,-1},{10236,4,1,-1},{10239,4,0,-1},{10240,4,1,-1}, +{10244,4,0,-1},{10245,4,1,-1},{10248,4,0,-1},{10249,4,1,-1},{10252,4,0,-1}, +{10253,4,1,-1},{10257,4,0,-1},{10258,4,1,-1},{10261,4,0,-1},{10262,4,1,-1}, +{10265,4,0,-1},{10266,4,1,-1},{10270,4,0,-1},{10271,4,1,-1},{10274,4,0,-1}, +{10275,4,1,-1},{10278,4,0,-1},{10279,4,1,-1},{10283,4,0,-1},{10284,4,1,-1}, +{10287,4,0,-1},{10288,4,1,-1},{10291,4,0,-1},{10292,4,1,-1},{10296,4,0,-1}, +{10297,4,1,-1},{10300,4,0,-1},{10301,4,1,-1},{10304,4,0,-1},{10305,4,1,-1}, +{10309,4,0,-1},{10310,4,1,-1},{10313,4,0,-1},{10314,4,1,-1},{10317,4,0,-1}, +{10318,4,1,-1},{10322,4,0,-1},{10323,4,1,-1},{10256,4,0,-1},{10326,4,0,-1}, +{10327,4,1,-1},{10330,4,0,-1},{10331,4,1,-1},{10335,4,0,-1},{10336,4,1,-1}, +{10269,4,1,-1},{10339,4,0,-1},{10340,4,1,-1},{10343,4,0,-1},{10344,4,1,-1}, +{10348,4,0,-1},{10349,4,1,-1},{10352,4,0,-1},{10353,4,1,-1},{10356,4,0,-1}, +{10357,4,1,-1},{10361,4,0,-1},{10362,4,1,-1},{10365,4,0,-1},{10366,4,1,-1}, +{10369,4,0,-1},{10370,4,1,-1},{10374,4,0,-1},{10375,4,1,-1},{10378,4,0,-1}, +{10379,4,1,-1},{10382,4,0,-1},{10383,4,1,-1},{10387,4,0,-1},{10388,4,1,-1}, +{10391,4,0,-1},{10392,4,1,-1},{10395,4,0,-1},{10396,4,1,-1},{10400,4,0,-1}, +{10401,4,1,-1},{10404,4,0,-1},{10405,4,1,-1},{10408,4,0,-1},{10409,4,1,-1}, +{10413,4,0,-1},{10414,4,1,-1},{10417,4,0,-1},{10418,4,1,-1},{10421,4,0,-1}, +{10422,4,1,-1},{10426,4,0,-1},{10427,4,1,-1},{10360,4,0,-1},{10430,4,0,-1}, +{10431,4,1,-1},{10434,4,0,-1},{10435,4,1,-1},{10439,4,0,-1},{10440,4,1,-1}, +{10373,4,1,-1},{10443,4,0,-1},{10444,4,1,-1},{10447,4,0,-1},{10448,4,1,-1}, +{10452,4,0,-1},{10453,4,1,-1},{10456,4,0,-1},{10457,4,1,-1},{10460,4,0,-1}, +{10461,4,1,-1},{10465,4,0,-1},{10466,4,1,-1},{10469,4,0,-1},{10470,4,1,-1}, +{10473,4,0,-1},{10474,4,1,-1},{10478,4,0,-1},{10479,4,1,-1},{10482,4,0,-1}, +{10483,4,1,-1},{10486,4,0,-1},{10487,4,1,-1},{10491,4,0,-1},{10492,4,1,-1}, +{10495,4,0,-1},{10496,4,1,-1},{10499,4,0,-1},{10500,4,1,-1},{10504,4,0,-1}, +{10505,4,1,-1},{10508,4,0,-1},{10509,4,1,-1},{10512,4,0,-1},{10513,4,1,-1}, +{10517,4,0,-1},{10518,4,1,-1},{10521,4,0,-1},{10522,4,1,-1},{10525,4,0,-1}, +{10526,4,1,-1},{10530,4,0,-1},{10531,4,1,-1},{10464,4,0,-1},{10534,4,0,-1}, +{10535,4,1,-1},{10538,4,0,-1},{10539,4,1,-1},{10543,4,0,-1},{10544,4,1,-1}, +{10477,4,1,-1},{10547,4,0,-1},{10548,4,1,-1},{10551,4,0,-1},{10552,4,1,-1}, +{10556,4,0,-1},{10557,4,1,-1},{10560,4,0,-1},{10561,4,1,-1},{10564,4,0,-1}, +{10565,4,1,-1},{10569,4,0,-1},{10570,4,1,-1},{10573,4,0,-1},{10574,4,1,-1}, +{10577,4,0,-1},{10578,4,1,-1},{10582,4,0,-1},{10583,4,1,-1},{10586,4,0,-1}, +{10587,4,1,-1},{10590,4,0,-1},{10591,4,1,-1},{10595,4,0,-1},{10596,4,1,-1}, +{10599,4,0,-1},{10600,4,1,-1},{10603,4,0,-1},{10604,4,1,-1},{10608,4,0,-1}, +{10609,4,1,-1},{10612,4,0,-1},{10613,4,1,-1},{10616,4,0,-1},{10617,4,1,-1}, +{10621,4,0,-1},{10622,4,1,-1},{10625,4,0,-1},{10626,4,1,-1},{10629,4,0,-1}, +{10630,4,1,-1},{10634,4,0,-1},{10635,4,1,-1},{10568,4,0,-1},{10638,4,0,-1}, +{10639,4,1,-1},{10642,4,0,-1},{10643,4,1,-1},{10647,4,0,-1},{10648,4,1,-1}, +{10581,4,1,-1},{10651,4,0,-1},{10652,4,1,-1},{10655,4,0,-1},{10656,4,1,-1}, +{10660,4,0,-1},{10661,4,1,-1},{10664,4,0,-1},{10665,4,1,-1},{10668,4,0,-1}, +{10669,4,1,-1},{10673,4,0,-1},{10674,4,1,-1},{10677,4,0,-1},{10678,4,1,-1}, +{10681,4,0,-1},{10682,4,1,-1},{10686,4,0,-1},{10687,4,1,-1},{10690,4,0,-1}, +{10691,4,1,-1},{10694,4,0,-1},{10695,4,1,-1},{10699,4,0,-1},{10700,4,1,-1}, +{10703,4,0,-1},{10704,4,1,-1},{10707,4,0,-1},{10708,4,1,-1},{10712,4,0,-1}, +{10713,4,1,-1},{10716,4,0,-1},{10717,4,1,-1},{10720,4,0,-1},{10721,4,1,-1}, +{10725,4,0,-1},{10726,4,1,-1},{10729,4,0,-1},{10730,4,1,-1},{10733,4,0,-1}, +{10734,4,1,-1},{10738,4,0,-1},{10739,4,1,-1},{10672,4,0,-1},{10742,4,0,-1}, +{10743,4,1,-1},{10746,4,0,-1},{10747,4,1,-1},{10751,4,0,-1},{10752,4,1,-1}, +{10685,4,1,-1},{10755,4,0,-1},{10756,4,1,-1},{10759,4,0,-1},{10760,4,1,-1}, +{10764,4,0,-1},{10765,4,1,-1},{10768,4,0,-1},{10769,4,1,-1},{10772,4,0,-1}, +{10773,4,1,-1},{10777,4,0,-1},{10778,4,1,-1},{10781,4,0,-1},{10782,4,1,-1}, +{10785,4,0,-1},{10786,4,1,-1},{10790,4,0,-1},{10791,4,1,-1},{10794,4,0,-1}, +{10795,4,1,-1},{10798,4,0,-1},{10799,4,1,-1},{10803,4,0,-1},{10804,4,1,-1}, +{10807,4,0,-1},{10808,4,1,-1},{10811,4,0,-1},{10812,4,1,-1},{10816,4,0,-1}, +{10817,4,1,-1},{10820,4,0,-1},{10821,4,1,-1},{10824,4,0,-1},{10825,4,1,-1}, +{10829,4,0,-1},{10830,4,1,-1},{10833,4,0,-1},{10834,4,1,-1},{10837,4,0,-1}, +{10838,4,1,-1},{10842,4,0,-1},{10843,4,1,-1},{10776,4,0,-1},{10846,4,0,-1}, +{10847,4,1,-1},{10850,4,0,-1},{10851,4,1,-1},{10855,4,0,-1},{10856,4,1,-1}, +{10789,4,1,-1},{10859,4,0,-1},{10860,4,1,-1},{10863,4,0,-1},{10864,4,1,-1}, +{10868,4,0,-1},{10869,4,1,-1},{10872,4,0,-1},{10873,4,1,-1},{10876,4,0,-1}, +{10877,4,1,-1},{10881,4,0,-1},{10882,4,1,-1},{10885,4,0,-1},{10886,4,1,-1}, +{10889,4,0,-1},{10890,4,1,-1},{10894,4,0,-1},{10895,4,1,-1},{10898,4,0,-1}, +{10899,4,1,-1},{10902,4,0,-1},{10903,4,1,-1},{10907,4,0,-1},{10908,4,1,-1}, +{10911,4,0,-1},{10912,4,1,-1},{10915,4,0,-1},{10916,4,1,-1},{10920,4,0,-1}, +{10921,4,1,-1},{10924,4,0,-1},{10925,4,1,-1},{10928,4,0,-1},{10929,4,1,-1}, +{10933,4,0,-1},{10934,4,1,-1},{10937,4,0,-1},{10938,4,1,-1},{10941,4,0,-1}, +{10942,4,1,-1},{10946,4,0,-1},{10947,4,1,-1},{10880,4,0,-1},{10950,4,0,-1}, +{10951,4,1,-1},{10954,4,0,-1},{10955,4,1,-1},{10959,4,0,-1},{10960,4,1,-1}, +{10893,4,1,-1},{10963,4,0,-1},{10964,4,1,-1},{10967,4,0,-1},{10968,4,1,-1}, +{10972,4,0,-1},{10973,4,1,-1},{10976,4,0,-1},{10977,4,1,-1},{10980,4,0,-1}, +{10981,4,1,-1},{10985,4,0,-1},{10986,4,1,-1},{10989,4,0,-1},{10990,4,1,-1}, +{10993,4,0,-1},{10994,4,1,-1},{10998,4,0,-1},{10999,4,1,-1},{11002,4,0,-1}, +{11003,4,1,-1},{11006,4,0,-1},{11007,4,1,-1},{11012,4,1,-1},{11016,4,1,-1}, +{11020,4,1,-1},{11025,4,1,-1},{11029,4,1,-1},{11033,4,1,-1},{11038,4,1,-1}, +{11042,4,1,-1},{11046,4,1,-1},{11051,4,1,-1},{10984,4,0,-1},{11055,4,1,-1}, +{11058,4,0,-1},{11059,4,1,-1},{10997,4,1,-1},{11067,4,0,-1},{11068,4,1,-1}, +{11072,4,1,-1},{11077,4,1,-1},{11081,4,1,-1},{11085,4,1,-1},{11090,4,1,-1}, +{11094,4,1,-1},{11098,4,1,-1},{11102,4,0,-1},{11103,4,1,-1},{11107,4,1,-1}, +{11111,4,1,-1},{11116,4,1,-1},{11120,4,1,-1},{11129,4,1,-1},{11133,4,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_5_ss0_ss1[] = { +{5269,5,0,-1},{5278,5,0,-1},{5286,5,0,-1},{5295,5,0,-1},{5304,5,0,-1}, +{5312,5,0,-1},{5321,5,0,-1},{5330,5,0,-1},{5264,5,0,-1},{5338,5,0,-1}, +{5347,5,0,-1},{5351,5,0,-1},{5356,5,0,-1},{5360,5,0,-1},{5364,5,0,-1}, +{5369,5,0,-1},{5373,5,0,-1},{5377,5,0,-1},{5382,5,0,-1},{5386,5,0,-1}, +{5390,5,0,-1},{5395,5,0,-1},{5399,5,0,-1},{5403,5,0,-1},{5408,5,0,-1}, +{5412,5,0,-1},{5416,5,0,-1},{5421,5,0,-1},{5425,5,0,-1},{5429,5,0,-1}, +{5434,5,0,-1},{5368,5,0,-1},{5438,5,0,-1},{5442,5,0,-1},{5447,5,0,-1}, +{5451,5,0,-1},{5455,5,0,-1},{5460,5,0,-1},{5464,5,0,-1},{5468,5,0,-1}, +{5473,5,0,-1},{5477,5,0,-1},{5481,5,0,-1},{5486,5,0,-1},{5490,5,0,-1}, +{5494,5,0,-1},{5499,5,0,-1},{5503,5,0,-1},{5507,5,0,-1},{5512,5,0,-1}, +{5516,5,0,-1},{5520,5,0,-1},{5525,5,0,-1},{5529,5,0,-1},{5533,5,0,-1}, +{5538,5,0,-1},{5472,5,0,-1},{5542,5,0,-1},{5546,5,0,-1},{5551,5,0,-1}, +{5555,5,0,-1},{5559,5,0,-1},{5564,5,0,-1},{5568,5,0,-1},{5572,5,0,-1}, +{5577,5,0,-1},{5581,5,0,-1},{5585,5,0,-1},{5590,5,0,-1},{5594,5,0,-1}, +{5598,5,0,-1},{5603,5,0,-1},{5607,5,0,-1},{5611,5,0,-1},{5616,5,0,-1}, +{5620,5,0,-1},{5624,5,0,-1},{5629,5,0,-1},{5633,5,0,-1},{5637,5,0,-1}, +{5638,5,1,-1},{5642,5,0,-1},{5576,5,0,-1},{5646,5,0,-1},{5647,5,1,-1}, +{5650,5,0,-1},{5655,5,0,-1},{5656,5,1,-1},{5659,5,0,-1},{5663,5,0,-1}, +{5668,5,0,-1},{5669,5,1,-1},{5672,5,0,-1},{5676,5,0,-1},{5677,5,1,-1}, +{5681,5,0,-1},{5685,5,0,-1},{5686,5,1,-1},{5689,5,0,-1},{5694,5,0,-1}, +{5695,5,1,-1},{5698,5,0,-1},{5702,5,0,-1},{5703,5,1,-1},{5707,5,0,-1}, +{5711,5,0,-1},{5712,5,1,-1},{5715,5,0,-1},{5720,5,0,-1},{5721,5,1,-1}, +{5724,5,0,-1},{5728,5,0,-1},{5729,5,1,-1},{5733,5,0,-1},{5737,5,0,-1}, +{5738,5,1,-1},{5741,5,0,-1},{5746,5,0,-1},{5747,5,1,-1},{5680,5,0,-1}, +{5750,5,0,-1},{5754,5,0,-1},{5755,5,1,-1},{5759,5,0,-1},{5693,5,1,-1}, +{5763,5,0,-1},{5764,5,1,-1},{5767,5,0,-1},{5772,5,0,-1},{5773,5,1,-1}, +{5776,5,0,-1},{5780,5,0,-1},{5781,5,1,-1},{5785,5,0,-1},{5789,5,0,-1}, +{5790,5,1,-1},{5793,5,0,-1},{5798,5,0,-1},{5799,5,1,-1},{5802,5,0,-1}, +{5806,5,0,-1},{5807,5,1,-1},{5811,5,0,-1},{5815,5,0,-1},{5816,5,1,-1}, +{5819,5,0,-1},{5820,5,1,-1},{5824,5,0,-1},{5825,5,1,-1},{5828,5,0,-1}, +{5829,5,1,-1},{5832,5,0,-1},{5833,5,1,-1},{5837,5,0,-1},{5838,5,1,-1}, +{5841,5,0,-1},{5842,5,1,-1},{5845,5,0,-1},{5850,5,0,-1},{5851,5,1,-1}, +{5784,5,0,-1},{5854,5,0,-1},{5855,5,1,-1},{5858,5,0,-1},{5859,5,1,-1}, +{5863,5,0,-1},{5864,5,1,-1},{5797,5,1,-1},{5867,5,0,-1},{5868,5,1,-1}, +{5871,5,0,-1},{5872,5,1,-1},{5876,5,0,-1},{5877,5,1,-1},{5880,5,0,-1}, +{5881,5,1,-1},{5884,5,0,-1},{5885,5,1,-1},{5890,5,1,-1},{5893,5,0,-1}, +{5894,5,1,-1},{5897,5,0,-1},{5898,5,1,-1},{5902,5,0,-1},{5903,5,1,-1}, +{5906,5,0,-1},{5907,5,1,-1},{5910,5,0,-1},{5911,5,1,-1},{5915,5,0,-1}, +{5916,5,1,-1},{5919,5,0,-1},{5920,5,1,-1},{5923,5,0,-1},{5924,5,1,-1}, +{5928,5,0,-1},{5929,5,1,-1},{5932,5,0,-1},{5933,5,1,-1},{5936,5,0,-1}, +{5937,5,1,-1},{5941,5,0,-1},{5942,5,1,-1},{5945,5,0,-1},{5946,5,1,-1}, +{5949,5,0,-1},{5950,5,1,-1},{5954,5,0,-1},{5955,5,1,-1},{5888,5,0,-1}, +{5958,5,0,-1},{5959,5,1,-1},{5962,5,0,-1},{5963,5,1,-1},{5967,5,0,-1}, +{5968,5,1,-1},{5901,5,1,-1},{5971,5,0,-1},{5972,5,1,-1},{5975,5,0,-1}, +{5976,5,1,-1},{5980,5,0,-1},{5981,5,1,-1},{5984,5,0,-1},{5988,5,0,-1}, +{5989,5,1,-1},{5993,5,0,-1},{5994,5,1,-1},{5997,5,0,-1},{5998,5,1,-1}, +{6001,5,0,-1},{6002,5,1,-1},{6006,5,0,-1},{6007,5,1,-1},{6010,5,0,-1}, +{6011,5,1,-1},{6014,5,0,-1},{6015,5,1,-1},{6019,5,0,-1},{6020,5,1,-1}, +{6023,5,0,-1},{6024,5,1,-1},{6028,5,1,-1},{6032,5,0,-1},{6033,5,1,-1}, +{6036,5,0,-1},{6040,5,0,-1},{6041,5,1,-1},{6045,5,0,-1},{6046,5,1,-1}, +{6049,5,0,-1},{6050,5,1,-1},{6053,5,0,-1},{6054,5,1,-1},{6058,5,0,-1}, +{6059,5,1,-1},{5992,5,0,-1},{6062,5,0,-1},{6063,5,1,-1},{6066,5,0,-1}, +{6067,5,1,-1},{6071,5,0,-1},{6072,5,1,-1},{6005,5,1,-1},{6075,5,0,-1}, +{6076,5,1,-1},{6079,5,0,-1},{6080,5,1,-1},{6084,5,0,-1},{6085,5,1,-1}, +{6088,5,0,-1},{6089,5,1,-1},{6092,5,0,-1},{6093,5,1,-1},{6097,5,0,-1}, +{6098,5,1,-1},{6101,5,0,-1},{6102,5,1,-1},{6105,5,0,-1},{6106,5,1,-1}, +{6110,5,0,-1},{6111,5,1,-1},{6114,5,0,-1},{6115,5,1,-1},{6118,5,0,-1}, +{6119,5,1,-1},{6123,5,0,-1},{6124,5,1,-1},{6127,5,0,-1},{6128,5,1,-1}, +{6131,5,0,-1},{6132,5,1,-1},{6136,5,0,-1},{6137,5,1,-1},{6140,5,0,-1}, +{6141,5,1,-1},{6144,5,0,-1},{6145,5,1,-1},{6149,5,0,-1},{6150,5,1,-1}, +{6153,5,0,-1},{6154,5,1,-1},{6157,5,0,-1},{6158,5,1,-1},{6162,5,0,-1}, +{6163,5,1,-1},{6096,5,0,-1},{6166,5,0,-1},{6167,5,1,-1},{6170,5,0,-1}, +{6171,5,1,-1},{6175,5,0,-1},{6176,5,1,-1},{6109,5,1,-1},{6179,5,0,-1}, +{6180,5,1,-1},{6183,5,0,-1},{6184,5,1,-1},{6188,5,0,-1},{6189,5,1,-1}, +{6192,5,0,-1},{6193,5,1,-1},{6196,5,0,-1},{6197,5,1,-1},{6201,5,0,-1}, +{6202,5,1,-1},{6205,5,0,-1},{6206,5,1,-1},{6209,5,0,-1},{6210,5,1,-1}, +{6214,5,0,-1},{6215,5,1,-1},{6218,5,0,-1},{6219,5,1,-1},{6222,5,0,-1}, +{6223,5,1,-1},{6227,5,0,-1},{6228,5,1,-1},{6231,5,0,-1},{6232,5,1,-1}, +{6235,5,0,-1},{6236,5,1,-1},{6240,5,0,-1},{6241,5,1,-1},{6244,5,0,-1}, +{6245,5,1,-1},{6248,5,0,-1},{6249,5,1,-1},{6253,5,0,-1},{6254,5,1,-1}, +{6257,5,0,-1},{6258,5,1,-1},{6261,5,0,-1},{6262,5,1,-1},{6266,5,0,-1}, +{6267,5,1,-1},{6200,5,0,-1},{6270,5,0,-1},{6271,5,1,-1},{6274,5,0,-1}, +{6275,5,1,-1},{6279,5,0,-1},{6280,5,1,-1},{6213,5,1,-1},{6283,5,0,-1}, +{6284,5,1,-1},{6287,5,0,-1},{6288,5,1,-1},{6292,5,0,-1},{6293,5,1,-1}, +{6296,5,0,-1},{6297,5,1,-1},{6300,5,0,-1},{6301,5,1,-1},{6305,5,0,-1}, +{6306,5,1,-1},{6309,5,0,-1},{6310,5,1,-1},{6313,5,0,-1},{6314,5,1,-1}, +{6318,5,0,-1},{6319,5,1,-1},{6322,5,0,-1},{6323,5,1,-1},{6326,5,0,-1}, +{6327,5,1,-1},{6331,5,0,-1},{6332,5,1,-1},{6335,5,0,-1},{6336,5,1,-1}, +{6339,5,0,-1},{6340,5,1,-1},{6344,5,0,-1},{6345,5,1,-1},{6348,5,0,-1}, +{6349,5,1,-1},{6352,5,0,-1},{6353,5,1,-1},{6357,5,0,-1},{6358,5,1,-1}, +{6361,5,0,-1},{6362,5,1,-1},{6365,5,0,-1},{6366,5,1,-1},{6370,5,0,-1}, +{6371,5,1,-1},{6304,5,0,-1},{6374,5,0,-1},{6375,5,1,-1},{6378,5,0,-1}, +{6379,5,1,-1},{6383,5,0,-1},{6384,5,1,-1},{6317,5,1,-1},{6387,5,0,-1}, +{6388,5,1,-1},{6391,5,0,-1},{6392,5,1,-1},{6396,5,0,-1},{6397,5,1,-1}, +{6400,5,0,-1},{6401,5,1,-1},{6404,5,0,-1},{6405,5,1,-1},{6409,5,0,-1}, +{6410,5,1,-1},{6413,5,0,-1},{6414,5,1,-1},{6417,5,0,-1},{6418,5,1,-1}, +{6422,5,0,-1},{6423,5,1,-1},{6426,5,0,-1},{6427,5,1,-1},{6430,5,0,-1}, +{6431,5,1,-1},{6435,5,0,-1},{6436,5,1,-1},{6439,5,0,-1},{6440,5,1,-1}, +{6443,5,0,-1},{6444,5,1,-1},{6448,5,0,-1},{6449,5,1,-1},{6452,5,0,-1}, +{6453,5,1,-1},{6456,5,0,-1},{6457,5,1,-1},{6461,5,0,-1},{6462,5,1,-1}, +{6465,5,0,-1},{6466,5,1,-1},{6469,5,0,-1},{6470,5,1,-1},{6474,5,0,-1}, +{6475,5,1,-1},{6408,5,0,-1},{6478,5,0,-1},{6479,5,1,-1},{6482,5,0,-1}, +{6483,5,1,-1},{6487,5,0,-1},{6488,5,1,-1},{6421,5,1,-1},{6491,5,0,-1}, +{6492,5,1,-1},{6495,5,0,-1},{6496,5,1,-1},{6500,5,0,-1},{6501,5,1,-1}, +{6504,5,0,-1},{6505,5,1,-1},{6508,5,0,-1},{6509,5,1,-1},{6513,5,0,-1}, +{6514,5,1,-1},{6517,5,0,-1},{6518,5,1,-1},{6521,5,0,-1},{6522,5,1,-1}, +{6526,5,0,-1},{6527,5,1,-1},{6530,5,0,-1},{6531,5,1,-1},{6534,5,0,-1}, +{6535,5,1,-1},{6539,5,0,-1},{6540,5,1,-1},{6543,5,0,-1},{6544,5,1,-1}, +{6547,5,0,-1},{6548,5,1,-1},{6552,5,0,-1},{6553,5,1,-1},{6556,5,0,-1}, +{6557,5,1,-1},{6560,5,0,-1},{6561,5,1,-1},{6565,5,0,-1},{6566,5,1,-1}, +{6569,5,0,-1},{6570,5,1,-1},{6573,5,0,-1},{6574,5,1,-1},{6578,5,0,-1}, +{6579,5,1,-1},{6512,5,0,-1},{6582,5,0,-1},{6583,5,1,-1},{6586,5,0,-1}, +{6587,5,1,-1},{6591,5,0,-1},{6592,5,1,-1},{6525,5,1,-1},{6595,5,0,-1}, +{6596,5,1,-1},{6599,5,0,-1},{6600,5,1,-1},{6604,5,0,-1},{6605,5,1,-1}, +{6608,5,0,-1},{6609,5,1,-1},{6612,5,0,-1},{6613,5,1,-1},{6617,5,0,-1}, +{6618,5,1,-1},{6621,5,0,-1},{6622,5,1,-1},{6625,5,0,-1},{6626,5,1,-1}, +{6630,5,0,-1},{6631,5,1,-1},{6634,5,0,-1},{6635,5,1,-1},{6638,5,0,-1}, +{6639,5,1,-1},{6643,5,0,-1},{6644,5,1,-1},{6647,5,0,-1},{6648,5,1,-1}, +{6651,5,0,-1},{6652,5,1,-1},{6656,5,0,-1},{6657,5,1,-1},{6660,5,0,-1}, +{6661,5,1,-1},{6664,5,0,-1},{6665,5,1,-1},{6669,5,0,-1},{6670,5,1,-1}, +{6673,5,0,-1},{6674,5,1,-1},{6677,5,0,-1},{6678,5,1,-1},{6682,5,0,-1}, +{6683,5,1,-1},{6616,5,0,-1},{6686,5,0,-1},{6687,5,1,-1},{6690,5,0,-1}, +{6691,5,1,-1},{6695,5,0,-1},{6696,5,1,-1},{6629,5,1,-1},{6699,5,0,-1}, +{6700,5,1,-1},{6703,5,0,-1},{6704,5,1,-1},{6708,5,0,-1},{6709,5,1,-1}, +{6712,5,0,-1},{6713,5,1,-1},{6716,5,0,-1},{6717,5,1,-1},{6721,5,0,-1}, +{6722,5,1,-1},{6725,5,0,-1},{6726,5,1,-1},{6729,5,0,-1},{6730,5,1,-1}, +{6734,5,0,-1},{6735,5,1,-1},{6738,5,0,-1},{6739,5,1,-1},{6742,5,0,-1}, +{6743,5,1,-1},{6747,5,0,-1},{6748,5,1,-1},{6751,5,0,-1},{6752,5,1,-1}, +{6755,5,0,-1},{6756,5,1,-1},{6760,5,0,-1},{6761,5,1,-1},{6764,5,0,-1}, +{6765,5,1,-1},{6768,5,0,-1},{6769,5,1,-1},{6773,5,0,-1},{6774,5,1,-1}, +{6777,5,0,-1},{6778,5,1,-1},{6781,5,0,-1},{6782,5,1,-1},{6786,5,0,-1}, +{6787,5,1,-1},{6720,5,0,-1},{6790,5,0,-1},{6791,5,1,-1},{6794,5,0,-1}, +{6795,5,1,-1},{6799,5,0,-1},{6800,5,1,-1},{6733,5,1,-1},{6803,5,0,-1}, +{6804,5,1,-1},{6807,5,0,-1},{6808,5,1,-1},{6812,5,0,-1},{6813,5,1,-1}, +{6816,5,0,-1},{6817,5,1,-1},{6820,5,0,-1},{6821,5,1,-1},{6825,5,0,-1}, +{6826,5,1,-1},{6829,5,0,-1},{6830,5,1,-1},{6833,5,0,-1},{6834,5,1,-1}, +{6838,5,0,-1},{6839,5,1,-1},{6842,5,0,-1},{6843,5,1,-1},{6846,5,0,-1}, +{6847,5,1,-1},{6851,5,0,-1},{6852,5,1,-1},{6855,5,0,-1},{6856,5,1,-1}, +{6859,5,0,-1},{6860,5,1,-1},{6864,5,0,-1},{6865,5,1,-1},{6868,5,0,-1}, +{6869,5,1,-1},{6872,5,0,-1},{6873,5,1,-1},{6877,5,0,-1},{6878,5,1,-1}, +{6881,5,0,-1},{6882,5,1,-1},{6885,5,0,-1},{6886,5,1,-1},{6890,5,0,-1}, +{6891,5,1,-1},{6824,5,0,-1},{6894,5,0,-1},{6895,5,1,-1},{6898,5,0,-1}, +{6899,5,1,-1},{6903,5,0,-1},{6904,5,1,-1},{6837,5,1,-1},{6907,5,0,-1}, +{6908,5,1,-1},{6911,5,0,-1},{6912,5,1,-1},{6916,5,0,-1},{6917,5,1,-1}, +{6920,5,0,-1},{6921,5,1,-1},{6924,5,0,-1},{6925,5,1,-1},{6929,5,0,-1}, +{6930,5,1,-1},{6933,5,0,-1},{6934,5,1,-1},{6937,5,0,-1},{6938,5,1,-1}, +{6942,5,0,-1},{6943,5,1,-1},{6946,5,0,-1},{6947,5,1,-1},{6950,5,0,-1}, +{6951,5,1,-1},{6955,5,0,-1},{6956,5,1,-1},{6959,5,0,-1},{6960,5,1,-1}, +{6963,5,0,-1},{6964,5,1,-1},{6968,5,0,-1},{6969,5,1,-1},{6972,5,0,-1}, +{6973,5,1,-1},{6976,5,0,-1},{6977,5,1,-1},{6981,5,0,-1},{6982,5,1,-1}, +{6985,5,0,-1},{6986,5,1,-1},{6989,5,0,-1},{6990,5,1,-1},{6994,5,0,-1}, +{6995,5,1,-1},{6928,5,0,-1},{6998,5,0,-1},{6999,5,1,-1},{7002,5,0,-1}, +{7003,5,1,-1},{7007,5,0,-1},{7008,5,1,-1},{6941,5,1,-1},{7011,5,0,-1}, +{7012,5,1,-1},{7015,5,0,-1},{7016,5,1,-1},{7020,5,0,-1},{7021,5,1,-1}, +{7024,5,0,-1},{7025,5,1,-1},{7028,5,0,-1},{7029,5,1,-1},{7033,5,0,-1}, +{7034,5,1,-1},{7037,5,0,-1},{7038,5,1,-1},{7041,5,0,-1},{7042,5,1,-1}, +{7046,5,0,-1},{7047,5,1,-1},{7050,5,0,-1},{7051,5,1,-1},{7054,5,0,-1}, +{7055,5,1,-1},{7059,5,0,-1},{7060,5,1,-1},{7063,5,0,-1},{7064,5,1,-1}, +{7067,5,0,-1},{7068,5,1,-1},{7072,5,0,-1},{7073,5,1,-1},{7076,5,0,-1}, +{7077,5,1,-1},{7080,5,0,-1},{7081,5,1,-1},{7085,5,0,-1},{7086,5,1,-1}, +{7089,5,0,-1},{7090,5,1,-1},{7093,5,0,-1},{7094,5,1,-1},{7098,5,0,-1}, +{7099,5,1,-1},{7032,5,0,-1},{7102,5,0,-1},{7103,5,1,-1},{7106,5,0,-1}, +{7107,5,1,-1},{7111,5,0,-1},{7112,5,1,-1},{7045,5,1,-1},{7115,5,0,-1}, +{7116,5,1,-1},{7119,5,0,-1},{7120,5,1,-1},{7124,5,0,-1},{7125,5,1,-1}, +{7128,5,0,-1},{7129,5,1,-1},{7132,5,0,-1},{7133,5,1,-1},{7137,5,0,-1}, +{7138,5,1,-1},{7141,5,0,-1},{7142,5,1,-1},{7145,5,0,-1},{7146,5,1,-1}, +{7150,5,0,-1},{7151,5,1,-1},{7154,5,0,-1},{7155,5,1,-1},{7158,5,0,-1}, +{7159,5,1,-1},{7163,5,0,-1},{7164,5,1,-1},{7167,5,0,-1},{7168,5,1,-1}, +{7171,5,0,-1},{7172,5,1,-1},{7176,5,0,-1},{7177,5,1,-1},{7180,5,0,-1}, +{7181,5,1,-1},{7184,5,0,-1},{7185,5,1,-1},{7189,5,0,-1},{7190,5,1,-1}, +{7193,5,0,-1},{7194,5,1,-1},{7197,5,0,-1},{7198,5,1,-1},{7202,5,0,-1}, +{7203,5,1,-1},{7136,5,0,-1},{7206,5,0,-1},{7207,5,1,-1},{7210,5,0,-1}, +{7211,5,1,-1},{7215,5,0,-1},{7216,5,1,-1},{7149,5,1,-1},{7219,5,0,-1}, +{7220,5,1,-1},{7223,5,0,-1},{7224,5,1,-1},{7228,5,0,-1},{7229,5,1,-1}, +{7232,5,0,-1},{7233,5,1,-1},{7236,5,0,-1},{7237,5,1,-1},{7241,5,0,-1}, +{7242,5,1,-1},{7245,5,0,-1},{7246,5,1,-1},{7249,5,0,-1},{7250,5,1,-1}, +{7254,5,0,-1},{7255,5,1,-1},{7258,5,0,-1},{7259,5,1,-1},{7262,5,0,-1}, +{7263,5,1,-1},{7267,5,0,-1},{7268,5,1,-1},{7271,5,0,-1},{7272,5,1,-1}, +{7275,5,0,-1},{7276,5,1,-1},{7280,5,0,-1},{7281,5,1,-1},{7284,5,0,-1}, +{7285,5,1,-1},{7288,5,0,-1},{7289,5,1,-1},{7293,5,0,-1},{7294,5,1,-1}, +{7297,5,0,-1},{7298,5,1,-1},{7301,5,0,-1},{7302,5,1,-1},{7306,5,0,-1}, +{7307,5,1,-1},{7240,5,0,-1},{7310,5,0,-1},{7311,5,1,-1},{7314,5,0,-1}, +{7315,5,1,-1},{7319,5,0,-1},{7320,5,1,-1},{7253,5,1,-1},{7323,5,0,-1}, +{7324,5,1,-1},{7327,5,0,-1},{7328,5,1,-1},{7332,5,0,-1},{7333,5,1,-1}, +{7336,5,0,-1},{7337,5,1,-1},{7340,5,0,-1},{7341,5,1,-1},{7345,5,0,-1}, +{7346,5,1,-1},{7349,5,0,-1},{7350,5,1,-1},{7353,5,0,-1},{7354,5,1,-1}, +{7358,5,0,-1},{7359,5,1,-1},{7362,5,0,-1},{7363,5,1,-1},{7366,5,0,-1}, +{7367,5,1,-1},{7371,5,0,-1},{7372,5,1,-1},{7375,5,0,-1},{7376,5,1,-1}, +{7379,5,0,-1},{7380,5,1,-1},{7384,5,0,-1},{7385,5,1,-1},{7388,5,0,-1}, +{7389,5,1,-1},{7392,5,0,-1},{7393,5,1,-1},{7397,5,0,-1},{7398,5,1,-1}, +{7401,5,0,-1},{7402,5,1,-1},{7405,5,0,-1},{7406,5,1,-1},{7410,5,0,-1}, +{7411,5,1,-1},{7344,5,0,-1},{7414,5,0,-1},{7415,5,1,-1},{7418,5,0,-1}, +{7419,5,1,-1},{7423,5,0,-1},{7424,5,1,-1},{7357,5,1,-1},{7427,5,0,-1}, +{7428,5,1,-1},{7431,5,0,-1},{7432,5,1,-1},{7436,5,0,-1},{7437,5,1,-1}, +{7440,5,0,-1},{7441,5,1,-1},{7444,5,0,-1},{7445,5,1,-1},{7449,5,0,-1}, +{7450,5,1,-1},{7453,5,0,-1},{7454,5,1,-1},{7457,5,0,-1},{7458,5,1,-1}, +{7462,5,0,-1},{7463,5,1,-1},{7466,5,0,-1},{7467,5,1,-1},{7470,5,0,-1}, +{7471,5,1,-1},{7475,5,0,-1},{7476,5,1,-1},{7479,5,0,-1},{7480,5,1,-1}, +{7483,5,0,-1},{7484,5,1,-1},{7488,5,0,-1},{7489,5,1,-1},{7492,5,0,-1}, +{7493,5,1,-1},{7496,5,0,-1},{7497,5,1,-1},{7501,5,0,-1},{7502,5,1,-1}, +{7505,5,0,-1},{7506,5,1,-1},{7509,5,0,-1},{7510,5,1,-1},{7514,5,0,-1}, +{7515,5,1,-1},{7448,5,0,-1},{7518,5,0,-1},{7519,5,1,-1},{7522,5,0,-1}, +{7523,5,1,-1},{7527,5,0,-1},{7528,5,1,-1},{7461,5,1,-1},{7531,5,0,-1}, +{7532,5,1,-1},{7535,5,0,-1},{7536,5,1,-1},{7540,5,0,-1},{7541,5,1,-1}, +{7544,5,0,-1},{7545,5,1,-1},{7548,5,0,-1},{7549,5,1,-1},{7553,5,0,-1}, +{7554,5,1,-1},{7557,5,0,-1},{7558,5,1,-1},{7561,5,0,-1},{7562,5,1,-1}, +{7566,5,0,-1},{7567,5,1,-1},{7570,5,0,-1},{7571,5,1,-1},{7574,5,0,-1}, +{7575,5,1,-1},{7579,5,0,-1},{7580,5,1,-1},{7583,5,0,-1},{7584,5,1,-1}, +{7587,5,0,-1},{7588,5,1,-1},{7592,5,0,-1},{7593,5,1,-1},{7596,5,0,-1}, +{7597,5,1,-1},{7600,5,0,-1},{7601,5,1,-1},{7605,5,0,-1},{7606,5,1,-1}, +{7609,5,0,-1},{7610,5,1,-1},{7613,5,0,-1},{7614,5,1,-1},{7618,5,0,-1}, +{7619,5,1,-1},{7552,5,0,-1},{7622,5,0,-1},{7623,5,1,-1},{7626,5,0,-1}, +{7627,5,1,-1},{7631,5,0,-1},{7632,5,1,-1},{7565,5,1,-1},{7635,5,0,-1}, +{7636,5,1,-1},{7639,5,0,-1},{7640,5,1,-1},{7644,5,0,-1},{7645,5,1,-1}, +{7648,5,0,-1},{7649,5,1,-1},{7652,5,0,-1},{7653,5,1,-1},{7657,5,0,-1}, +{7658,5,1,-1},{7661,5,0,-1},{7662,5,1,-1},{7665,5,0,-1},{7666,5,1,-1}, +{7670,5,0,-1},{7671,5,1,-1},{7674,5,0,-1},{7675,5,1,-1},{7678,5,0,-1}, +{7679,5,1,-1},{7683,5,0,-1},{7684,5,1,-1},{7687,5,0,-1},{7688,5,1,-1}, +{7691,5,0,-1},{7692,5,1,-1},{7696,5,0,-1},{7697,5,1,-1},{7700,5,0,-1}, +{7701,5,1,-1},{7704,5,0,-1},{7705,5,1,-1},{7709,5,0,-1},{7710,5,1,-1}, +{7713,5,0,-1},{7714,5,1,-1},{7717,5,0,-1},{7718,5,1,-1},{7722,5,0,-1}, +{7723,5,1,-1},{7656,5,0,-1},{7726,5,0,-1},{7727,5,1,-1},{7730,5,0,-1}, +{7731,5,1,-1},{7735,5,0,-1},{7736,5,1,-1},{7669,5,1,-1},{7739,5,0,-1}, +{7740,5,1,-1},{7743,5,0,-1},{7744,5,1,-1},{7748,5,0,-1},{7749,5,1,-1}, +{7752,5,0,-1},{7753,5,1,-1},{7756,5,0,-1},{7757,5,1,-1},{7761,5,0,-1}, +{7762,5,1,-1},{7765,5,0,-1},{7766,5,1,-1},{7769,5,0,-1},{7770,5,1,-1}, +{7774,5,0,-1},{7775,5,1,-1},{7778,5,0,-1},{7779,5,1,-1},{7782,5,0,-1}, +{7783,5,1,-1},{7787,5,0,-1},{7788,5,1,-1},{7791,5,0,-1},{7792,5,1,-1}, +{7795,5,0,-1},{7796,5,1,-1},{7800,5,0,-1},{7801,5,1,-1},{7804,5,0,-1}, +{7805,5,1,-1},{7808,5,0,-1},{7809,5,1,-1},{7813,5,0,-1},{7814,5,1,-1}, +{7817,5,0,-1},{7818,5,1,-1},{7821,5,0,-1},{7822,5,1,-1},{7826,5,0,-1}, +{7827,5,1,-1},{7760,5,0,-1},{7830,5,0,-1},{7831,5,1,-1},{7834,5,0,-1}, +{7835,5,1,-1},{7839,5,0,-1},{7840,5,1,-1},{7773,5,1,-1},{7843,5,0,-1}, +{7844,5,1,-1},{7847,5,0,-1},{7848,5,1,-1},{7852,5,0,-1},{7853,5,1,-1}, +{7856,5,0,-1},{7857,5,1,-1},{7860,5,0,-1},{7861,5,1,-1},{7865,5,0,-1}, +{7866,5,1,-1},{7869,5,0,-1},{7870,5,1,-1},{7873,5,0,-1},{7874,5,1,-1}, +{7878,5,0,-1},{7879,5,1,-1},{7882,5,0,-1},{7883,5,1,-1},{7886,5,0,-1}, +{7887,5,1,-1},{7891,5,0,-1},{7892,5,1,-1},{7895,5,0,-1},{7896,5,1,-1}, +{7899,5,0,-1},{7900,5,1,-1},{7904,5,0,-1},{7905,5,1,-1},{7908,5,0,-1}, +{7909,5,1,-1},{7912,5,0,-1},{7913,5,1,-1},{7917,5,0,-1},{7918,5,1,-1}, +{7921,5,0,-1},{7922,5,1,-1},{7925,5,0,-1},{7926,5,1,-1},{7930,5,0,-1}, +{7931,5,1,-1},{7864,5,0,-1},{7934,5,0,-1},{7935,5,1,-1},{7938,5,0,-1}, +{7939,5,1,-1},{7943,5,0,-1},{7944,5,1,-1},{7877,5,1,-1},{7947,5,0,-1}, +{7948,5,1,-1},{7951,5,0,-1},{7952,5,1,-1},{7956,5,0,-1},{7957,5,1,-1}, +{7960,5,0,-1},{7961,5,1,-1},{7964,5,0,-1},{7965,5,1,-1},{7969,5,0,-1}, +{7970,5,1,-1},{7973,5,0,-1},{7974,5,1,-1},{7977,5,0,-1},{7978,5,1,-1}, +{7982,5,0,-1},{7983,5,1,-1},{7986,5,0,-1},{7987,5,1,-1},{7990,5,0,-1}, +{7991,5,1,-1},{7995,5,0,-1},{7996,5,1,-1},{7999,5,0,-1},{8000,5,1,-1}, +{8003,5,0,-1},{8004,5,1,-1},{8008,5,0,-1},{8009,5,1,-1},{8012,5,0,-1}, +{8013,5,1,-1},{8016,5,0,-1},{8017,5,1,-1},{8021,5,0,-1},{8022,5,1,-1}, +{8025,5,0,-1},{8026,5,1,-1},{8029,5,0,-1},{8030,5,1,-1},{8034,5,0,-1}, +{8035,5,1,-1},{7968,5,0,-1},{8038,5,0,-1},{8039,5,1,-1},{8042,5,0,-1}, +{8043,5,1,-1},{8047,5,0,-1},{8048,5,1,-1},{7981,5,1,-1},{8051,5,0,-1}, +{8052,5,1,-1},{8055,5,0,-1},{8056,5,1,-1},{8060,5,0,-1},{8061,5,1,-1}, +{8064,5,0,-1},{8065,5,1,-1},{8068,5,0,-1},{8069,5,1,-1},{8073,5,0,-1}, +{8074,5,1,-1},{8077,5,0,-1},{8078,5,1,-1},{8081,5,0,-1},{8082,5,1,-1}, +{8086,5,0,-1},{8087,5,1,-1},{8090,5,0,-1},{8091,5,1,-1},{8094,5,0,-1}, +{8095,5,1,-1},{8099,5,0,-1},{8100,5,1,-1},{8103,5,0,-1},{8104,5,1,-1}, +{8107,5,0,-1},{8108,5,1,-1},{8112,5,0,-1},{8113,5,1,-1},{8116,5,0,-1}, +{8117,5,1,-1},{8120,5,0,-1},{8121,5,1,-1},{8125,5,0,-1},{8126,5,1,-1}, +{8129,5,0,-1},{8130,5,1,-1},{8133,5,0,-1},{8134,5,1,-1},{8138,5,0,-1}, +{8139,5,1,-1},{8072,5,0,-1},{8142,5,0,-1},{8143,5,1,-1},{8146,5,0,-1}, +{8147,5,1,-1},{8151,5,0,-1},{8152,5,1,-1},{8085,5,1,-1},{8155,5,0,-1}, +{8156,5,1,-1},{8159,5,0,-1},{8160,5,1,-1},{8164,5,0,-1},{8165,5,1,-1}, +{8168,5,0,-1},{8169,5,1,-1},{8172,5,0,-1},{8173,5,1,-1},{8177,5,0,-1}, +{8178,5,1,-1},{8181,5,0,-1},{8182,5,1,-1},{8185,5,0,-1},{8186,5,1,-1}, +{8190,5,0,-1},{8191,5,1,-1},{8194,5,0,-1},{8195,5,1,-1},{8198,5,0,-1}, +{8199,5,1,-1},{8203,5,0,-1},{8204,5,1,-1},{8207,5,0,-1},{8208,5,1,-1}, +{8211,5,0,-1},{8212,5,1,-1},{8216,5,0,-1},{8217,5,1,-1},{8220,5,0,-1}, +{8221,5,1,-1},{8224,5,0,-1},{8225,5,1,-1},{8229,5,0,-1},{8230,5,1,-1}, +{8233,5,0,-1},{8234,5,1,-1},{8237,5,0,-1},{8238,5,1,-1},{8242,5,0,-1}, +{8243,5,1,-1},{8176,5,0,-1},{8246,5,0,-1},{8247,5,1,-1},{8250,5,0,-1}, +{8251,5,1,-1},{8255,5,0,-1},{8256,5,1,-1},{8189,5,1,-1},{8259,5,0,-1}, +{8260,5,1,-1},{8263,5,0,-1},{8264,5,1,-1},{8268,5,0,-1},{8269,5,1,-1}, +{8272,5,0,-1},{8273,5,1,-1},{8276,5,0,-1},{8277,5,1,-1},{8281,5,0,-1}, +{8282,5,1,-1},{8285,5,0,-1},{8286,5,1,-1},{8289,5,0,-1},{8290,5,1,-1}, +{8294,5,0,-1},{8295,5,1,-1},{8298,5,0,-1},{8299,5,1,-1},{8302,5,0,-1}, +{8303,5,1,-1},{8307,5,0,-1},{8308,5,1,-1},{8311,5,0,-1},{8312,5,1,-1}, +{8315,5,0,-1},{8316,5,1,-1},{8320,5,0,-1},{8321,5,1,-1},{8324,5,0,-1}, +{8325,5,1,-1},{8328,5,0,-1},{8329,5,1,-1},{8333,5,0,-1},{8334,5,1,-1}, +{8337,5,0,-1},{8338,5,1,-1},{8341,5,0,-1},{8342,5,1,-1},{8346,5,0,-1}, +{8347,5,1,-1},{8280,5,0,-1},{8350,5,0,-1},{8351,5,1,-1},{8354,5,0,-1}, +{8355,5,1,-1},{8359,5,0,-1},{8360,5,1,-1},{8293,5,1,-1},{8363,5,0,-1}, +{8364,5,1,-1},{8367,5,0,-1},{8368,5,1,-1},{8372,5,0,-1},{8373,5,1,-1}, +{8376,5,0,-1},{8377,5,1,-1},{8380,5,0,-1},{8381,5,1,-1},{8385,5,0,-1}, +{8386,5,1,-1},{8389,5,0,-1},{8390,5,1,-1},{8393,5,0,-1},{8394,5,1,-1}, +{8398,5,0,-1},{8399,5,1,-1},{8402,5,0,-1},{8403,5,1,-1},{8406,5,0,-1}, +{8407,5,1,-1},{8411,5,0,-1},{8412,5,1,-1},{8415,5,0,-1},{8416,5,1,-1}, +{8419,5,0,-1},{8420,5,1,-1},{8424,5,0,-1},{8425,5,1,-1},{8428,5,0,-1}, +{8429,5,1,-1},{8432,5,0,-1},{8433,5,1,-1},{8437,5,0,-1},{8438,5,1,-1}, +{8441,5,0,-1},{8442,5,1,-1},{8445,5,0,-1},{8446,5,1,-1},{8450,5,0,-1}, +{8451,5,1,-1},{8384,5,0,-1},{8454,5,0,-1},{8455,5,1,-1},{8458,5,0,-1}, +{8459,5,1,-1},{8463,5,0,-1},{8464,5,1,-1},{8397,5,1,-1},{8467,5,0,-1}, +{8468,5,1,-1},{8471,5,0,-1},{8472,5,1,-1},{8476,5,0,-1},{8477,5,1,-1}, +{8480,5,0,-1},{8481,5,1,-1},{8484,5,0,-1},{8485,5,1,-1},{8489,5,0,-1}, +{8490,5,1,-1},{8493,5,0,-1},{8494,5,1,-1},{8497,5,0,-1},{8498,5,1,-1}, +{8502,5,0,-1},{8503,5,1,-1},{8506,5,0,-1},{8507,5,1,-1},{8510,5,0,-1}, +{8511,5,1,-1},{8515,5,0,-1},{8516,5,1,-1},{8519,5,0,-1},{8520,5,1,-1}, +{8523,5,0,-1},{8524,5,1,-1},{8528,5,0,-1},{8529,5,1,-1},{8532,5,0,-1}, +{8533,5,1,-1},{8536,5,0,-1},{8537,5,1,-1},{8541,5,0,-1},{8545,5,0,-1}, +{8549,5,0,-1},{8554,5,0,-1},{8488,5,0,-1},{8558,5,0,-1},{8562,5,0,-1}, +{8567,5,0,-1},{8501,5,1,-1},{8571,5,0,-1},{8575,5,0,-1},{8580,5,0,-1}, +{8584,5,0,-1},{8585,5,1,-1},{8588,5,0,-1},{8589,5,1,-1},{8597,5,0,-1}, +{8601,5,0,-1},{8606,5,0,-1},{8610,5,0,-1},{8614,5,0,-1},{8619,5,0,-1}, +{8623,5,0,-1},{8627,5,0,-1},{8632,5,0,-1},{8636,5,0,-1},{8640,5,0,-1}, +{8641,5,1,-1},{8649,5,0,-1},{8653,5,0,-1},{8658,5,0,-1},{8662,5,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS6, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_6_ss0_ss1[] = { +{8112,6,0,-1},{8120,6,0,-1},{8129,6,0,-1},{8138,6,0,-1},{8146,6,0,-1}, +{8155,6,0,-1},{8164,6,0,-1},{8098,6,0,-1},{8172,6,0,-1},{8181,6,0,-1}, +{8190,6,0,-1},{8198,6,0,-1},{8207,6,0,-1},{8211,6,0,-1},{8216,6,0,-1}, +{8220,6,0,-1},{8224,6,0,-1},{8229,6,0,-1},{8233,6,0,-1},{8237,6,0,-1}, +{8242,6,0,-1},{8246,6,0,-1},{8250,6,0,-1},{8255,6,0,-1},{8259,6,0,-1}, +{8263,6,0,-1},{8268,6,0,-1},{8202,6,0,-1},{8272,6,0,-1},{8276,6,0,-1}, +{8281,6,0,-1},{8285,6,0,-1},{8289,6,0,-1},{8294,6,0,-1},{8298,6,0,-1}, +{8302,6,0,-1},{8307,6,0,-1},{8311,6,0,-1},{8315,6,0,-1},{8320,6,0,-1}, +{8324,6,0,-1},{8328,6,0,-1},{8333,6,0,-1},{8337,6,0,-1},{8341,6,0,-1}, +{8346,6,0,-1},{8350,6,0,-1},{8354,6,0,-1},{8355,6,1,-1},{8359,6,0,-1}, +{8363,6,0,-1},{8364,6,1,-1},{8367,6,0,-1},{8372,6,0,-1},{8373,6,1,-1}, +{8306,6,0,-1},{8376,6,0,-1},{8380,6,0,-1},{8381,6,1,-1},{8385,6,0,-1}, +{8389,6,0,-1},{8390,6,1,-1},{8393,6,0,-1},{8398,6,0,-1},{8399,6,1,-1}, +{8402,6,0,-1},{8406,6,0,-1},{8407,6,1,-1},{8411,6,0,-1},{8412,6,1,-1}, +{8415,6,0,-1},{8416,6,1,-1},{8419,6,0,-1},{8420,6,1,-1},{8424,6,0,-1}, +{8425,6,1,-1},{8428,6,0,-1},{8432,6,0,-1},{8433,6,1,-1},{8437,6,0,-1}, +{8441,6,0,-1},{8442,6,1,-1},{8445,6,0,-1},{8450,6,0,-1},{8451,6,1,-1}, +{8454,6,0,-1},{8458,6,0,-1},{8459,6,1,-1},{8463,6,0,-1},{8467,6,0,-1}, +{8468,6,1,-1},{8471,6,0,-1},{8476,6,0,-1},{8477,6,1,-1},{8410,6,0,-1}, +{8480,6,0,-1},{8484,6,0,-1},{8485,6,1,-1},{8489,6,0,-1},{8490,6,1,-1}, +{8423,6,1,-1},{8493,6,0,-1},{8494,6,1,-1},{8497,6,0,-1},{8498,6,1,-1}, +{8502,6,0,-1},{8503,6,1,-1},{8506,6,0,-1},{8507,6,1,-1},{8510,6,0,-1}, +{8511,6,1,-1},{8515,6,0,-1},{8519,6,0,-1},{8520,6,1,-1},{8523,6,0,-1}, +{8524,6,1,-1},{8528,6,0,-1},{8529,6,1,-1},{8532,6,0,-1},{8533,6,1,-1}, +{8536,6,0,-1},{8537,6,1,-1},{8541,6,0,-1},{8542,6,1,-1},{8545,6,0,-1}, +{8546,6,1,-1},{8549,6,0,-1},{8550,6,1,-1},{8554,6,0,-1},{8555,6,1,-1}, +{8558,6,0,-1},{8559,6,1,-1},{8562,6,0,-1},{8563,6,1,-1},{8567,6,0,-1}, +{8568,6,1,-1},{8571,6,0,-1},{8572,6,1,-1},{8575,6,0,-1},{8576,6,1,-1}, +{8580,6,0,-1},{8581,6,1,-1},{8514,6,0,-1},{8584,6,0,-1},{8585,6,1,-1}, +{8588,6,0,-1},{8589,6,1,-1},{8593,6,0,-1},{8594,6,1,-1},{8527,6,1,-1}, +{8597,6,0,-1},{8598,6,1,-1},{8601,6,0,-1},{8602,6,1,-1},{8606,6,0,-1}, +{8607,6,1,-1},{8610,6,0,-1},{8611,6,1,-1},{8614,6,0,-1},{8615,6,1,-1}, +{8619,6,0,-1},{8620,6,1,-1},{8623,6,0,-1},{8624,6,1,-1},{8627,6,0,-1}, +{8628,6,1,-1},{8632,6,0,-1},{8633,6,1,-1},{8636,6,0,-1},{8637,6,1,-1}, +{8640,6,0,-1},{8641,6,1,-1},{8645,6,0,-1},{8646,6,1,-1},{8649,6,0,-1}, +{8650,6,1,-1},{8653,6,0,-1},{8654,6,1,-1},{8658,6,0,-1},{8659,6,1,-1}, +{8662,6,0,-1},{8663,6,1,-1},{8666,6,0,-1},{8667,6,1,-1},{8671,6,0,-1}, +{8672,6,1,-1},{8675,6,0,-1},{8676,6,1,-1},{8679,6,0,-1},{8680,6,1,-1}, +{8684,6,0,-1},{8685,6,1,-1},{8618,6,0,-1},{8688,6,0,-1},{8689,6,1,-1}, +{8692,6,0,-1},{8693,6,1,-1},{8697,6,0,-1},{8698,6,1,-1},{8631,6,1,-1}, +{8701,6,0,-1},{8702,6,1,-1},{8705,6,0,-1},{8706,6,1,-1},{8710,6,0,-1}, +{8711,6,1,-1},{8714,6,0,-1},{8715,6,1,-1},{8718,6,0,-1},{8719,6,1,-1}, +{8723,6,0,-1},{8724,6,1,-1},{8727,6,0,-1},{8728,6,1,-1},{8731,6,0,-1}, +{8732,6,1,-1},{8736,6,0,-1},{8737,6,1,-1},{8740,6,0,-1},{8741,6,1,-1}, +{8744,6,0,-1},{8745,6,1,-1},{8749,6,0,-1},{8750,6,1,-1},{8753,6,0,-1}, +{8754,6,1,-1},{8757,6,0,-1},{8758,6,1,-1},{8762,6,0,-1},{8763,6,1,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8771,6,1,-1},{8775,6,0,-1},{8776,6,1,-1}, +{8779,6,0,-1},{8780,6,1,-1},{8783,6,0,-1},{8784,6,1,-1},{8788,6,0,-1}, +{8789,6,1,-1},{8722,6,0,-1},{8792,6,0,-1},{8793,6,1,-1},{8796,6,0,-1}, +{8797,6,1,-1},{8801,6,0,-1},{8802,6,1,-1},{8735,6,1,-1},{8805,6,0,-1}, +{8806,6,1,-1},{8810,6,1,-1},{8814,6,0,-1},{8815,6,1,-1},{8818,6,0,-1}, +{8822,6,0,-1},{8823,6,1,-1},{8827,6,0,-1},{8828,6,1,-1},{8831,6,0,-1}, +{8832,6,1,-1},{8835,6,0,-1},{8836,6,1,-1},{8840,6,0,-1},{8841,6,1,-1}, +{8844,6,0,-1},{8845,6,1,-1},{8848,6,0,-1},{8849,6,1,-1},{8853,6,0,-1}, +{8854,6,1,-1},{8857,6,0,-1},{8858,6,1,-1},{8861,6,0,-1},{8862,6,1,-1}, +{8866,6,0,-1},{8867,6,1,-1},{8870,6,0,-1},{8871,6,1,-1},{8874,6,0,-1}, +{8875,6,1,-1},{8879,6,0,-1},{8880,6,1,-1},{8883,6,0,-1},{8884,6,1,-1}, +{8887,6,0,-1},{8888,6,1,-1},{8892,6,0,-1},{8893,6,1,-1},{8826,6,0,-1}, +{8896,6,0,-1},{8897,6,1,-1},{8900,6,0,-1},{8901,6,1,-1},{8905,6,0,-1}, +{8906,6,1,-1},{8839,6,1,-1},{8909,6,0,-1},{8910,6,1,-1},{8913,6,0,-1}, +{8914,6,1,-1},{8918,6,0,-1},{8919,6,1,-1},{8922,6,0,-1},{8923,6,1,-1}, +{8926,6,0,-1},{8927,6,1,-1},{8931,6,0,-1},{8932,6,1,-1},{8935,6,0,-1}, +{8936,6,1,-1},{8939,6,0,-1},{8940,6,1,-1},{8944,6,0,-1},{8945,6,1,-1}, +{8948,6,0,-1},{8949,6,1,-1},{8952,6,0,-1},{8953,6,1,-1},{8957,6,0,-1}, +{8958,6,1,-1},{8961,6,0,-1},{8962,6,1,-1},{8965,6,0,-1},{8966,6,1,-1}, +{8970,6,0,-1},{8971,6,1,-1},{8974,6,0,-1},{8975,6,1,-1},{8978,6,0,-1}, +{8979,6,1,-1},{8983,6,0,-1},{8984,6,1,-1},{8987,6,0,-1},{8988,6,1,-1}, +{8991,6,0,-1},{8992,6,1,-1},{8996,6,0,-1},{8997,6,1,-1},{8930,6,0,-1}, +{9000,6,0,-1},{9001,6,1,-1},{9004,6,0,-1},{9005,6,1,-1},{9009,6,0,-1}, +{9010,6,1,-1},{8943,6,1,-1},{9013,6,0,-1},{9014,6,1,-1},{9017,6,0,-1}, +{9018,6,1,-1},{9022,6,0,-1},{9023,6,1,-1},{9026,6,0,-1},{9027,6,1,-1}, +{9030,6,0,-1},{9031,6,1,-1},{9035,6,0,-1},{9036,6,1,-1},{9039,6,0,-1}, +{9040,6,1,-1},{9043,6,0,-1},{9044,6,1,-1},{9048,6,0,-1},{9049,6,1,-1}, +{9052,6,0,-1},{9053,6,1,-1},{9056,6,0,-1},{9057,6,1,-1},{9061,6,0,-1}, +{9062,6,1,-1},{9065,6,0,-1},{9066,6,1,-1},{9069,6,0,-1},{9070,6,1,-1}, +{9074,6,0,-1},{9075,6,1,-1},{9078,6,0,-1},{9079,6,1,-1},{9082,6,0,-1}, +{9083,6,1,-1},{9087,6,0,-1},{9088,6,1,-1},{9091,6,0,-1},{9092,6,1,-1}, +{9095,6,0,-1},{9096,6,1,-1},{9100,6,0,-1},{9101,6,1,-1},{9034,6,0,-1}, +{9104,6,0,-1},{9105,6,1,-1},{9108,6,0,-1},{9109,6,1,-1},{9113,6,0,-1}, +{9114,6,1,-1},{9047,6,1,-1},{9117,6,0,-1},{9118,6,1,-1},{9121,6,0,-1}, +{9122,6,1,-1},{9126,6,0,-1},{9127,6,1,-1},{9130,6,0,-1},{9131,6,1,-1}, +{9134,6,0,-1},{9135,6,1,-1},{9139,6,0,-1},{9140,6,1,-1},{9143,6,0,-1}, +{9144,6,1,-1},{9147,6,0,-1},{9148,6,1,-1},{9152,6,0,-1},{9153,6,1,-1}, +{9156,6,0,-1},{9157,6,1,-1},{9160,6,0,-1},{9161,6,1,-1},{9165,6,0,-1}, +{9166,6,1,-1},{9169,6,0,-1},{9170,6,1,-1},{9173,6,0,-1},{9174,6,1,-1}, +{9178,6,0,-1},{9179,6,1,-1},{9182,6,0,-1},{9183,6,1,-1},{9186,6,0,-1}, +{9187,6,1,-1},{9191,6,0,-1},{9192,6,1,-1},{9195,6,0,-1},{9196,6,1,-1}, +{9199,6,0,-1},{9200,6,1,-1},{9204,6,0,-1},{9205,6,1,-1},{9138,6,0,-1}, +{9208,6,0,-1},{9209,6,1,-1},{9212,6,0,-1},{9213,6,1,-1},{9217,6,0,-1}, +{9218,6,1,-1},{9151,6,1,-1},{9221,6,0,-1},{9222,6,1,-1},{9225,6,0,-1}, +{9226,6,1,-1},{9230,6,0,-1},{9231,6,1,-1},{9234,6,0,-1},{9235,6,1,-1}, +{9238,6,0,-1},{9239,6,1,-1},{9243,6,0,-1},{9244,6,1,-1},{9247,6,0,-1}, +{9248,6,1,-1},{9251,6,0,-1},{9252,6,1,-1},{9256,6,0,-1},{9257,6,1,-1}, +{9260,6,0,-1},{9261,6,1,-1},{9264,6,0,-1},{9265,6,1,-1},{9269,6,0,-1}, +{9270,6,1,-1},{9273,6,0,-1},{9274,6,1,-1},{9277,6,0,-1},{9278,6,1,-1}, +{9282,6,0,-1},{9283,6,1,-1},{9286,6,0,-1},{9287,6,1,-1},{9290,6,0,-1}, +{9291,6,1,-1},{9295,6,0,-1},{9296,6,1,-1},{9299,6,0,-1},{9300,6,1,-1}, +{9303,6,0,-1},{9304,6,1,-1},{9308,6,0,-1},{9309,6,1,-1},{9242,6,0,-1}, +{9312,6,0,-1},{9313,6,1,-1},{9316,6,0,-1},{9317,6,1,-1},{9321,6,0,-1}, +{9322,6,1,-1},{9255,6,1,-1},{9325,6,0,-1},{9326,6,1,-1},{9329,6,0,-1}, +{9330,6,1,-1},{9334,6,0,-1},{9335,6,1,-1},{9338,6,0,-1},{9339,6,1,-1}, +{9342,6,0,-1},{9343,6,1,-1},{9347,6,0,-1},{9348,6,1,-1},{9351,6,0,-1}, +{9352,6,1,-1},{9355,6,0,-1},{9356,6,1,-1},{9360,6,0,-1},{9361,6,1,-1}, +{9364,6,0,-1},{9365,6,1,-1},{9368,6,0,-1},{9369,6,1,-1},{9373,6,0,-1}, +{9374,6,1,-1},{9377,6,0,-1},{9378,6,1,-1},{9381,6,0,-1},{9382,6,1,-1}, +{9386,6,0,-1},{9387,6,1,-1},{9390,6,0,-1},{9391,6,1,-1},{9394,6,0,-1}, +{9395,6,1,-1},{9399,6,0,-1},{9400,6,1,-1},{9403,6,0,-1},{9404,6,1,-1}, +{9407,6,0,-1},{9408,6,1,-1},{9412,6,0,-1},{9413,6,1,-1},{9346,6,0,-1}, +{9416,6,0,-1},{9417,6,1,-1},{9420,6,0,-1},{9421,6,1,-1},{9425,6,0,-1}, +{9426,6,1,-1},{9359,6,1,-1},{9429,6,0,-1},{9430,6,1,-1},{9433,6,0,-1}, +{9434,6,1,-1},{9438,6,0,-1},{9439,6,1,-1},{9442,6,0,-1},{9443,6,1,-1}, +{9446,6,0,-1},{9447,6,1,-1},{9451,6,0,-1},{9452,6,1,-1},{9455,6,0,-1}, +{9456,6,1,-1},{9459,6,0,-1},{9460,6,1,-1},{9464,6,0,-1},{9465,6,1,-1}, +{9468,6,0,-1},{9469,6,1,-1},{9472,6,0,-1},{9473,6,1,-1},{9477,6,0,-1}, +{9478,6,1,-1},{9481,6,0,-1},{9482,6,1,-1},{9485,6,0,-1},{9486,6,1,-1}, +{9490,6,0,-1},{9491,6,1,-1},{9494,6,0,-1},{9495,6,1,-1},{9498,6,0,-1}, +{9499,6,1,-1},{9503,6,0,-1},{9504,6,1,-1},{9507,6,0,-1},{9508,6,1,-1}, +{9511,6,0,-1},{9512,6,1,-1},{9516,6,0,-1},{9517,6,1,-1},{9450,6,0,-1}, +{9520,6,0,-1},{9521,6,1,-1},{9524,6,0,-1},{9525,6,1,-1},{9529,6,0,-1}, +{9530,6,1,-1},{9463,6,1,-1},{9533,6,0,-1},{9534,6,1,-1},{9537,6,0,-1}, +{9538,6,1,-1},{9542,6,0,-1},{9543,6,1,-1},{9546,6,0,-1},{9547,6,1,-1}, +{9550,6,0,-1},{9551,6,1,-1},{9555,6,0,-1},{9556,6,1,-1},{9559,6,0,-1}, +{9560,6,1,-1},{9563,6,0,-1},{9564,6,1,-1},{9568,6,0,-1},{9569,6,1,-1}, +{9572,6,0,-1},{9573,6,1,-1},{9576,6,0,-1},{9577,6,1,-1},{9581,6,0,-1}, +{9582,6,1,-1},{9585,6,0,-1},{9586,6,1,-1},{9589,6,0,-1},{9590,6,1,-1}, +{9594,6,0,-1},{9595,6,1,-1},{9598,6,0,-1},{9599,6,1,-1},{9602,6,0,-1}, +{9603,6,1,-1},{9607,6,0,-1},{9608,6,1,-1},{9611,6,0,-1},{9612,6,1,-1}, +{9615,6,0,-1},{9616,6,1,-1},{9620,6,0,-1},{9621,6,1,-1},{9554,6,0,-1}, +{9624,6,0,-1},{9625,6,1,-1},{9628,6,0,-1},{9629,6,1,-1},{9633,6,0,-1}, +{9634,6,1,-1},{9567,6,1,-1},{9637,6,0,-1},{9638,6,1,-1},{9641,6,0,-1}, +{9642,6,1,-1},{9646,6,0,-1},{9647,6,1,-1},{9650,6,0,-1},{9651,6,1,-1}, +{9654,6,0,-1},{9655,6,1,-1},{9659,6,0,-1},{9660,6,1,-1},{9663,6,0,-1}, +{9664,6,1,-1},{9667,6,0,-1},{9668,6,1,-1},{9672,6,0,-1},{9673,6,1,-1}, +{9676,6,0,-1},{9677,6,1,-1},{9680,6,0,-1},{9681,6,1,-1},{9685,6,0,-1}, +{9686,6,1,-1},{9689,6,0,-1},{9690,6,1,-1},{9693,6,0,-1},{9694,6,1,-1}, +{9698,6,0,-1},{9699,6,1,-1},{9702,6,0,-1},{9703,6,1,-1},{9706,6,0,-1}, +{9707,6,1,-1},{9711,6,0,-1},{9712,6,1,-1},{9715,6,0,-1},{9716,6,1,-1}, +{9719,6,0,-1},{9720,6,1,-1},{9724,6,0,-1},{9725,6,1,-1},{9658,6,0,-1}, +{9728,6,0,-1},{9729,6,1,-1},{9732,6,0,-1},{9733,6,1,-1},{9737,6,0,-1}, +{9738,6,1,-1},{9671,6,1,-1},{9741,6,0,-1},{9742,6,1,-1},{9745,6,0,-1}, +{9746,6,1,-1},{9750,6,0,-1},{9751,6,1,-1},{9754,6,0,-1},{9755,6,1,-1}, +{9758,6,0,-1},{9759,6,1,-1},{9763,6,0,-1},{9764,6,1,-1},{9767,6,0,-1}, +{9768,6,1,-1},{9771,6,0,-1},{9772,6,1,-1},{9776,6,0,-1},{9777,6,1,-1}, +{9780,6,0,-1},{9781,6,1,-1},{9784,6,0,-1},{9785,6,1,-1},{9789,6,0,-1}, +{9790,6,1,-1},{9793,6,0,-1},{9794,6,1,-1},{9797,6,0,-1},{9798,6,1,-1}, +{9802,6,0,-1},{9803,6,1,-1},{9806,6,0,-1},{9807,6,1,-1},{9810,6,0,-1}, +{9811,6,1,-1},{9815,6,0,-1},{9816,6,1,-1},{9819,6,0,-1},{9820,6,1,-1}, +{9823,6,0,-1},{9824,6,1,-1},{9828,6,0,-1},{9829,6,1,-1},{9762,6,0,-1}, +{9832,6,0,-1},{9833,6,1,-1},{9836,6,0,-1},{9837,6,1,-1},{9841,6,0,-1}, +{9842,6,1,-1},{9775,6,1,-1},{9845,6,0,-1},{9846,6,1,-1},{9849,6,0,-1}, +{9850,6,1,-1},{9854,6,0,-1},{9855,6,1,-1},{9858,6,0,-1},{9859,6,1,-1}, +{9862,6,0,-1},{9863,6,1,-1},{9867,6,0,-1},{9868,6,1,-1},{9871,6,0,-1}, +{9872,6,1,-1},{9875,6,0,-1},{9876,6,1,-1},{9880,6,0,-1},{9881,6,1,-1}, +{9884,6,0,-1},{9885,6,1,-1},{9888,6,0,-1},{9889,6,1,-1},{9893,6,0,-1}, +{9894,6,1,-1},{9897,6,0,-1},{9898,6,1,-1},{9901,6,0,-1},{9902,6,1,-1}, +{9906,6,0,-1},{9907,6,1,-1},{9910,6,0,-1},{9911,6,1,-1},{9914,6,0,-1}, +{9915,6,1,-1},{9919,6,0,-1},{9920,6,1,-1},{9923,6,0,-1},{9924,6,1,-1}, +{9927,6,0,-1},{9928,6,1,-1},{9932,6,0,-1},{9933,6,1,-1},{9866,6,0,-1}, +{9936,6,0,-1},{9937,6,1,-1},{9940,6,0,-1},{9941,6,1,-1},{9945,6,0,-1}, +{9946,6,1,-1},{9879,6,1,-1},{9949,6,0,-1},{9950,6,1,-1},{9953,6,0,-1}, +{9954,6,1,-1},{9958,6,0,-1},{9959,6,1,-1},{9962,6,0,-1},{9963,6,1,-1}, +{9966,6,0,-1},{9967,6,1,-1},{9971,6,0,-1},{9972,6,1,-1},{9975,6,0,-1}, +{9976,6,1,-1},{9979,6,0,-1},{9980,6,1,-1},{9984,6,0,-1},{9985,6,1,-1}, +{9988,6,0,-1},{9989,6,1,-1},{9992,6,0,-1},{9993,6,1,-1},{9997,6,0,-1}, +{9998,6,1,-1},{10001,6,0,-1},{10002,6,1,-1},{10005,6,0,-1},{10006,6,1,-1}, +{10010,6,0,-1},{10011,6,1,-1},{10014,6,0,-1},{10015,6,1,-1},{10018,6,0,-1}, +{10019,6,1,-1},{10023,6,0,-1},{10024,6,1,-1},{10027,6,0,-1},{10028,6,1,-1}, +{10031,6,0,-1},{10032,6,1,-1},{10036,6,0,-1},{10037,6,1,-1},{9970,6,0,-1}, +{10040,6,0,-1},{10041,6,1,-1},{10044,6,0,-1},{10045,6,1,-1},{10049,6,0,-1}, +{10050,6,1,-1},{9983,6,1,-1},{10053,6,0,-1},{10054,6,1,-1},{10057,6,0,-1}, +{10058,6,1,-1},{10062,6,0,-1},{10063,6,1,-1},{10066,6,0,-1},{10067,6,1,-1}, +{10070,6,0,-1},{10071,6,1,-1},{10075,6,0,-1},{10076,6,1,-1},{10079,6,0,-1}, +{10080,6,1,-1},{10083,6,0,-1},{10084,6,1,-1},{10088,6,0,-1},{10089,6,1,-1}, +{10092,6,0,-1},{10093,6,1,-1},{10096,6,0,-1},{10097,6,1,-1},{10101,6,0,-1}, +{10102,6,1,-1},{10105,6,0,-1},{10106,6,1,-1},{10109,6,0,-1},{10110,6,1,-1}, +{10114,6,0,-1},{10115,6,1,-1},{10118,6,0,-1},{10119,6,1,-1},{10122,6,0,-1}, +{10123,6,1,-1},{10127,6,0,-1},{10128,6,1,-1},{10131,6,0,-1},{10132,6,1,-1}, +{10135,6,0,-1},{10136,6,1,-1},{10140,6,0,-1},{10141,6,1,-1},{10074,6,0,-1}, +{10144,6,0,-1},{10145,6,1,-1},{10148,6,0,-1},{10149,6,1,-1},{10153,6,0,-1}, +{10154,6,1,-1},{10087,6,1,-1},{10157,6,0,-1},{10158,6,1,-1},{10161,6,0,-1}, +{10162,6,1,-1},{10166,6,0,-1},{10167,6,1,-1},{10170,6,0,-1},{10171,6,1,-1}, +{10174,6,0,-1},{10175,6,1,-1},{10179,6,0,-1},{10180,6,1,-1},{10183,6,0,-1}, +{10184,6,1,-1},{10187,6,0,-1},{10188,6,1,-1},{10192,6,0,-1},{10193,6,1,-1}, +{10196,6,0,-1},{10197,6,1,-1},{10200,6,0,-1},{10201,6,1,-1},{10205,6,0,-1}, +{10206,6,1,-1},{10209,6,0,-1},{10210,6,1,-1},{10213,6,0,-1},{10214,6,1,-1}, +{10218,6,0,-1},{10219,6,1,-1},{10222,6,0,-1},{10223,6,1,-1},{10226,6,0,-1}, +{10227,6,1,-1},{10231,6,0,-1},{10232,6,1,-1},{10235,6,0,-1},{10236,6,1,-1}, +{10239,6,0,-1},{10240,6,1,-1},{10244,6,0,-1},{10245,6,1,-1},{10178,6,0,-1}, +{10248,6,0,-1},{10249,6,1,-1},{10252,6,0,-1},{10253,6,1,-1},{10257,6,0,-1}, +{10258,6,1,-1},{10191,6,1,-1},{10261,6,0,-1},{10262,6,1,-1},{10265,6,0,-1}, +{10266,6,1,-1},{10270,6,0,-1},{10271,6,1,-1},{10274,6,0,-1},{10275,6,1,-1}, +{10278,6,0,-1},{10279,6,1,-1},{10283,6,0,-1},{10284,6,1,-1},{10287,6,0,-1}, +{10288,6,1,-1},{10291,6,0,-1},{10292,6,1,-1},{10296,6,0,-1},{10297,6,1,-1}, +{10300,6,0,-1},{10301,6,1,-1},{10304,6,0,-1},{10305,6,1,-1},{10309,6,0,-1}, +{10310,6,1,-1},{10313,6,0,-1},{10314,6,1,-1},{10317,6,0,-1},{10318,6,1,-1}, +{10322,6,0,-1},{10323,6,1,-1},{10326,6,0,-1},{10327,6,1,-1},{10330,6,0,-1}, +{10331,6,1,-1},{10335,6,0,-1},{10336,6,1,-1},{10339,6,0,-1},{10340,6,1,-1}, +{10343,6,0,-1},{10344,6,1,-1},{10348,6,0,-1},{10349,6,1,-1},{10282,6,0,-1}, +{10352,6,0,-1},{10353,6,1,-1},{10356,6,0,-1},{10357,6,1,-1},{10361,6,0,-1}, +{10362,6,1,-1},{10295,6,1,-1},{10365,6,0,-1},{10366,6,1,-1},{10369,6,0,-1}, +{10370,6,1,-1},{10374,6,0,-1},{10375,6,1,-1},{10378,6,0,-1},{10379,6,1,-1}, +{10382,6,0,-1},{10383,6,1,-1},{10387,6,0,-1},{10388,6,1,-1},{10391,6,0,-1}, +{10392,6,1,-1},{10395,6,0,-1},{10396,6,1,-1},{10400,6,0,-1},{10401,6,1,-1}, +{10404,6,0,-1},{10405,6,1,-1},{10408,6,0,-1},{10409,6,1,-1},{10413,6,0,-1}, +{10414,6,1,-1},{10417,6,0,-1},{10418,6,1,-1},{10421,6,0,-1},{10422,6,1,-1}, +{10426,6,0,-1},{10427,6,1,-1},{10430,6,0,-1},{10431,6,1,-1},{10434,6,0,-1}, +{10435,6,1,-1},{10439,6,0,-1},{10440,6,1,-1},{10443,6,0,-1},{10444,6,1,-1}, +{10447,6,0,-1},{10448,6,1,-1},{10452,6,0,-1},{10453,6,1,-1},{10386,6,0,-1}, +{10456,6,0,-1},{10457,6,1,-1},{10460,6,0,-1},{10461,6,1,-1},{10465,6,0,-1}, +{10466,6,1,-1},{10399,6,1,-1},{10469,6,0,-1},{10470,6,1,-1},{10473,6,0,-1}, +{10474,6,1,-1},{10478,6,0,-1},{10479,6,1,-1},{10482,6,0,-1},{10483,6,1,-1}, +{10486,6,0,-1},{10487,6,1,-1},{10491,6,0,-1},{10492,6,1,-1},{10495,6,0,-1}, +{10496,6,1,-1},{10499,6,0,-1},{10500,6,1,-1},{10504,6,0,-1},{10505,6,1,-1}, +{10508,6,0,-1},{10509,6,1,-1},{10512,6,0,-1},{10513,6,1,-1},{10517,6,0,-1}, +{10518,6,1,-1},{10521,6,0,-1},{10522,6,1,-1},{10525,6,0,-1},{10526,6,1,-1}, +{10530,6,0,-1},{10531,6,1,-1},{10534,6,0,-1},{10535,6,1,-1},{10538,6,0,-1}, +{10539,6,1,-1},{10543,6,0,-1},{10544,6,1,-1},{10547,6,0,-1},{10548,6,1,-1}, +{10551,6,0,-1},{10552,6,1,-1},{10556,6,0,-1},{10557,6,1,-1},{10490,6,0,-1}, +{10560,6,0,-1},{10561,6,1,-1},{10564,6,0,-1},{10565,6,1,-1},{10569,6,0,-1}, +{10570,6,1,-1},{10503,6,1,-1},{10573,6,0,-1},{10574,6,1,-1},{10577,6,0,-1}, +{10578,6,1,-1},{10582,6,0,-1},{10583,6,1,-1},{10586,6,0,-1},{10587,6,1,-1}, +{10590,6,0,-1},{10591,6,1,-1},{10595,6,0,-1},{10596,6,1,-1},{10599,6,0,-1}, +{10600,6,1,-1},{10603,6,0,-1},{10604,6,1,-1},{10608,6,0,-1},{10609,6,1,-1}, +{10612,6,0,-1},{10613,6,1,-1},{10616,6,0,-1},{10617,6,1,-1},{10621,6,0,-1}, +{10622,6,1,-1},{10625,6,0,-1},{10626,6,1,-1},{10629,6,0,-1},{10630,6,1,-1}, +{10634,6,0,-1},{10635,6,1,-1},{10638,6,0,-1},{10639,6,1,-1},{10642,6,0,-1}, +{10643,6,1,-1},{10647,6,0,-1},{10648,6,1,-1},{10651,6,0,-1},{10652,6,1,-1}, +{10655,6,0,-1},{10656,6,1,-1},{10660,6,0,-1},{10661,6,1,-1},{10594,6,0,-1}, +{10664,6,0,-1},{10665,6,1,-1},{10668,6,0,-1},{10669,6,1,-1},{10673,6,0,-1}, +{10674,6,1,-1},{10607,6,1,-1},{10677,6,0,-1},{10678,6,1,-1},{10681,6,0,-1}, +{10682,6,1,-1},{10686,6,0,-1},{10687,6,1,-1},{10690,6,0,-1},{10691,6,1,-1}, +{10694,6,0,-1},{10695,6,1,-1},{10699,6,0,-1},{10700,6,1,-1},{10703,6,0,-1}, +{10704,6,1,-1},{10707,6,0,-1},{10708,6,1,-1},{10712,6,0,-1},{10713,6,1,-1}, +{10716,6,0,-1},{10717,6,1,-1},{10720,6,0,-1},{10721,6,1,-1},{10725,6,0,-1}, +{10726,6,1,-1},{10729,6,0,-1},{10730,6,1,-1},{10733,6,0,-1},{10734,6,1,-1}, +{10738,6,0,-1},{10739,6,1,-1},{10742,6,0,-1},{10743,6,1,-1},{10746,6,0,-1}, +{10747,6,1,-1},{10751,6,0,-1},{10752,6,1,-1},{10755,6,0,-1},{10756,6,1,-1}, +{10759,6,0,-1},{10760,6,1,-1},{10764,6,0,-1},{10765,6,1,-1},{10698,6,0,-1}, +{10768,6,0,-1},{10769,6,1,-1},{10772,6,0,-1},{10773,6,1,-1},{10777,6,0,-1}, +{10778,6,1,-1},{10711,6,1,-1},{10781,6,0,-1},{10782,6,1,-1},{10785,6,0,-1}, +{10786,6,1,-1},{10790,6,0,-1},{10791,6,1,-1},{10794,6,0,-1},{10795,6,1,-1}, +{10798,6,0,-1},{10799,6,1,-1},{10803,6,0,-1},{10804,6,1,-1},{10807,6,0,-1}, +{10808,6,1,-1},{10811,6,0,-1},{10812,6,1,-1},{10816,6,0,-1},{10817,6,1,-1}, +{10820,6,0,-1},{10821,6,1,-1},{10824,6,0,-1},{10825,6,1,-1},{10829,6,0,-1}, +{10830,6,1,-1},{10833,6,0,-1},{10834,6,1,-1},{10837,6,0,-1},{10838,6,1,-1}, +{10842,6,0,-1},{10843,6,1,-1},{10846,6,0,-1},{10847,6,1,-1},{10850,6,0,-1}, +{10851,6,1,-1},{10855,6,0,-1},{10856,6,1,-1},{10859,6,0,-1},{10860,6,1,-1}, +{10863,6,0,-1},{10864,6,1,-1},{10868,6,0,-1},{10869,6,1,-1},{10802,6,0,-1}, +{10872,6,0,-1},{10873,6,1,-1},{10876,6,0,-1},{10877,6,1,-1},{10881,6,0,-1}, +{10882,6,1,-1},{10815,6,1,-1},{10885,6,0,-1},{10886,6,1,-1},{10889,6,0,-1}, +{10890,6,1,-1},{10894,6,0,-1},{10895,6,1,-1},{10898,6,0,-1},{10899,6,1,-1}, +{10902,6,0,-1},{10903,6,1,-1},{10907,6,0,-1},{10908,6,1,-1},{10911,6,0,-1}, +{10912,6,1,-1},{10915,6,0,-1},{10916,6,1,-1},{10920,6,0,-1},{10921,6,1,-1}, +{10924,6,0,-1},{10925,6,1,-1},{10928,6,0,-1},{10929,6,1,-1},{10933,6,0,-1}, +{10934,6,1,-1},{10937,6,0,-1},{10938,6,1,-1},{10941,6,0,-1},{10942,6,1,-1}, +{10946,6,0,-1},{10947,6,1,-1},{10950,6,0,-1},{10951,6,1,-1},{10954,6,0,-1}, +{10955,6,1,-1},{10959,6,0,-1},{10960,6,1,-1},{10963,6,0,-1},{10964,6,1,-1}, +{10967,6,0,-1},{10968,6,1,-1},{10972,6,0,-1},{10973,6,1,-1},{10906,6,0,-1}, +{10976,6,0,-1},{10977,6,1,-1},{10980,6,0,-1},{10981,6,1,-1},{10985,6,0,-1}, +{10986,6,1,-1},{10919,6,1,-1},{10989,6,0,-1},{10990,6,1,-1},{10993,6,0,-1}, +{10994,6,1,-1},{10998,6,0,-1},{10999,6,1,-1},{11002,6,0,-1},{11003,6,1,-1}, +{11006,6,0,-1},{11007,6,1,-1},{11011,6,0,-1},{11012,6,1,-1},{11015,6,0,-1}, +{11016,6,1,-1},{11019,6,0,-1},{11020,6,1,-1},{11024,6,0,-1},{11025,6,1,-1}, +{11028,6,0,-1},{11029,6,1,-1},{11032,6,0,-1},{11033,6,1,-1},{11037,6,0,-1}, +{11038,6,1,-1},{11041,6,0,-1},{11042,6,1,-1},{11045,6,0,-1},{11046,6,1,-1}, +{11050,6,0,-1},{11051,6,1,-1},{11054,6,0,-1},{11055,6,1,-1},{11058,6,0,-1}, +{11059,6,1,-1},{11063,6,0,-1},{11064,6,1,-1},{11067,6,0,-1},{11068,6,1,-1}, +{11071,6,0,-1},{11072,6,1,-1},{11076,6,0,-1},{11077,6,1,-1},{11010,6,0,-1}, +{11080,6,0,-1},{11081,6,1,-1},{11084,6,0,-1},{11085,6,1,-1},{11089,6,0,-1}, +{11090,6,1,-1},{11023,6,1,-1},{11093,6,0,-1},{11094,6,1,-1},{11097,6,0,-1}, +{11098,6,1,-1},{11102,6,0,-1},{11103,6,1,-1},{11106,6,0,-1},{11107,6,1,-1}, +{11110,6,0,-1},{11111,6,1,-1},{11115,6,0,-1},{11116,6,1,-1},{11119,6,0,-1}, +{11120,6,1,-1},{11123,6,0,-1},{11124,6,1,-1},{11128,6,0,-1},{11129,6,1,-1}, +{11132,6,0,-1},{11133,6,1,-1},{11136,6,0,-1},{11137,6,1,-1},{11141,6,0,-1}, +{11142,6,1,-1},{11145,6,0,-1},{11146,6,1,-1},{11149,6,0,-1},{11150,6,1,-1}, +{11154,6,0,-1},{11155,6,1,-1},{11158,6,0,-1},{11159,6,1,-1},{11162,6,0,-1}, +{11163,6,1,-1},{11167,6,0,-1},{11168,6,1,-1},{11171,6,0,-1},{11172,6,1,-1}, +{11175,6,0,-1},{11176,6,1,-1},{11180,6,0,-1},{11181,6,1,-1},{11114,6,0,-1}, +{11184,6,0,-1},{11185,6,1,-1},{11188,6,0,-1},{11189,6,1,-1},{11193,6,0,-1}, +{11194,6,1,-1},{11127,6,1,-1},{11197,6,0,-1},{11198,6,1,-1},{11201,6,0,-1}, +{11202,6,1,-1},{11206,6,0,-1},{11207,6,1,-1},{11210,6,0,-1},{11211,6,1,-1}, +{11214,6,0,-1},{11215,6,1,-1},{11219,6,0,-1},{11220,6,1,-1},{11223,6,0,-1}, +{11224,6,1,-1},{11227,6,0,-1},{11228,6,1,-1},{11232,6,0,-1},{11233,6,1,-1}, +{11236,6,0,-1},{11237,6,1,-1},{11240,6,0,-1},{11241,6,1,-1},{11245,6,0,-1}, +{11246,6,1,-1},{11249,6,0,-1},{11250,6,1,-1},{11253,6,0,-1},{11254,6,1,-1}, +{11258,6,0,-1},{11259,6,1,-1},{11262,6,0,-1},{11263,6,1,-1},{11266,6,0,-1}, +{11267,6,1,-1},{11271,6,0,-1},{11272,6,1,-1},{11275,6,0,-1},{11276,6,1,-1}, +{11279,6,0,-1},{11280,6,1,-1},{11284,6,0,-1},{11285,6,1,-1},{11218,6,0,-1}, +{11288,6,0,-1},{11289,6,1,-1},{11292,6,0,-1},{11293,6,1,-1},{11297,6,0,-1}, +{11298,6,1,-1},{11231,6,1,-1},{11301,6,0,-1},{11302,6,1,-1},{11305,6,0,-1}, +{11306,6,1,-1},{11310,6,0,-1},{11311,6,1,-1},{11314,6,0,-1},{11315,6,1,-1}, +{11318,6,0,-1},{11319,6,1,-1},{11323,6,0,-1},{11324,6,1,-1},{11327,6,0,-1}, +{11328,6,1,-1},{11331,6,0,-1},{11332,6,1,-1},{11336,6,0,-1},{11337,6,1,-1}, +{11340,6,0,-1},{11341,6,1,-1},{11344,6,0,-1},{11345,6,1,-1},{11349,6,0,-1}, +{11350,6,1,-1},{11353,6,0,-1},{11354,6,1,-1},{11357,6,0,-1},{11358,6,1,-1}, +{11362,6,0,-1},{11363,6,1,-1},{11366,6,0,-1},{11367,6,1,-1},{11370,6,0,-1}, +{11371,6,1,-1},{11375,6,0,-1},{11376,6,1,-1},{11379,6,0,-1},{11380,6,1,-1}, +{11383,6,0,-1},{11384,6,1,-1},{11388,6,0,-1},{11389,6,1,-1},{11322,6,0,-1}, +{11392,6,0,-1},{11393,6,1,-1},{11396,6,0,-1},{11397,6,1,-1},{11401,6,0,-1}, +{11402,6,1,-1},{11335,6,1,-1},{11405,6,0,-1},{11406,6,1,-1},{11409,6,0,-1}, +{11410,6,1,-1},{11414,6,0,-1},{11415,6,1,-1},{11418,6,0,-1},{11419,6,1,-1}, +{11422,6,0,-1},{11423,6,1,-1},{11427,6,0,-1},{11428,6,1,-1},{11431,6,0,-1}, +{11432,6,1,-1},{11435,6,0,-1},{11436,6,1,-1},{11440,6,0,-1},{11441,6,1,-1}, +{11444,6,0,-1},{11445,6,1,-1},{11448,6,0,-1},{11449,6,1,-1},{11453,6,0,-1}, +{11454,6,1,-1},{11457,6,0,-1},{11458,6,1,-1},{11461,6,0,-1},{11462,6,1,-1}, +{11466,6,0,-1},{11467,6,1,-1},{11470,6,0,-1},{11471,6,1,-1},{11474,6,0,-1}, +{11475,6,1,-1},{11479,6,0,-1},{11480,6,1,-1},{11483,6,0,-1},{11484,6,1,-1}, +{11487,6,0,-1},{11488,6,1,-1},{11492,6,0,-1},{11493,6,1,-1},{11426,6,0,-1}, +{11496,6,0,-1},{11497,6,1,-1},{11500,6,0,-1},{11501,6,1,-1},{11505,6,0,-1}, +{11506,6,1,-1},{11439,6,1,-1},{11509,6,0,-1},{11510,6,1,-1},{11513,6,0,-1}, +{11514,6,1,-1},{11518,6,0,-1},{11519,6,1,-1},{11522,6,0,-1},{11523,6,1,-1}, +{11526,6,0,-1},{11527,6,1,-1},{11531,6,0,-1},{11532,6,1,-1},{11535,6,0,-1}, +{11536,6,1,-1},{11539,6,0,-1},{11540,6,1,-1},{11544,6,0,-1},{11545,6,1,-1}, +{11548,6,0,-1},{11549,6,1,-1},{11552,6,0,-1},{11553,6,1,-1},{11557,6,0,-1}, +{11558,6,1,-1},{11561,6,0,-1},{11562,6,1,-1},{11565,6,0,-1},{11566,6,1,-1}, +{11570,6,0,-1},{11571,6,1,-1},{11574,6,0,-1},{11575,6,1,-1},{11578,6,0,-1}, +{11579,6,1,-1},{11583,6,0,-1},{11584,6,1,-1},{11587,6,0,-1},{11588,6,1,-1}, +{11591,6,0,-1},{11592,6,1,-1},{11596,6,0,-1},{11597,6,1,-1},{11530,6,0,-1}, +{11600,6,0,-1},{11601,6,1,-1},{11604,6,0,-1},{11605,6,1,-1},{11609,6,0,-1}, +{11610,6,1,-1},{11543,6,1,-1},{11613,6,0,-1},{11614,6,1,-1},{11617,6,0,-1}, +{11622,6,0,-1},{11623,6,1,-1},{11626,6,0,-1},{11627,6,1,-1},{11630,6,0,-1}, +{11631,6,1,-1},{11635,6,0,-1},{11636,6,1,-1},{11639,6,0,-1},{11640,6,1,-1}, +{11643,6,0,-1},{11644,6,1,-1},{11648,6,0,-1},{11649,6,1,-1},{11652,6,0,-1}, +{11653,6,1,-1},{11656,6,0,-1},{11657,6,1,-1},{11661,6,0,-1},{11662,6,1,-1}, +{11665,6,0,-1},{11666,6,1,-1},{11674,6,0,-1},{11675,6,1,-1},{11678,6,0,-1}, +{11679,6,1,-1},{11682,6,0,-1},{11683,6,1,-1},{11687,6,0,-1},{11688,6,1,-1}, +{11691,6,0,-1},{11692,6,1,-1},{11695,6,0,-1},{11696,6,1,-1},{11700,6,0,-1}, +{11701,6,1,-1},{11704,6,0,-1},{11705,6,1,-1},{11708,6,0,-1},{11709,6,1,-1}, +{11713,6,0,-1},{11717,6,0,-1},{11726,6,0,-1},{11730,6,0,-1},{11734,6,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS7, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_7_ss0_ss1[] = { +{11752,7,0,-1},{11760,7,0,-1},{11769,7,0,-1},{11778,7,0,-1},{11786,7,0,-1}, +{11795,7,0,-1},{11799,7,0,-1},{11804,7,0,-1},{11738,7,0,-1},{11808,7,0,-1}, +{11812,7,0,-1},{11817,7,0,-1},{11821,7,0,-1},{11825,7,0,-1},{11830,7,0,-1}, +{11834,7,0,-1},{11838,7,0,-1},{11843,7,0,-1},{11847,7,0,-1},{11851,7,0,-1}, +{11856,7,0,-1},{11860,7,0,-1},{11864,7,0,-1},{11869,7,0,-1},{11873,7,0,-1}, +{11877,7,0,-1},{11882,7,0,-1},{11886,7,0,-1},{11890,7,0,-1},{11895,7,0,-1}, +{11899,7,0,-1},{11903,7,0,-1},{11908,7,0,-1},{11842,7,0,-1},{11912,7,0,-1}, +{11916,7,0,-1},{11921,7,0,-1},{11925,7,0,-1},{11929,7,0,-1},{11934,7,0,-1}, +{11938,7,0,-1},{11942,7,0,-1},{11947,7,0,-1},{11951,7,0,-1},{11955,7,0,-1}, +{11960,7,0,-1},{11964,7,0,-1},{11968,7,0,-1},{11973,7,0,-1},{11977,7,0,-1}, +{11981,7,0,-1},{11986,7,0,-1},{11990,7,0,-1},{11994,7,0,-1},{11999,7,0,-1}, +{12003,7,0,-1},{12007,7,0,-1},{12012,7,0,-1},{11946,7,0,-1},{12016,7,0,-1}, +{12020,7,0,-1},{12025,7,0,-1},{12026,7,1,-1},{12029,7,0,-1},{12033,7,0,-1}, +{12034,7,1,-1},{12038,7,0,-1},{12042,7,0,-1},{12046,7,0,-1},{12047,7,1,-1}, +{12051,7,0,-1},{12055,7,0,-1},{12056,7,1,-1},{12059,7,0,-1},{12064,7,0,-1}, +{12065,7,1,-1},{12068,7,0,-1},{12072,7,0,-1},{12073,7,1,-1},{12077,7,0,-1}, +{12081,7,0,-1},{12082,7,1,-1},{12085,7,0,-1},{12090,7,0,-1},{12091,7,1,-1}, +{12094,7,0,-1},{12098,7,0,-1},{12099,7,1,-1},{12103,7,0,-1},{12107,7,0,-1}, +{12108,7,1,-1},{12111,7,0,-1},{12116,7,0,-1},{12117,7,1,-1},{12050,7,0,-1}, +{12120,7,0,-1},{12124,7,0,-1},{12125,7,1,-1},{12129,7,0,-1},{12063,7,1,-1}, +{12133,7,0,-1},{12134,7,1,-1},{12137,7,0,-1},{12142,7,0,-1},{12143,7,1,-1}, +{12146,7,0,-1},{12150,7,0,-1},{12151,7,1,-1},{12155,7,0,-1},{12159,7,0,-1}, +{12160,7,1,-1},{12163,7,0,-1},{12168,7,0,-1},{12169,7,1,-1},{12172,7,0,-1}, +{12176,7,0,-1},{12177,7,1,-1},{12181,7,0,-1},{12185,7,0,-1},{12186,7,1,-1}, +{12189,7,0,-1},{12190,7,1,-1},{12194,7,0,-1},{12195,7,1,-1},{12198,7,0,-1}, +{12199,7,1,-1},{12202,7,0,-1},{12203,7,1,-1},{12207,7,0,-1},{12208,7,1,-1}, +{12211,7,0,-1},{12212,7,1,-1},{12215,7,0,-1},{12220,7,0,-1},{12221,7,1,-1}, +{12154,7,0,-1},{12224,7,0,-1},{12225,7,1,-1},{12228,7,0,-1},{12229,7,1,-1}, +{12233,7,0,-1},{12234,7,1,-1},{12167,7,1,-1},{12237,7,0,-1},{12238,7,1,-1}, +{12241,7,0,-1},{12242,7,1,-1},{12246,7,0,-1},{12247,7,1,-1},{12250,7,0,-1}, +{12251,7,1,-1},{12254,7,0,-1},{12255,7,1,-1},{12260,7,1,-1},{12263,7,0,-1}, +{12264,7,1,-1},{12267,7,0,-1},{12268,7,1,-1},{12272,7,0,-1},{12273,7,1,-1}, +{12276,7,0,-1},{12277,7,1,-1},{12280,7,0,-1},{12281,7,1,-1},{12285,7,0,-1}, +{12286,7,1,-1},{12289,7,0,-1},{12290,7,1,-1},{12293,7,0,-1},{12294,7,1,-1}, +{12298,7,0,-1},{12299,7,1,-1},{12302,7,0,-1},{12303,7,1,-1},{12306,7,0,-1}, +{12307,7,1,-1},{12311,7,0,-1},{12312,7,1,-1},{12315,7,0,-1},{12316,7,1,-1}, +{12319,7,0,-1},{12320,7,1,-1},{12324,7,0,-1},{12325,7,1,-1},{12258,7,0,-1}, +{12328,7,0,-1},{12329,7,1,-1},{12332,7,0,-1},{12333,7,1,-1},{12337,7,0,-1}, +{12338,7,1,-1},{12271,7,1,-1},{12341,7,0,-1},{12342,7,1,-1},{12345,7,0,-1}, +{12346,7,1,-1},{12350,7,0,-1},{12351,7,1,-1},{12354,7,0,-1},{12355,7,1,-1}, +{12358,7,0,-1},{12359,7,1,-1},{12363,7,0,-1},{12367,7,0,-1},{12368,7,1,-1}, +{12371,7,0,-1},{12372,7,1,-1},{12376,7,0,-1},{12377,7,1,-1},{12380,7,0,-1}, +{12381,7,1,-1},{12384,7,0,-1},{12385,7,1,-1},{12389,7,0,-1},{12390,7,1,-1}, +{12393,7,0,-1},{12394,7,1,-1},{12397,7,0,-1},{12398,7,1,-1},{12402,7,0,-1}, +{12403,7,1,-1},{12407,7,1,-1},{12410,7,0,-1},{12411,7,1,-1},{12415,7,0,-1}, +{12419,7,0,-1},{12420,7,1,-1},{12423,7,0,-1},{12424,7,1,-1},{12428,7,0,-1}, +{12429,7,1,-1},{12362,7,0,-1},{12432,7,0,-1},{12433,7,1,-1},{12436,7,0,-1}, +{12437,7,1,-1},{12441,7,0,-1},{12442,7,1,-1},{12375,7,1,-1},{12445,7,0,-1}, +{12446,7,1,-1},{12449,7,0,-1},{12450,7,1,-1},{12454,7,0,-1},{12455,7,1,-1}, +{12458,7,0,-1},{12459,7,1,-1},{12462,7,0,-1},{12463,7,1,-1},{12467,7,0,-1}, +{12468,7,1,-1},{12471,7,0,-1},{12472,7,1,-1},{12475,7,0,-1},{12476,7,1,-1}, +{12480,7,0,-1},{12481,7,1,-1},{12484,7,0,-1},{12485,7,1,-1},{12488,7,0,-1}, +{12489,7,1,-1},{12493,7,0,-1},{12494,7,1,-1},{12497,7,0,-1},{12498,7,1,-1}, +{12501,7,0,-1},{12502,7,1,-1},{12506,7,0,-1},{12507,7,1,-1},{12510,7,0,-1}, +{12511,7,1,-1},{12514,7,0,-1},{12515,7,1,-1},{12519,7,0,-1},{12520,7,1,-1}, +{12523,7,0,-1},{12524,7,1,-1},{12527,7,0,-1},{12528,7,1,-1},{12532,7,0,-1}, +{12533,7,1,-1},{12466,7,0,-1},{12536,7,0,-1},{12537,7,1,-1},{12540,7,0,-1}, +{12541,7,1,-1},{12545,7,0,-1},{12546,7,1,-1},{12479,7,1,-1},{12549,7,0,-1}, +{12550,7,1,-1},{12553,7,0,-1},{12554,7,1,-1},{12558,7,0,-1},{12559,7,1,-1}, +{12562,7,0,-1},{12563,7,1,-1},{12566,7,0,-1},{12567,7,1,-1},{12571,7,0,-1}, +{12572,7,1,-1},{12575,7,0,-1},{12576,7,1,-1},{12579,7,0,-1},{12580,7,1,-1}, +{12584,7,0,-1},{12585,7,1,-1},{12588,7,0,-1},{12589,7,1,-1},{12592,7,0,-1}, +{12593,7,1,-1},{12597,7,0,-1},{12598,7,1,-1},{12601,7,0,-1},{12602,7,1,-1}, +{12605,7,0,-1},{12606,7,1,-1},{12610,7,0,-1},{12611,7,1,-1},{12614,7,0,-1}, +{12615,7,1,-1},{12618,7,0,-1},{12619,7,1,-1},{12623,7,0,-1},{12624,7,1,-1}, +{12627,7,0,-1},{12628,7,1,-1},{12631,7,0,-1},{12632,7,1,-1},{12636,7,0,-1}, +{12637,7,1,-1},{12570,7,0,-1},{12640,7,0,-1},{12641,7,1,-1},{12644,7,0,-1}, +{12645,7,1,-1},{12649,7,0,-1},{12650,7,1,-1},{12583,7,1,-1},{12653,7,0,-1}, +{12654,7,1,-1},{12657,7,0,-1},{12658,7,1,-1},{12662,7,0,-1},{12663,7,1,-1}, +{12666,7,0,-1},{12667,7,1,-1},{12670,7,0,-1},{12671,7,1,-1},{12675,7,0,-1}, +{12676,7,1,-1},{12679,7,0,-1},{12680,7,1,-1},{12683,7,0,-1},{12684,7,1,-1}, +{12688,7,0,-1},{12689,7,1,-1},{12692,7,0,-1},{12693,7,1,-1},{12696,7,0,-1}, +{12697,7,1,-1},{12701,7,0,-1},{12702,7,1,-1},{12705,7,0,-1},{12706,7,1,-1}, +{12709,7,0,-1},{12710,7,1,-1},{12714,7,0,-1},{12715,7,1,-1},{12718,7,0,-1}, +{12719,7,1,-1},{12722,7,0,-1},{12723,7,1,-1},{12727,7,0,-1},{12728,7,1,-1}, +{12731,7,0,-1},{12732,7,1,-1},{12735,7,0,-1},{12736,7,1,-1},{12740,7,0,-1}, +{12741,7,1,-1},{12674,7,0,-1},{12744,7,0,-1},{12745,7,1,-1},{12748,7,0,-1}, +{12749,7,1,-1},{12753,7,0,-1},{12754,7,1,-1},{12687,7,1,-1},{12757,7,0,-1}, +{12758,7,1,-1},{12761,7,0,-1},{12762,7,1,-1},{12766,7,0,-1},{12767,7,1,-1}, +{12770,7,0,-1},{12771,7,1,-1},{12774,7,0,-1},{12775,7,1,-1},{12779,7,0,-1}, +{12780,7,1,-1},{12783,7,0,-1},{12784,7,1,-1},{12787,7,0,-1},{12788,7,1,-1}, +{12792,7,0,-1},{12793,7,1,-1},{12796,7,0,-1},{12797,7,1,-1},{12800,7,0,-1}, +{12801,7,1,-1},{12805,7,0,-1},{12806,7,1,-1},{12809,7,0,-1},{12810,7,1,-1}, +{12813,7,0,-1},{12814,7,1,-1},{12818,7,0,-1},{12819,7,1,-1},{12822,7,0,-1}, +{12823,7,1,-1},{12826,7,0,-1},{12827,7,1,-1},{12831,7,0,-1},{12832,7,1,-1}, +{12835,7,0,-1},{12836,7,1,-1},{12839,7,0,-1},{12840,7,1,-1},{12844,7,0,-1}, +{12845,7,1,-1},{12778,7,0,-1},{12848,7,0,-1},{12849,7,1,-1},{12852,7,0,-1}, +{12853,7,1,-1},{12857,7,0,-1},{12858,7,1,-1},{12791,7,1,-1},{12861,7,0,-1}, +{12862,7,1,-1},{12865,7,0,-1},{12866,7,1,-1},{12870,7,0,-1},{12871,7,1,-1}, +{12874,7,0,-1},{12875,7,1,-1},{12878,7,0,-1},{12879,7,1,-1},{12883,7,0,-1}, +{12884,7,1,-1},{12887,7,0,-1},{12888,7,1,-1},{12891,7,0,-1},{12892,7,1,-1}, +{12896,7,0,-1},{12897,7,1,-1},{12900,7,0,-1},{12901,7,1,-1},{12904,7,0,-1}, +{12905,7,1,-1},{12909,7,0,-1},{12910,7,1,-1},{12913,7,0,-1},{12914,7,1,-1}, +{12917,7,0,-1},{12918,7,1,-1},{12922,7,0,-1},{12923,7,1,-1},{12926,7,0,-1}, +{12927,7,1,-1},{12930,7,0,-1},{12931,7,1,-1},{12935,7,0,-1},{12936,7,1,-1}, +{12939,7,0,-1},{12940,7,1,-1},{12943,7,0,-1},{12944,7,1,-1},{12948,7,0,-1}, +{12949,7,1,-1},{12882,7,0,-1},{12952,7,0,-1},{12953,7,1,-1},{12956,7,0,-1}, +{12957,7,1,-1},{12961,7,0,-1},{12962,7,1,-1},{12895,7,1,-1},{12965,7,0,-1}, +{12966,7,1,-1},{12969,7,0,-1},{12970,7,1,-1},{12974,7,0,-1},{12975,7,1,-1}, +{12978,7,0,-1},{12979,7,1,-1},{12982,7,0,-1},{12983,7,1,-1},{12987,7,0,-1}, +{12988,7,1,-1},{12991,7,0,-1},{12992,7,1,-1},{12995,7,0,-1},{12996,7,1,-1}, +{13000,7,0,-1},{13001,7,1,-1},{13004,7,0,-1},{13005,7,1,-1},{13008,7,0,-1}, +{13009,7,1,-1},{13013,7,0,-1},{13014,7,1,-1},{13017,7,0,-1},{13018,7,1,-1}, +{13021,7,0,-1},{13022,7,1,-1},{13026,7,0,-1},{13027,7,1,-1},{13030,7,0,-1}, +{13031,7,1,-1},{13034,7,0,-1},{13035,7,1,-1},{13039,7,0,-1},{13040,7,1,-1}, +{13043,7,0,-1},{13044,7,1,-1},{13047,7,0,-1},{13048,7,1,-1},{13052,7,0,-1}, +{13053,7,1,-1},{12986,7,0,-1},{13056,7,0,-1},{13057,7,1,-1},{13060,7,0,-1}, +{13061,7,1,-1},{13065,7,0,-1},{13066,7,1,-1},{12999,7,1,-1},{13069,7,0,-1}, +{13070,7,1,-1},{13073,7,0,-1},{13074,7,1,-1},{13078,7,0,-1},{13079,7,1,-1}, +{13082,7,0,-1},{13083,7,1,-1},{13086,7,0,-1},{13087,7,1,-1},{13091,7,0,-1}, +{13092,7,1,-1},{13095,7,0,-1},{13096,7,1,-1},{13099,7,0,-1},{13100,7,1,-1}, +{13104,7,0,-1},{13105,7,1,-1},{13108,7,0,-1},{13109,7,1,-1},{13112,7,0,-1}, +{13113,7,1,-1},{13117,7,0,-1},{13118,7,1,-1},{13121,7,0,-1},{13122,7,1,-1}, +{13125,7,0,-1},{13126,7,1,-1},{13130,7,0,-1},{13131,7,1,-1},{13134,7,0,-1}, +{13135,7,1,-1},{13138,7,0,-1},{13139,7,1,-1},{13143,7,0,-1},{13144,7,1,-1}, +{13147,7,0,-1},{13148,7,1,-1},{13151,7,0,-1},{13152,7,1,-1},{13156,7,0,-1}, +{13157,7,1,-1},{13090,7,0,-1},{13160,7,0,-1},{13161,7,1,-1},{13164,7,0,-1}, +{13165,7,1,-1},{13169,7,0,-1},{13170,7,1,-1},{13103,7,1,-1},{13173,7,0,-1}, +{13174,7,1,-1},{13177,7,0,-1},{13178,7,1,-1},{13182,7,0,-1},{13183,7,1,-1}, +{13186,7,0,-1},{13187,7,1,-1},{13190,7,0,-1},{13191,7,1,-1},{13195,7,0,-1}, +{13196,7,1,-1},{13199,7,0,-1},{13200,7,1,-1},{13203,7,0,-1},{13204,7,1,-1}, +{13208,7,0,-1},{13209,7,1,-1},{13212,7,0,-1},{13213,7,1,-1},{13216,7,0,-1}, +{13217,7,1,-1},{13221,7,0,-1},{13222,7,1,-1},{13225,7,0,-1},{13226,7,1,-1}, +{13229,7,0,-1},{13230,7,1,-1},{13234,7,0,-1},{13235,7,1,-1},{13238,7,0,-1}, +{13239,7,1,-1},{13242,7,0,-1},{13243,7,1,-1},{13247,7,0,-1},{13248,7,1,-1}, +{13251,7,0,-1},{13252,7,1,-1},{13255,7,0,-1},{13256,7,1,-1},{13260,7,0,-1}, +{13261,7,1,-1},{13194,7,0,-1},{13264,7,0,-1},{13265,7,1,-1},{13268,7,0,-1}, +{13269,7,1,-1},{13273,7,0,-1},{13274,7,1,-1},{13207,7,1,-1},{13277,7,0,-1}, +{13278,7,1,-1},{13281,7,0,-1},{13282,7,1,-1},{13286,7,0,-1},{13287,7,1,-1}, +{13290,7,0,-1},{13291,7,1,-1},{13294,7,0,-1},{13295,7,1,-1},{13299,7,0,-1}, +{13300,7,1,-1},{13303,7,0,-1},{13304,7,1,-1},{13307,7,0,-1},{13308,7,1,-1}, +{13312,7,0,-1},{13313,7,1,-1},{13316,7,0,-1},{13317,7,1,-1},{13320,7,0,-1}, +{13321,7,1,-1},{13325,7,0,-1},{13326,7,1,-1},{13329,7,0,-1},{13330,7,1,-1}, +{13333,7,0,-1},{13334,7,1,-1},{13338,7,0,-1},{13339,7,1,-1},{13342,7,0,-1}, +{13343,7,1,-1},{13346,7,0,-1},{13347,7,1,-1},{13351,7,0,-1},{13352,7,1,-1}, +{13355,7,0,-1},{13356,7,1,-1},{13359,7,0,-1},{13360,7,1,-1},{13364,7,0,-1}, +{13365,7,1,-1},{13298,7,0,-1},{13368,7,0,-1},{13369,7,1,-1},{13372,7,0,-1}, +{13373,7,1,-1},{13377,7,0,-1},{13378,7,1,-1},{13311,7,1,-1},{13381,7,0,-1}, +{13382,7,1,-1},{13385,7,0,-1},{13386,7,1,-1},{13390,7,0,-1},{13391,7,1,-1}, +{13394,7,0,-1},{13395,7,1,-1},{13398,7,0,-1},{13399,7,1,-1},{13403,7,0,-1}, +{13404,7,1,-1},{13407,7,0,-1},{13408,7,1,-1},{13411,7,0,-1},{13412,7,1,-1}, +{13416,7,0,-1},{13417,7,1,-1},{13420,7,0,-1},{13421,7,1,-1},{13424,7,0,-1}, +{13425,7,1,-1},{13429,7,0,-1},{13430,7,1,-1},{13433,7,0,-1},{13434,7,1,-1}, +{13437,7,0,-1},{13438,7,1,-1},{13442,7,0,-1},{13443,7,1,-1},{13446,7,0,-1}, +{13447,7,1,-1},{13450,7,0,-1},{13451,7,1,-1},{13455,7,0,-1},{13456,7,1,-1}, +{13459,7,0,-1},{13460,7,1,-1},{13463,7,0,-1},{13464,7,1,-1},{13468,7,0,-1}, +{13469,7,1,-1},{13402,7,0,-1},{13472,7,0,-1},{13473,7,1,-1},{13476,7,0,-1}, +{13477,7,1,-1},{13481,7,0,-1},{13482,7,1,-1},{13415,7,1,-1},{13485,7,0,-1}, +{13486,7,1,-1},{13489,7,0,-1},{13490,7,1,-1},{13494,7,0,-1},{13495,7,1,-1}, +{13498,7,0,-1},{13499,7,1,-1},{13502,7,0,-1},{13503,7,1,-1},{13507,7,0,-1}, +{13508,7,1,-1},{13511,7,0,-1},{13512,7,1,-1},{13515,7,0,-1},{13516,7,1,-1}, +{13520,7,0,-1},{13521,7,1,-1},{13524,7,0,-1},{13525,7,1,-1},{13528,7,0,-1}, +{13529,7,1,-1},{13533,7,0,-1},{13534,7,1,-1},{13537,7,0,-1},{13538,7,1,-1}, +{13541,7,0,-1},{13542,7,1,-1},{13546,7,0,-1},{13547,7,1,-1},{13550,7,0,-1}, +{13551,7,1,-1},{13554,7,0,-1},{13555,7,1,-1},{13559,7,0,-1},{13560,7,1,-1}, +{13563,7,0,-1},{13564,7,1,-1},{13567,7,0,-1},{13568,7,1,-1},{13572,7,0,-1}, +{13573,7,1,-1},{13506,7,0,-1},{13576,7,0,-1},{13577,7,1,-1},{13580,7,0,-1}, +{13581,7,1,-1},{13585,7,0,-1},{13586,7,1,-1},{13519,7,1,-1},{13589,7,0,-1}, +{13590,7,1,-1},{13593,7,0,-1},{13594,7,1,-1},{13598,7,0,-1},{13599,7,1,-1}, +{13602,7,0,-1},{13603,7,1,-1},{13606,7,0,-1},{13607,7,1,-1},{13611,7,0,-1}, +{13612,7,1,-1},{13615,7,0,-1},{13616,7,1,-1},{13619,7,0,-1},{13620,7,1,-1}, +{13624,7,0,-1},{13625,7,1,-1},{13628,7,0,-1},{13629,7,1,-1},{13632,7,0,-1}, +{13633,7,1,-1},{13637,7,0,-1},{13638,7,1,-1},{13641,7,0,-1},{13642,7,1,-1}, +{13645,7,0,-1},{13646,7,1,-1},{13650,7,0,-1},{13651,7,1,-1},{13654,7,0,-1}, +{13655,7,1,-1},{13658,7,0,-1},{13659,7,1,-1},{13663,7,0,-1},{13664,7,1,-1}, +{13667,7,0,-1},{13668,7,1,-1},{13671,7,0,-1},{13672,7,1,-1},{13676,7,0,-1}, +{13677,7,1,-1},{13610,7,0,-1},{13680,7,0,-1},{13681,7,1,-1},{13684,7,0,-1}, +{13685,7,1,-1},{13689,7,0,-1},{13690,7,1,-1},{13623,7,1,-1},{13693,7,0,-1}, +{13694,7,1,-1},{13697,7,0,-1},{13698,7,1,-1},{13702,7,0,-1},{13703,7,1,-1}, +{13706,7,0,-1},{13707,7,1,-1},{13710,7,0,-1},{13711,7,1,-1},{13715,7,0,-1}, +{13716,7,1,-1},{13719,7,0,-1},{13720,7,1,-1},{13723,7,0,-1},{13724,7,1,-1}, +{13728,7,0,-1},{13729,7,1,-1},{13732,7,0,-1},{13733,7,1,-1},{13736,7,0,-1}, +{13737,7,1,-1},{13741,7,0,-1},{13742,7,1,-1},{13745,7,0,-1},{13746,7,1,-1}, +{13749,7,0,-1},{13750,7,1,-1},{13754,7,0,-1},{13755,7,1,-1},{13758,7,0,-1}, +{13759,7,1,-1},{13762,7,0,-1},{13763,7,1,-1},{13767,7,0,-1},{13768,7,1,-1}, +{13771,7,0,-1},{13772,7,1,-1},{13775,7,0,-1},{13776,7,1,-1},{13780,7,0,-1}, +{13781,7,1,-1},{13714,7,0,-1},{13784,7,0,-1},{13785,7,1,-1},{13788,7,0,-1}, +{13789,7,1,-1},{13793,7,0,-1},{13794,7,1,-1},{13727,7,1,-1},{13797,7,0,-1}, +{13798,7,1,-1},{13801,7,0,-1},{13802,7,1,-1},{13806,7,0,-1},{13807,7,1,-1}, +{13810,7,0,-1},{13811,7,1,-1},{13814,7,0,-1},{13815,7,1,-1},{13819,7,0,-1}, +{13820,7,1,-1},{13823,7,0,-1},{13824,7,1,-1},{13827,7,0,-1},{13828,7,1,-1}, +{13832,7,0,-1},{13833,7,1,-1},{13836,7,0,-1},{13837,7,1,-1},{13840,7,0,-1}, +{13841,7,1,-1},{13845,7,0,-1},{13846,7,1,-1},{13849,7,0,-1},{13850,7,1,-1}, +{13853,7,0,-1},{13854,7,1,-1},{13858,7,0,-1},{13859,7,1,-1},{13862,7,0,-1}, +{13863,7,1,-1},{13866,7,0,-1},{13867,7,1,-1},{13871,7,0,-1},{13872,7,1,-1}, +{13875,7,0,-1},{13876,7,1,-1},{13879,7,0,-1},{13880,7,1,-1},{13884,7,0,-1}, +{13885,7,1,-1},{13818,7,0,-1},{13888,7,0,-1},{13889,7,1,-1},{13892,7,0,-1}, +{13893,7,1,-1},{13897,7,0,-1},{13898,7,1,-1},{13831,7,1,-1},{13901,7,0,-1}, +{13902,7,1,-1},{13905,7,0,-1},{13906,7,1,-1},{13910,7,0,-1},{13911,7,1,-1}, +{13914,7,0,-1},{13915,7,1,-1},{13918,7,0,-1},{13919,7,1,-1},{13923,7,0,-1}, +{13924,7,1,-1},{13927,7,0,-1},{13928,7,1,-1},{13931,7,0,-1},{13932,7,1,-1}, +{13936,7,0,-1},{13937,7,1,-1},{13940,7,0,-1},{13941,7,1,-1},{13944,7,0,-1}, +{13945,7,1,-1},{13949,7,0,-1},{13950,7,1,-1},{13953,7,0,-1},{13954,7,1,-1}, +{13957,7,0,-1},{13958,7,1,-1},{13962,7,0,-1},{13963,7,1,-1},{13966,7,0,-1}, +{13967,7,1,-1},{13970,7,0,-1},{13971,7,1,-1},{13975,7,0,-1},{13976,7,1,-1}, +{13979,7,0,-1},{13980,7,1,-1},{13983,7,0,-1},{13984,7,1,-1},{13988,7,0,-1}, +{13989,7,1,-1},{13922,7,0,-1},{13992,7,0,-1},{13993,7,1,-1},{13996,7,0,-1}, +{13997,7,1,-1},{14001,7,0,-1},{14002,7,1,-1},{13935,7,1,-1},{14005,7,0,-1}, +{14006,7,1,-1},{14009,7,0,-1},{14010,7,1,-1},{14014,7,0,-1},{14015,7,1,-1}, +{14018,7,0,-1},{14019,7,1,-1},{14022,7,0,-1},{14023,7,1,-1},{14027,7,0,-1}, +{14028,7,1,-1},{14031,7,0,-1},{14032,7,1,-1},{14035,7,0,-1},{14036,7,1,-1}, +{14040,7,0,-1},{14041,7,1,-1},{14044,7,0,-1},{14045,7,1,-1},{14048,7,0,-1}, +{14049,7,1,-1},{14053,7,0,-1},{14054,7,1,-1},{14057,7,0,-1},{14058,7,1,-1}, +{14061,7,0,-1},{14062,7,1,-1},{14066,7,0,-1},{14067,7,1,-1},{14070,7,0,-1}, +{14071,7,1,-1},{14074,7,0,-1},{14075,7,1,-1},{14079,7,0,-1},{14080,7,1,-1}, +{14083,7,0,-1},{14084,7,1,-1},{14087,7,0,-1},{14088,7,1,-1},{14092,7,0,-1}, +{14093,7,1,-1},{14026,7,0,-1},{14096,7,0,-1},{14097,7,1,-1},{14100,7,0,-1}, +{14101,7,1,-1},{14105,7,0,-1},{14106,7,1,-1},{14039,7,1,-1},{14109,7,0,-1}, +{14110,7,1,-1},{14113,7,0,-1},{14114,7,1,-1},{14118,7,0,-1},{14119,7,1,-1}, +{14122,7,0,-1},{14123,7,1,-1},{14126,7,0,-1},{14127,7,1,-1},{14131,7,0,-1}, +{14132,7,1,-1},{14135,7,0,-1},{14136,7,1,-1},{14139,7,0,-1},{14140,7,1,-1}, +{14144,7,0,-1},{14145,7,1,-1},{14148,7,0,-1},{14149,7,1,-1},{14152,7,0,-1}, +{14153,7,1,-1},{14157,7,0,-1},{14158,7,1,-1},{14161,7,0,-1},{14162,7,1,-1}, +{14165,7,0,-1},{14166,7,1,-1},{14170,7,0,-1},{14171,7,1,-1},{14174,7,0,-1}, +{14175,7,1,-1},{14178,7,0,-1},{14179,7,1,-1},{14183,7,0,-1},{14184,7,1,-1}, +{14187,7,0,-1},{14188,7,1,-1},{14191,7,0,-1},{14192,7,1,-1},{14196,7,0,-1}, +{14197,7,1,-1},{14130,7,0,-1},{14200,7,0,-1},{14201,7,1,-1},{14204,7,0,-1}, +{14205,7,1,-1},{14209,7,0,-1},{14210,7,1,-1},{14143,7,1,-1},{14213,7,0,-1}, +{14214,7,1,-1},{14217,7,0,-1},{14218,7,1,-1},{14222,7,0,-1},{14223,7,1,-1}, +{14226,7,0,-1},{14227,7,1,-1},{14230,7,0,-1},{14231,7,1,-1},{14235,7,0,-1}, +{14236,7,1,-1},{14239,7,0,-1},{14240,7,1,-1},{14243,7,0,-1},{14244,7,1,-1}, +{14248,7,0,-1},{14249,7,1,-1},{14252,7,0,-1},{14253,7,1,-1},{14256,7,0,-1}, +{14257,7,1,-1},{14261,7,0,-1},{14262,7,1,-1},{14265,7,0,-1},{14266,7,1,-1}, +{14269,7,0,-1},{14270,7,1,-1},{14274,7,0,-1},{14275,7,1,-1},{14278,7,0,-1}, +{14279,7,1,-1},{14282,7,0,-1},{14283,7,1,-1},{14287,7,0,-1},{14288,7,1,-1}, +{14291,7,0,-1},{14292,7,1,-1},{14295,7,0,-1},{14296,7,1,-1},{14300,7,0,-1}, +{14301,7,1,-1},{14234,7,0,-1},{14304,7,0,-1},{14305,7,1,-1},{14308,7,0,-1}, +{14309,7,1,-1},{14313,7,0,-1},{14314,7,1,-1},{14247,7,1,-1},{14317,7,0,-1}, +{14318,7,1,-1},{14321,7,0,-1},{14322,7,1,-1},{14326,7,0,-1},{14327,7,1,-1}, +{14330,7,0,-1},{14331,7,1,-1},{14334,7,0,-1},{14335,7,1,-1},{14339,7,0,-1}, +{14340,7,1,-1},{14343,7,0,-1},{14344,7,1,-1},{14347,7,0,-1},{14348,7,1,-1}, +{14352,7,0,-1},{14353,7,1,-1},{14356,7,0,-1},{14357,7,1,-1},{14360,7,0,-1}, +{14361,7,1,-1},{14365,7,0,-1},{14366,7,1,-1},{14369,7,0,-1},{14370,7,1,-1}, +{14373,7,0,-1},{14374,7,1,-1},{14378,7,0,-1},{14379,7,1,-1},{14382,7,0,-1}, +{14383,7,1,-1},{14386,7,0,-1},{14387,7,1,-1},{14391,7,0,-1},{14392,7,1,-1}, +{14395,7,0,-1},{14396,7,1,-1},{14399,7,0,-1},{14400,7,1,-1},{14404,7,0,-1}, +{14405,7,1,-1},{14338,7,0,-1},{14408,7,0,-1},{14409,7,1,-1},{14412,7,0,-1}, +{14413,7,1,-1},{14417,7,0,-1},{14418,7,1,-1},{14351,7,1,-1},{14421,7,0,-1}, +{14422,7,1,-1},{14425,7,0,-1},{14426,7,1,-1},{14430,7,0,-1},{14431,7,1,-1}, +{14434,7,0,-1},{14435,7,1,-1},{14438,7,0,-1},{14439,7,1,-1},{14443,7,0,-1}, +{14444,7,1,-1},{14447,7,0,-1},{14448,7,1,-1},{14451,7,0,-1},{14452,7,1,-1}, +{14456,7,0,-1},{14457,7,1,-1},{14460,7,0,-1},{14461,7,1,-1},{14464,7,0,-1}, +{14465,7,1,-1},{14469,7,0,-1},{14470,7,1,-1},{14473,7,0,-1},{14474,7,1,-1}, +{14477,7,0,-1},{14478,7,1,-1},{14482,7,0,-1},{14483,7,1,-1},{14486,7,0,-1}, +{14487,7,1,-1},{14490,7,0,-1},{14491,7,1,-1},{14495,7,0,-1},{14496,7,1,-1}, +{14499,7,0,-1},{14500,7,1,-1},{14503,7,0,-1},{14504,7,1,-1},{14508,7,0,-1}, +{14509,7,1,-1},{14442,7,0,-1},{14512,7,0,-1},{14513,7,1,-1},{14516,7,0,-1}, +{14517,7,1,-1},{14521,7,0,-1},{14522,7,1,-1},{14455,7,1,-1},{14525,7,0,-1}, +{14526,7,1,-1},{14529,7,0,-1},{14530,7,1,-1},{14534,7,0,-1},{14535,7,1,-1}, +{14538,7,0,-1},{14539,7,1,-1},{14542,7,0,-1},{14543,7,1,-1},{14547,7,0,-1}, +{14548,7,1,-1},{14551,7,0,-1},{14552,7,1,-1},{14555,7,0,-1},{14556,7,1,-1}, +{14560,7,0,-1},{14561,7,1,-1},{14564,7,0,-1},{14565,7,1,-1},{14568,7,0,-1}, +{14569,7,1,-1},{14573,7,0,-1},{14574,7,1,-1},{14577,7,0,-1},{14578,7,1,-1}, +{14581,7,0,-1},{14582,7,1,-1},{14586,7,0,-1},{14587,7,1,-1},{14590,7,0,-1}, +{14591,7,1,-1},{14594,7,0,-1},{14595,7,1,-1},{14599,7,0,-1},{14600,7,1,-1}, +{14603,7,0,-1},{14604,7,1,-1},{14607,7,0,-1},{14608,7,1,-1},{14612,7,0,-1}, +{14613,7,1,-1},{14546,7,0,-1},{14616,7,0,-1},{14617,7,1,-1},{14620,7,0,-1}, +{14621,7,1,-1},{14625,7,0,-1},{14626,7,1,-1},{14559,7,1,-1},{14629,7,0,-1}, +{14630,7,1,-1},{14633,7,0,-1},{14634,7,1,-1},{14638,7,0,-1},{14639,7,1,-1}, +{14642,7,0,-1},{14643,7,1,-1},{14646,7,0,-1},{14647,7,1,-1},{14651,7,0,-1}, +{14652,7,1,-1},{14655,7,0,-1},{14656,7,1,-1},{14659,7,0,-1},{14660,7,1,-1}, +{14664,7,0,-1},{14665,7,1,-1},{14668,7,0,-1},{14669,7,1,-1},{14672,7,0,-1}, +{14673,7,1,-1},{14677,7,0,-1},{14678,7,1,-1},{14681,7,0,-1},{14682,7,1,-1}, +{14685,7,0,-1},{14686,7,1,-1},{14690,7,0,-1},{14691,7,1,-1},{14694,7,0,-1}, +{14695,7,1,-1},{14698,7,0,-1},{14699,7,1,-1},{14703,7,0,-1},{14704,7,1,-1}, +{14707,7,0,-1},{14708,7,1,-1},{14711,7,0,-1},{14712,7,1,-1},{14716,7,0,-1}, +{14717,7,1,-1},{14650,7,0,-1},{14720,7,0,-1},{14721,7,1,-1},{14724,7,0,-1}, +{14725,7,1,-1},{14729,7,0,-1},{14730,7,1,-1},{14663,7,1,-1},{14733,7,0,-1}, +{14734,7,1,-1},{14737,7,0,-1},{14738,7,1,-1},{14742,7,0,-1},{14743,7,1,-1}, +{14746,7,0,-1},{14747,7,1,-1},{14750,7,0,-1},{14751,7,1,-1},{14755,7,0,-1}, +{14756,7,1,-1},{14759,7,0,-1},{14760,7,1,-1},{14763,7,0,-1},{14764,7,1,-1}, +{14768,7,0,-1},{14769,7,1,-1},{14772,7,0,-1},{14773,7,1,-1},{14776,7,0,-1}, +{14777,7,1,-1},{14781,7,0,-1},{14782,7,1,-1},{14785,7,0,-1},{14786,7,1,-1}, +{14789,7,0,-1},{14790,7,1,-1},{14794,7,0,-1},{14795,7,1,-1},{14798,7,0,-1}, +{14799,7,1,-1},{14802,7,0,-1},{14803,7,1,-1},{14807,7,0,-1},{14808,7,1,-1}, +{14811,7,0,-1},{14812,7,1,-1},{14815,7,0,-1},{14816,7,1,-1},{14820,7,0,-1}, +{14821,7,1,-1},{14754,7,0,-1},{14824,7,0,-1},{14825,7,1,-1},{14828,7,0,-1}, +{14829,7,1,-1},{14833,7,0,-1},{14834,7,1,-1},{14767,7,1,-1},{14837,7,0,-1}, +{14838,7,1,-1},{14841,7,0,-1},{14842,7,1,-1},{14846,7,0,-1},{14847,7,1,-1}, +{14850,7,0,-1},{14851,7,1,-1},{14854,7,0,-1},{14855,7,1,-1},{14859,7,0,-1}, +{14860,7,1,-1},{14863,7,0,-1},{14864,7,1,-1},{14867,7,0,-1},{14868,7,1,-1}, +{14872,7,0,-1},{14873,7,1,-1},{14876,7,0,-1},{14877,7,1,-1},{14880,7,0,-1}, +{14881,7,1,-1},{14885,7,0,-1},{14886,7,1,-1},{14889,7,0,-1},{14890,7,1,-1}, +{14893,7,0,-1},{14894,7,1,-1},{14898,7,0,-1},{14899,7,1,-1},{14902,7,0,-1}, +{14903,7,1,-1},{14906,7,0,-1},{14907,7,1,-1},{14911,7,0,-1},{14912,7,1,-1}, +{14915,7,0,-1},{14916,7,1,-1},{14919,7,0,-1},{14920,7,1,-1},{14924,7,0,-1}, +{14925,7,1,-1},{14858,7,0,-1},{14928,7,0,-1},{14929,7,1,-1},{14932,7,0,-1}, +{14933,7,1,-1},{14937,7,0,-1},{14938,7,1,-1},{14871,7,1,-1},{14941,7,0,-1}, +{14942,7,1,-1},{14945,7,0,-1},{14946,7,1,-1},{14950,7,0,-1},{14951,7,1,-1}, +{14954,7,0,-1},{14955,7,1,-1},{14958,7,0,-1},{14959,7,1,-1},{14963,7,0,-1}, +{14964,7,1,-1},{14967,7,0,-1},{14968,7,1,-1},{14971,7,0,-1},{14972,7,1,-1}, +{14976,7,0,-1},{14977,7,1,-1},{14980,7,0,-1},{14981,7,1,-1},{14984,7,0,-1}, +{14985,7,1,-1},{14989,7,0,-1},{14990,7,1,-1},{14993,7,0,-1},{14994,7,1,-1}, +{14997,7,0,-1},{14998,7,1,-1},{15002,7,0,-1},{15003,7,1,-1},{15006,7,0,-1}, +{15007,7,1,-1},{15010,7,0,-1},{15011,7,1,-1},{15015,7,0,-1},{15016,7,1,-1}, +{15019,7,0,-1},{15020,7,1,-1},{15023,7,0,-1},{15024,7,1,-1},{15028,7,0,-1}, +{15029,7,1,-1},{14962,7,0,-1},{15032,7,0,-1},{15033,7,1,-1},{15036,7,0,-1}, +{15037,7,1,-1},{15041,7,0,-1},{15042,7,1,-1},{14975,7,1,-1},{15045,7,0,-1}, +{15046,7,1,-1},{15049,7,0,-1},{15050,7,1,-1},{15054,7,0,-1},{15055,7,1,-1}, +{15058,7,0,-1},{15059,7,1,-1},{15062,7,0,-1},{15063,7,1,-1},{15067,7,0,-1}, +{15068,7,1,-1},{15071,7,0,-1},{15072,7,1,-1},{15075,7,0,-1},{15076,7,1,-1}, +{15080,7,0,-1},{15081,7,1,-1},{15084,7,0,-1},{15085,7,1,-1},{15088,7,0,-1}, +{15089,7,1,-1},{15093,7,0,-1},{15094,7,1,-1},{15097,7,0,-1},{15098,7,1,-1}, +{15101,7,0,-1},{15102,7,1,-1},{15106,7,0,-1},{15107,7,1,-1},{15110,7,0,-1}, +{15111,7,1,-1},{15114,7,0,-1},{15115,7,1,-1},{15119,7,0,-1},{15120,7,1,-1}, +{15123,7,0,-1},{15124,7,1,-1},{15127,7,0,-1},{15128,7,1,-1},{15132,7,0,-1}, +{15133,7,1,-1},{15066,7,0,-1},{15136,7,0,-1},{15137,7,1,-1},{15140,7,0,-1}, +{15141,7,1,-1},{15145,7,0,-1},{15146,7,1,-1},{15079,7,1,-1},{15149,7,0,-1}, +{15150,7,1,-1},{15153,7,0,-1},{15154,7,1,-1},{15158,7,0,-1},{15159,7,1,-1}, +{15162,7,0,-1},{15163,7,1,-1},{15166,7,0,-1},{15167,7,1,-1},{15171,7,0,-1}, +{15172,7,1,-1},{15175,7,0,-1},{15176,7,1,-1},{15179,7,0,-1},{15180,7,1,-1}, +{15184,7,0,-1},{15185,7,1,-1},{15188,7,0,-1},{15189,7,1,-1},{15192,7,0,-1}, +{15193,7,1,-1},{15197,7,0,-1},{15198,7,1,-1},{15201,7,0,-1},{15202,7,1,-1}, +{15205,7,0,-1},{15206,7,1,-1},{15210,7,0,-1},{15211,7,1,-1},{15214,7,0,-1}, +{15215,7,1,-1},{15218,7,0,-1},{15219,7,1,-1},{15223,7,0,-1},{15224,7,1,-1}, +{15227,7,0,-1},{15228,7,1,-1},{15231,7,0,-1},{15232,7,1,-1},{15236,7,0,-1}, +{15237,7,1,-1},{15170,7,0,-1},{15240,7,0,-1},{15241,7,1,-1},{15244,7,0,-1}, +{15245,7,1,-1},{15249,7,0,-1},{15250,7,1,-1},{15183,7,1,-1},{15253,7,0,-1}, +{15254,7,1,-1},{15257,7,0,-1},{15258,7,1,-1},{15262,7,0,-1},{15263,7,1,-1}, +{15266,7,0,-1},{15267,7,1,-1},{15270,7,0,-1},{15271,7,1,-1},{15275,7,0,-1}, +{15276,7,1,-1},{15279,7,0,-1},{15280,7,1,-1},{15284,7,1,-1},{15288,7,0,-1}, +{15289,7,1,-1},{15292,7,0,-1},{15293,7,1,-1},{15296,7,0,-1},{15297,7,1,-1}, +{15301,7,0,-1},{15302,7,1,-1},{15305,7,0,-1},{15306,7,1,-1},{15309,7,0,-1}, +{15310,7,1,-1},{15314,7,0,-1},{15315,7,1,-1},{15318,7,0,-1},{15319,7,1,-1}, +{15322,7,0,-1},{15323,7,1,-1},{15327,7,0,-1},{15328,7,1,-1},{15331,7,0,-1}, +{15332,7,1,-1},{15336,7,1,-1},{15340,7,0,-1},{15341,7,1,-1},{15344,7,0,-1}, +{15345,7,1,-1},{15348,7,0,-1},{15349,7,1,-1},{15353,7,0,-1},{15354,7,1,-1}, +{15357,7,0,-1},{15361,7,0,-1},{15366,7,0,-1},{15370,7,0,-1},{15374,7,0,-1}}; diff --git a/tests/testsuite.at b/tests/testsuite.at index fed0018..0efd333 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -37,3 +37,9 @@ cat $abs_srcdir/tx_power/tx_power_test.err > experr AT_CHECK([$abs_top_builddir/tests/tx_power/tx_power_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([meas]) +AT_KEYWORDS([meas]) +cat $abs_srcdir/meas/meas_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/meas/meas_test], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 Gerrit-PatchSet: 6 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 Mon Jul 10 11:18:20 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 11:18:20 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 6: (1 comment) > > As Max pointed out, this is mostly the same as https://gerrit.osmocom.org/#/c/3099/ > > > > I guess you can use osmo_dump_gsmtime inside this function and I > > will also use yours into some patches I'm doing. > > Agree? Shall you take mine and rebase on top of it or I can > cherry-pick +modify yours on top of my branch. I have now modified my version of the function so that it uses yours. The advantage in keeping mine would be that it accepts the frame number directly instead of a gsm_time struct. I have removed all dependencies, so we could safely abandon this patch if we decide that it is not worth keeping my version. https://gerrit.osmocom.org/#/c/3048/4/src/gsm/gsm_utils.c File src/gsm/gsm_utils.c: Line 757: { > I think this is too large. Please do a more realistic calculaition. Withou Done -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 10 11:22:35 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 11:22:35 +0000 Subject: [PATCH] osmo-bts[master]: measurement: fix measurment report 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/3053 to look at the new patch set (#7). measurement: fix measurment report The end of the measurement reporting period is not aligned with the SACCH block where the results are reported. The tables that are used to detect the end of the measurement period are therefore wrong. The frame number of the SACCH block must be used and not the TDMA frame number (modulo 104) of the measurement reporing interval. The tables are oriented to the frame number of the first SACCH block, at the beginning of an interval. However, when a SACCH block is received it will always contain the result of the recently passed measurement reporting period. To match the tables, introduce another lookup table to remap each SACCH block that ends to the matching beginning block number. Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 --- M configure.ac M src/common/measurement.c M tests/Makefile.am A tests/meas/Makefile.am A tests/meas/meas_test.c A tests/meas/meas_test.ok A tests/meas/sysmobts_fr_samples.h M tests/testsuite.at 8 files changed, 3,446 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/3053/7 diff --git a/configure.ac b/configure.ac index b2700d5..64231b3 100644 --- a/configure.ac +++ b/configure.ac @@ -192,4 +192,5 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/meas/Makefile Makefile) diff --git a/src/common/measurement.c b/src/common/measurement.c index dba3543..3b32bf2 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -23,18 +23,27 @@ * 6 6 and 7 78 to 77 90, 12, 38, 64 * 7 6 and 7 91 to 90 103, 25, 51, 77 */ -/* measurement period ends at fn % 104 == ? */ static const uint8_t tchf_meas_rep_fn104[] = { - [0] = 103, - [1] = 12, - [2] = 25, - [3] = 38, - [4] = 51, - [5] = 64, - [6] = 77, - [7] = 90, + [0] = 90, + [1] = 103, + [2] = 12, + [3] = 25, + [4] = 38, + [5] = 51, + [6] = 64, + [7] = 77, }; static const uint8_t tchh0_meas_rep_fn104[] = { + [0] = 90, + [1] = 90, + [2] = 12, + [3] = 12, + [4] = 38, + [5] = 38, + [6] = 64, + [7] = 64, +}; +static const uint8_t tchh1_meas_rep_fn104[] = { [0] = 103, [1] = 103, [2] = 25, @@ -43,16 +52,6 @@ [5] = 51, [6] = 77, [7] = 77, -}; -static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12, - [1] = 12, - [2] = 38, - [3] = 38, - [4] = 64, - [5] = 64, - [6] = 90, - [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan @@ -86,6 +85,46 @@ [3] = 36 + 18 }; +/* Note: The reporting of the measurement results is done via the SACCH channel. + * The measurement interval is not alligned with the interval in which the + * SACCH is tranmitted. When we receive the measurement indication with the + * SACCH block, the coresponding measurement interval will already have ended + * and we will get the results late, but on spot with the beginning of the + * next measurement interval. + * + * For example: We get a measurement indication on FN%104=38 in TS=2. Then we + * will have to look at 3GPP TS 45.008, secton 8.4.1 (or 3GPP TS 05.02 Clause 7 + * Table 1 of 9) what value we need to feed into the lookup tables in order to + * detect the measurement period ending. In this example the "real" ending + * was on FN%104=12. This is the value we have to look for in + * tchf_meas_rep_fn104 to know that a measurement period has just ended. */ + +/* See also 3GPP TS 05.02 Clause 7 Table 1 of 9: + * Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5) */ +static uint8_t translate_tch_meas_rep_fn104(uint8_t fn_mod) +{ + switch (fn_mod) { + case 25: + return 103; + case 38: + return 12; + case 51: + return 25; + case 64: + return 38; + case 77: + return 51; + case 90: + return 64; + case 103: + return 77; + case 12: + return 90; + } + + /* Invalid / not of interest */ + return 0; +} /* determine if a measurement period ends at the given frame number */ static int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn) @@ -102,12 +141,12 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (tchf_meas_rep_fn104[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_TCH_H: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (lchan->nr == 0) tbl = tchh0_meas_rep_fn104; else @@ -132,9 +171,11 @@ break; } - DEBUGP(DMEAS, - "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", - gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + if (rc == 1) { + DEBUGP(DMEAS, + "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", + gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + } return rc; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 5b6f65e..d2b4181 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power +SUBDIRS = paging cipher agch misc handover tx_power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am new file mode 100644 index 0000000..b1e52c6 --- /dev/null +++ b/tests/meas/Makefile.am @@ -0,0 +1,8 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +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 +EXTRA_DIST = meas_test.ok + +meas_test_SOURCES = meas_test.c +meas_test_LDADD = $(top_builddir)/src/common/libbts.a $(LDADD) diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c new file mode 100644 index 0000000..c87350b --- /dev/null +++ b/tests/meas/meas_test.c @@ -0,0 +1,222 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct gsm_bts *bts; +struct gsm_bts_trx *trx; + +struct fn_sample { + uint32_t fn; + uint8_t ts; + uint8_t ss; + int rc; +}; + +#include "sysmobts_fr_samples.h" + +void test_fn_sample(struct fn_sample *s, unsigned int len, uint8_t pchan, uint8_t tsmap) +{ + int rc; + struct gsm_lchan *lchan; + unsigned int i; + unsigned int delta = 0; + uint8_t tsmap_result = 0; + uint32_t fn_prev = 0; + struct gsm_time gsm_time; + + + printf("\n\n"); + printf("===========================================================\n"); + + for (i = 0; i < len; i++) { + + lchan = &trx->ts[s[i].ts].lchan[s[i].ss]; + trx->ts[s[i].ts].pchan = pchan; + lchan->meas.num_ul_meas = 1; + + rc = lchan_meas_check_compute(lchan, s[i].fn); + if (rc) { + gsm_fn2gsmtime(&gsm_time, s[i].fn); + fprintf(stdout, "Testing: ts[%i]->lchan[%i], fn=%u=>%s, fn%%104=%u, rc=%i, delta=%i\n", s[i].ts, + s[i].ss, s[i].fn, osmo_dump_gsmtime(&gsm_time), s[i].fn % 104, rc, s[i].fn - fn_prev); + fn_prev = s[i].fn; + tsmap_result |= (1 << s[i].ts); + } else + delta++; + + /* If the test data set provides a return + * code, we check that as well */ + if (s[i].rc != -1) + OSMO_ASSERT(s[i].rc == rc); + } + + /* Make sure that we exactly trigger on the right frames + * timeslots must match exactlty to what we expect */ + OSMO_ASSERT(tsmap_result == tsmap); +} + +int main(int argc, char **argv) +{ + void *tall_bts_ctx; + + tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); + msgb_talloc_ctx_init(tall_bts_ctx, 0); + + bts_log_init(NULL); + osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; + + bts = gsm_bts_alloc(tall_bts_ctx); + if (!bts) { + fprintf(stderr, "Failed to create BTS structure\n"); + exit(1); + } + trx = gsm_bts_trx_alloc(bts); + if (!trx) { + fprintf(stderr, "Failed to TRX structure\n"); + exit(1); + } + + if (bts_init(bts) < 0) { + fprintf(stderr, "unable to to open bts\n"); + exit(1); + } + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test full rate */ + test_fn_sample(test_fn_tch_f_ts_2_3, ARRAY_SIZE(test_fn_tch_f_ts_2_3), GSM_PCHAN_TCH_F, (1 << 2) | (1 << 3)); + test_fn_sample(test_fn_tch_f_ts_4_5, ARRAY_SIZE(test_fn_tch_f_ts_4_5), GSM_PCHAN_TCH_F, (1 << 4) | (1 << 5)); + test_fn_sample(test_fn_tch_f_ts_6_7, ARRAY_SIZE(test_fn_tch_f_ts_6_7), GSM_PCHAN_TCH_F, (1 << 6) | (1 << 7)); + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test half rate */ + test_fn_sample(test_fn_tch_h_ts_2_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_2_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 2)); + test_fn_sample(test_fn_tch_h_ts_3_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_3_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 3)); + test_fn_sample(test_fn_tch_h_ts_4_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_4_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 4)); + test_fn_sample(test_fn_tch_h_ts_5_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_5_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 5)); + test_fn_sample(test_fn_tch_h_ts_6_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_6_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 6)); + test_fn_sample(test_fn_tch_h_ts_7_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_7_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 7)); + + printf("Success\n"); + + return 0; +} + +/* Stubs */ +void bts_model_abis_close(struct gsm_bts *bts) +{ +} + +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int obj_kind, void *obj) +{ + return 0; +} + +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + return 0; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj, uint8_t adm_state) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +void trx_get_hlayer1(void) +{ +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return 0; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return 0; +} + +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) +{ + return 0; +} diff --git a/tests/meas/meas_test.ok b/tests/meas/meas_test.ok new file mode 100644 index 0000000..2b76604 --- /dev/null +++ b/tests/meas/meas_test.ok @@ -0,0 +1,542 @@ + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=10958 +Testing: ts[2]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=104 +Testing: ts[3]->lchan[0], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11595=>011595/08/25/18/23, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11686=>011686/08/12/07/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11699=>011699/08/25/20/23, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11790=>011790/08/12/09/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11803=>011803/08/25/22/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11894=>011894/08/12/11/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11907=>011907/08/25/24/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11998=>011998/09/12/13/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12011=>012011/09/25/26/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12102=>012102/09/12/15/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12115=>012115/09/25/28/31, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12206=>012206/09/12/17/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12219=>012219/09/25/30/31, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12310=>012310/09/12/19/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12323=>012323/09/25/32/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12414=>012414/09/12/21/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12427=>012427/09/25/34/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12518=>012518/09/12/23/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12531=>012531/09/25/36/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12622=>012622/09/12/25/26, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12635=>012635/09/25/38/39, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=5888=>005888/04/12/23/00, fn%104=64, rc=1, delta=5888 +Testing: ts[4]->lchan[0], fn=5992=>005992/04/12/25/00, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6096=>006096/04/12/27/00, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6200=>006200/04/12/29/04, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=6213=>006213/04/25/42/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6304=>006304/04/12/31/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6317=>006317/04/25/44/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6408=>006408/04/12/33/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6421=>006421/04/25/46/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6512=>006512/04/12/35/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6525=>006525/04/25/48/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6616=>006616/04/12/37/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6629=>006629/04/25/50/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6720=>006720/05/12/39/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6733=>006733/05/25/01/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6824=>006824/05/12/41/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6837=>006837/05/25/03/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6928=>006928/05/12/43/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6941=>006941/05/25/05/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7032=>007032/05/12/45/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7045=>007045/05/25/07/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7136=>007136/05/12/47/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7149=>007149/05/25/09/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7240=>007240/05/12/49/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7253=>007253/05/25/11/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7344=>007344/05/12/00/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7357=>007357/05/25/13/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7448=>007448/05/12/02/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7461=>007461/05/25/15/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7552=>007552/05/12/04/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7565=>007565/05/25/17/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7656=>007656/05/12/06/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7669=>007669/05/25/19/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7773=>007773/05/25/21/41, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7877=>007877/05/25/23/41, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7981=>007981/06/25/25/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8085=>008085/06/25/27/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>008592/06/12/24/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8605=>008605/06/25/37/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>008696/06/12/26/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8709=>008709/06/25/39/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>008800/06/12/28/44, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8813=>008813/06/25/41/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>008904/06/12/30/44, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8917=>008917/06/25/43/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>009008/06/12/32/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9021=>009021/06/25/45/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>009112/06/12/34/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9125=>009125/06/25/47/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>009216/06/12/36/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9229=>009229/06/25/49/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>009320/07/12/38/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9333=>009333/07/25/00/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>009424/07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9437=>009437/07/25/02/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>009528/07/12/42/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9541=>009541/07/25/04/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>009632/07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9645=>009645/07/25/06/17, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8618=>008618/06/12/50/14, fn%104=90, rc=1, delta=8618 +Testing: ts[6]->lchan[0], fn=8722=>008722/06/12/01/18, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8826=>008826/06/12/03/18, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8930=>008930/06/12/05/18, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=8943=>008943/06/25/18/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>009034/06/12/07/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9047=>009047/06/25/20/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>009138/06/12/09/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9151=>009151/06/25/22/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>009242/06/12/11/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9255=>009255/06/25/24/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>009346/07/12/13/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9359=>009359/07/25/26/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>009450/07/12/15/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9463=>009463/07/25/28/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>009554/07/12/17/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9567=>009567/07/25/30/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>009658/07/12/19/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9671=>009671/07/25/32/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>009762/07/12/21/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9775=>009775/07/25/34/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>009866/07/12/23/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9879=>009879/07/25/36/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>009970/07/12/25/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9983=>009983/07/25/38/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>010074/07/12/27/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10087=>010087/07/25/40/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>010178/07/12/29/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10191=>010191/07/25/42/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>010282/07/12/31/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10295=>010295/07/25/44/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>010386/07/12/33/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10399=>010399/07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>010490/07/12/35/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10503=>010503/07/25/48/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>010594/07/12/37/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10607=>010607/07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>010698/08/12/39/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10711=>010711/08/25/01/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>010802/08/12/41/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10815=>010815/08/25/03/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>010906/08/12/43/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10919=>010919/08/25/05/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>011010/08/12/45/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11023=>011023/08/25/07/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>011114/08/12/47/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11127=>011127/08/25/09/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>011218/08/12/49/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11231=>011231/08/25/11/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>011322/08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11335=>011335/08/25/13/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>011426/08/12/02/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11439=>011439/08/25/15/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>011530/08/12/04/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11543=>011543/08/25/17/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11634=>011634/08/12/06/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11647=>011647/08/25/19/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11738=>011738/08/12/08/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11751=>011751/08/25/21/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11842=>011842/08/12/10/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11855=>011855/08/25/23/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11946=>011946/09/12/12/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11959=>011959/09/25/25/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12050=>012050/09/12/14/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12063=>012063/09/25/27/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12154=>012154/09/12/16/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12167=>012167/09/25/29/31, fn%104=103, rc=1, delta=13 + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=8982=>008982/06/12/06/22, fn%104=38, rc=1, delta=8982 +Testing: ts[2]->lchan[0], fn=9086=>009086/06/12/08/22, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9190=>009190/06/12/10/22, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9294=>009294/07/12/12/26, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9398=>009398/07/12/14/26, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[1], fn=9411=>009411/07/25/27/39, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9502=>009502/07/12/16/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9515=>009515/07/25/29/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9606=>009606/07/12/18/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9619=>009619/07/25/31/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9710=>009710/07/12/20/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9723=>009723/07/25/33/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9814=>009814/07/12/22/34, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9827=>009827/07/25/35/47, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9918=>009918/07/12/24/34, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9931=>009931/07/25/37/47, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10022=>010022/07/12/26/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10035=>010035/07/25/39/51, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10126=>010126/07/12/28/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10139=>010139/07/25/41/51, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10230=>010230/07/12/30/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10243=>010243/07/25/43/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10334=>010334/07/12/32/42, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10347=>010347/07/25/45/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10438=>010438/07/12/34/42, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10451=>010451/07/25/47/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10542=>010542/07/12/36/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10555=>010555/07/25/49/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10646=>010646/08/12/38/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10659=>010659/08/25/00/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10750=>010750/08/12/40/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10763=>010763/08/25/02/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10854=>010854/08/12/42/50, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10867=>010867/08/25/04/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10971=>010971/08/25/06/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11075=>011075/08/25/08/15, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11179=>011179/08/25/10/15, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11283=>011283/08/25/12/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11387=>011387/08/25/14/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 + + +=========================================================== +Testing: ts[3]->lchan[0], fn=10022=>010022/07/12/26/38, fn%104=38, rc=1, delta=10022 +Testing: ts[3]->lchan[1], fn=10035=>010035/07/25/39/51, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10126=>010126/07/12/28/38, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10139=>010139/07/25/41/51, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10230=>010230/07/12/30/38, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10243=>010243/07/25/43/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10334=>010334/07/12/32/42, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10347=>010347/07/25/45/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10438=>010438/07/12/34/42, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10451=>010451/07/25/47/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10542=>010542/07/12/36/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10555=>010555/07/25/49/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10646=>010646/08/12/38/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10659=>010659/08/25/00/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10750=>010750/08/12/40/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10763=>010763/08/25/02/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10854=>010854/08/12/42/50, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10867=>010867/08/25/04/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10971=>010971/08/25/06/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11075=>011075/08/25/08/15, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11179=>011179/08/25/10/15, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11283=>011283/08/25/12/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11387=>011387/08/25/14/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11595=>011595/08/25/18/23, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11686=>011686/08/12/07/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11699=>011699/08/25/20/23, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11790=>011790/08/12/09/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11803=>011803/08/25/22/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11894=>011894/08/12/11/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11907=>011907/08/25/24/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11998=>011998/09/12/13/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12011=>012011/09/25/26/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=12102=>012102/09/12/15/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12115=>012115/09/25/28/31, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=7760 +Testing: ts[4]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[1], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>008592/06/12/24/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8605=>008605/06/25/37/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>008696/06/12/26/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8709=>008709/06/25/39/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>008800/06/12/28/44, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8813=>008813/06/25/41/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>008904/06/12/30/44, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8917=>008917/06/25/43/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>009008/06/12/32/48, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9021=>009021/06/25/45/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>009112/06/12/34/48, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9125=>009125/06/25/47/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>009216/06/12/36/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9229=>009229/06/25/49/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>009320/07/12/38/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9333=>009333/07/25/00/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>009424/07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9437=>009437/07/25/02/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>009528/07/12/42/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9541=>009541/07/25/04/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>009632/07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9645=>009645/07/25/06/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9736=>009736/07/12/46/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9749=>009749/07/25/08/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9840=>009840/07/12/48/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9853=>009853/07/25/10/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9944=>009944/07/12/50/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9957=>009957/07/25/12/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10048=>010048/07/12/01/12, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10061=>010061/07/25/14/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10152=>010152/07/12/03/12, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10165=>010165/07/25/16/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10256=>010256/07/12/05/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10269=>010269/07/25/18/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10360=>010360/07/12/07/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10373=>010373/07/25/20/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10464=>010464/07/12/09/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10477=>010477/07/25/22/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10568=>010568/07/12/11/20, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10581=>010581/07/25/24/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10672=>010672/08/12/13/20, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10685=>010685/08/25/26/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10776=>010776/08/12/15/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10789=>010789/08/25/28/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10880=>010880/08/12/17/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10893=>010893/08/25/30/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10984=>010984/08/12/19/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10997=>010997/08/25/32/37, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[5]->lchan[0], fn=5264=>005264/03/12/11/40, fn%104=64, rc=1, delta=5264 +Testing: ts[5]->lchan[0], fn=5368=>005368/04/12/13/40, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5472=>005472/04/12/15/44, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5576=>005576/04/12/17/44, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5680=>005680/04/12/19/48, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[1], fn=5693=>005693/04/25/32/09, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5784=>005784/04/12/21/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5797=>005797/04/25/34/09, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5888=>005888/04/12/23/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5901=>005901/04/25/36/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5992=>005992/04/12/25/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6005=>006005/04/25/38/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6096=>006096/04/12/27/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6109=>006109/04/25/40/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6200=>006200/04/12/29/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6213=>006213/04/25/42/17, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6304=>006304/04/12/31/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6317=>006317/04/25/44/17, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6408=>006408/04/12/33/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6421=>006421/04/25/46/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6512=>006512/04/12/35/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6525=>006525/04/25/48/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6616=>006616/04/12/37/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6629=>006629/04/25/50/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6720=>006720/05/12/39/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6733=>006733/05/25/01/25, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6824=>006824/05/12/41/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6837=>006837/05/25/03/25, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6928=>006928/05/12/43/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6941=>006941/05/25/05/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7032=>007032/05/12/45/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7045=>007045/05/25/07/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7136=>007136/05/12/47/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7149=>007149/05/25/09/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7240=>007240/05/12/49/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7253=>007253/05/25/11/33, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7344=>007344/05/12/00/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7357=>007357/05/25/13/33, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7448=>007448/05/12/02/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7461=>007461/05/25/15/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7552=>007552/05/12/04/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7565=>007565/05/25/17/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7656=>007656/05/12/06/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7669=>007669/05/25/19/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7773=>007773/05/25/21/41, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7877=>007877/05/25/23/41, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7981=>007981/06/25/25/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8085=>008085/06/25/27/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8098=>008098/06/12/40/06, fn%104=90, rc=1, delta=8098 +Testing: ts[6]->lchan[0], fn=8202=>008202/06/12/42/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8306=>008306/06/12/44/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8410=>008410/06/12/46/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[1], fn=8423=>008423/06/25/08/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8514=>008514/06/12/48/14, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8527=>008527/06/25/10/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8618=>008618/06/12/50/14, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8631=>008631/06/25/12/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8722=>008722/06/12/01/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8735=>008735/06/25/14/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8826=>008826/06/12/03/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8839=>008839/06/25/16/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8930=>008930/06/12/05/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8943=>008943/06/25/18/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>009034/06/12/07/22, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9047=>009047/06/25/20/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>009138/06/12/09/22, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9151=>009151/06/25/22/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>009242/06/12/11/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9255=>009255/06/25/24/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>009346/07/12/13/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9359=>009359/07/25/26/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>009450/07/12/15/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9463=>009463/07/25/28/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>009554/07/12/17/30, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9567=>009567/07/25/30/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>009658/07/12/19/30, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9671=>009671/07/25/32/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>009762/07/12/21/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9775=>009775/07/25/34/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>009866/07/12/23/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9879=>009879/07/25/36/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>009970/07/12/25/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9983=>009983/07/25/38/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>010074/07/12/27/38, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10087=>010087/07/25/40/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>010178/07/12/29/38, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10191=>010191/07/25/42/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>010282/07/12/31/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10295=>010295/07/25/44/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>010386/07/12/33/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10399=>010399/07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>010490/07/12/35/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10503=>010503/07/25/48/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>010594/07/12/37/46, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10607=>010607/07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>010698/08/12/39/46, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10711=>010711/08/25/01/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>010802/08/12/41/50, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10815=>010815/08/25/03/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>010906/08/12/43/50, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10919=>010919/08/25/05/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>011010/08/12/45/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11023=>011023/08/25/07/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>011114/08/12/47/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11127=>011127/08/25/09/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>011218/08/12/49/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11231=>011231/08/25/11/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>011322/08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11335=>011335/08/25/13/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>011426/08/12/02/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11439=>011439/08/25/15/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>011530/08/12/04/10, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11543=>011543/08/25/17/23, fn%104=103, rc=1, delta=13 + + +=========================================================== +Testing: ts[7]->lchan[0], fn=11738=>011738/08/12/08/10, fn%104=90, rc=1, delta=11738 +Testing: ts[7]->lchan[0], fn=11842=>011842/08/12/10/14, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=11946=>011946/09/12/12/14, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=12050=>012050/09/12/14/18, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[1], fn=12063=>012063/09/25/27/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12154=>012154/09/12/16/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12167=>012167/09/25/29/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12258=>012258/09/12/18/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12271=>012271/09/25/31/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12362=>012362/09/12/20/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12375=>012375/09/25/33/35, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12466=>012466/09/12/22/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12479=>012479/09/25/35/35, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12570=>012570/09/12/24/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12583=>012583/09/25/37/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12674=>012674/09/12/26/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12687=>012687/09/25/39/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12778=>012778/09/12/28/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12791=>012791/09/25/41/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12882=>012882/09/12/30/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12895=>012895/09/25/43/43, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12986=>012986/09/12/32/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12999=>012999/09/25/45/43, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13090=>013090/09/12/34/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13103=>013103/09/25/47/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13194=>013194/09/12/36/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13207=>013207/09/25/49/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13298=>013298/10/12/38/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13311=>013311/10/25/00/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13402=>013402/10/12/40/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13415=>013415/10/25/02/51, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13506=>013506/10/12/42/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13519=>013519/10/25/04/51, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13610=>013610/10/12/44/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13623=>013623/10/25/06/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13714=>013714/10/12/46/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13727=>013727/10/25/08/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13818=>013818/10/12/48/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13831=>013831/10/25/10/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13922=>013922/10/12/50/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13935=>013935/10/25/12/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14026=>014026/10/12/01/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14039=>014039/10/25/14/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14130=>014130/10/12/03/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14143=>014143/10/25/16/11, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14234=>014234/10/12/05/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14247=>014247/10/25/18/11, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14338=>014338/10/12/07/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14351=>014351/10/25/20/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14442=>014442/10/12/09/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14455=>014455/10/25/22/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14546=>014546/10/12/11/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14559=>014559/10/25/24/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14650=>014650/11/12/13/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14663=>014663/11/25/26/19, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14754=>014754/11/12/15/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14767=>014767/11/25/28/19, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14858=>014858/11/12/17/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14871=>014871/11/25/30/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14962=>014962/11/12/19/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14975=>014975/11/25/32/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15066=>015066/11/12/21/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15079=>015079/11/25/34/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15170=>015170/11/12/23/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15183=>015183/11/25/36/27, fn%104=103, rc=1, delta=13 +Success diff --git a/tests/meas/sysmobts_fr_samples.h b/tests/meas/sysmobts_fr_samples.h new file mode 100644 index 0000000..ee70bd7 --- /dev/null +++ b/tests/meas/sysmobts_fr_samples.h @@ -0,0 +1,2601 @@ +/* The following dataset was generated using a sysmobts in order to have + * some real data from a real phy to test against. */ + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS2 and TS3 */ +struct fn_sample test_fn_tch_f_ts_2_3[] = { +{10954,2,0,-1},{10959,2,0,-1},{10972,2,0,-1},{10976,2,0,-1},{10980,2,0,-1}, +{10985,2,0,-1},{10989,2,0,-1},{10993,2,0,-1},{10998,2,0,-1},{11002,2,0,-1}, +{11006,2,0,-1},{11011,2,0,-1},{11015,2,0,-1},{11019,2,0,-1},{11024,2,0,-1}, +{11028,2,0,-1},{10958,2,0,-1},{11032,2,0,-1},{11037,2,0,-1},{11041,2,0,-1}, +{11045,2,0,-1},{11050,2,0,-1},{11054,2,0,-1},{11058,2,0,-1},{11063,2,0,-1}, +{11067,2,0,-1},{11071,2,0,-1},{11076,2,0,-1},{11080,2,0,-1},{11084,2,0,-1}, +{11089,2,0,-1},{11093,2,0,-1},{11097,2,0,-1},{11102,2,0,-1},{11106,2,0,-1}, +{11110,2,0,-1},{11115,2,0,-1},{11119,2,0,-1},{11123,2,0,-1},{11128,2,0,-1}, +{11132,2,0,-1},{11062,2,0,-1},{11136,2,0,-1},{11141,2,0,-1},{11145,2,0,-1}, +{11149,2,0,-1},{11154,2,0,-1},{11158,2,0,-1},{11162,2,0,-1},{11167,2,0,-1}, +{11171,2,0,-1},{11175,2,0,-1},{11180,2,0,-1},{11184,2,0,-1},{11188,2,0,-1}, +{11193,2,0,-1},{11197,2,0,-1},{11201,2,0,-1},{11206,2,0,-1},{11210,2,0,-1}, +{11214,2,0,-1},{11219,2,0,-1},{11223,2,0,-1},{11227,2,0,-1},{11232,2,0,-1}, +{11236,2,0,-1},{11166,2,0,-1},{11240,2,0,-1},{11245,2,0,-1},{11249,2,0,-1}, +{11253,2,0,-1},{11258,2,0,-1},{11262,2,0,-1},{11266,2,0,-1},{11271,2,0,-1}, +{11275,2,0,-1},{11279,2,0,-1},{11284,2,0,-1},{11288,2,0,-1},{11292,2,0,-1}, +{11297,2,0,-1},{11301,2,0,-1},{11305,2,0,-1},{11310,2,0,-1},{11314,2,0,-1}, +{11318,2,0,-1},{11323,2,0,-1},{11327,2,0,-1},{11331,2,0,-1},{11336,2,0,-1}, +{11340,2,0,-1},{11270,2,0,-1},{11344,2,0,-1},{11349,2,0,-1},{11353,2,0,-1}, +{11357,2,0,-1},{11362,2,0,-1},{11366,2,0,-1},{11370,2,0,-1},{11375,2,0,-1}, +{11379,2,0,-1},{11383,2,0,-1},{11388,2,0,-1},{11392,2,0,-1},{11396,2,0,-1}, +{11401,2,0,-1},{11405,2,0,-1},{11409,2,0,-1},{11414,2,0,-1},{11418,2,0,-1}, +{11422,2,0,-1},{11427,2,0,-1},{11431,2,0,-1},{11431,3,0,-1},{11435,2,0,-1}, +{11435,3,0,-1},{11440,2,0,-1},{11440,3,0,-1},{11444,2,0,-1},{11444,3,0,-1}, +{11374,2,0,-1},{11448,2,0,-1},{11448,3,0,-1},{11453,2,0,-1},{11453,3,0,-1}, +{11457,2,0,-1},{11457,3,0,-1},{11461,2,0,-1},{11461,3,0,-1},{11466,2,0,-1}, +{11466,3,0,-1},{11470,2,0,-1},{11470,3,0,-1},{11474,2,0,-1},{11474,3,0,-1}, +{11479,2,0,-1},{11479,3,0,-1},{11483,2,0,-1},{11483,3,0,-1},{11487,2,0,-1}, +{11487,3,0,-1},{11492,2,0,-1},{11492,3,0,-1},{11496,2,0,-1},{11496,3,0,-1}, +{11500,2,0,-1},{11500,3,0,-1},{11505,2,0,-1},{11505,3,0,-1},{11509,2,0,-1}, +{11509,3,0,-1},{11513,2,0,-1},{11513,3,0,-1},{11518,2,0,-1},{11518,3,0,-1}, +{11522,2,0,-1},{11522,3,0,-1},{11526,2,0,-1},{11526,3,0,-1},{11531,2,0,-1}, +{11531,3,0,-1},{11535,2,0,-1},{11535,3,0,-1},{11539,2,0,-1},{11539,3,0,-1}, +{11544,2,0,-1},{11544,3,0,-1},{11548,2,0,-1},{11548,3,0,-1},{11478,2,0,-1}, +{11552,2,0,-1},{11552,3,0,-1},{11557,2,0,-1},{11557,3,0,-1},{11561,2,0,-1}, +{11561,3,0,-1},{11491,3,0,-1},{11565,2,0,-1},{11565,3,0,-1},{11570,2,0,-1}, +{11570,3,0,-1},{11574,2,0,-1},{11574,3,0,-1},{11578,2,0,-1},{11578,3,0,-1}, +{11583,2,0,-1},{11583,3,0,-1},{11587,2,0,-1},{11587,3,0,-1},{11591,2,0,-1}, +{11591,3,0,-1},{11596,2,0,-1},{11596,3,0,-1},{11600,2,0,-1},{11600,3,0,-1}, +{11604,2,0,-1},{11604,3,0,-1},{11609,2,0,-1},{11609,3,0,-1},{11613,2,0,-1}, +{11613,3,0,-1},{11617,2,0,-1},{11617,3,0,-1},{11622,2,0,-1},{11622,3,0,-1}, +{11626,2,0,-1},{11626,3,0,-1},{11630,2,0,-1},{11630,3,0,-1},{11635,2,0,-1}, +{11635,3,0,-1},{11639,2,0,-1},{11639,3,0,-1},{11643,2,0,-1},{11643,3,0,-1}, +{11648,2,0,-1},{11648,3,0,-1},{11652,2,0,-1},{11652,3,0,-1},{11582,2,0,-1}, +{11656,2,0,-1},{11656,3,0,-1},{11661,2,0,-1},{11661,3,0,-1},{11665,2,0,-1}, +{11665,3,0,-1},{11595,3,0,-1},{11669,2,0,-1},{11669,3,0,-1},{11674,2,0,-1}, +{11674,3,0,-1},{11678,2,0,-1},{11678,3,0,-1},{11682,2,0,-1},{11682,3,0,-1}, +{11687,2,0,-1},{11687,3,0,-1},{11691,2,0,-1},{11691,3,0,-1},{11695,2,0,-1}, +{11695,3,0,-1},{11700,2,0,-1},{11700,3,0,-1},{11704,2,0,-1},{11704,3,0,-1}, +{11708,2,0,-1},{11708,3,0,-1},{11713,2,0,-1},{11713,3,0,-1},{11717,2,0,-1}, +{11717,3,0,-1},{11721,2,0,-1},{11721,3,0,-1},{11726,2,0,-1},{11726,3,0,-1}, +{11730,2,0,-1},{11730,3,0,-1},{11734,2,0,-1},{11734,3,0,-1},{11739,2,0,-1}, +{11739,3,0,-1},{11743,2,0,-1},{11743,3,0,-1},{11747,2,0,-1},{11747,3,0,-1}, +{11752,2,0,-1},{11752,3,0,-1},{11756,2,0,-1},{11756,3,0,-1},{11686,2,0,-1}, +{11760,2,0,-1},{11760,3,0,-1},{11765,2,0,-1},{11765,3,0,-1},{11769,2,0,-1}, +{11769,3,0,-1},{11699,3,0,-1},{11773,2,0,-1},{11773,3,0,-1},{11778,2,0,-1}, +{11778,3,0,-1},{11782,2,0,-1},{11782,3,0,-1},{11786,2,0,-1},{11786,3,0,-1}, +{11791,2,0,-1},{11791,3,0,-1},{11795,2,0,-1},{11795,3,0,-1},{11799,2,0,-1}, +{11799,3,0,-1},{11804,2,0,-1},{11804,3,0,-1},{11808,2,0,-1},{11808,3,0,-1}, +{11812,2,0,-1},{11812,3,0,-1},{11817,2,0,-1},{11817,3,0,-1},{11821,2,0,-1}, +{11821,3,0,-1},{11825,2,0,-1},{11825,3,0,-1},{11830,2,0,-1},{11830,3,0,-1}, +{11834,2,0,-1},{11834,3,0,-1},{11838,2,0,-1},{11838,3,0,-1},{11843,2,0,-1}, +{11843,3,0,-1},{11847,2,0,-1},{11847,3,0,-1},{11851,2,0,-1},{11851,3,0,-1}, +{11856,2,0,-1},{11856,3,0,-1},{11860,2,0,-1},{11860,3,0,-1},{11790,2,0,-1}, +{11864,2,0,-1},{11864,3,0,-1},{11869,2,0,-1},{11869,3,0,-1},{11873,2,0,-1}, +{11873,3,0,-1},{11803,3,0,-1},{11877,2,0,-1},{11877,3,0,-1},{11882,2,0,-1}, +{11882,3,0,-1},{11886,2,0,-1},{11886,3,0,-1},{11890,2,0,-1},{11890,3,0,-1}, +{11895,2,0,-1},{11895,3,0,-1},{11899,2,0,-1},{11899,3,0,-1},{11903,2,0,-1}, +{11903,3,0,-1},{11908,2,0,-1},{11908,3,0,-1},{11912,2,0,-1},{11912,3,0,-1}, +{11916,2,0,-1},{11916,3,0,-1},{11921,2,0,-1},{11921,3,0,-1},{11925,2,0,-1}, +{11925,3,0,-1},{11929,2,0,-1},{11929,3,0,-1},{11934,2,0,-1},{11934,3,0,-1}, +{11938,2,0,-1},{11938,3,0,-1},{11942,2,0,-1},{11942,3,0,-1},{11947,2,0,-1}, +{11947,3,0,-1},{11951,2,0,-1},{11951,3,0,-1},{11955,2,0,-1},{11955,3,0,-1}, +{11960,2,0,-1},{11960,3,0,-1},{11964,2,0,-1},{11964,3,0,-1},{11894,2,0,-1}, +{11968,2,0,-1},{11968,3,0,-1},{11973,2,0,-1},{11973,3,0,-1},{11977,2,0,-1}, +{11977,3,0,-1},{11907,3,0,-1},{11981,2,0,-1},{11981,3,0,-1},{11986,2,0,-1}, +{11986,3,0,-1},{11990,2,0,-1},{11990,3,0,-1},{11994,2,0,-1},{11994,3,0,-1}, +{11999,2,0,-1},{11999,3,0,-1},{12003,2,0,-1},{12003,3,0,-1},{12007,2,0,-1}, +{12007,3,0,-1},{12012,2,0,-1},{12012,3,0,-1},{12016,2,0,-1},{12016,3,0,-1}, +{12020,2,0,-1},{12020,3,0,-1},{12025,2,0,-1},{12025,3,0,-1},{12029,2,0,-1}, +{12029,3,0,-1},{12033,2,0,-1},{12033,3,0,-1},{12038,2,0,-1},{12038,3,0,-1}, +{12042,2,0,-1},{12042,3,0,-1},{12046,2,0,-1},{12046,3,0,-1},{12051,2,0,-1}, +{12051,3,0,-1},{12055,2,0,-1},{12055,3,0,-1},{12059,2,0,-1},{12059,3,0,-1}, +{12064,2,0,-1},{12064,3,0,-1},{12068,2,0,-1},{12068,3,0,-1},{11998,2,0,-1}, +{12072,2,0,-1},{12072,3,0,-1},{12077,2,0,-1},{12077,3,0,-1},{12081,2,0,-1}, +{12081,3,0,-1},{12011,3,0,-1},{12085,2,0,-1},{12085,3,0,-1},{12090,2,0,-1}, +{12090,3,0,-1},{12094,2,0,-1},{12094,3,0,-1},{12098,2,0,-1},{12098,3,0,-1}, +{12103,2,0,-1},{12103,3,0,-1},{12107,2,0,-1},{12107,3,0,-1},{12111,2,0,-1}, +{12111,3,0,-1},{12116,2,0,-1},{12116,3,0,-1},{12120,2,0,-1},{12120,3,0,-1}, +{12124,2,0,-1},{12124,3,0,-1},{12129,2,0,-1},{12129,3,0,-1},{12133,2,0,-1}, +{12133,3,0,-1},{12137,2,0,-1},{12137,3,0,-1},{12142,2,0,-1},{12142,3,0,-1}, +{12146,2,0,-1},{12146,3,0,-1},{12150,2,0,-1},{12150,3,0,-1},{12155,2,0,-1}, +{12155,3,0,-1},{12159,2,0,-1},{12159,3,0,-1},{12163,2,0,-1},{12163,3,0,-1}, +{12168,2,0,-1},{12168,3,0,-1},{12172,2,0,-1},{12172,3,0,-1},{12102,2,0,-1}, +{12176,2,0,-1},{12176,3,0,-1},{12181,2,0,-1},{12181,3,0,-1},{12185,2,0,-1}, +{12185,3,0,-1},{12115,3,0,-1},{12189,2,0,-1},{12189,3,0,-1},{12194,2,0,-1}, +{12194,3,0,-1},{12198,2,0,-1},{12198,3,0,-1},{12202,2,0,-1},{12202,3,0,-1}, +{12207,2,0,-1},{12207,3,0,-1},{12211,2,0,-1},{12211,3,0,-1},{12215,2,0,-1}, +{12215,3,0,-1},{12220,2,0,-1},{12220,3,0,-1},{12224,2,0,-1},{12224,3,0,-1}, +{12228,2,0,-1},{12228,3,0,-1},{12233,2,0,-1},{12233,3,0,-1},{12237,2,0,-1}, +{12237,3,0,-1},{12241,2,0,-1},{12241,3,0,-1},{12246,2,0,-1},{12246,3,0,-1}, +{12250,2,0,-1},{12250,3,0,-1},{12254,2,0,-1},{12254,3,0,-1},{12259,2,0,-1}, +{12259,3,0,-1},{12263,2,0,-1},{12263,3,0,-1},{12267,2,0,-1},{12267,3,0,-1}, +{12272,2,0,-1},{12272,3,0,-1},{12276,2,0,-1},{12276,3,0,-1},{12206,2,0,-1}, +{12280,2,0,-1},{12280,3,0,-1},{12285,2,0,-1},{12285,3,0,-1},{12289,2,0,-1}, +{12289,3,0,-1},{12219,3,0,-1},{12293,2,0,-1},{12293,3,0,-1},{12298,2,0,-1}, +{12298,3,0,-1},{12302,2,0,-1},{12302,3,0,-1},{12306,2,0,-1},{12306,3,0,-1}, +{12311,2,0,-1},{12311,3,0,-1},{12315,2,0,-1},{12315,3,0,-1},{12319,2,0,-1}, +{12319,3,0,-1},{12324,2,0,-1},{12324,3,0,-1},{12328,2,0,-1},{12328,3,0,-1}, +{12332,2,0,-1},{12332,3,0,-1},{12337,2,0,-1},{12337,3,0,-1},{12341,2,0,-1}, +{12341,3,0,-1},{12345,2,0,-1},{12345,3,0,-1},{12350,2,0,-1},{12350,3,0,-1}, +{12354,2,0,-1},{12354,3,0,-1},{12358,2,0,-1},{12358,3,0,-1},{12363,2,0,-1}, +{12363,3,0,-1},{12367,2,0,-1},{12367,3,0,-1},{12371,2,0,-1},{12371,3,0,-1}, +{12376,2,0,-1},{12376,3,0,-1},{12380,2,0,-1},{12380,3,0,-1},{12310,2,0,-1}, +{12384,2,0,-1},{12384,3,0,-1},{12389,2,0,-1},{12389,3,0,-1},{12393,2,0,-1}, +{12393,3,0,-1},{12323,3,0,-1},{12397,2,0,-1},{12397,3,0,-1},{12402,2,0,-1}, +{12402,3,0,-1},{12406,2,0,-1},{12406,3,0,-1},{12410,2,0,-1},{12410,3,0,-1}, +{12415,2,0,-1},{12415,3,0,-1},{12419,2,0,-1},{12419,3,0,-1},{12423,2,0,-1}, +{12423,3,0,-1},{12428,2,0,-1},{12428,3,0,-1},{12432,2,0,-1},{12432,3,0,-1}, +{12436,2,0,-1},{12436,3,0,-1},{12441,2,0,-1},{12441,3,0,-1},{12445,2,0,-1}, +{12445,3,0,-1},{12449,2,0,-1},{12449,3,0,-1},{12454,2,0,-1},{12454,3,0,-1}, +{12458,2,0,-1},{12458,3,0,-1},{12462,2,0,-1},{12462,3,0,-1},{12467,2,0,-1}, +{12467,3,0,-1},{12471,2,0,-1},{12471,3,0,-1},{12475,2,0,-1},{12475,3,0,-1}, +{12480,2,0,-1},{12480,3,0,-1},{12484,2,0,-1},{12484,3,0,-1},{12414,2,0,-1}, +{12488,2,0,-1},{12488,3,0,-1},{12493,2,0,-1},{12493,3,0,-1},{12497,2,0,-1}, +{12497,3,0,-1},{12427,3,0,-1},{12501,2,0,-1},{12501,3,0,-1},{12506,2,0,-1}, +{12506,3,0,-1},{12510,2,0,-1},{12510,3,0,-1},{12514,2,0,-1},{12514,3,0,-1}, +{12519,2,0,-1},{12519,3,0,-1},{12523,2,0,-1},{12523,3,0,-1},{12527,2,0,-1}, +{12527,3,0,-1},{12532,2,0,-1},{12532,3,0,-1},{12536,2,0,-1},{12536,3,0,-1}, +{12540,2,0,-1},{12540,3,0,-1},{12545,2,0,-1},{12545,3,0,-1},{12549,2,0,-1}, +{12549,3,0,-1},{12553,2,0,-1},{12553,3,0,-1},{12558,2,0,-1},{12558,3,0,-1}, +{12562,2,0,-1},{12562,3,0,-1},{12566,2,0,-1},{12566,3,0,-1},{12571,2,0,-1}, +{12571,3,0,-1},{12575,2,0,-1},{12575,3,0,-1},{12579,2,0,-1},{12579,3,0,-1}, +{12584,2,0,-1},{12584,3,0,-1},{12588,2,0,-1},{12588,3,0,-1},{12518,2,0,-1}, +{12592,2,0,-1},{12592,3,0,-1},{12597,2,0,-1},{12597,3,0,-1},{12601,2,0,-1}, +{12601,3,0,-1},{12531,3,0,-1},{12605,2,0,-1},{12605,3,0,-1},{12610,2,0,-1}, +{12610,3,0,-1},{12614,2,0,-1},{12614,3,0,-1},{12618,2,0,-1},{12618,3,0,-1}, +{12623,2,0,-1},{12623,3,0,-1},{12627,2,0,-1},{12627,3,0,-1},{12631,2,0,-1}, +{12631,3,0,-1},{12636,2,0,-1},{12636,3,0,-1},{12640,2,0,-1},{12640,3,0,-1}, +{12644,2,0,-1},{12644,3,0,-1},{12649,2,0,-1},{12649,3,0,-1},{12653,2,0,-1}, +{12653,3,0,-1},{12657,2,0,-1},{12657,3,0,-1},{12662,2,0,-1},{12662,3,0,-1}, +{12666,2,0,-1},{12666,3,0,-1},{12670,2,0,-1},{12670,3,0,-1},{12675,2,0,-1}, +{12675,3,0,-1},{12679,2,0,-1},{12679,3,0,-1},{12683,2,0,-1},{12683,3,0,-1}, +{12688,2,0,-1},{12688,3,0,-1},{12692,2,0,-1},{12692,3,0,-1},{12622,2,0,-1}, +{12696,2,0,-1},{12696,3,0,-1},{12701,2,0,-1},{12701,3,0,-1},{12705,2,0,-1}, +{12705,3,0,-1},{12635,3,0,-1},{12709,2,0,-1},{12709,3,0,-1},{12714,2,0,-1}, +{12714,3,0,-1},{12718,2,0,-1},{12718,3,0,-1},{12722,2,0,-1},{12722,3,0,-1}, +{12727,2,0,-1},{12727,3,0,-1},{12731,2,0,-1},{12731,3,0,-1},{12735,2,0,-1}, +{12735,3,0,-1},{12740,2,0,-1},{12740,3,0,-1},{12744,2,0,-1},{12744,3,0,-1}, +{12748,2,0,-1},{12748,3,0,-1},{12753,2,0,-1},{12753,3,0,-1},{12757,2,0,-1}, +{12757,3,0,-1},{12761,2,0,-1},{12761,3,0,-1},{12766,2,0,-1},{12766,3,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS4 and TS5 */ +struct fn_sample test_fn_tch_f_ts_4_5[] = { +{3407,0,1,-1},{3427,0,1,-1},{3458,0,1,-1},{3509,0,1,-1},{3529,0,1,-1}, +{3560,0,1,-1},{3611,0,1,-1},{3662,0,1,-1},{3713,0,1,-1},{3764,0,1,-1}, +{3780,0,2,-1},{3821,0,2,-1},{3872,0,2,-1},{3882,0,2,-1},{3923,0,2,-1}, +{3974,0,2,-1},{3984,0,2,-1},{4025,0,2,-1},{4076,0,2,-1},{4127,0,2,-1}, +{4178,0,2,-1},{5871,4,0,-1},{5876,4,0,-1},{5880,4,0,-1},{5884,4,0,-1}, +{5889,4,0,-1},{5893,4,0,-1},{5897,4,0,-1},{5902,4,0,-1},{5906,4,0,-1}, +{5910,4,0,-1},{5915,4,0,-1},{5919,4,0,-1},{5923,4,0,-1},{5928,4,0,-1}, +{5932,4,0,-1},{5936,4,0,-1},{5941,4,0,-1},{5945,4,0,-1},{5949,4,0,-1}, +{5954,4,0,-1},{5958,4,0,-1},{5888,4,0,-1},{5962,4,0,-1},{5967,4,0,-1}, +{5971,4,0,-1},{5975,4,0,-1},{5980,4,0,-1},{5984,4,0,-1},{5988,4,0,-1}, +{5993,4,0,-1},{5997,4,0,-1},{6001,4,0,-1},{6006,4,0,-1},{6010,4,0,-1}, +{6014,4,0,-1},{6019,4,0,-1},{6023,4,0,-1},{6027,4,0,-1},{6032,4,0,-1}, +{6036,4,0,-1},{6040,4,0,-1},{6045,4,0,-1},{6049,4,0,-1},{6053,4,0,-1}, +{6058,4,0,-1},{6062,4,0,-1},{5992,4,0,-1},{6066,4,0,-1},{6071,4,0,-1}, +{6075,4,0,-1},{6079,4,0,-1},{6084,4,0,-1},{6088,4,0,-1},{6092,4,0,-1}, +{6097,4,0,-1},{6101,4,0,-1},{6105,4,0,-1},{6110,4,0,-1},{6114,4,0,-1}, +{6118,4,0,-1},{6123,4,0,-1},{6127,4,0,-1},{6131,4,0,-1},{6136,4,0,-1}, +{6140,4,0,-1},{6144,4,0,-1},{6149,4,0,-1},{6153,4,0,-1},{6157,4,0,-1}, +{6162,4,0,-1},{6166,4,0,-1},{6096,4,0,-1},{6170,4,0,-1},{6175,4,0,-1}, +{6175,5,0,-1},{6179,4,0,-1},{6179,5,0,-1},{6183,4,0,-1},{6183,5,0,-1}, +{6188,4,0,-1},{6188,5,0,-1},{6192,4,0,-1},{6192,5,0,-1},{6196,4,0,-1}, +{6196,5,0,-1},{6201,4,0,-1},{6201,5,0,-1},{6205,4,0,-1},{6205,5,0,-1}, +{6209,4,0,-1},{6209,5,0,-1},{6214,4,0,-1},{6214,5,0,-1},{6218,4,0,-1}, +{6218,5,0,-1},{6222,4,0,-1},{6222,5,0,-1},{6227,4,0,-1},{6227,5,0,-1}, +{6231,4,0,-1},{6231,5,0,-1},{6235,4,0,-1},{6235,5,0,-1},{6240,4,0,-1}, +{6240,5,0,-1},{6244,4,0,-1},{6244,5,0,-1},{6248,4,0,-1},{6248,5,0,-1}, +{6253,4,0,-1},{6253,5,0,-1},{6257,4,0,-1},{6257,5,0,-1},{6261,4,0,-1}, +{6261,5,0,-1},{6266,4,0,-1},{6266,5,0,-1},{6270,4,0,-1},{6270,5,0,-1}, +{6200,4,0,-1},{6274,4,0,-1},{6274,5,0,-1},{6279,4,0,-1},{6279,5,0,-1}, +{6283,4,0,-1},{6283,5,0,-1},{6213,5,0,-1},{6287,4,0,-1},{6287,5,0,-1}, +{6292,4,0,-1},{6292,5,0,-1},{6296,4,0,-1},{6296,5,0,-1},{6300,4,0,-1}, +{6300,5,0,-1},{6305,4,0,-1},{6305,5,0,-1},{6309,4,0,-1},{6309,5,0,-1}, +{6313,4,0,-1},{6313,5,0,-1},{6318,4,0,-1},{6318,5,0,-1},{6322,4,0,-1}, +{6322,5,0,-1},{6326,4,0,-1},{6326,5,0,-1},{6331,4,0,-1},{6331,5,0,-1}, +{6335,4,0,-1},{6335,5,0,-1},{6339,4,0,-1},{6339,5,0,-1},{6344,4,0,-1}, +{6344,5,0,-1},{6348,4,0,-1},{6348,5,0,-1},{6352,4,0,-1},{6352,5,0,-1}, +{6357,4,0,-1},{6357,5,0,-1},{6361,4,0,-1},{6361,5,0,-1},{6365,4,0,-1}, +{6365,5,0,-1},{6370,4,0,-1},{6370,5,0,-1},{6374,4,0,-1},{6374,5,0,-1}, +{6304,4,0,-1},{6378,4,0,-1},{6378,5,0,-1},{6383,4,0,-1},{6383,5,0,-1}, +{6387,4,0,-1},{6387,5,0,-1},{6317,5,0,-1},{6391,4,0,-1},{6391,5,0,-1}, +{6396,4,0,-1},{6396,5,0,-1},{6400,4,0,-1},{6400,5,0,-1},{6404,4,0,-1}, +{6404,5,0,-1},{6409,4,0,-1},{6409,5,0,-1},{6413,4,0,-1},{6413,5,0,-1}, +{6417,4,0,-1},{6417,5,0,-1},{6422,4,0,-1},{6422,5,0,-1},{6426,4,0,-1}, +{6426,5,0,-1},{6430,4,0,-1},{6430,5,0,-1},{6435,4,0,-1},{6435,5,0,-1}, +{6439,4,0,-1},{6439,5,0,-1},{6443,4,0,-1},{6443,5,0,-1},{6448,4,0,-1}, +{6448,5,0,-1},{6452,4,0,-1},{6452,5,0,-1},{6456,4,0,-1},{6456,5,0,-1}, +{6461,4,0,-1},{6461,5,0,-1},{6465,4,0,-1},{6465,5,0,-1},{6469,4,0,-1}, +{6469,5,0,-1},{6474,4,0,-1},{6474,5,0,-1},{6478,4,0,-1},{6478,5,0,-1}, +{6408,4,0,-1},{6482,4,0,-1},{6482,5,0,-1},{6487,4,0,-1},{6487,5,0,-1}, +{6491,4,0,-1},{6491,5,0,-1},{6421,5,0,-1},{6495,4,0,-1},{6495,5,0,-1}, +{6500,4,0,-1},{6500,5,0,-1},{6504,4,0,-1},{6504,5,0,-1},{6508,4,0,-1}, +{6508,5,0,-1},{6513,4,0,-1},{6513,5,0,-1},{6517,4,0,-1},{6517,5,0,-1}, +{6521,4,0,-1},{6521,5,0,-1},{6526,4,0,-1},{6526,5,0,-1},{6530,4,0,-1}, +{6530,5,0,-1},{6534,4,0,-1},{6534,5,0,-1},{6539,4,0,-1},{6539,5,0,-1}, +{6543,4,0,-1},{6543,5,0,-1},{6547,4,0,-1},{6547,5,0,-1},{6552,4,0,-1}, +{6552,5,0,-1},{6556,4,0,-1},{6556,5,0,-1},{6560,4,0,-1},{6560,5,0,-1}, +{6565,4,0,-1},{6565,5,0,-1},{6569,4,0,-1},{6569,5,0,-1},{6573,4,0,-1}, +{6573,5,0,-1},{6578,4,0,-1},{6578,5,0,-1},{6582,4,0,-1},{6582,5,0,-1}, +{6512,4,0,-1},{6586,4,0,-1},{6586,5,0,-1},{6591,4,0,-1},{6591,5,0,-1}, +{6595,4,0,-1},{6595,5,0,-1},{6525,5,0,-1},{6599,4,0,-1},{6599,5,0,-1}, +{6604,4,0,-1},{6604,5,0,-1},{6608,4,0,-1},{6608,5,0,-1},{6612,4,0,-1}, +{6612,5,0,-1},{6617,4,0,-1},{6617,5,0,-1},{6621,4,0,-1},{6621,5,0,-1}, +{6625,4,0,-1},{6625,5,0,-1},{6630,4,0,-1},{6630,5,0,-1},{6634,4,0,-1}, +{6634,5,0,-1},{6638,4,0,-1},{6638,5,0,-1},{6643,4,0,-1},{6643,5,0,-1}, +{6647,4,0,-1},{6647,5,0,-1},{6651,4,0,-1},{6651,5,0,-1},{6656,4,0,-1}, +{6656,5,0,-1},{6660,4,0,-1},{6660,5,0,-1},{6664,4,0,-1},{6664,5,0,-1}, +{6669,4,0,-1},{6669,5,0,-1},{6673,4,0,-1},{6673,5,0,-1},{6677,4,0,-1}, +{6677,5,0,-1},{6682,4,0,-1},{6682,5,0,-1},{6686,4,0,-1},{6686,5,0,-1}, +{6616,4,0,-1},{6690,4,0,-1},{6690,5,0,-1},{6695,4,0,-1},{6695,5,0,-1}, +{6699,4,0,-1},{6699,5,0,-1},{6629,5,0,-1},{6703,4,0,-1},{6703,5,0,-1}, +{6708,4,0,-1},{6708,5,0,-1},{6712,4,0,-1},{6712,5,0,-1},{6716,4,0,-1}, +{6716,5,0,-1},{6721,4,0,-1},{6721,5,0,-1},{6725,4,0,-1},{6725,5,0,-1}, +{6729,4,0,-1},{6729,5,0,-1},{6734,4,0,-1},{6734,5,0,-1},{6738,4,0,-1}, +{6738,5,0,-1},{6742,4,0,-1},{6742,5,0,-1},{6747,4,0,-1},{6747,5,0,-1}, +{6751,4,0,-1},{6751,5,0,-1},{6755,4,0,-1},{6755,5,0,-1},{6760,4,0,-1}, +{6760,5,0,-1},{6764,4,0,-1},{6764,5,0,-1},{6768,4,0,-1},{6768,5,0,-1}, +{6773,4,0,-1},{6773,5,0,-1},{6777,4,0,-1},{6777,5,0,-1},{6781,4,0,-1}, +{6781,5,0,-1},{6786,4,0,-1},{6786,5,0,-1},{6790,4,0,-1},{6790,5,0,-1}, +{6720,4,0,-1},{6794,4,0,-1},{6794,5,0,-1},{6799,4,0,-1},{6799,5,0,-1}, +{6803,4,0,-1},{6803,5,0,-1},{6733,5,0,-1},{6807,4,0,-1},{6807,5,0,-1}, +{6812,4,0,-1},{6812,5,0,-1},{6816,4,0,-1},{6816,5,0,-1},{6820,4,0,-1}, +{6820,5,0,-1},{6825,4,0,-1},{6825,5,0,-1},{6829,4,0,-1},{6829,5,0,-1}, +{6833,4,0,-1},{6833,5,0,-1},{6838,4,0,-1},{6838,5,0,-1},{6842,4,0,-1}, +{6842,5,0,-1},{6846,4,0,-1},{6846,5,0,-1},{6851,4,0,-1},{6851,5,0,-1}, +{6855,4,0,-1},{6855,5,0,-1},{6859,4,0,-1},{6859,5,0,-1},{6864,4,0,-1}, +{6864,5,0,-1},{6868,4,0,-1},{6868,5,0,-1},{6872,4,0,-1},{6872,5,0,-1}, +{6877,4,0,-1},{6877,5,0,-1},{6881,4,0,-1},{6881,5,0,-1},{6885,4,0,-1}, +{6885,5,0,-1},{6890,4,0,-1},{6890,5,0,-1},{6894,4,0,-1},{6894,5,0,-1}, +{6824,4,0,-1},{6898,4,0,-1},{6898,5,0,-1},{6903,4,0,-1},{6903,5,0,-1}, +{6907,4,0,-1},{6907,5,0,-1},{6837,5,0,-1},{6911,4,0,-1},{6911,5,0,-1}, +{6916,4,0,-1},{6916,5,0,-1},{6920,4,0,-1},{6920,5,0,-1},{6924,4,0,-1}, +{6924,5,0,-1},{6929,4,0,-1},{6929,5,0,-1},{6933,4,0,-1},{6933,5,0,-1}, +{6937,4,0,-1},{6937,5,0,-1},{6942,4,0,-1},{6942,5,0,-1},{6946,4,0,-1}, +{6946,5,0,-1},{6950,4,0,-1},{6950,5,0,-1},{6955,4,0,-1},{6955,5,0,-1}, +{6959,4,0,-1},{6959,5,0,-1},{6963,4,0,-1},{6963,5,0,-1},{6968,4,0,-1}, +{6968,5,0,-1},{6972,4,0,-1},{6972,5,0,-1},{6976,4,0,-1},{6976,5,0,-1}, +{6981,4,0,-1},{6981,5,0,-1},{6985,4,0,-1},{6985,5,0,-1},{6989,4,0,-1}, +{6989,5,0,-1},{6994,4,0,-1},{6994,5,0,-1},{6998,4,0,-1},{6998,5,0,-1}, +{6928,4,0,-1},{7002,4,0,-1},{7002,5,0,-1},{7007,4,0,-1},{7007,5,0,-1}, +{7011,4,0,-1},{7011,5,0,-1},{6941,5,0,-1},{7015,4,0,-1},{7015,5,0,-1}, +{7020,4,0,-1},{7020,5,0,-1},{7024,4,0,-1},{7024,5,0,-1},{7028,4,0,-1}, +{7028,5,0,-1},{7033,4,0,-1},{7033,5,0,-1},{7037,4,0,-1},{7037,5,0,-1}, +{7041,4,0,-1},{7041,5,0,-1},{7046,4,0,-1},{7046,5,0,-1},{7050,4,0,-1}, +{7050,5,0,-1},{7054,4,0,-1},{7054,5,0,-1},{7059,4,0,-1},{7059,5,0,-1}, +{7063,4,0,-1},{7063,5,0,-1},{7067,4,0,-1},{7067,5,0,-1},{7072,4,0,-1}, +{7072,5,0,-1},{7076,4,0,-1},{7076,5,0,-1},{7080,4,0,-1},{7080,5,0,-1}, +{7085,4,0,-1},{7085,5,0,-1},{7089,4,0,-1},{7089,5,0,-1},{7093,4,0,-1}, +{7093,5,0,-1},{7098,4,0,-1},{7098,5,0,-1},{7102,4,0,-1},{7102,5,0,-1}, +{7032,4,0,-1},{7106,4,0,-1},{7106,5,0,-1},{7111,4,0,-1},{7111,5,0,-1}, +{7115,4,0,-1},{7115,5,0,-1},{7045,5,0,-1},{7119,4,0,-1},{7119,5,0,-1}, +{7124,4,0,-1},{7124,5,0,-1},{7128,4,0,-1},{7128,5,0,-1},{7132,4,0,-1}, +{7132,5,0,-1},{7137,4,0,-1},{7137,5,0,-1},{7141,4,0,-1},{7141,5,0,-1}, +{7145,4,0,-1},{7145,5,0,-1},{7150,4,0,-1},{7150,5,0,-1},{7154,4,0,-1}, +{7154,5,0,-1},{7158,4,0,-1},{7158,5,0,-1},{7163,4,0,-1},{7163,5,0,-1}, +{7167,4,0,-1},{7167,5,0,-1},{7171,4,0,-1},{7171,5,0,-1},{7176,4,0,-1}, +{7176,5,0,-1},{7180,4,0,-1},{7180,5,0,-1},{7184,4,0,-1},{7184,5,0,-1}, +{7189,4,0,-1},{7189,5,0,-1},{7193,4,0,-1},{7193,5,0,-1},{7197,4,0,-1}, +{7197,5,0,-1},{7202,4,0,-1},{7202,5,0,-1},{7206,4,0,-1},{7206,5,0,-1}, +{7136,4,0,-1},{7210,4,0,-1},{7210,5,0,-1},{7215,4,0,-1},{7215,5,0,-1}, +{7219,4,0,-1},{7219,5,0,-1},{7149,5,0,-1},{7223,4,0,-1},{7223,5,0,-1}, +{7228,4,0,-1},{7228,5,0,-1},{7232,4,0,-1},{7232,5,0,-1},{7236,4,0,-1}, +{7236,5,0,-1},{7241,4,0,-1},{7241,5,0,-1},{7245,4,0,-1},{7245,5,0,-1}, +{7249,4,0,-1},{7249,5,0,-1},{7254,4,0,-1},{7254,5,0,-1},{7258,4,0,-1}, +{7258,5,0,-1},{7262,4,0,-1},{7262,5,0,-1},{7267,4,0,-1},{7267,5,0,-1}, +{7271,4,0,-1},{7271,5,0,-1},{7275,4,0,-1},{7275,5,0,-1},{7280,4,0,-1}, +{7280,5,0,-1},{7284,4,0,-1},{7284,5,0,-1},{7288,4,0,-1},{7288,5,0,-1}, +{7293,4,0,-1},{7293,5,0,-1},{7297,4,0,-1},{7297,5,0,-1},{7301,4,0,-1}, +{7301,5,0,-1},{7306,4,0,-1},{7306,5,0,-1},{7310,4,0,-1},{7310,5,0,-1}, +{7240,4,0,-1},{7314,4,0,-1},{7314,5,0,-1},{7319,4,0,-1},{7319,5,0,-1}, +{7323,4,0,-1},{7323,5,0,-1},{7253,5,0,-1},{7327,4,0,-1},{7327,5,0,-1}, +{7332,4,0,-1},{7332,5,0,-1},{7336,4,0,-1},{7336,5,0,-1},{7340,4,0,-1}, +{7340,5,0,-1},{7345,4,0,-1},{7345,5,0,-1},{7349,4,0,-1},{7349,5,0,-1}, +{7353,4,0,-1},{7353,5,0,-1},{7358,4,0,-1},{7358,5,0,-1},{7362,4,0,-1}, +{7362,5,0,-1},{7366,4,0,-1},{7366,5,0,-1},{7371,4,0,-1},{7371,5,0,-1}, +{7375,4,0,-1},{7375,5,0,-1},{7379,4,0,-1},{7379,5,0,-1},{7384,4,0,-1}, +{7384,5,0,-1},{7388,4,0,-1},{7388,5,0,-1},{7392,4,0,-1},{7392,5,0,-1}, +{7397,4,0,-1},{7397,5,0,-1},{7401,4,0,-1},{7401,5,0,-1},{7405,4,0,-1}, +{7405,5,0,-1},{7410,4,0,-1},{7410,5,0,-1},{7414,4,0,-1},{7414,5,0,-1}, +{7344,4,0,-1},{7418,4,0,-1},{7418,5,0,-1},{7423,4,0,-1},{7423,5,0,-1}, +{7427,4,0,-1},{7427,5,0,-1},{7357,5,0,-1},{7431,4,0,-1},{7431,5,0,-1}, +{7436,4,0,-1},{7436,5,0,-1},{7440,4,0,-1},{7440,5,0,-1},{7444,4,0,-1}, +{7444,5,0,-1},{7449,4,0,-1},{7449,5,0,-1},{7453,4,0,-1},{7453,5,0,-1}, +{7457,4,0,-1},{7457,5,0,-1},{7462,4,0,-1},{7462,5,0,-1},{7466,4,0,-1}, +{7466,5,0,-1},{7470,4,0,-1},{7470,5,0,-1},{7475,4,0,-1},{7475,5,0,-1}, +{7479,4,0,-1},{7479,5,0,-1},{7483,4,0,-1},{7483,5,0,-1},{7488,4,0,-1}, +{7488,5,0,-1},{7492,4,0,-1},{7492,5,0,-1},{7496,4,0,-1},{7496,5,0,-1}, +{7501,4,0,-1},{7501,5,0,-1},{7505,4,0,-1},{7505,5,0,-1},{7509,4,0,-1}, +{7509,5,0,-1},{7514,4,0,-1},{7514,5,0,-1},{7518,4,0,-1},{7518,5,0,-1}, +{7448,4,0,-1},{7522,4,0,-1},{7522,5,0,-1},{7527,4,0,-1},{7527,5,0,-1}, +{7531,4,0,-1},{7531,5,0,-1},{7461,5,0,-1},{7535,4,0,-1},{7535,5,0,-1}, +{7540,4,0,-1},{7540,5,0,-1},{7544,4,0,-1},{7544,5,0,-1},{7548,4,0,-1}, +{7548,5,0,-1},{7553,4,0,-1},{7553,5,0,-1},{7557,4,0,-1},{7557,5,0,-1}, +{7561,4,0,-1},{7561,5,0,-1},{7566,4,0,-1},{7566,5,0,-1},{7570,4,0,-1}, +{7570,5,0,-1},{7574,4,0,-1},{7574,5,0,-1},{7579,4,0,-1},{7579,5,0,-1}, +{7583,4,0,-1},{7583,5,0,-1},{7587,4,0,-1},{7587,5,0,-1},{7592,4,0,-1}, +{7592,5,0,-1},{7596,4,0,-1},{7596,5,0,-1},{7600,4,0,-1},{7600,5,0,-1}, +{7605,4,0,-1},{7605,5,0,-1},{7609,4,0,-1},{7609,5,0,-1},{7613,4,0,-1}, +{7613,5,0,-1},{7618,4,0,-1},{7618,5,0,-1},{7622,4,0,-1},{7622,5,0,-1}, +{7552,4,0,-1},{7626,4,0,-1},{7626,5,0,-1},{7631,4,0,-1},{7631,5,0,-1}, +{7635,4,0,-1},{7635,5,0,-1},{7565,5,0,-1},{7639,4,0,-1},{7639,5,0,-1}, +{7644,4,0,-1},{7644,5,0,-1},{7648,4,0,-1},{7648,5,0,-1},{7652,4,0,-1}, +{7652,5,0,-1},{7657,4,0,-1},{7657,5,0,-1},{7661,4,0,-1},{7661,5,0,-1}, +{7665,4,0,-1},{7665,5,0,-1},{7670,4,0,-1},{7670,5,0,-1},{7674,4,0,-1}, +{7674,5,0,-1},{7678,4,0,-1},{7678,5,0,-1},{7683,4,0,-1},{7683,5,0,-1}, +{7687,4,0,-1},{7687,5,0,-1},{7691,4,0,-1},{7691,5,0,-1},{7696,4,0,-1}, +{7696,5,0,-1},{7700,4,0,-1},{7700,5,0,-1},{7704,4,0,-1},{7704,5,0,-1}, +{7709,4,0,-1},{7709,5,0,-1},{7713,4,0,-1},{7713,5,0,-1},{7717,4,0,-1}, +{7717,5,0,-1},{7722,4,0,-1},{7722,5,0,-1},{7726,4,0,-1},{7726,5,0,-1}, +{7656,4,0,-1},{7730,4,0,-1},{7730,5,0,-1},{7735,4,0,-1},{7735,5,0,-1}, +{7739,4,0,-1},{7739,5,0,-1},{7669,5,0,-1},{7743,4,0,-1},{7743,5,0,-1}, +{7748,4,0,-1},{7748,5,0,-1},{7752,4,0,-1},{7752,5,0,-1},{7756,4,0,-1}, +{7756,5,0,-1},{7761,4,0,-1},{7761,5,0,-1},{7765,4,0,-1},{7765,5,0,-1}, +{7769,4,0,-1},{7769,5,0,-1},{7774,4,0,-1},{7774,5,0,-1},{7778,4,0,-1}, +{7778,5,0,-1},{7782,4,0,-1},{7782,5,0,-1},{7787,4,0,-1},{7787,5,0,-1}, +{7791,4,0,-1},{7791,5,0,-1},{7795,4,0,-1},{7795,5,0,-1},{7800,4,0,-1}, +{7800,5,0,-1},{7804,4,0,-1},{7804,5,0,-1},{7808,4,0,-1},{7808,5,0,-1}, +{7813,4,0,-1},{7813,5,0,-1},{7817,4,0,-1},{7817,5,0,-1},{7821,4,0,-1}, +{7821,5,0,-1},{7826,4,0,-1},{7826,5,0,-1},{7830,4,0,-1},{7830,5,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7834,5,0,-1},{7839,4,0,-1},{7839,5,0,-1}, +{7843,4,0,-1},{7843,5,0,-1},{7773,5,0,-1},{7847,4,0,-1},{7847,5,0,-1}, +{7852,4,0,-1},{7852,5,0,-1},{7856,4,0,-1},{7856,5,0,-1},{7860,4,0,-1}, +{7860,5,0,-1},{7865,4,0,-1},{7865,5,0,-1},{7869,4,0,-1},{7869,5,0,-1}, +{7873,4,0,-1},{7873,5,0,-1},{7878,4,0,-1},{7878,5,0,-1},{7882,4,0,-1}, +{7882,5,0,-1},{7886,4,0,-1},{7886,5,0,-1},{7891,4,0,-1},{7891,5,0,-1}, +{7895,4,0,-1},{7895,5,0,-1},{7899,4,0,-1},{7899,5,0,-1},{7904,4,0,-1}, +{7904,5,0,-1},{7908,4,0,-1},{7908,5,0,-1},{7912,4,0,-1},{7912,5,0,-1}, +{7917,4,0,-1},{7917,5,0,-1},{7921,4,0,-1},{7921,5,0,-1},{7925,4,0,-1}, +{7925,5,0,-1},{7930,4,0,-1},{7930,5,0,-1},{7934,4,0,-1},{7934,5,0,-1}, +{7864,4,0,-1},{7938,4,0,-1},{7938,5,0,-1},{7943,4,0,-1},{7943,5,0,-1}, +{7947,4,0,-1},{7947,5,0,-1},{7877,5,0,-1},{7951,4,0,-1},{7951,5,0,-1}, +{7956,4,0,-1},{7956,5,0,-1},{7960,4,0,-1},{7960,5,0,-1},{7964,4,0,-1}, +{7964,5,0,-1},{7969,4,0,-1},{7969,5,0,-1},{7973,4,0,-1},{7973,5,0,-1}, +{7977,4,0,-1},{7977,5,0,-1},{7982,4,0,-1},{7982,5,0,-1},{7986,4,0,-1}, +{7986,5,0,-1},{7990,4,0,-1},{7990,5,0,-1},{7995,4,0,-1},{7995,5,0,-1}, +{7999,4,0,-1},{7999,5,0,-1},{8003,4,0,-1},{8003,5,0,-1},{8008,4,0,-1}, +{8008,5,0,-1},{8012,4,0,-1},{8012,5,0,-1},{8016,4,0,-1},{8016,5,0,-1}, +{8021,4,0,-1},{8021,5,0,-1},{8025,4,0,-1},{8025,5,0,-1},{8029,4,0,-1}, +{8029,5,0,-1},{8034,4,0,-1},{8034,5,0,-1},{8038,4,0,-1},{8038,5,0,-1}, +{7968,4,0,-1},{8042,4,0,-1},{8042,5,0,-1},{8047,4,0,-1},{8047,5,0,-1}, +{8051,4,0,-1},{8051,5,0,-1},{7981,5,0,-1},{8055,4,0,-1},{8055,5,0,-1}, +{8060,4,0,-1},{8060,5,0,-1},{8064,4,0,-1},{8064,5,0,-1},{8068,4,0,-1}, +{8068,5,0,-1},{8073,4,0,-1},{8073,5,0,-1},{8077,4,0,-1},{8077,5,0,-1}, +{8081,4,0,-1},{8081,5,0,-1},{8086,4,0,-1},{8086,5,0,-1},{8090,4,0,-1}, +{8090,5,0,-1},{8094,4,0,-1},{8094,5,0,-1},{8099,4,0,-1},{8099,5,0,-1}, +{8103,4,0,-1},{8103,5,0,-1},{8107,4,0,-1},{8107,5,0,-1},{8112,4,0,-1}, +{8112,5,0,-1},{8116,4,0,-1},{8116,5,0,-1},{8120,4,0,-1},{8120,5,0,-1}, +{8125,4,0,-1},{8125,5,0,-1},{8129,4,0,-1},{8129,5,0,-1},{8133,4,0,-1}, +{8133,5,0,-1},{8138,4,0,-1},{8138,5,0,-1},{8142,4,0,-1},{8142,5,0,-1}, +{8072,4,0,-1},{8146,4,0,-1},{8146,5,0,-1},{8151,4,0,-1},{8151,5,0,-1}, +{8155,4,0,-1},{8155,5,0,-1},{8085,5,0,-1},{8159,4,0,-1},{8159,5,0,-1}, +{8164,4,0,-1},{8164,5,0,-1},{8168,4,0,-1},{8168,5,0,-1},{8172,4,0,-1}, +{8172,5,0,-1},{8177,4,0,-1},{8177,5,0,-1},{8181,4,0,-1},{8181,5,0,-1}, +{8185,4,0,-1},{8185,5,0,-1},{8190,4,0,-1},{8190,5,0,-1},{8194,4,0,-1}, +{8194,5,0,-1},{8198,4,0,-1},{8198,5,0,-1},{8203,4,0,-1},{8203,5,0,-1}, +{8207,4,0,-1},{8207,5,0,-1},{8211,4,0,-1},{8211,5,0,-1},{8216,4,0,-1}, +{8216,5,0,-1},{8220,4,0,-1},{8220,5,0,-1},{8224,4,0,-1},{8224,5,0,-1}, +{8229,4,0,-1},{8229,5,0,-1},{8233,4,0,-1},{8233,5,0,-1},{8237,4,0,-1}, +{8237,5,0,-1},{8242,4,0,-1},{8242,5,0,-1},{8246,4,0,-1},{8246,5,0,-1}, +{8176,4,0,-1},{8250,4,0,-1},{8250,5,0,-1},{8255,4,0,-1},{8255,5,0,-1}, +{8259,4,0,-1},{8259,5,0,-1},{8189,5,0,-1},{8263,4,0,-1},{8263,5,0,-1}, +{8268,4,0,-1},{8268,5,0,-1},{8272,4,0,-1},{8272,5,0,-1},{8276,4,0,-1}, +{8276,5,0,-1},{8281,4,0,-1},{8281,5,0,-1},{8285,4,0,-1},{8285,5,0,-1}, +{8289,4,0,-1},{8289,5,0,-1},{8294,4,0,-1},{8294,5,0,-1},{8298,4,0,-1}, +{8298,5,0,-1},{8302,4,0,-1},{8302,5,0,-1},{8307,4,0,-1},{8307,5,0,-1}, +{8311,4,0,-1},{8311,5,0,-1},{8315,4,0,-1},{8315,5,0,-1},{8320,4,0,-1}, +{8320,5,0,-1},{8324,4,0,-1},{8324,5,0,-1},{8328,4,0,-1},{8328,5,0,-1}, +{8333,4,0,-1},{8333,5,0,-1},{8337,4,0,-1},{8337,5,0,-1},{8341,4,0,-1}, +{8341,5,0,-1},{8346,4,0,-1},{8346,5,0,-1},{8350,4,0,-1},{8350,5,0,-1}, +{8280,4,0,-1},{8354,4,0,-1},{8354,5,0,-1},{8359,4,0,-1},{8359,5,0,-1}, +{8363,4,0,-1},{8363,5,0,-1},{8293,5,0,-1},{8367,4,0,-1},{8367,5,0,-1}, +{8372,4,0,-1},{8372,5,0,-1},{8376,4,0,-1},{8376,5,0,-1},{8380,4,0,-1}, +{8380,5,0,-1},{8385,4,0,-1},{8385,5,0,-1},{8389,4,0,-1},{8389,5,0,-1}, +{8393,4,0,-1},{8393,5,0,-1},{8398,4,0,-1},{8398,5,0,-1},{8402,4,0,-1}, +{8402,5,0,-1},{8406,4,0,-1},{8406,5,0,-1},{8411,4,0,-1},{8411,5,0,-1}, +{8415,4,0,-1},{8415,5,0,-1},{8419,4,0,-1},{8419,5,0,-1},{8424,4,0,-1}, +{8424,5,0,-1},{8428,4,0,-1},{8428,5,0,-1},{8432,4,0,-1},{8432,5,0,-1}, +{8437,4,0,-1},{8437,5,0,-1},{8441,4,0,-1},{8441,5,0,-1},{8445,4,0,-1}, +{8445,5,0,-1},{8450,4,0,-1},{8450,5,0,-1},{8454,4,0,-1},{8454,5,0,-1}, +{8384,4,0,-1},{8458,4,0,-1},{8458,5,0,-1},{8463,4,0,-1},{8463,5,0,-1}, +{8467,4,0,-1},{8467,5,0,-1},{8397,5,0,-1},{8471,4,0,-1},{8471,5,0,-1}, +{8476,4,0,-1},{8476,5,0,-1},{8480,4,0,-1},{8480,5,0,-1},{8484,4,0,-1}, +{8484,5,0,-1},{8489,4,0,-1},{8489,5,0,-1},{8493,4,0,-1},{8493,5,0,-1}, +{8497,4,0,-1},{8497,5,0,-1},{8502,4,0,-1},{8502,5,0,-1},{8506,4,0,-1}, +{8506,5,0,-1},{8510,4,0,-1},{8510,5,0,-1},{8515,4,0,-1},{8515,5,0,-1}, +{8519,4,0,-1},{8519,5,0,-1},{8523,4,0,-1},{8523,5,0,-1},{8528,4,0,-1}, +{8528,5,0,-1},{8532,4,0,-1},{8532,5,0,-1},{8536,4,0,-1},{8536,5,0,-1}, +{8541,4,0,-1},{8541,5,0,-1},{8545,4,0,-1},{8545,5,0,-1},{8549,4,0,-1}, +{8549,5,0,-1},{8554,4,0,-1},{8554,5,0,-1},{8558,4,0,-1},{8558,5,0,-1}, +{8488,4,0,-1},{8562,4,0,-1},{8562,5,0,-1},{8567,4,0,-1},{8567,5,0,-1}, +{8571,4,0,-1},{8571,5,0,-1},{8501,5,0,-1},{8575,4,0,-1},{8575,5,0,-1}, +{8580,4,0,-1},{8580,5,0,-1},{8584,4,0,-1},{8584,5,0,-1},{8588,4,0,-1}, +{8588,5,0,-1},{8593,4,0,-1},{8593,5,0,-1},{8597,4,0,-1},{8597,5,0,-1}, +{8601,4,0,-1},{8601,5,0,-1},{8606,4,0,-1},{8606,5,0,-1},{8610,4,0,-1}, +{8610,5,0,-1},{8614,4,0,-1},{8614,5,0,-1},{8619,4,0,-1},{8619,5,0,-1}, +{8623,4,0,-1},{8623,5,0,-1},{8627,4,0,-1},{8627,5,0,-1},{8632,4,0,-1}, +{8632,5,0,-1},{8636,4,0,-1},{8636,5,0,-1},{8640,4,0,-1},{8640,5,0,-1}, +{8645,4,0,-1},{8645,5,0,-1},{8649,4,0,-1},{8649,5,0,-1},{8653,4,0,-1}, +{8653,5,0,-1},{8658,4,0,-1},{8658,5,0,-1},{8662,4,0,-1},{8662,5,0,-1}, +{8592,4,0,-1},{8666,4,0,-1},{8666,5,0,-1},{8671,4,0,-1},{8671,5,0,-1}, +{8675,4,0,-1},{8675,5,0,-1},{8605,5,0,-1},{8679,4,0,-1},{8679,5,0,-1}, +{8684,4,0,-1},{8684,5,0,-1},{8688,4,0,-1},{8688,5,0,-1},{8692,4,0,-1}, +{8692,5,0,-1},{8697,4,0,-1},{8697,5,0,-1},{8701,4,0,-1},{8701,5,0,-1}, +{8705,4,0,-1},{8705,5,0,-1},{8710,4,0,-1},{8710,5,0,-1},{8714,4,0,-1}, +{8714,5,0,-1},{8718,4,0,-1},{8718,5,0,-1},{8723,4,0,-1},{8723,5,0,-1}, +{8727,4,0,-1},{8727,5,0,-1},{8731,4,0,-1},{8731,5,0,-1},{8736,4,0,-1}, +{8736,5,0,-1},{8740,4,0,-1},{8740,5,0,-1},{8744,4,0,-1},{8744,5,0,-1}, +{8749,4,0,-1},{8749,5,0,-1},{8753,4,0,-1},{8753,5,0,-1},{8757,4,0,-1}, +{8757,5,0,-1},{8762,4,0,-1},{8762,5,0,-1},{8766,4,0,-1},{8766,5,0,-1}, +{8696,4,0,-1},{8770,4,0,-1},{8770,5,0,-1},{8775,4,0,-1},{8775,5,0,-1}, +{8779,4,0,-1},{8779,5,0,-1},{8709,5,0,-1},{8783,4,0,-1},{8783,5,0,-1}, +{8788,4,0,-1},{8788,5,0,-1},{8792,4,0,-1},{8792,5,0,-1},{8796,4,0,-1}, +{8796,5,0,-1},{8801,4,0,-1},{8801,5,0,-1},{8805,4,0,-1},{8805,5,0,-1}, +{8809,4,0,-1},{8809,5,0,-1},{8814,4,0,-1},{8814,5,0,-1},{8818,4,0,-1}, +{8818,5,0,-1},{8822,4,0,-1},{8822,5,0,-1},{8827,4,0,-1},{8827,5,0,-1}, +{8831,4,0,-1},{8831,5,0,-1},{8835,4,0,-1},{8835,5,0,-1},{8840,4,0,-1}, +{8840,5,0,-1},{8844,4,0,-1},{8844,5,0,-1},{8848,4,0,-1},{8848,5,0,-1}, +{8853,4,0,-1},{8853,5,0,-1},{8857,4,0,-1},{8857,5,0,-1},{8861,4,0,-1}, +{8861,5,0,-1},{8866,4,0,-1},{8866,5,0,-1},{8870,4,0,-1},{8870,5,0,-1}, +{8800,4,0,-1},{8874,4,0,-1},{8874,5,0,-1},{8879,4,0,-1},{8879,5,0,-1}, +{8883,4,0,-1},{8883,5,0,-1},{8813,5,0,-1},{8887,4,0,-1},{8887,5,0,-1}, +{8892,4,0,-1},{8892,5,0,-1},{8896,4,0,-1},{8896,5,0,-1},{8900,4,0,-1}, +{8900,5,0,-1},{8905,4,0,-1},{8905,5,0,-1},{8909,4,0,-1},{8909,5,0,-1}, +{8913,4,0,-1},{8913,5,0,-1},{8918,4,0,-1},{8918,5,0,-1},{8922,4,0,-1}, +{8922,5,0,-1},{8926,4,0,-1},{8926,5,0,-1},{8931,4,0,-1},{8931,5,0,-1}, +{8935,4,0,-1},{8935,5,0,-1},{8939,4,0,-1},{8939,5,0,-1},{8944,4,0,-1}, +{8944,5,0,-1},{8948,4,0,-1},{8948,5,0,-1},{8952,4,0,-1},{8952,5,0,-1}, +{8957,4,0,-1},{8957,5,0,-1},{8961,4,0,-1},{8961,5,0,-1},{8965,4,0,-1}, +{8965,5,0,-1},{8970,4,0,-1},{8970,5,0,-1},{8974,4,0,-1},{8974,5,0,-1}, +{8904,4,0,-1},{8978,4,0,-1},{8978,5,0,-1},{8983,4,0,-1},{8983,5,0,-1}, +{8987,4,0,-1},{8987,5,0,-1},{8917,5,0,-1},{8991,4,0,-1},{8991,5,0,-1}, +{8996,4,0,-1},{8996,5,0,-1},{9000,4,0,-1},{9000,5,0,-1},{9004,4,0,-1}, +{9004,5,0,-1},{9009,4,0,-1},{9009,5,0,-1},{9013,4,0,-1},{9013,5,0,-1}, +{9017,4,0,-1},{9017,5,0,-1},{9022,4,0,-1},{9022,5,0,-1},{9026,4,0,-1}, +{9026,5,0,-1},{9030,4,0,-1},{9030,5,0,-1},{9035,4,0,-1},{9035,5,0,-1}, +{9039,4,0,-1},{9039,5,0,-1},{9043,4,0,-1},{9043,5,0,-1},{9048,4,0,-1}, +{9048,5,0,-1},{9052,4,0,-1},{9052,5,0,-1},{9056,4,0,-1},{9056,5,0,-1}, +{9061,4,0,-1},{9061,5,0,-1},{9065,4,0,-1},{9065,5,0,-1},{9069,4,0,-1}, +{9069,5,0,-1},{9074,4,0,-1},{9074,5,0,-1},{9078,4,0,-1},{9078,5,0,-1}, +{9008,4,0,-1},{9082,4,0,-1},{9082,5,0,-1},{9087,4,0,-1},{9087,5,0,-1}, +{9091,4,0,-1},{9091,5,0,-1},{9021,5,0,-1},{9095,4,0,-1},{9095,5,0,-1}, +{9100,4,0,-1},{9100,5,0,-1},{9104,4,0,-1},{9104,5,0,-1},{9108,4,0,-1}, +{9108,5,0,-1},{9113,4,0,-1},{9113,5,0,-1},{9117,4,0,-1},{9117,5,0,-1}, +{9121,4,0,-1},{9121,5,0,-1},{9126,4,0,-1},{9126,5,0,-1},{9130,4,0,-1}, +{9130,5,0,-1},{9134,4,0,-1},{9134,5,0,-1},{9139,4,0,-1},{9139,5,0,-1}, +{9143,4,0,-1},{9143,5,0,-1},{9147,4,0,-1},{9147,5,0,-1},{9152,4,0,-1}, +{9152,5,0,-1},{9156,4,0,-1},{9156,5,0,-1},{9160,4,0,-1},{9160,5,0,-1}, +{9165,4,0,-1},{9165,5,0,-1},{9169,4,0,-1},{9169,5,0,-1},{9173,4,0,-1}, +{9173,5,0,-1},{9178,4,0,-1},{9178,5,0,-1},{9182,4,0,-1},{9182,5,0,-1}, +{9112,4,0,-1},{9186,4,0,-1},{9186,5,0,-1},{9191,4,0,-1},{9191,5,0,-1}, +{9195,4,0,-1},{9195,5,0,-1},{9125,5,0,-1},{9199,4,0,-1},{9199,5,0,-1}, +{9204,4,0,-1},{9204,5,0,-1},{9208,4,0,-1},{9208,5,0,-1},{9212,4,0,-1}, +{9212,5,0,-1},{9217,4,0,-1},{9217,5,0,-1},{9221,4,0,-1},{9221,5,0,-1}, +{9225,4,0,-1},{9225,5,0,-1},{9230,4,0,-1},{9230,5,0,-1},{9234,4,0,-1}, +{9234,5,0,-1},{9238,4,0,-1},{9238,5,0,-1},{9243,4,0,-1},{9243,5,0,-1}, +{9247,4,0,-1},{9247,5,0,-1},{9251,4,0,-1},{9251,5,0,-1},{9256,4,0,-1}, +{9256,5,0,-1},{9260,4,0,-1},{9260,5,0,-1},{9264,4,0,-1},{9264,5,0,-1}, +{9269,4,0,-1},{9269,5,0,-1},{9273,4,0,-1},{9273,5,0,-1},{9277,4,0,-1}, +{9277,5,0,-1},{9282,4,0,-1},{9282,5,0,-1},{9286,4,0,-1},{9286,5,0,-1}, +{9216,4,0,-1},{9290,4,0,-1},{9290,5,0,-1},{9295,4,0,-1},{9295,5,0,-1}, +{9299,4,0,-1},{9299,5,0,-1},{9229,5,0,-1},{9303,4,0,-1},{9303,5,0,-1}, +{9308,4,0,-1},{9308,5,0,-1},{9312,4,0,-1},{9312,5,0,-1},{9316,4,0,-1}, +{9316,5,0,-1},{9321,4,0,-1},{9321,5,0,-1},{9325,4,0,-1},{9325,5,0,-1}, +{9329,4,0,-1},{9329,5,0,-1},{9334,4,0,-1},{9334,5,0,-1},{9338,4,0,-1}, +{9338,5,0,-1},{9342,4,0,-1},{9342,5,0,-1},{9347,4,0,-1},{9347,5,0,-1}, +{9351,4,0,-1},{9351,5,0,-1},{9355,4,0,-1},{9355,5,0,-1},{9360,4,0,-1}, +{9360,5,0,-1},{9364,4,0,-1},{9364,5,0,-1},{9368,4,0,-1},{9368,5,0,-1}, +{9373,4,0,-1},{9373,5,0,-1},{9377,4,0,-1},{9377,5,0,-1},{9381,4,0,-1}, +{9381,5,0,-1},{9386,4,0,-1},{9386,5,0,-1},{9390,4,0,-1},{9390,5,0,-1}, +{9320,4,0,-1},{9394,4,0,-1},{9394,5,0,-1},{9399,4,0,-1},{9399,5,0,-1}, +{9403,4,0,-1},{9403,5,0,-1},{9333,5,0,-1},{9407,4,0,-1},{9407,5,0,-1}, +{9412,4,0,-1},{9412,5,0,-1},{9416,4,0,-1},{9416,5,0,-1},{9420,4,0,-1}, +{9420,5,0,-1},{9425,4,0,-1},{9425,5,0,-1},{9429,4,0,-1},{9429,5,0,-1}, +{9433,4,0,-1},{9433,5,0,-1},{9438,4,0,-1},{9438,5,0,-1},{9442,4,0,-1}, +{9442,5,0,-1},{9446,4,0,-1},{9446,5,0,-1},{9451,4,0,-1},{9451,5,0,-1}, +{9455,4,0,-1},{9455,5,0,-1},{9459,4,0,-1},{9459,5,0,-1},{9464,4,0,-1}, +{9464,5,0,-1},{9468,4,0,-1},{9468,5,0,-1},{9472,4,0,-1},{9472,5,0,-1}, +{9477,4,0,-1},{9477,5,0,-1},{9481,4,0,-1},{9481,5,0,-1},{9485,4,0,-1}, +{9485,5,0,-1},{9490,4,0,-1},{9490,5,0,-1},{9494,4,0,-1},{9494,5,0,-1}, +{9424,4,0,-1},{9498,4,0,-1},{9498,5,0,-1},{9503,4,0,-1},{9503,5,0,-1}, +{9507,4,0,-1},{9507,5,0,-1},{9437,5,0,-1},{9511,4,0,-1},{9511,5,0,-1}, +{9516,4,0,-1},{9516,5,0,-1},{9520,4,0,-1},{9520,5,0,-1},{9524,4,0,-1}, +{9524,5,0,-1},{9529,4,0,-1},{9529,5,0,-1},{9533,4,0,-1},{9533,5,0,-1}, +{9537,4,0,-1},{9537,5,0,-1},{9542,4,0,-1},{9542,5,0,-1},{9546,4,0,-1}, +{9546,5,0,-1},{9550,4,0,-1},{9550,5,0,-1},{9555,4,0,-1},{9555,5,0,-1}, +{9559,4,0,-1},{9559,5,0,-1},{9563,4,0,-1},{9563,5,0,-1},{9568,4,0,-1}, +{9568,5,0,-1},{9572,4,0,-1},{9572,5,0,-1},{9576,4,0,-1},{9576,5,0,-1}, +{9581,4,0,-1},{9581,5,0,-1},{9585,4,0,-1},{9585,5,0,-1},{9589,4,0,-1}, +{9589,5,0,-1},{9594,4,0,-1},{9594,5,0,-1},{9598,4,0,-1},{9598,5,0,-1}, +{9528,4,0,-1},{9602,4,0,-1},{9602,5,0,-1},{9607,4,0,-1},{9607,5,0,-1}, +{9611,4,0,-1},{9611,5,0,-1},{9541,5,0,-1},{9615,4,0,-1},{9615,5,0,-1}, +{9620,4,0,-1},{9620,5,0,-1},{9624,4,0,-1},{9624,5,0,-1},{9628,4,0,-1}, +{9628,5,0,-1},{9633,4,0,-1},{9633,5,0,-1},{9637,4,0,-1},{9637,5,0,-1}, +{9641,4,0,-1},{9641,5,0,-1},{9646,4,0,-1},{9646,5,0,-1},{9650,4,0,-1}, +{9650,5,0,-1},{9654,4,0,-1},{9654,5,0,-1},{9659,4,0,-1},{9659,5,0,-1}, +{9663,4,0,-1},{9663,5,0,-1},{9667,4,0,-1},{9667,5,0,-1},{9672,4,0,-1}, +{9672,5,0,-1},{9676,4,0,-1},{9676,5,0,-1},{9680,4,0,-1},{9680,5,0,-1}, +{9685,4,0,-1},{9689,4,0,-1},{9689,5,0,-1},{9693,4,0,-1},{9698,4,0,-1}, +{9702,4,0,-1},{9632,4,0,-1},{9706,4,0,-1},{9706,5,0,-1},{9711,4,0,-1}, +{9711,5,0,-1},{9715,4,0,-1},{9715,5,0,-1},{9645,5,0,-1},{9719,4,0,-1}, +{9719,5,0,-1},{9724,4,0,-1},{9724,5,0,-1},{9728,4,0,-1},{9728,5,0,-1}, +{9732,4,0,-1},{9737,4,0,-1},{9741,4,0,-1},{9741,5,0,-1},{9745,4,0,-1}, +{9745,5,0,-1},{9750,4,0,-1},{9754,4,0,-1},{9758,4,0,-1},{9763,4,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS6 and TS7 */ +struct fn_sample test_fn_tch_f_ts_6_7[] = { +{4753,0,1,-1},{4784,0,1,-1},{4835,0,1,-1},{4855,0,1,-1},{4886,0,1,-1}, +{4937,0,1,-1},{4957,0,1,-1},{4988,0,1,-1},{5039,0,1,-1},{5090,0,1,-1}, +{5141,0,1,-1},{5198,0,2,-1},{5208,0,2,-1},{5249,0,2,-1},{5300,0,2,-1}, +{5310,0,2,-1},{5351,0,2,-1},{5402,0,2,-1},{5453,0,2,-1},{5504,0,2,-1}, +{5555,0,2,-1},{8597,6,0,-1},{8627,6,0,-1},{8632,6,0,-1},{8636,6,0,-1}, +{8640,6,0,-1},{8645,6,0,-1},{8649,6,0,-1},{8653,6,0,-1},{8658,6,0,-1}, +{8662,6,0,-1},{8666,6,0,-1},{8671,6,0,-1},{8675,6,0,-1},{8679,6,0,-1}, +{8684,6,0,-1},{8688,6,0,-1},{8618,6,0,-1},{8692,6,0,-1},{8697,6,0,-1}, +{8701,6,0,-1},{8705,6,0,-1},{8710,6,0,-1},{8714,6,0,-1},{8718,6,0,-1}, +{8723,6,0,-1},{8727,6,0,-1},{8731,6,0,-1},{8736,6,0,-1},{8740,6,0,-1}, +{8744,6,0,-1},{8749,6,0,-1},{8753,6,0,-1},{8757,6,0,-1},{8762,6,0,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8775,6,0,-1},{8779,6,0,-1},{8783,6,0,-1}, +{8788,6,0,-1},{8792,6,0,-1},{8722,6,0,-1},{8796,6,0,-1},{8801,6,0,-1}, +{8805,6,0,-1},{8809,6,0,-1},{8814,6,0,-1},{8818,6,0,-1},{8822,6,0,-1}, +{8827,6,0,-1},{8831,6,0,-1},{8835,6,0,-1},{8840,6,0,-1},{8844,6,0,-1}, +{8848,6,0,-1},{8853,6,0,-1},{8857,6,0,-1},{8861,6,0,-1},{8866,6,0,-1}, +{8870,6,0,-1},{8874,6,0,-1},{8874,7,0,-1},{8879,6,0,-1},{8879,7,0,-1}, +{8883,6,0,-1},{8883,7,0,-1},{8887,6,0,-1},{8887,7,0,-1},{8892,6,0,-1}, +{8892,7,0,-1},{8896,6,0,-1},{8896,7,0,-1},{8826,6,0,-1},{8900,6,0,-1}, +{8900,7,0,-1},{8905,6,0,-1},{8905,7,0,-1},{8909,6,0,-1},{8909,7,0,-1}, +{8913,6,0,-1},{8913,7,0,-1},{8918,6,0,-1},{8918,7,0,-1},{8922,6,0,-1}, +{8922,7,0,-1},{8926,6,0,-1},{8926,7,0,-1},{8931,6,0,-1},{8931,7,0,-1}, +{8935,6,0,-1},{8935,7,0,-1},{8939,6,0,-1},{8939,7,0,-1},{8944,6,0,-1}, +{8944,7,0,-1},{8948,6,0,-1},{8948,7,0,-1},{8952,6,0,-1},{8952,7,0,-1}, +{8957,6,0,-1},{8957,7,0,-1},{8961,6,0,-1},{8961,7,0,-1},{8965,6,0,-1}, +{8965,7,0,-1},{8970,6,0,-1},{8970,7,0,-1},{8974,6,0,-1},{8974,7,0,-1}, +{8978,6,0,-1},{8978,7,0,-1},{8983,6,0,-1},{8983,7,0,-1},{8987,6,0,-1}, +{8987,7,0,-1},{8991,6,0,-1},{8991,7,0,-1},{8996,6,0,-1},{8996,7,0,-1}, +{9000,6,0,-1},{9000,7,0,-1},{8930,6,0,-1},{9004,6,0,-1},{9004,7,0,-1}, +{9009,6,0,-1},{9009,7,0,-1},{9013,6,0,-1},{9013,7,0,-1},{8943,7,0,-1}, +{9017,6,0,-1},{9017,7,0,-1},{9022,6,0,-1},{9022,7,0,-1},{9026,6,0,-1}, +{9026,7,0,-1},{9030,6,0,-1},{9030,7,0,-1},{9035,6,0,-1},{9035,7,0,-1}, +{9039,6,0,-1},{9039,7,0,-1},{9043,6,0,-1},{9043,7,0,-1},{9048,6,0,-1}, +{9048,7,0,-1},{9052,6,0,-1},{9052,7,0,-1},{9056,6,0,-1},{9056,7,0,-1}, +{9061,6,0,-1},{9061,7,0,-1},{9065,6,0,-1},{9065,7,0,-1},{9069,6,0,-1}, +{9069,7,0,-1},{9074,6,0,-1},{9074,7,0,-1},{9078,6,0,-1},{9078,7,0,-1}, +{9082,6,0,-1},{9082,7,0,-1},{9087,6,0,-1},{9087,7,0,-1},{9091,6,0,-1}, +{9091,7,0,-1},{9095,6,0,-1},{9095,7,0,-1},{9100,6,0,-1},{9100,7,0,-1}, +{9104,6,0,-1},{9104,7,0,-1},{9034,6,0,-1},{9108,6,0,-1},{9108,7,0,-1}, +{9113,6,0,-1},{9113,7,0,-1},{9117,6,0,-1},{9117,7,0,-1},{9047,7,0,-1}, +{9121,6,0,-1},{9121,7,0,-1},{9126,6,0,-1},{9126,7,0,-1},{9130,6,0,-1}, +{9130,7,0,-1},{9134,6,0,-1},{9134,7,0,-1},{9139,6,0,-1},{9139,7,0,-1}, +{9143,6,0,-1},{9143,7,0,-1},{9147,6,0,-1},{9147,7,0,-1},{9152,6,0,-1}, +{9152,7,0,-1},{9156,6,0,-1},{9156,7,0,-1},{9160,6,0,-1},{9160,7,0,-1}, +{9165,6,0,-1},{9165,7,0,-1},{9169,6,0,-1},{9169,7,0,-1},{9173,6,0,-1}, +{9173,7,0,-1},{9178,6,0,-1},{9178,7,0,-1},{9182,6,0,-1},{9182,7,0,-1}, +{9186,6,0,-1},{9186,7,0,-1},{9191,6,0,-1},{9191,7,0,-1},{9195,6,0,-1}, +{9195,7,0,-1},{9199,6,0,-1},{9199,7,0,-1},{9204,6,0,-1},{9204,7,0,-1}, +{9208,6,0,-1},{9208,7,0,-1},{9138,6,0,-1},{9212,6,0,-1},{9212,7,0,-1}, +{9217,6,0,-1},{9217,7,0,-1},{9221,6,0,-1},{9221,7,0,-1},{9151,7,0,-1}, +{9225,6,0,-1},{9225,7,0,-1},{9230,6,0,-1},{9230,7,0,-1},{9234,6,0,-1}, +{9234,7,0,-1},{9238,6,0,-1},{9238,7,0,-1},{9243,6,0,-1},{9243,7,0,-1}, +{9247,6,0,-1},{9247,7,0,-1},{9251,6,0,-1},{9251,7,0,-1},{9256,6,0,-1}, +{9256,7,0,-1},{9260,6,0,-1},{9260,7,0,-1},{9264,6,0,-1},{9264,7,0,-1}, +{9269,6,0,-1},{9269,7,0,-1},{9273,6,0,-1},{9273,7,0,-1},{9277,6,0,-1}, +{9277,7,0,-1},{9282,6,0,-1},{9282,7,0,-1},{9286,6,0,-1},{9286,7,0,-1}, +{9290,6,0,-1},{9290,7,0,-1},{9295,6,0,-1},{9295,7,0,-1},{9299,6,0,-1}, +{9299,7,0,-1},{9303,6,0,-1},{9303,7,0,-1},{9308,6,0,-1},{9308,7,0,-1}, +{9312,6,0,-1},{9312,7,0,-1},{9242,6,0,-1},{9316,6,0,-1},{9316,7,0,-1}, +{9321,6,0,-1},{9321,7,0,-1},{9325,6,0,-1},{9325,7,0,-1},{9255,7,0,-1}, +{9329,6,0,-1},{9329,7,0,-1},{9334,6,0,-1},{9334,7,0,-1},{9338,6,0,-1}, +{9338,7,0,-1},{9342,6,0,-1},{9342,7,0,-1},{9347,6,0,-1},{9347,7,0,-1}, +{9351,6,0,-1},{9351,7,0,-1},{9355,6,0,-1},{9355,7,0,-1},{9360,6,0,-1}, +{9360,7,0,-1},{9364,6,0,-1},{9364,7,0,-1},{9368,6,0,-1},{9368,7,0,-1}, +{9373,6,0,-1},{9373,7,0,-1},{9377,6,0,-1},{9377,7,0,-1},{9381,6,0,-1}, +{9381,7,0,-1},{9386,6,0,-1},{9386,7,0,-1},{9390,6,0,-1},{9390,7,0,-1}, +{9394,6,0,-1},{9394,7,0,-1},{9399,6,0,-1},{9399,7,0,-1},{9403,6,0,-1}, +{9403,7,0,-1},{9407,6,0,-1},{9407,7,0,-1},{9412,6,0,-1},{9412,7,0,-1}, +{9416,6,0,-1},{9416,7,0,-1},{9346,6,0,-1},{9420,6,0,-1},{9420,7,0,-1}, +{9425,6,0,-1},{9425,7,0,-1},{9429,6,0,-1},{9429,7,0,-1},{9359,7,0,-1}, +{9433,6,0,-1},{9433,7,0,-1},{9438,6,0,-1},{9438,7,0,-1},{9442,6,0,-1}, +{9442,7,0,-1},{9446,6,0,-1},{9446,7,0,-1},{9451,6,0,-1},{9451,7,0,-1}, +{9455,6,0,-1},{9455,7,0,-1},{9459,6,0,-1},{9459,7,0,-1},{9464,6,0,-1}, +{9464,7,0,-1},{9468,6,0,-1},{9468,7,0,-1},{9472,6,0,-1},{9472,7,0,-1}, +{9477,6,0,-1},{9477,7,0,-1},{9481,6,0,-1},{9481,7,0,-1},{9485,6,0,-1}, +{9485,7,0,-1},{9490,6,0,-1},{9490,7,0,-1},{9494,6,0,-1},{9494,7,0,-1}, +{9498,6,0,-1},{9498,7,0,-1},{9503,6,0,-1},{9503,7,0,-1},{9507,6,0,-1}, +{9507,7,0,-1},{9511,6,0,-1},{9511,7,0,-1},{9516,6,0,-1},{9516,7,0,-1}, +{9520,6,0,-1},{9520,7,0,-1},{9450,6,0,-1},{9524,6,0,-1},{9524,7,0,-1}, +{9529,6,0,-1},{9529,7,0,-1},{9533,6,0,-1},{9533,7,0,-1},{9463,7,0,-1}, +{9537,6,0,-1},{9537,7,0,-1},{9542,6,0,-1},{9542,7,0,-1},{9546,6,0,-1}, +{9546,7,0,-1},{9550,6,0,-1},{9550,7,0,-1},{9555,6,0,-1},{9555,7,0,-1}, +{9559,6,0,-1},{9559,7,0,-1},{9563,6,0,-1},{9563,7,0,-1},{9568,6,0,-1}, +{9568,7,0,-1},{9572,6,0,-1},{9572,7,0,-1},{9576,6,0,-1},{9576,7,0,-1}, +{9581,6,0,-1},{9581,7,0,-1},{9585,6,0,-1},{9585,7,0,-1},{9589,6,0,-1}, +{9589,7,0,-1},{9594,6,0,-1},{9594,7,0,-1},{9598,6,0,-1},{9598,7,0,-1}, +{9602,6,0,-1},{9602,7,0,-1},{9607,6,0,-1},{9607,7,0,-1},{9611,6,0,-1}, +{9611,7,0,-1},{9615,6,0,-1},{9615,7,0,-1},{9620,6,0,-1},{9620,7,0,-1}, +{9624,6,0,-1},{9624,7,0,-1},{9554,6,0,-1},{9628,6,0,-1},{9628,7,0,-1}, +{9633,6,0,-1},{9633,7,0,-1},{9637,6,0,-1},{9637,7,0,-1},{9567,7,0,-1}, +{9641,6,0,-1},{9641,7,0,-1},{9646,6,0,-1},{9646,7,0,-1},{9650,6,0,-1}, +{9650,7,0,-1},{9654,6,0,-1},{9654,7,0,-1},{9659,6,0,-1},{9659,7,0,-1}, +{9663,6,0,-1},{9663,7,0,-1},{9667,6,0,-1},{9667,7,0,-1},{9672,6,0,-1}, +{9672,7,0,-1},{9676,6,0,-1},{9676,7,0,-1},{9680,6,0,-1},{9680,7,0,-1}, +{9685,6,0,-1},{9685,7,0,-1},{9689,6,0,-1},{9689,7,0,-1},{9693,6,0,-1}, +{9693,7,0,-1},{9698,6,0,-1},{9698,7,0,-1},{9702,6,0,-1},{9702,7,0,-1}, +{9706,6,0,-1},{9706,7,0,-1},{9711,6,0,-1},{9711,7,0,-1},{9715,6,0,-1}, +{9715,7,0,-1},{9719,6,0,-1},{9719,7,0,-1},{9724,6,0,-1},{9724,7,0,-1}, +{9728,6,0,-1},{9728,7,0,-1},{9658,6,0,-1},{9732,6,0,-1},{9732,7,0,-1}, +{9737,6,0,-1},{9737,7,0,-1},{9741,6,0,-1},{9741,7,0,-1},{9671,7,0,-1}, +{9745,6,0,-1},{9745,7,0,-1},{9750,6,0,-1},{9750,7,0,-1},{9754,6,0,-1}, +{9754,7,0,-1},{9758,6,0,-1},{9758,7,0,-1},{9763,6,0,-1},{9763,7,0,-1}, +{9767,6,0,-1},{9767,7,0,-1},{9771,6,0,-1},{9771,7,0,-1},{9776,6,0,-1}, +{9776,7,0,-1},{9780,6,0,-1},{9780,7,0,-1},{9784,6,0,-1},{9784,7,0,-1}, +{9789,6,0,-1},{9789,7,0,-1},{9793,6,0,-1},{9793,7,0,-1},{9797,6,0,-1}, +{9797,7,0,-1},{9802,6,0,-1},{9802,7,0,-1},{9806,6,0,-1},{9806,7,0,-1}, +{9810,6,0,-1},{9810,7,0,-1},{9815,6,0,-1},{9815,7,0,-1},{9819,6,0,-1}, +{9819,7,0,-1},{9823,6,0,-1},{9823,7,0,-1},{9828,6,0,-1},{9828,7,0,-1}, +{9832,6,0,-1},{9832,7,0,-1},{9762,6,0,-1},{9836,6,0,-1},{9836,7,0,-1}, +{9841,6,0,-1},{9841,7,0,-1},{9845,6,0,-1},{9845,7,0,-1},{9775,7,0,-1}, +{9849,6,0,-1},{9849,7,0,-1},{9854,6,0,-1},{9854,7,0,-1},{9858,6,0,-1}, +{9858,7,0,-1},{9862,6,0,-1},{9862,7,0,-1},{9867,6,0,-1},{9867,7,0,-1}, +{9871,6,0,-1},{9871,7,0,-1},{9875,6,0,-1},{9875,7,0,-1},{9880,6,0,-1}, +{9880,7,0,-1},{9884,6,0,-1},{9884,7,0,-1},{9888,6,0,-1},{9888,7,0,-1}, +{9893,6,0,-1},{9893,7,0,-1},{9897,6,0,-1},{9897,7,0,-1},{9901,6,0,-1}, +{9901,7,0,-1},{9906,6,0,-1},{9906,7,0,-1},{9910,6,0,-1},{9910,7,0,-1}, +{9914,6,0,-1},{9914,7,0,-1},{9919,6,0,-1},{9919,7,0,-1},{9923,6,0,-1}, +{9923,7,0,-1},{9927,6,0,-1},{9927,7,0,-1},{9932,6,0,-1},{9932,7,0,-1}, +{9936,6,0,-1},{9936,7,0,-1},{9866,6,0,-1},{9940,6,0,-1},{9940,7,0,-1}, +{9945,6,0,-1},{9945,7,0,-1},{9949,6,0,-1},{9949,7,0,-1},{9879,7,0,-1}, +{9953,6,0,-1},{9953,7,0,-1},{9958,6,0,-1},{9958,7,0,-1},{9962,6,0,-1}, +{9962,7,0,-1},{9966,6,0,-1},{9966,7,0,-1},{9971,6,0,-1},{9971,7,0,-1}, +{9975,6,0,-1},{9975,7,0,-1},{9979,6,0,-1},{9979,7,0,-1},{9984,6,0,-1}, +{9984,7,0,-1},{9988,6,0,-1},{9988,7,0,-1},{9992,6,0,-1},{9992,7,0,-1}, +{9997,6,0,-1},{9997,7,0,-1},{10001,6,0,-1},{10001,7,0,-1},{10005,6,0,-1}, +{10005,7,0,-1},{10010,6,0,-1},{10010,7,0,-1},{10014,6,0,-1},{10014,7,0,-1}, +{10018,6,0,-1},{10018,7,0,-1},{10023,6,0,-1},{10023,7,0,-1},{10027,6,0,-1}, +{10027,7,0,-1},{10031,6,0,-1},{10031,7,0,-1},{10036,6,0,-1},{10036,7,0,-1}, +{10040,6,0,-1},{10040,7,0,-1},{9970,6,0,-1},{10044,6,0,-1},{10044,7,0,-1}, +{10049,6,0,-1},{10049,7,0,-1},{10053,6,0,-1},{10053,7,0,-1},{9983,7,0,-1}, +{10057,6,0,-1},{10057,7,0,-1},{10062,6,0,-1},{10062,7,0,-1},{10066,6,0,-1}, +{10066,7,0,-1},{10070,6,0,-1},{10070,7,0,-1},{10075,6,0,-1},{10075,7,0,-1}, +{10079,6,0,-1},{10079,7,0,-1},{10083,6,0,-1},{10083,7,0,-1},{10088,6,0,-1}, +{10088,7,0,-1},{10092,6,0,-1},{10092,7,0,-1},{10096,6,0,-1},{10096,7,0,-1}, +{10101,6,0,-1},{10101,7,0,-1},{10105,6,0,-1},{10105,7,0,-1},{10109,6,0,-1}, +{10109,7,0,-1},{10114,6,0,-1},{10114,7,0,-1},{10118,6,0,-1},{10118,7,0,-1}, +{10122,6,0,-1},{10122,7,0,-1},{10127,6,0,-1},{10127,7,0,-1},{10131,6,0,-1}, +{10131,7,0,-1},{10135,6,0,-1},{10135,7,0,-1},{10140,6,0,-1},{10140,7,0,-1}, +{10144,6,0,-1},{10144,7,0,-1},{10074,6,0,-1},{10148,6,0,-1},{10148,7,0,-1}, +{10153,6,0,-1},{10153,7,0,-1},{10157,6,0,-1},{10157,7,0,-1},{10087,7,0,-1}, +{10161,6,0,-1},{10161,7,0,-1},{10166,6,0,-1},{10166,7,0,-1},{10170,6,0,-1}, +{10170,7,0,-1},{10174,6,0,-1},{10174,7,0,-1},{10179,6,0,-1},{10179,7,0,-1}, +{10183,6,0,-1},{10183,7,0,-1},{10187,6,0,-1},{10187,7,0,-1},{10192,6,0,-1}, +{10192,7,0,-1},{10196,6,0,-1},{10196,7,0,-1},{10200,6,0,-1},{10200,7,0,-1}, +{10205,6,0,-1},{10205,7,0,-1},{10209,6,0,-1},{10209,7,0,-1},{10213,6,0,-1}, +{10213,7,0,-1},{10218,6,0,-1},{10218,7,0,-1},{10222,6,0,-1},{10222,7,0,-1}, +{10226,6,0,-1},{10226,7,0,-1},{10231,6,0,-1},{10231,7,0,-1},{10235,6,0,-1}, +{10235,7,0,-1},{10239,6,0,-1},{10239,7,0,-1},{10244,6,0,-1},{10244,7,0,-1}, +{10248,6,0,-1},{10248,7,0,-1},{10178,6,0,-1},{10252,6,0,-1},{10252,7,0,-1}, +{10257,6,0,-1},{10257,7,0,-1},{10261,6,0,-1},{10261,7,0,-1},{10191,7,0,-1}, +{10265,6,0,-1},{10265,7,0,-1},{10270,6,0,-1},{10270,7,0,-1},{10274,6,0,-1}, +{10274,7,0,-1},{10278,6,0,-1},{10278,7,0,-1},{10283,6,0,-1},{10283,7,0,-1}, +{10287,6,0,-1},{10287,7,0,-1},{10291,6,0,-1},{10291,7,0,-1},{10296,6,0,-1}, +{10296,7,0,-1},{10300,6,0,-1},{10300,7,0,-1},{10304,6,0,-1},{10304,7,0,-1}, +{10309,6,0,-1},{10309,7,0,-1},{10313,6,0,-1},{10313,7,0,-1},{10317,6,0,-1}, +{10317,7,0,-1},{10322,6,0,-1},{10322,7,0,-1},{10326,6,0,-1},{10326,7,0,-1}, +{10330,6,0,-1},{10330,7,0,-1},{10335,6,0,-1},{10335,7,0,-1},{10339,6,0,-1}, +{10339,7,0,-1},{10343,6,0,-1},{10343,7,0,-1},{10348,6,0,-1},{10348,7,0,-1}, +{10352,6,0,-1},{10352,7,0,-1},{10282,6,0,-1},{10356,6,0,-1},{10356,7,0,-1}, +{10361,6,0,-1},{10361,7,0,-1},{10365,6,0,-1},{10365,7,0,-1},{10295,7,0,-1}, +{10369,6,0,-1},{10369,7,0,-1},{10374,6,0,-1},{10374,7,0,-1},{10378,6,0,-1}, +{10378,7,0,-1},{10382,6,0,-1},{10382,7,0,-1},{10387,6,0,-1},{10387,7,0,-1}, +{10391,6,0,-1},{10391,7,0,-1},{10395,6,0,-1},{10395,7,0,-1},{10400,6,0,-1}, +{10400,7,0,-1},{10404,6,0,-1},{10404,7,0,-1},{10408,6,0,-1},{10408,7,0,-1}, +{10413,6,0,-1},{10413,7,0,-1},{10417,6,0,-1},{10417,7,0,-1},{10421,6,0,-1}, +{10421,7,0,-1},{10426,6,0,-1},{10426,7,0,-1},{10430,6,0,-1},{10430,7,0,-1}, +{10434,6,0,-1},{10434,7,0,-1},{10439,6,0,-1},{10439,7,0,-1},{10443,6,0,-1}, +{10443,7,0,-1},{10447,6,0,-1},{10447,7,0,-1},{10452,6,0,-1},{10452,7,0,-1}, +{10456,6,0,-1},{10456,7,0,-1},{10386,6,0,-1},{10460,6,0,-1},{10460,7,0,-1}, +{10465,6,0,-1},{10465,7,0,-1},{10469,6,0,-1},{10469,7,0,-1},{10399,7,0,-1}, +{10473,6,0,-1},{10473,7,0,-1},{10478,6,0,-1},{10478,7,0,-1},{10482,6,0,-1}, +{10482,7,0,-1},{10486,6,0,-1},{10486,7,0,-1},{10491,6,0,-1},{10491,7,0,-1}, +{10495,6,0,-1},{10495,7,0,-1},{10499,6,0,-1},{10499,7,0,-1},{10504,6,0,-1}, +{10504,7,0,-1},{10508,6,0,-1},{10508,7,0,-1},{10512,6,0,-1},{10512,7,0,-1}, +{10517,6,0,-1},{10517,7,0,-1},{10521,6,0,-1},{10521,7,0,-1},{10525,6,0,-1}, +{10525,7,0,-1},{10530,6,0,-1},{10530,7,0,-1},{10534,6,0,-1},{10534,7,0,-1}, +{10538,6,0,-1},{10538,7,0,-1},{10543,6,0,-1},{10543,7,0,-1},{10547,6,0,-1}, +{10547,7,0,-1},{10551,6,0,-1},{10551,7,0,-1},{10556,6,0,-1},{10556,7,0,-1}, +{10560,6,0,-1},{10560,7,0,-1},{10490,6,0,-1},{10564,6,0,-1},{10564,7,0,-1}, +{10569,6,0,-1},{10569,7,0,-1},{10573,6,0,-1},{10573,7,0,-1},{10503,7,0,-1}, +{10577,6,0,-1},{10577,7,0,-1},{10582,6,0,-1},{10582,7,0,-1},{10586,6,0,-1}, +{10586,7,0,-1},{10590,6,0,-1},{10590,7,0,-1},{10595,6,0,-1},{10595,7,0,-1}, +{10599,6,0,-1},{10599,7,0,-1},{10603,6,0,-1},{10603,7,0,-1},{10608,6,0,-1}, +{10608,7,0,-1},{10612,6,0,-1},{10612,7,0,-1},{10616,6,0,-1},{10616,7,0,-1}, +{10621,6,0,-1},{10621,7,0,-1},{10625,6,0,-1},{10625,7,0,-1},{10629,6,0,-1}, +{10629,7,0,-1},{10634,6,0,-1},{10634,7,0,-1},{10638,6,0,-1},{10638,7,0,-1}, +{10642,6,0,-1},{10642,7,0,-1},{10647,6,0,-1},{10647,7,0,-1},{10651,6,0,-1}, +{10651,7,0,-1},{10655,6,0,-1},{10655,7,0,-1},{10660,6,0,-1},{10660,7,0,-1}, +{10664,6,0,-1},{10664,7,0,-1},{10594,6,0,-1},{10668,6,0,-1},{10668,7,0,-1}, +{10673,6,0,-1},{10673,7,0,-1},{10677,6,0,-1},{10677,7,0,-1},{10607,7,0,-1}, +{10681,6,0,-1},{10681,7,0,-1},{10686,6,0,-1},{10686,7,0,-1},{10690,6,0,-1}, +{10690,7,0,-1},{10694,6,0,-1},{10694,7,0,-1},{10699,6,0,-1},{10699,7,0,-1}, +{10703,6,0,-1},{10703,7,0,-1},{10707,6,0,-1},{10707,7,0,-1},{10712,6,0,-1}, +{10712,7,0,-1},{10716,6,0,-1},{10716,7,0,-1},{10720,6,0,-1},{10720,7,0,-1}, +{10725,6,0,-1},{10725,7,0,-1},{10729,6,0,-1},{10729,7,0,-1},{10733,6,0,-1}, +{10733,7,0,-1},{10738,6,0,-1},{10738,7,0,-1},{10742,6,0,-1},{10742,7,0,-1}, +{10746,6,0,-1},{10746,7,0,-1},{10751,6,0,-1},{10751,7,0,-1},{10755,6,0,-1}, +{10755,7,0,-1},{10759,6,0,-1},{10759,7,0,-1},{10764,6,0,-1},{10764,7,0,-1}, +{10768,6,0,-1},{10768,7,0,-1},{10698,6,0,-1},{10772,6,0,-1},{10772,7,0,-1}, +{10777,6,0,-1},{10777,7,0,-1},{10781,6,0,-1},{10781,7,0,-1},{10711,7,0,-1}, +{10785,6,0,-1},{10785,7,0,-1},{10790,6,0,-1},{10790,7,0,-1},{10794,6,0,-1}, +{10794,7,0,-1},{10798,6,0,-1},{10798,7,0,-1},{10803,6,0,-1},{10803,7,0,-1}, +{10807,6,0,-1},{10807,7,0,-1},{10811,6,0,-1},{10811,7,0,-1},{10816,6,0,-1}, +{10816,7,0,-1},{10820,6,0,-1},{10820,7,0,-1},{10824,6,0,-1},{10824,7,0,-1}, +{10829,6,0,-1},{10829,7,0,-1},{10833,6,0,-1},{10833,7,0,-1},{10837,6,0,-1}, +{10837,7,0,-1},{10842,6,0,-1},{10842,7,0,-1},{10846,6,0,-1},{10846,7,0,-1}, +{10850,6,0,-1},{10850,7,0,-1},{10855,6,0,-1},{10855,7,0,-1},{10859,6,0,-1}, +{10859,7,0,-1},{10863,6,0,-1},{10863,7,0,-1},{10868,6,0,-1},{10868,7,0,-1}, +{10872,6,0,-1},{10872,7,0,-1},{10802,6,0,-1},{10876,6,0,-1},{10876,7,0,-1}, +{10881,6,0,-1},{10881,7,0,-1},{10885,6,0,-1},{10885,7,0,-1},{10815,7,0,-1}, +{10889,6,0,-1},{10889,7,0,-1},{10894,6,0,-1},{10894,7,0,-1},{10898,6,0,-1}, +{10898,7,0,-1},{10902,6,0,-1},{10902,7,0,-1},{10907,6,0,-1},{10907,7,0,-1}, +{10911,6,0,-1},{10911,7,0,-1},{10915,6,0,-1},{10915,7,0,-1},{10920,6,0,-1}, +{10920,7,0,-1},{10924,6,0,-1},{10924,7,0,-1},{10928,6,0,-1},{10928,7,0,-1}, +{10933,6,0,-1},{10933,7,0,-1},{10937,6,0,-1},{10937,7,0,-1},{10941,6,0,-1}, +{10941,7,0,-1},{10946,6,0,-1},{10946,7,0,-1},{10950,6,0,-1},{10950,7,0,-1}, +{10954,6,0,-1},{10954,7,0,-1},{10959,6,0,-1},{10959,7,0,-1},{10963,6,0,-1}, +{10963,7,0,-1},{10967,6,0,-1},{10967,7,0,-1},{10972,6,0,-1},{10972,7,0,-1}, +{10976,6,0,-1},{10976,7,0,-1},{10906,6,0,-1},{10980,6,0,-1},{10980,7,0,-1}, +{10985,6,0,-1},{10985,7,0,-1},{10989,6,0,-1},{10989,7,0,-1},{10919,7,0,-1}, +{10993,6,0,-1},{10993,7,0,-1},{10998,6,0,-1},{10998,7,0,-1},{11002,6,0,-1}, +{11002,7,0,-1},{11006,6,0,-1},{11006,7,0,-1},{11011,6,0,-1},{11011,7,0,-1}, +{11015,6,0,-1},{11015,7,0,-1},{11019,6,0,-1},{11019,7,0,-1},{11024,6,0,-1}, +{11024,7,0,-1},{11028,6,0,-1},{11028,7,0,-1},{11032,6,0,-1},{11032,7,0,-1}, +{11037,6,0,-1},{11037,7,0,-1},{11041,6,0,-1},{11041,7,0,-1},{11045,6,0,-1}, +{11045,7,0,-1},{11050,6,0,-1},{11050,7,0,-1},{11054,6,0,-1},{11054,7,0,-1}, +{11058,6,0,-1},{11058,7,0,-1},{11063,6,0,-1},{11063,7,0,-1},{11067,6,0,-1}, +{11067,7,0,-1},{11071,6,0,-1},{11071,7,0,-1},{11076,6,0,-1},{11076,7,0,-1}, +{11080,6,0,-1},{11080,7,0,-1},{11010,6,0,-1},{11084,6,0,-1},{11084,7,0,-1}, +{11089,6,0,-1},{11089,7,0,-1},{11093,6,0,-1},{11093,7,0,-1},{11023,7,0,-1}, +{11097,6,0,-1},{11097,7,0,-1},{11102,6,0,-1},{11102,7,0,-1},{11106,6,0,-1}, +{11106,7,0,-1},{11110,6,0,-1},{11110,7,0,-1},{11115,6,0,-1},{11115,7,0,-1}, +{11119,6,0,-1},{11119,7,0,-1},{11123,6,0,-1},{11123,7,0,-1},{11128,6,0,-1}, +{11128,7,0,-1},{11132,6,0,-1},{11132,7,0,-1},{11136,6,0,-1},{11136,7,0,-1}, +{11141,6,0,-1},{11141,7,0,-1},{11145,6,0,-1},{11145,7,0,-1},{11149,6,0,-1}, +{11149,7,0,-1},{11154,6,0,-1},{11154,7,0,-1},{11158,6,0,-1},{11158,7,0,-1}, +{11162,6,0,-1},{11162,7,0,-1},{11167,6,0,-1},{11167,7,0,-1},{11171,6,0,-1}, +{11171,7,0,-1},{11175,6,0,-1},{11175,7,0,-1},{11180,6,0,-1},{11180,7,0,-1}, +{11184,6,0,-1},{11184,7,0,-1},{11114,6,0,-1},{11188,6,0,-1},{11188,7,0,-1}, +{11193,6,0,-1},{11193,7,0,-1},{11197,6,0,-1},{11197,7,0,-1},{11127,7,0,-1}, +{11201,6,0,-1},{11201,7,0,-1},{11206,6,0,-1},{11206,7,0,-1},{11210,6,0,-1}, +{11210,7,0,-1},{11214,6,0,-1},{11214,7,0,-1},{11219,6,0,-1},{11219,7,0,-1}, +{11223,6,0,-1},{11223,7,0,-1},{11227,6,0,-1},{11227,7,0,-1},{11232,6,0,-1}, +{11232,7,0,-1},{11236,6,0,-1},{11236,7,0,-1},{11240,6,0,-1},{11240,7,0,-1}, +{11245,6,0,-1},{11245,7,0,-1},{11249,6,0,-1},{11249,7,0,-1},{11253,6,0,-1}, +{11253,7,0,-1},{11258,6,0,-1},{11258,7,0,-1},{11262,6,0,-1},{11262,7,0,-1}, +{11266,6,0,-1},{11266,7,0,-1},{11271,6,0,-1},{11271,7,0,-1},{11275,6,0,-1}, +{11275,7,0,-1},{11279,6,0,-1},{11279,7,0,-1},{11284,6,0,-1},{11284,7,0,-1}, +{11288,6,0,-1},{11288,7,0,-1},{11218,6,0,-1},{11292,6,0,-1},{11292,7,0,-1}, +{11297,6,0,-1},{11297,7,0,-1},{11301,6,0,-1},{11301,7,0,-1},{11231,7,0,-1}, +{11305,6,0,-1},{11305,7,0,-1},{11310,6,0,-1},{11310,7,0,-1},{11314,6,0,-1}, +{11314,7,0,-1},{11318,6,0,-1},{11318,7,0,-1},{11323,6,0,-1},{11323,7,0,-1}, +{11327,6,0,-1},{11327,7,0,-1},{11331,6,0,-1},{11331,7,0,-1},{11336,6,0,-1}, +{11336,7,0,-1},{11340,6,0,-1},{11340,7,0,-1},{11344,6,0,-1},{11344,7,0,-1}, +{11349,6,0,-1},{11349,7,0,-1},{11353,6,0,-1},{11353,7,0,-1},{11357,6,0,-1}, +{11357,7,0,-1},{11362,6,0,-1},{11362,7,0,-1},{11366,6,0,-1},{11366,7,0,-1}, +{11370,6,0,-1},{11370,7,0,-1},{11375,6,0,-1},{11375,7,0,-1},{11379,6,0,-1}, +{11379,7,0,-1},{11383,6,0,-1},{11383,7,0,-1},{11388,6,0,-1},{11388,7,0,-1}, +{11392,6,0,-1},{11392,7,0,-1},{11322,6,0,-1},{11396,6,0,-1},{11396,7,0,-1}, +{11401,6,0,-1},{11401,7,0,-1},{11405,6,0,-1},{11405,7,0,-1},{11335,7,0,-1}, +{11409,6,0,-1},{11409,7,0,-1},{11414,6,0,-1},{11414,7,0,-1},{11418,6,0,-1}, +{11418,7,0,-1},{11422,6,0,-1},{11422,7,0,-1},{11427,6,0,-1},{11427,7,0,-1}, +{11431,6,0,-1},{11431,7,0,-1},{11435,6,0,-1},{11435,7,0,-1},{11440,6,0,-1}, +{11440,7,0,-1},{11444,6,0,-1},{11444,7,0,-1},{11448,6,0,-1},{11448,7,0,-1}, +{11453,6,0,-1},{11453,7,0,-1},{11457,6,0,-1},{11457,7,0,-1},{11461,6,0,-1}, +{11461,7,0,-1},{11466,6,0,-1},{11466,7,0,-1},{11470,6,0,-1},{11470,7,0,-1}, +{11474,6,0,-1},{11474,7,0,-1},{11479,6,0,-1},{11479,7,0,-1},{11483,6,0,-1}, +{11483,7,0,-1},{11487,6,0,-1},{11487,7,0,-1},{11492,6,0,-1},{11492,7,0,-1}, +{11496,6,0,-1},{11496,7,0,-1},{11426,6,0,-1},{11500,6,0,-1},{11500,7,0,-1}, +{11505,6,0,-1},{11505,7,0,-1},{11509,6,0,-1},{11509,7,0,-1},{11439,7,0,-1}, +{11513,6,0,-1},{11513,7,0,-1},{11518,6,0,-1},{11518,7,0,-1},{11522,6,0,-1}, +{11522,7,0,-1},{11526,6,0,-1},{11526,7,0,-1},{11531,6,0,-1},{11531,7,0,-1}, +{11535,6,0,-1},{11535,7,0,-1},{11539,6,0,-1},{11539,7,0,-1},{11544,6,0,-1}, +{11544,7,0,-1},{11548,6,0,-1},{11548,7,0,-1},{11552,6,0,-1},{11552,7,0,-1}, +{11557,6,0,-1},{11557,7,0,-1},{11561,6,0,-1},{11561,7,0,-1},{11565,6,0,-1}, +{11565,7,0,-1},{11570,6,0,-1},{11570,7,0,-1},{11574,6,0,-1},{11574,7,0,-1}, +{11578,6,0,-1},{11578,7,0,-1},{11583,6,0,-1},{11583,7,0,-1},{11587,6,0,-1}, +{11587,7,0,-1},{11591,6,0,-1},{11591,7,0,-1},{11596,6,0,-1},{11596,7,0,-1}, +{11600,6,0,-1},{11600,7,0,-1},{11530,6,0,-1},{11604,6,0,-1},{11604,7,0,-1}, +{11609,6,0,-1},{11609,7,0,-1},{11613,6,0,-1},{11613,7,0,-1},{11543,7,0,-1}, +{11617,6,0,-1},{11617,7,0,-1},{11622,6,0,-1},{11622,7,0,-1},{11626,6,0,-1}, +{11626,7,0,-1},{11630,6,0,-1},{11630,7,0,-1},{11635,6,0,-1},{11635,7,0,-1}, +{11639,6,0,-1},{11639,7,0,-1},{11643,6,0,-1},{11643,7,0,-1},{11648,6,0,-1}, +{11648,7,0,-1},{11652,6,0,-1},{11652,7,0,-1},{11656,6,0,-1},{11656,7,0,-1}, +{11661,6,0,-1},{11661,7,0,-1},{11665,6,0,-1},{11665,7,0,-1},{11669,6,0,-1}, +{11669,7,0,-1},{11674,6,0,-1},{11674,7,0,-1},{11678,6,0,-1},{11678,7,0,-1}, +{11682,6,0,-1},{11682,7,0,-1},{11687,6,0,-1},{11687,7,0,-1},{11691,6,0,-1}, +{11691,7,0,-1},{11695,6,0,-1},{11695,7,0,-1},{11700,6,0,-1},{11700,7,0,-1}, +{11704,6,0,-1},{11704,7,0,-1},{11634,6,0,-1},{11708,6,0,-1},{11708,7,0,-1}, +{11713,6,0,-1},{11713,7,0,-1},{11717,6,0,-1},{11717,7,0,-1},{11647,7,0,-1}, +{11721,6,0,-1},{11721,7,0,-1},{11726,6,0,-1},{11726,7,0,-1},{11730,6,0,-1}, +{11730,7,0,-1},{11734,6,0,-1},{11734,7,0,-1},{11739,6,0,-1},{11739,7,0,-1}, +{11743,6,0,-1},{11743,7,0,-1},{11747,6,0,-1},{11747,7,0,-1},{11752,6,0,-1}, +{11752,7,0,-1},{11756,6,0,-1},{11756,7,0,-1},{11760,6,0,-1},{11760,7,0,-1}, +{11765,6,0,-1},{11765,7,0,-1},{11769,6,0,-1},{11769,7,0,-1},{11773,6,0,-1}, +{11773,7,0,-1},{11778,6,0,-1},{11778,7,0,-1},{11782,6,0,-1},{11782,7,0,-1}, +{11786,6,0,-1},{11786,7,0,-1},{11791,6,0,-1},{11791,7,0,-1},{11795,6,0,-1}, +{11795,7,0,-1},{11799,6,0,-1},{11799,7,0,-1},{11804,6,0,-1},{11804,7,0,-1}, +{11808,6,0,-1},{11808,7,0,-1},{11738,6,0,-1},{11812,6,0,-1},{11812,7,0,-1}, +{11817,6,0,-1},{11817,7,0,-1},{11821,6,0,-1},{11821,7,0,-1},{11751,7,0,-1}, +{11825,6,0,-1},{11825,7,0,-1},{11830,6,0,-1},{11830,7,0,-1},{11834,6,0,-1}, +{11834,7,0,-1},{11838,6,0,-1},{11838,7,0,-1},{11843,6,0,-1},{11843,7,0,-1}, +{11847,6,0,-1},{11847,7,0,-1},{11851,6,0,-1},{11851,7,0,-1},{11856,6,0,-1}, +{11856,7,0,-1},{11860,6,0,-1},{11860,7,0,-1},{11864,6,0,-1},{11864,7,0,-1}, +{11869,6,0,-1},{11869,7,0,-1},{11873,6,0,-1},{11873,7,0,-1},{11877,6,0,-1}, +{11877,7,0,-1},{11882,6,0,-1},{11882,7,0,-1},{11886,6,0,-1},{11886,7,0,-1}, +{11890,6,0,-1},{11890,7,0,-1},{11895,6,0,-1},{11895,7,0,-1},{11899,6,0,-1}, +{11899,7,0,-1},{11903,6,0,-1},{11903,7,0,-1},{11908,6,0,-1},{11908,7,0,-1}, +{11912,6,0,-1},{11912,7,0,-1},{11842,6,0,-1},{11916,6,0,-1},{11916,7,0,-1}, +{11921,6,0,-1},{11921,7,0,-1},{11925,6,0,-1},{11925,7,0,-1},{11855,7,0,-1}, +{11929,6,0,-1},{11929,7,0,-1},{11934,6,0,-1},{11934,7,0,-1},{11938,6,0,-1}, +{11938,7,0,-1},{11942,6,0,-1},{11942,7,0,-1},{11947,6,0,-1},{11947,7,0,-1}, +{11951,6,0,-1},{11951,7,0,-1},{11955,6,0,-1},{11955,7,0,-1},{11960,6,0,-1}, +{11960,7,0,-1},{11964,6,0,-1},{11964,7,0,-1},{11968,6,0,-1},{11968,7,0,-1}, +{11973,6,0,-1},{11973,7,0,-1},{11977,6,0,-1},{11977,7,0,-1},{11981,6,0,-1}, +{11981,7,0,-1},{11986,6,0,-1},{11986,7,0,-1},{11990,6,0,-1},{11990,7,0,-1}, +{11994,6,0,-1},{11994,7,0,-1},{11999,6,0,-1},{11999,7,0,-1},{12003,6,0,-1}, +{12003,7,0,-1},{12007,6,0,-1},{12007,7,0,-1},{12012,6,0,-1},{12012,7,0,-1}, +{12016,6,0,-1},{12016,7,0,-1},{11946,6,0,-1},{12020,6,0,-1},{12020,7,0,-1}, +{12025,6,0,-1},{12025,7,0,-1},{12029,6,0,-1},{12029,7,0,-1},{11959,7,0,-1}, +{12033,6,0,-1},{12033,7,0,-1},{12038,6,0,-1},{12038,7,0,-1},{12042,6,0,-1}, +{12042,7,0,-1},{12046,6,0,-1},{12046,7,0,-1},{12051,6,0,-1},{12051,7,0,-1}, +{12055,6,0,-1},{12055,7,0,-1},{12059,6,0,-1},{12059,7,0,-1},{12064,6,0,-1}, +{12064,7,0,-1},{12068,6,0,-1},{12068,7,0,-1},{12072,6,0,-1},{12072,7,0,-1}, +{12077,6,0,-1},{12077,7,0,-1},{12081,6,0,-1},{12081,7,0,-1},{12085,6,0,-1}, +{12085,7,0,-1},{12090,6,0,-1},{12090,7,0,-1},{12094,6,0,-1},{12094,7,0,-1}, +{12098,6,0,-1},{12098,7,0,-1},{12103,6,0,-1},{12103,7,0,-1},{12107,6,0,-1}, +{12107,7,0,-1},{12111,6,0,-1},{12111,7,0,-1},{12116,6,0,-1},{12116,7,0,-1}, +{12120,6,0,-1},{12120,7,0,-1},{12050,6,0,-1},{12124,6,0,-1},{12124,7,0,-1}, +{12129,6,0,-1},{12129,7,0,-1},{12133,6,0,-1},{12133,7,0,-1},{12063,7,0,-1}, +{12137,6,0,-1},{12137,7,0,-1},{12142,6,0,-1},{12142,7,0,-1},{12146,6,0,-1}, +{12146,7,0,-1},{12150,6,0,-1},{12150,7,0,-1},{12155,6,0,-1},{12155,7,0,-1}, +{12159,6,0,-1},{12159,7,0,-1},{12163,6,0,-1},{12163,7,0,-1},{12168,6,0,-1}, +{12168,7,0,-1},{12172,6,0,-1},{12172,7,0,-1},{12176,6,0,-1},{12176,7,0,-1}, +{12181,6,0,-1},{12181,7,0,-1},{12185,6,0,-1},{12185,7,0,-1},{12189,6,0,-1}, +{12189,7,0,-1},{12194,6,0,-1},{12194,7,0,-1},{12198,6,0,-1},{12198,7,0,-1}, +{12202,6,0,-1},{12202,7,0,-1},{12207,6,0,-1},{12207,7,0,-1},{12211,6,0,-1}, +{12211,7,0,-1},{12215,6,0,-1},{12215,7,0,-1},{12220,6,0,-1},{12220,7,0,-1}, +{12224,6,0,-1},{12224,7,0,-1},{12154,6,0,-1},{12228,6,0,-1},{12228,7,0,-1}, +{12233,6,0,-1},{12233,7,0,-1},{12237,6,0,-1},{12237,7,0,-1},{12167,7,0,-1}, +{12241,6,0,-1},{12241,7,0,-1},{12246,6,0,-1},{12246,7,0,-1},{12250,7,0,-1}, +{12254,7,0,-1},{12259,6,0,-1},{12259,7,0,-1},{12263,7,0,-1},{12267,7,0,-1}, +{12272,6,0,-1},{12272,7,0,-1},{12276,6,0,-1},{12276,7,0,-1},{12280,6,0,-1}, +{12280,7,0,-1},{12285,6,0,-1},{12285,7,0,-1},{12289,7,0,-1},{12293,7,0,-1}, +{12298,7,0,-1},{12302,7,0,-1},{12306,6,0,-1},{12306,7,0,-1},{12311,6,0,-1}, +{12311,7,0,-1},{12315,7,0,-1},{12319,7,0,-1},{12324,7,0,-1},{12328,7,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS2, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_2_ss0_ss1[] = { +{8252,0,1,-1},{8987,2,0,-1},{8996,2,0,-1},{9004,2,0,-1},{9013,2,0,-1}, +{9022,2,0,-1},{9030,2,0,-1},{9039,2,0,-1},{9043,2,0,-1},{9048,2,0,-1}, +{8982,2,0,-1},{9056,2,0,-1},{9065,2,0,-1},{9074,2,0,-1},{9082,2,0,-1}, +{9091,2,0,-1},{9100,2,0,-1},{9108,2,0,-1},{9117,2,0,-1},{9126,2,0,-1}, +{9134,2,0,-1},{9143,2,0,-1},{9152,2,0,-1},{9086,2,0,-1},{9160,2,0,-1}, +{9169,2,0,-1},{9173,2,0,-1},{9178,2,0,-1},{9182,2,0,-1},{9186,2,0,-1}, +{9191,2,0,-1},{9195,2,0,-1},{9199,2,0,-1},{9204,2,0,-1},{9208,2,0,-1}, +{9212,2,0,-1},{9217,2,0,-1},{9221,2,0,-1},{9225,2,0,-1},{9230,2,0,-1}, +{9234,2,0,-1},{9238,2,0,-1},{9243,2,0,-1},{9247,2,0,-1},{9251,2,0,-1}, +{9256,2,0,-1},{9190,2,0,-1},{9260,2,0,-1},{9264,2,0,-1},{9269,2,0,-1}, +{9273,2,0,-1},{9277,2,0,-1},{9282,2,0,-1},{9286,2,0,-1},{9290,2,0,-1}, +{9295,2,0,-1},{9299,2,0,-1},{9303,2,0,-1},{9308,2,0,-1},{9312,2,0,-1}, +{9316,2,0,-1},{9321,2,0,-1},{9325,2,0,-1},{9329,2,0,-1},{9334,2,0,-1}, +{9338,2,0,-1},{9342,2,0,-1},{9347,2,0,-1},{9351,2,0,-1},{9355,2,0,-1}, +{9360,2,0,-1},{9294,2,0,-1},{9364,2,0,-1},{9368,2,0,-1},{9369,2,1,-1}, +{9373,2,0,-1},{9377,2,0,-1},{9381,2,0,-1},{9382,2,1,-1},{9386,2,0,-1}, +{9390,2,0,-1},{9391,2,1,-1},{9394,2,0,-1},{9395,2,1,-1},{9399,2,0,-1}, +{9403,2,0,-1},{9404,2,1,-1},{9407,2,0,-1},{9412,2,0,-1},{9413,2,1,-1}, +{9416,2,0,-1},{9420,2,0,-1},{9421,2,1,-1},{9425,2,0,-1},{9429,2,0,-1}, +{9430,2,1,-1},{9433,2,0,-1},{9438,2,0,-1},{9439,2,1,-1},{9442,2,0,-1}, +{9446,2,0,-1},{9447,2,1,-1},{9451,2,0,-1},{9455,2,0,-1},{9456,2,1,-1}, +{9459,2,0,-1},{9464,2,0,-1},{9465,2,1,-1},{9398,2,0,-1},{9468,2,0,-1}, +{9472,2,0,-1},{9473,2,1,-1},{9477,2,0,-1},{9411,2,1,-1},{9481,2,0,-1}, +{9482,2,1,-1},{9485,2,0,-1},{9490,2,0,-1},{9491,2,1,-1},{9494,2,0,-1}, +{9498,2,0,-1},{9499,2,1,-1},{9503,2,0,-1},{9504,2,1,-1},{9507,2,0,-1}, +{9508,2,1,-1},{9511,2,0,-1},{9512,2,1,-1},{9516,2,0,-1},{9517,2,1,-1}, +{9520,2,0,-1},{9521,2,1,-1},{9524,2,0,-1},{9525,2,1,-1},{9529,2,0,-1}, +{9533,2,0,-1},{9534,2,1,-1},{9537,2,0,-1},{9538,2,1,-1},{9542,2,0,-1}, +{9543,2,1,-1},{9546,2,0,-1},{9547,2,1,-1},{9550,2,0,-1},{9551,2,1,-1}, +{9555,2,0,-1},{9556,2,1,-1},{9559,2,0,-1},{9560,2,1,-1},{9563,2,0,-1}, +{9564,2,1,-1},{9568,2,0,-1},{9569,2,1,-1},{9502,2,0,-1},{9573,2,1,-1}, +{9576,2,0,-1},{9577,2,1,-1},{9581,2,0,-1},{9582,2,1,-1},{9515,2,1,-1}, +{9585,2,0,-1},{9586,2,1,-1},{9589,2,0,-1},{9590,2,1,-1},{9594,2,0,-1}, +{9595,2,1,-1},{9598,2,0,-1},{9599,2,1,-1},{9602,2,0,-1},{9603,2,1,-1}, +{9607,2,0,-1},{9608,2,1,-1},{9611,2,0,-1},{9612,2,1,-1},{9615,2,0,-1}, +{9616,2,1,-1},{9620,2,0,-1},{9621,2,1,-1},{9624,2,0,-1},{9625,2,1,-1}, +{9628,2,0,-1},{9629,2,1,-1},{9633,2,0,-1},{9634,2,1,-1},{9637,2,0,-1}, +{9638,2,1,-1},{9641,2,0,-1},{9642,2,1,-1},{9646,2,0,-1},{9647,2,1,-1}, +{9650,2,0,-1},{9651,2,1,-1},{9654,2,0,-1},{9655,2,1,-1},{9659,2,0,-1}, +{9660,2,1,-1},{9663,2,0,-1},{9664,2,1,-1},{9667,2,0,-1},{9668,2,1,-1}, +{9672,2,0,-1},{9673,2,1,-1},{9606,2,0,-1},{9676,2,0,-1},{9677,2,1,-1}, +{9680,2,0,-1},{9681,2,1,-1},{9685,2,0,-1},{9686,2,1,-1},{9619,2,1,-1}, +{9689,2,0,-1},{9690,2,1,-1},{9693,2,0,-1},{9694,2,1,-1},{9698,2,0,-1}, +{9699,2,1,-1},{9702,2,0,-1},{9703,2,1,-1},{9706,2,0,-1},{9707,2,1,-1}, +{9711,2,0,-1},{9712,2,1,-1},{9715,2,0,-1},{9716,2,1,-1},{9719,2,0,-1}, +{9724,2,0,-1},{9725,2,1,-1},{9728,2,0,-1},{9729,2,1,-1},{9732,2,0,-1}, +{9733,2,1,-1},{9737,2,0,-1},{9738,2,1,-1},{9741,2,0,-1},{9742,2,1,-1}, +{9745,2,0,-1},{9746,2,1,-1},{9750,2,0,-1},{9751,2,1,-1},{9754,2,0,-1}, +{9755,2,1,-1},{9758,2,0,-1},{9759,2,1,-1},{9764,2,1,-1},{9767,2,0,-1}, +{9768,2,1,-1},{9771,2,0,-1},{9776,2,0,-1},{9777,2,1,-1},{9710,2,0,-1}, +{9780,2,0,-1},{9781,2,1,-1},{9784,2,0,-1},{9785,2,1,-1},{9789,2,0,-1}, +{9790,2,1,-1},{9723,2,1,-1},{9793,2,0,-1},{9794,2,1,-1},{9797,2,0,-1}, +{9798,2,1,-1},{9802,2,0,-1},{9803,2,1,-1},{9806,2,0,-1},{9807,2,1,-1}, +{9810,2,0,-1},{9811,2,1,-1},{9815,2,0,-1},{9816,2,1,-1},{9819,2,0,-1}, +{9820,2,1,-1},{9823,2,0,-1},{9824,2,1,-1},{9828,2,0,-1},{9829,2,1,-1}, +{9832,2,0,-1},{9833,2,1,-1},{9836,2,0,-1},{9837,2,1,-1},{9841,2,0,-1}, +{9842,2,1,-1},{9845,2,0,-1},{9846,2,1,-1},{9849,2,0,-1},{9850,2,1,-1}, +{9854,2,0,-1},{9855,2,1,-1},{9858,2,0,-1},{9859,2,1,-1},{9862,2,0,-1}, +{9863,2,1,-1},{9867,2,0,-1},{9868,2,1,-1},{9871,2,0,-1},{9872,2,1,-1}, +{9875,2,0,-1},{9876,2,1,-1},{9880,2,0,-1},{9881,2,1,-1},{9814,2,0,-1}, +{9884,2,0,-1},{9885,2,1,-1},{9888,2,0,-1},{9889,2,1,-1},{9893,2,0,-1}, +{9894,2,1,-1},{9827,2,1,-1},{9897,2,0,-1},{9898,2,1,-1},{9901,2,0,-1}, +{9902,2,1,-1},{9906,2,0,-1},{9907,2,1,-1},{9910,2,0,-1},{9911,2,1,-1}, +{9914,2,0,-1},{9915,2,1,-1},{9919,2,0,-1},{9920,2,1,-1},{9923,2,0,-1}, +{9924,2,1,-1},{9927,2,0,-1},{9928,2,1,-1},{9932,2,0,-1},{9933,2,1,-1}, +{9936,2,0,-1},{9937,2,1,-1},{9940,2,0,-1},{9941,2,1,-1},{9945,2,0,-1}, +{9946,2,1,-1},{9949,2,0,-1},{9950,2,1,-1},{9953,2,0,-1},{9954,2,1,-1}, +{9958,2,0,-1},{9959,2,1,-1},{9962,2,0,-1},{9963,2,1,-1},{9966,2,0,-1}, +{9967,2,1,-1},{9971,2,0,-1},{9972,2,1,-1},{9975,2,0,-1},{9976,2,1,-1}, +{9979,2,0,-1},{9980,2,1,-1},{9984,2,0,-1},{9985,2,1,-1},{9918,2,0,-1}, +{9988,2,0,-1},{9989,2,1,-1},{9992,2,0,-1},{9993,2,1,-1},{9997,2,0,-1}, +{9998,2,1,-1},{9931,2,1,-1},{10001,2,0,-1},{10002,2,1,-1},{10005,2,0,-1}, +{10006,2,1,-1},{10010,2,0,-1},{10011,2,1,-1},{10014,2,0,-1},{10015,2,1,-1}, +{10018,2,0,-1},{10019,2,1,-1},{10023,2,0,-1},{10024,2,1,-1},{10027,2,0,-1}, +{10028,2,1,-1},{10031,2,0,-1},{10032,2,1,-1},{10036,2,0,-1},{10037,2,1,-1}, +{10040,2,0,-1},{10041,2,1,-1},{10044,2,0,-1},{10045,2,1,-1},{10049,2,0,-1}, +{10050,2,1,-1},{10053,2,0,-1},{10054,2,1,-1},{10057,2,0,-1},{10058,2,1,-1}, +{10062,2,0,-1},{10063,2,1,-1},{10066,2,0,-1},{10067,2,1,-1},{10070,2,0,-1}, +{10071,2,1,-1},{10075,2,0,-1},{10076,2,1,-1},{10079,2,0,-1},{10080,2,1,-1}, +{10083,2,0,-1},{10084,2,1,-1},{10088,2,0,-1},{10089,2,1,-1},{10022,2,0,-1}, +{10092,2,0,-1},{10093,2,1,-1},{10096,2,0,-1},{10097,2,1,-1},{10101,2,0,-1}, +{10102,2,1,-1},{10035,2,1,-1},{10105,2,0,-1},{10106,2,1,-1},{10109,2,0,-1}, +{10110,2,1,-1},{10114,2,0,-1},{10115,2,1,-1},{10118,2,0,-1},{10119,2,1,-1}, +{10122,2,0,-1},{10123,2,1,-1},{10127,2,0,-1},{10128,2,1,-1},{10131,2,0,-1}, +{10132,2,1,-1},{10135,2,0,-1},{10136,2,1,-1},{10140,2,0,-1},{10141,2,1,-1}, +{10144,2,0,-1},{10145,2,1,-1},{10148,2,0,-1},{10149,2,1,-1},{10153,2,0,-1}, +{10154,2,1,-1},{10157,2,0,-1},{10158,2,1,-1},{10161,2,0,-1},{10162,2,1,-1}, +{10166,2,0,-1},{10167,2,1,-1},{10170,2,0,-1},{10171,2,1,-1},{10174,2,0,-1}, +{10175,2,1,-1},{10179,2,0,-1},{10180,2,1,-1},{10183,2,0,-1},{10184,2,1,-1}, +{10187,2,0,-1},{10188,2,1,-1},{10192,2,0,-1},{10193,2,1,-1},{10126,2,0,-1}, +{10196,2,0,-1},{10197,2,1,-1},{10200,2,0,-1},{10201,2,1,-1},{10205,2,0,-1}, +{10206,2,1,-1},{10139,2,1,-1},{10209,2,0,-1},{10210,2,1,-1},{10213,2,0,-1}, +{10214,2,1,-1},{10218,2,0,-1},{10219,2,1,-1},{10222,2,0,-1},{10223,2,1,-1}, +{10226,2,0,-1},{10227,2,1,-1},{10231,2,0,-1},{10232,2,1,-1},{10235,2,0,-1}, +{10236,2,1,-1},{10239,2,0,-1},{10240,2,1,-1},{10244,2,0,-1},{10245,2,1,-1}, +{10248,2,0,-1},{10249,2,1,-1},{10252,2,0,-1},{10253,2,1,-1},{10257,2,0,-1}, +{10258,2,1,-1},{10261,2,0,-1},{10262,2,1,-1},{10265,2,0,-1},{10266,2,1,-1}, +{10270,2,0,-1},{10271,2,1,-1},{10274,2,0,-1},{10275,2,1,-1},{10278,2,0,-1}, +{10279,2,1,-1},{10283,2,0,-1},{10284,2,1,-1},{10287,2,0,-1},{10288,2,1,-1}, +{10291,2,0,-1},{10292,2,1,-1},{10296,2,0,-1},{10297,2,1,-1},{10230,2,0,-1}, +{10300,2,0,-1},{10301,2,1,-1},{10304,2,0,-1},{10305,2,1,-1},{10309,2,0,-1}, +{10310,2,1,-1},{10243,2,1,-1},{10313,2,0,-1},{10314,2,1,-1},{10317,2,0,-1}, +{10318,2,1,-1},{10322,2,0,-1},{10323,2,1,-1},{10326,2,0,-1},{10327,2,1,-1}, +{10330,2,0,-1},{10331,2,1,-1},{10335,2,0,-1},{10336,2,1,-1},{10339,2,0,-1}, +{10340,2,1,-1},{10343,2,0,-1},{10344,2,1,-1},{10348,2,0,-1},{10349,2,1,-1}, +{10352,2,0,-1},{10353,2,1,-1},{10356,2,0,-1},{10357,2,1,-1},{10361,2,0,-1}, +{10362,2,1,-1},{10365,2,0,-1},{10366,2,1,-1},{10369,2,0,-1},{10370,2,1,-1}, +{10374,2,0,-1},{10375,2,1,-1},{10378,2,0,-1},{10379,2,1,-1},{10382,2,0,-1}, +{10383,2,1,-1},{10387,2,0,-1},{10388,2,1,-1},{10391,2,0,-1},{10392,2,1,-1}, +{10395,2,0,-1},{10396,2,1,-1},{10400,2,0,-1},{10401,2,1,-1},{10334,2,0,-1}, +{10404,2,0,-1},{10405,2,1,-1},{10408,2,0,-1},{10409,2,1,-1},{10413,2,0,-1}, +{10414,2,1,-1},{10347,2,1,-1},{10417,2,0,-1},{10418,2,1,-1},{10421,2,0,-1}, +{10422,2,1,-1},{10426,2,0,-1},{10427,2,1,-1},{10430,2,0,-1},{10431,2,1,-1}, +{10434,2,0,-1},{10435,2,1,-1},{10439,2,0,-1},{10440,2,1,-1},{10443,2,0,-1}, +{10444,2,1,-1},{10447,2,0,-1},{10448,2,1,-1},{10452,2,0,-1},{10453,2,1,-1}, +{10456,2,0,-1},{10457,2,1,-1},{10460,2,0,-1},{10461,2,1,-1},{10465,2,0,-1}, +{10466,2,1,-1},{10469,2,0,-1},{10470,2,1,-1},{10473,2,0,-1},{10474,2,1,-1}, +{10478,2,0,-1},{10479,2,1,-1},{10482,2,0,-1},{10483,2,1,-1},{10486,2,0,-1}, +{10487,2,1,-1},{10491,2,0,-1},{10492,2,1,-1},{10495,2,0,-1},{10496,2,1,-1}, +{10499,2,0,-1},{10500,2,1,-1},{10504,2,0,-1},{10505,2,1,-1},{10438,2,0,-1}, +{10508,2,0,-1},{10509,2,1,-1},{10512,2,0,-1},{10513,2,1,-1},{10517,2,0,-1}, +{10518,2,1,-1},{10451,2,1,-1},{10521,2,0,-1},{10522,2,1,-1},{10525,2,0,-1}, +{10526,2,1,-1},{10530,2,0,-1},{10531,2,1,-1},{10534,2,0,-1},{10535,2,1,-1}, +{10538,2,0,-1},{10539,2,1,-1},{10543,2,0,-1},{10544,2,1,-1},{10547,2,0,-1}, +{10548,2,1,-1},{10551,2,0,-1},{10552,2,1,-1},{10556,2,0,-1},{10557,2,1,-1}, +{10560,2,0,-1},{10561,2,1,-1},{10564,2,0,-1},{10565,2,1,-1},{10569,2,0,-1}, +{10570,2,1,-1},{10573,2,0,-1},{10574,2,1,-1},{10577,2,0,-1},{10578,2,1,-1}, +{10582,2,0,-1},{10583,2,1,-1},{10586,2,0,-1},{10587,2,1,-1},{10590,2,0,-1}, +{10591,2,1,-1},{10595,2,0,-1},{10596,2,1,-1},{10599,2,0,-1},{10600,2,1,-1}, +{10603,2,0,-1},{10604,2,1,-1},{10608,2,0,-1},{10609,2,1,-1},{10542,2,0,-1}, +{10612,2,0,-1},{10613,2,1,-1},{10616,2,0,-1},{10617,2,1,-1},{10621,2,0,-1}, +{10622,2,1,-1},{10555,2,1,-1},{10625,2,0,-1},{10626,2,1,-1},{10629,2,0,-1}, +{10630,2,1,-1},{10634,2,0,-1},{10635,2,1,-1},{10638,2,0,-1},{10639,2,1,-1}, +{10642,2,0,-1},{10643,2,1,-1},{10647,2,0,-1},{10648,2,1,-1},{10651,2,0,-1}, +{10652,2,1,-1},{10655,2,0,-1},{10656,2,1,-1},{10660,2,0,-1},{10661,2,1,-1}, +{10664,2,0,-1},{10665,2,1,-1},{10668,2,0,-1},{10669,2,1,-1},{10673,2,0,-1}, +{10674,2,1,-1},{10677,2,0,-1},{10678,2,1,-1},{10681,2,0,-1},{10682,2,1,-1}, +{10686,2,0,-1},{10687,2,1,-1},{10690,2,0,-1},{10691,2,1,-1},{10694,2,0,-1}, +{10695,2,1,-1},{10699,2,0,-1},{10700,2,1,-1},{10703,2,0,-1},{10704,2,1,-1}, +{10707,2,0,-1},{10708,2,1,-1},{10712,2,0,-1},{10713,2,1,-1},{10646,2,0,-1}, +{10716,2,0,-1},{10717,2,1,-1},{10720,2,0,-1},{10721,2,1,-1},{10725,2,0,-1}, +{10726,2,1,-1},{10659,2,1,-1},{10729,2,0,-1},{10730,2,1,-1},{10733,2,0,-1}, +{10734,2,1,-1},{10738,2,0,-1},{10739,2,1,-1},{10742,2,0,-1},{10743,2,1,-1}, +{10746,2,0,-1},{10747,2,1,-1},{10751,2,0,-1},{10752,2,1,-1},{10755,2,0,-1}, +{10756,2,1,-1},{10759,2,0,-1},{10760,2,1,-1},{10764,2,0,-1},{10765,2,1,-1}, +{10768,2,0,-1},{10769,2,1,-1},{10772,2,0,-1},{10773,2,1,-1},{10777,2,0,-1}, +{10778,2,1,-1},{10781,2,0,-1},{10782,2,1,-1},{10785,2,0,-1},{10786,2,1,-1}, +{10790,2,0,-1},{10791,2,1,-1},{10794,2,0,-1},{10795,2,1,-1},{10798,2,0,-1}, +{10799,2,1,-1},{10803,2,0,-1},{10804,2,1,-1},{10807,2,0,-1},{10808,2,1,-1}, +{10811,2,0,-1},{10812,2,1,-1},{10816,2,0,-1},{10817,2,1,-1},{10750,2,0,-1}, +{10820,2,0,-1},{10821,2,1,-1},{10824,2,0,-1},{10825,2,1,-1},{10829,2,0,-1}, +{10830,2,1,-1},{10763,2,1,-1},{10833,2,0,-1},{10834,2,1,-1},{10837,2,0,-1}, +{10838,2,1,-1},{10842,2,0,-1},{10843,2,1,-1},{10846,2,0,-1},{10847,2,1,-1}, +{10850,2,0,-1},{10851,2,1,-1},{10855,2,0,-1},{10856,2,1,-1},{10859,2,0,-1}, +{10860,2,1,-1},{10863,2,0,-1},{10864,2,1,-1},{10868,2,0,-1},{10869,2,1,-1}, +{10872,2,0,-1},{10873,2,1,-1},{10876,2,0,-1},{10877,2,1,-1},{10881,2,0,-1}, +{10882,2,1,-1},{10885,2,0,-1},{10886,2,1,-1},{10889,2,0,-1},{10890,2,1,-1}, +{10894,2,0,-1},{10895,2,1,-1},{10898,2,0,-1},{10899,2,1,-1},{10902,2,0,-1}, +{10903,2,1,-1},{10907,2,0,-1},{10908,2,1,-1},{10911,2,0,-1},{10912,2,1,-1}, +{10915,2,0,-1},{10916,2,1,-1},{10920,2,0,-1},{10921,2,1,-1},{10854,2,0,-1}, +{10924,2,0,-1},{10925,2,1,-1},{10928,2,0,-1},{10929,2,1,-1},{10933,2,0,-1}, +{10934,2,1,-1},{10867,2,1,-1},{10937,2,0,-1},{10938,2,1,-1},{10941,2,0,-1}, +{10942,2,1,-1},{10946,2,0,-1},{10947,2,1,-1},{10950,2,0,-1},{10951,2,1,-1}, +{10954,2,0,-1},{10955,2,1,-1},{10959,2,0,-1},{10960,2,1,-1},{10963,2,0,-1}, +{10964,2,1,-1},{10967,2,0,-1},{10968,2,1,-1},{10972,2,0,-1},{10973,2,1,-1}, +{10976,2,0,-1},{10977,2,1,-1},{10980,2,0,-1},{10981,2,1,-1},{10985,2,0,-1}, +{10986,2,1,-1},{10989,2,0,-1},{10990,2,1,-1},{10993,2,0,-1},{10994,2,1,-1}, +{10998,2,0,-1},{10999,2,1,-1},{11002,2,0,-1},{11003,2,1,-1},{11006,2,0,-1}, +{11007,2,1,-1},{11011,2,0,-1},{11012,2,1,-1},{11015,2,0,-1},{11016,2,1,-1}, +{11019,2,0,-1},{11020,2,1,-1},{11024,2,0,-1},{11025,2,1,-1},{10958,2,0,-1}, +{11028,2,0,-1},{11029,2,1,-1},{11032,2,0,-1},{11033,2,1,-1},{11037,2,0,-1}, +{11038,2,1,-1},{10971,2,1,-1},{11041,2,0,-1},{11042,2,1,-1},{11045,2,0,-1}, +{11046,2,1,-1},{11050,2,0,-1},{11051,2,1,-1},{11054,2,0,-1},{11055,2,1,-1}, +{11058,2,0,-1},{11059,2,1,-1},{11063,2,0,-1},{11064,2,1,-1},{11067,2,0,-1}, +{11068,2,1,-1},{11071,2,0,-1},{11072,2,1,-1},{11076,2,0,-1},{11077,2,1,-1}, +{11080,2,0,-1},{11081,2,1,-1},{11084,2,0,-1},{11085,2,1,-1},{11089,2,0,-1}, +{11090,2,1,-1},{11093,2,0,-1},{11094,2,1,-1},{11097,2,0,-1},{11098,2,1,-1}, +{11102,2,0,-1},{11103,2,1,-1},{11106,2,0,-1},{11107,2,1,-1},{11110,2,0,-1}, +{11111,2,1,-1},{11115,2,0,-1},{11116,2,1,-1},{11119,2,0,-1},{11120,2,1,-1}, +{11123,2,0,-1},{11124,2,1,-1},{11128,2,0,-1},{11129,2,1,-1},{11062,2,0,-1}, +{11132,2,0,-1},{11133,2,1,-1},{11136,2,0,-1},{11137,2,1,-1},{11141,2,0,-1}, +{11142,2,1,-1},{11075,2,1,-1},{11145,2,0,-1},{11146,2,1,-1},{11149,2,0,-1}, +{11150,2,1,-1},{11154,2,0,-1},{11155,2,1,-1},{11158,2,0,-1},{11159,2,1,-1}, +{11162,2,0,-1},{11163,2,1,-1},{11167,2,0,-1},{11168,2,1,-1},{11171,2,0,-1}, +{11172,2,1,-1},{11175,2,0,-1},{11176,2,1,-1},{11180,2,0,-1},{11181,2,1,-1}, +{11184,2,0,-1},{11185,2,1,-1},{11188,2,0,-1},{11189,2,1,-1},{11193,2,0,-1}, +{11194,2,1,-1},{11197,2,0,-1},{11198,2,1,-1},{11201,2,0,-1},{11202,2,1,-1}, +{11206,2,0,-1},{11207,2,1,-1},{11210,2,0,-1},{11211,2,1,-1},{11214,2,0,-1}, +{11215,2,1,-1},{11219,2,0,-1},{11220,2,1,-1},{11223,2,0,-1},{11224,2,1,-1}, +{11227,2,0,-1},{11228,2,1,-1},{11232,2,0,-1},{11233,2,1,-1},{11166,2,0,-1}, +{11236,2,0,-1},{11237,2,1,-1},{11240,2,0,-1},{11241,2,1,-1},{11245,2,0,-1}, +{11246,2,1,-1},{11179,2,1,-1},{11249,2,0,-1},{11250,2,1,-1},{11253,2,0,-1}, +{11254,2,1,-1},{11258,2,0,-1},{11259,2,1,-1},{11262,2,0,-1},{11263,2,1,-1}, +{11266,2,0,-1},{11267,2,1,-1},{11271,2,0,-1},{11272,2,1,-1},{11275,2,0,-1}, +{11276,2,1,-1},{11279,2,0,-1},{11280,2,1,-1},{11284,2,0,-1},{11285,2,1,-1}, +{11288,2,0,-1},{11289,2,1,-1},{11292,2,0,-1},{11293,2,1,-1},{11297,2,0,-1}, +{11298,2,1,-1},{11301,2,0,-1},{11302,2,1,-1},{11305,2,0,-1},{11306,2,1,-1}, +{11310,2,0,-1},{11311,2,1,-1},{11314,2,0,-1},{11315,2,1,-1},{11318,2,0,-1}, +{11319,2,1,-1},{11323,2,0,-1},{11324,2,1,-1},{11327,2,0,-1},{11328,2,1,-1}, +{11331,2,0,-1},{11332,2,1,-1},{11336,2,0,-1},{11337,2,1,-1},{11270,2,0,-1}, +{11340,2,0,-1},{11341,2,1,-1},{11344,2,0,-1},{11345,2,1,-1},{11349,2,0,-1}, +{11350,2,1,-1},{11283,2,1,-1},{11353,2,0,-1},{11354,2,1,-1},{11357,2,0,-1}, +{11358,2,1,-1},{11362,2,0,-1},{11363,2,1,-1},{11366,2,0,-1},{11367,2,1,-1}, +{11370,2,0,-1},{11371,2,1,-1},{11375,2,0,-1},{11376,2,1,-1},{11379,2,0,-1}, +{11380,2,1,-1},{11383,2,0,-1},{11384,2,1,-1},{11388,2,0,-1},{11389,2,1,-1}, +{11392,2,0,-1},{11393,2,1,-1},{11396,2,0,-1},{11397,2,1,-1},{11401,2,0,-1}, +{11402,2,1,-1},{11405,2,0,-1},{11406,2,1,-1},{11409,2,0,-1},{11410,2,1,-1}, +{11414,2,0,-1},{11415,2,1,-1},{11418,2,0,-1},{11419,2,1,-1},{11422,2,0,-1}, +{11423,2,1,-1},{11427,2,0,-1},{11428,2,1,-1},{11431,2,0,-1},{11432,2,1,-1}, +{11435,2,0,-1},{11436,2,1,-1},{11440,2,0,-1},{11441,2,1,-1},{11374,2,0,-1}, +{11444,2,0,-1},{11445,2,1,-1},{11448,2,0,-1},{11449,2,1,-1},{11453,2,0,-1}, +{11454,2,1,-1},{11387,2,1,-1},{11457,2,0,-1},{11458,2,1,-1},{11461,2,0,-1}, +{11462,2,1,-1},{11466,2,0,-1},{11467,2,1,-1},{11470,2,0,-1},{11471,2,1,-1}, +{11474,2,0,-1},{11475,2,1,-1},{11479,2,0,-1},{11480,2,1,-1},{11483,2,0,-1}, +{11484,2,1,-1},{11487,2,0,-1},{11488,2,1,-1},{11492,2,0,-1},{11493,2,1,-1}, +{11496,2,0,-1},{11497,2,1,-1},{11500,2,0,-1},{11501,2,1,-1},{11505,2,0,-1}, +{11506,2,1,-1},{11509,2,0,-1},{11510,2,1,-1},{11513,2,0,-1},{11514,2,1,-1}, +{11518,2,0,-1},{11519,2,1,-1},{11522,2,0,-1},{11523,2,1,-1},{11526,2,0,-1}, +{11527,2,1,-1},{11531,2,0,-1},{11532,2,1,-1},{11535,2,0,-1},{11536,2,1,-1}, +{11539,2,0,-1},{11540,2,1,-1},{11544,2,0,-1},{11545,2,1,-1},{11478,2,0,-1}, +{11548,2,0,-1},{11549,2,1,-1},{11552,2,0,-1},{11553,2,1,-1},{11557,2,0,-1}, +{11558,2,1,-1},{11491,2,1,-1},{11561,2,0,-1},{11562,2,1,-1},{11565,2,0,-1}, +{11566,2,1,-1},{11570,2,0,-1},{11571,2,1,-1},{11574,2,0,-1},{11575,2,1,-1}, +{11578,2,0,-1},{11579,2,1,-1},{11583,2,0,-1},{11584,2,1,-1},{11587,2,0,-1}, +{11588,2,1,-1},{11591,2,0,-1},{11596,2,0,-1},{11597,2,1,-1},{11600,2,0,-1}, +{11601,2,1,-1},{11604,2,0,-1},{11605,2,1,-1},{11609,2,0,-1},{11610,2,1,-1}, +{11613,2,0,-1},{11614,2,1,-1},{11617,2,0,-1},{11618,2,1,-1},{11622,2,0,-1}, +{11623,2,1,-1},{11626,2,0,-1},{11627,2,1,-1},{11630,2,0,-1},{11631,2,1,-1}, +{11635,2,0,-1},{11636,2,1,-1},{11639,2,0,-1},{11640,2,1,-1},{11648,2,0,-1}, +{11649,2,1,-1},{11582,2,0,-1},{11652,2,0,-1},{11653,2,1,-1},{11656,2,0,-1}, +{11657,2,1,-1},{11661,2,0,-1},{11662,2,1,-1},{11665,2,0,-1},{11666,2,1,-1}, +{11669,2,0,-1},{11670,2,1,-1},{11674,2,0,-1},{11675,2,1,-1},{11678,2,0,-1}, +{11679,2,1,-1},{11682,2,0,-1},{11683,2,1,-1},{11687,2,0,-1},{11688,2,1,-1}, +{11691,2,0,-1},{11692,2,1,-1},{11700,2,0,-1},{11704,2,0,-1},{11708,2,0,-1}, +{11713,2,0,-1},{11717,2,0,-1},{11721,2,0,-1},{11726,2,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS3, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_3_ss0_ss1[] = { +{10001,3,0,-1},{10002,3,1,-1},{10005,3,0,-1},{10006,3,1,-1},{10010,3,0,-1}, +{10011,3,1,-1},{10014,3,0,-1},{10015,3,1,-1},{10018,3,0,-1},{10019,3,1,-1}, +{10023,3,0,-1},{10024,3,1,-1},{10027,3,0,-1},{10028,3,1,-1},{10031,3,0,-1}, +{10032,3,1,-1},{10036,3,0,-1},{10037,3,1,-1},{10040,3,0,-1},{10041,3,1,-1}, +{10044,3,0,-1},{10045,3,1,-1},{10049,3,0,-1},{10050,3,1,-1},{10053,3,0,-1}, +{10054,3,1,-1},{10057,3,0,-1},{10058,3,1,-1},{10062,3,0,-1},{10063,3,1,-1}, +{10066,3,0,-1},{10067,3,1,-1},{10070,3,0,-1},{10071,3,1,-1},{10075,3,0,-1}, +{10076,3,1,-1},{10079,3,0,-1},{10080,3,1,-1},{10083,3,0,-1},{10084,3,1,-1}, +{10088,3,0,-1},{10089,3,1,-1},{10022,3,0,-1},{10092,3,0,-1},{10093,3,1,-1}, +{10096,3,0,-1},{10097,3,1,-1},{10101,3,0,-1},{10102,3,1,-1},{10035,3,1,-1}, +{10105,3,0,-1},{10106,3,1,-1},{10109,3,0,-1},{10110,3,1,-1},{10114,3,0,-1}, +{10115,3,1,-1},{10118,3,0,-1},{10119,3,1,-1},{10122,3,0,-1},{10123,3,1,-1}, +{10127,3,0,-1},{10128,3,1,-1},{10131,3,0,-1},{10132,3,1,-1},{10135,3,0,-1}, +{10136,3,1,-1},{10140,3,0,-1},{10141,3,1,-1},{10144,3,0,-1},{10145,3,1,-1}, +{10148,3,0,-1},{10149,3,1,-1},{10153,3,0,-1},{10154,3,1,-1},{10157,3,0,-1}, +{10158,3,1,-1},{10161,3,0,-1},{10162,3,1,-1},{10166,3,0,-1},{10167,3,1,-1}, +{10170,3,0,-1},{10171,3,1,-1},{10174,3,0,-1},{10175,3,1,-1},{10179,3,0,-1}, +{10180,3,1,-1},{10183,3,0,-1},{10184,3,1,-1},{10187,3,0,-1},{10188,3,1,-1}, +{10192,3,0,-1},{10193,3,1,-1},{10126,3,0,-1},{10196,3,0,-1},{10197,3,1,-1}, +{10200,3,0,-1},{10201,3,1,-1},{10205,3,0,-1},{10206,3,1,-1},{10139,3,1,-1}, +{10209,3,0,-1},{10210,3,1,-1},{10213,3,0,-1},{10214,3,1,-1},{10218,3,0,-1}, +{10219,3,1,-1},{10222,3,0,-1},{10223,3,1,-1},{10226,3,0,-1},{10227,3,1,-1}, +{10231,3,0,-1},{10232,3,1,-1},{10235,3,0,-1},{10236,3,1,-1},{10239,3,0,-1}, +{10240,3,1,-1},{10244,3,0,-1},{10245,3,1,-1},{10248,3,0,-1},{10249,3,1,-1}, +{10252,3,0,-1},{10253,3,1,-1},{10257,3,0,-1},{10258,3,1,-1},{10261,3,0,-1}, +{10262,3,1,-1},{10265,3,0,-1},{10266,3,1,-1},{10270,3,0,-1},{10271,3,1,-1}, +{10274,3,0,-1},{10275,3,1,-1},{10278,3,0,-1},{10279,3,1,-1},{10283,3,0,-1}, +{10284,3,1,-1},{10287,3,0,-1},{10288,3,1,-1},{10291,3,0,-1},{10292,3,1,-1}, +{10296,3,0,-1},{10297,3,1,-1},{10230,3,0,-1},{10300,3,0,-1},{10301,3,1,-1}, +{10304,3,0,-1},{10305,3,1,-1},{10309,3,0,-1},{10310,3,1,-1},{10243,3,1,-1}, +{10313,3,0,-1},{10314,3,1,-1},{10317,3,0,-1},{10318,3,1,-1},{10322,3,0,-1}, +{10323,3,1,-1},{10326,3,0,-1},{10327,3,1,-1},{10330,3,0,-1},{10331,3,1,-1}, +{10335,3,0,-1},{10336,3,1,-1},{10339,3,0,-1},{10340,3,1,-1},{10343,3,0,-1}, +{10344,3,1,-1},{10348,3,0,-1},{10349,3,1,-1},{10352,3,0,-1},{10353,3,1,-1}, +{10356,3,0,-1},{10357,3,1,-1},{10361,3,0,-1},{10362,3,1,-1},{10365,3,0,-1}, +{10366,3,1,-1},{10369,3,0,-1},{10370,3,1,-1},{10374,3,0,-1},{10375,3,1,-1}, +{10378,3,0,-1},{10379,3,1,-1},{10382,3,0,-1},{10383,3,1,-1},{10387,3,0,-1}, +{10388,3,1,-1},{10391,3,0,-1},{10392,3,1,-1},{10395,3,0,-1},{10396,3,1,-1}, +{10400,3,0,-1},{10401,3,1,-1},{10334,3,0,-1},{10404,3,0,-1},{10405,3,1,-1}, +{10408,3,0,-1},{10409,3,1,-1},{10413,3,0,-1},{10414,3,1,-1},{10347,3,1,-1}, +{10417,3,0,-1},{10418,3,1,-1},{10421,3,0,-1},{10422,3,1,-1},{10426,3,0,-1}, +{10427,3,1,-1},{10430,3,0,-1},{10431,3,1,-1},{10434,3,0,-1},{10435,3,1,-1}, +{10439,3,0,-1},{10440,3,1,-1},{10443,3,0,-1},{10444,3,1,-1},{10447,3,0,-1}, +{10448,3,1,-1},{10452,3,0,-1},{10453,3,1,-1},{10456,3,0,-1},{10457,3,1,-1}, +{10460,3,0,-1},{10461,3,1,-1},{10465,3,0,-1},{10466,3,1,-1},{10469,3,0,-1}, +{10470,3,1,-1},{10473,3,0,-1},{10474,3,1,-1},{10478,3,0,-1},{10479,3,1,-1}, +{10482,3,0,-1},{10483,3,1,-1},{10486,3,0,-1},{10487,3,1,-1},{10491,3,0,-1}, +{10492,3,1,-1},{10495,3,0,-1},{10496,3,1,-1},{10499,3,0,-1},{10500,3,1,-1}, +{10504,3,0,-1},{10505,3,1,-1},{10438,3,0,-1},{10508,3,0,-1},{10509,3,1,-1}, +{10512,3,0,-1},{10513,3,1,-1},{10517,3,0,-1},{10518,3,1,-1},{10451,3,1,-1}, +{10521,3,0,-1},{10522,3,1,-1},{10525,3,0,-1},{10526,3,1,-1},{10530,3,0,-1}, +{10531,3,1,-1},{10534,3,0,-1},{10535,3,1,-1},{10538,3,0,-1},{10539,3,1,-1}, +{10543,3,0,-1},{10544,3,1,-1},{10547,3,0,-1},{10548,3,1,-1},{10551,3,0,-1}, +{10552,3,1,-1},{10556,3,0,-1},{10557,3,1,-1},{10560,3,0,-1},{10561,3,1,-1}, +{10564,3,0,-1},{10565,3,1,-1},{10569,3,0,-1},{10570,3,1,-1},{10573,3,0,-1}, +{10574,3,1,-1},{10577,3,0,-1},{10578,3,1,-1},{10582,3,0,-1},{10583,3,1,-1}, +{10586,3,0,-1},{10587,3,1,-1},{10590,3,0,-1},{10591,3,1,-1},{10595,3,0,-1}, +{10596,3,1,-1},{10599,3,0,-1},{10600,3,1,-1},{10603,3,0,-1},{10604,3,1,-1}, +{10608,3,0,-1},{10609,3,1,-1},{10542,3,0,-1},{10612,3,0,-1},{10613,3,1,-1}, +{10616,3,0,-1},{10617,3,1,-1},{10621,3,0,-1},{10622,3,1,-1},{10555,3,1,-1}, +{10625,3,0,-1},{10626,3,1,-1},{10629,3,0,-1},{10630,3,1,-1},{10634,3,0,-1}, +{10635,3,1,-1},{10638,3,0,-1},{10639,3,1,-1},{10642,3,0,-1},{10643,3,1,-1}, +{10647,3,0,-1},{10648,3,1,-1},{10651,3,0,-1},{10652,3,1,-1},{10655,3,0,-1}, +{10656,3,1,-1},{10660,3,0,-1},{10661,3,1,-1},{10664,3,0,-1},{10665,3,1,-1}, +{10668,3,0,-1},{10669,3,1,-1},{10673,3,0,-1},{10674,3,1,-1},{10677,3,0,-1}, +{10678,3,1,-1},{10681,3,0,-1},{10682,3,1,-1},{10686,3,0,-1},{10687,3,1,-1}, +{10690,3,0,-1},{10691,3,1,-1},{10694,3,0,-1},{10695,3,1,-1},{10699,3,0,-1}, +{10700,3,1,-1},{10703,3,0,-1},{10704,3,1,-1},{10707,3,0,-1},{10708,3,1,-1}, +{10712,3,0,-1},{10713,3,1,-1},{10646,3,0,-1},{10716,3,0,-1},{10717,3,1,-1}, +{10720,3,0,-1},{10721,3,1,-1},{10725,3,0,-1},{10726,3,1,-1},{10659,3,1,-1}, +{10729,3,0,-1},{10730,3,1,-1},{10733,3,0,-1},{10734,3,1,-1},{10738,3,0,-1}, +{10739,3,1,-1},{10742,3,0,-1},{10743,3,1,-1},{10746,3,0,-1},{10747,3,1,-1}, +{10751,3,0,-1},{10752,3,1,-1},{10755,3,0,-1},{10756,3,1,-1},{10759,3,0,-1}, +{10760,3,1,-1},{10764,3,0,-1},{10765,3,1,-1},{10768,3,0,-1},{10769,3,1,-1}, +{10772,3,0,-1},{10773,3,1,-1},{10777,3,0,-1},{10778,3,1,-1},{10781,3,0,-1}, +{10782,3,1,-1},{10785,3,0,-1},{10786,3,1,-1},{10790,3,0,-1},{10791,3,1,-1}, +{10794,3,0,-1},{10795,3,1,-1},{10798,3,0,-1},{10799,3,1,-1},{10803,3,0,-1}, +{10804,3,1,-1},{10807,3,0,-1},{10808,3,1,-1},{10811,3,0,-1},{10812,3,1,-1}, +{10816,3,0,-1},{10817,3,1,-1},{10750,3,0,-1},{10820,3,0,-1},{10821,3,1,-1}, +{10824,3,0,-1},{10825,3,1,-1},{10829,3,0,-1},{10830,3,1,-1},{10763,3,1,-1}, +{10833,3,0,-1},{10834,3,1,-1},{10837,3,0,-1},{10838,3,1,-1},{10842,3,0,-1}, +{10843,3,1,-1},{10846,3,0,-1},{10847,3,1,-1},{10850,3,0,-1},{10851,3,1,-1}, +{10855,3,0,-1},{10856,3,1,-1},{10859,3,0,-1},{10860,3,1,-1},{10863,3,0,-1}, +{10864,3,1,-1},{10868,3,0,-1},{10869,3,1,-1},{10872,3,0,-1},{10873,3,1,-1}, +{10876,3,0,-1},{10877,3,1,-1},{10881,3,0,-1},{10882,3,1,-1},{10885,3,0,-1}, +{10886,3,1,-1},{10889,3,0,-1},{10890,3,1,-1},{10894,3,0,-1},{10895,3,1,-1}, +{10898,3,0,-1},{10899,3,1,-1},{10902,3,0,-1},{10903,3,1,-1},{10907,3,0,-1}, +{10908,3,1,-1},{10911,3,0,-1},{10912,3,1,-1},{10915,3,0,-1},{10916,3,1,-1}, +{10920,3,0,-1},{10921,3,1,-1},{10854,3,0,-1},{10924,3,0,-1},{10925,3,1,-1}, +{10928,3,0,-1},{10929,3,1,-1},{10933,3,0,-1},{10934,3,1,-1},{10867,3,1,-1}, +{10937,3,0,-1},{10938,3,1,-1},{10941,3,0,-1},{10942,3,1,-1},{10946,3,0,-1}, +{10947,3,1,-1},{10950,3,0,-1},{10951,3,1,-1},{10954,3,0,-1},{10955,3,1,-1}, +{10959,3,0,-1},{10960,3,1,-1},{10963,3,0,-1},{10964,3,1,-1},{10967,3,0,-1}, +{10968,3,1,-1},{10972,3,0,-1},{10973,3,1,-1},{10976,3,0,-1},{10977,3,1,-1}, +{10980,3,0,-1},{10981,3,1,-1},{10985,3,0,-1},{10986,3,1,-1},{10989,3,0,-1}, +{10990,3,1,-1},{10993,3,0,-1},{10994,3,1,-1},{10998,3,0,-1},{10999,3,1,-1}, +{11002,3,0,-1},{11003,3,1,-1},{11006,3,0,-1},{11007,3,1,-1},{11011,3,0,-1}, +{11012,3,1,-1},{11015,3,0,-1},{11016,3,1,-1},{11019,3,0,-1},{11020,3,1,-1}, +{11024,3,0,-1},{11025,3,1,-1},{10958,3,0,-1},{11028,3,0,-1},{11029,3,1,-1}, +{11032,3,0,-1},{11033,3,1,-1},{11037,3,0,-1},{11038,3,1,-1},{10971,3,1,-1}, +{11041,3,0,-1},{11042,3,1,-1},{11045,3,0,-1},{11046,3,1,-1},{11050,3,0,-1}, +{11051,3,1,-1},{11054,3,0,-1},{11055,3,1,-1},{11058,3,0,-1},{11059,3,1,-1}, +{11063,3,0,-1},{11064,3,1,-1},{11067,3,0,-1},{11068,3,1,-1},{11071,3,0,-1}, +{11072,3,1,-1},{11076,3,0,-1},{11077,3,1,-1},{11080,3,0,-1},{11081,3,1,-1}, +{11084,3,0,-1},{11085,3,1,-1},{11089,3,0,-1},{11090,3,1,-1},{11093,3,0,-1}, +{11094,3,1,-1},{11097,3,0,-1},{11098,3,1,-1},{11102,3,0,-1},{11103,3,1,-1}, +{11106,3,0,-1},{11107,3,1,-1},{11110,3,0,-1},{11111,3,1,-1},{11115,3,0,-1}, +{11116,3,1,-1},{11119,3,0,-1},{11120,3,1,-1},{11123,3,0,-1},{11124,3,1,-1}, +{11128,3,0,-1},{11129,3,1,-1},{11062,3,0,-1},{11132,3,0,-1},{11133,3,1,-1}, +{11136,3,0,-1},{11137,3,1,-1},{11141,3,0,-1},{11142,3,1,-1},{11075,3,1,-1}, +{11145,3,0,-1},{11146,3,1,-1},{11149,3,0,-1},{11150,3,1,-1},{11154,3,0,-1}, +{11155,3,1,-1},{11158,3,0,-1},{11159,3,1,-1},{11162,3,0,-1},{11163,3,1,-1}, +{11167,3,0,-1},{11168,3,1,-1},{11171,3,0,-1},{11172,3,1,-1},{11175,3,0,-1}, +{11176,3,1,-1},{11180,3,0,-1},{11181,3,1,-1},{11184,3,0,-1},{11185,3,1,-1}, +{11188,3,0,-1},{11189,3,1,-1},{11193,3,0,-1},{11194,3,1,-1},{11197,3,0,-1}, +{11198,3,1,-1},{11201,3,0,-1},{11202,3,1,-1},{11206,3,0,-1},{11207,3,1,-1}, +{11210,3,0,-1},{11211,3,1,-1},{11214,3,0,-1},{11215,3,1,-1},{11219,3,0,-1}, +{11220,3,1,-1},{11223,3,0,-1},{11224,3,1,-1},{11227,3,0,-1},{11228,3,1,-1}, +{11232,3,0,-1},{11233,3,1,-1},{11166,3,0,-1},{11236,3,0,-1},{11237,3,1,-1}, +{11240,3,0,-1},{11241,3,1,-1},{11245,3,0,-1},{11246,3,1,-1},{11179,3,1,-1}, +{11249,3,0,-1},{11250,3,1,-1},{11253,3,0,-1},{11254,3,1,-1},{11258,3,0,-1}, +{11259,3,1,-1},{11262,3,0,-1},{11263,3,1,-1},{11266,3,0,-1},{11267,3,1,-1}, +{11271,3,0,-1},{11272,3,1,-1},{11275,3,0,-1},{11276,3,1,-1},{11279,3,0,-1}, +{11280,3,1,-1},{11284,3,0,-1},{11285,3,1,-1},{11288,3,0,-1},{11289,3,1,-1}, +{11292,3,0,-1},{11293,3,1,-1},{11297,3,0,-1},{11298,3,1,-1},{11301,3,0,-1}, +{11302,3,1,-1},{11305,3,0,-1},{11306,3,1,-1},{11310,3,0,-1},{11311,3,1,-1}, +{11314,3,0,-1},{11315,3,1,-1},{11318,3,0,-1},{11319,3,1,-1},{11323,3,0,-1}, +{11324,3,1,-1},{11327,3,0,-1},{11328,3,1,-1},{11331,3,0,-1},{11332,3,1,-1}, +{11336,3,0,-1},{11337,3,1,-1},{11270,3,0,-1},{11340,3,0,-1},{11341,3,1,-1}, +{11344,3,0,-1},{11345,3,1,-1},{11349,3,0,-1},{11350,3,1,-1},{11283,3,1,-1}, +{11353,3,0,-1},{11354,3,1,-1},{11357,3,0,-1},{11358,3,1,-1},{11362,3,0,-1}, +{11363,3,1,-1},{11366,3,0,-1},{11367,3,1,-1},{11370,3,0,-1},{11371,3,1,-1}, +{11375,3,0,-1},{11376,3,1,-1},{11379,3,0,-1},{11380,3,1,-1},{11383,3,0,-1}, +{11384,3,1,-1},{11388,3,0,-1},{11389,3,1,-1},{11392,3,0,-1},{11393,3,1,-1}, +{11396,3,0,-1},{11397,3,1,-1},{11401,3,0,-1},{11402,3,1,-1},{11405,3,0,-1}, +{11406,3,1,-1},{11409,3,0,-1},{11410,3,1,-1},{11414,3,0,-1},{11415,3,1,-1}, +{11418,3,0,-1},{11419,3,1,-1},{11422,3,0,-1},{11423,3,1,-1},{11427,3,0,-1}, +{11428,3,1,-1},{11431,3,0,-1},{11432,3,1,-1},{11435,3,0,-1},{11436,3,1,-1}, +{11440,3,0,-1},{11441,3,1,-1},{11374,3,0,-1},{11444,3,0,-1},{11445,3,1,-1}, +{11448,3,0,-1},{11449,3,1,-1},{11453,3,0,-1},{11454,3,1,-1},{11387,3,1,-1}, +{11457,3,0,-1},{11458,3,1,-1},{11461,3,0,-1},{11462,3,1,-1},{11466,3,0,-1}, +{11467,3,1,-1},{11470,3,0,-1},{11471,3,1,-1},{11474,3,0,-1},{11475,3,1,-1}, +{11479,3,0,-1},{11480,3,1,-1},{11483,3,0,-1},{11484,3,1,-1},{11487,3,0,-1}, +{11488,3,1,-1},{11492,3,0,-1},{11493,3,1,-1},{11496,3,0,-1},{11497,3,1,-1}, +{11500,3,0,-1},{11501,3,1,-1},{11505,3,0,-1},{11506,3,1,-1},{11509,3,0,-1}, +{11510,3,1,-1},{11513,3,0,-1},{11514,3,1,-1},{11518,3,0,-1},{11519,3,1,-1}, +{11522,3,0,-1},{11523,3,1,-1},{11526,3,0,-1},{11527,3,1,-1},{11531,3,0,-1}, +{11532,3,1,-1},{11535,3,0,-1},{11536,3,1,-1},{11539,3,0,-1},{11540,3,1,-1}, +{11544,3,0,-1},{11545,3,1,-1},{11478,3,0,-1},{11548,3,0,-1},{11549,3,1,-1}, +{11552,3,0,-1},{11553,3,1,-1},{11557,3,0,-1},{11558,3,1,-1},{11491,3,1,-1}, +{11561,3,0,-1},{11562,3,1,-1},{11565,3,0,-1},{11566,3,1,-1},{11570,3,0,-1}, +{11571,3,1,-1},{11574,3,0,-1},{11575,3,1,-1},{11578,3,0,-1},{11579,3,1,-1}, +{11583,3,0,-1},{11584,3,1,-1},{11587,3,0,-1},{11588,3,1,-1},{11591,3,0,-1}, +{11592,3,1,-1},{11596,3,0,-1},{11597,3,1,-1},{11600,3,0,-1},{11601,3,1,-1}, +{11604,3,0,-1},{11605,3,1,-1},{11609,3,0,-1},{11610,3,1,-1},{11613,3,0,-1}, +{11614,3,1,-1},{11617,3,0,-1},{11618,3,1,-1},{11622,3,0,-1},{11623,3,1,-1}, +{11626,3,0,-1},{11627,3,1,-1},{11630,3,0,-1},{11631,3,1,-1},{11635,3,0,-1}, +{11636,3,1,-1},{11639,3,0,-1},{11640,3,1,-1},{11643,3,0,-1},{11644,3,1,-1}, +{11648,3,0,-1},{11649,3,1,-1},{11582,3,0,-1},{11652,3,0,-1},{11653,3,1,-1}, +{11656,3,0,-1},{11657,3,1,-1},{11661,3,0,-1},{11662,3,1,-1},{11595,3,1,-1}, +{11665,3,0,-1},{11666,3,1,-1},{11669,3,0,-1},{11670,3,1,-1},{11674,3,0,-1}, +{11675,3,1,-1},{11678,3,0,-1},{11679,3,1,-1},{11682,3,0,-1},{11683,3,1,-1}, +{11687,3,0,-1},{11688,3,1,-1},{11691,3,0,-1},{11692,3,1,-1},{11695,3,0,-1}, +{11696,3,1,-1},{11700,3,0,-1},{11701,3,1,-1},{11704,3,0,-1},{11705,3,1,-1}, +{11708,3,0,-1},{11709,3,1,-1},{11713,3,0,-1},{11714,3,1,-1},{11717,3,0,-1}, +{11718,3,1,-1},{11721,3,0,-1},{11722,3,1,-1},{11726,3,0,-1},{11727,3,1,-1}, +{11730,3,0,-1},{11731,3,1,-1},{11734,3,0,-1},{11735,3,1,-1},{11739,3,0,-1}, +{11740,3,1,-1},{11743,3,0,-1},{11744,3,1,-1},{11747,3,0,-1},{11748,3,1,-1}, +{11752,3,0,-1},{11753,3,1,-1},{11686,3,0,-1},{11756,3,0,-1},{11757,3,1,-1}, +{11760,3,0,-1},{11761,3,1,-1},{11765,3,0,-1},{11766,3,1,-1},{11699,3,1,-1}, +{11769,3,0,-1},{11770,3,1,-1},{11773,3,0,-1},{11774,3,1,-1},{11778,3,0,-1}, +{11779,3,1,-1},{11782,3,0,-1},{11783,3,1,-1},{11786,3,0,-1},{11787,3,1,-1}, +{11791,3,0,-1},{11792,3,1,-1},{11795,3,0,-1},{11796,3,1,-1},{11799,3,0,-1}, +{11800,3,1,-1},{11804,3,0,-1},{11805,3,1,-1},{11808,3,0,-1},{11809,3,1,-1}, +{11812,3,0,-1},{11813,3,1,-1},{11817,3,0,-1},{11818,3,1,-1},{11821,3,0,-1}, +{11822,3,1,-1},{11825,3,0,-1},{11826,3,1,-1},{11830,3,0,-1},{11831,3,1,-1}, +{11834,3,0,-1},{11835,3,1,-1},{11838,3,0,-1},{11839,3,1,-1},{11843,3,0,-1}, +{11844,3,1,-1},{11847,3,0,-1},{11848,3,1,-1},{11851,3,0,-1},{11852,3,1,-1}, +{11856,3,0,-1},{11857,3,1,-1},{11790,3,0,-1},{11860,3,0,-1},{11861,3,1,-1}, +{11864,3,0,-1},{11865,3,1,-1},{11869,3,0,-1},{11870,3,1,-1},{11803,3,1,-1}, +{11873,3,0,-1},{11874,3,1,-1},{11877,3,0,-1},{11878,3,1,-1},{11882,3,0,-1}, +{11883,3,1,-1},{11886,3,0,-1},{11887,3,1,-1},{11890,3,0,-1},{11891,3,1,-1}, +{11895,3,0,-1},{11896,3,1,-1},{11899,3,0,-1},{11900,3,1,-1},{11903,3,0,-1}, +{11904,3,1,-1},{11908,3,0,-1},{11909,3,1,-1},{11912,3,0,-1},{11913,3,1,-1}, +{11916,3,0,-1},{11917,3,1,-1},{11921,3,0,-1},{11922,3,1,-1},{11925,3,0,-1}, +{11926,3,1,-1},{11929,3,0,-1},{11930,3,1,-1},{11934,3,0,-1},{11935,3,1,-1}, +{11938,3,0,-1},{11939,3,1,-1},{11942,3,0,-1},{11943,3,1,-1},{11947,3,0,-1}, +{11948,3,1,-1},{11951,3,0,-1},{11952,3,1,-1},{11955,3,0,-1},{11956,3,1,-1}, +{11960,3,0,-1},{11961,3,1,-1},{11894,3,0,-1},{11964,3,0,-1},{11965,3,1,-1}, +{11968,3,0,-1},{11969,3,1,-1},{11973,3,0,-1},{11974,3,1,-1},{11907,3,1,-1}, +{11977,3,0,-1},{11978,3,1,-1},{11981,3,0,-1},{11982,3,1,-1},{11986,3,0,-1}, +{11987,3,1,-1},{11990,3,0,-1},{11991,3,1,-1},{11994,3,0,-1},{11995,3,1,-1}, +{11999,3,0,-1},{12000,3,1,-1},{12003,3,0,-1},{12004,3,1,-1},{12007,3,0,-1}, +{12008,3,1,-1},{12012,3,0,-1},{12013,3,1,-1},{12016,3,0,-1},{12017,3,1,-1}, +{12020,3,0,-1},{12021,3,1,-1},{12025,3,0,-1},{12026,3,1,-1},{12029,3,0,-1}, +{12030,3,1,-1},{12033,3,0,-1},{12034,3,1,-1},{12038,3,0,-1},{12039,3,1,-1}, +{12042,3,0,-1},{12043,3,1,-1},{12046,3,0,-1},{12047,3,1,-1},{12051,3,0,-1}, +{12052,3,1,-1},{12055,3,0,-1},{12056,3,1,-1},{12059,3,0,-1},{12060,3,1,-1}, +{12064,3,0,-1},{12065,3,1,-1},{11998,3,0,-1},{12068,3,0,-1},{12069,3,1,-1}, +{12072,3,0,-1},{12073,3,1,-1},{12077,3,0,-1},{12078,3,1,-1},{12011,3,1,-1}, +{12081,3,0,-1},{12082,3,1,-1},{12085,3,0,-1},{12086,3,1,-1},{12090,3,0,-1}, +{12091,3,1,-1},{12094,3,0,-1},{12095,3,1,-1},{12098,3,0,-1},{12099,3,1,-1}, +{12103,3,0,-1},{12104,3,1,-1},{12107,3,0,-1},{12108,3,1,-1},{12111,3,0,-1}, +{12112,3,1,-1},{12116,3,0,-1},{12117,3,1,-1},{12120,3,0,-1},{12121,3,1,-1}, +{12124,3,0,-1},{12125,3,1,-1},{12129,3,0,-1},{12130,3,1,-1},{12133,3,0,-1}, +{12134,3,1,-1},{12137,3,0,-1},{12138,3,1,-1},{12142,3,0,-1},{12143,3,1,-1}, +{12146,3,0,-1},{12147,3,1,-1},{12150,3,0,-1},{12151,3,1,-1},{12155,3,0,-1}, +{12156,3,1,-1},{12159,3,0,-1},{12160,3,1,-1},{12164,3,1,-1},{12168,3,0,-1}, +{12169,3,1,-1},{12102,3,0,-1},{12172,3,0,-1},{12173,3,1,-1},{12176,3,0,-1}, +{12177,3,1,-1},{12181,3,0,-1},{12182,3,1,-1},{12115,3,1,-1},{12185,3,0,-1}, +{12186,3,1,-1},{12189,3,0,-1},{12190,3,1,-1},{12194,3,0,-1},{12195,3,1,-1}, +{12198,3,0,-1},{12199,3,1,-1},{12202,3,0,-1},{12203,3,1,-1},{12207,3,0,-1}, +{12208,3,1,-1},{12211,3,0,-1},{12212,3,1,-1},{12216,3,1,-1},{12220,3,0,-1}, +{12221,3,1,-1},{12224,3,0,-1},{12225,3,1,-1},{12228,3,0,-1},{12229,3,1,-1}, +{12233,3,0,-1},{12234,3,1,-1},{12237,3,0,-1},{12238,3,1,-1},{12241,3,0,-1}, +{12242,3,1,-1},{12246,3,0,-1},{12247,3,1,-1},{12250,3,0,-1},{12251,3,1,-1}, +{12254,3,0,-1},{12255,3,1,-1},{12260,3,1,-1},{12264,3,1,-1},{12268,3,1,-1}, +{12273,3,1,-1},{12281,3,1,-1},{12286,3,1,-1},{12290,3,1,-1},{12294,3,1,-1}, +{12299,3,1,-1},{12303,3,1,-1},{12307,3,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_4_ss0_ss1[] = { +{7704,4,0,-1},{7713,4,0,-1},{7722,4,0,-1},{7730,4,0,-1},{7739,4,0,-1}, +{7748,4,0,-1},{7756,4,0,-1},{7765,4,0,-1},{7774,4,0,-1},{7782,4,0,-1}, +{7791,4,0,-1},{7800,4,0,-1},{7808,4,0,-1},{7817,4,0,-1},{7826,4,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7843,4,0,-1},{7852,4,0,-1},{7860,4,0,-1}, +{7865,4,0,-1},{7869,4,0,-1},{7873,4,0,-1},{7878,4,0,-1},{7882,4,0,-1}, +{7886,4,0,-1},{7891,4,0,-1},{7895,4,0,-1},{7899,4,0,-1},{7904,4,0,-1}, +{7908,4,0,-1},{7912,4,0,-1},{7917,4,0,-1},{7921,4,0,-1},{7925,4,0,-1}, +{7930,4,0,-1},{7864,4,0,-1},{7934,4,0,-1},{7938,4,0,-1},{7943,4,0,-1}, +{7947,4,0,-1},{7951,4,0,-1},{7956,4,0,-1},{7960,4,0,-1},{7964,4,0,-1}, +{7969,4,0,-1},{7973,4,0,-1},{7977,4,0,-1},{7982,4,0,-1},{7986,4,0,-1}, +{7990,4,0,-1},{7995,4,0,-1},{7999,4,0,-1},{8003,4,0,-1},{8008,4,0,-1}, +{8012,4,0,-1},{8016,4,0,-1},{8021,4,0,-1},{8025,4,0,-1},{8029,4,0,-1}, +{8034,4,0,-1},{7968,4,0,-1},{8038,4,0,-1},{8042,4,0,-1},{8047,4,0,-1}, +{8051,4,0,-1},{8055,4,0,-1},{8060,4,0,-1},{8064,4,0,-1},{8068,4,0,-1}, +{8073,4,0,-1},{8077,4,0,-1},{8081,4,0,-1},{8086,4,0,-1},{8090,4,0,-1}, +{8094,4,0,-1},{8099,4,0,-1},{8103,4,0,-1},{8107,4,0,-1},{8112,4,0,-1}, +{8116,4,0,-1},{8120,4,0,-1},{8121,4,1,-1},{8125,4,0,-1},{8129,4,0,-1}, +{8130,4,1,-1},{8133,4,0,-1},{8138,4,0,-1},{8139,4,1,-1},{8072,4,0,-1}, +{8142,4,0,-1},{8146,4,0,-1},{8147,4,1,-1},{8151,4,0,-1},{8155,4,0,-1}, +{8156,4,1,-1},{8159,4,0,-1},{8164,4,0,-1},{8165,4,1,-1},{8168,4,0,-1}, +{8172,4,0,-1},{8173,4,1,-1},{8177,4,0,-1},{8181,4,0,-1},{8182,4,1,-1}, +{8185,4,0,-1},{8190,4,0,-1},{8191,4,1,-1},{8194,4,0,-1},{8198,4,0,-1}, +{8199,4,1,-1},{8203,4,0,-1},{8207,4,0,-1},{8208,4,1,-1},{8211,4,0,-1}, +{8216,4,0,-1},{8217,4,1,-1},{8220,4,0,-1},{8224,4,0,-1},{8225,4,1,-1}, +{8229,4,0,-1},{8230,4,1,-1},{8233,4,0,-1},{8234,4,1,-1},{8237,4,0,-1}, +{8238,4,1,-1},{8242,4,0,-1},{8243,4,1,-1},{8176,4,0,-1},{8246,4,0,-1}, +{8247,4,1,-1},{8250,4,0,-1},{8251,4,1,-1},{8255,4,0,-1},{8189,4,1,-1}, +{8259,4,0,-1},{8260,4,1,-1},{8263,4,0,-1},{8264,4,1,-1},{8268,4,0,-1}, +{8269,4,1,-1},{8272,4,0,-1},{8273,4,1,-1},{8276,4,0,-1},{8277,4,1,-1}, +{8281,4,0,-1},{8282,4,1,-1},{8285,4,0,-1},{8286,4,1,-1},{8289,4,0,-1}, +{8290,4,1,-1},{8294,4,0,-1},{8295,4,1,-1},{8299,4,1,-1},{8302,4,0,-1}, +{8303,4,1,-1},{8307,4,0,-1},{8308,4,1,-1},{8311,4,0,-1},{8312,4,1,-1}, +{8315,4,0,-1},{8316,4,1,-1},{8320,4,0,-1},{8321,4,1,-1},{8324,4,0,-1}, +{8325,4,1,-1},{8328,4,0,-1},{8329,4,1,-1},{8333,4,0,-1},{8334,4,1,-1}, +{8337,4,0,-1},{8338,4,1,-1},{8341,4,0,-1},{8342,4,1,-1},{8346,4,0,-1}, +{8347,4,1,-1},{8280,4,0,-1},{8350,4,0,-1},{8351,4,1,-1},{8354,4,0,-1}, +{8355,4,1,-1},{8359,4,0,-1},{8360,4,1,-1},{8293,4,1,-1},{8363,4,0,-1}, +{8364,4,1,-1},{8367,4,0,-1},{8368,4,1,-1},{8372,4,0,-1},{8373,4,1,-1}, +{8376,4,0,-1},{8377,4,1,-1},{8380,4,0,-1},{8381,4,1,-1},{8385,4,0,-1}, +{8386,4,1,-1},{8389,4,0,-1},{8390,4,1,-1},{8393,4,0,-1},{8394,4,1,-1}, +{8398,4,0,-1},{8399,4,1,-1},{8402,4,0,-1},{8403,4,1,-1},{8406,4,0,-1}, +{8407,4,1,-1},{8411,4,0,-1},{8412,4,1,-1},{8415,4,0,-1},{8416,4,1,-1}, +{8419,4,0,-1},{8420,4,1,-1},{8424,4,0,-1},{8425,4,1,-1},{8428,4,0,-1}, +{8429,4,1,-1},{8432,4,0,-1},{8433,4,1,-1},{8437,4,0,-1},{8438,4,1,-1}, +{8441,4,0,-1},{8442,4,1,-1},{8445,4,0,-1},{8446,4,1,-1},{8450,4,0,-1}, +{8451,4,1,-1},{8384,4,0,-1},{8454,4,0,-1},{8455,4,1,-1},{8458,4,0,-1}, +{8459,4,1,-1},{8463,4,0,-1},{8397,4,1,-1},{8467,4,0,-1},{8468,4,1,-1}, +{8471,4,0,-1},{8472,4,1,-1},{8476,4,0,-1},{8477,4,1,-1},{8480,4,0,-1}, +{8481,4,1,-1},{8484,4,0,-1},{8485,4,1,-1},{8489,4,0,-1},{8490,4,1,-1}, +{8493,4,0,-1},{8494,4,1,-1},{8497,4,0,-1},{8498,4,1,-1},{8502,4,0,-1}, +{8503,4,1,-1},{8507,4,1,-1},{8510,4,0,-1},{8511,4,1,-1},{8515,4,0,-1}, +{8519,4,0,-1},{8520,4,1,-1},{8523,4,0,-1},{8524,4,1,-1},{8528,4,0,-1}, +{8529,4,1,-1},{8532,4,0,-1},{8533,4,1,-1},{8536,4,0,-1},{8537,4,1,-1}, +{8541,4,0,-1},{8542,4,1,-1},{8545,4,0,-1},{8546,4,1,-1},{8549,4,0,-1}, +{8550,4,1,-1},{8554,4,0,-1},{8555,4,1,-1},{8488,4,0,-1},{8558,4,0,-1}, +{8559,4,1,-1},{8562,4,0,-1},{8563,4,1,-1},{8567,4,0,-1},{8568,4,1,-1}, +{8501,4,1,-1},{8571,4,0,-1},{8572,4,1,-1},{8575,4,0,-1},{8576,4,1,-1}, +{8580,4,0,-1},{8581,4,1,-1},{8584,4,0,-1},{8585,4,1,-1},{8588,4,0,-1}, +{8589,4,1,-1},{8593,4,0,-1},{8594,4,1,-1},{8597,4,0,-1},{8598,4,1,-1}, +{8601,4,0,-1},{8602,4,1,-1},{8606,4,0,-1},{8607,4,1,-1},{8610,4,0,-1}, +{8611,4,1,-1},{8614,4,0,-1},{8615,4,1,-1},{8619,4,0,-1},{8620,4,1,-1}, +{8623,4,0,-1},{8624,4,1,-1},{8627,4,0,-1},{8628,4,1,-1},{8632,4,0,-1}, +{8633,4,1,-1},{8636,4,0,-1},{8637,4,1,-1},{8640,4,0,-1},{8641,4,1,-1}, +{8645,4,0,-1},{8646,4,1,-1},{8649,4,0,-1},{8650,4,1,-1},{8653,4,0,-1}, +{8654,4,1,-1},{8658,4,0,-1},{8659,4,1,-1},{8592,4,0,-1},{8662,4,0,-1}, +{8663,4,1,-1},{8666,4,0,-1},{8667,4,1,-1},{8671,4,0,-1},{8672,4,1,-1}, +{8605,4,1,-1},{8675,4,0,-1},{8676,4,1,-1},{8679,4,0,-1},{8680,4,1,-1}, +{8684,4,0,-1},{8685,4,1,-1},{8688,4,0,-1},{8689,4,1,-1},{8692,4,0,-1}, +{8693,4,1,-1},{8697,4,0,-1},{8698,4,1,-1},{8701,4,0,-1},{8702,4,1,-1}, +{8705,4,0,-1},{8706,4,1,-1},{8710,4,0,-1},{8711,4,1,-1},{8714,4,0,-1}, +{8715,4,1,-1},{8718,4,0,-1},{8719,4,1,-1},{8723,4,0,-1},{8724,4,1,-1}, +{8727,4,0,-1},{8728,4,1,-1},{8731,4,0,-1},{8732,4,1,-1},{8736,4,0,-1}, +{8737,4,1,-1},{8740,4,0,-1},{8741,4,1,-1},{8744,4,0,-1},{8745,4,1,-1}, +{8749,4,0,-1},{8750,4,1,-1},{8753,4,0,-1},{8754,4,1,-1},{8757,4,0,-1}, +{8758,4,1,-1},{8762,4,0,-1},{8763,4,1,-1},{8696,4,0,-1},{8766,4,0,-1}, +{8767,4,1,-1},{8770,4,0,-1},{8771,4,1,-1},{8775,4,0,-1},{8776,4,1,-1}, +{8709,4,1,-1},{8779,4,0,-1},{8780,4,1,-1},{8783,4,0,-1},{8784,4,1,-1}, +{8788,4,0,-1},{8789,4,1,-1},{8792,4,0,-1},{8793,4,1,-1},{8796,4,0,-1}, +{8797,4,1,-1},{8801,4,0,-1},{8802,4,1,-1},{8805,4,0,-1},{8806,4,1,-1}, +{8809,4,0,-1},{8810,4,1,-1},{8814,4,0,-1},{8815,4,1,-1},{8818,4,0,-1}, +{8819,4,1,-1},{8822,4,0,-1},{8823,4,1,-1},{8827,4,0,-1},{8828,4,1,-1}, +{8831,4,0,-1},{8832,4,1,-1},{8835,4,0,-1},{8836,4,1,-1},{8840,4,0,-1}, +{8841,4,1,-1},{8844,4,0,-1},{8845,4,1,-1},{8848,4,0,-1},{8849,4,1,-1}, +{8853,4,0,-1},{8854,4,1,-1},{8857,4,0,-1},{8858,4,1,-1},{8861,4,0,-1}, +{8862,4,1,-1},{8866,4,0,-1},{8867,4,1,-1},{8800,4,0,-1},{8870,4,0,-1}, +{8871,4,1,-1},{8874,4,0,-1},{8875,4,1,-1},{8879,4,0,-1},{8880,4,1,-1}, +{8813,4,1,-1},{8883,4,0,-1},{8884,4,1,-1},{8887,4,0,-1},{8888,4,1,-1}, +{8892,4,0,-1},{8893,4,1,-1},{8896,4,0,-1},{8897,4,1,-1},{8900,4,0,-1}, +{8901,4,1,-1},{8905,4,0,-1},{8906,4,1,-1},{8909,4,0,-1},{8910,4,1,-1}, +{8913,4,0,-1},{8914,4,1,-1},{8918,4,0,-1},{8919,4,1,-1},{8922,4,0,-1}, +{8923,4,1,-1},{8926,4,0,-1},{8927,4,1,-1},{8931,4,0,-1},{8932,4,1,-1}, +{8935,4,0,-1},{8936,4,1,-1},{8939,4,0,-1},{8940,4,1,-1},{8944,4,0,-1}, +{8945,4,1,-1},{8948,4,0,-1},{8949,4,1,-1},{8952,4,0,-1},{8953,4,1,-1}, +{8957,4,0,-1},{8958,4,1,-1},{8961,4,0,-1},{8962,4,1,-1},{8965,4,0,-1}, +{8966,4,1,-1},{8970,4,0,-1},{8971,4,1,-1},{8904,4,0,-1},{8974,4,0,-1}, +{8975,4,1,-1},{8978,4,0,-1},{8979,4,1,-1},{8983,4,0,-1},{8984,4,1,-1}, +{8917,4,1,-1},{8987,4,0,-1},{8988,4,1,-1},{8991,4,0,-1},{8992,4,1,-1}, +{8996,4,0,-1},{8997,4,1,-1},{9000,4,0,-1},{9001,4,1,-1},{9004,4,0,-1}, +{9005,4,1,-1},{9009,4,0,-1},{9010,4,1,-1},{9013,4,0,-1},{9014,4,1,-1}, +{9017,4,0,-1},{9018,4,1,-1},{9022,4,0,-1},{9023,4,1,-1},{9026,4,0,-1}, +{9027,4,1,-1},{9030,4,0,-1},{9031,4,1,-1},{9035,4,0,-1},{9036,4,1,-1}, +{9039,4,0,-1},{9040,4,1,-1},{9043,4,0,-1},{9044,4,1,-1},{9048,4,0,-1}, +{9049,4,1,-1},{9052,4,0,-1},{9053,4,1,-1},{9056,4,0,-1},{9057,4,1,-1}, +{9061,4,0,-1},{9062,4,1,-1},{9065,4,0,-1},{9066,4,1,-1},{9069,4,0,-1}, +{9070,4,1,-1},{9074,4,0,-1},{9075,4,1,-1},{9008,4,0,-1},{9078,4,0,-1}, +{9079,4,1,-1},{9082,4,0,-1},{9083,4,1,-1},{9087,4,0,-1},{9088,4,1,-1}, +{9021,4,1,-1},{9091,4,0,-1},{9092,4,1,-1},{9095,4,0,-1},{9096,4,1,-1}, +{9100,4,0,-1},{9101,4,1,-1},{9104,4,0,-1},{9105,4,1,-1},{9108,4,0,-1}, +{9109,4,1,-1},{9113,4,0,-1},{9114,4,1,-1},{9117,4,0,-1},{9118,4,1,-1}, +{9121,4,0,-1},{9122,4,1,-1},{9126,4,0,-1},{9127,4,1,-1},{9130,4,0,-1}, +{9131,4,1,-1},{9134,4,0,-1},{9135,4,1,-1},{9139,4,0,-1},{9140,4,1,-1}, +{9143,4,0,-1},{9144,4,1,-1},{9147,4,0,-1},{9148,4,1,-1},{9152,4,0,-1}, +{9153,4,1,-1},{9156,4,0,-1},{9157,4,1,-1},{9160,4,0,-1},{9161,4,1,-1}, +{9165,4,0,-1},{9166,4,1,-1},{9169,4,0,-1},{9170,4,1,-1},{9173,4,0,-1}, +{9174,4,1,-1},{9178,4,0,-1},{9179,4,1,-1},{9112,4,0,-1},{9182,4,0,-1}, +{9183,4,1,-1},{9186,4,0,-1},{9187,4,1,-1},{9191,4,0,-1},{9192,4,1,-1}, +{9125,4,1,-1},{9195,4,0,-1},{9196,4,1,-1},{9199,4,0,-1},{9200,4,1,-1}, +{9204,4,0,-1},{9205,4,1,-1},{9208,4,0,-1},{9209,4,1,-1},{9212,4,0,-1}, +{9213,4,1,-1},{9217,4,0,-1},{9218,4,1,-1},{9221,4,0,-1},{9222,4,1,-1}, +{9225,4,0,-1},{9226,4,1,-1},{9230,4,0,-1},{9231,4,1,-1},{9234,4,0,-1}, +{9235,4,1,-1},{9238,4,0,-1},{9239,4,1,-1},{9243,4,0,-1},{9244,4,1,-1}, +{9247,4,0,-1},{9248,4,1,-1},{9251,4,0,-1},{9252,4,1,-1},{9256,4,0,-1}, +{9257,4,1,-1},{9260,4,0,-1},{9261,4,1,-1},{9264,4,0,-1},{9265,4,1,-1}, +{9269,4,0,-1},{9270,4,1,-1},{9273,4,0,-1},{9274,4,1,-1},{9277,4,0,-1}, +{9278,4,1,-1},{9282,4,0,-1},{9283,4,1,-1},{9216,4,0,-1},{9286,4,0,-1}, +{9287,4,1,-1},{9290,4,0,-1},{9291,4,1,-1},{9295,4,0,-1},{9296,4,1,-1}, +{9229,4,1,-1},{9299,4,0,-1},{9300,4,1,-1},{9303,4,0,-1},{9304,4,1,-1}, +{9308,4,0,-1},{9309,4,1,-1},{9312,4,0,-1},{9313,4,1,-1},{9316,4,0,-1}, +{9317,4,1,-1},{9321,4,0,-1},{9322,4,1,-1},{9325,4,0,-1},{9326,4,1,-1}, +{9329,4,0,-1},{9330,4,1,-1},{9334,4,0,-1},{9335,4,1,-1},{9338,4,0,-1}, +{9339,4,1,-1},{9342,4,0,-1},{9343,4,1,-1},{9347,4,0,-1},{9348,4,1,-1}, +{9351,4,0,-1},{9352,4,1,-1},{9355,4,0,-1},{9356,4,1,-1},{9360,4,0,-1}, +{9361,4,1,-1},{9364,4,0,-1},{9365,4,1,-1},{9368,4,0,-1},{9369,4,1,-1}, +{9373,4,0,-1},{9374,4,1,-1},{9377,4,0,-1},{9378,4,1,-1},{9381,4,0,-1}, +{9382,4,1,-1},{9386,4,0,-1},{9387,4,1,-1},{9320,4,0,-1},{9390,4,0,-1}, +{9391,4,1,-1},{9394,4,0,-1},{9395,4,1,-1},{9399,4,0,-1},{9400,4,1,-1}, +{9333,4,1,-1},{9403,4,0,-1},{9404,4,1,-1},{9407,4,0,-1},{9408,4,1,-1}, +{9412,4,0,-1},{9413,4,1,-1},{9416,4,0,-1},{9417,4,1,-1},{9420,4,0,-1}, +{9421,4,1,-1},{9425,4,0,-1},{9426,4,1,-1},{9429,4,0,-1},{9430,4,1,-1}, +{9433,4,0,-1},{9434,4,1,-1},{9438,4,0,-1},{9439,4,1,-1},{9442,4,0,-1}, +{9443,4,1,-1},{9446,4,0,-1},{9447,4,1,-1},{9451,4,0,-1},{9452,4,1,-1}, +{9455,4,0,-1},{9456,4,1,-1},{9459,4,0,-1},{9460,4,1,-1},{9464,4,0,-1}, +{9465,4,1,-1},{9468,4,0,-1},{9469,4,1,-1},{9472,4,0,-1},{9473,4,1,-1}, +{9477,4,0,-1},{9478,4,1,-1},{9481,4,0,-1},{9482,4,1,-1},{9485,4,0,-1}, +{9486,4,1,-1},{9490,4,0,-1},{9491,4,1,-1},{9424,4,0,-1},{9494,4,0,-1}, +{9495,4,1,-1},{9498,4,0,-1},{9499,4,1,-1},{9503,4,0,-1},{9504,4,1,-1}, +{9437,4,1,-1},{9507,4,0,-1},{9508,4,1,-1},{9511,4,0,-1},{9512,4,1,-1}, +{9516,4,0,-1},{9517,4,1,-1},{9520,4,0,-1},{9521,4,1,-1},{9524,4,0,-1}, +{9525,4,1,-1},{9529,4,0,-1},{9530,4,1,-1},{9533,4,0,-1},{9534,4,1,-1}, +{9537,4,0,-1},{9538,4,1,-1},{9542,4,0,-1},{9543,4,1,-1},{9546,4,0,-1}, +{9547,4,1,-1},{9550,4,0,-1},{9551,4,1,-1},{9555,4,0,-1},{9556,4,1,-1}, +{9559,4,0,-1},{9560,4,1,-1},{9563,4,0,-1},{9564,4,1,-1},{9568,4,0,-1}, +{9569,4,1,-1},{9572,4,0,-1},{9573,4,1,-1},{9576,4,0,-1},{9577,4,1,-1}, +{9581,4,0,-1},{9582,4,1,-1},{9585,4,0,-1},{9586,4,1,-1},{9589,4,0,-1}, +{9590,4,1,-1},{9594,4,0,-1},{9595,4,1,-1},{9528,4,0,-1},{9598,4,0,-1}, +{9599,4,1,-1},{9602,4,0,-1},{9603,4,1,-1},{9607,4,0,-1},{9608,4,1,-1}, +{9541,4,1,-1},{9611,4,0,-1},{9612,4,1,-1},{9615,4,0,-1},{9616,4,1,-1}, +{9620,4,0,-1},{9621,4,1,-1},{9624,4,0,-1},{9625,4,1,-1},{9628,4,0,-1}, +{9629,4,1,-1},{9633,4,0,-1},{9634,4,1,-1},{9637,4,0,-1},{9638,4,1,-1}, +{9641,4,0,-1},{9642,4,1,-1},{9646,4,0,-1},{9647,4,1,-1},{9650,4,0,-1}, +{9651,4,1,-1},{9654,4,0,-1},{9655,4,1,-1},{9659,4,0,-1},{9660,4,1,-1}, +{9663,4,0,-1},{9664,4,1,-1},{9667,4,0,-1},{9668,4,1,-1},{9672,4,0,-1}, +{9673,4,1,-1},{9676,4,0,-1},{9677,4,1,-1},{9680,4,0,-1},{9681,4,1,-1}, +{9685,4,0,-1},{9686,4,1,-1},{9689,4,0,-1},{9690,4,1,-1},{9693,4,0,-1}, +{9694,4,1,-1},{9698,4,0,-1},{9699,4,1,-1},{9632,4,0,-1},{9702,4,0,-1}, +{9703,4,1,-1},{9706,4,0,-1},{9707,4,1,-1},{9711,4,0,-1},{9712,4,1,-1}, +{9645,4,1,-1},{9715,4,0,-1},{9716,4,1,-1},{9719,4,0,-1},{9720,4,1,-1}, +{9724,4,0,-1},{9725,4,1,-1},{9728,4,0,-1},{9729,4,1,-1},{9732,4,0,-1}, +{9733,4,1,-1},{9737,4,0,-1},{9738,4,1,-1},{9741,4,0,-1},{9742,4,1,-1}, +{9745,4,0,-1},{9746,4,1,-1},{9750,4,0,-1},{9751,4,1,-1},{9754,4,0,-1}, +{9755,4,1,-1},{9758,4,0,-1},{9759,4,1,-1},{9763,4,0,-1},{9764,4,1,-1}, +{9767,4,0,-1},{9768,4,1,-1},{9771,4,0,-1},{9772,4,1,-1},{9776,4,0,-1}, +{9777,4,1,-1},{9780,4,0,-1},{9781,4,1,-1},{9784,4,0,-1},{9785,4,1,-1}, +{9789,4,0,-1},{9790,4,1,-1},{9793,4,0,-1},{9794,4,1,-1},{9797,4,0,-1}, +{9798,4,1,-1},{9802,4,0,-1},{9803,4,1,-1},{9736,4,0,-1},{9806,4,0,-1}, +{9807,4,1,-1},{9810,4,0,-1},{9811,4,1,-1},{9815,4,0,-1},{9816,4,1,-1}, +{9749,4,1,-1},{9819,4,0,-1},{9820,4,1,-1},{9823,4,0,-1},{9824,4,1,-1}, +{9828,4,0,-1},{9829,4,1,-1},{9832,4,0,-1},{9833,4,1,-1},{9836,4,0,-1}, +{9837,4,1,-1},{9841,4,0,-1},{9842,4,1,-1},{9845,4,0,-1},{9846,4,1,-1}, +{9849,4,0,-1},{9850,4,1,-1},{9854,4,0,-1},{9855,4,1,-1},{9858,4,0,-1}, +{9859,4,1,-1},{9862,4,0,-1},{9863,4,1,-1},{9867,4,0,-1},{9868,4,1,-1}, +{9871,4,0,-1},{9872,4,1,-1},{9875,4,0,-1},{9876,4,1,-1},{9880,4,0,-1}, +{9881,4,1,-1},{9884,4,0,-1},{9885,4,1,-1},{9888,4,0,-1},{9889,4,1,-1}, +{9893,4,0,-1},{9894,4,1,-1},{9897,4,0,-1},{9898,4,1,-1},{9901,4,0,-1}, +{9902,4,1,-1},{9906,4,0,-1},{9907,4,1,-1},{9840,4,0,-1},{9910,4,0,-1}, +{9911,4,1,-1},{9914,4,0,-1},{9915,4,1,-1},{9919,4,0,-1},{9920,4,1,-1}, +{9853,4,1,-1},{9923,4,0,-1},{9924,4,1,-1},{9927,4,0,-1},{9928,4,1,-1}, +{9932,4,0,-1},{9933,4,1,-1},{9936,4,0,-1},{9937,4,1,-1},{9940,4,0,-1}, +{9941,4,1,-1},{9945,4,0,-1},{9946,4,1,-1},{9949,4,0,-1},{9950,4,1,-1}, +{9953,4,0,-1},{9954,4,1,-1},{9958,4,0,-1},{9959,4,1,-1},{9962,4,0,-1}, +{9963,4,1,-1},{9966,4,0,-1},{9967,4,1,-1},{9971,4,0,-1},{9972,4,1,-1}, +{9975,4,0,-1},{9976,4,1,-1},{9979,4,0,-1},{9980,4,1,-1},{9984,4,0,-1}, +{9985,4,1,-1},{9988,4,0,-1},{9989,4,1,-1},{9992,4,0,-1},{9993,4,1,-1}, +{9997,4,0,-1},{9998,4,1,-1},{10001,4,0,-1},{10002,4,1,-1},{10005,4,0,-1}, +{10006,4,1,-1},{10010,4,0,-1},{10011,4,1,-1},{9944,4,0,-1},{10014,4,0,-1}, +{10015,4,1,-1},{10018,4,0,-1},{10019,4,1,-1},{10023,4,0,-1},{10024,4,1,-1}, +{9957,4,1,-1},{10027,4,0,-1},{10028,4,1,-1},{10031,4,0,-1},{10032,4,1,-1}, +{10036,4,0,-1},{10037,4,1,-1},{10040,4,0,-1},{10041,4,1,-1},{10044,4,0,-1}, +{10045,4,1,-1},{10049,4,0,-1},{10050,4,1,-1},{10053,4,0,-1},{10054,4,1,-1}, +{10057,4,0,-1},{10058,4,1,-1},{10062,4,0,-1},{10063,4,1,-1},{10066,4,0,-1}, +{10067,4,1,-1},{10070,4,0,-1},{10071,4,1,-1},{10075,4,0,-1},{10076,4,1,-1}, +{10079,4,0,-1},{10080,4,1,-1},{10083,4,0,-1},{10084,4,1,-1},{10088,4,0,-1}, +{10089,4,1,-1},{10092,4,0,-1},{10093,4,1,-1},{10096,4,0,-1},{10097,4,1,-1}, +{10101,4,0,-1},{10102,4,1,-1},{10105,4,0,-1},{10106,4,1,-1},{10109,4,0,-1}, +{10110,4,1,-1},{10114,4,0,-1},{10115,4,1,-1},{10048,4,0,-1},{10118,4,0,-1}, +{10119,4,1,-1},{10122,4,0,-1},{10123,4,1,-1},{10127,4,0,-1},{10128,4,1,-1}, +{10061,4,1,-1},{10131,4,0,-1},{10132,4,1,-1},{10135,4,0,-1},{10136,4,1,-1}, +{10140,4,0,-1},{10141,4,1,-1},{10144,4,0,-1},{10145,4,1,-1},{10148,4,0,-1}, +{10149,4,1,-1},{10153,4,0,-1},{10154,4,1,-1},{10157,4,0,-1},{10158,4,1,-1}, +{10161,4,0,-1},{10162,4,1,-1},{10166,4,0,-1},{10167,4,1,-1},{10170,4,0,-1}, +{10171,4,1,-1},{10174,4,0,-1},{10175,4,1,-1},{10179,4,0,-1},{10180,4,1,-1}, +{10183,4,0,-1},{10184,4,1,-1},{10187,4,0,-1},{10188,4,1,-1},{10192,4,0,-1}, +{10193,4,1,-1},{10196,4,0,-1},{10197,4,1,-1},{10200,4,0,-1},{10201,4,1,-1}, +{10205,4,0,-1},{10206,4,1,-1},{10209,4,0,-1},{10210,4,1,-1},{10213,4,0,-1}, +{10214,4,1,-1},{10218,4,0,-1},{10219,4,1,-1},{10152,4,0,-1},{10222,4,0,-1}, +{10223,4,1,-1},{10226,4,0,-1},{10227,4,1,-1},{10231,4,0,-1},{10232,4,1,-1}, +{10165,4,1,-1},{10235,4,0,-1},{10236,4,1,-1},{10239,4,0,-1},{10240,4,1,-1}, +{10244,4,0,-1},{10245,4,1,-1},{10248,4,0,-1},{10249,4,1,-1},{10252,4,0,-1}, +{10253,4,1,-1},{10257,4,0,-1},{10258,4,1,-1},{10261,4,0,-1},{10262,4,1,-1}, +{10265,4,0,-1},{10266,4,1,-1},{10270,4,0,-1},{10271,4,1,-1},{10274,4,0,-1}, +{10275,4,1,-1},{10278,4,0,-1},{10279,4,1,-1},{10283,4,0,-1},{10284,4,1,-1}, +{10287,4,0,-1},{10288,4,1,-1},{10291,4,0,-1},{10292,4,1,-1},{10296,4,0,-1}, +{10297,4,1,-1},{10300,4,0,-1},{10301,4,1,-1},{10304,4,0,-1},{10305,4,1,-1}, +{10309,4,0,-1},{10310,4,1,-1},{10313,4,0,-1},{10314,4,1,-1},{10317,4,0,-1}, +{10318,4,1,-1},{10322,4,0,-1},{10323,4,1,-1},{10256,4,0,-1},{10326,4,0,-1}, +{10327,4,1,-1},{10330,4,0,-1},{10331,4,1,-1},{10335,4,0,-1},{10336,4,1,-1}, +{10269,4,1,-1},{10339,4,0,-1},{10340,4,1,-1},{10343,4,0,-1},{10344,4,1,-1}, +{10348,4,0,-1},{10349,4,1,-1},{10352,4,0,-1},{10353,4,1,-1},{10356,4,0,-1}, +{10357,4,1,-1},{10361,4,0,-1},{10362,4,1,-1},{10365,4,0,-1},{10366,4,1,-1}, +{10369,4,0,-1},{10370,4,1,-1},{10374,4,0,-1},{10375,4,1,-1},{10378,4,0,-1}, +{10379,4,1,-1},{10382,4,0,-1},{10383,4,1,-1},{10387,4,0,-1},{10388,4,1,-1}, +{10391,4,0,-1},{10392,4,1,-1},{10395,4,0,-1},{10396,4,1,-1},{10400,4,0,-1}, +{10401,4,1,-1},{10404,4,0,-1},{10405,4,1,-1},{10408,4,0,-1},{10409,4,1,-1}, +{10413,4,0,-1},{10414,4,1,-1},{10417,4,0,-1},{10418,4,1,-1},{10421,4,0,-1}, +{10422,4,1,-1},{10426,4,0,-1},{10427,4,1,-1},{10360,4,0,-1},{10430,4,0,-1}, +{10431,4,1,-1},{10434,4,0,-1},{10435,4,1,-1},{10439,4,0,-1},{10440,4,1,-1}, +{10373,4,1,-1},{10443,4,0,-1},{10444,4,1,-1},{10447,4,0,-1},{10448,4,1,-1}, +{10452,4,0,-1},{10453,4,1,-1},{10456,4,0,-1},{10457,4,1,-1},{10460,4,0,-1}, +{10461,4,1,-1},{10465,4,0,-1},{10466,4,1,-1},{10469,4,0,-1},{10470,4,1,-1}, +{10473,4,0,-1},{10474,4,1,-1},{10478,4,0,-1},{10479,4,1,-1},{10482,4,0,-1}, +{10483,4,1,-1},{10486,4,0,-1},{10487,4,1,-1},{10491,4,0,-1},{10492,4,1,-1}, +{10495,4,0,-1},{10496,4,1,-1},{10499,4,0,-1},{10500,4,1,-1},{10504,4,0,-1}, +{10505,4,1,-1},{10508,4,0,-1},{10509,4,1,-1},{10512,4,0,-1},{10513,4,1,-1}, +{10517,4,0,-1},{10518,4,1,-1},{10521,4,0,-1},{10522,4,1,-1},{10525,4,0,-1}, +{10526,4,1,-1},{10530,4,0,-1},{10531,4,1,-1},{10464,4,0,-1},{10534,4,0,-1}, +{10535,4,1,-1},{10538,4,0,-1},{10539,4,1,-1},{10543,4,0,-1},{10544,4,1,-1}, +{10477,4,1,-1},{10547,4,0,-1},{10548,4,1,-1},{10551,4,0,-1},{10552,4,1,-1}, +{10556,4,0,-1},{10557,4,1,-1},{10560,4,0,-1},{10561,4,1,-1},{10564,4,0,-1}, +{10565,4,1,-1},{10569,4,0,-1},{10570,4,1,-1},{10573,4,0,-1},{10574,4,1,-1}, +{10577,4,0,-1},{10578,4,1,-1},{10582,4,0,-1},{10583,4,1,-1},{10586,4,0,-1}, +{10587,4,1,-1},{10590,4,0,-1},{10591,4,1,-1},{10595,4,0,-1},{10596,4,1,-1}, +{10599,4,0,-1},{10600,4,1,-1},{10603,4,0,-1},{10604,4,1,-1},{10608,4,0,-1}, +{10609,4,1,-1},{10612,4,0,-1},{10613,4,1,-1},{10616,4,0,-1},{10617,4,1,-1}, +{10621,4,0,-1},{10622,4,1,-1},{10625,4,0,-1},{10626,4,1,-1},{10629,4,0,-1}, +{10630,4,1,-1},{10634,4,0,-1},{10635,4,1,-1},{10568,4,0,-1},{10638,4,0,-1}, +{10639,4,1,-1},{10642,4,0,-1},{10643,4,1,-1},{10647,4,0,-1},{10648,4,1,-1}, +{10581,4,1,-1},{10651,4,0,-1},{10652,4,1,-1},{10655,4,0,-1},{10656,4,1,-1}, +{10660,4,0,-1},{10661,4,1,-1},{10664,4,0,-1},{10665,4,1,-1},{10668,4,0,-1}, +{10669,4,1,-1},{10673,4,0,-1},{10674,4,1,-1},{10677,4,0,-1},{10678,4,1,-1}, +{10681,4,0,-1},{10682,4,1,-1},{10686,4,0,-1},{10687,4,1,-1},{10690,4,0,-1}, +{10691,4,1,-1},{10694,4,0,-1},{10695,4,1,-1},{10699,4,0,-1},{10700,4,1,-1}, +{10703,4,0,-1},{10704,4,1,-1},{10707,4,0,-1},{10708,4,1,-1},{10712,4,0,-1}, +{10713,4,1,-1},{10716,4,0,-1},{10717,4,1,-1},{10720,4,0,-1},{10721,4,1,-1}, +{10725,4,0,-1},{10726,4,1,-1},{10729,4,0,-1},{10730,4,1,-1},{10733,4,0,-1}, +{10734,4,1,-1},{10738,4,0,-1},{10739,4,1,-1},{10672,4,0,-1},{10742,4,0,-1}, +{10743,4,1,-1},{10746,4,0,-1},{10747,4,1,-1},{10751,4,0,-1},{10752,4,1,-1}, +{10685,4,1,-1},{10755,4,0,-1},{10756,4,1,-1},{10759,4,0,-1},{10760,4,1,-1}, +{10764,4,0,-1},{10765,4,1,-1},{10768,4,0,-1},{10769,4,1,-1},{10772,4,0,-1}, +{10773,4,1,-1},{10777,4,0,-1},{10778,4,1,-1},{10781,4,0,-1},{10782,4,1,-1}, +{10785,4,0,-1},{10786,4,1,-1},{10790,4,0,-1},{10791,4,1,-1},{10794,4,0,-1}, +{10795,4,1,-1},{10798,4,0,-1},{10799,4,1,-1},{10803,4,0,-1},{10804,4,1,-1}, +{10807,4,0,-1},{10808,4,1,-1},{10811,4,0,-1},{10812,4,1,-1},{10816,4,0,-1}, +{10817,4,1,-1},{10820,4,0,-1},{10821,4,1,-1},{10824,4,0,-1},{10825,4,1,-1}, +{10829,4,0,-1},{10830,4,1,-1},{10833,4,0,-1},{10834,4,1,-1},{10837,4,0,-1}, +{10838,4,1,-1},{10842,4,0,-1},{10843,4,1,-1},{10776,4,0,-1},{10846,4,0,-1}, +{10847,4,1,-1},{10850,4,0,-1},{10851,4,1,-1},{10855,4,0,-1},{10856,4,1,-1}, +{10789,4,1,-1},{10859,4,0,-1},{10860,4,1,-1},{10863,4,0,-1},{10864,4,1,-1}, +{10868,4,0,-1},{10869,4,1,-1},{10872,4,0,-1},{10873,4,1,-1},{10876,4,0,-1}, +{10877,4,1,-1},{10881,4,0,-1},{10882,4,1,-1},{10885,4,0,-1},{10886,4,1,-1}, +{10889,4,0,-1},{10890,4,1,-1},{10894,4,0,-1},{10895,4,1,-1},{10898,4,0,-1}, +{10899,4,1,-1},{10902,4,0,-1},{10903,4,1,-1},{10907,4,0,-1},{10908,4,1,-1}, +{10911,4,0,-1},{10912,4,1,-1},{10915,4,0,-1},{10916,4,1,-1},{10920,4,0,-1}, +{10921,4,1,-1},{10924,4,0,-1},{10925,4,1,-1},{10928,4,0,-1},{10929,4,1,-1}, +{10933,4,0,-1},{10934,4,1,-1},{10937,4,0,-1},{10938,4,1,-1},{10941,4,0,-1}, +{10942,4,1,-1},{10946,4,0,-1},{10947,4,1,-1},{10880,4,0,-1},{10950,4,0,-1}, +{10951,4,1,-1},{10954,4,0,-1},{10955,4,1,-1},{10959,4,0,-1},{10960,4,1,-1}, +{10893,4,1,-1},{10963,4,0,-1},{10964,4,1,-1},{10967,4,0,-1},{10968,4,1,-1}, +{10972,4,0,-1},{10973,4,1,-1},{10976,4,0,-1},{10977,4,1,-1},{10980,4,0,-1}, +{10981,4,1,-1},{10985,4,0,-1},{10986,4,1,-1},{10989,4,0,-1},{10990,4,1,-1}, +{10993,4,0,-1},{10994,4,1,-1},{10998,4,0,-1},{10999,4,1,-1},{11002,4,0,-1}, +{11003,4,1,-1},{11006,4,0,-1},{11007,4,1,-1},{11012,4,1,-1},{11016,4,1,-1}, +{11020,4,1,-1},{11025,4,1,-1},{11029,4,1,-1},{11033,4,1,-1},{11038,4,1,-1}, +{11042,4,1,-1},{11046,4,1,-1},{11051,4,1,-1},{10984,4,0,-1},{11055,4,1,-1}, +{11058,4,0,-1},{11059,4,1,-1},{10997,4,1,-1},{11067,4,0,-1},{11068,4,1,-1}, +{11072,4,1,-1},{11077,4,1,-1},{11081,4,1,-1},{11085,4,1,-1},{11090,4,1,-1}, +{11094,4,1,-1},{11098,4,1,-1},{11102,4,0,-1},{11103,4,1,-1},{11107,4,1,-1}, +{11111,4,1,-1},{11116,4,1,-1},{11120,4,1,-1},{11129,4,1,-1},{11133,4,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_5_ss0_ss1[] = { +{5269,5,0,-1},{5278,5,0,-1},{5286,5,0,-1},{5295,5,0,-1},{5304,5,0,-1}, +{5312,5,0,-1},{5321,5,0,-1},{5330,5,0,-1},{5264,5,0,-1},{5338,5,0,-1}, +{5347,5,0,-1},{5351,5,0,-1},{5356,5,0,-1},{5360,5,0,-1},{5364,5,0,-1}, +{5369,5,0,-1},{5373,5,0,-1},{5377,5,0,-1},{5382,5,0,-1},{5386,5,0,-1}, +{5390,5,0,-1},{5395,5,0,-1},{5399,5,0,-1},{5403,5,0,-1},{5408,5,0,-1}, +{5412,5,0,-1},{5416,5,0,-1},{5421,5,0,-1},{5425,5,0,-1},{5429,5,0,-1}, +{5434,5,0,-1},{5368,5,0,-1},{5438,5,0,-1},{5442,5,0,-1},{5447,5,0,-1}, +{5451,5,0,-1},{5455,5,0,-1},{5460,5,0,-1},{5464,5,0,-1},{5468,5,0,-1}, +{5473,5,0,-1},{5477,5,0,-1},{5481,5,0,-1},{5486,5,0,-1},{5490,5,0,-1}, +{5494,5,0,-1},{5499,5,0,-1},{5503,5,0,-1},{5507,5,0,-1},{5512,5,0,-1}, +{5516,5,0,-1},{5520,5,0,-1},{5525,5,0,-1},{5529,5,0,-1},{5533,5,0,-1}, +{5538,5,0,-1},{5472,5,0,-1},{5542,5,0,-1},{5546,5,0,-1},{5551,5,0,-1}, +{5555,5,0,-1},{5559,5,0,-1},{5564,5,0,-1},{5568,5,0,-1},{5572,5,0,-1}, +{5577,5,0,-1},{5581,5,0,-1},{5585,5,0,-1},{5590,5,0,-1},{5594,5,0,-1}, +{5598,5,0,-1},{5603,5,0,-1},{5607,5,0,-1},{5611,5,0,-1},{5616,5,0,-1}, +{5620,5,0,-1},{5624,5,0,-1},{5629,5,0,-1},{5633,5,0,-1},{5637,5,0,-1}, +{5638,5,1,-1},{5642,5,0,-1},{5576,5,0,-1},{5646,5,0,-1},{5647,5,1,-1}, +{5650,5,0,-1},{5655,5,0,-1},{5656,5,1,-1},{5659,5,0,-1},{5663,5,0,-1}, +{5668,5,0,-1},{5669,5,1,-1},{5672,5,0,-1},{5676,5,0,-1},{5677,5,1,-1}, +{5681,5,0,-1},{5685,5,0,-1},{5686,5,1,-1},{5689,5,0,-1},{5694,5,0,-1}, +{5695,5,1,-1},{5698,5,0,-1},{5702,5,0,-1},{5703,5,1,-1},{5707,5,0,-1}, +{5711,5,0,-1},{5712,5,1,-1},{5715,5,0,-1},{5720,5,0,-1},{5721,5,1,-1}, +{5724,5,0,-1},{5728,5,0,-1},{5729,5,1,-1},{5733,5,0,-1},{5737,5,0,-1}, +{5738,5,1,-1},{5741,5,0,-1},{5746,5,0,-1},{5747,5,1,-1},{5680,5,0,-1}, +{5750,5,0,-1},{5754,5,0,-1},{5755,5,1,-1},{5759,5,0,-1},{5693,5,1,-1}, +{5763,5,0,-1},{5764,5,1,-1},{5767,5,0,-1},{5772,5,0,-1},{5773,5,1,-1}, +{5776,5,0,-1},{5780,5,0,-1},{5781,5,1,-1},{5785,5,0,-1},{5789,5,0,-1}, +{5790,5,1,-1},{5793,5,0,-1},{5798,5,0,-1},{5799,5,1,-1},{5802,5,0,-1}, +{5806,5,0,-1},{5807,5,1,-1},{5811,5,0,-1},{5815,5,0,-1},{5816,5,1,-1}, +{5819,5,0,-1},{5820,5,1,-1},{5824,5,0,-1},{5825,5,1,-1},{5828,5,0,-1}, +{5829,5,1,-1},{5832,5,0,-1},{5833,5,1,-1},{5837,5,0,-1},{5838,5,1,-1}, +{5841,5,0,-1},{5842,5,1,-1},{5845,5,0,-1},{5850,5,0,-1},{5851,5,1,-1}, +{5784,5,0,-1},{5854,5,0,-1},{5855,5,1,-1},{5858,5,0,-1},{5859,5,1,-1}, +{5863,5,0,-1},{5864,5,1,-1},{5797,5,1,-1},{5867,5,0,-1},{5868,5,1,-1}, +{5871,5,0,-1},{5872,5,1,-1},{5876,5,0,-1},{5877,5,1,-1},{5880,5,0,-1}, +{5881,5,1,-1},{5884,5,0,-1},{5885,5,1,-1},{5890,5,1,-1},{5893,5,0,-1}, +{5894,5,1,-1},{5897,5,0,-1},{5898,5,1,-1},{5902,5,0,-1},{5903,5,1,-1}, +{5906,5,0,-1},{5907,5,1,-1},{5910,5,0,-1},{5911,5,1,-1},{5915,5,0,-1}, +{5916,5,1,-1},{5919,5,0,-1},{5920,5,1,-1},{5923,5,0,-1},{5924,5,1,-1}, +{5928,5,0,-1},{5929,5,1,-1},{5932,5,0,-1},{5933,5,1,-1},{5936,5,0,-1}, +{5937,5,1,-1},{5941,5,0,-1},{5942,5,1,-1},{5945,5,0,-1},{5946,5,1,-1}, +{5949,5,0,-1},{5950,5,1,-1},{5954,5,0,-1},{5955,5,1,-1},{5888,5,0,-1}, +{5958,5,0,-1},{5959,5,1,-1},{5962,5,0,-1},{5963,5,1,-1},{5967,5,0,-1}, +{5968,5,1,-1},{5901,5,1,-1},{5971,5,0,-1},{5972,5,1,-1},{5975,5,0,-1}, +{5976,5,1,-1},{5980,5,0,-1},{5981,5,1,-1},{5984,5,0,-1},{5988,5,0,-1}, +{5989,5,1,-1},{5993,5,0,-1},{5994,5,1,-1},{5997,5,0,-1},{5998,5,1,-1}, +{6001,5,0,-1},{6002,5,1,-1},{6006,5,0,-1},{6007,5,1,-1},{6010,5,0,-1}, +{6011,5,1,-1},{6014,5,0,-1},{6015,5,1,-1},{6019,5,0,-1},{6020,5,1,-1}, +{6023,5,0,-1},{6024,5,1,-1},{6028,5,1,-1},{6032,5,0,-1},{6033,5,1,-1}, +{6036,5,0,-1},{6040,5,0,-1},{6041,5,1,-1},{6045,5,0,-1},{6046,5,1,-1}, +{6049,5,0,-1},{6050,5,1,-1},{6053,5,0,-1},{6054,5,1,-1},{6058,5,0,-1}, +{6059,5,1,-1},{5992,5,0,-1},{6062,5,0,-1},{6063,5,1,-1},{6066,5,0,-1}, +{6067,5,1,-1},{6071,5,0,-1},{6072,5,1,-1},{6005,5,1,-1},{6075,5,0,-1}, +{6076,5,1,-1},{6079,5,0,-1},{6080,5,1,-1},{6084,5,0,-1},{6085,5,1,-1}, +{6088,5,0,-1},{6089,5,1,-1},{6092,5,0,-1},{6093,5,1,-1},{6097,5,0,-1}, +{6098,5,1,-1},{6101,5,0,-1},{6102,5,1,-1},{6105,5,0,-1},{6106,5,1,-1}, +{6110,5,0,-1},{6111,5,1,-1},{6114,5,0,-1},{6115,5,1,-1},{6118,5,0,-1}, +{6119,5,1,-1},{6123,5,0,-1},{6124,5,1,-1},{6127,5,0,-1},{6128,5,1,-1}, +{6131,5,0,-1},{6132,5,1,-1},{6136,5,0,-1},{6137,5,1,-1},{6140,5,0,-1}, +{6141,5,1,-1},{6144,5,0,-1},{6145,5,1,-1},{6149,5,0,-1},{6150,5,1,-1}, +{6153,5,0,-1},{6154,5,1,-1},{6157,5,0,-1},{6158,5,1,-1},{6162,5,0,-1}, +{6163,5,1,-1},{6096,5,0,-1},{6166,5,0,-1},{6167,5,1,-1},{6170,5,0,-1}, +{6171,5,1,-1},{6175,5,0,-1},{6176,5,1,-1},{6109,5,1,-1},{6179,5,0,-1}, +{6180,5,1,-1},{6183,5,0,-1},{6184,5,1,-1},{6188,5,0,-1},{6189,5,1,-1}, +{6192,5,0,-1},{6193,5,1,-1},{6196,5,0,-1},{6197,5,1,-1},{6201,5,0,-1}, +{6202,5,1,-1},{6205,5,0,-1},{6206,5,1,-1},{6209,5,0,-1},{6210,5,1,-1}, +{6214,5,0,-1},{6215,5,1,-1},{6218,5,0,-1},{6219,5,1,-1},{6222,5,0,-1}, +{6223,5,1,-1},{6227,5,0,-1},{6228,5,1,-1},{6231,5,0,-1},{6232,5,1,-1}, +{6235,5,0,-1},{6236,5,1,-1},{6240,5,0,-1},{6241,5,1,-1},{6244,5,0,-1}, +{6245,5,1,-1},{6248,5,0,-1},{6249,5,1,-1},{6253,5,0,-1},{6254,5,1,-1}, +{6257,5,0,-1},{6258,5,1,-1},{6261,5,0,-1},{6262,5,1,-1},{6266,5,0,-1}, +{6267,5,1,-1},{6200,5,0,-1},{6270,5,0,-1},{6271,5,1,-1},{6274,5,0,-1}, +{6275,5,1,-1},{6279,5,0,-1},{6280,5,1,-1},{6213,5,1,-1},{6283,5,0,-1}, +{6284,5,1,-1},{6287,5,0,-1},{6288,5,1,-1},{6292,5,0,-1},{6293,5,1,-1}, +{6296,5,0,-1},{6297,5,1,-1},{6300,5,0,-1},{6301,5,1,-1},{6305,5,0,-1}, +{6306,5,1,-1},{6309,5,0,-1},{6310,5,1,-1},{6313,5,0,-1},{6314,5,1,-1}, +{6318,5,0,-1},{6319,5,1,-1},{6322,5,0,-1},{6323,5,1,-1},{6326,5,0,-1}, +{6327,5,1,-1},{6331,5,0,-1},{6332,5,1,-1},{6335,5,0,-1},{6336,5,1,-1}, +{6339,5,0,-1},{6340,5,1,-1},{6344,5,0,-1},{6345,5,1,-1},{6348,5,0,-1}, +{6349,5,1,-1},{6352,5,0,-1},{6353,5,1,-1},{6357,5,0,-1},{6358,5,1,-1}, +{6361,5,0,-1},{6362,5,1,-1},{6365,5,0,-1},{6366,5,1,-1},{6370,5,0,-1}, +{6371,5,1,-1},{6304,5,0,-1},{6374,5,0,-1},{6375,5,1,-1},{6378,5,0,-1}, +{6379,5,1,-1},{6383,5,0,-1},{6384,5,1,-1},{6317,5,1,-1},{6387,5,0,-1}, +{6388,5,1,-1},{6391,5,0,-1},{6392,5,1,-1},{6396,5,0,-1},{6397,5,1,-1}, +{6400,5,0,-1},{6401,5,1,-1},{6404,5,0,-1},{6405,5,1,-1},{6409,5,0,-1}, +{6410,5,1,-1},{6413,5,0,-1},{6414,5,1,-1},{6417,5,0,-1},{6418,5,1,-1}, +{6422,5,0,-1},{6423,5,1,-1},{6426,5,0,-1},{6427,5,1,-1},{6430,5,0,-1}, +{6431,5,1,-1},{6435,5,0,-1},{6436,5,1,-1},{6439,5,0,-1},{6440,5,1,-1}, +{6443,5,0,-1},{6444,5,1,-1},{6448,5,0,-1},{6449,5,1,-1},{6452,5,0,-1}, +{6453,5,1,-1},{6456,5,0,-1},{6457,5,1,-1},{6461,5,0,-1},{6462,5,1,-1}, +{6465,5,0,-1},{6466,5,1,-1},{6469,5,0,-1},{6470,5,1,-1},{6474,5,0,-1}, +{6475,5,1,-1},{6408,5,0,-1},{6478,5,0,-1},{6479,5,1,-1},{6482,5,0,-1}, +{6483,5,1,-1},{6487,5,0,-1},{6488,5,1,-1},{6421,5,1,-1},{6491,5,0,-1}, +{6492,5,1,-1},{6495,5,0,-1},{6496,5,1,-1},{6500,5,0,-1},{6501,5,1,-1}, +{6504,5,0,-1},{6505,5,1,-1},{6508,5,0,-1},{6509,5,1,-1},{6513,5,0,-1}, +{6514,5,1,-1},{6517,5,0,-1},{6518,5,1,-1},{6521,5,0,-1},{6522,5,1,-1}, +{6526,5,0,-1},{6527,5,1,-1},{6530,5,0,-1},{6531,5,1,-1},{6534,5,0,-1}, +{6535,5,1,-1},{6539,5,0,-1},{6540,5,1,-1},{6543,5,0,-1},{6544,5,1,-1}, +{6547,5,0,-1},{6548,5,1,-1},{6552,5,0,-1},{6553,5,1,-1},{6556,5,0,-1}, +{6557,5,1,-1},{6560,5,0,-1},{6561,5,1,-1},{6565,5,0,-1},{6566,5,1,-1}, +{6569,5,0,-1},{6570,5,1,-1},{6573,5,0,-1},{6574,5,1,-1},{6578,5,0,-1}, +{6579,5,1,-1},{6512,5,0,-1},{6582,5,0,-1},{6583,5,1,-1},{6586,5,0,-1}, +{6587,5,1,-1},{6591,5,0,-1},{6592,5,1,-1},{6525,5,1,-1},{6595,5,0,-1}, +{6596,5,1,-1},{6599,5,0,-1},{6600,5,1,-1},{6604,5,0,-1},{6605,5,1,-1}, +{6608,5,0,-1},{6609,5,1,-1},{6612,5,0,-1},{6613,5,1,-1},{6617,5,0,-1}, +{6618,5,1,-1},{6621,5,0,-1},{6622,5,1,-1},{6625,5,0,-1},{6626,5,1,-1}, +{6630,5,0,-1},{6631,5,1,-1},{6634,5,0,-1},{6635,5,1,-1},{6638,5,0,-1}, +{6639,5,1,-1},{6643,5,0,-1},{6644,5,1,-1},{6647,5,0,-1},{6648,5,1,-1}, +{6651,5,0,-1},{6652,5,1,-1},{6656,5,0,-1},{6657,5,1,-1},{6660,5,0,-1}, +{6661,5,1,-1},{6664,5,0,-1},{6665,5,1,-1},{6669,5,0,-1},{6670,5,1,-1}, +{6673,5,0,-1},{6674,5,1,-1},{6677,5,0,-1},{6678,5,1,-1},{6682,5,0,-1}, +{6683,5,1,-1},{6616,5,0,-1},{6686,5,0,-1},{6687,5,1,-1},{6690,5,0,-1}, +{6691,5,1,-1},{6695,5,0,-1},{6696,5,1,-1},{6629,5,1,-1},{6699,5,0,-1}, +{6700,5,1,-1},{6703,5,0,-1},{6704,5,1,-1},{6708,5,0,-1},{6709,5,1,-1}, +{6712,5,0,-1},{6713,5,1,-1},{6716,5,0,-1},{6717,5,1,-1},{6721,5,0,-1}, +{6722,5,1,-1},{6725,5,0,-1},{6726,5,1,-1},{6729,5,0,-1},{6730,5,1,-1}, +{6734,5,0,-1},{6735,5,1,-1},{6738,5,0,-1},{6739,5,1,-1},{6742,5,0,-1}, +{6743,5,1,-1},{6747,5,0,-1},{6748,5,1,-1},{6751,5,0,-1},{6752,5,1,-1}, +{6755,5,0,-1},{6756,5,1,-1},{6760,5,0,-1},{6761,5,1,-1},{6764,5,0,-1}, +{6765,5,1,-1},{6768,5,0,-1},{6769,5,1,-1},{6773,5,0,-1},{6774,5,1,-1}, +{6777,5,0,-1},{6778,5,1,-1},{6781,5,0,-1},{6782,5,1,-1},{6786,5,0,-1}, +{6787,5,1,-1},{6720,5,0,-1},{6790,5,0,-1},{6791,5,1,-1},{6794,5,0,-1}, +{6795,5,1,-1},{6799,5,0,-1},{6800,5,1,-1},{6733,5,1,-1},{6803,5,0,-1}, +{6804,5,1,-1},{6807,5,0,-1},{6808,5,1,-1},{6812,5,0,-1},{6813,5,1,-1}, +{6816,5,0,-1},{6817,5,1,-1},{6820,5,0,-1},{6821,5,1,-1},{6825,5,0,-1}, +{6826,5,1,-1},{6829,5,0,-1},{6830,5,1,-1},{6833,5,0,-1},{6834,5,1,-1}, +{6838,5,0,-1},{6839,5,1,-1},{6842,5,0,-1},{6843,5,1,-1},{6846,5,0,-1}, +{6847,5,1,-1},{6851,5,0,-1},{6852,5,1,-1},{6855,5,0,-1},{6856,5,1,-1}, +{6859,5,0,-1},{6860,5,1,-1},{6864,5,0,-1},{6865,5,1,-1},{6868,5,0,-1}, +{6869,5,1,-1},{6872,5,0,-1},{6873,5,1,-1},{6877,5,0,-1},{6878,5,1,-1}, +{6881,5,0,-1},{6882,5,1,-1},{6885,5,0,-1},{6886,5,1,-1},{6890,5,0,-1}, +{6891,5,1,-1},{6824,5,0,-1},{6894,5,0,-1},{6895,5,1,-1},{6898,5,0,-1}, +{6899,5,1,-1},{6903,5,0,-1},{6904,5,1,-1},{6837,5,1,-1},{6907,5,0,-1}, +{6908,5,1,-1},{6911,5,0,-1},{6912,5,1,-1},{6916,5,0,-1},{6917,5,1,-1}, +{6920,5,0,-1},{6921,5,1,-1},{6924,5,0,-1},{6925,5,1,-1},{6929,5,0,-1}, +{6930,5,1,-1},{6933,5,0,-1},{6934,5,1,-1},{6937,5,0,-1},{6938,5,1,-1}, +{6942,5,0,-1},{6943,5,1,-1},{6946,5,0,-1},{6947,5,1,-1},{6950,5,0,-1}, +{6951,5,1,-1},{6955,5,0,-1},{6956,5,1,-1},{6959,5,0,-1},{6960,5,1,-1}, +{6963,5,0,-1},{6964,5,1,-1},{6968,5,0,-1},{6969,5,1,-1},{6972,5,0,-1}, +{6973,5,1,-1},{6976,5,0,-1},{6977,5,1,-1},{6981,5,0,-1},{6982,5,1,-1}, +{6985,5,0,-1},{6986,5,1,-1},{6989,5,0,-1},{6990,5,1,-1},{6994,5,0,-1}, +{6995,5,1,-1},{6928,5,0,-1},{6998,5,0,-1},{6999,5,1,-1},{7002,5,0,-1}, +{7003,5,1,-1},{7007,5,0,-1},{7008,5,1,-1},{6941,5,1,-1},{7011,5,0,-1}, +{7012,5,1,-1},{7015,5,0,-1},{7016,5,1,-1},{7020,5,0,-1},{7021,5,1,-1}, +{7024,5,0,-1},{7025,5,1,-1},{7028,5,0,-1},{7029,5,1,-1},{7033,5,0,-1}, +{7034,5,1,-1},{7037,5,0,-1},{7038,5,1,-1},{7041,5,0,-1},{7042,5,1,-1}, +{7046,5,0,-1},{7047,5,1,-1},{7050,5,0,-1},{7051,5,1,-1},{7054,5,0,-1}, +{7055,5,1,-1},{7059,5,0,-1},{7060,5,1,-1},{7063,5,0,-1},{7064,5,1,-1}, +{7067,5,0,-1},{7068,5,1,-1},{7072,5,0,-1},{7073,5,1,-1},{7076,5,0,-1}, +{7077,5,1,-1},{7080,5,0,-1},{7081,5,1,-1},{7085,5,0,-1},{7086,5,1,-1}, +{7089,5,0,-1},{7090,5,1,-1},{7093,5,0,-1},{7094,5,1,-1},{7098,5,0,-1}, +{7099,5,1,-1},{7032,5,0,-1},{7102,5,0,-1},{7103,5,1,-1},{7106,5,0,-1}, +{7107,5,1,-1},{7111,5,0,-1},{7112,5,1,-1},{7045,5,1,-1},{7115,5,0,-1}, +{7116,5,1,-1},{7119,5,0,-1},{7120,5,1,-1},{7124,5,0,-1},{7125,5,1,-1}, +{7128,5,0,-1},{7129,5,1,-1},{7132,5,0,-1},{7133,5,1,-1},{7137,5,0,-1}, +{7138,5,1,-1},{7141,5,0,-1},{7142,5,1,-1},{7145,5,0,-1},{7146,5,1,-1}, +{7150,5,0,-1},{7151,5,1,-1},{7154,5,0,-1},{7155,5,1,-1},{7158,5,0,-1}, +{7159,5,1,-1},{7163,5,0,-1},{7164,5,1,-1},{7167,5,0,-1},{7168,5,1,-1}, +{7171,5,0,-1},{7172,5,1,-1},{7176,5,0,-1},{7177,5,1,-1},{7180,5,0,-1}, +{7181,5,1,-1},{7184,5,0,-1},{7185,5,1,-1},{7189,5,0,-1},{7190,5,1,-1}, +{7193,5,0,-1},{7194,5,1,-1},{7197,5,0,-1},{7198,5,1,-1},{7202,5,0,-1}, +{7203,5,1,-1},{7136,5,0,-1},{7206,5,0,-1},{7207,5,1,-1},{7210,5,0,-1}, +{7211,5,1,-1},{7215,5,0,-1},{7216,5,1,-1},{7149,5,1,-1},{7219,5,0,-1}, +{7220,5,1,-1},{7223,5,0,-1},{7224,5,1,-1},{7228,5,0,-1},{7229,5,1,-1}, +{7232,5,0,-1},{7233,5,1,-1},{7236,5,0,-1},{7237,5,1,-1},{7241,5,0,-1}, +{7242,5,1,-1},{7245,5,0,-1},{7246,5,1,-1},{7249,5,0,-1},{7250,5,1,-1}, +{7254,5,0,-1},{7255,5,1,-1},{7258,5,0,-1},{7259,5,1,-1},{7262,5,0,-1}, +{7263,5,1,-1},{7267,5,0,-1},{7268,5,1,-1},{7271,5,0,-1},{7272,5,1,-1}, +{7275,5,0,-1},{7276,5,1,-1},{7280,5,0,-1},{7281,5,1,-1},{7284,5,0,-1}, +{7285,5,1,-1},{7288,5,0,-1},{7289,5,1,-1},{7293,5,0,-1},{7294,5,1,-1}, +{7297,5,0,-1},{7298,5,1,-1},{7301,5,0,-1},{7302,5,1,-1},{7306,5,0,-1}, +{7307,5,1,-1},{7240,5,0,-1},{7310,5,0,-1},{7311,5,1,-1},{7314,5,0,-1}, +{7315,5,1,-1},{7319,5,0,-1},{7320,5,1,-1},{7253,5,1,-1},{7323,5,0,-1}, +{7324,5,1,-1},{7327,5,0,-1},{7328,5,1,-1},{7332,5,0,-1},{7333,5,1,-1}, +{7336,5,0,-1},{7337,5,1,-1},{7340,5,0,-1},{7341,5,1,-1},{7345,5,0,-1}, +{7346,5,1,-1},{7349,5,0,-1},{7350,5,1,-1},{7353,5,0,-1},{7354,5,1,-1}, +{7358,5,0,-1},{7359,5,1,-1},{7362,5,0,-1},{7363,5,1,-1},{7366,5,0,-1}, +{7367,5,1,-1},{7371,5,0,-1},{7372,5,1,-1},{7375,5,0,-1},{7376,5,1,-1}, +{7379,5,0,-1},{7380,5,1,-1},{7384,5,0,-1},{7385,5,1,-1},{7388,5,0,-1}, +{7389,5,1,-1},{7392,5,0,-1},{7393,5,1,-1},{7397,5,0,-1},{7398,5,1,-1}, +{7401,5,0,-1},{7402,5,1,-1},{7405,5,0,-1},{7406,5,1,-1},{7410,5,0,-1}, +{7411,5,1,-1},{7344,5,0,-1},{7414,5,0,-1},{7415,5,1,-1},{7418,5,0,-1}, +{7419,5,1,-1},{7423,5,0,-1},{7424,5,1,-1},{7357,5,1,-1},{7427,5,0,-1}, +{7428,5,1,-1},{7431,5,0,-1},{7432,5,1,-1},{7436,5,0,-1},{7437,5,1,-1}, +{7440,5,0,-1},{7441,5,1,-1},{7444,5,0,-1},{7445,5,1,-1},{7449,5,0,-1}, +{7450,5,1,-1},{7453,5,0,-1},{7454,5,1,-1},{7457,5,0,-1},{7458,5,1,-1}, +{7462,5,0,-1},{7463,5,1,-1},{7466,5,0,-1},{7467,5,1,-1},{7470,5,0,-1}, +{7471,5,1,-1},{7475,5,0,-1},{7476,5,1,-1},{7479,5,0,-1},{7480,5,1,-1}, +{7483,5,0,-1},{7484,5,1,-1},{7488,5,0,-1},{7489,5,1,-1},{7492,5,0,-1}, +{7493,5,1,-1},{7496,5,0,-1},{7497,5,1,-1},{7501,5,0,-1},{7502,5,1,-1}, +{7505,5,0,-1},{7506,5,1,-1},{7509,5,0,-1},{7510,5,1,-1},{7514,5,0,-1}, +{7515,5,1,-1},{7448,5,0,-1},{7518,5,0,-1},{7519,5,1,-1},{7522,5,0,-1}, +{7523,5,1,-1},{7527,5,0,-1},{7528,5,1,-1},{7461,5,1,-1},{7531,5,0,-1}, +{7532,5,1,-1},{7535,5,0,-1},{7536,5,1,-1},{7540,5,0,-1},{7541,5,1,-1}, +{7544,5,0,-1},{7545,5,1,-1},{7548,5,0,-1},{7549,5,1,-1},{7553,5,0,-1}, +{7554,5,1,-1},{7557,5,0,-1},{7558,5,1,-1},{7561,5,0,-1},{7562,5,1,-1}, +{7566,5,0,-1},{7567,5,1,-1},{7570,5,0,-1},{7571,5,1,-1},{7574,5,0,-1}, +{7575,5,1,-1},{7579,5,0,-1},{7580,5,1,-1},{7583,5,0,-1},{7584,5,1,-1}, +{7587,5,0,-1},{7588,5,1,-1},{7592,5,0,-1},{7593,5,1,-1},{7596,5,0,-1}, +{7597,5,1,-1},{7600,5,0,-1},{7601,5,1,-1},{7605,5,0,-1},{7606,5,1,-1}, +{7609,5,0,-1},{7610,5,1,-1},{7613,5,0,-1},{7614,5,1,-1},{7618,5,0,-1}, +{7619,5,1,-1},{7552,5,0,-1},{7622,5,0,-1},{7623,5,1,-1},{7626,5,0,-1}, +{7627,5,1,-1},{7631,5,0,-1},{7632,5,1,-1},{7565,5,1,-1},{7635,5,0,-1}, +{7636,5,1,-1},{7639,5,0,-1},{7640,5,1,-1},{7644,5,0,-1},{7645,5,1,-1}, +{7648,5,0,-1},{7649,5,1,-1},{7652,5,0,-1},{7653,5,1,-1},{7657,5,0,-1}, +{7658,5,1,-1},{7661,5,0,-1},{7662,5,1,-1},{7665,5,0,-1},{7666,5,1,-1}, +{7670,5,0,-1},{7671,5,1,-1},{7674,5,0,-1},{7675,5,1,-1},{7678,5,0,-1}, +{7679,5,1,-1},{7683,5,0,-1},{7684,5,1,-1},{7687,5,0,-1},{7688,5,1,-1}, +{7691,5,0,-1},{7692,5,1,-1},{7696,5,0,-1},{7697,5,1,-1},{7700,5,0,-1}, +{7701,5,1,-1},{7704,5,0,-1},{7705,5,1,-1},{7709,5,0,-1},{7710,5,1,-1}, +{7713,5,0,-1},{7714,5,1,-1},{7717,5,0,-1},{7718,5,1,-1},{7722,5,0,-1}, +{7723,5,1,-1},{7656,5,0,-1},{7726,5,0,-1},{7727,5,1,-1},{7730,5,0,-1}, +{7731,5,1,-1},{7735,5,0,-1},{7736,5,1,-1},{7669,5,1,-1},{7739,5,0,-1}, +{7740,5,1,-1},{7743,5,0,-1},{7744,5,1,-1},{7748,5,0,-1},{7749,5,1,-1}, +{7752,5,0,-1},{7753,5,1,-1},{7756,5,0,-1},{7757,5,1,-1},{7761,5,0,-1}, +{7762,5,1,-1},{7765,5,0,-1},{7766,5,1,-1},{7769,5,0,-1},{7770,5,1,-1}, +{7774,5,0,-1},{7775,5,1,-1},{7778,5,0,-1},{7779,5,1,-1},{7782,5,0,-1}, +{7783,5,1,-1},{7787,5,0,-1},{7788,5,1,-1},{7791,5,0,-1},{7792,5,1,-1}, +{7795,5,0,-1},{7796,5,1,-1},{7800,5,0,-1},{7801,5,1,-1},{7804,5,0,-1}, +{7805,5,1,-1},{7808,5,0,-1},{7809,5,1,-1},{7813,5,0,-1},{7814,5,1,-1}, +{7817,5,0,-1},{7818,5,1,-1},{7821,5,0,-1},{7822,5,1,-1},{7826,5,0,-1}, +{7827,5,1,-1},{7760,5,0,-1},{7830,5,0,-1},{7831,5,1,-1},{7834,5,0,-1}, +{7835,5,1,-1},{7839,5,0,-1},{7840,5,1,-1},{7773,5,1,-1},{7843,5,0,-1}, +{7844,5,1,-1},{7847,5,0,-1},{7848,5,1,-1},{7852,5,0,-1},{7853,5,1,-1}, +{7856,5,0,-1},{7857,5,1,-1},{7860,5,0,-1},{7861,5,1,-1},{7865,5,0,-1}, +{7866,5,1,-1},{7869,5,0,-1},{7870,5,1,-1},{7873,5,0,-1},{7874,5,1,-1}, +{7878,5,0,-1},{7879,5,1,-1},{7882,5,0,-1},{7883,5,1,-1},{7886,5,0,-1}, +{7887,5,1,-1},{7891,5,0,-1},{7892,5,1,-1},{7895,5,0,-1},{7896,5,1,-1}, +{7899,5,0,-1},{7900,5,1,-1},{7904,5,0,-1},{7905,5,1,-1},{7908,5,0,-1}, +{7909,5,1,-1},{7912,5,0,-1},{7913,5,1,-1},{7917,5,0,-1},{7918,5,1,-1}, +{7921,5,0,-1},{7922,5,1,-1},{7925,5,0,-1},{7926,5,1,-1},{7930,5,0,-1}, +{7931,5,1,-1},{7864,5,0,-1},{7934,5,0,-1},{7935,5,1,-1},{7938,5,0,-1}, +{7939,5,1,-1},{7943,5,0,-1},{7944,5,1,-1},{7877,5,1,-1},{7947,5,0,-1}, +{7948,5,1,-1},{7951,5,0,-1},{7952,5,1,-1},{7956,5,0,-1},{7957,5,1,-1}, +{7960,5,0,-1},{7961,5,1,-1},{7964,5,0,-1},{7965,5,1,-1},{7969,5,0,-1}, +{7970,5,1,-1},{7973,5,0,-1},{7974,5,1,-1},{7977,5,0,-1},{7978,5,1,-1}, +{7982,5,0,-1},{7983,5,1,-1},{7986,5,0,-1},{7987,5,1,-1},{7990,5,0,-1}, +{7991,5,1,-1},{7995,5,0,-1},{7996,5,1,-1},{7999,5,0,-1},{8000,5,1,-1}, +{8003,5,0,-1},{8004,5,1,-1},{8008,5,0,-1},{8009,5,1,-1},{8012,5,0,-1}, +{8013,5,1,-1},{8016,5,0,-1},{8017,5,1,-1},{8021,5,0,-1},{8022,5,1,-1}, +{8025,5,0,-1},{8026,5,1,-1},{8029,5,0,-1},{8030,5,1,-1},{8034,5,0,-1}, +{8035,5,1,-1},{7968,5,0,-1},{8038,5,0,-1},{8039,5,1,-1},{8042,5,0,-1}, +{8043,5,1,-1},{8047,5,0,-1},{8048,5,1,-1},{7981,5,1,-1},{8051,5,0,-1}, +{8052,5,1,-1},{8055,5,0,-1},{8056,5,1,-1},{8060,5,0,-1},{8061,5,1,-1}, +{8064,5,0,-1},{8065,5,1,-1},{8068,5,0,-1},{8069,5,1,-1},{8073,5,0,-1}, +{8074,5,1,-1},{8077,5,0,-1},{8078,5,1,-1},{8081,5,0,-1},{8082,5,1,-1}, +{8086,5,0,-1},{8087,5,1,-1},{8090,5,0,-1},{8091,5,1,-1},{8094,5,0,-1}, +{8095,5,1,-1},{8099,5,0,-1},{8100,5,1,-1},{8103,5,0,-1},{8104,5,1,-1}, +{8107,5,0,-1},{8108,5,1,-1},{8112,5,0,-1},{8113,5,1,-1},{8116,5,0,-1}, +{8117,5,1,-1},{8120,5,0,-1},{8121,5,1,-1},{8125,5,0,-1},{8126,5,1,-1}, +{8129,5,0,-1},{8130,5,1,-1},{8133,5,0,-1},{8134,5,1,-1},{8138,5,0,-1}, +{8139,5,1,-1},{8072,5,0,-1},{8142,5,0,-1},{8143,5,1,-1},{8146,5,0,-1}, +{8147,5,1,-1},{8151,5,0,-1},{8152,5,1,-1},{8085,5,1,-1},{8155,5,0,-1}, +{8156,5,1,-1},{8159,5,0,-1},{8160,5,1,-1},{8164,5,0,-1},{8165,5,1,-1}, +{8168,5,0,-1},{8169,5,1,-1},{8172,5,0,-1},{8173,5,1,-1},{8177,5,0,-1}, +{8178,5,1,-1},{8181,5,0,-1},{8182,5,1,-1},{8185,5,0,-1},{8186,5,1,-1}, +{8190,5,0,-1},{8191,5,1,-1},{8194,5,0,-1},{8195,5,1,-1},{8198,5,0,-1}, +{8199,5,1,-1},{8203,5,0,-1},{8204,5,1,-1},{8207,5,0,-1},{8208,5,1,-1}, +{8211,5,0,-1},{8212,5,1,-1},{8216,5,0,-1},{8217,5,1,-1},{8220,5,0,-1}, +{8221,5,1,-1},{8224,5,0,-1},{8225,5,1,-1},{8229,5,0,-1},{8230,5,1,-1}, +{8233,5,0,-1},{8234,5,1,-1},{8237,5,0,-1},{8238,5,1,-1},{8242,5,0,-1}, +{8243,5,1,-1},{8176,5,0,-1},{8246,5,0,-1},{8247,5,1,-1},{8250,5,0,-1}, +{8251,5,1,-1},{8255,5,0,-1},{8256,5,1,-1},{8189,5,1,-1},{8259,5,0,-1}, +{8260,5,1,-1},{8263,5,0,-1},{8264,5,1,-1},{8268,5,0,-1},{8269,5,1,-1}, +{8272,5,0,-1},{8273,5,1,-1},{8276,5,0,-1},{8277,5,1,-1},{8281,5,0,-1}, +{8282,5,1,-1},{8285,5,0,-1},{8286,5,1,-1},{8289,5,0,-1},{8290,5,1,-1}, +{8294,5,0,-1},{8295,5,1,-1},{8298,5,0,-1},{8299,5,1,-1},{8302,5,0,-1}, +{8303,5,1,-1},{8307,5,0,-1},{8308,5,1,-1},{8311,5,0,-1},{8312,5,1,-1}, +{8315,5,0,-1},{8316,5,1,-1},{8320,5,0,-1},{8321,5,1,-1},{8324,5,0,-1}, +{8325,5,1,-1},{8328,5,0,-1},{8329,5,1,-1},{8333,5,0,-1},{8334,5,1,-1}, +{8337,5,0,-1},{8338,5,1,-1},{8341,5,0,-1},{8342,5,1,-1},{8346,5,0,-1}, +{8347,5,1,-1},{8280,5,0,-1},{8350,5,0,-1},{8351,5,1,-1},{8354,5,0,-1}, +{8355,5,1,-1},{8359,5,0,-1},{8360,5,1,-1},{8293,5,1,-1},{8363,5,0,-1}, +{8364,5,1,-1},{8367,5,0,-1},{8368,5,1,-1},{8372,5,0,-1},{8373,5,1,-1}, +{8376,5,0,-1},{8377,5,1,-1},{8380,5,0,-1},{8381,5,1,-1},{8385,5,0,-1}, +{8386,5,1,-1},{8389,5,0,-1},{8390,5,1,-1},{8393,5,0,-1},{8394,5,1,-1}, +{8398,5,0,-1},{8399,5,1,-1},{8402,5,0,-1},{8403,5,1,-1},{8406,5,0,-1}, +{8407,5,1,-1},{8411,5,0,-1},{8412,5,1,-1},{8415,5,0,-1},{8416,5,1,-1}, +{8419,5,0,-1},{8420,5,1,-1},{8424,5,0,-1},{8425,5,1,-1},{8428,5,0,-1}, +{8429,5,1,-1},{8432,5,0,-1},{8433,5,1,-1},{8437,5,0,-1},{8438,5,1,-1}, +{8441,5,0,-1},{8442,5,1,-1},{8445,5,0,-1},{8446,5,1,-1},{8450,5,0,-1}, +{8451,5,1,-1},{8384,5,0,-1},{8454,5,0,-1},{8455,5,1,-1},{8458,5,0,-1}, +{8459,5,1,-1},{8463,5,0,-1},{8464,5,1,-1},{8397,5,1,-1},{8467,5,0,-1}, +{8468,5,1,-1},{8471,5,0,-1},{8472,5,1,-1},{8476,5,0,-1},{8477,5,1,-1}, +{8480,5,0,-1},{8481,5,1,-1},{8484,5,0,-1},{8485,5,1,-1},{8489,5,0,-1}, +{8490,5,1,-1},{8493,5,0,-1},{8494,5,1,-1},{8497,5,0,-1},{8498,5,1,-1}, +{8502,5,0,-1},{8503,5,1,-1},{8506,5,0,-1},{8507,5,1,-1},{8510,5,0,-1}, +{8511,5,1,-1},{8515,5,0,-1},{8516,5,1,-1},{8519,5,0,-1},{8520,5,1,-1}, +{8523,5,0,-1},{8524,5,1,-1},{8528,5,0,-1},{8529,5,1,-1},{8532,5,0,-1}, +{8533,5,1,-1},{8536,5,0,-1},{8537,5,1,-1},{8541,5,0,-1},{8545,5,0,-1}, +{8549,5,0,-1},{8554,5,0,-1},{8488,5,0,-1},{8558,5,0,-1},{8562,5,0,-1}, +{8567,5,0,-1},{8501,5,1,-1},{8571,5,0,-1},{8575,5,0,-1},{8580,5,0,-1}, +{8584,5,0,-1},{8585,5,1,-1},{8588,5,0,-1},{8589,5,1,-1},{8597,5,0,-1}, +{8601,5,0,-1},{8606,5,0,-1},{8610,5,0,-1},{8614,5,0,-1},{8619,5,0,-1}, +{8623,5,0,-1},{8627,5,0,-1},{8632,5,0,-1},{8636,5,0,-1},{8640,5,0,-1}, +{8641,5,1,-1},{8649,5,0,-1},{8653,5,0,-1},{8658,5,0,-1},{8662,5,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS6, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_6_ss0_ss1[] = { +{8112,6,0,-1},{8120,6,0,-1},{8129,6,0,-1},{8138,6,0,-1},{8146,6,0,-1}, +{8155,6,0,-1},{8164,6,0,-1},{8098,6,0,-1},{8172,6,0,-1},{8181,6,0,-1}, +{8190,6,0,-1},{8198,6,0,-1},{8207,6,0,-1},{8211,6,0,-1},{8216,6,0,-1}, +{8220,6,0,-1},{8224,6,0,-1},{8229,6,0,-1},{8233,6,0,-1},{8237,6,0,-1}, +{8242,6,0,-1},{8246,6,0,-1},{8250,6,0,-1},{8255,6,0,-1},{8259,6,0,-1}, +{8263,6,0,-1},{8268,6,0,-1},{8202,6,0,-1},{8272,6,0,-1},{8276,6,0,-1}, +{8281,6,0,-1},{8285,6,0,-1},{8289,6,0,-1},{8294,6,0,-1},{8298,6,0,-1}, +{8302,6,0,-1},{8307,6,0,-1},{8311,6,0,-1},{8315,6,0,-1},{8320,6,0,-1}, +{8324,6,0,-1},{8328,6,0,-1},{8333,6,0,-1},{8337,6,0,-1},{8341,6,0,-1}, +{8346,6,0,-1},{8350,6,0,-1},{8354,6,0,-1},{8355,6,1,-1},{8359,6,0,-1}, +{8363,6,0,-1},{8364,6,1,-1},{8367,6,0,-1},{8372,6,0,-1},{8373,6,1,-1}, +{8306,6,0,-1},{8376,6,0,-1},{8380,6,0,-1},{8381,6,1,-1},{8385,6,0,-1}, +{8389,6,0,-1},{8390,6,1,-1},{8393,6,0,-1},{8398,6,0,-1},{8399,6,1,-1}, +{8402,6,0,-1},{8406,6,0,-1},{8407,6,1,-1},{8411,6,0,-1},{8412,6,1,-1}, +{8415,6,0,-1},{8416,6,1,-1},{8419,6,0,-1},{8420,6,1,-1},{8424,6,0,-1}, +{8425,6,1,-1},{8428,6,0,-1},{8432,6,0,-1},{8433,6,1,-1},{8437,6,0,-1}, +{8441,6,0,-1},{8442,6,1,-1},{8445,6,0,-1},{8450,6,0,-1},{8451,6,1,-1}, +{8454,6,0,-1},{8458,6,0,-1},{8459,6,1,-1},{8463,6,0,-1},{8467,6,0,-1}, +{8468,6,1,-1},{8471,6,0,-1},{8476,6,0,-1},{8477,6,1,-1},{8410,6,0,-1}, +{8480,6,0,-1},{8484,6,0,-1},{8485,6,1,-1},{8489,6,0,-1},{8490,6,1,-1}, +{8423,6,1,-1},{8493,6,0,-1},{8494,6,1,-1},{8497,6,0,-1},{8498,6,1,-1}, +{8502,6,0,-1},{8503,6,1,-1},{8506,6,0,-1},{8507,6,1,-1},{8510,6,0,-1}, +{8511,6,1,-1},{8515,6,0,-1},{8519,6,0,-1},{8520,6,1,-1},{8523,6,0,-1}, +{8524,6,1,-1},{8528,6,0,-1},{8529,6,1,-1},{8532,6,0,-1},{8533,6,1,-1}, +{8536,6,0,-1},{8537,6,1,-1},{8541,6,0,-1},{8542,6,1,-1},{8545,6,0,-1}, +{8546,6,1,-1},{8549,6,0,-1},{8550,6,1,-1},{8554,6,0,-1},{8555,6,1,-1}, +{8558,6,0,-1},{8559,6,1,-1},{8562,6,0,-1},{8563,6,1,-1},{8567,6,0,-1}, +{8568,6,1,-1},{8571,6,0,-1},{8572,6,1,-1},{8575,6,0,-1},{8576,6,1,-1}, +{8580,6,0,-1},{8581,6,1,-1},{8514,6,0,-1},{8584,6,0,-1},{8585,6,1,-1}, +{8588,6,0,-1},{8589,6,1,-1},{8593,6,0,-1},{8594,6,1,-1},{8527,6,1,-1}, +{8597,6,0,-1},{8598,6,1,-1},{8601,6,0,-1},{8602,6,1,-1},{8606,6,0,-1}, +{8607,6,1,-1},{8610,6,0,-1},{8611,6,1,-1},{8614,6,0,-1},{8615,6,1,-1}, +{8619,6,0,-1},{8620,6,1,-1},{8623,6,0,-1},{8624,6,1,-1},{8627,6,0,-1}, +{8628,6,1,-1},{8632,6,0,-1},{8633,6,1,-1},{8636,6,0,-1},{8637,6,1,-1}, +{8640,6,0,-1},{8641,6,1,-1},{8645,6,0,-1},{8646,6,1,-1},{8649,6,0,-1}, +{8650,6,1,-1},{8653,6,0,-1},{8654,6,1,-1},{8658,6,0,-1},{8659,6,1,-1}, +{8662,6,0,-1},{8663,6,1,-1},{8666,6,0,-1},{8667,6,1,-1},{8671,6,0,-1}, +{8672,6,1,-1},{8675,6,0,-1},{8676,6,1,-1},{8679,6,0,-1},{8680,6,1,-1}, +{8684,6,0,-1},{8685,6,1,-1},{8618,6,0,-1},{8688,6,0,-1},{8689,6,1,-1}, +{8692,6,0,-1},{8693,6,1,-1},{8697,6,0,-1},{8698,6,1,-1},{8631,6,1,-1}, +{8701,6,0,-1},{8702,6,1,-1},{8705,6,0,-1},{8706,6,1,-1},{8710,6,0,-1}, +{8711,6,1,-1},{8714,6,0,-1},{8715,6,1,-1},{8718,6,0,-1},{8719,6,1,-1}, +{8723,6,0,-1},{8724,6,1,-1},{8727,6,0,-1},{8728,6,1,-1},{8731,6,0,-1}, +{8732,6,1,-1},{8736,6,0,-1},{8737,6,1,-1},{8740,6,0,-1},{8741,6,1,-1}, +{8744,6,0,-1},{8745,6,1,-1},{8749,6,0,-1},{8750,6,1,-1},{8753,6,0,-1}, +{8754,6,1,-1},{8757,6,0,-1},{8758,6,1,-1},{8762,6,0,-1},{8763,6,1,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8771,6,1,-1},{8775,6,0,-1},{8776,6,1,-1}, +{8779,6,0,-1},{8780,6,1,-1},{8783,6,0,-1},{8784,6,1,-1},{8788,6,0,-1}, +{8789,6,1,-1},{8722,6,0,-1},{8792,6,0,-1},{8793,6,1,-1},{8796,6,0,-1}, +{8797,6,1,-1},{8801,6,0,-1},{8802,6,1,-1},{8735,6,1,-1},{8805,6,0,-1}, +{8806,6,1,-1},{8810,6,1,-1},{8814,6,0,-1},{8815,6,1,-1},{8818,6,0,-1}, +{8822,6,0,-1},{8823,6,1,-1},{8827,6,0,-1},{8828,6,1,-1},{8831,6,0,-1}, +{8832,6,1,-1},{8835,6,0,-1},{8836,6,1,-1},{8840,6,0,-1},{8841,6,1,-1}, +{8844,6,0,-1},{8845,6,1,-1},{8848,6,0,-1},{8849,6,1,-1},{8853,6,0,-1}, +{8854,6,1,-1},{8857,6,0,-1},{8858,6,1,-1},{8861,6,0,-1},{8862,6,1,-1}, +{8866,6,0,-1},{8867,6,1,-1},{8870,6,0,-1},{8871,6,1,-1},{8874,6,0,-1}, +{8875,6,1,-1},{8879,6,0,-1},{8880,6,1,-1},{8883,6,0,-1},{8884,6,1,-1}, +{8887,6,0,-1},{8888,6,1,-1},{8892,6,0,-1},{8893,6,1,-1},{8826,6,0,-1}, +{8896,6,0,-1},{8897,6,1,-1},{8900,6,0,-1},{8901,6,1,-1},{8905,6,0,-1}, +{8906,6,1,-1},{8839,6,1,-1},{8909,6,0,-1},{8910,6,1,-1},{8913,6,0,-1}, +{8914,6,1,-1},{8918,6,0,-1},{8919,6,1,-1},{8922,6,0,-1},{8923,6,1,-1}, +{8926,6,0,-1},{8927,6,1,-1},{8931,6,0,-1},{8932,6,1,-1},{8935,6,0,-1}, +{8936,6,1,-1},{8939,6,0,-1},{8940,6,1,-1},{8944,6,0,-1},{8945,6,1,-1}, +{8948,6,0,-1},{8949,6,1,-1},{8952,6,0,-1},{8953,6,1,-1},{8957,6,0,-1}, +{8958,6,1,-1},{8961,6,0,-1},{8962,6,1,-1},{8965,6,0,-1},{8966,6,1,-1}, +{8970,6,0,-1},{8971,6,1,-1},{8974,6,0,-1},{8975,6,1,-1},{8978,6,0,-1}, +{8979,6,1,-1},{8983,6,0,-1},{8984,6,1,-1},{8987,6,0,-1},{8988,6,1,-1}, +{8991,6,0,-1},{8992,6,1,-1},{8996,6,0,-1},{8997,6,1,-1},{8930,6,0,-1}, +{9000,6,0,-1},{9001,6,1,-1},{9004,6,0,-1},{9005,6,1,-1},{9009,6,0,-1}, +{9010,6,1,-1},{8943,6,1,-1},{9013,6,0,-1},{9014,6,1,-1},{9017,6,0,-1}, +{9018,6,1,-1},{9022,6,0,-1},{9023,6,1,-1},{9026,6,0,-1},{9027,6,1,-1}, +{9030,6,0,-1},{9031,6,1,-1},{9035,6,0,-1},{9036,6,1,-1},{9039,6,0,-1}, +{9040,6,1,-1},{9043,6,0,-1},{9044,6,1,-1},{9048,6,0,-1},{9049,6,1,-1}, +{9052,6,0,-1},{9053,6,1,-1},{9056,6,0,-1},{9057,6,1,-1},{9061,6,0,-1}, +{9062,6,1,-1},{9065,6,0,-1},{9066,6,1,-1},{9069,6,0,-1},{9070,6,1,-1}, +{9074,6,0,-1},{9075,6,1,-1},{9078,6,0,-1},{9079,6,1,-1},{9082,6,0,-1}, +{9083,6,1,-1},{9087,6,0,-1},{9088,6,1,-1},{9091,6,0,-1},{9092,6,1,-1}, +{9095,6,0,-1},{9096,6,1,-1},{9100,6,0,-1},{9101,6,1,-1},{9034,6,0,-1}, +{9104,6,0,-1},{9105,6,1,-1},{9108,6,0,-1},{9109,6,1,-1},{9113,6,0,-1}, +{9114,6,1,-1},{9047,6,1,-1},{9117,6,0,-1},{9118,6,1,-1},{9121,6,0,-1}, +{9122,6,1,-1},{9126,6,0,-1},{9127,6,1,-1},{9130,6,0,-1},{9131,6,1,-1}, +{9134,6,0,-1},{9135,6,1,-1},{9139,6,0,-1},{9140,6,1,-1},{9143,6,0,-1}, +{9144,6,1,-1},{9147,6,0,-1},{9148,6,1,-1},{9152,6,0,-1},{9153,6,1,-1}, +{9156,6,0,-1},{9157,6,1,-1},{9160,6,0,-1},{9161,6,1,-1},{9165,6,0,-1}, +{9166,6,1,-1},{9169,6,0,-1},{9170,6,1,-1},{9173,6,0,-1},{9174,6,1,-1}, +{9178,6,0,-1},{9179,6,1,-1},{9182,6,0,-1},{9183,6,1,-1},{9186,6,0,-1}, +{9187,6,1,-1},{9191,6,0,-1},{9192,6,1,-1},{9195,6,0,-1},{9196,6,1,-1}, +{9199,6,0,-1},{9200,6,1,-1},{9204,6,0,-1},{9205,6,1,-1},{9138,6,0,-1}, +{9208,6,0,-1},{9209,6,1,-1},{9212,6,0,-1},{9213,6,1,-1},{9217,6,0,-1}, +{9218,6,1,-1},{9151,6,1,-1},{9221,6,0,-1},{9222,6,1,-1},{9225,6,0,-1}, +{9226,6,1,-1},{9230,6,0,-1},{9231,6,1,-1},{9234,6,0,-1},{9235,6,1,-1}, +{9238,6,0,-1},{9239,6,1,-1},{9243,6,0,-1},{9244,6,1,-1},{9247,6,0,-1}, +{9248,6,1,-1},{9251,6,0,-1},{9252,6,1,-1},{9256,6,0,-1},{9257,6,1,-1}, +{9260,6,0,-1},{9261,6,1,-1},{9264,6,0,-1},{9265,6,1,-1},{9269,6,0,-1}, +{9270,6,1,-1},{9273,6,0,-1},{9274,6,1,-1},{9277,6,0,-1},{9278,6,1,-1}, +{9282,6,0,-1},{9283,6,1,-1},{9286,6,0,-1},{9287,6,1,-1},{9290,6,0,-1}, +{9291,6,1,-1},{9295,6,0,-1},{9296,6,1,-1},{9299,6,0,-1},{9300,6,1,-1}, +{9303,6,0,-1},{9304,6,1,-1},{9308,6,0,-1},{9309,6,1,-1},{9242,6,0,-1}, +{9312,6,0,-1},{9313,6,1,-1},{9316,6,0,-1},{9317,6,1,-1},{9321,6,0,-1}, +{9322,6,1,-1},{9255,6,1,-1},{9325,6,0,-1},{9326,6,1,-1},{9329,6,0,-1}, +{9330,6,1,-1},{9334,6,0,-1},{9335,6,1,-1},{9338,6,0,-1},{9339,6,1,-1}, +{9342,6,0,-1},{9343,6,1,-1},{9347,6,0,-1},{9348,6,1,-1},{9351,6,0,-1}, +{9352,6,1,-1},{9355,6,0,-1},{9356,6,1,-1},{9360,6,0,-1},{9361,6,1,-1}, +{9364,6,0,-1},{9365,6,1,-1},{9368,6,0,-1},{9369,6,1,-1},{9373,6,0,-1}, +{9374,6,1,-1},{9377,6,0,-1},{9378,6,1,-1},{9381,6,0,-1},{9382,6,1,-1}, +{9386,6,0,-1},{9387,6,1,-1},{9390,6,0,-1},{9391,6,1,-1},{9394,6,0,-1}, +{9395,6,1,-1},{9399,6,0,-1},{9400,6,1,-1},{9403,6,0,-1},{9404,6,1,-1}, +{9407,6,0,-1},{9408,6,1,-1},{9412,6,0,-1},{9413,6,1,-1},{9346,6,0,-1}, +{9416,6,0,-1},{9417,6,1,-1},{9420,6,0,-1},{9421,6,1,-1},{9425,6,0,-1}, +{9426,6,1,-1},{9359,6,1,-1},{9429,6,0,-1},{9430,6,1,-1},{9433,6,0,-1}, +{9434,6,1,-1},{9438,6,0,-1},{9439,6,1,-1},{9442,6,0,-1},{9443,6,1,-1}, +{9446,6,0,-1},{9447,6,1,-1},{9451,6,0,-1},{9452,6,1,-1},{9455,6,0,-1}, +{9456,6,1,-1},{9459,6,0,-1},{9460,6,1,-1},{9464,6,0,-1},{9465,6,1,-1}, +{9468,6,0,-1},{9469,6,1,-1},{9472,6,0,-1},{9473,6,1,-1},{9477,6,0,-1}, +{9478,6,1,-1},{9481,6,0,-1},{9482,6,1,-1},{9485,6,0,-1},{9486,6,1,-1}, +{9490,6,0,-1},{9491,6,1,-1},{9494,6,0,-1},{9495,6,1,-1},{9498,6,0,-1}, +{9499,6,1,-1},{9503,6,0,-1},{9504,6,1,-1},{9507,6,0,-1},{9508,6,1,-1}, +{9511,6,0,-1},{9512,6,1,-1},{9516,6,0,-1},{9517,6,1,-1},{9450,6,0,-1}, +{9520,6,0,-1},{9521,6,1,-1},{9524,6,0,-1},{9525,6,1,-1},{9529,6,0,-1}, +{9530,6,1,-1},{9463,6,1,-1},{9533,6,0,-1},{9534,6,1,-1},{9537,6,0,-1}, +{9538,6,1,-1},{9542,6,0,-1},{9543,6,1,-1},{9546,6,0,-1},{9547,6,1,-1}, +{9550,6,0,-1},{9551,6,1,-1},{9555,6,0,-1},{9556,6,1,-1},{9559,6,0,-1}, +{9560,6,1,-1},{9563,6,0,-1},{9564,6,1,-1},{9568,6,0,-1},{9569,6,1,-1}, +{9572,6,0,-1},{9573,6,1,-1},{9576,6,0,-1},{9577,6,1,-1},{9581,6,0,-1}, +{9582,6,1,-1},{9585,6,0,-1},{9586,6,1,-1},{9589,6,0,-1},{9590,6,1,-1}, +{9594,6,0,-1},{9595,6,1,-1},{9598,6,0,-1},{9599,6,1,-1},{9602,6,0,-1}, +{9603,6,1,-1},{9607,6,0,-1},{9608,6,1,-1},{9611,6,0,-1},{9612,6,1,-1}, +{9615,6,0,-1},{9616,6,1,-1},{9620,6,0,-1},{9621,6,1,-1},{9554,6,0,-1}, +{9624,6,0,-1},{9625,6,1,-1},{9628,6,0,-1},{9629,6,1,-1},{9633,6,0,-1}, +{9634,6,1,-1},{9567,6,1,-1},{9637,6,0,-1},{9638,6,1,-1},{9641,6,0,-1}, +{9642,6,1,-1},{9646,6,0,-1},{9647,6,1,-1},{9650,6,0,-1},{9651,6,1,-1}, +{9654,6,0,-1},{9655,6,1,-1},{9659,6,0,-1},{9660,6,1,-1},{9663,6,0,-1}, +{9664,6,1,-1},{9667,6,0,-1},{9668,6,1,-1},{9672,6,0,-1},{9673,6,1,-1}, +{9676,6,0,-1},{9677,6,1,-1},{9680,6,0,-1},{9681,6,1,-1},{9685,6,0,-1}, +{9686,6,1,-1},{9689,6,0,-1},{9690,6,1,-1},{9693,6,0,-1},{9694,6,1,-1}, +{9698,6,0,-1},{9699,6,1,-1},{9702,6,0,-1},{9703,6,1,-1},{9706,6,0,-1}, +{9707,6,1,-1},{9711,6,0,-1},{9712,6,1,-1},{9715,6,0,-1},{9716,6,1,-1}, +{9719,6,0,-1},{9720,6,1,-1},{9724,6,0,-1},{9725,6,1,-1},{9658,6,0,-1}, +{9728,6,0,-1},{9729,6,1,-1},{9732,6,0,-1},{9733,6,1,-1},{9737,6,0,-1}, +{9738,6,1,-1},{9671,6,1,-1},{9741,6,0,-1},{9742,6,1,-1},{9745,6,0,-1}, +{9746,6,1,-1},{9750,6,0,-1},{9751,6,1,-1},{9754,6,0,-1},{9755,6,1,-1}, +{9758,6,0,-1},{9759,6,1,-1},{9763,6,0,-1},{9764,6,1,-1},{9767,6,0,-1}, +{9768,6,1,-1},{9771,6,0,-1},{9772,6,1,-1},{9776,6,0,-1},{9777,6,1,-1}, +{9780,6,0,-1},{9781,6,1,-1},{9784,6,0,-1},{9785,6,1,-1},{9789,6,0,-1}, +{9790,6,1,-1},{9793,6,0,-1},{9794,6,1,-1},{9797,6,0,-1},{9798,6,1,-1}, +{9802,6,0,-1},{9803,6,1,-1},{9806,6,0,-1},{9807,6,1,-1},{9810,6,0,-1}, +{9811,6,1,-1},{9815,6,0,-1},{9816,6,1,-1},{9819,6,0,-1},{9820,6,1,-1}, +{9823,6,0,-1},{9824,6,1,-1},{9828,6,0,-1},{9829,6,1,-1},{9762,6,0,-1}, +{9832,6,0,-1},{9833,6,1,-1},{9836,6,0,-1},{9837,6,1,-1},{9841,6,0,-1}, +{9842,6,1,-1},{9775,6,1,-1},{9845,6,0,-1},{9846,6,1,-1},{9849,6,0,-1}, +{9850,6,1,-1},{9854,6,0,-1},{9855,6,1,-1},{9858,6,0,-1},{9859,6,1,-1}, +{9862,6,0,-1},{9863,6,1,-1},{9867,6,0,-1},{9868,6,1,-1},{9871,6,0,-1}, +{9872,6,1,-1},{9875,6,0,-1},{9876,6,1,-1},{9880,6,0,-1},{9881,6,1,-1}, +{9884,6,0,-1},{9885,6,1,-1},{9888,6,0,-1},{9889,6,1,-1},{9893,6,0,-1}, +{9894,6,1,-1},{9897,6,0,-1},{9898,6,1,-1},{9901,6,0,-1},{9902,6,1,-1}, +{9906,6,0,-1},{9907,6,1,-1},{9910,6,0,-1},{9911,6,1,-1},{9914,6,0,-1}, +{9915,6,1,-1},{9919,6,0,-1},{9920,6,1,-1},{9923,6,0,-1},{9924,6,1,-1}, +{9927,6,0,-1},{9928,6,1,-1},{9932,6,0,-1},{9933,6,1,-1},{9866,6,0,-1}, +{9936,6,0,-1},{9937,6,1,-1},{9940,6,0,-1},{9941,6,1,-1},{9945,6,0,-1}, +{9946,6,1,-1},{9879,6,1,-1},{9949,6,0,-1},{9950,6,1,-1},{9953,6,0,-1}, +{9954,6,1,-1},{9958,6,0,-1},{9959,6,1,-1},{9962,6,0,-1},{9963,6,1,-1}, +{9966,6,0,-1},{9967,6,1,-1},{9971,6,0,-1},{9972,6,1,-1},{9975,6,0,-1}, +{9976,6,1,-1},{9979,6,0,-1},{9980,6,1,-1},{9984,6,0,-1},{9985,6,1,-1}, +{9988,6,0,-1},{9989,6,1,-1},{9992,6,0,-1},{9993,6,1,-1},{9997,6,0,-1}, +{9998,6,1,-1},{10001,6,0,-1},{10002,6,1,-1},{10005,6,0,-1},{10006,6,1,-1}, +{10010,6,0,-1},{10011,6,1,-1},{10014,6,0,-1},{10015,6,1,-1},{10018,6,0,-1}, +{10019,6,1,-1},{10023,6,0,-1},{10024,6,1,-1},{10027,6,0,-1},{10028,6,1,-1}, +{10031,6,0,-1},{10032,6,1,-1},{10036,6,0,-1},{10037,6,1,-1},{9970,6,0,-1}, +{10040,6,0,-1},{10041,6,1,-1},{10044,6,0,-1},{10045,6,1,-1},{10049,6,0,-1}, +{10050,6,1,-1},{9983,6,1,-1},{10053,6,0,-1},{10054,6,1,-1},{10057,6,0,-1}, +{10058,6,1,-1},{10062,6,0,-1},{10063,6,1,-1},{10066,6,0,-1},{10067,6,1,-1}, +{10070,6,0,-1},{10071,6,1,-1},{10075,6,0,-1},{10076,6,1,-1},{10079,6,0,-1}, +{10080,6,1,-1},{10083,6,0,-1},{10084,6,1,-1},{10088,6,0,-1},{10089,6,1,-1}, +{10092,6,0,-1},{10093,6,1,-1},{10096,6,0,-1},{10097,6,1,-1},{10101,6,0,-1}, +{10102,6,1,-1},{10105,6,0,-1},{10106,6,1,-1},{10109,6,0,-1},{10110,6,1,-1}, +{10114,6,0,-1},{10115,6,1,-1},{10118,6,0,-1},{10119,6,1,-1},{10122,6,0,-1}, +{10123,6,1,-1},{10127,6,0,-1},{10128,6,1,-1},{10131,6,0,-1},{10132,6,1,-1}, +{10135,6,0,-1},{10136,6,1,-1},{10140,6,0,-1},{10141,6,1,-1},{10074,6,0,-1}, +{10144,6,0,-1},{10145,6,1,-1},{10148,6,0,-1},{10149,6,1,-1},{10153,6,0,-1}, +{10154,6,1,-1},{10087,6,1,-1},{10157,6,0,-1},{10158,6,1,-1},{10161,6,0,-1}, +{10162,6,1,-1},{10166,6,0,-1},{10167,6,1,-1},{10170,6,0,-1},{10171,6,1,-1}, +{10174,6,0,-1},{10175,6,1,-1},{10179,6,0,-1},{10180,6,1,-1},{10183,6,0,-1}, +{10184,6,1,-1},{10187,6,0,-1},{10188,6,1,-1},{10192,6,0,-1},{10193,6,1,-1}, +{10196,6,0,-1},{10197,6,1,-1},{10200,6,0,-1},{10201,6,1,-1},{10205,6,0,-1}, +{10206,6,1,-1},{10209,6,0,-1},{10210,6,1,-1},{10213,6,0,-1},{10214,6,1,-1}, +{10218,6,0,-1},{10219,6,1,-1},{10222,6,0,-1},{10223,6,1,-1},{10226,6,0,-1}, +{10227,6,1,-1},{10231,6,0,-1},{10232,6,1,-1},{10235,6,0,-1},{10236,6,1,-1}, +{10239,6,0,-1},{10240,6,1,-1},{10244,6,0,-1},{10245,6,1,-1},{10178,6,0,-1}, +{10248,6,0,-1},{10249,6,1,-1},{10252,6,0,-1},{10253,6,1,-1},{10257,6,0,-1}, +{10258,6,1,-1},{10191,6,1,-1},{10261,6,0,-1},{10262,6,1,-1},{10265,6,0,-1}, +{10266,6,1,-1},{10270,6,0,-1},{10271,6,1,-1},{10274,6,0,-1},{10275,6,1,-1}, +{10278,6,0,-1},{10279,6,1,-1},{10283,6,0,-1},{10284,6,1,-1},{10287,6,0,-1}, +{10288,6,1,-1},{10291,6,0,-1},{10292,6,1,-1},{10296,6,0,-1},{10297,6,1,-1}, +{10300,6,0,-1},{10301,6,1,-1},{10304,6,0,-1},{10305,6,1,-1},{10309,6,0,-1}, +{10310,6,1,-1},{10313,6,0,-1},{10314,6,1,-1},{10317,6,0,-1},{10318,6,1,-1}, +{10322,6,0,-1},{10323,6,1,-1},{10326,6,0,-1},{10327,6,1,-1},{10330,6,0,-1}, +{10331,6,1,-1},{10335,6,0,-1},{10336,6,1,-1},{10339,6,0,-1},{10340,6,1,-1}, +{10343,6,0,-1},{10344,6,1,-1},{10348,6,0,-1},{10349,6,1,-1},{10282,6,0,-1}, +{10352,6,0,-1},{10353,6,1,-1},{10356,6,0,-1},{10357,6,1,-1},{10361,6,0,-1}, +{10362,6,1,-1},{10295,6,1,-1},{10365,6,0,-1},{10366,6,1,-1},{10369,6,0,-1}, +{10370,6,1,-1},{10374,6,0,-1},{10375,6,1,-1},{10378,6,0,-1},{10379,6,1,-1}, +{10382,6,0,-1},{10383,6,1,-1},{10387,6,0,-1},{10388,6,1,-1},{10391,6,0,-1}, +{10392,6,1,-1},{10395,6,0,-1},{10396,6,1,-1},{10400,6,0,-1},{10401,6,1,-1}, +{10404,6,0,-1},{10405,6,1,-1},{10408,6,0,-1},{10409,6,1,-1},{10413,6,0,-1}, +{10414,6,1,-1},{10417,6,0,-1},{10418,6,1,-1},{10421,6,0,-1},{10422,6,1,-1}, +{10426,6,0,-1},{10427,6,1,-1},{10430,6,0,-1},{10431,6,1,-1},{10434,6,0,-1}, +{10435,6,1,-1},{10439,6,0,-1},{10440,6,1,-1},{10443,6,0,-1},{10444,6,1,-1}, +{10447,6,0,-1},{10448,6,1,-1},{10452,6,0,-1},{10453,6,1,-1},{10386,6,0,-1}, +{10456,6,0,-1},{10457,6,1,-1},{10460,6,0,-1},{10461,6,1,-1},{10465,6,0,-1}, +{10466,6,1,-1},{10399,6,1,-1},{10469,6,0,-1},{10470,6,1,-1},{10473,6,0,-1}, +{10474,6,1,-1},{10478,6,0,-1},{10479,6,1,-1},{10482,6,0,-1},{10483,6,1,-1}, +{10486,6,0,-1},{10487,6,1,-1},{10491,6,0,-1},{10492,6,1,-1},{10495,6,0,-1}, +{10496,6,1,-1},{10499,6,0,-1},{10500,6,1,-1},{10504,6,0,-1},{10505,6,1,-1}, +{10508,6,0,-1},{10509,6,1,-1},{10512,6,0,-1},{10513,6,1,-1},{10517,6,0,-1}, +{10518,6,1,-1},{10521,6,0,-1},{10522,6,1,-1},{10525,6,0,-1},{10526,6,1,-1}, +{10530,6,0,-1},{10531,6,1,-1},{10534,6,0,-1},{10535,6,1,-1},{10538,6,0,-1}, +{10539,6,1,-1},{10543,6,0,-1},{10544,6,1,-1},{10547,6,0,-1},{10548,6,1,-1}, +{10551,6,0,-1},{10552,6,1,-1},{10556,6,0,-1},{10557,6,1,-1},{10490,6,0,-1}, +{10560,6,0,-1},{10561,6,1,-1},{10564,6,0,-1},{10565,6,1,-1},{10569,6,0,-1}, +{10570,6,1,-1},{10503,6,1,-1},{10573,6,0,-1},{10574,6,1,-1},{10577,6,0,-1}, +{10578,6,1,-1},{10582,6,0,-1},{10583,6,1,-1},{10586,6,0,-1},{10587,6,1,-1}, +{10590,6,0,-1},{10591,6,1,-1},{10595,6,0,-1},{10596,6,1,-1},{10599,6,0,-1}, +{10600,6,1,-1},{10603,6,0,-1},{10604,6,1,-1},{10608,6,0,-1},{10609,6,1,-1}, +{10612,6,0,-1},{10613,6,1,-1},{10616,6,0,-1},{10617,6,1,-1},{10621,6,0,-1}, +{10622,6,1,-1},{10625,6,0,-1},{10626,6,1,-1},{10629,6,0,-1},{10630,6,1,-1}, +{10634,6,0,-1},{10635,6,1,-1},{10638,6,0,-1},{10639,6,1,-1},{10642,6,0,-1}, +{10643,6,1,-1},{10647,6,0,-1},{10648,6,1,-1},{10651,6,0,-1},{10652,6,1,-1}, +{10655,6,0,-1},{10656,6,1,-1},{10660,6,0,-1},{10661,6,1,-1},{10594,6,0,-1}, +{10664,6,0,-1},{10665,6,1,-1},{10668,6,0,-1},{10669,6,1,-1},{10673,6,0,-1}, +{10674,6,1,-1},{10607,6,1,-1},{10677,6,0,-1},{10678,6,1,-1},{10681,6,0,-1}, +{10682,6,1,-1},{10686,6,0,-1},{10687,6,1,-1},{10690,6,0,-1},{10691,6,1,-1}, +{10694,6,0,-1},{10695,6,1,-1},{10699,6,0,-1},{10700,6,1,-1},{10703,6,0,-1}, +{10704,6,1,-1},{10707,6,0,-1},{10708,6,1,-1},{10712,6,0,-1},{10713,6,1,-1}, +{10716,6,0,-1},{10717,6,1,-1},{10720,6,0,-1},{10721,6,1,-1},{10725,6,0,-1}, +{10726,6,1,-1},{10729,6,0,-1},{10730,6,1,-1},{10733,6,0,-1},{10734,6,1,-1}, +{10738,6,0,-1},{10739,6,1,-1},{10742,6,0,-1},{10743,6,1,-1},{10746,6,0,-1}, +{10747,6,1,-1},{10751,6,0,-1},{10752,6,1,-1},{10755,6,0,-1},{10756,6,1,-1}, +{10759,6,0,-1},{10760,6,1,-1},{10764,6,0,-1},{10765,6,1,-1},{10698,6,0,-1}, +{10768,6,0,-1},{10769,6,1,-1},{10772,6,0,-1},{10773,6,1,-1},{10777,6,0,-1}, +{10778,6,1,-1},{10711,6,1,-1},{10781,6,0,-1},{10782,6,1,-1},{10785,6,0,-1}, +{10786,6,1,-1},{10790,6,0,-1},{10791,6,1,-1},{10794,6,0,-1},{10795,6,1,-1}, +{10798,6,0,-1},{10799,6,1,-1},{10803,6,0,-1},{10804,6,1,-1},{10807,6,0,-1}, +{10808,6,1,-1},{10811,6,0,-1},{10812,6,1,-1},{10816,6,0,-1},{10817,6,1,-1}, +{10820,6,0,-1},{10821,6,1,-1},{10824,6,0,-1},{10825,6,1,-1},{10829,6,0,-1}, +{10830,6,1,-1},{10833,6,0,-1},{10834,6,1,-1},{10837,6,0,-1},{10838,6,1,-1}, +{10842,6,0,-1},{10843,6,1,-1},{10846,6,0,-1},{10847,6,1,-1},{10850,6,0,-1}, +{10851,6,1,-1},{10855,6,0,-1},{10856,6,1,-1},{10859,6,0,-1},{10860,6,1,-1}, +{10863,6,0,-1},{10864,6,1,-1},{10868,6,0,-1},{10869,6,1,-1},{10802,6,0,-1}, +{10872,6,0,-1},{10873,6,1,-1},{10876,6,0,-1},{10877,6,1,-1},{10881,6,0,-1}, +{10882,6,1,-1},{10815,6,1,-1},{10885,6,0,-1},{10886,6,1,-1},{10889,6,0,-1}, +{10890,6,1,-1},{10894,6,0,-1},{10895,6,1,-1},{10898,6,0,-1},{10899,6,1,-1}, +{10902,6,0,-1},{10903,6,1,-1},{10907,6,0,-1},{10908,6,1,-1},{10911,6,0,-1}, +{10912,6,1,-1},{10915,6,0,-1},{10916,6,1,-1},{10920,6,0,-1},{10921,6,1,-1}, +{10924,6,0,-1},{10925,6,1,-1},{10928,6,0,-1},{10929,6,1,-1},{10933,6,0,-1}, +{10934,6,1,-1},{10937,6,0,-1},{10938,6,1,-1},{10941,6,0,-1},{10942,6,1,-1}, +{10946,6,0,-1},{10947,6,1,-1},{10950,6,0,-1},{10951,6,1,-1},{10954,6,0,-1}, +{10955,6,1,-1},{10959,6,0,-1},{10960,6,1,-1},{10963,6,0,-1},{10964,6,1,-1}, +{10967,6,0,-1},{10968,6,1,-1},{10972,6,0,-1},{10973,6,1,-1},{10906,6,0,-1}, +{10976,6,0,-1},{10977,6,1,-1},{10980,6,0,-1},{10981,6,1,-1},{10985,6,0,-1}, +{10986,6,1,-1},{10919,6,1,-1},{10989,6,0,-1},{10990,6,1,-1},{10993,6,0,-1}, +{10994,6,1,-1},{10998,6,0,-1},{10999,6,1,-1},{11002,6,0,-1},{11003,6,1,-1}, +{11006,6,0,-1},{11007,6,1,-1},{11011,6,0,-1},{11012,6,1,-1},{11015,6,0,-1}, +{11016,6,1,-1},{11019,6,0,-1},{11020,6,1,-1},{11024,6,0,-1},{11025,6,1,-1}, +{11028,6,0,-1},{11029,6,1,-1},{11032,6,0,-1},{11033,6,1,-1},{11037,6,0,-1}, +{11038,6,1,-1},{11041,6,0,-1},{11042,6,1,-1},{11045,6,0,-1},{11046,6,1,-1}, +{11050,6,0,-1},{11051,6,1,-1},{11054,6,0,-1},{11055,6,1,-1},{11058,6,0,-1}, +{11059,6,1,-1},{11063,6,0,-1},{11064,6,1,-1},{11067,6,0,-1},{11068,6,1,-1}, +{11071,6,0,-1},{11072,6,1,-1},{11076,6,0,-1},{11077,6,1,-1},{11010,6,0,-1}, +{11080,6,0,-1},{11081,6,1,-1},{11084,6,0,-1},{11085,6,1,-1},{11089,6,0,-1}, +{11090,6,1,-1},{11023,6,1,-1},{11093,6,0,-1},{11094,6,1,-1},{11097,6,0,-1}, +{11098,6,1,-1},{11102,6,0,-1},{11103,6,1,-1},{11106,6,0,-1},{11107,6,1,-1}, +{11110,6,0,-1},{11111,6,1,-1},{11115,6,0,-1},{11116,6,1,-1},{11119,6,0,-1}, +{11120,6,1,-1},{11123,6,0,-1},{11124,6,1,-1},{11128,6,0,-1},{11129,6,1,-1}, +{11132,6,0,-1},{11133,6,1,-1},{11136,6,0,-1},{11137,6,1,-1},{11141,6,0,-1}, +{11142,6,1,-1},{11145,6,0,-1},{11146,6,1,-1},{11149,6,0,-1},{11150,6,1,-1}, +{11154,6,0,-1},{11155,6,1,-1},{11158,6,0,-1},{11159,6,1,-1},{11162,6,0,-1}, +{11163,6,1,-1},{11167,6,0,-1},{11168,6,1,-1},{11171,6,0,-1},{11172,6,1,-1}, +{11175,6,0,-1},{11176,6,1,-1},{11180,6,0,-1},{11181,6,1,-1},{11114,6,0,-1}, +{11184,6,0,-1},{11185,6,1,-1},{11188,6,0,-1},{11189,6,1,-1},{11193,6,0,-1}, +{11194,6,1,-1},{11127,6,1,-1},{11197,6,0,-1},{11198,6,1,-1},{11201,6,0,-1}, +{11202,6,1,-1},{11206,6,0,-1},{11207,6,1,-1},{11210,6,0,-1},{11211,6,1,-1}, +{11214,6,0,-1},{11215,6,1,-1},{11219,6,0,-1},{11220,6,1,-1},{11223,6,0,-1}, +{11224,6,1,-1},{11227,6,0,-1},{11228,6,1,-1},{11232,6,0,-1},{11233,6,1,-1}, +{11236,6,0,-1},{11237,6,1,-1},{11240,6,0,-1},{11241,6,1,-1},{11245,6,0,-1}, +{11246,6,1,-1},{11249,6,0,-1},{11250,6,1,-1},{11253,6,0,-1},{11254,6,1,-1}, +{11258,6,0,-1},{11259,6,1,-1},{11262,6,0,-1},{11263,6,1,-1},{11266,6,0,-1}, +{11267,6,1,-1},{11271,6,0,-1},{11272,6,1,-1},{11275,6,0,-1},{11276,6,1,-1}, +{11279,6,0,-1},{11280,6,1,-1},{11284,6,0,-1},{11285,6,1,-1},{11218,6,0,-1}, +{11288,6,0,-1},{11289,6,1,-1},{11292,6,0,-1},{11293,6,1,-1},{11297,6,0,-1}, +{11298,6,1,-1},{11231,6,1,-1},{11301,6,0,-1},{11302,6,1,-1},{11305,6,0,-1}, +{11306,6,1,-1},{11310,6,0,-1},{11311,6,1,-1},{11314,6,0,-1},{11315,6,1,-1}, +{11318,6,0,-1},{11319,6,1,-1},{11323,6,0,-1},{11324,6,1,-1},{11327,6,0,-1}, +{11328,6,1,-1},{11331,6,0,-1},{11332,6,1,-1},{11336,6,0,-1},{11337,6,1,-1}, +{11340,6,0,-1},{11341,6,1,-1},{11344,6,0,-1},{11345,6,1,-1},{11349,6,0,-1}, +{11350,6,1,-1},{11353,6,0,-1},{11354,6,1,-1},{11357,6,0,-1},{11358,6,1,-1}, +{11362,6,0,-1},{11363,6,1,-1},{11366,6,0,-1},{11367,6,1,-1},{11370,6,0,-1}, +{11371,6,1,-1},{11375,6,0,-1},{11376,6,1,-1},{11379,6,0,-1},{11380,6,1,-1}, +{11383,6,0,-1},{11384,6,1,-1},{11388,6,0,-1},{11389,6,1,-1},{11322,6,0,-1}, +{11392,6,0,-1},{11393,6,1,-1},{11396,6,0,-1},{11397,6,1,-1},{11401,6,0,-1}, +{11402,6,1,-1},{11335,6,1,-1},{11405,6,0,-1},{11406,6,1,-1},{11409,6,0,-1}, +{11410,6,1,-1},{11414,6,0,-1},{11415,6,1,-1},{11418,6,0,-1},{11419,6,1,-1}, +{11422,6,0,-1},{11423,6,1,-1},{11427,6,0,-1},{11428,6,1,-1},{11431,6,0,-1}, +{11432,6,1,-1},{11435,6,0,-1},{11436,6,1,-1},{11440,6,0,-1},{11441,6,1,-1}, +{11444,6,0,-1},{11445,6,1,-1},{11448,6,0,-1},{11449,6,1,-1},{11453,6,0,-1}, +{11454,6,1,-1},{11457,6,0,-1},{11458,6,1,-1},{11461,6,0,-1},{11462,6,1,-1}, +{11466,6,0,-1},{11467,6,1,-1},{11470,6,0,-1},{11471,6,1,-1},{11474,6,0,-1}, +{11475,6,1,-1},{11479,6,0,-1},{11480,6,1,-1},{11483,6,0,-1},{11484,6,1,-1}, +{11487,6,0,-1},{11488,6,1,-1},{11492,6,0,-1},{11493,6,1,-1},{11426,6,0,-1}, +{11496,6,0,-1},{11497,6,1,-1},{11500,6,0,-1},{11501,6,1,-1},{11505,6,0,-1}, +{11506,6,1,-1},{11439,6,1,-1},{11509,6,0,-1},{11510,6,1,-1},{11513,6,0,-1}, +{11514,6,1,-1},{11518,6,0,-1},{11519,6,1,-1},{11522,6,0,-1},{11523,6,1,-1}, +{11526,6,0,-1},{11527,6,1,-1},{11531,6,0,-1},{11532,6,1,-1},{11535,6,0,-1}, +{11536,6,1,-1},{11539,6,0,-1},{11540,6,1,-1},{11544,6,0,-1},{11545,6,1,-1}, +{11548,6,0,-1},{11549,6,1,-1},{11552,6,0,-1},{11553,6,1,-1},{11557,6,0,-1}, +{11558,6,1,-1},{11561,6,0,-1},{11562,6,1,-1},{11565,6,0,-1},{11566,6,1,-1}, +{11570,6,0,-1},{11571,6,1,-1},{11574,6,0,-1},{11575,6,1,-1},{11578,6,0,-1}, +{11579,6,1,-1},{11583,6,0,-1},{11584,6,1,-1},{11587,6,0,-1},{11588,6,1,-1}, +{11591,6,0,-1},{11592,6,1,-1},{11596,6,0,-1},{11597,6,1,-1},{11530,6,0,-1}, +{11600,6,0,-1},{11601,6,1,-1},{11604,6,0,-1},{11605,6,1,-1},{11609,6,0,-1}, +{11610,6,1,-1},{11543,6,1,-1},{11613,6,0,-1},{11614,6,1,-1},{11617,6,0,-1}, +{11622,6,0,-1},{11623,6,1,-1},{11626,6,0,-1},{11627,6,1,-1},{11630,6,0,-1}, +{11631,6,1,-1},{11635,6,0,-1},{11636,6,1,-1},{11639,6,0,-1},{11640,6,1,-1}, +{11643,6,0,-1},{11644,6,1,-1},{11648,6,0,-1},{11649,6,1,-1},{11652,6,0,-1}, +{11653,6,1,-1},{11656,6,0,-1},{11657,6,1,-1},{11661,6,0,-1},{11662,6,1,-1}, +{11665,6,0,-1},{11666,6,1,-1},{11674,6,0,-1},{11675,6,1,-1},{11678,6,0,-1}, +{11679,6,1,-1},{11682,6,0,-1},{11683,6,1,-1},{11687,6,0,-1},{11688,6,1,-1}, +{11691,6,0,-1},{11692,6,1,-1},{11695,6,0,-1},{11696,6,1,-1},{11700,6,0,-1}, +{11701,6,1,-1},{11704,6,0,-1},{11705,6,1,-1},{11708,6,0,-1},{11709,6,1,-1}, +{11713,6,0,-1},{11717,6,0,-1},{11726,6,0,-1},{11730,6,0,-1},{11734,6,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS7, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_7_ss0_ss1[] = { +{11752,7,0,-1},{11760,7,0,-1},{11769,7,0,-1},{11778,7,0,-1},{11786,7,0,-1}, +{11795,7,0,-1},{11799,7,0,-1},{11804,7,0,-1},{11738,7,0,-1},{11808,7,0,-1}, +{11812,7,0,-1},{11817,7,0,-1},{11821,7,0,-1},{11825,7,0,-1},{11830,7,0,-1}, +{11834,7,0,-1},{11838,7,0,-1},{11843,7,0,-1},{11847,7,0,-1},{11851,7,0,-1}, +{11856,7,0,-1},{11860,7,0,-1},{11864,7,0,-1},{11869,7,0,-1},{11873,7,0,-1}, +{11877,7,0,-1},{11882,7,0,-1},{11886,7,0,-1},{11890,7,0,-1},{11895,7,0,-1}, +{11899,7,0,-1},{11903,7,0,-1},{11908,7,0,-1},{11842,7,0,-1},{11912,7,0,-1}, +{11916,7,0,-1},{11921,7,0,-1},{11925,7,0,-1},{11929,7,0,-1},{11934,7,0,-1}, +{11938,7,0,-1},{11942,7,0,-1},{11947,7,0,-1},{11951,7,0,-1},{11955,7,0,-1}, +{11960,7,0,-1},{11964,7,0,-1},{11968,7,0,-1},{11973,7,0,-1},{11977,7,0,-1}, +{11981,7,0,-1},{11986,7,0,-1},{11990,7,0,-1},{11994,7,0,-1},{11999,7,0,-1}, +{12003,7,0,-1},{12007,7,0,-1},{12012,7,0,-1},{11946,7,0,-1},{12016,7,0,-1}, +{12020,7,0,-1},{12025,7,0,-1},{12026,7,1,-1},{12029,7,0,-1},{12033,7,0,-1}, +{12034,7,1,-1},{12038,7,0,-1},{12042,7,0,-1},{12046,7,0,-1},{12047,7,1,-1}, +{12051,7,0,-1},{12055,7,0,-1},{12056,7,1,-1},{12059,7,0,-1},{12064,7,0,-1}, +{12065,7,1,-1},{12068,7,0,-1},{12072,7,0,-1},{12073,7,1,-1},{12077,7,0,-1}, +{12081,7,0,-1},{12082,7,1,-1},{12085,7,0,-1},{12090,7,0,-1},{12091,7,1,-1}, +{12094,7,0,-1},{12098,7,0,-1},{12099,7,1,-1},{12103,7,0,-1},{12107,7,0,-1}, +{12108,7,1,-1},{12111,7,0,-1},{12116,7,0,-1},{12117,7,1,-1},{12050,7,0,-1}, +{12120,7,0,-1},{12124,7,0,-1},{12125,7,1,-1},{12129,7,0,-1},{12063,7,1,-1}, +{12133,7,0,-1},{12134,7,1,-1},{12137,7,0,-1},{12142,7,0,-1},{12143,7,1,-1}, +{12146,7,0,-1},{12150,7,0,-1},{12151,7,1,-1},{12155,7,0,-1},{12159,7,0,-1}, +{12160,7,1,-1},{12163,7,0,-1},{12168,7,0,-1},{12169,7,1,-1},{12172,7,0,-1}, +{12176,7,0,-1},{12177,7,1,-1},{12181,7,0,-1},{12185,7,0,-1},{12186,7,1,-1}, +{12189,7,0,-1},{12190,7,1,-1},{12194,7,0,-1},{12195,7,1,-1},{12198,7,0,-1}, +{12199,7,1,-1},{12202,7,0,-1},{12203,7,1,-1},{12207,7,0,-1},{12208,7,1,-1}, +{12211,7,0,-1},{12212,7,1,-1},{12215,7,0,-1},{12220,7,0,-1},{12221,7,1,-1}, +{12154,7,0,-1},{12224,7,0,-1},{12225,7,1,-1},{12228,7,0,-1},{12229,7,1,-1}, +{12233,7,0,-1},{12234,7,1,-1},{12167,7,1,-1},{12237,7,0,-1},{12238,7,1,-1}, +{12241,7,0,-1},{12242,7,1,-1},{12246,7,0,-1},{12247,7,1,-1},{12250,7,0,-1}, +{12251,7,1,-1},{12254,7,0,-1},{12255,7,1,-1},{12260,7,1,-1},{12263,7,0,-1}, +{12264,7,1,-1},{12267,7,0,-1},{12268,7,1,-1},{12272,7,0,-1},{12273,7,1,-1}, +{12276,7,0,-1},{12277,7,1,-1},{12280,7,0,-1},{12281,7,1,-1},{12285,7,0,-1}, +{12286,7,1,-1},{12289,7,0,-1},{12290,7,1,-1},{12293,7,0,-1},{12294,7,1,-1}, +{12298,7,0,-1},{12299,7,1,-1},{12302,7,0,-1},{12303,7,1,-1},{12306,7,0,-1}, +{12307,7,1,-1},{12311,7,0,-1},{12312,7,1,-1},{12315,7,0,-1},{12316,7,1,-1}, +{12319,7,0,-1},{12320,7,1,-1},{12324,7,0,-1},{12325,7,1,-1},{12258,7,0,-1}, +{12328,7,0,-1},{12329,7,1,-1},{12332,7,0,-1},{12333,7,1,-1},{12337,7,0,-1}, +{12338,7,1,-1},{12271,7,1,-1},{12341,7,0,-1},{12342,7,1,-1},{12345,7,0,-1}, +{12346,7,1,-1},{12350,7,0,-1},{12351,7,1,-1},{12354,7,0,-1},{12355,7,1,-1}, +{12358,7,0,-1},{12359,7,1,-1},{12363,7,0,-1},{12367,7,0,-1},{12368,7,1,-1}, +{12371,7,0,-1},{12372,7,1,-1},{12376,7,0,-1},{12377,7,1,-1},{12380,7,0,-1}, +{12381,7,1,-1},{12384,7,0,-1},{12385,7,1,-1},{12389,7,0,-1},{12390,7,1,-1}, +{12393,7,0,-1},{12394,7,1,-1},{12397,7,0,-1},{12398,7,1,-1},{12402,7,0,-1}, +{12403,7,1,-1},{12407,7,1,-1},{12410,7,0,-1},{12411,7,1,-1},{12415,7,0,-1}, +{12419,7,0,-1},{12420,7,1,-1},{12423,7,0,-1},{12424,7,1,-1},{12428,7,0,-1}, +{12429,7,1,-1},{12362,7,0,-1},{12432,7,0,-1},{12433,7,1,-1},{12436,7,0,-1}, +{12437,7,1,-1},{12441,7,0,-1},{12442,7,1,-1},{12375,7,1,-1},{12445,7,0,-1}, +{12446,7,1,-1},{12449,7,0,-1},{12450,7,1,-1},{12454,7,0,-1},{12455,7,1,-1}, +{12458,7,0,-1},{12459,7,1,-1},{12462,7,0,-1},{12463,7,1,-1},{12467,7,0,-1}, +{12468,7,1,-1},{12471,7,0,-1},{12472,7,1,-1},{12475,7,0,-1},{12476,7,1,-1}, +{12480,7,0,-1},{12481,7,1,-1},{12484,7,0,-1},{12485,7,1,-1},{12488,7,0,-1}, +{12489,7,1,-1},{12493,7,0,-1},{12494,7,1,-1},{12497,7,0,-1},{12498,7,1,-1}, +{12501,7,0,-1},{12502,7,1,-1},{12506,7,0,-1},{12507,7,1,-1},{12510,7,0,-1}, +{12511,7,1,-1},{12514,7,0,-1},{12515,7,1,-1},{12519,7,0,-1},{12520,7,1,-1}, +{12523,7,0,-1},{12524,7,1,-1},{12527,7,0,-1},{12528,7,1,-1},{12532,7,0,-1}, +{12533,7,1,-1},{12466,7,0,-1},{12536,7,0,-1},{12537,7,1,-1},{12540,7,0,-1}, +{12541,7,1,-1},{12545,7,0,-1},{12546,7,1,-1},{12479,7,1,-1},{12549,7,0,-1}, +{12550,7,1,-1},{12553,7,0,-1},{12554,7,1,-1},{12558,7,0,-1},{12559,7,1,-1}, +{12562,7,0,-1},{12563,7,1,-1},{12566,7,0,-1},{12567,7,1,-1},{12571,7,0,-1}, +{12572,7,1,-1},{12575,7,0,-1},{12576,7,1,-1},{12579,7,0,-1},{12580,7,1,-1}, +{12584,7,0,-1},{12585,7,1,-1},{12588,7,0,-1},{12589,7,1,-1},{12592,7,0,-1}, +{12593,7,1,-1},{12597,7,0,-1},{12598,7,1,-1},{12601,7,0,-1},{12602,7,1,-1}, +{12605,7,0,-1},{12606,7,1,-1},{12610,7,0,-1},{12611,7,1,-1},{12614,7,0,-1}, +{12615,7,1,-1},{12618,7,0,-1},{12619,7,1,-1},{12623,7,0,-1},{12624,7,1,-1}, +{12627,7,0,-1},{12628,7,1,-1},{12631,7,0,-1},{12632,7,1,-1},{12636,7,0,-1}, +{12637,7,1,-1},{12570,7,0,-1},{12640,7,0,-1},{12641,7,1,-1},{12644,7,0,-1}, +{12645,7,1,-1},{12649,7,0,-1},{12650,7,1,-1},{12583,7,1,-1},{12653,7,0,-1}, +{12654,7,1,-1},{12657,7,0,-1},{12658,7,1,-1},{12662,7,0,-1},{12663,7,1,-1}, +{12666,7,0,-1},{12667,7,1,-1},{12670,7,0,-1},{12671,7,1,-1},{12675,7,0,-1}, +{12676,7,1,-1},{12679,7,0,-1},{12680,7,1,-1},{12683,7,0,-1},{12684,7,1,-1}, +{12688,7,0,-1},{12689,7,1,-1},{12692,7,0,-1},{12693,7,1,-1},{12696,7,0,-1}, +{12697,7,1,-1},{12701,7,0,-1},{12702,7,1,-1},{12705,7,0,-1},{12706,7,1,-1}, +{12709,7,0,-1},{12710,7,1,-1},{12714,7,0,-1},{12715,7,1,-1},{12718,7,0,-1}, +{12719,7,1,-1},{12722,7,0,-1},{12723,7,1,-1},{12727,7,0,-1},{12728,7,1,-1}, +{12731,7,0,-1},{12732,7,1,-1},{12735,7,0,-1},{12736,7,1,-1},{12740,7,0,-1}, +{12741,7,1,-1},{12674,7,0,-1},{12744,7,0,-1},{12745,7,1,-1},{12748,7,0,-1}, +{12749,7,1,-1},{12753,7,0,-1},{12754,7,1,-1},{12687,7,1,-1},{12757,7,0,-1}, +{12758,7,1,-1},{12761,7,0,-1},{12762,7,1,-1},{12766,7,0,-1},{12767,7,1,-1}, +{12770,7,0,-1},{12771,7,1,-1},{12774,7,0,-1},{12775,7,1,-1},{12779,7,0,-1}, +{12780,7,1,-1},{12783,7,0,-1},{12784,7,1,-1},{12787,7,0,-1},{12788,7,1,-1}, +{12792,7,0,-1},{12793,7,1,-1},{12796,7,0,-1},{12797,7,1,-1},{12800,7,0,-1}, +{12801,7,1,-1},{12805,7,0,-1},{12806,7,1,-1},{12809,7,0,-1},{12810,7,1,-1}, +{12813,7,0,-1},{12814,7,1,-1},{12818,7,0,-1},{12819,7,1,-1},{12822,7,0,-1}, +{12823,7,1,-1},{12826,7,0,-1},{12827,7,1,-1},{12831,7,0,-1},{12832,7,1,-1}, +{12835,7,0,-1},{12836,7,1,-1},{12839,7,0,-1},{12840,7,1,-1},{12844,7,0,-1}, +{12845,7,1,-1},{12778,7,0,-1},{12848,7,0,-1},{12849,7,1,-1},{12852,7,0,-1}, +{12853,7,1,-1},{12857,7,0,-1},{12858,7,1,-1},{12791,7,1,-1},{12861,7,0,-1}, +{12862,7,1,-1},{12865,7,0,-1},{12866,7,1,-1},{12870,7,0,-1},{12871,7,1,-1}, +{12874,7,0,-1},{12875,7,1,-1},{12878,7,0,-1},{12879,7,1,-1},{12883,7,0,-1}, +{12884,7,1,-1},{12887,7,0,-1},{12888,7,1,-1},{12891,7,0,-1},{12892,7,1,-1}, +{12896,7,0,-1},{12897,7,1,-1},{12900,7,0,-1},{12901,7,1,-1},{12904,7,0,-1}, +{12905,7,1,-1},{12909,7,0,-1},{12910,7,1,-1},{12913,7,0,-1},{12914,7,1,-1}, +{12917,7,0,-1},{12918,7,1,-1},{12922,7,0,-1},{12923,7,1,-1},{12926,7,0,-1}, +{12927,7,1,-1},{12930,7,0,-1},{12931,7,1,-1},{12935,7,0,-1},{12936,7,1,-1}, +{12939,7,0,-1},{12940,7,1,-1},{12943,7,0,-1},{12944,7,1,-1},{12948,7,0,-1}, +{12949,7,1,-1},{12882,7,0,-1},{12952,7,0,-1},{12953,7,1,-1},{12956,7,0,-1}, +{12957,7,1,-1},{12961,7,0,-1},{12962,7,1,-1},{12895,7,1,-1},{12965,7,0,-1}, +{12966,7,1,-1},{12969,7,0,-1},{12970,7,1,-1},{12974,7,0,-1},{12975,7,1,-1}, +{12978,7,0,-1},{12979,7,1,-1},{12982,7,0,-1},{12983,7,1,-1},{12987,7,0,-1}, +{12988,7,1,-1},{12991,7,0,-1},{12992,7,1,-1},{12995,7,0,-1},{12996,7,1,-1}, +{13000,7,0,-1},{13001,7,1,-1},{13004,7,0,-1},{13005,7,1,-1},{13008,7,0,-1}, +{13009,7,1,-1},{13013,7,0,-1},{13014,7,1,-1},{13017,7,0,-1},{13018,7,1,-1}, +{13021,7,0,-1},{13022,7,1,-1},{13026,7,0,-1},{13027,7,1,-1},{13030,7,0,-1}, +{13031,7,1,-1},{13034,7,0,-1},{13035,7,1,-1},{13039,7,0,-1},{13040,7,1,-1}, +{13043,7,0,-1},{13044,7,1,-1},{13047,7,0,-1},{13048,7,1,-1},{13052,7,0,-1}, +{13053,7,1,-1},{12986,7,0,-1},{13056,7,0,-1},{13057,7,1,-1},{13060,7,0,-1}, +{13061,7,1,-1},{13065,7,0,-1},{13066,7,1,-1},{12999,7,1,-1},{13069,7,0,-1}, +{13070,7,1,-1},{13073,7,0,-1},{13074,7,1,-1},{13078,7,0,-1},{13079,7,1,-1}, +{13082,7,0,-1},{13083,7,1,-1},{13086,7,0,-1},{13087,7,1,-1},{13091,7,0,-1}, +{13092,7,1,-1},{13095,7,0,-1},{13096,7,1,-1},{13099,7,0,-1},{13100,7,1,-1}, +{13104,7,0,-1},{13105,7,1,-1},{13108,7,0,-1},{13109,7,1,-1},{13112,7,0,-1}, +{13113,7,1,-1},{13117,7,0,-1},{13118,7,1,-1},{13121,7,0,-1},{13122,7,1,-1}, +{13125,7,0,-1},{13126,7,1,-1},{13130,7,0,-1},{13131,7,1,-1},{13134,7,0,-1}, +{13135,7,1,-1},{13138,7,0,-1},{13139,7,1,-1},{13143,7,0,-1},{13144,7,1,-1}, +{13147,7,0,-1},{13148,7,1,-1},{13151,7,0,-1},{13152,7,1,-1},{13156,7,0,-1}, +{13157,7,1,-1},{13090,7,0,-1},{13160,7,0,-1},{13161,7,1,-1},{13164,7,0,-1}, +{13165,7,1,-1},{13169,7,0,-1},{13170,7,1,-1},{13103,7,1,-1},{13173,7,0,-1}, +{13174,7,1,-1},{13177,7,0,-1},{13178,7,1,-1},{13182,7,0,-1},{13183,7,1,-1}, +{13186,7,0,-1},{13187,7,1,-1},{13190,7,0,-1},{13191,7,1,-1},{13195,7,0,-1}, +{13196,7,1,-1},{13199,7,0,-1},{13200,7,1,-1},{13203,7,0,-1},{13204,7,1,-1}, +{13208,7,0,-1},{13209,7,1,-1},{13212,7,0,-1},{13213,7,1,-1},{13216,7,0,-1}, +{13217,7,1,-1},{13221,7,0,-1},{13222,7,1,-1},{13225,7,0,-1},{13226,7,1,-1}, +{13229,7,0,-1},{13230,7,1,-1},{13234,7,0,-1},{13235,7,1,-1},{13238,7,0,-1}, +{13239,7,1,-1},{13242,7,0,-1},{13243,7,1,-1},{13247,7,0,-1},{13248,7,1,-1}, +{13251,7,0,-1},{13252,7,1,-1},{13255,7,0,-1},{13256,7,1,-1},{13260,7,0,-1}, +{13261,7,1,-1},{13194,7,0,-1},{13264,7,0,-1},{13265,7,1,-1},{13268,7,0,-1}, +{13269,7,1,-1},{13273,7,0,-1},{13274,7,1,-1},{13207,7,1,-1},{13277,7,0,-1}, +{13278,7,1,-1},{13281,7,0,-1},{13282,7,1,-1},{13286,7,0,-1},{13287,7,1,-1}, +{13290,7,0,-1},{13291,7,1,-1},{13294,7,0,-1},{13295,7,1,-1},{13299,7,0,-1}, +{13300,7,1,-1},{13303,7,0,-1},{13304,7,1,-1},{13307,7,0,-1},{13308,7,1,-1}, +{13312,7,0,-1},{13313,7,1,-1},{13316,7,0,-1},{13317,7,1,-1},{13320,7,0,-1}, +{13321,7,1,-1},{13325,7,0,-1},{13326,7,1,-1},{13329,7,0,-1},{13330,7,1,-1}, +{13333,7,0,-1},{13334,7,1,-1},{13338,7,0,-1},{13339,7,1,-1},{13342,7,0,-1}, +{13343,7,1,-1},{13346,7,0,-1},{13347,7,1,-1},{13351,7,0,-1},{13352,7,1,-1}, +{13355,7,0,-1},{13356,7,1,-1},{13359,7,0,-1},{13360,7,1,-1},{13364,7,0,-1}, +{13365,7,1,-1},{13298,7,0,-1},{13368,7,0,-1},{13369,7,1,-1},{13372,7,0,-1}, +{13373,7,1,-1},{13377,7,0,-1},{13378,7,1,-1},{13311,7,1,-1},{13381,7,0,-1}, +{13382,7,1,-1},{13385,7,0,-1},{13386,7,1,-1},{13390,7,0,-1},{13391,7,1,-1}, +{13394,7,0,-1},{13395,7,1,-1},{13398,7,0,-1},{13399,7,1,-1},{13403,7,0,-1}, +{13404,7,1,-1},{13407,7,0,-1},{13408,7,1,-1},{13411,7,0,-1},{13412,7,1,-1}, +{13416,7,0,-1},{13417,7,1,-1},{13420,7,0,-1},{13421,7,1,-1},{13424,7,0,-1}, +{13425,7,1,-1},{13429,7,0,-1},{13430,7,1,-1},{13433,7,0,-1},{13434,7,1,-1}, +{13437,7,0,-1},{13438,7,1,-1},{13442,7,0,-1},{13443,7,1,-1},{13446,7,0,-1}, +{13447,7,1,-1},{13450,7,0,-1},{13451,7,1,-1},{13455,7,0,-1},{13456,7,1,-1}, +{13459,7,0,-1},{13460,7,1,-1},{13463,7,0,-1},{13464,7,1,-1},{13468,7,0,-1}, +{13469,7,1,-1},{13402,7,0,-1},{13472,7,0,-1},{13473,7,1,-1},{13476,7,0,-1}, +{13477,7,1,-1},{13481,7,0,-1},{13482,7,1,-1},{13415,7,1,-1},{13485,7,0,-1}, +{13486,7,1,-1},{13489,7,0,-1},{13490,7,1,-1},{13494,7,0,-1},{13495,7,1,-1}, +{13498,7,0,-1},{13499,7,1,-1},{13502,7,0,-1},{13503,7,1,-1},{13507,7,0,-1}, +{13508,7,1,-1},{13511,7,0,-1},{13512,7,1,-1},{13515,7,0,-1},{13516,7,1,-1}, +{13520,7,0,-1},{13521,7,1,-1},{13524,7,0,-1},{13525,7,1,-1},{13528,7,0,-1}, +{13529,7,1,-1},{13533,7,0,-1},{13534,7,1,-1},{13537,7,0,-1},{13538,7,1,-1}, +{13541,7,0,-1},{13542,7,1,-1},{13546,7,0,-1},{13547,7,1,-1},{13550,7,0,-1}, +{13551,7,1,-1},{13554,7,0,-1},{13555,7,1,-1},{13559,7,0,-1},{13560,7,1,-1}, +{13563,7,0,-1},{13564,7,1,-1},{13567,7,0,-1},{13568,7,1,-1},{13572,7,0,-1}, +{13573,7,1,-1},{13506,7,0,-1},{13576,7,0,-1},{13577,7,1,-1},{13580,7,0,-1}, +{13581,7,1,-1},{13585,7,0,-1},{13586,7,1,-1},{13519,7,1,-1},{13589,7,0,-1}, +{13590,7,1,-1},{13593,7,0,-1},{13594,7,1,-1},{13598,7,0,-1},{13599,7,1,-1}, +{13602,7,0,-1},{13603,7,1,-1},{13606,7,0,-1},{13607,7,1,-1},{13611,7,0,-1}, +{13612,7,1,-1},{13615,7,0,-1},{13616,7,1,-1},{13619,7,0,-1},{13620,7,1,-1}, +{13624,7,0,-1},{13625,7,1,-1},{13628,7,0,-1},{13629,7,1,-1},{13632,7,0,-1}, +{13633,7,1,-1},{13637,7,0,-1},{13638,7,1,-1},{13641,7,0,-1},{13642,7,1,-1}, +{13645,7,0,-1},{13646,7,1,-1},{13650,7,0,-1},{13651,7,1,-1},{13654,7,0,-1}, +{13655,7,1,-1},{13658,7,0,-1},{13659,7,1,-1},{13663,7,0,-1},{13664,7,1,-1}, +{13667,7,0,-1},{13668,7,1,-1},{13671,7,0,-1},{13672,7,1,-1},{13676,7,0,-1}, +{13677,7,1,-1},{13610,7,0,-1},{13680,7,0,-1},{13681,7,1,-1},{13684,7,0,-1}, +{13685,7,1,-1},{13689,7,0,-1},{13690,7,1,-1},{13623,7,1,-1},{13693,7,0,-1}, +{13694,7,1,-1},{13697,7,0,-1},{13698,7,1,-1},{13702,7,0,-1},{13703,7,1,-1}, +{13706,7,0,-1},{13707,7,1,-1},{13710,7,0,-1},{13711,7,1,-1},{13715,7,0,-1}, +{13716,7,1,-1},{13719,7,0,-1},{13720,7,1,-1},{13723,7,0,-1},{13724,7,1,-1}, +{13728,7,0,-1},{13729,7,1,-1},{13732,7,0,-1},{13733,7,1,-1},{13736,7,0,-1}, +{13737,7,1,-1},{13741,7,0,-1},{13742,7,1,-1},{13745,7,0,-1},{13746,7,1,-1}, +{13749,7,0,-1},{13750,7,1,-1},{13754,7,0,-1},{13755,7,1,-1},{13758,7,0,-1}, +{13759,7,1,-1},{13762,7,0,-1},{13763,7,1,-1},{13767,7,0,-1},{13768,7,1,-1}, +{13771,7,0,-1},{13772,7,1,-1},{13775,7,0,-1},{13776,7,1,-1},{13780,7,0,-1}, +{13781,7,1,-1},{13714,7,0,-1},{13784,7,0,-1},{13785,7,1,-1},{13788,7,0,-1}, +{13789,7,1,-1},{13793,7,0,-1},{13794,7,1,-1},{13727,7,1,-1},{13797,7,0,-1}, +{13798,7,1,-1},{13801,7,0,-1},{13802,7,1,-1},{13806,7,0,-1},{13807,7,1,-1}, +{13810,7,0,-1},{13811,7,1,-1},{13814,7,0,-1},{13815,7,1,-1},{13819,7,0,-1}, +{13820,7,1,-1},{13823,7,0,-1},{13824,7,1,-1},{13827,7,0,-1},{13828,7,1,-1}, +{13832,7,0,-1},{13833,7,1,-1},{13836,7,0,-1},{13837,7,1,-1},{13840,7,0,-1}, +{13841,7,1,-1},{13845,7,0,-1},{13846,7,1,-1},{13849,7,0,-1},{13850,7,1,-1}, +{13853,7,0,-1},{13854,7,1,-1},{13858,7,0,-1},{13859,7,1,-1},{13862,7,0,-1}, +{13863,7,1,-1},{13866,7,0,-1},{13867,7,1,-1},{13871,7,0,-1},{13872,7,1,-1}, +{13875,7,0,-1},{13876,7,1,-1},{13879,7,0,-1},{13880,7,1,-1},{13884,7,0,-1}, +{13885,7,1,-1},{13818,7,0,-1},{13888,7,0,-1},{13889,7,1,-1},{13892,7,0,-1}, +{13893,7,1,-1},{13897,7,0,-1},{13898,7,1,-1},{13831,7,1,-1},{13901,7,0,-1}, +{13902,7,1,-1},{13905,7,0,-1},{13906,7,1,-1},{13910,7,0,-1},{13911,7,1,-1}, +{13914,7,0,-1},{13915,7,1,-1},{13918,7,0,-1},{13919,7,1,-1},{13923,7,0,-1}, +{13924,7,1,-1},{13927,7,0,-1},{13928,7,1,-1},{13931,7,0,-1},{13932,7,1,-1}, +{13936,7,0,-1},{13937,7,1,-1},{13940,7,0,-1},{13941,7,1,-1},{13944,7,0,-1}, +{13945,7,1,-1},{13949,7,0,-1},{13950,7,1,-1},{13953,7,0,-1},{13954,7,1,-1}, +{13957,7,0,-1},{13958,7,1,-1},{13962,7,0,-1},{13963,7,1,-1},{13966,7,0,-1}, +{13967,7,1,-1},{13970,7,0,-1},{13971,7,1,-1},{13975,7,0,-1},{13976,7,1,-1}, +{13979,7,0,-1},{13980,7,1,-1},{13983,7,0,-1},{13984,7,1,-1},{13988,7,0,-1}, +{13989,7,1,-1},{13922,7,0,-1},{13992,7,0,-1},{13993,7,1,-1},{13996,7,0,-1}, +{13997,7,1,-1},{14001,7,0,-1},{14002,7,1,-1},{13935,7,1,-1},{14005,7,0,-1}, +{14006,7,1,-1},{14009,7,0,-1},{14010,7,1,-1},{14014,7,0,-1},{14015,7,1,-1}, +{14018,7,0,-1},{14019,7,1,-1},{14022,7,0,-1},{14023,7,1,-1},{14027,7,0,-1}, +{14028,7,1,-1},{14031,7,0,-1},{14032,7,1,-1},{14035,7,0,-1},{14036,7,1,-1}, +{14040,7,0,-1},{14041,7,1,-1},{14044,7,0,-1},{14045,7,1,-1},{14048,7,0,-1}, +{14049,7,1,-1},{14053,7,0,-1},{14054,7,1,-1},{14057,7,0,-1},{14058,7,1,-1}, +{14061,7,0,-1},{14062,7,1,-1},{14066,7,0,-1},{14067,7,1,-1},{14070,7,0,-1}, +{14071,7,1,-1},{14074,7,0,-1},{14075,7,1,-1},{14079,7,0,-1},{14080,7,1,-1}, +{14083,7,0,-1},{14084,7,1,-1},{14087,7,0,-1},{14088,7,1,-1},{14092,7,0,-1}, +{14093,7,1,-1},{14026,7,0,-1},{14096,7,0,-1},{14097,7,1,-1},{14100,7,0,-1}, +{14101,7,1,-1},{14105,7,0,-1},{14106,7,1,-1},{14039,7,1,-1},{14109,7,0,-1}, +{14110,7,1,-1},{14113,7,0,-1},{14114,7,1,-1},{14118,7,0,-1},{14119,7,1,-1}, +{14122,7,0,-1},{14123,7,1,-1},{14126,7,0,-1},{14127,7,1,-1},{14131,7,0,-1}, +{14132,7,1,-1},{14135,7,0,-1},{14136,7,1,-1},{14139,7,0,-1},{14140,7,1,-1}, +{14144,7,0,-1},{14145,7,1,-1},{14148,7,0,-1},{14149,7,1,-1},{14152,7,0,-1}, +{14153,7,1,-1},{14157,7,0,-1},{14158,7,1,-1},{14161,7,0,-1},{14162,7,1,-1}, +{14165,7,0,-1},{14166,7,1,-1},{14170,7,0,-1},{14171,7,1,-1},{14174,7,0,-1}, +{14175,7,1,-1},{14178,7,0,-1},{14179,7,1,-1},{14183,7,0,-1},{14184,7,1,-1}, +{14187,7,0,-1},{14188,7,1,-1},{14191,7,0,-1},{14192,7,1,-1},{14196,7,0,-1}, +{14197,7,1,-1},{14130,7,0,-1},{14200,7,0,-1},{14201,7,1,-1},{14204,7,0,-1}, +{14205,7,1,-1},{14209,7,0,-1},{14210,7,1,-1},{14143,7,1,-1},{14213,7,0,-1}, +{14214,7,1,-1},{14217,7,0,-1},{14218,7,1,-1},{14222,7,0,-1},{14223,7,1,-1}, +{14226,7,0,-1},{14227,7,1,-1},{14230,7,0,-1},{14231,7,1,-1},{14235,7,0,-1}, +{14236,7,1,-1},{14239,7,0,-1},{14240,7,1,-1},{14243,7,0,-1},{14244,7,1,-1}, +{14248,7,0,-1},{14249,7,1,-1},{14252,7,0,-1},{14253,7,1,-1},{14256,7,0,-1}, +{14257,7,1,-1},{14261,7,0,-1},{14262,7,1,-1},{14265,7,0,-1},{14266,7,1,-1}, +{14269,7,0,-1},{14270,7,1,-1},{14274,7,0,-1},{14275,7,1,-1},{14278,7,0,-1}, +{14279,7,1,-1},{14282,7,0,-1},{14283,7,1,-1},{14287,7,0,-1},{14288,7,1,-1}, +{14291,7,0,-1},{14292,7,1,-1},{14295,7,0,-1},{14296,7,1,-1},{14300,7,0,-1}, +{14301,7,1,-1},{14234,7,0,-1},{14304,7,0,-1},{14305,7,1,-1},{14308,7,0,-1}, +{14309,7,1,-1},{14313,7,0,-1},{14314,7,1,-1},{14247,7,1,-1},{14317,7,0,-1}, +{14318,7,1,-1},{14321,7,0,-1},{14322,7,1,-1},{14326,7,0,-1},{14327,7,1,-1}, +{14330,7,0,-1},{14331,7,1,-1},{14334,7,0,-1},{14335,7,1,-1},{14339,7,0,-1}, +{14340,7,1,-1},{14343,7,0,-1},{14344,7,1,-1},{14347,7,0,-1},{14348,7,1,-1}, +{14352,7,0,-1},{14353,7,1,-1},{14356,7,0,-1},{14357,7,1,-1},{14360,7,0,-1}, +{14361,7,1,-1},{14365,7,0,-1},{14366,7,1,-1},{14369,7,0,-1},{14370,7,1,-1}, +{14373,7,0,-1},{14374,7,1,-1},{14378,7,0,-1},{14379,7,1,-1},{14382,7,0,-1}, +{14383,7,1,-1},{14386,7,0,-1},{14387,7,1,-1},{14391,7,0,-1},{14392,7,1,-1}, +{14395,7,0,-1},{14396,7,1,-1},{14399,7,0,-1},{14400,7,1,-1},{14404,7,0,-1}, +{14405,7,1,-1},{14338,7,0,-1},{14408,7,0,-1},{14409,7,1,-1},{14412,7,0,-1}, +{14413,7,1,-1},{14417,7,0,-1},{14418,7,1,-1},{14351,7,1,-1},{14421,7,0,-1}, +{14422,7,1,-1},{14425,7,0,-1},{14426,7,1,-1},{14430,7,0,-1},{14431,7,1,-1}, +{14434,7,0,-1},{14435,7,1,-1},{14438,7,0,-1},{14439,7,1,-1},{14443,7,0,-1}, +{14444,7,1,-1},{14447,7,0,-1},{14448,7,1,-1},{14451,7,0,-1},{14452,7,1,-1}, +{14456,7,0,-1},{14457,7,1,-1},{14460,7,0,-1},{14461,7,1,-1},{14464,7,0,-1}, +{14465,7,1,-1},{14469,7,0,-1},{14470,7,1,-1},{14473,7,0,-1},{14474,7,1,-1}, +{14477,7,0,-1},{14478,7,1,-1},{14482,7,0,-1},{14483,7,1,-1},{14486,7,0,-1}, +{14487,7,1,-1},{14490,7,0,-1},{14491,7,1,-1},{14495,7,0,-1},{14496,7,1,-1}, +{14499,7,0,-1},{14500,7,1,-1},{14503,7,0,-1},{14504,7,1,-1},{14508,7,0,-1}, +{14509,7,1,-1},{14442,7,0,-1},{14512,7,0,-1},{14513,7,1,-1},{14516,7,0,-1}, +{14517,7,1,-1},{14521,7,0,-1},{14522,7,1,-1},{14455,7,1,-1},{14525,7,0,-1}, +{14526,7,1,-1},{14529,7,0,-1},{14530,7,1,-1},{14534,7,0,-1},{14535,7,1,-1}, +{14538,7,0,-1},{14539,7,1,-1},{14542,7,0,-1},{14543,7,1,-1},{14547,7,0,-1}, +{14548,7,1,-1},{14551,7,0,-1},{14552,7,1,-1},{14555,7,0,-1},{14556,7,1,-1}, +{14560,7,0,-1},{14561,7,1,-1},{14564,7,0,-1},{14565,7,1,-1},{14568,7,0,-1}, +{14569,7,1,-1},{14573,7,0,-1},{14574,7,1,-1},{14577,7,0,-1},{14578,7,1,-1}, +{14581,7,0,-1},{14582,7,1,-1},{14586,7,0,-1},{14587,7,1,-1},{14590,7,0,-1}, +{14591,7,1,-1},{14594,7,0,-1},{14595,7,1,-1},{14599,7,0,-1},{14600,7,1,-1}, +{14603,7,0,-1},{14604,7,1,-1},{14607,7,0,-1},{14608,7,1,-1},{14612,7,0,-1}, +{14613,7,1,-1},{14546,7,0,-1},{14616,7,0,-1},{14617,7,1,-1},{14620,7,0,-1}, +{14621,7,1,-1},{14625,7,0,-1},{14626,7,1,-1},{14559,7,1,-1},{14629,7,0,-1}, +{14630,7,1,-1},{14633,7,0,-1},{14634,7,1,-1},{14638,7,0,-1},{14639,7,1,-1}, +{14642,7,0,-1},{14643,7,1,-1},{14646,7,0,-1},{14647,7,1,-1},{14651,7,0,-1}, +{14652,7,1,-1},{14655,7,0,-1},{14656,7,1,-1},{14659,7,0,-1},{14660,7,1,-1}, +{14664,7,0,-1},{14665,7,1,-1},{14668,7,0,-1},{14669,7,1,-1},{14672,7,0,-1}, +{14673,7,1,-1},{14677,7,0,-1},{14678,7,1,-1},{14681,7,0,-1},{14682,7,1,-1}, +{14685,7,0,-1},{14686,7,1,-1},{14690,7,0,-1},{14691,7,1,-1},{14694,7,0,-1}, +{14695,7,1,-1},{14698,7,0,-1},{14699,7,1,-1},{14703,7,0,-1},{14704,7,1,-1}, +{14707,7,0,-1},{14708,7,1,-1},{14711,7,0,-1},{14712,7,1,-1},{14716,7,0,-1}, +{14717,7,1,-1},{14650,7,0,-1},{14720,7,0,-1},{14721,7,1,-1},{14724,7,0,-1}, +{14725,7,1,-1},{14729,7,0,-1},{14730,7,1,-1},{14663,7,1,-1},{14733,7,0,-1}, +{14734,7,1,-1},{14737,7,0,-1},{14738,7,1,-1},{14742,7,0,-1},{14743,7,1,-1}, +{14746,7,0,-1},{14747,7,1,-1},{14750,7,0,-1},{14751,7,1,-1},{14755,7,0,-1}, +{14756,7,1,-1},{14759,7,0,-1},{14760,7,1,-1},{14763,7,0,-1},{14764,7,1,-1}, +{14768,7,0,-1},{14769,7,1,-1},{14772,7,0,-1},{14773,7,1,-1},{14776,7,0,-1}, +{14777,7,1,-1},{14781,7,0,-1},{14782,7,1,-1},{14785,7,0,-1},{14786,7,1,-1}, +{14789,7,0,-1},{14790,7,1,-1},{14794,7,0,-1},{14795,7,1,-1},{14798,7,0,-1}, +{14799,7,1,-1},{14802,7,0,-1},{14803,7,1,-1},{14807,7,0,-1},{14808,7,1,-1}, +{14811,7,0,-1},{14812,7,1,-1},{14815,7,0,-1},{14816,7,1,-1},{14820,7,0,-1}, +{14821,7,1,-1},{14754,7,0,-1},{14824,7,0,-1},{14825,7,1,-1},{14828,7,0,-1}, +{14829,7,1,-1},{14833,7,0,-1},{14834,7,1,-1},{14767,7,1,-1},{14837,7,0,-1}, +{14838,7,1,-1},{14841,7,0,-1},{14842,7,1,-1},{14846,7,0,-1},{14847,7,1,-1}, +{14850,7,0,-1},{14851,7,1,-1},{14854,7,0,-1},{14855,7,1,-1},{14859,7,0,-1}, +{14860,7,1,-1},{14863,7,0,-1},{14864,7,1,-1},{14867,7,0,-1},{14868,7,1,-1}, +{14872,7,0,-1},{14873,7,1,-1},{14876,7,0,-1},{14877,7,1,-1},{14880,7,0,-1}, +{14881,7,1,-1},{14885,7,0,-1},{14886,7,1,-1},{14889,7,0,-1},{14890,7,1,-1}, +{14893,7,0,-1},{14894,7,1,-1},{14898,7,0,-1},{14899,7,1,-1},{14902,7,0,-1}, +{14903,7,1,-1},{14906,7,0,-1},{14907,7,1,-1},{14911,7,0,-1},{14912,7,1,-1}, +{14915,7,0,-1},{14916,7,1,-1},{14919,7,0,-1},{14920,7,1,-1},{14924,7,0,-1}, +{14925,7,1,-1},{14858,7,0,-1},{14928,7,0,-1},{14929,7,1,-1},{14932,7,0,-1}, +{14933,7,1,-1},{14937,7,0,-1},{14938,7,1,-1},{14871,7,1,-1},{14941,7,0,-1}, +{14942,7,1,-1},{14945,7,0,-1},{14946,7,1,-1},{14950,7,0,-1},{14951,7,1,-1}, +{14954,7,0,-1},{14955,7,1,-1},{14958,7,0,-1},{14959,7,1,-1},{14963,7,0,-1}, +{14964,7,1,-1},{14967,7,0,-1},{14968,7,1,-1},{14971,7,0,-1},{14972,7,1,-1}, +{14976,7,0,-1},{14977,7,1,-1},{14980,7,0,-1},{14981,7,1,-1},{14984,7,0,-1}, +{14985,7,1,-1},{14989,7,0,-1},{14990,7,1,-1},{14993,7,0,-1},{14994,7,1,-1}, +{14997,7,0,-1},{14998,7,1,-1},{15002,7,0,-1},{15003,7,1,-1},{15006,7,0,-1}, +{15007,7,1,-1},{15010,7,0,-1},{15011,7,1,-1},{15015,7,0,-1},{15016,7,1,-1}, +{15019,7,0,-1},{15020,7,1,-1},{15023,7,0,-1},{15024,7,1,-1},{15028,7,0,-1}, +{15029,7,1,-1},{14962,7,0,-1},{15032,7,0,-1},{15033,7,1,-1},{15036,7,0,-1}, +{15037,7,1,-1},{15041,7,0,-1},{15042,7,1,-1},{14975,7,1,-1},{15045,7,0,-1}, +{15046,7,1,-1},{15049,7,0,-1},{15050,7,1,-1},{15054,7,0,-1},{15055,7,1,-1}, +{15058,7,0,-1},{15059,7,1,-1},{15062,7,0,-1},{15063,7,1,-1},{15067,7,0,-1}, +{15068,7,1,-1},{15071,7,0,-1},{15072,7,1,-1},{15075,7,0,-1},{15076,7,1,-1}, +{15080,7,0,-1},{15081,7,1,-1},{15084,7,0,-1},{15085,7,1,-1},{15088,7,0,-1}, +{15089,7,1,-1},{15093,7,0,-1},{15094,7,1,-1},{15097,7,0,-1},{15098,7,1,-1}, +{15101,7,0,-1},{15102,7,1,-1},{15106,7,0,-1},{15107,7,1,-1},{15110,7,0,-1}, +{15111,7,1,-1},{15114,7,0,-1},{15115,7,1,-1},{15119,7,0,-1},{15120,7,1,-1}, +{15123,7,0,-1},{15124,7,1,-1},{15127,7,0,-1},{15128,7,1,-1},{15132,7,0,-1}, +{15133,7,1,-1},{15066,7,0,-1},{15136,7,0,-1},{15137,7,1,-1},{15140,7,0,-1}, +{15141,7,1,-1},{15145,7,0,-1},{15146,7,1,-1},{15079,7,1,-1},{15149,7,0,-1}, +{15150,7,1,-1},{15153,7,0,-1},{15154,7,1,-1},{15158,7,0,-1},{15159,7,1,-1}, +{15162,7,0,-1},{15163,7,1,-1},{15166,7,0,-1},{15167,7,1,-1},{15171,7,0,-1}, +{15172,7,1,-1},{15175,7,0,-1},{15176,7,1,-1},{15179,7,0,-1},{15180,7,1,-1}, +{15184,7,0,-1},{15185,7,1,-1},{15188,7,0,-1},{15189,7,1,-1},{15192,7,0,-1}, +{15193,7,1,-1},{15197,7,0,-1},{15198,7,1,-1},{15201,7,0,-1},{15202,7,1,-1}, +{15205,7,0,-1},{15206,7,1,-1},{15210,7,0,-1},{15211,7,1,-1},{15214,7,0,-1}, +{15215,7,1,-1},{15218,7,0,-1},{15219,7,1,-1},{15223,7,0,-1},{15224,7,1,-1}, +{15227,7,0,-1},{15228,7,1,-1},{15231,7,0,-1},{15232,7,1,-1},{15236,7,0,-1}, +{15237,7,1,-1},{15170,7,0,-1},{15240,7,0,-1},{15241,7,1,-1},{15244,7,0,-1}, +{15245,7,1,-1},{15249,7,0,-1},{15250,7,1,-1},{15183,7,1,-1},{15253,7,0,-1}, +{15254,7,1,-1},{15257,7,0,-1},{15258,7,1,-1},{15262,7,0,-1},{15263,7,1,-1}, +{15266,7,0,-1},{15267,7,1,-1},{15270,7,0,-1},{15271,7,1,-1},{15275,7,0,-1}, +{15276,7,1,-1},{15279,7,0,-1},{15280,7,1,-1},{15284,7,1,-1},{15288,7,0,-1}, +{15289,7,1,-1},{15292,7,0,-1},{15293,7,1,-1},{15296,7,0,-1},{15297,7,1,-1}, +{15301,7,0,-1},{15302,7,1,-1},{15305,7,0,-1},{15306,7,1,-1},{15309,7,0,-1}, +{15310,7,1,-1},{15314,7,0,-1},{15315,7,1,-1},{15318,7,0,-1},{15319,7,1,-1}, +{15322,7,0,-1},{15323,7,1,-1},{15327,7,0,-1},{15328,7,1,-1},{15331,7,0,-1}, +{15332,7,1,-1},{15336,7,1,-1},{15340,7,0,-1},{15341,7,1,-1},{15344,7,0,-1}, +{15345,7,1,-1},{15348,7,0,-1},{15349,7,1,-1},{15353,7,0,-1},{15354,7,1,-1}, +{15357,7,0,-1},{15361,7,0,-1},{15366,7,0,-1},{15370,7,0,-1},{15374,7,0,-1}}; diff --git a/tests/testsuite.at b/tests/testsuite.at index fed0018..0efd333 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -37,3 +37,9 @@ cat $abs_srcdir/tx_power/tx_power_test.err > experr AT_CHECK([$abs_top_builddir/tests/tx_power/tx_power_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([meas]) +AT_KEYWORDS([meas]) +cat $abs_srcdir/meas/meas_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/meas/meas_test], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 Gerrit-PatchSet: 7 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 Mon Jul 10 11:50:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 11:50:14 +0000 Subject: [PATCH] osmo-trx[master]: Remove redundant explicit dependency Message-ID: Review at https://gerrit.osmocom.org/3163 Remove redundant explicit dependency There's no need to explicitly mention library package because ${shlibs:Depends} will take care of it automatically. Change-Id: Ibd9cfc3673d828122edb85ba9de7ceb77f0299d0 --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/3163/1 diff --git a/debian/control b/debian/control index 12da64a..b9ed72a 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ Package: osmo-trx Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libsqlite3-0 +Depends: ${shlibs:Depends}, ${misc:Depends} Description: SDR transceiver that implements Layer 1 of a GSM BTS OsmoTRX is a software-defined radio transceiver that implements the Layer 1 physical layer of a BTS comprising the following 3GPP specifications: -- To view, visit https://gerrit.osmocom.org/3163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd9cfc3673d828122edb85ba9de7ceb77f0299d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jul 10 12:19:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 12:19:46 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Remove global variables, move SETBSIC/SETTSC handling i... 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/3044 to look at the new patch set (#3). TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX (SETTSC) transceiver is a property of the phy_link, and not a property of the BTS. Also, we *really, really* should never use global variables. I'm very happy this is being cleaned up, finally. Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c Related: OS#1848 --- M include/osmo-bts/phy_link.h M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 4 files changed, 38 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/3044/3 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4c7ff34..89bb336 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -45,6 +45,7 @@ uint32_t clock_advance; uint32_t rts_advance; + bool use_legacy_setbsic; } osmotrx; struct { /* MAC address of the PHY */ diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 8ce2893..86a3b9b 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -51,8 +51,6 @@ //#define TOA_RSSI_DEBUG int transceiver_available = 0; -int settsc_enabled = 0; -int setbsic_enabled = 0; #define TRX_MAX_BURST_LEN 512 @@ -248,21 +246,21 @@ /*! Send "SETTSC" command to TRX */ int trx_if_cmd_settsc(struct trx_l1h *l1h, uint8_t tsc) { - if (!settsc_enabled) + struct phy_instance *pinst = l1h->phy_inst; + if (pinst->phy_link->u.osmotrx.use_legacy_setbsic) return 0; - /* if TSC is enabled only, the positive response is mandatory */ - return trx_ctrl_cmd(l1h, (setbsic_enabled) ? 0 : 1, "SETTSC", "%d", - tsc); + + return trx_ctrl_cmd(l1h, 1, "SETTSC", "%d", tsc); } /*! Send "SETBSIC" command to TRX */ int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic) { - if (!setbsic_enabled) + struct phy_instance *pinst = l1h->phy_inst; + if (!pinst->phy_link->u.osmotrx.use_legacy_setbsic) return 0; - /* if BSIC is enabled only, the positive response is mandatory */ - return trx_ctrl_cmd(l1h, (settsc_enabled) ? 0 : 1, "SETBSIC", "%d", - bsic); + + return trx_ctrl_cmd(l1h, 1, "SETBSIC", "%d", bsic); } /*! Send "SETRXGAIN" command to TRX */ diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 1fc454d..ee24f71 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -4,8 +4,6 @@ extern int transceiver_available; extern const char *local_ip; extern const char *remote_ip; -extern int settsc_enabled; -extern int setbsic_enabled; struct trx_l1h; diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 6d6cded..482248c 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -197,51 +197,6 @@ return CMD_SUCCESS; } -DEFUN(cfg_bts_settsc, cfg_bts_settsc_cmd, - "settsc", - "Use SETTSC to configure transceiver\n") -{ - settsc_enabled = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_setbsic, cfg_bts_setbsic_cmd, - "setbsic", - "Use SETBSIC to configure transceiver\n") -{ - setbsic_enabled = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_settsc, cfg_bts_no_settsc_cmd, - "no settsc", - NO_STR "Disable SETTSC to configure transceiver\n") -{ - settsc_enabled = 0; - if (!setbsic_enabled) { - vty_out(vty, "%% Auto enabling SETBSIC.%s", VTY_NEWLINE); - setbsic_enabled = 1; - } - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_setbsic, cfg_bts_no_setbsic_cmd, - "no setbsic", - NO_STR "Disable SETBSIC to configure transceiver\n") -{ - setbsic_enabled = 0; - if (!settsc_enabled) { - vty_out(vty, "%% Auto enabling SETTSC.%s", VTY_NEWLINE); - settsc_enabled = 1; - } - - return CMD_SUCCESS; -} - - DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd, "osmotrx maxdly <0-31>", "Set the maximum acceptable delay of an Access Burst (in GSM symbols)." @@ -322,7 +277,6 @@ vty_out(vty, "OFF: %d%s", trx_if_cmd_poweroff(l1h), VTY_NEWLINE); else { vty_out(vty, "ON: %d%s", trx_if_cmd_poweron(l1h), VTY_NEWLINE); - settsc_enabled = 1; } return CMD_SUCCESS; @@ -503,6 +457,30 @@ return CMD_SUCCESS; } +DEFUN(cfg_phy_setbsic, cfg_phy_setbsic_cmd, + "osmotrx legacy-setbsic", + "Use SETBSIC to configure transceiver (use ONLY with OpenBTS Transceiver!)\n") +{ + struct phy_link *plink = vty->index; + plink->u.osmotrx.use_legacy_setbsic = true; + + vty_out(vty, "%% You have enabled SETBSIC, which is not supported by OsmoTRX " + "but only useful if you want to interface with legacy OpenBTS Transceivers%s", + VTY_NEWLINE); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd, + "no osmotrx legacy-setbsic", + NO_STR "Disable Legacy SETBSIC to configure transceiver\n") +{ + struct phy_link *plink = vty->index; + plink->u.osmotrx.use_legacy_setbsic = false; + + return CMD_SUCCESS; +} + void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) { if (plink->u.osmotrx.local_ip) @@ -523,6 +501,9 @@ plink->u.osmotrx.clock_advance, VTY_NEWLINE); vty_out(vty, " osmotrx rts-advance %d%s", plink->u.osmotrx.rts_advance, VTY_NEWLINE); + + if (plink->u.osmotrx.use_legacy_setbsic) + vty_out(vty, " osmotrx leyacy-setbsic%s", VTY_NEWLINE); } void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) @@ -565,10 +546,6 @@ vty_out(vty, " no ms-power-loop%s", VTY_NEWLINE); vty_out(vty, " %stiming-advance-loop%s", (trx_ta_loop) ? "":"no ", VTY_NEWLINE); - if (settsc_enabled) - vty_out(vty, " settsc%s", VTY_NEWLINE); - if (setbsic_enabled) - vty_out(vty, " setbsic%s", VTY_NEWLINE); } void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) @@ -586,16 +563,14 @@ install_element(BTS_NODE, &cfg_bts_no_ms_power_loop_cmd); install_element(BTS_NODE, &cfg_bts_timing_advance_loop_cmd); install_element(BTS_NODE, &cfg_bts_no_timing_advance_loop_cmd); - install_element(BTS_NODE, &cfg_bts_settsc_cmd); - install_element(BTS_NODE, &cfg_bts_setbsic_cmd); - install_element(BTS_NODE, &cfg_bts_no_settsc_cmd); - install_element(BTS_NODE, &cfg_bts_no_setbsic_cmd); install_element(PHY_NODE, &cfg_phy_base_port_cmd); install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); install_element(PHY_NODE, &cfg_phy_transc_ip_cmd); install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd); + install_element(PHY_NODE, &cfg_phy_setbsic_cmd); + install_element(PHY_NODE, &cfg_phy_no_setbsic_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd); -- To view, visit https://gerrit.osmocom.org/3044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jul 10 12:21:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 12:21:22 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3045 to look at the new patch set (#3). TRX: Remove bogus extern global variable declarations Those global variable declarations for non-existing variables were introduced in 8a8d73a691c709403be4adbe8f2a7150b4d5998a, let's remove them again. The source / destination IP address is a parameter of the phy_link, and not a global variable. Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Related: OS#1848 --- M src/osmo-bts-trx/trx_if.h 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/3045/3 diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index ee24f71..076e35e 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,8 +2,6 @@ #define TRX_IF_H extern int transceiver_available; -extern const char *local_ip; -extern const char *remote_ip; struct trx_l1h; -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jul 10 12:31:49 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 12:31:49 +0000 Subject: [PATCH] osmo-bts[master]: measurement: fix measurment report 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/3053 to look at the new patch set (#8). measurement: fix measurment report The end of the measurement reporting period is not aligned with the SACCH block where the results are reported. The tables that are used to detect the end of the measurement period are therefore wrong. The frame number of the SACCH block must be used and not the TDMA frame number (modulo 104) of the measurement reporing interval. The tables are oriented to the frame number of the first SACCH block, at the beginning of an interval. However, when a SACCH block is received it will always contain the result of the recently passed measurement reporting period. To match the tables, introduce another lookup table to remap each SACCH block that ends to the matching beginning block number. Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 --- M configure.ac M src/common/measurement.c M tests/Makefile.am A tests/meas/Makefile.am A tests/meas/meas_test.c A tests/meas/meas_test.ok A tests/meas/sysmobts_fr_samples.h M tests/testsuite.at 8 files changed, 3,447 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/3053/8 diff --git a/configure.ac b/configure.ac index b2700d5..64231b3 100644 --- a/configure.ac +++ b/configure.ac @@ -192,4 +192,5 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/meas/Makefile Makefile) diff --git a/src/common/measurement.c b/src/common/measurement.c index dba3543..3b32bf2 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -23,18 +23,27 @@ * 6 6 and 7 78 to 77 90, 12, 38, 64 * 7 6 and 7 91 to 90 103, 25, 51, 77 */ -/* measurement period ends at fn % 104 == ? */ static const uint8_t tchf_meas_rep_fn104[] = { - [0] = 103, - [1] = 12, - [2] = 25, - [3] = 38, - [4] = 51, - [5] = 64, - [6] = 77, - [7] = 90, + [0] = 90, + [1] = 103, + [2] = 12, + [3] = 25, + [4] = 38, + [5] = 51, + [6] = 64, + [7] = 77, }; static const uint8_t tchh0_meas_rep_fn104[] = { + [0] = 90, + [1] = 90, + [2] = 12, + [3] = 12, + [4] = 38, + [5] = 38, + [6] = 64, + [7] = 64, +}; +static const uint8_t tchh1_meas_rep_fn104[] = { [0] = 103, [1] = 103, [2] = 25, @@ -43,16 +52,6 @@ [5] = 51, [6] = 77, [7] = 77, -}; -static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12, - [1] = 12, - [2] = 38, - [3] = 38, - [4] = 64, - [5] = 64, - [6] = 90, - [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan @@ -86,6 +85,46 @@ [3] = 36 + 18 }; +/* Note: The reporting of the measurement results is done via the SACCH channel. + * The measurement interval is not alligned with the interval in which the + * SACCH is tranmitted. When we receive the measurement indication with the + * SACCH block, the coresponding measurement interval will already have ended + * and we will get the results late, but on spot with the beginning of the + * next measurement interval. + * + * For example: We get a measurement indication on FN%104=38 in TS=2. Then we + * will have to look at 3GPP TS 45.008, secton 8.4.1 (or 3GPP TS 05.02 Clause 7 + * Table 1 of 9) what value we need to feed into the lookup tables in order to + * detect the measurement period ending. In this example the "real" ending + * was on FN%104=12. This is the value we have to look for in + * tchf_meas_rep_fn104 to know that a measurement period has just ended. */ + +/* See also 3GPP TS 05.02 Clause 7 Table 1 of 9: + * Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5) */ +static uint8_t translate_tch_meas_rep_fn104(uint8_t fn_mod) +{ + switch (fn_mod) { + case 25: + return 103; + case 38: + return 12; + case 51: + return 25; + case 64: + return 38; + case 77: + return 51; + case 90: + return 64; + case 103: + return 77; + case 12: + return 90; + } + + /* Invalid / not of interest */ + return 0; +} /* determine if a measurement period ends at the given frame number */ static int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn) @@ -102,12 +141,12 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (tchf_meas_rep_fn104[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_TCH_H: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (lchan->nr == 0) tbl = tchh0_meas_rep_fn104; else @@ -132,9 +171,11 @@ break; } - DEBUGP(DMEAS, - "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", - gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + if (rc == 1) { + DEBUGP(DMEAS, + "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", + gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + } return rc; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 5b6f65e..d2b4181 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power +SUBDIRS = paging cipher agch misc handover tx_power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am new file mode 100644 index 0000000..8dd0582 --- /dev/null +++ b/tests/meas/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +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 +EXTRA_DIST = meas_test.ok + +meas_test_SOURCES = meas_test.c +meas_test_LDADD = $(top_builddir)/src/common/libbts.a $(LDADD) diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c new file mode 100644 index 0000000..c87350b --- /dev/null +++ b/tests/meas/meas_test.c @@ -0,0 +1,222 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct gsm_bts *bts; +struct gsm_bts_trx *trx; + +struct fn_sample { + uint32_t fn; + uint8_t ts; + uint8_t ss; + int rc; +}; + +#include "sysmobts_fr_samples.h" + +void test_fn_sample(struct fn_sample *s, unsigned int len, uint8_t pchan, uint8_t tsmap) +{ + int rc; + struct gsm_lchan *lchan; + unsigned int i; + unsigned int delta = 0; + uint8_t tsmap_result = 0; + uint32_t fn_prev = 0; + struct gsm_time gsm_time; + + + printf("\n\n"); + printf("===========================================================\n"); + + for (i = 0; i < len; i++) { + + lchan = &trx->ts[s[i].ts].lchan[s[i].ss]; + trx->ts[s[i].ts].pchan = pchan; + lchan->meas.num_ul_meas = 1; + + rc = lchan_meas_check_compute(lchan, s[i].fn); + if (rc) { + gsm_fn2gsmtime(&gsm_time, s[i].fn); + fprintf(stdout, "Testing: ts[%i]->lchan[%i], fn=%u=>%s, fn%%104=%u, rc=%i, delta=%i\n", s[i].ts, + s[i].ss, s[i].fn, osmo_dump_gsmtime(&gsm_time), s[i].fn % 104, rc, s[i].fn - fn_prev); + fn_prev = s[i].fn; + tsmap_result |= (1 << s[i].ts); + } else + delta++; + + /* If the test data set provides a return + * code, we check that as well */ + if (s[i].rc != -1) + OSMO_ASSERT(s[i].rc == rc); + } + + /* Make sure that we exactly trigger on the right frames + * timeslots must match exactlty to what we expect */ + OSMO_ASSERT(tsmap_result == tsmap); +} + +int main(int argc, char **argv) +{ + void *tall_bts_ctx; + + tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); + msgb_talloc_ctx_init(tall_bts_ctx, 0); + + bts_log_init(NULL); + osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; + + bts = gsm_bts_alloc(tall_bts_ctx); + if (!bts) { + fprintf(stderr, "Failed to create BTS structure\n"); + exit(1); + } + trx = gsm_bts_trx_alloc(bts); + if (!trx) { + fprintf(stderr, "Failed to TRX structure\n"); + exit(1); + } + + if (bts_init(bts) < 0) { + fprintf(stderr, "unable to to open bts\n"); + exit(1); + } + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test full rate */ + test_fn_sample(test_fn_tch_f_ts_2_3, ARRAY_SIZE(test_fn_tch_f_ts_2_3), GSM_PCHAN_TCH_F, (1 << 2) | (1 << 3)); + test_fn_sample(test_fn_tch_f_ts_4_5, ARRAY_SIZE(test_fn_tch_f_ts_4_5), GSM_PCHAN_TCH_F, (1 << 4) | (1 << 5)); + test_fn_sample(test_fn_tch_f_ts_6_7, ARRAY_SIZE(test_fn_tch_f_ts_6_7), GSM_PCHAN_TCH_F, (1 << 6) | (1 << 7)); + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test half rate */ + test_fn_sample(test_fn_tch_h_ts_2_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_2_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 2)); + test_fn_sample(test_fn_tch_h_ts_3_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_3_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 3)); + test_fn_sample(test_fn_tch_h_ts_4_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_4_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 4)); + test_fn_sample(test_fn_tch_h_ts_5_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_5_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 5)); + test_fn_sample(test_fn_tch_h_ts_6_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_6_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 6)); + test_fn_sample(test_fn_tch_h_ts_7_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_7_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 7)); + + printf("Success\n"); + + return 0; +} + +/* Stubs */ +void bts_model_abis_close(struct gsm_bts *bts) +{ +} + +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int obj_kind, void *obj) +{ + return 0; +} + +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + return 0; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj, uint8_t adm_state) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +void trx_get_hlayer1(void) +{ +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return 0; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return 0; +} + +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) +{ + return 0; +} diff --git a/tests/meas/meas_test.ok b/tests/meas/meas_test.ok new file mode 100644 index 0000000..2b76604 --- /dev/null +++ b/tests/meas/meas_test.ok @@ -0,0 +1,542 @@ + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=10958 +Testing: ts[2]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=104 +Testing: ts[3]->lchan[0], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11595=>011595/08/25/18/23, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11686=>011686/08/12/07/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11699=>011699/08/25/20/23, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11790=>011790/08/12/09/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11803=>011803/08/25/22/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11894=>011894/08/12/11/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11907=>011907/08/25/24/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11998=>011998/09/12/13/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12011=>012011/09/25/26/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12102=>012102/09/12/15/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12115=>012115/09/25/28/31, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12206=>012206/09/12/17/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12219=>012219/09/25/30/31, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12310=>012310/09/12/19/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12323=>012323/09/25/32/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12414=>012414/09/12/21/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12427=>012427/09/25/34/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12518=>012518/09/12/23/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12531=>012531/09/25/36/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12622=>012622/09/12/25/26, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12635=>012635/09/25/38/39, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=5888=>005888/04/12/23/00, fn%104=64, rc=1, delta=5888 +Testing: ts[4]->lchan[0], fn=5992=>005992/04/12/25/00, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6096=>006096/04/12/27/00, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6200=>006200/04/12/29/04, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=6213=>006213/04/25/42/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6304=>006304/04/12/31/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6317=>006317/04/25/44/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6408=>006408/04/12/33/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6421=>006421/04/25/46/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6512=>006512/04/12/35/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6525=>006525/04/25/48/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6616=>006616/04/12/37/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6629=>006629/04/25/50/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6720=>006720/05/12/39/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6733=>006733/05/25/01/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6824=>006824/05/12/41/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6837=>006837/05/25/03/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6928=>006928/05/12/43/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6941=>006941/05/25/05/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7032=>007032/05/12/45/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7045=>007045/05/25/07/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7136=>007136/05/12/47/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7149=>007149/05/25/09/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7240=>007240/05/12/49/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7253=>007253/05/25/11/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7344=>007344/05/12/00/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7357=>007357/05/25/13/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7448=>007448/05/12/02/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7461=>007461/05/25/15/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7552=>007552/05/12/04/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7565=>007565/05/25/17/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7656=>007656/05/12/06/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7669=>007669/05/25/19/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7773=>007773/05/25/21/41, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7877=>007877/05/25/23/41, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7981=>007981/06/25/25/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8085=>008085/06/25/27/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>008592/06/12/24/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8605=>008605/06/25/37/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>008696/06/12/26/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8709=>008709/06/25/39/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>008800/06/12/28/44, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8813=>008813/06/25/41/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>008904/06/12/30/44, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8917=>008917/06/25/43/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>009008/06/12/32/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9021=>009021/06/25/45/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>009112/06/12/34/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9125=>009125/06/25/47/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>009216/06/12/36/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9229=>009229/06/25/49/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>009320/07/12/38/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9333=>009333/07/25/00/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>009424/07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9437=>009437/07/25/02/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>009528/07/12/42/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9541=>009541/07/25/04/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>009632/07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9645=>009645/07/25/06/17, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8618=>008618/06/12/50/14, fn%104=90, rc=1, delta=8618 +Testing: ts[6]->lchan[0], fn=8722=>008722/06/12/01/18, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8826=>008826/06/12/03/18, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8930=>008930/06/12/05/18, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=8943=>008943/06/25/18/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>009034/06/12/07/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9047=>009047/06/25/20/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>009138/06/12/09/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9151=>009151/06/25/22/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>009242/06/12/11/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9255=>009255/06/25/24/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>009346/07/12/13/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9359=>009359/07/25/26/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>009450/07/12/15/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9463=>009463/07/25/28/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>009554/07/12/17/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9567=>009567/07/25/30/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>009658/07/12/19/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9671=>009671/07/25/32/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>009762/07/12/21/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9775=>009775/07/25/34/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>009866/07/12/23/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9879=>009879/07/25/36/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>009970/07/12/25/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9983=>009983/07/25/38/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>010074/07/12/27/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10087=>010087/07/25/40/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>010178/07/12/29/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10191=>010191/07/25/42/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>010282/07/12/31/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10295=>010295/07/25/44/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>010386/07/12/33/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10399=>010399/07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>010490/07/12/35/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10503=>010503/07/25/48/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>010594/07/12/37/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10607=>010607/07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>010698/08/12/39/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10711=>010711/08/25/01/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>010802/08/12/41/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10815=>010815/08/25/03/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>010906/08/12/43/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10919=>010919/08/25/05/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>011010/08/12/45/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11023=>011023/08/25/07/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>011114/08/12/47/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11127=>011127/08/25/09/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>011218/08/12/49/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11231=>011231/08/25/11/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>011322/08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11335=>011335/08/25/13/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>011426/08/12/02/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11439=>011439/08/25/15/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>011530/08/12/04/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11543=>011543/08/25/17/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11634=>011634/08/12/06/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11647=>011647/08/25/19/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11738=>011738/08/12/08/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11751=>011751/08/25/21/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11842=>011842/08/12/10/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11855=>011855/08/25/23/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11946=>011946/09/12/12/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11959=>011959/09/25/25/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12050=>012050/09/12/14/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12063=>012063/09/25/27/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12154=>012154/09/12/16/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12167=>012167/09/25/29/31, fn%104=103, rc=1, delta=13 + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=8982=>008982/06/12/06/22, fn%104=38, rc=1, delta=8982 +Testing: ts[2]->lchan[0], fn=9086=>009086/06/12/08/22, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9190=>009190/06/12/10/22, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9294=>009294/07/12/12/26, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9398=>009398/07/12/14/26, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[1], fn=9411=>009411/07/25/27/39, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9502=>009502/07/12/16/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9515=>009515/07/25/29/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9606=>009606/07/12/18/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9619=>009619/07/25/31/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9710=>009710/07/12/20/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9723=>009723/07/25/33/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9814=>009814/07/12/22/34, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9827=>009827/07/25/35/47, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9918=>009918/07/12/24/34, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9931=>009931/07/25/37/47, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10022=>010022/07/12/26/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10035=>010035/07/25/39/51, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10126=>010126/07/12/28/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10139=>010139/07/25/41/51, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10230=>010230/07/12/30/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10243=>010243/07/25/43/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10334=>010334/07/12/32/42, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10347=>010347/07/25/45/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10438=>010438/07/12/34/42, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10451=>010451/07/25/47/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10542=>010542/07/12/36/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10555=>010555/07/25/49/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10646=>010646/08/12/38/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10659=>010659/08/25/00/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10750=>010750/08/12/40/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10763=>010763/08/25/02/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10854=>010854/08/12/42/50, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10867=>010867/08/25/04/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10971=>010971/08/25/06/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11075=>011075/08/25/08/15, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11179=>011179/08/25/10/15, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11283=>011283/08/25/12/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11387=>011387/08/25/14/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 + + +=========================================================== +Testing: ts[3]->lchan[0], fn=10022=>010022/07/12/26/38, fn%104=38, rc=1, delta=10022 +Testing: ts[3]->lchan[1], fn=10035=>010035/07/25/39/51, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10126=>010126/07/12/28/38, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10139=>010139/07/25/41/51, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10230=>010230/07/12/30/38, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10243=>010243/07/25/43/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10334=>010334/07/12/32/42, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10347=>010347/07/25/45/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10438=>010438/07/12/34/42, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10451=>010451/07/25/47/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10542=>010542/07/12/36/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10555=>010555/07/25/49/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10646=>010646/08/12/38/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10659=>010659/08/25/00/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10750=>010750/08/12/40/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10763=>010763/08/25/02/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10854=>010854/08/12/42/50, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10867=>010867/08/25/04/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10971=>010971/08/25/06/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11075=>011075/08/25/08/15, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11179=>011179/08/25/10/15, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11283=>011283/08/25/12/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11387=>011387/08/25/14/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11595=>011595/08/25/18/23, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11686=>011686/08/12/07/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11699=>011699/08/25/20/23, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11790=>011790/08/12/09/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11803=>011803/08/25/22/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11894=>011894/08/12/11/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11907=>011907/08/25/24/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11998=>011998/09/12/13/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12011=>012011/09/25/26/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=12102=>012102/09/12/15/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12115=>012115/09/25/28/31, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=7760 +Testing: ts[4]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[1], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>008592/06/12/24/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8605=>008605/06/25/37/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>008696/06/12/26/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8709=>008709/06/25/39/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>008800/06/12/28/44, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8813=>008813/06/25/41/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>008904/06/12/30/44, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8917=>008917/06/25/43/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>009008/06/12/32/48, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9021=>009021/06/25/45/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>009112/06/12/34/48, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9125=>009125/06/25/47/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>009216/06/12/36/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9229=>009229/06/25/49/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>009320/07/12/38/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9333=>009333/07/25/00/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>009424/07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9437=>009437/07/25/02/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>009528/07/12/42/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9541=>009541/07/25/04/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>009632/07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9645=>009645/07/25/06/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9736=>009736/07/12/46/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9749=>009749/07/25/08/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9840=>009840/07/12/48/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9853=>009853/07/25/10/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9944=>009944/07/12/50/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9957=>009957/07/25/12/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10048=>010048/07/12/01/12, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10061=>010061/07/25/14/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10152=>010152/07/12/03/12, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10165=>010165/07/25/16/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10256=>010256/07/12/05/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10269=>010269/07/25/18/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10360=>010360/07/12/07/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10373=>010373/07/25/20/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10464=>010464/07/12/09/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10477=>010477/07/25/22/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10568=>010568/07/12/11/20, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10581=>010581/07/25/24/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10672=>010672/08/12/13/20, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10685=>010685/08/25/26/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10776=>010776/08/12/15/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10789=>010789/08/25/28/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10880=>010880/08/12/17/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10893=>010893/08/25/30/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10984=>010984/08/12/19/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10997=>010997/08/25/32/37, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[5]->lchan[0], fn=5264=>005264/03/12/11/40, fn%104=64, rc=1, delta=5264 +Testing: ts[5]->lchan[0], fn=5368=>005368/04/12/13/40, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5472=>005472/04/12/15/44, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5576=>005576/04/12/17/44, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5680=>005680/04/12/19/48, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[1], fn=5693=>005693/04/25/32/09, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5784=>005784/04/12/21/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5797=>005797/04/25/34/09, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5888=>005888/04/12/23/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5901=>005901/04/25/36/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5992=>005992/04/12/25/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6005=>006005/04/25/38/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6096=>006096/04/12/27/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6109=>006109/04/25/40/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6200=>006200/04/12/29/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6213=>006213/04/25/42/17, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6304=>006304/04/12/31/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6317=>006317/04/25/44/17, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6408=>006408/04/12/33/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6421=>006421/04/25/46/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6512=>006512/04/12/35/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6525=>006525/04/25/48/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6616=>006616/04/12/37/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6629=>006629/04/25/50/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6720=>006720/05/12/39/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6733=>006733/05/25/01/25, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6824=>006824/05/12/41/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6837=>006837/05/25/03/25, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6928=>006928/05/12/43/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6941=>006941/05/25/05/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7032=>007032/05/12/45/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7045=>007045/05/25/07/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7136=>007136/05/12/47/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7149=>007149/05/25/09/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7240=>007240/05/12/49/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7253=>007253/05/25/11/33, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7344=>007344/05/12/00/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7357=>007357/05/25/13/33, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7448=>007448/05/12/02/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7461=>007461/05/25/15/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7552=>007552/05/12/04/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7565=>007565/05/25/17/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7656=>007656/05/12/06/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7669=>007669/05/25/19/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7773=>007773/05/25/21/41, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7877=>007877/05/25/23/41, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7981=>007981/06/25/25/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8085=>008085/06/25/27/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8098=>008098/06/12/40/06, fn%104=90, rc=1, delta=8098 +Testing: ts[6]->lchan[0], fn=8202=>008202/06/12/42/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8306=>008306/06/12/44/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8410=>008410/06/12/46/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[1], fn=8423=>008423/06/25/08/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8514=>008514/06/12/48/14, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8527=>008527/06/25/10/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8618=>008618/06/12/50/14, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8631=>008631/06/25/12/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8722=>008722/06/12/01/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8735=>008735/06/25/14/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8826=>008826/06/12/03/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8839=>008839/06/25/16/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8930=>008930/06/12/05/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8943=>008943/06/25/18/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>009034/06/12/07/22, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9047=>009047/06/25/20/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>009138/06/12/09/22, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9151=>009151/06/25/22/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>009242/06/12/11/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9255=>009255/06/25/24/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>009346/07/12/13/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9359=>009359/07/25/26/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>009450/07/12/15/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9463=>009463/07/25/28/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>009554/07/12/17/30, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9567=>009567/07/25/30/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>009658/07/12/19/30, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9671=>009671/07/25/32/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>009762/07/12/21/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9775=>009775/07/25/34/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>009866/07/12/23/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9879=>009879/07/25/36/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>009970/07/12/25/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9983=>009983/07/25/38/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>010074/07/12/27/38, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10087=>010087/07/25/40/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>010178/07/12/29/38, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10191=>010191/07/25/42/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>010282/07/12/31/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10295=>010295/07/25/44/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>010386/07/12/33/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10399=>010399/07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>010490/07/12/35/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10503=>010503/07/25/48/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>010594/07/12/37/46, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10607=>010607/07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>010698/08/12/39/46, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10711=>010711/08/25/01/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>010802/08/12/41/50, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10815=>010815/08/25/03/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>010906/08/12/43/50, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10919=>010919/08/25/05/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>011010/08/12/45/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11023=>011023/08/25/07/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>011114/08/12/47/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11127=>011127/08/25/09/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>011218/08/12/49/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11231=>011231/08/25/11/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>011322/08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11335=>011335/08/25/13/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>011426/08/12/02/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11439=>011439/08/25/15/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>011530/08/12/04/10, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11543=>011543/08/25/17/23, fn%104=103, rc=1, delta=13 + + +=========================================================== +Testing: ts[7]->lchan[0], fn=11738=>011738/08/12/08/10, fn%104=90, rc=1, delta=11738 +Testing: ts[7]->lchan[0], fn=11842=>011842/08/12/10/14, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=11946=>011946/09/12/12/14, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=12050=>012050/09/12/14/18, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[1], fn=12063=>012063/09/25/27/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12154=>012154/09/12/16/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12167=>012167/09/25/29/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12258=>012258/09/12/18/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12271=>012271/09/25/31/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12362=>012362/09/12/20/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12375=>012375/09/25/33/35, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12466=>012466/09/12/22/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12479=>012479/09/25/35/35, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12570=>012570/09/12/24/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12583=>012583/09/25/37/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12674=>012674/09/12/26/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12687=>012687/09/25/39/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12778=>012778/09/12/28/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12791=>012791/09/25/41/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12882=>012882/09/12/30/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12895=>012895/09/25/43/43, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12986=>012986/09/12/32/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12999=>012999/09/25/45/43, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13090=>013090/09/12/34/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13103=>013103/09/25/47/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13194=>013194/09/12/36/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13207=>013207/09/25/49/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13298=>013298/10/12/38/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13311=>013311/10/25/00/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13402=>013402/10/12/40/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13415=>013415/10/25/02/51, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13506=>013506/10/12/42/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13519=>013519/10/25/04/51, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13610=>013610/10/12/44/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13623=>013623/10/25/06/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13714=>013714/10/12/46/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13727=>013727/10/25/08/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13818=>013818/10/12/48/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13831=>013831/10/25/10/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13922=>013922/10/12/50/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13935=>013935/10/25/12/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14026=>014026/10/12/01/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14039=>014039/10/25/14/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14130=>014130/10/12/03/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14143=>014143/10/25/16/11, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14234=>014234/10/12/05/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14247=>014247/10/25/18/11, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14338=>014338/10/12/07/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14351=>014351/10/25/20/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14442=>014442/10/12/09/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14455=>014455/10/25/22/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14546=>014546/10/12/11/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14559=>014559/10/25/24/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14650=>014650/11/12/13/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14663=>014663/11/25/26/19, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14754=>014754/11/12/15/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14767=>014767/11/25/28/19, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14858=>014858/11/12/17/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14871=>014871/11/25/30/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14962=>014962/11/12/19/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14975=>014975/11/25/32/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15066=>015066/11/12/21/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15079=>015079/11/25/34/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15170=>015170/11/12/23/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15183=>015183/11/25/36/27, fn%104=103, rc=1, delta=13 +Success diff --git a/tests/meas/sysmobts_fr_samples.h b/tests/meas/sysmobts_fr_samples.h new file mode 100644 index 0000000..ee70bd7 --- /dev/null +++ b/tests/meas/sysmobts_fr_samples.h @@ -0,0 +1,2601 @@ +/* The following dataset was generated using a sysmobts in order to have + * some real data from a real phy to test against. */ + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS2 and TS3 */ +struct fn_sample test_fn_tch_f_ts_2_3[] = { +{10954,2,0,-1},{10959,2,0,-1},{10972,2,0,-1},{10976,2,0,-1},{10980,2,0,-1}, +{10985,2,0,-1},{10989,2,0,-1},{10993,2,0,-1},{10998,2,0,-1},{11002,2,0,-1}, +{11006,2,0,-1},{11011,2,0,-1},{11015,2,0,-1},{11019,2,0,-1},{11024,2,0,-1}, +{11028,2,0,-1},{10958,2,0,-1},{11032,2,0,-1},{11037,2,0,-1},{11041,2,0,-1}, +{11045,2,0,-1},{11050,2,0,-1},{11054,2,0,-1},{11058,2,0,-1},{11063,2,0,-1}, +{11067,2,0,-1},{11071,2,0,-1},{11076,2,0,-1},{11080,2,0,-1},{11084,2,0,-1}, +{11089,2,0,-1},{11093,2,0,-1},{11097,2,0,-1},{11102,2,0,-1},{11106,2,0,-1}, +{11110,2,0,-1},{11115,2,0,-1},{11119,2,0,-1},{11123,2,0,-1},{11128,2,0,-1}, +{11132,2,0,-1},{11062,2,0,-1},{11136,2,0,-1},{11141,2,0,-1},{11145,2,0,-1}, +{11149,2,0,-1},{11154,2,0,-1},{11158,2,0,-1},{11162,2,0,-1},{11167,2,0,-1}, +{11171,2,0,-1},{11175,2,0,-1},{11180,2,0,-1},{11184,2,0,-1},{11188,2,0,-1}, +{11193,2,0,-1},{11197,2,0,-1},{11201,2,0,-1},{11206,2,0,-1},{11210,2,0,-1}, +{11214,2,0,-1},{11219,2,0,-1},{11223,2,0,-1},{11227,2,0,-1},{11232,2,0,-1}, +{11236,2,0,-1},{11166,2,0,-1},{11240,2,0,-1},{11245,2,0,-1},{11249,2,0,-1}, +{11253,2,0,-1},{11258,2,0,-1},{11262,2,0,-1},{11266,2,0,-1},{11271,2,0,-1}, +{11275,2,0,-1},{11279,2,0,-1},{11284,2,0,-1},{11288,2,0,-1},{11292,2,0,-1}, +{11297,2,0,-1},{11301,2,0,-1},{11305,2,0,-1},{11310,2,0,-1},{11314,2,0,-1}, +{11318,2,0,-1},{11323,2,0,-1},{11327,2,0,-1},{11331,2,0,-1},{11336,2,0,-1}, +{11340,2,0,-1},{11270,2,0,-1},{11344,2,0,-1},{11349,2,0,-1},{11353,2,0,-1}, +{11357,2,0,-1},{11362,2,0,-1},{11366,2,0,-1},{11370,2,0,-1},{11375,2,0,-1}, +{11379,2,0,-1},{11383,2,0,-1},{11388,2,0,-1},{11392,2,0,-1},{11396,2,0,-1}, +{11401,2,0,-1},{11405,2,0,-1},{11409,2,0,-1},{11414,2,0,-1},{11418,2,0,-1}, +{11422,2,0,-1},{11427,2,0,-1},{11431,2,0,-1},{11431,3,0,-1},{11435,2,0,-1}, +{11435,3,0,-1},{11440,2,0,-1},{11440,3,0,-1},{11444,2,0,-1},{11444,3,0,-1}, +{11374,2,0,-1},{11448,2,0,-1},{11448,3,0,-1},{11453,2,0,-1},{11453,3,0,-1}, +{11457,2,0,-1},{11457,3,0,-1},{11461,2,0,-1},{11461,3,0,-1},{11466,2,0,-1}, +{11466,3,0,-1},{11470,2,0,-1},{11470,3,0,-1},{11474,2,0,-1},{11474,3,0,-1}, +{11479,2,0,-1},{11479,3,0,-1},{11483,2,0,-1},{11483,3,0,-1},{11487,2,0,-1}, +{11487,3,0,-1},{11492,2,0,-1},{11492,3,0,-1},{11496,2,0,-1},{11496,3,0,-1}, +{11500,2,0,-1},{11500,3,0,-1},{11505,2,0,-1},{11505,3,0,-1},{11509,2,0,-1}, +{11509,3,0,-1},{11513,2,0,-1},{11513,3,0,-1},{11518,2,0,-1},{11518,3,0,-1}, +{11522,2,0,-1},{11522,3,0,-1},{11526,2,0,-1},{11526,3,0,-1},{11531,2,0,-1}, +{11531,3,0,-1},{11535,2,0,-1},{11535,3,0,-1},{11539,2,0,-1},{11539,3,0,-1}, +{11544,2,0,-1},{11544,3,0,-1},{11548,2,0,-1},{11548,3,0,-1},{11478,2,0,-1}, +{11552,2,0,-1},{11552,3,0,-1},{11557,2,0,-1},{11557,3,0,-1},{11561,2,0,-1}, +{11561,3,0,-1},{11491,3,0,-1},{11565,2,0,-1},{11565,3,0,-1},{11570,2,0,-1}, +{11570,3,0,-1},{11574,2,0,-1},{11574,3,0,-1},{11578,2,0,-1},{11578,3,0,-1}, +{11583,2,0,-1},{11583,3,0,-1},{11587,2,0,-1},{11587,3,0,-1},{11591,2,0,-1}, +{11591,3,0,-1},{11596,2,0,-1},{11596,3,0,-1},{11600,2,0,-1},{11600,3,0,-1}, +{11604,2,0,-1},{11604,3,0,-1},{11609,2,0,-1},{11609,3,0,-1},{11613,2,0,-1}, +{11613,3,0,-1},{11617,2,0,-1},{11617,3,0,-1},{11622,2,0,-1},{11622,3,0,-1}, +{11626,2,0,-1},{11626,3,0,-1},{11630,2,0,-1},{11630,3,0,-1},{11635,2,0,-1}, +{11635,3,0,-1},{11639,2,0,-1},{11639,3,0,-1},{11643,2,0,-1},{11643,3,0,-1}, +{11648,2,0,-1},{11648,3,0,-1},{11652,2,0,-1},{11652,3,0,-1},{11582,2,0,-1}, +{11656,2,0,-1},{11656,3,0,-1},{11661,2,0,-1},{11661,3,0,-1},{11665,2,0,-1}, +{11665,3,0,-1},{11595,3,0,-1},{11669,2,0,-1},{11669,3,0,-1},{11674,2,0,-1}, +{11674,3,0,-1},{11678,2,0,-1},{11678,3,0,-1},{11682,2,0,-1},{11682,3,0,-1}, +{11687,2,0,-1},{11687,3,0,-1},{11691,2,0,-1},{11691,3,0,-1},{11695,2,0,-1}, +{11695,3,0,-1},{11700,2,0,-1},{11700,3,0,-1},{11704,2,0,-1},{11704,3,0,-1}, +{11708,2,0,-1},{11708,3,0,-1},{11713,2,0,-1},{11713,3,0,-1},{11717,2,0,-1}, +{11717,3,0,-1},{11721,2,0,-1},{11721,3,0,-1},{11726,2,0,-1},{11726,3,0,-1}, +{11730,2,0,-1},{11730,3,0,-1},{11734,2,0,-1},{11734,3,0,-1},{11739,2,0,-1}, +{11739,3,0,-1},{11743,2,0,-1},{11743,3,0,-1},{11747,2,0,-1},{11747,3,0,-1}, +{11752,2,0,-1},{11752,3,0,-1},{11756,2,0,-1},{11756,3,0,-1},{11686,2,0,-1}, +{11760,2,0,-1},{11760,3,0,-1},{11765,2,0,-1},{11765,3,0,-1},{11769,2,0,-1}, +{11769,3,0,-1},{11699,3,0,-1},{11773,2,0,-1},{11773,3,0,-1},{11778,2,0,-1}, +{11778,3,0,-1},{11782,2,0,-1},{11782,3,0,-1},{11786,2,0,-1},{11786,3,0,-1}, +{11791,2,0,-1},{11791,3,0,-1},{11795,2,0,-1},{11795,3,0,-1},{11799,2,0,-1}, +{11799,3,0,-1},{11804,2,0,-1},{11804,3,0,-1},{11808,2,0,-1},{11808,3,0,-1}, +{11812,2,0,-1},{11812,3,0,-1},{11817,2,0,-1},{11817,3,0,-1},{11821,2,0,-1}, +{11821,3,0,-1},{11825,2,0,-1},{11825,3,0,-1},{11830,2,0,-1},{11830,3,0,-1}, +{11834,2,0,-1},{11834,3,0,-1},{11838,2,0,-1},{11838,3,0,-1},{11843,2,0,-1}, +{11843,3,0,-1},{11847,2,0,-1},{11847,3,0,-1},{11851,2,0,-1},{11851,3,0,-1}, +{11856,2,0,-1},{11856,3,0,-1},{11860,2,0,-1},{11860,3,0,-1},{11790,2,0,-1}, +{11864,2,0,-1},{11864,3,0,-1},{11869,2,0,-1},{11869,3,0,-1},{11873,2,0,-1}, +{11873,3,0,-1},{11803,3,0,-1},{11877,2,0,-1},{11877,3,0,-1},{11882,2,0,-1}, +{11882,3,0,-1},{11886,2,0,-1},{11886,3,0,-1},{11890,2,0,-1},{11890,3,0,-1}, +{11895,2,0,-1},{11895,3,0,-1},{11899,2,0,-1},{11899,3,0,-1},{11903,2,0,-1}, +{11903,3,0,-1},{11908,2,0,-1},{11908,3,0,-1},{11912,2,0,-1},{11912,3,0,-1}, +{11916,2,0,-1},{11916,3,0,-1},{11921,2,0,-1},{11921,3,0,-1},{11925,2,0,-1}, +{11925,3,0,-1},{11929,2,0,-1},{11929,3,0,-1},{11934,2,0,-1},{11934,3,0,-1}, +{11938,2,0,-1},{11938,3,0,-1},{11942,2,0,-1},{11942,3,0,-1},{11947,2,0,-1}, +{11947,3,0,-1},{11951,2,0,-1},{11951,3,0,-1},{11955,2,0,-1},{11955,3,0,-1}, +{11960,2,0,-1},{11960,3,0,-1},{11964,2,0,-1},{11964,3,0,-1},{11894,2,0,-1}, +{11968,2,0,-1},{11968,3,0,-1},{11973,2,0,-1},{11973,3,0,-1},{11977,2,0,-1}, +{11977,3,0,-1},{11907,3,0,-1},{11981,2,0,-1},{11981,3,0,-1},{11986,2,0,-1}, +{11986,3,0,-1},{11990,2,0,-1},{11990,3,0,-1},{11994,2,0,-1},{11994,3,0,-1}, +{11999,2,0,-1},{11999,3,0,-1},{12003,2,0,-1},{12003,3,0,-1},{12007,2,0,-1}, +{12007,3,0,-1},{12012,2,0,-1},{12012,3,0,-1},{12016,2,0,-1},{12016,3,0,-1}, +{12020,2,0,-1},{12020,3,0,-1},{12025,2,0,-1},{12025,3,0,-1},{12029,2,0,-1}, +{12029,3,0,-1},{12033,2,0,-1},{12033,3,0,-1},{12038,2,0,-1},{12038,3,0,-1}, +{12042,2,0,-1},{12042,3,0,-1},{12046,2,0,-1},{12046,3,0,-1},{12051,2,0,-1}, +{12051,3,0,-1},{12055,2,0,-1},{12055,3,0,-1},{12059,2,0,-1},{12059,3,0,-1}, +{12064,2,0,-1},{12064,3,0,-1},{12068,2,0,-1},{12068,3,0,-1},{11998,2,0,-1}, +{12072,2,0,-1},{12072,3,0,-1},{12077,2,0,-1},{12077,3,0,-1},{12081,2,0,-1}, +{12081,3,0,-1},{12011,3,0,-1},{12085,2,0,-1},{12085,3,0,-1},{12090,2,0,-1}, +{12090,3,0,-1},{12094,2,0,-1},{12094,3,0,-1},{12098,2,0,-1},{12098,3,0,-1}, +{12103,2,0,-1},{12103,3,0,-1},{12107,2,0,-1},{12107,3,0,-1},{12111,2,0,-1}, +{12111,3,0,-1},{12116,2,0,-1},{12116,3,0,-1},{12120,2,0,-1},{12120,3,0,-1}, +{12124,2,0,-1},{12124,3,0,-1},{12129,2,0,-1},{12129,3,0,-1},{12133,2,0,-1}, +{12133,3,0,-1},{12137,2,0,-1},{12137,3,0,-1},{12142,2,0,-1},{12142,3,0,-1}, +{12146,2,0,-1},{12146,3,0,-1},{12150,2,0,-1},{12150,3,0,-1},{12155,2,0,-1}, +{12155,3,0,-1},{12159,2,0,-1},{12159,3,0,-1},{12163,2,0,-1},{12163,3,0,-1}, +{12168,2,0,-1},{12168,3,0,-1},{12172,2,0,-1},{12172,3,0,-1},{12102,2,0,-1}, +{12176,2,0,-1},{12176,3,0,-1},{12181,2,0,-1},{12181,3,0,-1},{12185,2,0,-1}, +{12185,3,0,-1},{12115,3,0,-1},{12189,2,0,-1},{12189,3,0,-1},{12194,2,0,-1}, +{12194,3,0,-1},{12198,2,0,-1},{12198,3,0,-1},{12202,2,0,-1},{12202,3,0,-1}, +{12207,2,0,-1},{12207,3,0,-1},{12211,2,0,-1},{12211,3,0,-1},{12215,2,0,-1}, +{12215,3,0,-1},{12220,2,0,-1},{12220,3,0,-1},{12224,2,0,-1},{12224,3,0,-1}, +{12228,2,0,-1},{12228,3,0,-1},{12233,2,0,-1},{12233,3,0,-1},{12237,2,0,-1}, +{12237,3,0,-1},{12241,2,0,-1},{12241,3,0,-1},{12246,2,0,-1},{12246,3,0,-1}, +{12250,2,0,-1},{12250,3,0,-1},{12254,2,0,-1},{12254,3,0,-1},{12259,2,0,-1}, +{12259,3,0,-1},{12263,2,0,-1},{12263,3,0,-1},{12267,2,0,-1},{12267,3,0,-1}, +{12272,2,0,-1},{12272,3,0,-1},{12276,2,0,-1},{12276,3,0,-1},{12206,2,0,-1}, +{12280,2,0,-1},{12280,3,0,-1},{12285,2,0,-1},{12285,3,0,-1},{12289,2,0,-1}, +{12289,3,0,-1},{12219,3,0,-1},{12293,2,0,-1},{12293,3,0,-1},{12298,2,0,-1}, +{12298,3,0,-1},{12302,2,0,-1},{12302,3,0,-1},{12306,2,0,-1},{12306,3,0,-1}, +{12311,2,0,-1},{12311,3,0,-1},{12315,2,0,-1},{12315,3,0,-1},{12319,2,0,-1}, +{12319,3,0,-1},{12324,2,0,-1},{12324,3,0,-1},{12328,2,0,-1},{12328,3,0,-1}, +{12332,2,0,-1},{12332,3,0,-1},{12337,2,0,-1},{12337,3,0,-1},{12341,2,0,-1}, +{12341,3,0,-1},{12345,2,0,-1},{12345,3,0,-1},{12350,2,0,-1},{12350,3,0,-1}, +{12354,2,0,-1},{12354,3,0,-1},{12358,2,0,-1},{12358,3,0,-1},{12363,2,0,-1}, +{12363,3,0,-1},{12367,2,0,-1},{12367,3,0,-1},{12371,2,0,-1},{12371,3,0,-1}, +{12376,2,0,-1},{12376,3,0,-1},{12380,2,0,-1},{12380,3,0,-1},{12310,2,0,-1}, +{12384,2,0,-1},{12384,3,0,-1},{12389,2,0,-1},{12389,3,0,-1},{12393,2,0,-1}, +{12393,3,0,-1},{12323,3,0,-1},{12397,2,0,-1},{12397,3,0,-1},{12402,2,0,-1}, +{12402,3,0,-1},{12406,2,0,-1},{12406,3,0,-1},{12410,2,0,-1},{12410,3,0,-1}, +{12415,2,0,-1},{12415,3,0,-1},{12419,2,0,-1},{12419,3,0,-1},{12423,2,0,-1}, +{12423,3,0,-1},{12428,2,0,-1},{12428,3,0,-1},{12432,2,0,-1},{12432,3,0,-1}, +{12436,2,0,-1},{12436,3,0,-1},{12441,2,0,-1},{12441,3,0,-1},{12445,2,0,-1}, +{12445,3,0,-1},{12449,2,0,-1},{12449,3,0,-1},{12454,2,0,-1},{12454,3,0,-1}, +{12458,2,0,-1},{12458,3,0,-1},{12462,2,0,-1},{12462,3,0,-1},{12467,2,0,-1}, +{12467,3,0,-1},{12471,2,0,-1},{12471,3,0,-1},{12475,2,0,-1},{12475,3,0,-1}, +{12480,2,0,-1},{12480,3,0,-1},{12484,2,0,-1},{12484,3,0,-1},{12414,2,0,-1}, +{12488,2,0,-1},{12488,3,0,-1},{12493,2,0,-1},{12493,3,0,-1},{12497,2,0,-1}, +{12497,3,0,-1},{12427,3,0,-1},{12501,2,0,-1},{12501,3,0,-1},{12506,2,0,-1}, +{12506,3,0,-1},{12510,2,0,-1},{12510,3,0,-1},{12514,2,0,-1},{12514,3,0,-1}, +{12519,2,0,-1},{12519,3,0,-1},{12523,2,0,-1},{12523,3,0,-1},{12527,2,0,-1}, +{12527,3,0,-1},{12532,2,0,-1},{12532,3,0,-1},{12536,2,0,-1},{12536,3,0,-1}, +{12540,2,0,-1},{12540,3,0,-1},{12545,2,0,-1},{12545,3,0,-1},{12549,2,0,-1}, +{12549,3,0,-1},{12553,2,0,-1},{12553,3,0,-1},{12558,2,0,-1},{12558,3,0,-1}, +{12562,2,0,-1},{12562,3,0,-1},{12566,2,0,-1},{12566,3,0,-1},{12571,2,0,-1}, +{12571,3,0,-1},{12575,2,0,-1},{12575,3,0,-1},{12579,2,0,-1},{12579,3,0,-1}, +{12584,2,0,-1},{12584,3,0,-1},{12588,2,0,-1},{12588,3,0,-1},{12518,2,0,-1}, +{12592,2,0,-1},{12592,3,0,-1},{12597,2,0,-1},{12597,3,0,-1},{12601,2,0,-1}, +{12601,3,0,-1},{12531,3,0,-1},{12605,2,0,-1},{12605,3,0,-1},{12610,2,0,-1}, +{12610,3,0,-1},{12614,2,0,-1},{12614,3,0,-1},{12618,2,0,-1},{12618,3,0,-1}, +{12623,2,0,-1},{12623,3,0,-1},{12627,2,0,-1},{12627,3,0,-1},{12631,2,0,-1}, +{12631,3,0,-1},{12636,2,0,-1},{12636,3,0,-1},{12640,2,0,-1},{12640,3,0,-1}, +{12644,2,0,-1},{12644,3,0,-1},{12649,2,0,-1},{12649,3,0,-1},{12653,2,0,-1}, +{12653,3,0,-1},{12657,2,0,-1},{12657,3,0,-1},{12662,2,0,-1},{12662,3,0,-1}, +{12666,2,0,-1},{12666,3,0,-1},{12670,2,0,-1},{12670,3,0,-1},{12675,2,0,-1}, +{12675,3,0,-1},{12679,2,0,-1},{12679,3,0,-1},{12683,2,0,-1},{12683,3,0,-1}, +{12688,2,0,-1},{12688,3,0,-1},{12692,2,0,-1},{12692,3,0,-1},{12622,2,0,-1}, +{12696,2,0,-1},{12696,3,0,-1},{12701,2,0,-1},{12701,3,0,-1},{12705,2,0,-1}, +{12705,3,0,-1},{12635,3,0,-1},{12709,2,0,-1},{12709,3,0,-1},{12714,2,0,-1}, +{12714,3,0,-1},{12718,2,0,-1},{12718,3,0,-1},{12722,2,0,-1},{12722,3,0,-1}, +{12727,2,0,-1},{12727,3,0,-1},{12731,2,0,-1},{12731,3,0,-1},{12735,2,0,-1}, +{12735,3,0,-1},{12740,2,0,-1},{12740,3,0,-1},{12744,2,0,-1},{12744,3,0,-1}, +{12748,2,0,-1},{12748,3,0,-1},{12753,2,0,-1},{12753,3,0,-1},{12757,2,0,-1}, +{12757,3,0,-1},{12761,2,0,-1},{12761,3,0,-1},{12766,2,0,-1},{12766,3,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS4 and TS5 */ +struct fn_sample test_fn_tch_f_ts_4_5[] = { +{3407,0,1,-1},{3427,0,1,-1},{3458,0,1,-1},{3509,0,1,-1},{3529,0,1,-1}, +{3560,0,1,-1},{3611,0,1,-1},{3662,0,1,-1},{3713,0,1,-1},{3764,0,1,-1}, +{3780,0,2,-1},{3821,0,2,-1},{3872,0,2,-1},{3882,0,2,-1},{3923,0,2,-1}, +{3974,0,2,-1},{3984,0,2,-1},{4025,0,2,-1},{4076,0,2,-1},{4127,0,2,-1}, +{4178,0,2,-1},{5871,4,0,-1},{5876,4,0,-1},{5880,4,0,-1},{5884,4,0,-1}, +{5889,4,0,-1},{5893,4,0,-1},{5897,4,0,-1},{5902,4,0,-1},{5906,4,0,-1}, +{5910,4,0,-1},{5915,4,0,-1},{5919,4,0,-1},{5923,4,0,-1},{5928,4,0,-1}, +{5932,4,0,-1},{5936,4,0,-1},{5941,4,0,-1},{5945,4,0,-1},{5949,4,0,-1}, +{5954,4,0,-1},{5958,4,0,-1},{5888,4,0,-1},{5962,4,0,-1},{5967,4,0,-1}, +{5971,4,0,-1},{5975,4,0,-1},{5980,4,0,-1},{5984,4,0,-1},{5988,4,0,-1}, +{5993,4,0,-1},{5997,4,0,-1},{6001,4,0,-1},{6006,4,0,-1},{6010,4,0,-1}, +{6014,4,0,-1},{6019,4,0,-1},{6023,4,0,-1},{6027,4,0,-1},{6032,4,0,-1}, +{6036,4,0,-1},{6040,4,0,-1},{6045,4,0,-1},{6049,4,0,-1},{6053,4,0,-1}, +{6058,4,0,-1},{6062,4,0,-1},{5992,4,0,-1},{6066,4,0,-1},{6071,4,0,-1}, +{6075,4,0,-1},{6079,4,0,-1},{6084,4,0,-1},{6088,4,0,-1},{6092,4,0,-1}, +{6097,4,0,-1},{6101,4,0,-1},{6105,4,0,-1},{6110,4,0,-1},{6114,4,0,-1}, +{6118,4,0,-1},{6123,4,0,-1},{6127,4,0,-1},{6131,4,0,-1},{6136,4,0,-1}, +{6140,4,0,-1},{6144,4,0,-1},{6149,4,0,-1},{6153,4,0,-1},{6157,4,0,-1}, +{6162,4,0,-1},{6166,4,0,-1},{6096,4,0,-1},{6170,4,0,-1},{6175,4,0,-1}, +{6175,5,0,-1},{6179,4,0,-1},{6179,5,0,-1},{6183,4,0,-1},{6183,5,0,-1}, +{6188,4,0,-1},{6188,5,0,-1},{6192,4,0,-1},{6192,5,0,-1},{6196,4,0,-1}, +{6196,5,0,-1},{6201,4,0,-1},{6201,5,0,-1},{6205,4,0,-1},{6205,5,0,-1}, +{6209,4,0,-1},{6209,5,0,-1},{6214,4,0,-1},{6214,5,0,-1},{6218,4,0,-1}, +{6218,5,0,-1},{6222,4,0,-1},{6222,5,0,-1},{6227,4,0,-1},{6227,5,0,-1}, +{6231,4,0,-1},{6231,5,0,-1},{6235,4,0,-1},{6235,5,0,-1},{6240,4,0,-1}, +{6240,5,0,-1},{6244,4,0,-1},{6244,5,0,-1},{6248,4,0,-1},{6248,5,0,-1}, +{6253,4,0,-1},{6253,5,0,-1},{6257,4,0,-1},{6257,5,0,-1},{6261,4,0,-1}, +{6261,5,0,-1},{6266,4,0,-1},{6266,5,0,-1},{6270,4,0,-1},{6270,5,0,-1}, +{6200,4,0,-1},{6274,4,0,-1},{6274,5,0,-1},{6279,4,0,-1},{6279,5,0,-1}, +{6283,4,0,-1},{6283,5,0,-1},{6213,5,0,-1},{6287,4,0,-1},{6287,5,0,-1}, +{6292,4,0,-1},{6292,5,0,-1},{6296,4,0,-1},{6296,5,0,-1},{6300,4,0,-1}, +{6300,5,0,-1},{6305,4,0,-1},{6305,5,0,-1},{6309,4,0,-1},{6309,5,0,-1}, +{6313,4,0,-1},{6313,5,0,-1},{6318,4,0,-1},{6318,5,0,-1},{6322,4,0,-1}, +{6322,5,0,-1},{6326,4,0,-1},{6326,5,0,-1},{6331,4,0,-1},{6331,5,0,-1}, +{6335,4,0,-1},{6335,5,0,-1},{6339,4,0,-1},{6339,5,0,-1},{6344,4,0,-1}, +{6344,5,0,-1},{6348,4,0,-1},{6348,5,0,-1},{6352,4,0,-1},{6352,5,0,-1}, +{6357,4,0,-1},{6357,5,0,-1},{6361,4,0,-1},{6361,5,0,-1},{6365,4,0,-1}, +{6365,5,0,-1},{6370,4,0,-1},{6370,5,0,-1},{6374,4,0,-1},{6374,5,0,-1}, +{6304,4,0,-1},{6378,4,0,-1},{6378,5,0,-1},{6383,4,0,-1},{6383,5,0,-1}, +{6387,4,0,-1},{6387,5,0,-1},{6317,5,0,-1},{6391,4,0,-1},{6391,5,0,-1}, +{6396,4,0,-1},{6396,5,0,-1},{6400,4,0,-1},{6400,5,0,-1},{6404,4,0,-1}, +{6404,5,0,-1},{6409,4,0,-1},{6409,5,0,-1},{6413,4,0,-1},{6413,5,0,-1}, +{6417,4,0,-1},{6417,5,0,-1},{6422,4,0,-1},{6422,5,0,-1},{6426,4,0,-1}, +{6426,5,0,-1},{6430,4,0,-1},{6430,5,0,-1},{6435,4,0,-1},{6435,5,0,-1}, +{6439,4,0,-1},{6439,5,0,-1},{6443,4,0,-1},{6443,5,0,-1},{6448,4,0,-1}, +{6448,5,0,-1},{6452,4,0,-1},{6452,5,0,-1},{6456,4,0,-1},{6456,5,0,-1}, +{6461,4,0,-1},{6461,5,0,-1},{6465,4,0,-1},{6465,5,0,-1},{6469,4,0,-1}, +{6469,5,0,-1},{6474,4,0,-1},{6474,5,0,-1},{6478,4,0,-1},{6478,5,0,-1}, +{6408,4,0,-1},{6482,4,0,-1},{6482,5,0,-1},{6487,4,0,-1},{6487,5,0,-1}, +{6491,4,0,-1},{6491,5,0,-1},{6421,5,0,-1},{6495,4,0,-1},{6495,5,0,-1}, +{6500,4,0,-1},{6500,5,0,-1},{6504,4,0,-1},{6504,5,0,-1},{6508,4,0,-1}, +{6508,5,0,-1},{6513,4,0,-1},{6513,5,0,-1},{6517,4,0,-1},{6517,5,0,-1}, +{6521,4,0,-1},{6521,5,0,-1},{6526,4,0,-1},{6526,5,0,-1},{6530,4,0,-1}, +{6530,5,0,-1},{6534,4,0,-1},{6534,5,0,-1},{6539,4,0,-1},{6539,5,0,-1}, +{6543,4,0,-1},{6543,5,0,-1},{6547,4,0,-1},{6547,5,0,-1},{6552,4,0,-1}, +{6552,5,0,-1},{6556,4,0,-1},{6556,5,0,-1},{6560,4,0,-1},{6560,5,0,-1}, +{6565,4,0,-1},{6565,5,0,-1},{6569,4,0,-1},{6569,5,0,-1},{6573,4,0,-1}, +{6573,5,0,-1},{6578,4,0,-1},{6578,5,0,-1},{6582,4,0,-1},{6582,5,0,-1}, +{6512,4,0,-1},{6586,4,0,-1},{6586,5,0,-1},{6591,4,0,-1},{6591,5,0,-1}, +{6595,4,0,-1},{6595,5,0,-1},{6525,5,0,-1},{6599,4,0,-1},{6599,5,0,-1}, +{6604,4,0,-1},{6604,5,0,-1},{6608,4,0,-1},{6608,5,0,-1},{6612,4,0,-1}, +{6612,5,0,-1},{6617,4,0,-1},{6617,5,0,-1},{6621,4,0,-1},{6621,5,0,-1}, +{6625,4,0,-1},{6625,5,0,-1},{6630,4,0,-1},{6630,5,0,-1},{6634,4,0,-1}, +{6634,5,0,-1},{6638,4,0,-1},{6638,5,0,-1},{6643,4,0,-1},{6643,5,0,-1}, +{6647,4,0,-1},{6647,5,0,-1},{6651,4,0,-1},{6651,5,0,-1},{6656,4,0,-1}, +{6656,5,0,-1},{6660,4,0,-1},{6660,5,0,-1},{6664,4,0,-1},{6664,5,0,-1}, +{6669,4,0,-1},{6669,5,0,-1},{6673,4,0,-1},{6673,5,0,-1},{6677,4,0,-1}, +{6677,5,0,-1},{6682,4,0,-1},{6682,5,0,-1},{6686,4,0,-1},{6686,5,0,-1}, +{6616,4,0,-1},{6690,4,0,-1},{6690,5,0,-1},{6695,4,0,-1},{6695,5,0,-1}, +{6699,4,0,-1},{6699,5,0,-1},{6629,5,0,-1},{6703,4,0,-1},{6703,5,0,-1}, +{6708,4,0,-1},{6708,5,0,-1},{6712,4,0,-1},{6712,5,0,-1},{6716,4,0,-1}, +{6716,5,0,-1},{6721,4,0,-1},{6721,5,0,-1},{6725,4,0,-1},{6725,5,0,-1}, +{6729,4,0,-1},{6729,5,0,-1},{6734,4,0,-1},{6734,5,0,-1},{6738,4,0,-1}, +{6738,5,0,-1},{6742,4,0,-1},{6742,5,0,-1},{6747,4,0,-1},{6747,5,0,-1}, +{6751,4,0,-1},{6751,5,0,-1},{6755,4,0,-1},{6755,5,0,-1},{6760,4,0,-1}, +{6760,5,0,-1},{6764,4,0,-1},{6764,5,0,-1},{6768,4,0,-1},{6768,5,0,-1}, +{6773,4,0,-1},{6773,5,0,-1},{6777,4,0,-1},{6777,5,0,-1},{6781,4,0,-1}, +{6781,5,0,-1},{6786,4,0,-1},{6786,5,0,-1},{6790,4,0,-1},{6790,5,0,-1}, +{6720,4,0,-1},{6794,4,0,-1},{6794,5,0,-1},{6799,4,0,-1},{6799,5,0,-1}, +{6803,4,0,-1},{6803,5,0,-1},{6733,5,0,-1},{6807,4,0,-1},{6807,5,0,-1}, +{6812,4,0,-1},{6812,5,0,-1},{6816,4,0,-1},{6816,5,0,-1},{6820,4,0,-1}, +{6820,5,0,-1},{6825,4,0,-1},{6825,5,0,-1},{6829,4,0,-1},{6829,5,0,-1}, +{6833,4,0,-1},{6833,5,0,-1},{6838,4,0,-1},{6838,5,0,-1},{6842,4,0,-1}, +{6842,5,0,-1},{6846,4,0,-1},{6846,5,0,-1},{6851,4,0,-1},{6851,5,0,-1}, +{6855,4,0,-1},{6855,5,0,-1},{6859,4,0,-1},{6859,5,0,-1},{6864,4,0,-1}, +{6864,5,0,-1},{6868,4,0,-1},{6868,5,0,-1},{6872,4,0,-1},{6872,5,0,-1}, +{6877,4,0,-1},{6877,5,0,-1},{6881,4,0,-1},{6881,5,0,-1},{6885,4,0,-1}, +{6885,5,0,-1},{6890,4,0,-1},{6890,5,0,-1},{6894,4,0,-1},{6894,5,0,-1}, +{6824,4,0,-1},{6898,4,0,-1},{6898,5,0,-1},{6903,4,0,-1},{6903,5,0,-1}, +{6907,4,0,-1},{6907,5,0,-1},{6837,5,0,-1},{6911,4,0,-1},{6911,5,0,-1}, +{6916,4,0,-1},{6916,5,0,-1},{6920,4,0,-1},{6920,5,0,-1},{6924,4,0,-1}, +{6924,5,0,-1},{6929,4,0,-1},{6929,5,0,-1},{6933,4,0,-1},{6933,5,0,-1}, +{6937,4,0,-1},{6937,5,0,-1},{6942,4,0,-1},{6942,5,0,-1},{6946,4,0,-1}, +{6946,5,0,-1},{6950,4,0,-1},{6950,5,0,-1},{6955,4,0,-1},{6955,5,0,-1}, +{6959,4,0,-1},{6959,5,0,-1},{6963,4,0,-1},{6963,5,0,-1},{6968,4,0,-1}, +{6968,5,0,-1},{6972,4,0,-1},{6972,5,0,-1},{6976,4,0,-1},{6976,5,0,-1}, +{6981,4,0,-1},{6981,5,0,-1},{6985,4,0,-1},{6985,5,0,-1},{6989,4,0,-1}, +{6989,5,0,-1},{6994,4,0,-1},{6994,5,0,-1},{6998,4,0,-1},{6998,5,0,-1}, +{6928,4,0,-1},{7002,4,0,-1},{7002,5,0,-1},{7007,4,0,-1},{7007,5,0,-1}, +{7011,4,0,-1},{7011,5,0,-1},{6941,5,0,-1},{7015,4,0,-1},{7015,5,0,-1}, +{7020,4,0,-1},{7020,5,0,-1},{7024,4,0,-1},{7024,5,0,-1},{7028,4,0,-1}, +{7028,5,0,-1},{7033,4,0,-1},{7033,5,0,-1},{7037,4,0,-1},{7037,5,0,-1}, +{7041,4,0,-1},{7041,5,0,-1},{7046,4,0,-1},{7046,5,0,-1},{7050,4,0,-1}, +{7050,5,0,-1},{7054,4,0,-1},{7054,5,0,-1},{7059,4,0,-1},{7059,5,0,-1}, +{7063,4,0,-1},{7063,5,0,-1},{7067,4,0,-1},{7067,5,0,-1},{7072,4,0,-1}, +{7072,5,0,-1},{7076,4,0,-1},{7076,5,0,-1},{7080,4,0,-1},{7080,5,0,-1}, +{7085,4,0,-1},{7085,5,0,-1},{7089,4,0,-1},{7089,5,0,-1},{7093,4,0,-1}, +{7093,5,0,-1},{7098,4,0,-1},{7098,5,0,-1},{7102,4,0,-1},{7102,5,0,-1}, +{7032,4,0,-1},{7106,4,0,-1},{7106,5,0,-1},{7111,4,0,-1},{7111,5,0,-1}, +{7115,4,0,-1},{7115,5,0,-1},{7045,5,0,-1},{7119,4,0,-1},{7119,5,0,-1}, +{7124,4,0,-1},{7124,5,0,-1},{7128,4,0,-1},{7128,5,0,-1},{7132,4,0,-1}, +{7132,5,0,-1},{7137,4,0,-1},{7137,5,0,-1},{7141,4,0,-1},{7141,5,0,-1}, +{7145,4,0,-1},{7145,5,0,-1},{7150,4,0,-1},{7150,5,0,-1},{7154,4,0,-1}, +{7154,5,0,-1},{7158,4,0,-1},{7158,5,0,-1},{7163,4,0,-1},{7163,5,0,-1}, +{7167,4,0,-1},{7167,5,0,-1},{7171,4,0,-1},{7171,5,0,-1},{7176,4,0,-1}, +{7176,5,0,-1},{7180,4,0,-1},{7180,5,0,-1},{7184,4,0,-1},{7184,5,0,-1}, +{7189,4,0,-1},{7189,5,0,-1},{7193,4,0,-1},{7193,5,0,-1},{7197,4,0,-1}, +{7197,5,0,-1},{7202,4,0,-1},{7202,5,0,-1},{7206,4,0,-1},{7206,5,0,-1}, +{7136,4,0,-1},{7210,4,0,-1},{7210,5,0,-1},{7215,4,0,-1},{7215,5,0,-1}, +{7219,4,0,-1},{7219,5,0,-1},{7149,5,0,-1},{7223,4,0,-1},{7223,5,0,-1}, +{7228,4,0,-1},{7228,5,0,-1},{7232,4,0,-1},{7232,5,0,-1},{7236,4,0,-1}, +{7236,5,0,-1},{7241,4,0,-1},{7241,5,0,-1},{7245,4,0,-1},{7245,5,0,-1}, +{7249,4,0,-1},{7249,5,0,-1},{7254,4,0,-1},{7254,5,0,-1},{7258,4,0,-1}, +{7258,5,0,-1},{7262,4,0,-1},{7262,5,0,-1},{7267,4,0,-1},{7267,5,0,-1}, +{7271,4,0,-1},{7271,5,0,-1},{7275,4,0,-1},{7275,5,0,-1},{7280,4,0,-1}, +{7280,5,0,-1},{7284,4,0,-1},{7284,5,0,-1},{7288,4,0,-1},{7288,5,0,-1}, +{7293,4,0,-1},{7293,5,0,-1},{7297,4,0,-1},{7297,5,0,-1},{7301,4,0,-1}, +{7301,5,0,-1},{7306,4,0,-1},{7306,5,0,-1},{7310,4,0,-1},{7310,5,0,-1}, +{7240,4,0,-1},{7314,4,0,-1},{7314,5,0,-1},{7319,4,0,-1},{7319,5,0,-1}, +{7323,4,0,-1},{7323,5,0,-1},{7253,5,0,-1},{7327,4,0,-1},{7327,5,0,-1}, +{7332,4,0,-1},{7332,5,0,-1},{7336,4,0,-1},{7336,5,0,-1},{7340,4,0,-1}, +{7340,5,0,-1},{7345,4,0,-1},{7345,5,0,-1},{7349,4,0,-1},{7349,5,0,-1}, +{7353,4,0,-1},{7353,5,0,-1},{7358,4,0,-1},{7358,5,0,-1},{7362,4,0,-1}, +{7362,5,0,-1},{7366,4,0,-1},{7366,5,0,-1},{7371,4,0,-1},{7371,5,0,-1}, +{7375,4,0,-1},{7375,5,0,-1},{7379,4,0,-1},{7379,5,0,-1},{7384,4,0,-1}, +{7384,5,0,-1},{7388,4,0,-1},{7388,5,0,-1},{7392,4,0,-1},{7392,5,0,-1}, +{7397,4,0,-1},{7397,5,0,-1},{7401,4,0,-1},{7401,5,0,-1},{7405,4,0,-1}, +{7405,5,0,-1},{7410,4,0,-1},{7410,5,0,-1},{7414,4,0,-1},{7414,5,0,-1}, +{7344,4,0,-1},{7418,4,0,-1},{7418,5,0,-1},{7423,4,0,-1},{7423,5,0,-1}, +{7427,4,0,-1},{7427,5,0,-1},{7357,5,0,-1},{7431,4,0,-1},{7431,5,0,-1}, +{7436,4,0,-1},{7436,5,0,-1},{7440,4,0,-1},{7440,5,0,-1},{7444,4,0,-1}, +{7444,5,0,-1},{7449,4,0,-1},{7449,5,0,-1},{7453,4,0,-1},{7453,5,0,-1}, +{7457,4,0,-1},{7457,5,0,-1},{7462,4,0,-1},{7462,5,0,-1},{7466,4,0,-1}, +{7466,5,0,-1},{7470,4,0,-1},{7470,5,0,-1},{7475,4,0,-1},{7475,5,0,-1}, +{7479,4,0,-1},{7479,5,0,-1},{7483,4,0,-1},{7483,5,0,-1},{7488,4,0,-1}, +{7488,5,0,-1},{7492,4,0,-1},{7492,5,0,-1},{7496,4,0,-1},{7496,5,0,-1}, +{7501,4,0,-1},{7501,5,0,-1},{7505,4,0,-1},{7505,5,0,-1},{7509,4,0,-1}, +{7509,5,0,-1},{7514,4,0,-1},{7514,5,0,-1},{7518,4,0,-1},{7518,5,0,-1}, +{7448,4,0,-1},{7522,4,0,-1},{7522,5,0,-1},{7527,4,0,-1},{7527,5,0,-1}, +{7531,4,0,-1},{7531,5,0,-1},{7461,5,0,-1},{7535,4,0,-1},{7535,5,0,-1}, +{7540,4,0,-1},{7540,5,0,-1},{7544,4,0,-1},{7544,5,0,-1},{7548,4,0,-1}, +{7548,5,0,-1},{7553,4,0,-1},{7553,5,0,-1},{7557,4,0,-1},{7557,5,0,-1}, +{7561,4,0,-1},{7561,5,0,-1},{7566,4,0,-1},{7566,5,0,-1},{7570,4,0,-1}, +{7570,5,0,-1},{7574,4,0,-1},{7574,5,0,-1},{7579,4,0,-1},{7579,5,0,-1}, +{7583,4,0,-1},{7583,5,0,-1},{7587,4,0,-1},{7587,5,0,-1},{7592,4,0,-1}, +{7592,5,0,-1},{7596,4,0,-1},{7596,5,0,-1},{7600,4,0,-1},{7600,5,0,-1}, +{7605,4,0,-1},{7605,5,0,-1},{7609,4,0,-1},{7609,5,0,-1},{7613,4,0,-1}, +{7613,5,0,-1},{7618,4,0,-1},{7618,5,0,-1},{7622,4,0,-1},{7622,5,0,-1}, +{7552,4,0,-1},{7626,4,0,-1},{7626,5,0,-1},{7631,4,0,-1},{7631,5,0,-1}, +{7635,4,0,-1},{7635,5,0,-1},{7565,5,0,-1},{7639,4,0,-1},{7639,5,0,-1}, +{7644,4,0,-1},{7644,5,0,-1},{7648,4,0,-1},{7648,5,0,-1},{7652,4,0,-1}, +{7652,5,0,-1},{7657,4,0,-1},{7657,5,0,-1},{7661,4,0,-1},{7661,5,0,-1}, +{7665,4,0,-1},{7665,5,0,-1},{7670,4,0,-1},{7670,5,0,-1},{7674,4,0,-1}, +{7674,5,0,-1},{7678,4,0,-1},{7678,5,0,-1},{7683,4,0,-1},{7683,5,0,-1}, +{7687,4,0,-1},{7687,5,0,-1},{7691,4,0,-1},{7691,5,0,-1},{7696,4,0,-1}, +{7696,5,0,-1},{7700,4,0,-1},{7700,5,0,-1},{7704,4,0,-1},{7704,5,0,-1}, +{7709,4,0,-1},{7709,5,0,-1},{7713,4,0,-1},{7713,5,0,-1},{7717,4,0,-1}, +{7717,5,0,-1},{7722,4,0,-1},{7722,5,0,-1},{7726,4,0,-1},{7726,5,0,-1}, +{7656,4,0,-1},{7730,4,0,-1},{7730,5,0,-1},{7735,4,0,-1},{7735,5,0,-1}, +{7739,4,0,-1},{7739,5,0,-1},{7669,5,0,-1},{7743,4,0,-1},{7743,5,0,-1}, +{7748,4,0,-1},{7748,5,0,-1},{7752,4,0,-1},{7752,5,0,-1},{7756,4,0,-1}, +{7756,5,0,-1},{7761,4,0,-1},{7761,5,0,-1},{7765,4,0,-1},{7765,5,0,-1}, +{7769,4,0,-1},{7769,5,0,-1},{7774,4,0,-1},{7774,5,0,-1},{7778,4,0,-1}, +{7778,5,0,-1},{7782,4,0,-1},{7782,5,0,-1},{7787,4,0,-1},{7787,5,0,-1}, +{7791,4,0,-1},{7791,5,0,-1},{7795,4,0,-1},{7795,5,0,-1},{7800,4,0,-1}, +{7800,5,0,-1},{7804,4,0,-1},{7804,5,0,-1},{7808,4,0,-1},{7808,5,0,-1}, +{7813,4,0,-1},{7813,5,0,-1},{7817,4,0,-1},{7817,5,0,-1},{7821,4,0,-1}, +{7821,5,0,-1},{7826,4,0,-1},{7826,5,0,-1},{7830,4,0,-1},{7830,5,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7834,5,0,-1},{7839,4,0,-1},{7839,5,0,-1}, +{7843,4,0,-1},{7843,5,0,-1},{7773,5,0,-1},{7847,4,0,-1},{7847,5,0,-1}, +{7852,4,0,-1},{7852,5,0,-1},{7856,4,0,-1},{7856,5,0,-1},{7860,4,0,-1}, +{7860,5,0,-1},{7865,4,0,-1},{7865,5,0,-1},{7869,4,0,-1},{7869,5,0,-1}, +{7873,4,0,-1},{7873,5,0,-1},{7878,4,0,-1},{7878,5,0,-1},{7882,4,0,-1}, +{7882,5,0,-1},{7886,4,0,-1},{7886,5,0,-1},{7891,4,0,-1},{7891,5,0,-1}, +{7895,4,0,-1},{7895,5,0,-1},{7899,4,0,-1},{7899,5,0,-1},{7904,4,0,-1}, +{7904,5,0,-1},{7908,4,0,-1},{7908,5,0,-1},{7912,4,0,-1},{7912,5,0,-1}, +{7917,4,0,-1},{7917,5,0,-1},{7921,4,0,-1},{7921,5,0,-1},{7925,4,0,-1}, +{7925,5,0,-1},{7930,4,0,-1},{7930,5,0,-1},{7934,4,0,-1},{7934,5,0,-1}, +{7864,4,0,-1},{7938,4,0,-1},{7938,5,0,-1},{7943,4,0,-1},{7943,5,0,-1}, +{7947,4,0,-1},{7947,5,0,-1},{7877,5,0,-1},{7951,4,0,-1},{7951,5,0,-1}, +{7956,4,0,-1},{7956,5,0,-1},{7960,4,0,-1},{7960,5,0,-1},{7964,4,0,-1}, +{7964,5,0,-1},{7969,4,0,-1},{7969,5,0,-1},{7973,4,0,-1},{7973,5,0,-1}, +{7977,4,0,-1},{7977,5,0,-1},{7982,4,0,-1},{7982,5,0,-1},{7986,4,0,-1}, +{7986,5,0,-1},{7990,4,0,-1},{7990,5,0,-1},{7995,4,0,-1},{7995,5,0,-1}, +{7999,4,0,-1},{7999,5,0,-1},{8003,4,0,-1},{8003,5,0,-1},{8008,4,0,-1}, +{8008,5,0,-1},{8012,4,0,-1},{8012,5,0,-1},{8016,4,0,-1},{8016,5,0,-1}, +{8021,4,0,-1},{8021,5,0,-1},{8025,4,0,-1},{8025,5,0,-1},{8029,4,0,-1}, +{8029,5,0,-1},{8034,4,0,-1},{8034,5,0,-1},{8038,4,0,-1},{8038,5,0,-1}, +{7968,4,0,-1},{8042,4,0,-1},{8042,5,0,-1},{8047,4,0,-1},{8047,5,0,-1}, +{8051,4,0,-1},{8051,5,0,-1},{7981,5,0,-1},{8055,4,0,-1},{8055,5,0,-1}, +{8060,4,0,-1},{8060,5,0,-1},{8064,4,0,-1},{8064,5,0,-1},{8068,4,0,-1}, +{8068,5,0,-1},{8073,4,0,-1},{8073,5,0,-1},{8077,4,0,-1},{8077,5,0,-1}, +{8081,4,0,-1},{8081,5,0,-1},{8086,4,0,-1},{8086,5,0,-1},{8090,4,0,-1}, +{8090,5,0,-1},{8094,4,0,-1},{8094,5,0,-1},{8099,4,0,-1},{8099,5,0,-1}, +{8103,4,0,-1},{8103,5,0,-1},{8107,4,0,-1},{8107,5,0,-1},{8112,4,0,-1}, +{8112,5,0,-1},{8116,4,0,-1},{8116,5,0,-1},{8120,4,0,-1},{8120,5,0,-1}, +{8125,4,0,-1},{8125,5,0,-1},{8129,4,0,-1},{8129,5,0,-1},{8133,4,0,-1}, +{8133,5,0,-1},{8138,4,0,-1},{8138,5,0,-1},{8142,4,0,-1},{8142,5,0,-1}, +{8072,4,0,-1},{8146,4,0,-1},{8146,5,0,-1},{8151,4,0,-1},{8151,5,0,-1}, +{8155,4,0,-1},{8155,5,0,-1},{8085,5,0,-1},{8159,4,0,-1},{8159,5,0,-1}, +{8164,4,0,-1},{8164,5,0,-1},{8168,4,0,-1},{8168,5,0,-1},{8172,4,0,-1}, +{8172,5,0,-1},{8177,4,0,-1},{8177,5,0,-1},{8181,4,0,-1},{8181,5,0,-1}, +{8185,4,0,-1},{8185,5,0,-1},{8190,4,0,-1},{8190,5,0,-1},{8194,4,0,-1}, +{8194,5,0,-1},{8198,4,0,-1},{8198,5,0,-1},{8203,4,0,-1},{8203,5,0,-1}, +{8207,4,0,-1},{8207,5,0,-1},{8211,4,0,-1},{8211,5,0,-1},{8216,4,0,-1}, +{8216,5,0,-1},{8220,4,0,-1},{8220,5,0,-1},{8224,4,0,-1},{8224,5,0,-1}, +{8229,4,0,-1},{8229,5,0,-1},{8233,4,0,-1},{8233,5,0,-1},{8237,4,0,-1}, +{8237,5,0,-1},{8242,4,0,-1},{8242,5,0,-1},{8246,4,0,-1},{8246,5,0,-1}, +{8176,4,0,-1},{8250,4,0,-1},{8250,5,0,-1},{8255,4,0,-1},{8255,5,0,-1}, +{8259,4,0,-1},{8259,5,0,-1},{8189,5,0,-1},{8263,4,0,-1},{8263,5,0,-1}, +{8268,4,0,-1},{8268,5,0,-1},{8272,4,0,-1},{8272,5,0,-1},{8276,4,0,-1}, +{8276,5,0,-1},{8281,4,0,-1},{8281,5,0,-1},{8285,4,0,-1},{8285,5,0,-1}, +{8289,4,0,-1},{8289,5,0,-1},{8294,4,0,-1},{8294,5,0,-1},{8298,4,0,-1}, +{8298,5,0,-1},{8302,4,0,-1},{8302,5,0,-1},{8307,4,0,-1},{8307,5,0,-1}, +{8311,4,0,-1},{8311,5,0,-1},{8315,4,0,-1},{8315,5,0,-1},{8320,4,0,-1}, +{8320,5,0,-1},{8324,4,0,-1},{8324,5,0,-1},{8328,4,0,-1},{8328,5,0,-1}, +{8333,4,0,-1},{8333,5,0,-1},{8337,4,0,-1},{8337,5,0,-1},{8341,4,0,-1}, +{8341,5,0,-1},{8346,4,0,-1},{8346,5,0,-1},{8350,4,0,-1},{8350,5,0,-1}, +{8280,4,0,-1},{8354,4,0,-1},{8354,5,0,-1},{8359,4,0,-1},{8359,5,0,-1}, +{8363,4,0,-1},{8363,5,0,-1},{8293,5,0,-1},{8367,4,0,-1},{8367,5,0,-1}, +{8372,4,0,-1},{8372,5,0,-1},{8376,4,0,-1},{8376,5,0,-1},{8380,4,0,-1}, +{8380,5,0,-1},{8385,4,0,-1},{8385,5,0,-1},{8389,4,0,-1},{8389,5,0,-1}, +{8393,4,0,-1},{8393,5,0,-1},{8398,4,0,-1},{8398,5,0,-1},{8402,4,0,-1}, +{8402,5,0,-1},{8406,4,0,-1},{8406,5,0,-1},{8411,4,0,-1},{8411,5,0,-1}, +{8415,4,0,-1},{8415,5,0,-1},{8419,4,0,-1},{8419,5,0,-1},{8424,4,0,-1}, +{8424,5,0,-1},{8428,4,0,-1},{8428,5,0,-1},{8432,4,0,-1},{8432,5,0,-1}, +{8437,4,0,-1},{8437,5,0,-1},{8441,4,0,-1},{8441,5,0,-1},{8445,4,0,-1}, +{8445,5,0,-1},{8450,4,0,-1},{8450,5,0,-1},{8454,4,0,-1},{8454,5,0,-1}, +{8384,4,0,-1},{8458,4,0,-1},{8458,5,0,-1},{8463,4,0,-1},{8463,5,0,-1}, +{8467,4,0,-1},{8467,5,0,-1},{8397,5,0,-1},{8471,4,0,-1},{8471,5,0,-1}, +{8476,4,0,-1},{8476,5,0,-1},{8480,4,0,-1},{8480,5,0,-1},{8484,4,0,-1}, +{8484,5,0,-1},{8489,4,0,-1},{8489,5,0,-1},{8493,4,0,-1},{8493,5,0,-1}, +{8497,4,0,-1},{8497,5,0,-1},{8502,4,0,-1},{8502,5,0,-1},{8506,4,0,-1}, +{8506,5,0,-1},{8510,4,0,-1},{8510,5,0,-1},{8515,4,0,-1},{8515,5,0,-1}, +{8519,4,0,-1},{8519,5,0,-1},{8523,4,0,-1},{8523,5,0,-1},{8528,4,0,-1}, +{8528,5,0,-1},{8532,4,0,-1},{8532,5,0,-1},{8536,4,0,-1},{8536,5,0,-1}, +{8541,4,0,-1},{8541,5,0,-1},{8545,4,0,-1},{8545,5,0,-1},{8549,4,0,-1}, +{8549,5,0,-1},{8554,4,0,-1},{8554,5,0,-1},{8558,4,0,-1},{8558,5,0,-1}, +{8488,4,0,-1},{8562,4,0,-1},{8562,5,0,-1},{8567,4,0,-1},{8567,5,0,-1}, +{8571,4,0,-1},{8571,5,0,-1},{8501,5,0,-1},{8575,4,0,-1},{8575,5,0,-1}, +{8580,4,0,-1},{8580,5,0,-1},{8584,4,0,-1},{8584,5,0,-1},{8588,4,0,-1}, +{8588,5,0,-1},{8593,4,0,-1},{8593,5,0,-1},{8597,4,0,-1},{8597,5,0,-1}, +{8601,4,0,-1},{8601,5,0,-1},{8606,4,0,-1},{8606,5,0,-1},{8610,4,0,-1}, +{8610,5,0,-1},{8614,4,0,-1},{8614,5,0,-1},{8619,4,0,-1},{8619,5,0,-1}, +{8623,4,0,-1},{8623,5,0,-1},{8627,4,0,-1},{8627,5,0,-1},{8632,4,0,-1}, +{8632,5,0,-1},{8636,4,0,-1},{8636,5,0,-1},{8640,4,0,-1},{8640,5,0,-1}, +{8645,4,0,-1},{8645,5,0,-1},{8649,4,0,-1},{8649,5,0,-1},{8653,4,0,-1}, +{8653,5,0,-1},{8658,4,0,-1},{8658,5,0,-1},{8662,4,0,-1},{8662,5,0,-1}, +{8592,4,0,-1},{8666,4,0,-1},{8666,5,0,-1},{8671,4,0,-1},{8671,5,0,-1}, +{8675,4,0,-1},{8675,5,0,-1},{8605,5,0,-1},{8679,4,0,-1},{8679,5,0,-1}, +{8684,4,0,-1},{8684,5,0,-1},{8688,4,0,-1},{8688,5,0,-1},{8692,4,0,-1}, +{8692,5,0,-1},{8697,4,0,-1},{8697,5,0,-1},{8701,4,0,-1},{8701,5,0,-1}, +{8705,4,0,-1},{8705,5,0,-1},{8710,4,0,-1},{8710,5,0,-1},{8714,4,0,-1}, +{8714,5,0,-1},{8718,4,0,-1},{8718,5,0,-1},{8723,4,0,-1},{8723,5,0,-1}, +{8727,4,0,-1},{8727,5,0,-1},{8731,4,0,-1},{8731,5,0,-1},{8736,4,0,-1}, +{8736,5,0,-1},{8740,4,0,-1},{8740,5,0,-1},{8744,4,0,-1},{8744,5,0,-1}, +{8749,4,0,-1},{8749,5,0,-1},{8753,4,0,-1},{8753,5,0,-1},{8757,4,0,-1}, +{8757,5,0,-1},{8762,4,0,-1},{8762,5,0,-1},{8766,4,0,-1},{8766,5,0,-1}, +{8696,4,0,-1},{8770,4,0,-1},{8770,5,0,-1},{8775,4,0,-1},{8775,5,0,-1}, +{8779,4,0,-1},{8779,5,0,-1},{8709,5,0,-1},{8783,4,0,-1},{8783,5,0,-1}, +{8788,4,0,-1},{8788,5,0,-1},{8792,4,0,-1},{8792,5,0,-1},{8796,4,0,-1}, +{8796,5,0,-1},{8801,4,0,-1},{8801,5,0,-1},{8805,4,0,-1},{8805,5,0,-1}, +{8809,4,0,-1},{8809,5,0,-1},{8814,4,0,-1},{8814,5,0,-1},{8818,4,0,-1}, +{8818,5,0,-1},{8822,4,0,-1},{8822,5,0,-1},{8827,4,0,-1},{8827,5,0,-1}, +{8831,4,0,-1},{8831,5,0,-1},{8835,4,0,-1},{8835,5,0,-1},{8840,4,0,-1}, +{8840,5,0,-1},{8844,4,0,-1},{8844,5,0,-1},{8848,4,0,-1},{8848,5,0,-1}, +{8853,4,0,-1},{8853,5,0,-1},{8857,4,0,-1},{8857,5,0,-1},{8861,4,0,-1}, +{8861,5,0,-1},{8866,4,0,-1},{8866,5,0,-1},{8870,4,0,-1},{8870,5,0,-1}, +{8800,4,0,-1},{8874,4,0,-1},{8874,5,0,-1},{8879,4,0,-1},{8879,5,0,-1}, +{8883,4,0,-1},{8883,5,0,-1},{8813,5,0,-1},{8887,4,0,-1},{8887,5,0,-1}, +{8892,4,0,-1},{8892,5,0,-1},{8896,4,0,-1},{8896,5,0,-1},{8900,4,0,-1}, +{8900,5,0,-1},{8905,4,0,-1},{8905,5,0,-1},{8909,4,0,-1},{8909,5,0,-1}, +{8913,4,0,-1},{8913,5,0,-1},{8918,4,0,-1},{8918,5,0,-1},{8922,4,0,-1}, +{8922,5,0,-1},{8926,4,0,-1},{8926,5,0,-1},{8931,4,0,-1},{8931,5,0,-1}, +{8935,4,0,-1},{8935,5,0,-1},{8939,4,0,-1},{8939,5,0,-1},{8944,4,0,-1}, +{8944,5,0,-1},{8948,4,0,-1},{8948,5,0,-1},{8952,4,0,-1},{8952,5,0,-1}, +{8957,4,0,-1},{8957,5,0,-1},{8961,4,0,-1},{8961,5,0,-1},{8965,4,0,-1}, +{8965,5,0,-1},{8970,4,0,-1},{8970,5,0,-1},{8974,4,0,-1},{8974,5,0,-1}, +{8904,4,0,-1},{8978,4,0,-1},{8978,5,0,-1},{8983,4,0,-1},{8983,5,0,-1}, +{8987,4,0,-1},{8987,5,0,-1},{8917,5,0,-1},{8991,4,0,-1},{8991,5,0,-1}, +{8996,4,0,-1},{8996,5,0,-1},{9000,4,0,-1},{9000,5,0,-1},{9004,4,0,-1}, +{9004,5,0,-1},{9009,4,0,-1},{9009,5,0,-1},{9013,4,0,-1},{9013,5,0,-1}, +{9017,4,0,-1},{9017,5,0,-1},{9022,4,0,-1},{9022,5,0,-1},{9026,4,0,-1}, +{9026,5,0,-1},{9030,4,0,-1},{9030,5,0,-1},{9035,4,0,-1},{9035,5,0,-1}, +{9039,4,0,-1},{9039,5,0,-1},{9043,4,0,-1},{9043,5,0,-1},{9048,4,0,-1}, +{9048,5,0,-1},{9052,4,0,-1},{9052,5,0,-1},{9056,4,0,-1},{9056,5,0,-1}, +{9061,4,0,-1},{9061,5,0,-1},{9065,4,0,-1},{9065,5,0,-1},{9069,4,0,-1}, +{9069,5,0,-1},{9074,4,0,-1},{9074,5,0,-1},{9078,4,0,-1},{9078,5,0,-1}, +{9008,4,0,-1},{9082,4,0,-1},{9082,5,0,-1},{9087,4,0,-1},{9087,5,0,-1}, +{9091,4,0,-1},{9091,5,0,-1},{9021,5,0,-1},{9095,4,0,-1},{9095,5,0,-1}, +{9100,4,0,-1},{9100,5,0,-1},{9104,4,0,-1},{9104,5,0,-1},{9108,4,0,-1}, +{9108,5,0,-1},{9113,4,0,-1},{9113,5,0,-1},{9117,4,0,-1},{9117,5,0,-1}, +{9121,4,0,-1},{9121,5,0,-1},{9126,4,0,-1},{9126,5,0,-1},{9130,4,0,-1}, +{9130,5,0,-1},{9134,4,0,-1},{9134,5,0,-1},{9139,4,0,-1},{9139,5,0,-1}, +{9143,4,0,-1},{9143,5,0,-1},{9147,4,0,-1},{9147,5,0,-1},{9152,4,0,-1}, +{9152,5,0,-1},{9156,4,0,-1},{9156,5,0,-1},{9160,4,0,-1},{9160,5,0,-1}, +{9165,4,0,-1},{9165,5,0,-1},{9169,4,0,-1},{9169,5,0,-1},{9173,4,0,-1}, +{9173,5,0,-1},{9178,4,0,-1},{9178,5,0,-1},{9182,4,0,-1},{9182,5,0,-1}, +{9112,4,0,-1},{9186,4,0,-1},{9186,5,0,-1},{9191,4,0,-1},{9191,5,0,-1}, +{9195,4,0,-1},{9195,5,0,-1},{9125,5,0,-1},{9199,4,0,-1},{9199,5,0,-1}, +{9204,4,0,-1},{9204,5,0,-1},{9208,4,0,-1},{9208,5,0,-1},{9212,4,0,-1}, +{9212,5,0,-1},{9217,4,0,-1},{9217,5,0,-1},{9221,4,0,-1},{9221,5,0,-1}, +{9225,4,0,-1},{9225,5,0,-1},{9230,4,0,-1},{9230,5,0,-1},{9234,4,0,-1}, +{9234,5,0,-1},{9238,4,0,-1},{9238,5,0,-1},{9243,4,0,-1},{9243,5,0,-1}, +{9247,4,0,-1},{9247,5,0,-1},{9251,4,0,-1},{9251,5,0,-1},{9256,4,0,-1}, +{9256,5,0,-1},{9260,4,0,-1},{9260,5,0,-1},{9264,4,0,-1},{9264,5,0,-1}, +{9269,4,0,-1},{9269,5,0,-1},{9273,4,0,-1},{9273,5,0,-1},{9277,4,0,-1}, +{9277,5,0,-1},{9282,4,0,-1},{9282,5,0,-1},{9286,4,0,-1},{9286,5,0,-1}, +{9216,4,0,-1},{9290,4,0,-1},{9290,5,0,-1},{9295,4,0,-1},{9295,5,0,-1}, +{9299,4,0,-1},{9299,5,0,-1},{9229,5,0,-1},{9303,4,0,-1},{9303,5,0,-1}, +{9308,4,0,-1},{9308,5,0,-1},{9312,4,0,-1},{9312,5,0,-1},{9316,4,0,-1}, +{9316,5,0,-1},{9321,4,0,-1},{9321,5,0,-1},{9325,4,0,-1},{9325,5,0,-1}, +{9329,4,0,-1},{9329,5,0,-1},{9334,4,0,-1},{9334,5,0,-1},{9338,4,0,-1}, +{9338,5,0,-1},{9342,4,0,-1},{9342,5,0,-1},{9347,4,0,-1},{9347,5,0,-1}, +{9351,4,0,-1},{9351,5,0,-1},{9355,4,0,-1},{9355,5,0,-1},{9360,4,0,-1}, +{9360,5,0,-1},{9364,4,0,-1},{9364,5,0,-1},{9368,4,0,-1},{9368,5,0,-1}, +{9373,4,0,-1},{9373,5,0,-1},{9377,4,0,-1},{9377,5,0,-1},{9381,4,0,-1}, +{9381,5,0,-1},{9386,4,0,-1},{9386,5,0,-1},{9390,4,0,-1},{9390,5,0,-1}, +{9320,4,0,-1},{9394,4,0,-1},{9394,5,0,-1},{9399,4,0,-1},{9399,5,0,-1}, +{9403,4,0,-1},{9403,5,0,-1},{9333,5,0,-1},{9407,4,0,-1},{9407,5,0,-1}, +{9412,4,0,-1},{9412,5,0,-1},{9416,4,0,-1},{9416,5,0,-1},{9420,4,0,-1}, +{9420,5,0,-1},{9425,4,0,-1},{9425,5,0,-1},{9429,4,0,-1},{9429,5,0,-1}, +{9433,4,0,-1},{9433,5,0,-1},{9438,4,0,-1},{9438,5,0,-1},{9442,4,0,-1}, +{9442,5,0,-1},{9446,4,0,-1},{9446,5,0,-1},{9451,4,0,-1},{9451,5,0,-1}, +{9455,4,0,-1},{9455,5,0,-1},{9459,4,0,-1},{9459,5,0,-1},{9464,4,0,-1}, +{9464,5,0,-1},{9468,4,0,-1},{9468,5,0,-1},{9472,4,0,-1},{9472,5,0,-1}, +{9477,4,0,-1},{9477,5,0,-1},{9481,4,0,-1},{9481,5,0,-1},{9485,4,0,-1}, +{9485,5,0,-1},{9490,4,0,-1},{9490,5,0,-1},{9494,4,0,-1},{9494,5,0,-1}, +{9424,4,0,-1},{9498,4,0,-1},{9498,5,0,-1},{9503,4,0,-1},{9503,5,0,-1}, +{9507,4,0,-1},{9507,5,0,-1},{9437,5,0,-1},{9511,4,0,-1},{9511,5,0,-1}, +{9516,4,0,-1},{9516,5,0,-1},{9520,4,0,-1},{9520,5,0,-1},{9524,4,0,-1}, +{9524,5,0,-1},{9529,4,0,-1},{9529,5,0,-1},{9533,4,0,-1},{9533,5,0,-1}, +{9537,4,0,-1},{9537,5,0,-1},{9542,4,0,-1},{9542,5,0,-1},{9546,4,0,-1}, +{9546,5,0,-1},{9550,4,0,-1},{9550,5,0,-1},{9555,4,0,-1},{9555,5,0,-1}, +{9559,4,0,-1},{9559,5,0,-1},{9563,4,0,-1},{9563,5,0,-1},{9568,4,0,-1}, +{9568,5,0,-1},{9572,4,0,-1},{9572,5,0,-1},{9576,4,0,-1},{9576,5,0,-1}, +{9581,4,0,-1},{9581,5,0,-1},{9585,4,0,-1},{9585,5,0,-1},{9589,4,0,-1}, +{9589,5,0,-1},{9594,4,0,-1},{9594,5,0,-1},{9598,4,0,-1},{9598,5,0,-1}, +{9528,4,0,-1},{9602,4,0,-1},{9602,5,0,-1},{9607,4,0,-1},{9607,5,0,-1}, +{9611,4,0,-1},{9611,5,0,-1},{9541,5,0,-1},{9615,4,0,-1},{9615,5,0,-1}, +{9620,4,0,-1},{9620,5,0,-1},{9624,4,0,-1},{9624,5,0,-1},{9628,4,0,-1}, +{9628,5,0,-1},{9633,4,0,-1},{9633,5,0,-1},{9637,4,0,-1},{9637,5,0,-1}, +{9641,4,0,-1},{9641,5,0,-1},{9646,4,0,-1},{9646,5,0,-1},{9650,4,0,-1}, +{9650,5,0,-1},{9654,4,0,-1},{9654,5,0,-1},{9659,4,0,-1},{9659,5,0,-1}, +{9663,4,0,-1},{9663,5,0,-1},{9667,4,0,-1},{9667,5,0,-1},{9672,4,0,-1}, +{9672,5,0,-1},{9676,4,0,-1},{9676,5,0,-1},{9680,4,0,-1},{9680,5,0,-1}, +{9685,4,0,-1},{9689,4,0,-1},{9689,5,0,-1},{9693,4,0,-1},{9698,4,0,-1}, +{9702,4,0,-1},{9632,4,0,-1},{9706,4,0,-1},{9706,5,0,-1},{9711,4,0,-1}, +{9711,5,0,-1},{9715,4,0,-1},{9715,5,0,-1},{9645,5,0,-1},{9719,4,0,-1}, +{9719,5,0,-1},{9724,4,0,-1},{9724,5,0,-1},{9728,4,0,-1},{9728,5,0,-1}, +{9732,4,0,-1},{9737,4,0,-1},{9741,4,0,-1},{9741,5,0,-1},{9745,4,0,-1}, +{9745,5,0,-1},{9750,4,0,-1},{9754,4,0,-1},{9758,4,0,-1},{9763,4,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS6 and TS7 */ +struct fn_sample test_fn_tch_f_ts_6_7[] = { +{4753,0,1,-1},{4784,0,1,-1},{4835,0,1,-1},{4855,0,1,-1},{4886,0,1,-1}, +{4937,0,1,-1},{4957,0,1,-1},{4988,0,1,-1},{5039,0,1,-1},{5090,0,1,-1}, +{5141,0,1,-1},{5198,0,2,-1},{5208,0,2,-1},{5249,0,2,-1},{5300,0,2,-1}, +{5310,0,2,-1},{5351,0,2,-1},{5402,0,2,-1},{5453,0,2,-1},{5504,0,2,-1}, +{5555,0,2,-1},{8597,6,0,-1},{8627,6,0,-1},{8632,6,0,-1},{8636,6,0,-1}, +{8640,6,0,-1},{8645,6,0,-1},{8649,6,0,-1},{8653,6,0,-1},{8658,6,0,-1}, +{8662,6,0,-1},{8666,6,0,-1},{8671,6,0,-1},{8675,6,0,-1},{8679,6,0,-1}, +{8684,6,0,-1},{8688,6,0,-1},{8618,6,0,-1},{8692,6,0,-1},{8697,6,0,-1}, +{8701,6,0,-1},{8705,6,0,-1},{8710,6,0,-1},{8714,6,0,-1},{8718,6,0,-1}, +{8723,6,0,-1},{8727,6,0,-1},{8731,6,0,-1},{8736,6,0,-1},{8740,6,0,-1}, +{8744,6,0,-1},{8749,6,0,-1},{8753,6,0,-1},{8757,6,0,-1},{8762,6,0,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8775,6,0,-1},{8779,6,0,-1},{8783,6,0,-1}, +{8788,6,0,-1},{8792,6,0,-1},{8722,6,0,-1},{8796,6,0,-1},{8801,6,0,-1}, +{8805,6,0,-1},{8809,6,0,-1},{8814,6,0,-1},{8818,6,0,-1},{8822,6,0,-1}, +{8827,6,0,-1},{8831,6,0,-1},{8835,6,0,-1},{8840,6,0,-1},{8844,6,0,-1}, +{8848,6,0,-1},{8853,6,0,-1},{8857,6,0,-1},{8861,6,0,-1},{8866,6,0,-1}, +{8870,6,0,-1},{8874,6,0,-1},{8874,7,0,-1},{8879,6,0,-1},{8879,7,0,-1}, +{8883,6,0,-1},{8883,7,0,-1},{8887,6,0,-1},{8887,7,0,-1},{8892,6,0,-1}, +{8892,7,0,-1},{8896,6,0,-1},{8896,7,0,-1},{8826,6,0,-1},{8900,6,0,-1}, +{8900,7,0,-1},{8905,6,0,-1},{8905,7,0,-1},{8909,6,0,-1},{8909,7,0,-1}, +{8913,6,0,-1},{8913,7,0,-1},{8918,6,0,-1},{8918,7,0,-1},{8922,6,0,-1}, +{8922,7,0,-1},{8926,6,0,-1},{8926,7,0,-1},{8931,6,0,-1},{8931,7,0,-1}, +{8935,6,0,-1},{8935,7,0,-1},{8939,6,0,-1},{8939,7,0,-1},{8944,6,0,-1}, +{8944,7,0,-1},{8948,6,0,-1},{8948,7,0,-1},{8952,6,0,-1},{8952,7,0,-1}, +{8957,6,0,-1},{8957,7,0,-1},{8961,6,0,-1},{8961,7,0,-1},{8965,6,0,-1}, +{8965,7,0,-1},{8970,6,0,-1},{8970,7,0,-1},{8974,6,0,-1},{8974,7,0,-1}, +{8978,6,0,-1},{8978,7,0,-1},{8983,6,0,-1},{8983,7,0,-1},{8987,6,0,-1}, +{8987,7,0,-1},{8991,6,0,-1},{8991,7,0,-1},{8996,6,0,-1},{8996,7,0,-1}, +{9000,6,0,-1},{9000,7,0,-1},{8930,6,0,-1},{9004,6,0,-1},{9004,7,0,-1}, +{9009,6,0,-1},{9009,7,0,-1},{9013,6,0,-1},{9013,7,0,-1},{8943,7,0,-1}, +{9017,6,0,-1},{9017,7,0,-1},{9022,6,0,-1},{9022,7,0,-1},{9026,6,0,-1}, +{9026,7,0,-1},{9030,6,0,-1},{9030,7,0,-1},{9035,6,0,-1},{9035,7,0,-1}, +{9039,6,0,-1},{9039,7,0,-1},{9043,6,0,-1},{9043,7,0,-1},{9048,6,0,-1}, +{9048,7,0,-1},{9052,6,0,-1},{9052,7,0,-1},{9056,6,0,-1},{9056,7,0,-1}, +{9061,6,0,-1},{9061,7,0,-1},{9065,6,0,-1},{9065,7,0,-1},{9069,6,0,-1}, +{9069,7,0,-1},{9074,6,0,-1},{9074,7,0,-1},{9078,6,0,-1},{9078,7,0,-1}, +{9082,6,0,-1},{9082,7,0,-1},{9087,6,0,-1},{9087,7,0,-1},{9091,6,0,-1}, +{9091,7,0,-1},{9095,6,0,-1},{9095,7,0,-1},{9100,6,0,-1},{9100,7,0,-1}, +{9104,6,0,-1},{9104,7,0,-1},{9034,6,0,-1},{9108,6,0,-1},{9108,7,0,-1}, +{9113,6,0,-1},{9113,7,0,-1},{9117,6,0,-1},{9117,7,0,-1},{9047,7,0,-1}, +{9121,6,0,-1},{9121,7,0,-1},{9126,6,0,-1},{9126,7,0,-1},{9130,6,0,-1}, +{9130,7,0,-1},{9134,6,0,-1},{9134,7,0,-1},{9139,6,0,-1},{9139,7,0,-1}, +{9143,6,0,-1},{9143,7,0,-1},{9147,6,0,-1},{9147,7,0,-1},{9152,6,0,-1}, +{9152,7,0,-1},{9156,6,0,-1},{9156,7,0,-1},{9160,6,0,-1},{9160,7,0,-1}, +{9165,6,0,-1},{9165,7,0,-1},{9169,6,0,-1},{9169,7,0,-1},{9173,6,0,-1}, +{9173,7,0,-1},{9178,6,0,-1},{9178,7,0,-1},{9182,6,0,-1},{9182,7,0,-1}, +{9186,6,0,-1},{9186,7,0,-1},{9191,6,0,-1},{9191,7,0,-1},{9195,6,0,-1}, +{9195,7,0,-1},{9199,6,0,-1},{9199,7,0,-1},{9204,6,0,-1},{9204,7,0,-1}, +{9208,6,0,-1},{9208,7,0,-1},{9138,6,0,-1},{9212,6,0,-1},{9212,7,0,-1}, +{9217,6,0,-1},{9217,7,0,-1},{9221,6,0,-1},{9221,7,0,-1},{9151,7,0,-1}, +{9225,6,0,-1},{9225,7,0,-1},{9230,6,0,-1},{9230,7,0,-1},{9234,6,0,-1}, +{9234,7,0,-1},{9238,6,0,-1},{9238,7,0,-1},{9243,6,0,-1},{9243,7,0,-1}, +{9247,6,0,-1},{9247,7,0,-1},{9251,6,0,-1},{9251,7,0,-1},{9256,6,0,-1}, +{9256,7,0,-1},{9260,6,0,-1},{9260,7,0,-1},{9264,6,0,-1},{9264,7,0,-1}, +{9269,6,0,-1},{9269,7,0,-1},{9273,6,0,-1},{9273,7,0,-1},{9277,6,0,-1}, +{9277,7,0,-1},{9282,6,0,-1},{9282,7,0,-1},{9286,6,0,-1},{9286,7,0,-1}, +{9290,6,0,-1},{9290,7,0,-1},{9295,6,0,-1},{9295,7,0,-1},{9299,6,0,-1}, +{9299,7,0,-1},{9303,6,0,-1},{9303,7,0,-1},{9308,6,0,-1},{9308,7,0,-1}, +{9312,6,0,-1},{9312,7,0,-1},{9242,6,0,-1},{9316,6,0,-1},{9316,7,0,-1}, +{9321,6,0,-1},{9321,7,0,-1},{9325,6,0,-1},{9325,7,0,-1},{9255,7,0,-1}, +{9329,6,0,-1},{9329,7,0,-1},{9334,6,0,-1},{9334,7,0,-1},{9338,6,0,-1}, +{9338,7,0,-1},{9342,6,0,-1},{9342,7,0,-1},{9347,6,0,-1},{9347,7,0,-1}, +{9351,6,0,-1},{9351,7,0,-1},{9355,6,0,-1},{9355,7,0,-1},{9360,6,0,-1}, +{9360,7,0,-1},{9364,6,0,-1},{9364,7,0,-1},{9368,6,0,-1},{9368,7,0,-1}, +{9373,6,0,-1},{9373,7,0,-1},{9377,6,0,-1},{9377,7,0,-1},{9381,6,0,-1}, +{9381,7,0,-1},{9386,6,0,-1},{9386,7,0,-1},{9390,6,0,-1},{9390,7,0,-1}, +{9394,6,0,-1},{9394,7,0,-1},{9399,6,0,-1},{9399,7,0,-1},{9403,6,0,-1}, +{9403,7,0,-1},{9407,6,0,-1},{9407,7,0,-1},{9412,6,0,-1},{9412,7,0,-1}, +{9416,6,0,-1},{9416,7,0,-1},{9346,6,0,-1},{9420,6,0,-1},{9420,7,0,-1}, +{9425,6,0,-1},{9425,7,0,-1},{9429,6,0,-1},{9429,7,0,-1},{9359,7,0,-1}, +{9433,6,0,-1},{9433,7,0,-1},{9438,6,0,-1},{9438,7,0,-1},{9442,6,0,-1}, +{9442,7,0,-1},{9446,6,0,-1},{9446,7,0,-1},{9451,6,0,-1},{9451,7,0,-1}, +{9455,6,0,-1},{9455,7,0,-1},{9459,6,0,-1},{9459,7,0,-1},{9464,6,0,-1}, +{9464,7,0,-1},{9468,6,0,-1},{9468,7,0,-1},{9472,6,0,-1},{9472,7,0,-1}, +{9477,6,0,-1},{9477,7,0,-1},{9481,6,0,-1},{9481,7,0,-1},{9485,6,0,-1}, +{9485,7,0,-1},{9490,6,0,-1},{9490,7,0,-1},{9494,6,0,-1},{9494,7,0,-1}, +{9498,6,0,-1},{9498,7,0,-1},{9503,6,0,-1},{9503,7,0,-1},{9507,6,0,-1}, +{9507,7,0,-1},{9511,6,0,-1},{9511,7,0,-1},{9516,6,0,-1},{9516,7,0,-1}, +{9520,6,0,-1},{9520,7,0,-1},{9450,6,0,-1},{9524,6,0,-1},{9524,7,0,-1}, +{9529,6,0,-1},{9529,7,0,-1},{9533,6,0,-1},{9533,7,0,-1},{9463,7,0,-1}, +{9537,6,0,-1},{9537,7,0,-1},{9542,6,0,-1},{9542,7,0,-1},{9546,6,0,-1}, +{9546,7,0,-1},{9550,6,0,-1},{9550,7,0,-1},{9555,6,0,-1},{9555,7,0,-1}, +{9559,6,0,-1},{9559,7,0,-1},{9563,6,0,-1},{9563,7,0,-1},{9568,6,0,-1}, +{9568,7,0,-1},{9572,6,0,-1},{9572,7,0,-1},{9576,6,0,-1},{9576,7,0,-1}, +{9581,6,0,-1},{9581,7,0,-1},{9585,6,0,-1},{9585,7,0,-1},{9589,6,0,-1}, +{9589,7,0,-1},{9594,6,0,-1},{9594,7,0,-1},{9598,6,0,-1},{9598,7,0,-1}, +{9602,6,0,-1},{9602,7,0,-1},{9607,6,0,-1},{9607,7,0,-1},{9611,6,0,-1}, +{9611,7,0,-1},{9615,6,0,-1},{9615,7,0,-1},{9620,6,0,-1},{9620,7,0,-1}, +{9624,6,0,-1},{9624,7,0,-1},{9554,6,0,-1},{9628,6,0,-1},{9628,7,0,-1}, +{9633,6,0,-1},{9633,7,0,-1},{9637,6,0,-1},{9637,7,0,-1},{9567,7,0,-1}, +{9641,6,0,-1},{9641,7,0,-1},{9646,6,0,-1},{9646,7,0,-1},{9650,6,0,-1}, +{9650,7,0,-1},{9654,6,0,-1},{9654,7,0,-1},{9659,6,0,-1},{9659,7,0,-1}, +{9663,6,0,-1},{9663,7,0,-1},{9667,6,0,-1},{9667,7,0,-1},{9672,6,0,-1}, +{9672,7,0,-1},{9676,6,0,-1},{9676,7,0,-1},{9680,6,0,-1},{9680,7,0,-1}, +{9685,6,0,-1},{9685,7,0,-1},{9689,6,0,-1},{9689,7,0,-1},{9693,6,0,-1}, +{9693,7,0,-1},{9698,6,0,-1},{9698,7,0,-1},{9702,6,0,-1},{9702,7,0,-1}, +{9706,6,0,-1},{9706,7,0,-1},{9711,6,0,-1},{9711,7,0,-1},{9715,6,0,-1}, +{9715,7,0,-1},{9719,6,0,-1},{9719,7,0,-1},{9724,6,0,-1},{9724,7,0,-1}, +{9728,6,0,-1},{9728,7,0,-1},{9658,6,0,-1},{9732,6,0,-1},{9732,7,0,-1}, +{9737,6,0,-1},{9737,7,0,-1},{9741,6,0,-1},{9741,7,0,-1},{9671,7,0,-1}, +{9745,6,0,-1},{9745,7,0,-1},{9750,6,0,-1},{9750,7,0,-1},{9754,6,0,-1}, +{9754,7,0,-1},{9758,6,0,-1},{9758,7,0,-1},{9763,6,0,-1},{9763,7,0,-1}, +{9767,6,0,-1},{9767,7,0,-1},{9771,6,0,-1},{9771,7,0,-1},{9776,6,0,-1}, +{9776,7,0,-1},{9780,6,0,-1},{9780,7,0,-1},{9784,6,0,-1},{9784,7,0,-1}, +{9789,6,0,-1},{9789,7,0,-1},{9793,6,0,-1},{9793,7,0,-1},{9797,6,0,-1}, +{9797,7,0,-1},{9802,6,0,-1},{9802,7,0,-1},{9806,6,0,-1},{9806,7,0,-1}, +{9810,6,0,-1},{9810,7,0,-1},{9815,6,0,-1},{9815,7,0,-1},{9819,6,0,-1}, +{9819,7,0,-1},{9823,6,0,-1},{9823,7,0,-1},{9828,6,0,-1},{9828,7,0,-1}, +{9832,6,0,-1},{9832,7,0,-1},{9762,6,0,-1},{9836,6,0,-1},{9836,7,0,-1}, +{9841,6,0,-1},{9841,7,0,-1},{9845,6,0,-1},{9845,7,0,-1},{9775,7,0,-1}, +{9849,6,0,-1},{9849,7,0,-1},{9854,6,0,-1},{9854,7,0,-1},{9858,6,0,-1}, +{9858,7,0,-1},{9862,6,0,-1},{9862,7,0,-1},{9867,6,0,-1},{9867,7,0,-1}, +{9871,6,0,-1},{9871,7,0,-1},{9875,6,0,-1},{9875,7,0,-1},{9880,6,0,-1}, +{9880,7,0,-1},{9884,6,0,-1},{9884,7,0,-1},{9888,6,0,-1},{9888,7,0,-1}, +{9893,6,0,-1},{9893,7,0,-1},{9897,6,0,-1},{9897,7,0,-1},{9901,6,0,-1}, +{9901,7,0,-1},{9906,6,0,-1},{9906,7,0,-1},{9910,6,0,-1},{9910,7,0,-1}, +{9914,6,0,-1},{9914,7,0,-1},{9919,6,0,-1},{9919,7,0,-1},{9923,6,0,-1}, +{9923,7,0,-1},{9927,6,0,-1},{9927,7,0,-1},{9932,6,0,-1},{9932,7,0,-1}, +{9936,6,0,-1},{9936,7,0,-1},{9866,6,0,-1},{9940,6,0,-1},{9940,7,0,-1}, +{9945,6,0,-1},{9945,7,0,-1},{9949,6,0,-1},{9949,7,0,-1},{9879,7,0,-1}, +{9953,6,0,-1},{9953,7,0,-1},{9958,6,0,-1},{9958,7,0,-1},{9962,6,0,-1}, +{9962,7,0,-1},{9966,6,0,-1},{9966,7,0,-1},{9971,6,0,-1},{9971,7,0,-1}, +{9975,6,0,-1},{9975,7,0,-1},{9979,6,0,-1},{9979,7,0,-1},{9984,6,0,-1}, +{9984,7,0,-1},{9988,6,0,-1},{9988,7,0,-1},{9992,6,0,-1},{9992,7,0,-1}, +{9997,6,0,-1},{9997,7,0,-1},{10001,6,0,-1},{10001,7,0,-1},{10005,6,0,-1}, +{10005,7,0,-1},{10010,6,0,-1},{10010,7,0,-1},{10014,6,0,-1},{10014,7,0,-1}, +{10018,6,0,-1},{10018,7,0,-1},{10023,6,0,-1},{10023,7,0,-1},{10027,6,0,-1}, +{10027,7,0,-1},{10031,6,0,-1},{10031,7,0,-1},{10036,6,0,-1},{10036,7,0,-1}, +{10040,6,0,-1},{10040,7,0,-1},{9970,6,0,-1},{10044,6,0,-1},{10044,7,0,-1}, +{10049,6,0,-1},{10049,7,0,-1},{10053,6,0,-1},{10053,7,0,-1},{9983,7,0,-1}, +{10057,6,0,-1},{10057,7,0,-1},{10062,6,0,-1},{10062,7,0,-1},{10066,6,0,-1}, +{10066,7,0,-1},{10070,6,0,-1},{10070,7,0,-1},{10075,6,0,-1},{10075,7,0,-1}, +{10079,6,0,-1},{10079,7,0,-1},{10083,6,0,-1},{10083,7,0,-1},{10088,6,0,-1}, +{10088,7,0,-1},{10092,6,0,-1},{10092,7,0,-1},{10096,6,0,-1},{10096,7,0,-1}, +{10101,6,0,-1},{10101,7,0,-1},{10105,6,0,-1},{10105,7,0,-1},{10109,6,0,-1}, +{10109,7,0,-1},{10114,6,0,-1},{10114,7,0,-1},{10118,6,0,-1},{10118,7,0,-1}, +{10122,6,0,-1},{10122,7,0,-1},{10127,6,0,-1},{10127,7,0,-1},{10131,6,0,-1}, +{10131,7,0,-1},{10135,6,0,-1},{10135,7,0,-1},{10140,6,0,-1},{10140,7,0,-1}, +{10144,6,0,-1},{10144,7,0,-1},{10074,6,0,-1},{10148,6,0,-1},{10148,7,0,-1}, +{10153,6,0,-1},{10153,7,0,-1},{10157,6,0,-1},{10157,7,0,-1},{10087,7,0,-1}, +{10161,6,0,-1},{10161,7,0,-1},{10166,6,0,-1},{10166,7,0,-1},{10170,6,0,-1}, +{10170,7,0,-1},{10174,6,0,-1},{10174,7,0,-1},{10179,6,0,-1},{10179,7,0,-1}, +{10183,6,0,-1},{10183,7,0,-1},{10187,6,0,-1},{10187,7,0,-1},{10192,6,0,-1}, +{10192,7,0,-1},{10196,6,0,-1},{10196,7,0,-1},{10200,6,0,-1},{10200,7,0,-1}, +{10205,6,0,-1},{10205,7,0,-1},{10209,6,0,-1},{10209,7,0,-1},{10213,6,0,-1}, +{10213,7,0,-1},{10218,6,0,-1},{10218,7,0,-1},{10222,6,0,-1},{10222,7,0,-1}, +{10226,6,0,-1},{10226,7,0,-1},{10231,6,0,-1},{10231,7,0,-1},{10235,6,0,-1}, +{10235,7,0,-1},{10239,6,0,-1},{10239,7,0,-1},{10244,6,0,-1},{10244,7,0,-1}, +{10248,6,0,-1},{10248,7,0,-1},{10178,6,0,-1},{10252,6,0,-1},{10252,7,0,-1}, +{10257,6,0,-1},{10257,7,0,-1},{10261,6,0,-1},{10261,7,0,-1},{10191,7,0,-1}, +{10265,6,0,-1},{10265,7,0,-1},{10270,6,0,-1},{10270,7,0,-1},{10274,6,0,-1}, +{10274,7,0,-1},{10278,6,0,-1},{10278,7,0,-1},{10283,6,0,-1},{10283,7,0,-1}, +{10287,6,0,-1},{10287,7,0,-1},{10291,6,0,-1},{10291,7,0,-1},{10296,6,0,-1}, +{10296,7,0,-1},{10300,6,0,-1},{10300,7,0,-1},{10304,6,0,-1},{10304,7,0,-1}, +{10309,6,0,-1},{10309,7,0,-1},{10313,6,0,-1},{10313,7,0,-1},{10317,6,0,-1}, +{10317,7,0,-1},{10322,6,0,-1},{10322,7,0,-1},{10326,6,0,-1},{10326,7,0,-1}, +{10330,6,0,-1},{10330,7,0,-1},{10335,6,0,-1},{10335,7,0,-1},{10339,6,0,-1}, +{10339,7,0,-1},{10343,6,0,-1},{10343,7,0,-1},{10348,6,0,-1},{10348,7,0,-1}, +{10352,6,0,-1},{10352,7,0,-1},{10282,6,0,-1},{10356,6,0,-1},{10356,7,0,-1}, +{10361,6,0,-1},{10361,7,0,-1},{10365,6,0,-1},{10365,7,0,-1},{10295,7,0,-1}, +{10369,6,0,-1},{10369,7,0,-1},{10374,6,0,-1},{10374,7,0,-1},{10378,6,0,-1}, +{10378,7,0,-1},{10382,6,0,-1},{10382,7,0,-1},{10387,6,0,-1},{10387,7,0,-1}, +{10391,6,0,-1},{10391,7,0,-1},{10395,6,0,-1},{10395,7,0,-1},{10400,6,0,-1}, +{10400,7,0,-1},{10404,6,0,-1},{10404,7,0,-1},{10408,6,0,-1},{10408,7,0,-1}, +{10413,6,0,-1},{10413,7,0,-1},{10417,6,0,-1},{10417,7,0,-1},{10421,6,0,-1}, +{10421,7,0,-1},{10426,6,0,-1},{10426,7,0,-1},{10430,6,0,-1},{10430,7,0,-1}, +{10434,6,0,-1},{10434,7,0,-1},{10439,6,0,-1},{10439,7,0,-1},{10443,6,0,-1}, +{10443,7,0,-1},{10447,6,0,-1},{10447,7,0,-1},{10452,6,0,-1},{10452,7,0,-1}, +{10456,6,0,-1},{10456,7,0,-1},{10386,6,0,-1},{10460,6,0,-1},{10460,7,0,-1}, +{10465,6,0,-1},{10465,7,0,-1},{10469,6,0,-1},{10469,7,0,-1},{10399,7,0,-1}, +{10473,6,0,-1},{10473,7,0,-1},{10478,6,0,-1},{10478,7,0,-1},{10482,6,0,-1}, +{10482,7,0,-1},{10486,6,0,-1},{10486,7,0,-1},{10491,6,0,-1},{10491,7,0,-1}, +{10495,6,0,-1},{10495,7,0,-1},{10499,6,0,-1},{10499,7,0,-1},{10504,6,0,-1}, +{10504,7,0,-1},{10508,6,0,-1},{10508,7,0,-1},{10512,6,0,-1},{10512,7,0,-1}, +{10517,6,0,-1},{10517,7,0,-1},{10521,6,0,-1},{10521,7,0,-1},{10525,6,0,-1}, +{10525,7,0,-1},{10530,6,0,-1},{10530,7,0,-1},{10534,6,0,-1},{10534,7,0,-1}, +{10538,6,0,-1},{10538,7,0,-1},{10543,6,0,-1},{10543,7,0,-1},{10547,6,0,-1}, +{10547,7,0,-1},{10551,6,0,-1},{10551,7,0,-1},{10556,6,0,-1},{10556,7,0,-1}, +{10560,6,0,-1},{10560,7,0,-1},{10490,6,0,-1},{10564,6,0,-1},{10564,7,0,-1}, +{10569,6,0,-1},{10569,7,0,-1},{10573,6,0,-1},{10573,7,0,-1},{10503,7,0,-1}, +{10577,6,0,-1},{10577,7,0,-1},{10582,6,0,-1},{10582,7,0,-1},{10586,6,0,-1}, +{10586,7,0,-1},{10590,6,0,-1},{10590,7,0,-1},{10595,6,0,-1},{10595,7,0,-1}, +{10599,6,0,-1},{10599,7,0,-1},{10603,6,0,-1},{10603,7,0,-1},{10608,6,0,-1}, +{10608,7,0,-1},{10612,6,0,-1},{10612,7,0,-1},{10616,6,0,-1},{10616,7,0,-1}, +{10621,6,0,-1},{10621,7,0,-1},{10625,6,0,-1},{10625,7,0,-1},{10629,6,0,-1}, +{10629,7,0,-1},{10634,6,0,-1},{10634,7,0,-1},{10638,6,0,-1},{10638,7,0,-1}, +{10642,6,0,-1},{10642,7,0,-1},{10647,6,0,-1},{10647,7,0,-1},{10651,6,0,-1}, +{10651,7,0,-1},{10655,6,0,-1},{10655,7,0,-1},{10660,6,0,-1},{10660,7,0,-1}, +{10664,6,0,-1},{10664,7,0,-1},{10594,6,0,-1},{10668,6,0,-1},{10668,7,0,-1}, +{10673,6,0,-1},{10673,7,0,-1},{10677,6,0,-1},{10677,7,0,-1},{10607,7,0,-1}, +{10681,6,0,-1},{10681,7,0,-1},{10686,6,0,-1},{10686,7,0,-1},{10690,6,0,-1}, +{10690,7,0,-1},{10694,6,0,-1},{10694,7,0,-1},{10699,6,0,-1},{10699,7,0,-1}, +{10703,6,0,-1},{10703,7,0,-1},{10707,6,0,-1},{10707,7,0,-1},{10712,6,0,-1}, +{10712,7,0,-1},{10716,6,0,-1},{10716,7,0,-1},{10720,6,0,-1},{10720,7,0,-1}, +{10725,6,0,-1},{10725,7,0,-1},{10729,6,0,-1},{10729,7,0,-1},{10733,6,0,-1}, +{10733,7,0,-1},{10738,6,0,-1},{10738,7,0,-1},{10742,6,0,-1},{10742,7,0,-1}, +{10746,6,0,-1},{10746,7,0,-1},{10751,6,0,-1},{10751,7,0,-1},{10755,6,0,-1}, +{10755,7,0,-1},{10759,6,0,-1},{10759,7,0,-1},{10764,6,0,-1},{10764,7,0,-1}, +{10768,6,0,-1},{10768,7,0,-1},{10698,6,0,-1},{10772,6,0,-1},{10772,7,0,-1}, +{10777,6,0,-1},{10777,7,0,-1},{10781,6,0,-1},{10781,7,0,-1},{10711,7,0,-1}, +{10785,6,0,-1},{10785,7,0,-1},{10790,6,0,-1},{10790,7,0,-1},{10794,6,0,-1}, +{10794,7,0,-1},{10798,6,0,-1},{10798,7,0,-1},{10803,6,0,-1},{10803,7,0,-1}, +{10807,6,0,-1},{10807,7,0,-1},{10811,6,0,-1},{10811,7,0,-1},{10816,6,0,-1}, +{10816,7,0,-1},{10820,6,0,-1},{10820,7,0,-1},{10824,6,0,-1},{10824,7,0,-1}, +{10829,6,0,-1},{10829,7,0,-1},{10833,6,0,-1},{10833,7,0,-1},{10837,6,0,-1}, +{10837,7,0,-1},{10842,6,0,-1},{10842,7,0,-1},{10846,6,0,-1},{10846,7,0,-1}, +{10850,6,0,-1},{10850,7,0,-1},{10855,6,0,-1},{10855,7,0,-1},{10859,6,0,-1}, +{10859,7,0,-1},{10863,6,0,-1},{10863,7,0,-1},{10868,6,0,-1},{10868,7,0,-1}, +{10872,6,0,-1},{10872,7,0,-1},{10802,6,0,-1},{10876,6,0,-1},{10876,7,0,-1}, +{10881,6,0,-1},{10881,7,0,-1},{10885,6,0,-1},{10885,7,0,-1},{10815,7,0,-1}, +{10889,6,0,-1},{10889,7,0,-1},{10894,6,0,-1},{10894,7,0,-1},{10898,6,0,-1}, +{10898,7,0,-1},{10902,6,0,-1},{10902,7,0,-1},{10907,6,0,-1},{10907,7,0,-1}, +{10911,6,0,-1},{10911,7,0,-1},{10915,6,0,-1},{10915,7,0,-1},{10920,6,0,-1}, +{10920,7,0,-1},{10924,6,0,-1},{10924,7,0,-1},{10928,6,0,-1},{10928,7,0,-1}, +{10933,6,0,-1},{10933,7,0,-1},{10937,6,0,-1},{10937,7,0,-1},{10941,6,0,-1}, +{10941,7,0,-1},{10946,6,0,-1},{10946,7,0,-1},{10950,6,0,-1},{10950,7,0,-1}, +{10954,6,0,-1},{10954,7,0,-1},{10959,6,0,-1},{10959,7,0,-1},{10963,6,0,-1}, +{10963,7,0,-1},{10967,6,0,-1},{10967,7,0,-1},{10972,6,0,-1},{10972,7,0,-1}, +{10976,6,0,-1},{10976,7,0,-1},{10906,6,0,-1},{10980,6,0,-1},{10980,7,0,-1}, +{10985,6,0,-1},{10985,7,0,-1},{10989,6,0,-1},{10989,7,0,-1},{10919,7,0,-1}, +{10993,6,0,-1},{10993,7,0,-1},{10998,6,0,-1},{10998,7,0,-1},{11002,6,0,-1}, +{11002,7,0,-1},{11006,6,0,-1},{11006,7,0,-1},{11011,6,0,-1},{11011,7,0,-1}, +{11015,6,0,-1},{11015,7,0,-1},{11019,6,0,-1},{11019,7,0,-1},{11024,6,0,-1}, +{11024,7,0,-1},{11028,6,0,-1},{11028,7,0,-1},{11032,6,0,-1},{11032,7,0,-1}, +{11037,6,0,-1},{11037,7,0,-1},{11041,6,0,-1},{11041,7,0,-1},{11045,6,0,-1}, +{11045,7,0,-1},{11050,6,0,-1},{11050,7,0,-1},{11054,6,0,-1},{11054,7,0,-1}, +{11058,6,0,-1},{11058,7,0,-1},{11063,6,0,-1},{11063,7,0,-1},{11067,6,0,-1}, +{11067,7,0,-1},{11071,6,0,-1},{11071,7,0,-1},{11076,6,0,-1},{11076,7,0,-1}, +{11080,6,0,-1},{11080,7,0,-1},{11010,6,0,-1},{11084,6,0,-1},{11084,7,0,-1}, +{11089,6,0,-1},{11089,7,0,-1},{11093,6,0,-1},{11093,7,0,-1},{11023,7,0,-1}, +{11097,6,0,-1},{11097,7,0,-1},{11102,6,0,-1},{11102,7,0,-1},{11106,6,0,-1}, +{11106,7,0,-1},{11110,6,0,-1},{11110,7,0,-1},{11115,6,0,-1},{11115,7,0,-1}, +{11119,6,0,-1},{11119,7,0,-1},{11123,6,0,-1},{11123,7,0,-1},{11128,6,0,-1}, +{11128,7,0,-1},{11132,6,0,-1},{11132,7,0,-1},{11136,6,0,-1},{11136,7,0,-1}, +{11141,6,0,-1},{11141,7,0,-1},{11145,6,0,-1},{11145,7,0,-1},{11149,6,0,-1}, +{11149,7,0,-1},{11154,6,0,-1},{11154,7,0,-1},{11158,6,0,-1},{11158,7,0,-1}, +{11162,6,0,-1},{11162,7,0,-1},{11167,6,0,-1},{11167,7,0,-1},{11171,6,0,-1}, +{11171,7,0,-1},{11175,6,0,-1},{11175,7,0,-1},{11180,6,0,-1},{11180,7,0,-1}, +{11184,6,0,-1},{11184,7,0,-1},{11114,6,0,-1},{11188,6,0,-1},{11188,7,0,-1}, +{11193,6,0,-1},{11193,7,0,-1},{11197,6,0,-1},{11197,7,0,-1},{11127,7,0,-1}, +{11201,6,0,-1},{11201,7,0,-1},{11206,6,0,-1},{11206,7,0,-1},{11210,6,0,-1}, +{11210,7,0,-1},{11214,6,0,-1},{11214,7,0,-1},{11219,6,0,-1},{11219,7,0,-1}, +{11223,6,0,-1},{11223,7,0,-1},{11227,6,0,-1},{11227,7,0,-1},{11232,6,0,-1}, +{11232,7,0,-1},{11236,6,0,-1},{11236,7,0,-1},{11240,6,0,-1},{11240,7,0,-1}, +{11245,6,0,-1},{11245,7,0,-1},{11249,6,0,-1},{11249,7,0,-1},{11253,6,0,-1}, +{11253,7,0,-1},{11258,6,0,-1},{11258,7,0,-1},{11262,6,0,-1},{11262,7,0,-1}, +{11266,6,0,-1},{11266,7,0,-1},{11271,6,0,-1},{11271,7,0,-1},{11275,6,0,-1}, +{11275,7,0,-1},{11279,6,0,-1},{11279,7,0,-1},{11284,6,0,-1},{11284,7,0,-1}, +{11288,6,0,-1},{11288,7,0,-1},{11218,6,0,-1},{11292,6,0,-1},{11292,7,0,-1}, +{11297,6,0,-1},{11297,7,0,-1},{11301,6,0,-1},{11301,7,0,-1},{11231,7,0,-1}, +{11305,6,0,-1},{11305,7,0,-1},{11310,6,0,-1},{11310,7,0,-1},{11314,6,0,-1}, +{11314,7,0,-1},{11318,6,0,-1},{11318,7,0,-1},{11323,6,0,-1},{11323,7,0,-1}, +{11327,6,0,-1},{11327,7,0,-1},{11331,6,0,-1},{11331,7,0,-1},{11336,6,0,-1}, +{11336,7,0,-1},{11340,6,0,-1},{11340,7,0,-1},{11344,6,0,-1},{11344,7,0,-1}, +{11349,6,0,-1},{11349,7,0,-1},{11353,6,0,-1},{11353,7,0,-1},{11357,6,0,-1}, +{11357,7,0,-1},{11362,6,0,-1},{11362,7,0,-1},{11366,6,0,-1},{11366,7,0,-1}, +{11370,6,0,-1},{11370,7,0,-1},{11375,6,0,-1},{11375,7,0,-1},{11379,6,0,-1}, +{11379,7,0,-1},{11383,6,0,-1},{11383,7,0,-1},{11388,6,0,-1},{11388,7,0,-1}, +{11392,6,0,-1},{11392,7,0,-1},{11322,6,0,-1},{11396,6,0,-1},{11396,7,0,-1}, +{11401,6,0,-1},{11401,7,0,-1},{11405,6,0,-1},{11405,7,0,-1},{11335,7,0,-1}, +{11409,6,0,-1},{11409,7,0,-1},{11414,6,0,-1},{11414,7,0,-1},{11418,6,0,-1}, +{11418,7,0,-1},{11422,6,0,-1},{11422,7,0,-1},{11427,6,0,-1},{11427,7,0,-1}, +{11431,6,0,-1},{11431,7,0,-1},{11435,6,0,-1},{11435,7,0,-1},{11440,6,0,-1}, +{11440,7,0,-1},{11444,6,0,-1},{11444,7,0,-1},{11448,6,0,-1},{11448,7,0,-1}, +{11453,6,0,-1},{11453,7,0,-1},{11457,6,0,-1},{11457,7,0,-1},{11461,6,0,-1}, +{11461,7,0,-1},{11466,6,0,-1},{11466,7,0,-1},{11470,6,0,-1},{11470,7,0,-1}, +{11474,6,0,-1},{11474,7,0,-1},{11479,6,0,-1},{11479,7,0,-1},{11483,6,0,-1}, +{11483,7,0,-1},{11487,6,0,-1},{11487,7,0,-1},{11492,6,0,-1},{11492,7,0,-1}, +{11496,6,0,-1},{11496,7,0,-1},{11426,6,0,-1},{11500,6,0,-1},{11500,7,0,-1}, +{11505,6,0,-1},{11505,7,0,-1},{11509,6,0,-1},{11509,7,0,-1},{11439,7,0,-1}, +{11513,6,0,-1},{11513,7,0,-1},{11518,6,0,-1},{11518,7,0,-1},{11522,6,0,-1}, +{11522,7,0,-1},{11526,6,0,-1},{11526,7,0,-1},{11531,6,0,-1},{11531,7,0,-1}, +{11535,6,0,-1},{11535,7,0,-1},{11539,6,0,-1},{11539,7,0,-1},{11544,6,0,-1}, +{11544,7,0,-1},{11548,6,0,-1},{11548,7,0,-1},{11552,6,0,-1},{11552,7,0,-1}, +{11557,6,0,-1},{11557,7,0,-1},{11561,6,0,-1},{11561,7,0,-1},{11565,6,0,-1}, +{11565,7,0,-1},{11570,6,0,-1},{11570,7,0,-1},{11574,6,0,-1},{11574,7,0,-1}, +{11578,6,0,-1},{11578,7,0,-1},{11583,6,0,-1},{11583,7,0,-1},{11587,6,0,-1}, +{11587,7,0,-1},{11591,6,0,-1},{11591,7,0,-1},{11596,6,0,-1},{11596,7,0,-1}, +{11600,6,0,-1},{11600,7,0,-1},{11530,6,0,-1},{11604,6,0,-1},{11604,7,0,-1}, +{11609,6,0,-1},{11609,7,0,-1},{11613,6,0,-1},{11613,7,0,-1},{11543,7,0,-1}, +{11617,6,0,-1},{11617,7,0,-1},{11622,6,0,-1},{11622,7,0,-1},{11626,6,0,-1}, +{11626,7,0,-1},{11630,6,0,-1},{11630,7,0,-1},{11635,6,0,-1},{11635,7,0,-1}, +{11639,6,0,-1},{11639,7,0,-1},{11643,6,0,-1},{11643,7,0,-1},{11648,6,0,-1}, +{11648,7,0,-1},{11652,6,0,-1},{11652,7,0,-1},{11656,6,0,-1},{11656,7,0,-1}, +{11661,6,0,-1},{11661,7,0,-1},{11665,6,0,-1},{11665,7,0,-1},{11669,6,0,-1}, +{11669,7,0,-1},{11674,6,0,-1},{11674,7,0,-1},{11678,6,0,-1},{11678,7,0,-1}, +{11682,6,0,-1},{11682,7,0,-1},{11687,6,0,-1},{11687,7,0,-1},{11691,6,0,-1}, +{11691,7,0,-1},{11695,6,0,-1},{11695,7,0,-1},{11700,6,0,-1},{11700,7,0,-1}, +{11704,6,0,-1},{11704,7,0,-1},{11634,6,0,-1},{11708,6,0,-1},{11708,7,0,-1}, +{11713,6,0,-1},{11713,7,0,-1},{11717,6,0,-1},{11717,7,0,-1},{11647,7,0,-1}, +{11721,6,0,-1},{11721,7,0,-1},{11726,6,0,-1},{11726,7,0,-1},{11730,6,0,-1}, +{11730,7,0,-1},{11734,6,0,-1},{11734,7,0,-1},{11739,6,0,-1},{11739,7,0,-1}, +{11743,6,0,-1},{11743,7,0,-1},{11747,6,0,-1},{11747,7,0,-1},{11752,6,0,-1}, +{11752,7,0,-1},{11756,6,0,-1},{11756,7,0,-1},{11760,6,0,-1},{11760,7,0,-1}, +{11765,6,0,-1},{11765,7,0,-1},{11769,6,0,-1},{11769,7,0,-1},{11773,6,0,-1}, +{11773,7,0,-1},{11778,6,0,-1},{11778,7,0,-1},{11782,6,0,-1},{11782,7,0,-1}, +{11786,6,0,-1},{11786,7,0,-1},{11791,6,0,-1},{11791,7,0,-1},{11795,6,0,-1}, +{11795,7,0,-1},{11799,6,0,-1},{11799,7,0,-1},{11804,6,0,-1},{11804,7,0,-1}, +{11808,6,0,-1},{11808,7,0,-1},{11738,6,0,-1},{11812,6,0,-1},{11812,7,0,-1}, +{11817,6,0,-1},{11817,7,0,-1},{11821,6,0,-1},{11821,7,0,-1},{11751,7,0,-1}, +{11825,6,0,-1},{11825,7,0,-1},{11830,6,0,-1},{11830,7,0,-1},{11834,6,0,-1}, +{11834,7,0,-1},{11838,6,0,-1},{11838,7,0,-1},{11843,6,0,-1},{11843,7,0,-1}, +{11847,6,0,-1},{11847,7,0,-1},{11851,6,0,-1},{11851,7,0,-1},{11856,6,0,-1}, +{11856,7,0,-1},{11860,6,0,-1},{11860,7,0,-1},{11864,6,0,-1},{11864,7,0,-1}, +{11869,6,0,-1},{11869,7,0,-1},{11873,6,0,-1},{11873,7,0,-1},{11877,6,0,-1}, +{11877,7,0,-1},{11882,6,0,-1},{11882,7,0,-1},{11886,6,0,-1},{11886,7,0,-1}, +{11890,6,0,-1},{11890,7,0,-1},{11895,6,0,-1},{11895,7,0,-1},{11899,6,0,-1}, +{11899,7,0,-1},{11903,6,0,-1},{11903,7,0,-1},{11908,6,0,-1},{11908,7,0,-1}, +{11912,6,0,-1},{11912,7,0,-1},{11842,6,0,-1},{11916,6,0,-1},{11916,7,0,-1}, +{11921,6,0,-1},{11921,7,0,-1},{11925,6,0,-1},{11925,7,0,-1},{11855,7,0,-1}, +{11929,6,0,-1},{11929,7,0,-1},{11934,6,0,-1},{11934,7,0,-1},{11938,6,0,-1}, +{11938,7,0,-1},{11942,6,0,-1},{11942,7,0,-1},{11947,6,0,-1},{11947,7,0,-1}, +{11951,6,0,-1},{11951,7,0,-1},{11955,6,0,-1},{11955,7,0,-1},{11960,6,0,-1}, +{11960,7,0,-1},{11964,6,0,-1},{11964,7,0,-1},{11968,6,0,-1},{11968,7,0,-1}, +{11973,6,0,-1},{11973,7,0,-1},{11977,6,0,-1},{11977,7,0,-1},{11981,6,0,-1}, +{11981,7,0,-1},{11986,6,0,-1},{11986,7,0,-1},{11990,6,0,-1},{11990,7,0,-1}, +{11994,6,0,-1},{11994,7,0,-1},{11999,6,0,-1},{11999,7,0,-1},{12003,6,0,-1}, +{12003,7,0,-1},{12007,6,0,-1},{12007,7,0,-1},{12012,6,0,-1},{12012,7,0,-1}, +{12016,6,0,-1},{12016,7,0,-1},{11946,6,0,-1},{12020,6,0,-1},{12020,7,0,-1}, +{12025,6,0,-1},{12025,7,0,-1},{12029,6,0,-1},{12029,7,0,-1},{11959,7,0,-1}, +{12033,6,0,-1},{12033,7,0,-1},{12038,6,0,-1},{12038,7,0,-1},{12042,6,0,-1}, +{12042,7,0,-1},{12046,6,0,-1},{12046,7,0,-1},{12051,6,0,-1},{12051,7,0,-1}, +{12055,6,0,-1},{12055,7,0,-1},{12059,6,0,-1},{12059,7,0,-1},{12064,6,0,-1}, +{12064,7,0,-1},{12068,6,0,-1},{12068,7,0,-1},{12072,6,0,-1},{12072,7,0,-1}, +{12077,6,0,-1},{12077,7,0,-1},{12081,6,0,-1},{12081,7,0,-1},{12085,6,0,-1}, +{12085,7,0,-1},{12090,6,0,-1},{12090,7,0,-1},{12094,6,0,-1},{12094,7,0,-1}, +{12098,6,0,-1},{12098,7,0,-1},{12103,6,0,-1},{12103,7,0,-1},{12107,6,0,-1}, +{12107,7,0,-1},{12111,6,0,-1},{12111,7,0,-1},{12116,6,0,-1},{12116,7,0,-1}, +{12120,6,0,-1},{12120,7,0,-1},{12050,6,0,-1},{12124,6,0,-1},{12124,7,0,-1}, +{12129,6,0,-1},{12129,7,0,-1},{12133,6,0,-1},{12133,7,0,-1},{12063,7,0,-1}, +{12137,6,0,-1},{12137,7,0,-1},{12142,6,0,-1},{12142,7,0,-1},{12146,6,0,-1}, +{12146,7,0,-1},{12150,6,0,-1},{12150,7,0,-1},{12155,6,0,-1},{12155,7,0,-1}, +{12159,6,0,-1},{12159,7,0,-1},{12163,6,0,-1},{12163,7,0,-1},{12168,6,0,-1}, +{12168,7,0,-1},{12172,6,0,-1},{12172,7,0,-1},{12176,6,0,-1},{12176,7,0,-1}, +{12181,6,0,-1},{12181,7,0,-1},{12185,6,0,-1},{12185,7,0,-1},{12189,6,0,-1}, +{12189,7,0,-1},{12194,6,0,-1},{12194,7,0,-1},{12198,6,0,-1},{12198,7,0,-1}, +{12202,6,0,-1},{12202,7,0,-1},{12207,6,0,-1},{12207,7,0,-1},{12211,6,0,-1}, +{12211,7,0,-1},{12215,6,0,-1},{12215,7,0,-1},{12220,6,0,-1},{12220,7,0,-1}, +{12224,6,0,-1},{12224,7,0,-1},{12154,6,0,-1},{12228,6,0,-1},{12228,7,0,-1}, +{12233,6,0,-1},{12233,7,0,-1},{12237,6,0,-1},{12237,7,0,-1},{12167,7,0,-1}, +{12241,6,0,-1},{12241,7,0,-1},{12246,6,0,-1},{12246,7,0,-1},{12250,7,0,-1}, +{12254,7,0,-1},{12259,6,0,-1},{12259,7,0,-1},{12263,7,0,-1},{12267,7,0,-1}, +{12272,6,0,-1},{12272,7,0,-1},{12276,6,0,-1},{12276,7,0,-1},{12280,6,0,-1}, +{12280,7,0,-1},{12285,6,0,-1},{12285,7,0,-1},{12289,7,0,-1},{12293,7,0,-1}, +{12298,7,0,-1},{12302,7,0,-1},{12306,6,0,-1},{12306,7,0,-1},{12311,6,0,-1}, +{12311,7,0,-1},{12315,7,0,-1},{12319,7,0,-1},{12324,7,0,-1},{12328,7,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS2, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_2_ss0_ss1[] = { +{8252,0,1,-1},{8987,2,0,-1},{8996,2,0,-1},{9004,2,0,-1},{9013,2,0,-1}, +{9022,2,0,-1},{9030,2,0,-1},{9039,2,0,-1},{9043,2,0,-1},{9048,2,0,-1}, +{8982,2,0,-1},{9056,2,0,-1},{9065,2,0,-1},{9074,2,0,-1},{9082,2,0,-1}, +{9091,2,0,-1},{9100,2,0,-1},{9108,2,0,-1},{9117,2,0,-1},{9126,2,0,-1}, +{9134,2,0,-1},{9143,2,0,-1},{9152,2,0,-1},{9086,2,0,-1},{9160,2,0,-1}, +{9169,2,0,-1},{9173,2,0,-1},{9178,2,0,-1},{9182,2,0,-1},{9186,2,0,-1}, +{9191,2,0,-1},{9195,2,0,-1},{9199,2,0,-1},{9204,2,0,-1},{9208,2,0,-1}, +{9212,2,0,-1},{9217,2,0,-1},{9221,2,0,-1},{9225,2,0,-1},{9230,2,0,-1}, +{9234,2,0,-1},{9238,2,0,-1},{9243,2,0,-1},{9247,2,0,-1},{9251,2,0,-1}, +{9256,2,0,-1},{9190,2,0,-1},{9260,2,0,-1},{9264,2,0,-1},{9269,2,0,-1}, +{9273,2,0,-1},{9277,2,0,-1},{9282,2,0,-1},{9286,2,0,-1},{9290,2,0,-1}, +{9295,2,0,-1},{9299,2,0,-1},{9303,2,0,-1},{9308,2,0,-1},{9312,2,0,-1}, +{9316,2,0,-1},{9321,2,0,-1},{9325,2,0,-1},{9329,2,0,-1},{9334,2,0,-1}, +{9338,2,0,-1},{9342,2,0,-1},{9347,2,0,-1},{9351,2,0,-1},{9355,2,0,-1}, +{9360,2,0,-1},{9294,2,0,-1},{9364,2,0,-1},{9368,2,0,-1},{9369,2,1,-1}, +{9373,2,0,-1},{9377,2,0,-1},{9381,2,0,-1},{9382,2,1,-1},{9386,2,0,-1}, +{9390,2,0,-1},{9391,2,1,-1},{9394,2,0,-1},{9395,2,1,-1},{9399,2,0,-1}, +{9403,2,0,-1},{9404,2,1,-1},{9407,2,0,-1},{9412,2,0,-1},{9413,2,1,-1}, +{9416,2,0,-1},{9420,2,0,-1},{9421,2,1,-1},{9425,2,0,-1},{9429,2,0,-1}, +{9430,2,1,-1},{9433,2,0,-1},{9438,2,0,-1},{9439,2,1,-1},{9442,2,0,-1}, +{9446,2,0,-1},{9447,2,1,-1},{9451,2,0,-1},{9455,2,0,-1},{9456,2,1,-1}, +{9459,2,0,-1},{9464,2,0,-1},{9465,2,1,-1},{9398,2,0,-1},{9468,2,0,-1}, +{9472,2,0,-1},{9473,2,1,-1},{9477,2,0,-1},{9411,2,1,-1},{9481,2,0,-1}, +{9482,2,1,-1},{9485,2,0,-1},{9490,2,0,-1},{9491,2,1,-1},{9494,2,0,-1}, +{9498,2,0,-1},{9499,2,1,-1},{9503,2,0,-1},{9504,2,1,-1},{9507,2,0,-1}, +{9508,2,1,-1},{9511,2,0,-1},{9512,2,1,-1},{9516,2,0,-1},{9517,2,1,-1}, +{9520,2,0,-1},{9521,2,1,-1},{9524,2,0,-1},{9525,2,1,-1},{9529,2,0,-1}, +{9533,2,0,-1},{9534,2,1,-1},{9537,2,0,-1},{9538,2,1,-1},{9542,2,0,-1}, +{9543,2,1,-1},{9546,2,0,-1},{9547,2,1,-1},{9550,2,0,-1},{9551,2,1,-1}, +{9555,2,0,-1},{9556,2,1,-1},{9559,2,0,-1},{9560,2,1,-1},{9563,2,0,-1}, +{9564,2,1,-1},{9568,2,0,-1},{9569,2,1,-1},{9502,2,0,-1},{9573,2,1,-1}, +{9576,2,0,-1},{9577,2,1,-1},{9581,2,0,-1},{9582,2,1,-1},{9515,2,1,-1}, +{9585,2,0,-1},{9586,2,1,-1},{9589,2,0,-1},{9590,2,1,-1},{9594,2,0,-1}, +{9595,2,1,-1},{9598,2,0,-1},{9599,2,1,-1},{9602,2,0,-1},{9603,2,1,-1}, +{9607,2,0,-1},{9608,2,1,-1},{9611,2,0,-1},{9612,2,1,-1},{9615,2,0,-1}, +{9616,2,1,-1},{9620,2,0,-1},{9621,2,1,-1},{9624,2,0,-1},{9625,2,1,-1}, +{9628,2,0,-1},{9629,2,1,-1},{9633,2,0,-1},{9634,2,1,-1},{9637,2,0,-1}, +{9638,2,1,-1},{9641,2,0,-1},{9642,2,1,-1},{9646,2,0,-1},{9647,2,1,-1}, +{9650,2,0,-1},{9651,2,1,-1},{9654,2,0,-1},{9655,2,1,-1},{9659,2,0,-1}, +{9660,2,1,-1},{9663,2,0,-1},{9664,2,1,-1},{9667,2,0,-1},{9668,2,1,-1}, +{9672,2,0,-1},{9673,2,1,-1},{9606,2,0,-1},{9676,2,0,-1},{9677,2,1,-1}, +{9680,2,0,-1},{9681,2,1,-1},{9685,2,0,-1},{9686,2,1,-1},{9619,2,1,-1}, +{9689,2,0,-1},{9690,2,1,-1},{9693,2,0,-1},{9694,2,1,-1},{9698,2,0,-1}, +{9699,2,1,-1},{9702,2,0,-1},{9703,2,1,-1},{9706,2,0,-1},{9707,2,1,-1}, +{9711,2,0,-1},{9712,2,1,-1},{9715,2,0,-1},{9716,2,1,-1},{9719,2,0,-1}, +{9724,2,0,-1},{9725,2,1,-1},{9728,2,0,-1},{9729,2,1,-1},{9732,2,0,-1}, +{9733,2,1,-1},{9737,2,0,-1},{9738,2,1,-1},{9741,2,0,-1},{9742,2,1,-1}, +{9745,2,0,-1},{9746,2,1,-1},{9750,2,0,-1},{9751,2,1,-1},{9754,2,0,-1}, +{9755,2,1,-1},{9758,2,0,-1},{9759,2,1,-1},{9764,2,1,-1},{9767,2,0,-1}, +{9768,2,1,-1},{9771,2,0,-1},{9776,2,0,-1},{9777,2,1,-1},{9710,2,0,-1}, +{9780,2,0,-1},{9781,2,1,-1},{9784,2,0,-1},{9785,2,1,-1},{9789,2,0,-1}, +{9790,2,1,-1},{9723,2,1,-1},{9793,2,0,-1},{9794,2,1,-1},{9797,2,0,-1}, +{9798,2,1,-1},{9802,2,0,-1},{9803,2,1,-1},{9806,2,0,-1},{9807,2,1,-1}, +{9810,2,0,-1},{9811,2,1,-1},{9815,2,0,-1},{9816,2,1,-1},{9819,2,0,-1}, +{9820,2,1,-1},{9823,2,0,-1},{9824,2,1,-1},{9828,2,0,-1},{9829,2,1,-1}, +{9832,2,0,-1},{9833,2,1,-1},{9836,2,0,-1},{9837,2,1,-1},{9841,2,0,-1}, +{9842,2,1,-1},{9845,2,0,-1},{9846,2,1,-1},{9849,2,0,-1},{9850,2,1,-1}, +{9854,2,0,-1},{9855,2,1,-1},{9858,2,0,-1},{9859,2,1,-1},{9862,2,0,-1}, +{9863,2,1,-1},{9867,2,0,-1},{9868,2,1,-1},{9871,2,0,-1},{9872,2,1,-1}, +{9875,2,0,-1},{9876,2,1,-1},{9880,2,0,-1},{9881,2,1,-1},{9814,2,0,-1}, +{9884,2,0,-1},{9885,2,1,-1},{9888,2,0,-1},{9889,2,1,-1},{9893,2,0,-1}, +{9894,2,1,-1},{9827,2,1,-1},{9897,2,0,-1},{9898,2,1,-1},{9901,2,0,-1}, +{9902,2,1,-1},{9906,2,0,-1},{9907,2,1,-1},{9910,2,0,-1},{9911,2,1,-1}, +{9914,2,0,-1},{9915,2,1,-1},{9919,2,0,-1},{9920,2,1,-1},{9923,2,0,-1}, +{9924,2,1,-1},{9927,2,0,-1},{9928,2,1,-1},{9932,2,0,-1},{9933,2,1,-1}, +{9936,2,0,-1},{9937,2,1,-1},{9940,2,0,-1},{9941,2,1,-1},{9945,2,0,-1}, +{9946,2,1,-1},{9949,2,0,-1},{9950,2,1,-1},{9953,2,0,-1},{9954,2,1,-1}, +{9958,2,0,-1},{9959,2,1,-1},{9962,2,0,-1},{9963,2,1,-1},{9966,2,0,-1}, +{9967,2,1,-1},{9971,2,0,-1},{9972,2,1,-1},{9975,2,0,-1},{9976,2,1,-1}, +{9979,2,0,-1},{9980,2,1,-1},{9984,2,0,-1},{9985,2,1,-1},{9918,2,0,-1}, +{9988,2,0,-1},{9989,2,1,-1},{9992,2,0,-1},{9993,2,1,-1},{9997,2,0,-1}, +{9998,2,1,-1},{9931,2,1,-1},{10001,2,0,-1},{10002,2,1,-1},{10005,2,0,-1}, +{10006,2,1,-1},{10010,2,0,-1},{10011,2,1,-1},{10014,2,0,-1},{10015,2,1,-1}, +{10018,2,0,-1},{10019,2,1,-1},{10023,2,0,-1},{10024,2,1,-1},{10027,2,0,-1}, +{10028,2,1,-1},{10031,2,0,-1},{10032,2,1,-1},{10036,2,0,-1},{10037,2,1,-1}, +{10040,2,0,-1},{10041,2,1,-1},{10044,2,0,-1},{10045,2,1,-1},{10049,2,0,-1}, +{10050,2,1,-1},{10053,2,0,-1},{10054,2,1,-1},{10057,2,0,-1},{10058,2,1,-1}, +{10062,2,0,-1},{10063,2,1,-1},{10066,2,0,-1},{10067,2,1,-1},{10070,2,0,-1}, +{10071,2,1,-1},{10075,2,0,-1},{10076,2,1,-1},{10079,2,0,-1},{10080,2,1,-1}, +{10083,2,0,-1},{10084,2,1,-1},{10088,2,0,-1},{10089,2,1,-1},{10022,2,0,-1}, +{10092,2,0,-1},{10093,2,1,-1},{10096,2,0,-1},{10097,2,1,-1},{10101,2,0,-1}, +{10102,2,1,-1},{10035,2,1,-1},{10105,2,0,-1},{10106,2,1,-1},{10109,2,0,-1}, +{10110,2,1,-1},{10114,2,0,-1},{10115,2,1,-1},{10118,2,0,-1},{10119,2,1,-1}, +{10122,2,0,-1},{10123,2,1,-1},{10127,2,0,-1},{10128,2,1,-1},{10131,2,0,-1}, +{10132,2,1,-1},{10135,2,0,-1},{10136,2,1,-1},{10140,2,0,-1},{10141,2,1,-1}, +{10144,2,0,-1},{10145,2,1,-1},{10148,2,0,-1},{10149,2,1,-1},{10153,2,0,-1}, +{10154,2,1,-1},{10157,2,0,-1},{10158,2,1,-1},{10161,2,0,-1},{10162,2,1,-1}, +{10166,2,0,-1},{10167,2,1,-1},{10170,2,0,-1},{10171,2,1,-1},{10174,2,0,-1}, +{10175,2,1,-1},{10179,2,0,-1},{10180,2,1,-1},{10183,2,0,-1},{10184,2,1,-1}, +{10187,2,0,-1},{10188,2,1,-1},{10192,2,0,-1},{10193,2,1,-1},{10126,2,0,-1}, +{10196,2,0,-1},{10197,2,1,-1},{10200,2,0,-1},{10201,2,1,-1},{10205,2,0,-1}, +{10206,2,1,-1},{10139,2,1,-1},{10209,2,0,-1},{10210,2,1,-1},{10213,2,0,-1}, +{10214,2,1,-1},{10218,2,0,-1},{10219,2,1,-1},{10222,2,0,-1},{10223,2,1,-1}, +{10226,2,0,-1},{10227,2,1,-1},{10231,2,0,-1},{10232,2,1,-1},{10235,2,0,-1}, +{10236,2,1,-1},{10239,2,0,-1},{10240,2,1,-1},{10244,2,0,-1},{10245,2,1,-1}, +{10248,2,0,-1},{10249,2,1,-1},{10252,2,0,-1},{10253,2,1,-1},{10257,2,0,-1}, +{10258,2,1,-1},{10261,2,0,-1},{10262,2,1,-1},{10265,2,0,-1},{10266,2,1,-1}, +{10270,2,0,-1},{10271,2,1,-1},{10274,2,0,-1},{10275,2,1,-1},{10278,2,0,-1}, +{10279,2,1,-1},{10283,2,0,-1},{10284,2,1,-1},{10287,2,0,-1},{10288,2,1,-1}, +{10291,2,0,-1},{10292,2,1,-1},{10296,2,0,-1},{10297,2,1,-1},{10230,2,0,-1}, +{10300,2,0,-1},{10301,2,1,-1},{10304,2,0,-1},{10305,2,1,-1},{10309,2,0,-1}, +{10310,2,1,-1},{10243,2,1,-1},{10313,2,0,-1},{10314,2,1,-1},{10317,2,0,-1}, +{10318,2,1,-1},{10322,2,0,-1},{10323,2,1,-1},{10326,2,0,-1},{10327,2,1,-1}, +{10330,2,0,-1},{10331,2,1,-1},{10335,2,0,-1},{10336,2,1,-1},{10339,2,0,-1}, +{10340,2,1,-1},{10343,2,0,-1},{10344,2,1,-1},{10348,2,0,-1},{10349,2,1,-1}, +{10352,2,0,-1},{10353,2,1,-1},{10356,2,0,-1},{10357,2,1,-1},{10361,2,0,-1}, +{10362,2,1,-1},{10365,2,0,-1},{10366,2,1,-1},{10369,2,0,-1},{10370,2,1,-1}, +{10374,2,0,-1},{10375,2,1,-1},{10378,2,0,-1},{10379,2,1,-1},{10382,2,0,-1}, +{10383,2,1,-1},{10387,2,0,-1},{10388,2,1,-1},{10391,2,0,-1},{10392,2,1,-1}, +{10395,2,0,-1},{10396,2,1,-1},{10400,2,0,-1},{10401,2,1,-1},{10334,2,0,-1}, +{10404,2,0,-1},{10405,2,1,-1},{10408,2,0,-1},{10409,2,1,-1},{10413,2,0,-1}, +{10414,2,1,-1},{10347,2,1,-1},{10417,2,0,-1},{10418,2,1,-1},{10421,2,0,-1}, +{10422,2,1,-1},{10426,2,0,-1},{10427,2,1,-1},{10430,2,0,-1},{10431,2,1,-1}, +{10434,2,0,-1},{10435,2,1,-1},{10439,2,0,-1},{10440,2,1,-1},{10443,2,0,-1}, +{10444,2,1,-1},{10447,2,0,-1},{10448,2,1,-1},{10452,2,0,-1},{10453,2,1,-1}, +{10456,2,0,-1},{10457,2,1,-1},{10460,2,0,-1},{10461,2,1,-1},{10465,2,0,-1}, +{10466,2,1,-1},{10469,2,0,-1},{10470,2,1,-1},{10473,2,0,-1},{10474,2,1,-1}, +{10478,2,0,-1},{10479,2,1,-1},{10482,2,0,-1},{10483,2,1,-1},{10486,2,0,-1}, +{10487,2,1,-1},{10491,2,0,-1},{10492,2,1,-1},{10495,2,0,-1},{10496,2,1,-1}, +{10499,2,0,-1},{10500,2,1,-1},{10504,2,0,-1},{10505,2,1,-1},{10438,2,0,-1}, +{10508,2,0,-1},{10509,2,1,-1},{10512,2,0,-1},{10513,2,1,-1},{10517,2,0,-1}, +{10518,2,1,-1},{10451,2,1,-1},{10521,2,0,-1},{10522,2,1,-1},{10525,2,0,-1}, +{10526,2,1,-1},{10530,2,0,-1},{10531,2,1,-1},{10534,2,0,-1},{10535,2,1,-1}, +{10538,2,0,-1},{10539,2,1,-1},{10543,2,0,-1},{10544,2,1,-1},{10547,2,0,-1}, +{10548,2,1,-1},{10551,2,0,-1},{10552,2,1,-1},{10556,2,0,-1},{10557,2,1,-1}, +{10560,2,0,-1},{10561,2,1,-1},{10564,2,0,-1},{10565,2,1,-1},{10569,2,0,-1}, +{10570,2,1,-1},{10573,2,0,-1},{10574,2,1,-1},{10577,2,0,-1},{10578,2,1,-1}, +{10582,2,0,-1},{10583,2,1,-1},{10586,2,0,-1},{10587,2,1,-1},{10590,2,0,-1}, +{10591,2,1,-1},{10595,2,0,-1},{10596,2,1,-1},{10599,2,0,-1},{10600,2,1,-1}, +{10603,2,0,-1},{10604,2,1,-1},{10608,2,0,-1},{10609,2,1,-1},{10542,2,0,-1}, +{10612,2,0,-1},{10613,2,1,-1},{10616,2,0,-1},{10617,2,1,-1},{10621,2,0,-1}, +{10622,2,1,-1},{10555,2,1,-1},{10625,2,0,-1},{10626,2,1,-1},{10629,2,0,-1}, +{10630,2,1,-1},{10634,2,0,-1},{10635,2,1,-1},{10638,2,0,-1},{10639,2,1,-1}, +{10642,2,0,-1},{10643,2,1,-1},{10647,2,0,-1},{10648,2,1,-1},{10651,2,0,-1}, +{10652,2,1,-1},{10655,2,0,-1},{10656,2,1,-1},{10660,2,0,-1},{10661,2,1,-1}, +{10664,2,0,-1},{10665,2,1,-1},{10668,2,0,-1},{10669,2,1,-1},{10673,2,0,-1}, +{10674,2,1,-1},{10677,2,0,-1},{10678,2,1,-1},{10681,2,0,-1},{10682,2,1,-1}, +{10686,2,0,-1},{10687,2,1,-1},{10690,2,0,-1},{10691,2,1,-1},{10694,2,0,-1}, +{10695,2,1,-1},{10699,2,0,-1},{10700,2,1,-1},{10703,2,0,-1},{10704,2,1,-1}, +{10707,2,0,-1},{10708,2,1,-1},{10712,2,0,-1},{10713,2,1,-1},{10646,2,0,-1}, +{10716,2,0,-1},{10717,2,1,-1},{10720,2,0,-1},{10721,2,1,-1},{10725,2,0,-1}, +{10726,2,1,-1},{10659,2,1,-1},{10729,2,0,-1},{10730,2,1,-1},{10733,2,0,-1}, +{10734,2,1,-1},{10738,2,0,-1},{10739,2,1,-1},{10742,2,0,-1},{10743,2,1,-1}, +{10746,2,0,-1},{10747,2,1,-1},{10751,2,0,-1},{10752,2,1,-1},{10755,2,0,-1}, +{10756,2,1,-1},{10759,2,0,-1},{10760,2,1,-1},{10764,2,0,-1},{10765,2,1,-1}, +{10768,2,0,-1},{10769,2,1,-1},{10772,2,0,-1},{10773,2,1,-1},{10777,2,0,-1}, +{10778,2,1,-1},{10781,2,0,-1},{10782,2,1,-1},{10785,2,0,-1},{10786,2,1,-1}, +{10790,2,0,-1},{10791,2,1,-1},{10794,2,0,-1},{10795,2,1,-1},{10798,2,0,-1}, +{10799,2,1,-1},{10803,2,0,-1},{10804,2,1,-1},{10807,2,0,-1},{10808,2,1,-1}, +{10811,2,0,-1},{10812,2,1,-1},{10816,2,0,-1},{10817,2,1,-1},{10750,2,0,-1}, +{10820,2,0,-1},{10821,2,1,-1},{10824,2,0,-1},{10825,2,1,-1},{10829,2,0,-1}, +{10830,2,1,-1},{10763,2,1,-1},{10833,2,0,-1},{10834,2,1,-1},{10837,2,0,-1}, +{10838,2,1,-1},{10842,2,0,-1},{10843,2,1,-1},{10846,2,0,-1},{10847,2,1,-1}, +{10850,2,0,-1},{10851,2,1,-1},{10855,2,0,-1},{10856,2,1,-1},{10859,2,0,-1}, +{10860,2,1,-1},{10863,2,0,-1},{10864,2,1,-1},{10868,2,0,-1},{10869,2,1,-1}, +{10872,2,0,-1},{10873,2,1,-1},{10876,2,0,-1},{10877,2,1,-1},{10881,2,0,-1}, +{10882,2,1,-1},{10885,2,0,-1},{10886,2,1,-1},{10889,2,0,-1},{10890,2,1,-1}, +{10894,2,0,-1},{10895,2,1,-1},{10898,2,0,-1},{10899,2,1,-1},{10902,2,0,-1}, +{10903,2,1,-1},{10907,2,0,-1},{10908,2,1,-1},{10911,2,0,-1},{10912,2,1,-1}, +{10915,2,0,-1},{10916,2,1,-1},{10920,2,0,-1},{10921,2,1,-1},{10854,2,0,-1}, +{10924,2,0,-1},{10925,2,1,-1},{10928,2,0,-1},{10929,2,1,-1},{10933,2,0,-1}, +{10934,2,1,-1},{10867,2,1,-1},{10937,2,0,-1},{10938,2,1,-1},{10941,2,0,-1}, +{10942,2,1,-1},{10946,2,0,-1},{10947,2,1,-1},{10950,2,0,-1},{10951,2,1,-1}, +{10954,2,0,-1},{10955,2,1,-1},{10959,2,0,-1},{10960,2,1,-1},{10963,2,0,-1}, +{10964,2,1,-1},{10967,2,0,-1},{10968,2,1,-1},{10972,2,0,-1},{10973,2,1,-1}, +{10976,2,0,-1},{10977,2,1,-1},{10980,2,0,-1},{10981,2,1,-1},{10985,2,0,-1}, +{10986,2,1,-1},{10989,2,0,-1},{10990,2,1,-1},{10993,2,0,-1},{10994,2,1,-1}, +{10998,2,0,-1},{10999,2,1,-1},{11002,2,0,-1},{11003,2,1,-1},{11006,2,0,-1}, +{11007,2,1,-1},{11011,2,0,-1},{11012,2,1,-1},{11015,2,0,-1},{11016,2,1,-1}, +{11019,2,0,-1},{11020,2,1,-1},{11024,2,0,-1},{11025,2,1,-1},{10958,2,0,-1}, +{11028,2,0,-1},{11029,2,1,-1},{11032,2,0,-1},{11033,2,1,-1},{11037,2,0,-1}, +{11038,2,1,-1},{10971,2,1,-1},{11041,2,0,-1},{11042,2,1,-1},{11045,2,0,-1}, +{11046,2,1,-1},{11050,2,0,-1},{11051,2,1,-1},{11054,2,0,-1},{11055,2,1,-1}, +{11058,2,0,-1},{11059,2,1,-1},{11063,2,0,-1},{11064,2,1,-1},{11067,2,0,-1}, +{11068,2,1,-1},{11071,2,0,-1},{11072,2,1,-1},{11076,2,0,-1},{11077,2,1,-1}, +{11080,2,0,-1},{11081,2,1,-1},{11084,2,0,-1},{11085,2,1,-1},{11089,2,0,-1}, +{11090,2,1,-1},{11093,2,0,-1},{11094,2,1,-1},{11097,2,0,-1},{11098,2,1,-1}, +{11102,2,0,-1},{11103,2,1,-1},{11106,2,0,-1},{11107,2,1,-1},{11110,2,0,-1}, +{11111,2,1,-1},{11115,2,0,-1},{11116,2,1,-1},{11119,2,0,-1},{11120,2,1,-1}, +{11123,2,0,-1},{11124,2,1,-1},{11128,2,0,-1},{11129,2,1,-1},{11062,2,0,-1}, +{11132,2,0,-1},{11133,2,1,-1},{11136,2,0,-1},{11137,2,1,-1},{11141,2,0,-1}, +{11142,2,1,-1},{11075,2,1,-1},{11145,2,0,-1},{11146,2,1,-1},{11149,2,0,-1}, +{11150,2,1,-1},{11154,2,0,-1},{11155,2,1,-1},{11158,2,0,-1},{11159,2,1,-1}, +{11162,2,0,-1},{11163,2,1,-1},{11167,2,0,-1},{11168,2,1,-1},{11171,2,0,-1}, +{11172,2,1,-1},{11175,2,0,-1},{11176,2,1,-1},{11180,2,0,-1},{11181,2,1,-1}, +{11184,2,0,-1},{11185,2,1,-1},{11188,2,0,-1},{11189,2,1,-1},{11193,2,0,-1}, +{11194,2,1,-1},{11197,2,0,-1},{11198,2,1,-1},{11201,2,0,-1},{11202,2,1,-1}, +{11206,2,0,-1},{11207,2,1,-1},{11210,2,0,-1},{11211,2,1,-1},{11214,2,0,-1}, +{11215,2,1,-1},{11219,2,0,-1},{11220,2,1,-1},{11223,2,0,-1},{11224,2,1,-1}, +{11227,2,0,-1},{11228,2,1,-1},{11232,2,0,-1},{11233,2,1,-1},{11166,2,0,-1}, +{11236,2,0,-1},{11237,2,1,-1},{11240,2,0,-1},{11241,2,1,-1},{11245,2,0,-1}, +{11246,2,1,-1},{11179,2,1,-1},{11249,2,0,-1},{11250,2,1,-1},{11253,2,0,-1}, +{11254,2,1,-1},{11258,2,0,-1},{11259,2,1,-1},{11262,2,0,-1},{11263,2,1,-1}, +{11266,2,0,-1},{11267,2,1,-1},{11271,2,0,-1},{11272,2,1,-1},{11275,2,0,-1}, +{11276,2,1,-1},{11279,2,0,-1},{11280,2,1,-1},{11284,2,0,-1},{11285,2,1,-1}, +{11288,2,0,-1},{11289,2,1,-1},{11292,2,0,-1},{11293,2,1,-1},{11297,2,0,-1}, +{11298,2,1,-1},{11301,2,0,-1},{11302,2,1,-1},{11305,2,0,-1},{11306,2,1,-1}, +{11310,2,0,-1},{11311,2,1,-1},{11314,2,0,-1},{11315,2,1,-1},{11318,2,0,-1}, +{11319,2,1,-1},{11323,2,0,-1},{11324,2,1,-1},{11327,2,0,-1},{11328,2,1,-1}, +{11331,2,0,-1},{11332,2,1,-1},{11336,2,0,-1},{11337,2,1,-1},{11270,2,0,-1}, +{11340,2,0,-1},{11341,2,1,-1},{11344,2,0,-1},{11345,2,1,-1},{11349,2,0,-1}, +{11350,2,1,-1},{11283,2,1,-1},{11353,2,0,-1},{11354,2,1,-1},{11357,2,0,-1}, +{11358,2,1,-1},{11362,2,0,-1},{11363,2,1,-1},{11366,2,0,-1},{11367,2,1,-1}, +{11370,2,0,-1},{11371,2,1,-1},{11375,2,0,-1},{11376,2,1,-1},{11379,2,0,-1}, +{11380,2,1,-1},{11383,2,0,-1},{11384,2,1,-1},{11388,2,0,-1},{11389,2,1,-1}, +{11392,2,0,-1},{11393,2,1,-1},{11396,2,0,-1},{11397,2,1,-1},{11401,2,0,-1}, +{11402,2,1,-1},{11405,2,0,-1},{11406,2,1,-1},{11409,2,0,-1},{11410,2,1,-1}, +{11414,2,0,-1},{11415,2,1,-1},{11418,2,0,-1},{11419,2,1,-1},{11422,2,0,-1}, +{11423,2,1,-1},{11427,2,0,-1},{11428,2,1,-1},{11431,2,0,-1},{11432,2,1,-1}, +{11435,2,0,-1},{11436,2,1,-1},{11440,2,0,-1},{11441,2,1,-1},{11374,2,0,-1}, +{11444,2,0,-1},{11445,2,1,-1},{11448,2,0,-1},{11449,2,1,-1},{11453,2,0,-1}, +{11454,2,1,-1},{11387,2,1,-1},{11457,2,0,-1},{11458,2,1,-1},{11461,2,0,-1}, +{11462,2,1,-1},{11466,2,0,-1},{11467,2,1,-1},{11470,2,0,-1},{11471,2,1,-1}, +{11474,2,0,-1},{11475,2,1,-1},{11479,2,0,-1},{11480,2,1,-1},{11483,2,0,-1}, +{11484,2,1,-1},{11487,2,0,-1},{11488,2,1,-1},{11492,2,0,-1},{11493,2,1,-1}, +{11496,2,0,-1},{11497,2,1,-1},{11500,2,0,-1},{11501,2,1,-1},{11505,2,0,-1}, +{11506,2,1,-1},{11509,2,0,-1},{11510,2,1,-1},{11513,2,0,-1},{11514,2,1,-1}, +{11518,2,0,-1},{11519,2,1,-1},{11522,2,0,-1},{11523,2,1,-1},{11526,2,0,-1}, +{11527,2,1,-1},{11531,2,0,-1},{11532,2,1,-1},{11535,2,0,-1},{11536,2,1,-1}, +{11539,2,0,-1},{11540,2,1,-1},{11544,2,0,-1},{11545,2,1,-1},{11478,2,0,-1}, +{11548,2,0,-1},{11549,2,1,-1},{11552,2,0,-1},{11553,2,1,-1},{11557,2,0,-1}, +{11558,2,1,-1},{11491,2,1,-1},{11561,2,0,-1},{11562,2,1,-1},{11565,2,0,-1}, +{11566,2,1,-1},{11570,2,0,-1},{11571,2,1,-1},{11574,2,0,-1},{11575,2,1,-1}, +{11578,2,0,-1},{11579,2,1,-1},{11583,2,0,-1},{11584,2,1,-1},{11587,2,0,-1}, +{11588,2,1,-1},{11591,2,0,-1},{11596,2,0,-1},{11597,2,1,-1},{11600,2,0,-1}, +{11601,2,1,-1},{11604,2,0,-1},{11605,2,1,-1},{11609,2,0,-1},{11610,2,1,-1}, +{11613,2,0,-1},{11614,2,1,-1},{11617,2,0,-1},{11618,2,1,-1},{11622,2,0,-1}, +{11623,2,1,-1},{11626,2,0,-1},{11627,2,1,-1},{11630,2,0,-1},{11631,2,1,-1}, +{11635,2,0,-1},{11636,2,1,-1},{11639,2,0,-1},{11640,2,1,-1},{11648,2,0,-1}, +{11649,2,1,-1},{11582,2,0,-1},{11652,2,0,-1},{11653,2,1,-1},{11656,2,0,-1}, +{11657,2,1,-1},{11661,2,0,-1},{11662,2,1,-1},{11665,2,0,-1},{11666,2,1,-1}, +{11669,2,0,-1},{11670,2,1,-1},{11674,2,0,-1},{11675,2,1,-1},{11678,2,0,-1}, +{11679,2,1,-1},{11682,2,0,-1},{11683,2,1,-1},{11687,2,0,-1},{11688,2,1,-1}, +{11691,2,0,-1},{11692,2,1,-1},{11700,2,0,-1},{11704,2,0,-1},{11708,2,0,-1}, +{11713,2,0,-1},{11717,2,0,-1},{11721,2,0,-1},{11726,2,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS3, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_3_ss0_ss1[] = { +{10001,3,0,-1},{10002,3,1,-1},{10005,3,0,-1},{10006,3,1,-1},{10010,3,0,-1}, +{10011,3,1,-1},{10014,3,0,-1},{10015,3,1,-1},{10018,3,0,-1},{10019,3,1,-1}, +{10023,3,0,-1},{10024,3,1,-1},{10027,3,0,-1},{10028,3,1,-1},{10031,3,0,-1}, +{10032,3,1,-1},{10036,3,0,-1},{10037,3,1,-1},{10040,3,0,-1},{10041,3,1,-1}, +{10044,3,0,-1},{10045,3,1,-1},{10049,3,0,-1},{10050,3,1,-1},{10053,3,0,-1}, +{10054,3,1,-1},{10057,3,0,-1},{10058,3,1,-1},{10062,3,0,-1},{10063,3,1,-1}, +{10066,3,0,-1},{10067,3,1,-1},{10070,3,0,-1},{10071,3,1,-1},{10075,3,0,-1}, +{10076,3,1,-1},{10079,3,0,-1},{10080,3,1,-1},{10083,3,0,-1},{10084,3,1,-1}, +{10088,3,0,-1},{10089,3,1,-1},{10022,3,0,-1},{10092,3,0,-1},{10093,3,1,-1}, +{10096,3,0,-1},{10097,3,1,-1},{10101,3,0,-1},{10102,3,1,-1},{10035,3,1,-1}, +{10105,3,0,-1},{10106,3,1,-1},{10109,3,0,-1},{10110,3,1,-1},{10114,3,0,-1}, +{10115,3,1,-1},{10118,3,0,-1},{10119,3,1,-1},{10122,3,0,-1},{10123,3,1,-1}, +{10127,3,0,-1},{10128,3,1,-1},{10131,3,0,-1},{10132,3,1,-1},{10135,3,0,-1}, +{10136,3,1,-1},{10140,3,0,-1},{10141,3,1,-1},{10144,3,0,-1},{10145,3,1,-1}, +{10148,3,0,-1},{10149,3,1,-1},{10153,3,0,-1},{10154,3,1,-1},{10157,3,0,-1}, +{10158,3,1,-1},{10161,3,0,-1},{10162,3,1,-1},{10166,3,0,-1},{10167,3,1,-1}, +{10170,3,0,-1},{10171,3,1,-1},{10174,3,0,-1},{10175,3,1,-1},{10179,3,0,-1}, +{10180,3,1,-1},{10183,3,0,-1},{10184,3,1,-1},{10187,3,0,-1},{10188,3,1,-1}, +{10192,3,0,-1},{10193,3,1,-1},{10126,3,0,-1},{10196,3,0,-1},{10197,3,1,-1}, +{10200,3,0,-1},{10201,3,1,-1},{10205,3,0,-1},{10206,3,1,-1},{10139,3,1,-1}, +{10209,3,0,-1},{10210,3,1,-1},{10213,3,0,-1},{10214,3,1,-1},{10218,3,0,-1}, +{10219,3,1,-1},{10222,3,0,-1},{10223,3,1,-1},{10226,3,0,-1},{10227,3,1,-1}, +{10231,3,0,-1},{10232,3,1,-1},{10235,3,0,-1},{10236,3,1,-1},{10239,3,0,-1}, +{10240,3,1,-1},{10244,3,0,-1},{10245,3,1,-1},{10248,3,0,-1},{10249,3,1,-1}, +{10252,3,0,-1},{10253,3,1,-1},{10257,3,0,-1},{10258,3,1,-1},{10261,3,0,-1}, +{10262,3,1,-1},{10265,3,0,-1},{10266,3,1,-1},{10270,3,0,-1},{10271,3,1,-1}, +{10274,3,0,-1},{10275,3,1,-1},{10278,3,0,-1},{10279,3,1,-1},{10283,3,0,-1}, +{10284,3,1,-1},{10287,3,0,-1},{10288,3,1,-1},{10291,3,0,-1},{10292,3,1,-1}, +{10296,3,0,-1},{10297,3,1,-1},{10230,3,0,-1},{10300,3,0,-1},{10301,3,1,-1}, +{10304,3,0,-1},{10305,3,1,-1},{10309,3,0,-1},{10310,3,1,-1},{10243,3,1,-1}, +{10313,3,0,-1},{10314,3,1,-1},{10317,3,0,-1},{10318,3,1,-1},{10322,3,0,-1}, +{10323,3,1,-1},{10326,3,0,-1},{10327,3,1,-1},{10330,3,0,-1},{10331,3,1,-1}, +{10335,3,0,-1},{10336,3,1,-1},{10339,3,0,-1},{10340,3,1,-1},{10343,3,0,-1}, +{10344,3,1,-1},{10348,3,0,-1},{10349,3,1,-1},{10352,3,0,-1},{10353,3,1,-1}, +{10356,3,0,-1},{10357,3,1,-1},{10361,3,0,-1},{10362,3,1,-1},{10365,3,0,-1}, +{10366,3,1,-1},{10369,3,0,-1},{10370,3,1,-1},{10374,3,0,-1},{10375,3,1,-1}, +{10378,3,0,-1},{10379,3,1,-1},{10382,3,0,-1},{10383,3,1,-1},{10387,3,0,-1}, +{10388,3,1,-1},{10391,3,0,-1},{10392,3,1,-1},{10395,3,0,-1},{10396,3,1,-1}, +{10400,3,0,-1},{10401,3,1,-1},{10334,3,0,-1},{10404,3,0,-1},{10405,3,1,-1}, +{10408,3,0,-1},{10409,3,1,-1},{10413,3,0,-1},{10414,3,1,-1},{10347,3,1,-1}, +{10417,3,0,-1},{10418,3,1,-1},{10421,3,0,-1},{10422,3,1,-1},{10426,3,0,-1}, +{10427,3,1,-1},{10430,3,0,-1},{10431,3,1,-1},{10434,3,0,-1},{10435,3,1,-1}, +{10439,3,0,-1},{10440,3,1,-1},{10443,3,0,-1},{10444,3,1,-1},{10447,3,0,-1}, +{10448,3,1,-1},{10452,3,0,-1},{10453,3,1,-1},{10456,3,0,-1},{10457,3,1,-1}, +{10460,3,0,-1},{10461,3,1,-1},{10465,3,0,-1},{10466,3,1,-1},{10469,3,0,-1}, +{10470,3,1,-1},{10473,3,0,-1},{10474,3,1,-1},{10478,3,0,-1},{10479,3,1,-1}, +{10482,3,0,-1},{10483,3,1,-1},{10486,3,0,-1},{10487,3,1,-1},{10491,3,0,-1}, +{10492,3,1,-1},{10495,3,0,-1},{10496,3,1,-1},{10499,3,0,-1},{10500,3,1,-1}, +{10504,3,0,-1},{10505,3,1,-1},{10438,3,0,-1},{10508,3,0,-1},{10509,3,1,-1}, +{10512,3,0,-1},{10513,3,1,-1},{10517,3,0,-1},{10518,3,1,-1},{10451,3,1,-1}, +{10521,3,0,-1},{10522,3,1,-1},{10525,3,0,-1},{10526,3,1,-1},{10530,3,0,-1}, +{10531,3,1,-1},{10534,3,0,-1},{10535,3,1,-1},{10538,3,0,-1},{10539,3,1,-1}, +{10543,3,0,-1},{10544,3,1,-1},{10547,3,0,-1},{10548,3,1,-1},{10551,3,0,-1}, +{10552,3,1,-1},{10556,3,0,-1},{10557,3,1,-1},{10560,3,0,-1},{10561,3,1,-1}, +{10564,3,0,-1},{10565,3,1,-1},{10569,3,0,-1},{10570,3,1,-1},{10573,3,0,-1}, +{10574,3,1,-1},{10577,3,0,-1},{10578,3,1,-1},{10582,3,0,-1},{10583,3,1,-1}, +{10586,3,0,-1},{10587,3,1,-1},{10590,3,0,-1},{10591,3,1,-1},{10595,3,0,-1}, +{10596,3,1,-1},{10599,3,0,-1},{10600,3,1,-1},{10603,3,0,-1},{10604,3,1,-1}, +{10608,3,0,-1},{10609,3,1,-1},{10542,3,0,-1},{10612,3,0,-1},{10613,3,1,-1}, +{10616,3,0,-1},{10617,3,1,-1},{10621,3,0,-1},{10622,3,1,-1},{10555,3,1,-1}, +{10625,3,0,-1},{10626,3,1,-1},{10629,3,0,-1},{10630,3,1,-1},{10634,3,0,-1}, +{10635,3,1,-1},{10638,3,0,-1},{10639,3,1,-1},{10642,3,0,-1},{10643,3,1,-1}, +{10647,3,0,-1},{10648,3,1,-1},{10651,3,0,-1},{10652,3,1,-1},{10655,3,0,-1}, +{10656,3,1,-1},{10660,3,0,-1},{10661,3,1,-1},{10664,3,0,-1},{10665,3,1,-1}, +{10668,3,0,-1},{10669,3,1,-1},{10673,3,0,-1},{10674,3,1,-1},{10677,3,0,-1}, +{10678,3,1,-1},{10681,3,0,-1},{10682,3,1,-1},{10686,3,0,-1},{10687,3,1,-1}, +{10690,3,0,-1},{10691,3,1,-1},{10694,3,0,-1},{10695,3,1,-1},{10699,3,0,-1}, +{10700,3,1,-1},{10703,3,0,-1},{10704,3,1,-1},{10707,3,0,-1},{10708,3,1,-1}, +{10712,3,0,-1},{10713,3,1,-1},{10646,3,0,-1},{10716,3,0,-1},{10717,3,1,-1}, +{10720,3,0,-1},{10721,3,1,-1},{10725,3,0,-1},{10726,3,1,-1},{10659,3,1,-1}, +{10729,3,0,-1},{10730,3,1,-1},{10733,3,0,-1},{10734,3,1,-1},{10738,3,0,-1}, +{10739,3,1,-1},{10742,3,0,-1},{10743,3,1,-1},{10746,3,0,-1},{10747,3,1,-1}, +{10751,3,0,-1},{10752,3,1,-1},{10755,3,0,-1},{10756,3,1,-1},{10759,3,0,-1}, +{10760,3,1,-1},{10764,3,0,-1},{10765,3,1,-1},{10768,3,0,-1},{10769,3,1,-1}, +{10772,3,0,-1},{10773,3,1,-1},{10777,3,0,-1},{10778,3,1,-1},{10781,3,0,-1}, +{10782,3,1,-1},{10785,3,0,-1},{10786,3,1,-1},{10790,3,0,-1},{10791,3,1,-1}, +{10794,3,0,-1},{10795,3,1,-1},{10798,3,0,-1},{10799,3,1,-1},{10803,3,0,-1}, +{10804,3,1,-1},{10807,3,0,-1},{10808,3,1,-1},{10811,3,0,-1},{10812,3,1,-1}, +{10816,3,0,-1},{10817,3,1,-1},{10750,3,0,-1},{10820,3,0,-1},{10821,3,1,-1}, +{10824,3,0,-1},{10825,3,1,-1},{10829,3,0,-1},{10830,3,1,-1},{10763,3,1,-1}, +{10833,3,0,-1},{10834,3,1,-1},{10837,3,0,-1},{10838,3,1,-1},{10842,3,0,-1}, +{10843,3,1,-1},{10846,3,0,-1},{10847,3,1,-1},{10850,3,0,-1},{10851,3,1,-1}, +{10855,3,0,-1},{10856,3,1,-1},{10859,3,0,-1},{10860,3,1,-1},{10863,3,0,-1}, +{10864,3,1,-1},{10868,3,0,-1},{10869,3,1,-1},{10872,3,0,-1},{10873,3,1,-1}, +{10876,3,0,-1},{10877,3,1,-1},{10881,3,0,-1},{10882,3,1,-1},{10885,3,0,-1}, +{10886,3,1,-1},{10889,3,0,-1},{10890,3,1,-1},{10894,3,0,-1},{10895,3,1,-1}, +{10898,3,0,-1},{10899,3,1,-1},{10902,3,0,-1},{10903,3,1,-1},{10907,3,0,-1}, +{10908,3,1,-1},{10911,3,0,-1},{10912,3,1,-1},{10915,3,0,-1},{10916,3,1,-1}, +{10920,3,0,-1},{10921,3,1,-1},{10854,3,0,-1},{10924,3,0,-1},{10925,3,1,-1}, +{10928,3,0,-1},{10929,3,1,-1},{10933,3,0,-1},{10934,3,1,-1},{10867,3,1,-1}, +{10937,3,0,-1},{10938,3,1,-1},{10941,3,0,-1},{10942,3,1,-1},{10946,3,0,-1}, +{10947,3,1,-1},{10950,3,0,-1},{10951,3,1,-1},{10954,3,0,-1},{10955,3,1,-1}, +{10959,3,0,-1},{10960,3,1,-1},{10963,3,0,-1},{10964,3,1,-1},{10967,3,0,-1}, +{10968,3,1,-1},{10972,3,0,-1},{10973,3,1,-1},{10976,3,0,-1},{10977,3,1,-1}, +{10980,3,0,-1},{10981,3,1,-1},{10985,3,0,-1},{10986,3,1,-1},{10989,3,0,-1}, +{10990,3,1,-1},{10993,3,0,-1},{10994,3,1,-1},{10998,3,0,-1},{10999,3,1,-1}, +{11002,3,0,-1},{11003,3,1,-1},{11006,3,0,-1},{11007,3,1,-1},{11011,3,0,-1}, +{11012,3,1,-1},{11015,3,0,-1},{11016,3,1,-1},{11019,3,0,-1},{11020,3,1,-1}, +{11024,3,0,-1},{11025,3,1,-1},{10958,3,0,-1},{11028,3,0,-1},{11029,3,1,-1}, +{11032,3,0,-1},{11033,3,1,-1},{11037,3,0,-1},{11038,3,1,-1},{10971,3,1,-1}, +{11041,3,0,-1},{11042,3,1,-1},{11045,3,0,-1},{11046,3,1,-1},{11050,3,0,-1}, +{11051,3,1,-1},{11054,3,0,-1},{11055,3,1,-1},{11058,3,0,-1},{11059,3,1,-1}, +{11063,3,0,-1},{11064,3,1,-1},{11067,3,0,-1},{11068,3,1,-1},{11071,3,0,-1}, +{11072,3,1,-1},{11076,3,0,-1},{11077,3,1,-1},{11080,3,0,-1},{11081,3,1,-1}, +{11084,3,0,-1},{11085,3,1,-1},{11089,3,0,-1},{11090,3,1,-1},{11093,3,0,-1}, +{11094,3,1,-1},{11097,3,0,-1},{11098,3,1,-1},{11102,3,0,-1},{11103,3,1,-1}, +{11106,3,0,-1},{11107,3,1,-1},{11110,3,0,-1},{11111,3,1,-1},{11115,3,0,-1}, +{11116,3,1,-1},{11119,3,0,-1},{11120,3,1,-1},{11123,3,0,-1},{11124,3,1,-1}, +{11128,3,0,-1},{11129,3,1,-1},{11062,3,0,-1},{11132,3,0,-1},{11133,3,1,-1}, +{11136,3,0,-1},{11137,3,1,-1},{11141,3,0,-1},{11142,3,1,-1},{11075,3,1,-1}, +{11145,3,0,-1},{11146,3,1,-1},{11149,3,0,-1},{11150,3,1,-1},{11154,3,0,-1}, +{11155,3,1,-1},{11158,3,0,-1},{11159,3,1,-1},{11162,3,0,-1},{11163,3,1,-1}, +{11167,3,0,-1},{11168,3,1,-1},{11171,3,0,-1},{11172,3,1,-1},{11175,3,0,-1}, +{11176,3,1,-1},{11180,3,0,-1},{11181,3,1,-1},{11184,3,0,-1},{11185,3,1,-1}, +{11188,3,0,-1},{11189,3,1,-1},{11193,3,0,-1},{11194,3,1,-1},{11197,3,0,-1}, +{11198,3,1,-1},{11201,3,0,-1},{11202,3,1,-1},{11206,3,0,-1},{11207,3,1,-1}, +{11210,3,0,-1},{11211,3,1,-1},{11214,3,0,-1},{11215,3,1,-1},{11219,3,0,-1}, +{11220,3,1,-1},{11223,3,0,-1},{11224,3,1,-1},{11227,3,0,-1},{11228,3,1,-1}, +{11232,3,0,-1},{11233,3,1,-1},{11166,3,0,-1},{11236,3,0,-1},{11237,3,1,-1}, +{11240,3,0,-1},{11241,3,1,-1},{11245,3,0,-1},{11246,3,1,-1},{11179,3,1,-1}, +{11249,3,0,-1},{11250,3,1,-1},{11253,3,0,-1},{11254,3,1,-1},{11258,3,0,-1}, +{11259,3,1,-1},{11262,3,0,-1},{11263,3,1,-1},{11266,3,0,-1},{11267,3,1,-1}, +{11271,3,0,-1},{11272,3,1,-1},{11275,3,0,-1},{11276,3,1,-1},{11279,3,0,-1}, +{11280,3,1,-1},{11284,3,0,-1},{11285,3,1,-1},{11288,3,0,-1},{11289,3,1,-1}, +{11292,3,0,-1},{11293,3,1,-1},{11297,3,0,-1},{11298,3,1,-1},{11301,3,0,-1}, +{11302,3,1,-1},{11305,3,0,-1},{11306,3,1,-1},{11310,3,0,-1},{11311,3,1,-1}, +{11314,3,0,-1},{11315,3,1,-1},{11318,3,0,-1},{11319,3,1,-1},{11323,3,0,-1}, +{11324,3,1,-1},{11327,3,0,-1},{11328,3,1,-1},{11331,3,0,-1},{11332,3,1,-1}, +{11336,3,0,-1},{11337,3,1,-1},{11270,3,0,-1},{11340,3,0,-1},{11341,3,1,-1}, +{11344,3,0,-1},{11345,3,1,-1},{11349,3,0,-1},{11350,3,1,-1},{11283,3,1,-1}, +{11353,3,0,-1},{11354,3,1,-1},{11357,3,0,-1},{11358,3,1,-1},{11362,3,0,-1}, +{11363,3,1,-1},{11366,3,0,-1},{11367,3,1,-1},{11370,3,0,-1},{11371,3,1,-1}, +{11375,3,0,-1},{11376,3,1,-1},{11379,3,0,-1},{11380,3,1,-1},{11383,3,0,-1}, +{11384,3,1,-1},{11388,3,0,-1},{11389,3,1,-1},{11392,3,0,-1},{11393,3,1,-1}, +{11396,3,0,-1},{11397,3,1,-1},{11401,3,0,-1},{11402,3,1,-1},{11405,3,0,-1}, +{11406,3,1,-1},{11409,3,0,-1},{11410,3,1,-1},{11414,3,0,-1},{11415,3,1,-1}, +{11418,3,0,-1},{11419,3,1,-1},{11422,3,0,-1},{11423,3,1,-1},{11427,3,0,-1}, +{11428,3,1,-1},{11431,3,0,-1},{11432,3,1,-1},{11435,3,0,-1},{11436,3,1,-1}, +{11440,3,0,-1},{11441,3,1,-1},{11374,3,0,-1},{11444,3,0,-1},{11445,3,1,-1}, +{11448,3,0,-1},{11449,3,1,-1},{11453,3,0,-1},{11454,3,1,-1},{11387,3,1,-1}, +{11457,3,0,-1},{11458,3,1,-1},{11461,3,0,-1},{11462,3,1,-1},{11466,3,0,-1}, +{11467,3,1,-1},{11470,3,0,-1},{11471,3,1,-1},{11474,3,0,-1},{11475,3,1,-1}, +{11479,3,0,-1},{11480,3,1,-1},{11483,3,0,-1},{11484,3,1,-1},{11487,3,0,-1}, +{11488,3,1,-1},{11492,3,0,-1},{11493,3,1,-1},{11496,3,0,-1},{11497,3,1,-1}, +{11500,3,0,-1},{11501,3,1,-1},{11505,3,0,-1},{11506,3,1,-1},{11509,3,0,-1}, +{11510,3,1,-1},{11513,3,0,-1},{11514,3,1,-1},{11518,3,0,-1},{11519,3,1,-1}, +{11522,3,0,-1},{11523,3,1,-1},{11526,3,0,-1},{11527,3,1,-1},{11531,3,0,-1}, +{11532,3,1,-1},{11535,3,0,-1},{11536,3,1,-1},{11539,3,0,-1},{11540,3,1,-1}, +{11544,3,0,-1},{11545,3,1,-1},{11478,3,0,-1},{11548,3,0,-1},{11549,3,1,-1}, +{11552,3,0,-1},{11553,3,1,-1},{11557,3,0,-1},{11558,3,1,-1},{11491,3,1,-1}, +{11561,3,0,-1},{11562,3,1,-1},{11565,3,0,-1},{11566,3,1,-1},{11570,3,0,-1}, +{11571,3,1,-1},{11574,3,0,-1},{11575,3,1,-1},{11578,3,0,-1},{11579,3,1,-1}, +{11583,3,0,-1},{11584,3,1,-1},{11587,3,0,-1},{11588,3,1,-1},{11591,3,0,-1}, +{11592,3,1,-1},{11596,3,0,-1},{11597,3,1,-1},{11600,3,0,-1},{11601,3,1,-1}, +{11604,3,0,-1},{11605,3,1,-1},{11609,3,0,-1},{11610,3,1,-1},{11613,3,0,-1}, +{11614,3,1,-1},{11617,3,0,-1},{11618,3,1,-1},{11622,3,0,-1},{11623,3,1,-1}, +{11626,3,0,-1},{11627,3,1,-1},{11630,3,0,-1},{11631,3,1,-1},{11635,3,0,-1}, +{11636,3,1,-1},{11639,3,0,-1},{11640,3,1,-1},{11643,3,0,-1},{11644,3,1,-1}, +{11648,3,0,-1},{11649,3,1,-1},{11582,3,0,-1},{11652,3,0,-1},{11653,3,1,-1}, +{11656,3,0,-1},{11657,3,1,-1},{11661,3,0,-1},{11662,3,1,-1},{11595,3,1,-1}, +{11665,3,0,-1},{11666,3,1,-1},{11669,3,0,-1},{11670,3,1,-1},{11674,3,0,-1}, +{11675,3,1,-1},{11678,3,0,-1},{11679,3,1,-1},{11682,3,0,-1},{11683,3,1,-1}, +{11687,3,0,-1},{11688,3,1,-1},{11691,3,0,-1},{11692,3,1,-1},{11695,3,0,-1}, +{11696,3,1,-1},{11700,3,0,-1},{11701,3,1,-1},{11704,3,0,-1},{11705,3,1,-1}, +{11708,3,0,-1},{11709,3,1,-1},{11713,3,0,-1},{11714,3,1,-1},{11717,3,0,-1}, +{11718,3,1,-1},{11721,3,0,-1},{11722,3,1,-1},{11726,3,0,-1},{11727,3,1,-1}, +{11730,3,0,-1},{11731,3,1,-1},{11734,3,0,-1},{11735,3,1,-1},{11739,3,0,-1}, +{11740,3,1,-1},{11743,3,0,-1},{11744,3,1,-1},{11747,3,0,-1},{11748,3,1,-1}, +{11752,3,0,-1},{11753,3,1,-1},{11686,3,0,-1},{11756,3,0,-1},{11757,3,1,-1}, +{11760,3,0,-1},{11761,3,1,-1},{11765,3,0,-1},{11766,3,1,-1},{11699,3,1,-1}, +{11769,3,0,-1},{11770,3,1,-1},{11773,3,0,-1},{11774,3,1,-1},{11778,3,0,-1}, +{11779,3,1,-1},{11782,3,0,-1},{11783,3,1,-1},{11786,3,0,-1},{11787,3,1,-1}, +{11791,3,0,-1},{11792,3,1,-1},{11795,3,0,-1},{11796,3,1,-1},{11799,3,0,-1}, +{11800,3,1,-1},{11804,3,0,-1},{11805,3,1,-1},{11808,3,0,-1},{11809,3,1,-1}, +{11812,3,0,-1},{11813,3,1,-1},{11817,3,0,-1},{11818,3,1,-1},{11821,3,0,-1}, +{11822,3,1,-1},{11825,3,0,-1},{11826,3,1,-1},{11830,3,0,-1},{11831,3,1,-1}, +{11834,3,0,-1},{11835,3,1,-1},{11838,3,0,-1},{11839,3,1,-1},{11843,3,0,-1}, +{11844,3,1,-1},{11847,3,0,-1},{11848,3,1,-1},{11851,3,0,-1},{11852,3,1,-1}, +{11856,3,0,-1},{11857,3,1,-1},{11790,3,0,-1},{11860,3,0,-1},{11861,3,1,-1}, +{11864,3,0,-1},{11865,3,1,-1},{11869,3,0,-1},{11870,3,1,-1},{11803,3,1,-1}, +{11873,3,0,-1},{11874,3,1,-1},{11877,3,0,-1},{11878,3,1,-1},{11882,3,0,-1}, +{11883,3,1,-1},{11886,3,0,-1},{11887,3,1,-1},{11890,3,0,-1},{11891,3,1,-1}, +{11895,3,0,-1},{11896,3,1,-1},{11899,3,0,-1},{11900,3,1,-1},{11903,3,0,-1}, +{11904,3,1,-1},{11908,3,0,-1},{11909,3,1,-1},{11912,3,0,-1},{11913,3,1,-1}, +{11916,3,0,-1},{11917,3,1,-1},{11921,3,0,-1},{11922,3,1,-1},{11925,3,0,-1}, +{11926,3,1,-1},{11929,3,0,-1},{11930,3,1,-1},{11934,3,0,-1},{11935,3,1,-1}, +{11938,3,0,-1},{11939,3,1,-1},{11942,3,0,-1},{11943,3,1,-1},{11947,3,0,-1}, +{11948,3,1,-1},{11951,3,0,-1},{11952,3,1,-1},{11955,3,0,-1},{11956,3,1,-1}, +{11960,3,0,-1},{11961,3,1,-1},{11894,3,0,-1},{11964,3,0,-1},{11965,3,1,-1}, +{11968,3,0,-1},{11969,3,1,-1},{11973,3,0,-1},{11974,3,1,-1},{11907,3,1,-1}, +{11977,3,0,-1},{11978,3,1,-1},{11981,3,0,-1},{11982,3,1,-1},{11986,3,0,-1}, +{11987,3,1,-1},{11990,3,0,-1},{11991,3,1,-1},{11994,3,0,-1},{11995,3,1,-1}, +{11999,3,0,-1},{12000,3,1,-1},{12003,3,0,-1},{12004,3,1,-1},{12007,3,0,-1}, +{12008,3,1,-1},{12012,3,0,-1},{12013,3,1,-1},{12016,3,0,-1},{12017,3,1,-1}, +{12020,3,0,-1},{12021,3,1,-1},{12025,3,0,-1},{12026,3,1,-1},{12029,3,0,-1}, +{12030,3,1,-1},{12033,3,0,-1},{12034,3,1,-1},{12038,3,0,-1},{12039,3,1,-1}, +{12042,3,0,-1},{12043,3,1,-1},{12046,3,0,-1},{12047,3,1,-1},{12051,3,0,-1}, +{12052,3,1,-1},{12055,3,0,-1},{12056,3,1,-1},{12059,3,0,-1},{12060,3,1,-1}, +{12064,3,0,-1},{12065,3,1,-1},{11998,3,0,-1},{12068,3,0,-1},{12069,3,1,-1}, +{12072,3,0,-1},{12073,3,1,-1},{12077,3,0,-1},{12078,3,1,-1},{12011,3,1,-1}, +{12081,3,0,-1},{12082,3,1,-1},{12085,3,0,-1},{12086,3,1,-1},{12090,3,0,-1}, +{12091,3,1,-1},{12094,3,0,-1},{12095,3,1,-1},{12098,3,0,-1},{12099,3,1,-1}, +{12103,3,0,-1},{12104,3,1,-1},{12107,3,0,-1},{12108,3,1,-1},{12111,3,0,-1}, +{12112,3,1,-1},{12116,3,0,-1},{12117,3,1,-1},{12120,3,0,-1},{12121,3,1,-1}, +{12124,3,0,-1},{12125,3,1,-1},{12129,3,0,-1},{12130,3,1,-1},{12133,3,0,-1}, +{12134,3,1,-1},{12137,3,0,-1},{12138,3,1,-1},{12142,3,0,-1},{12143,3,1,-1}, +{12146,3,0,-1},{12147,3,1,-1},{12150,3,0,-1},{12151,3,1,-1},{12155,3,0,-1}, +{12156,3,1,-1},{12159,3,0,-1},{12160,3,1,-1},{12164,3,1,-1},{12168,3,0,-1}, +{12169,3,1,-1},{12102,3,0,-1},{12172,3,0,-1},{12173,3,1,-1},{12176,3,0,-1}, +{12177,3,1,-1},{12181,3,0,-1},{12182,3,1,-1},{12115,3,1,-1},{12185,3,0,-1}, +{12186,3,1,-1},{12189,3,0,-1},{12190,3,1,-1},{12194,3,0,-1},{12195,3,1,-1}, +{12198,3,0,-1},{12199,3,1,-1},{12202,3,0,-1},{12203,3,1,-1},{12207,3,0,-1}, +{12208,3,1,-1},{12211,3,0,-1},{12212,3,1,-1},{12216,3,1,-1},{12220,3,0,-1}, +{12221,3,1,-1},{12224,3,0,-1},{12225,3,1,-1},{12228,3,0,-1},{12229,3,1,-1}, +{12233,3,0,-1},{12234,3,1,-1},{12237,3,0,-1},{12238,3,1,-1},{12241,3,0,-1}, +{12242,3,1,-1},{12246,3,0,-1},{12247,3,1,-1},{12250,3,0,-1},{12251,3,1,-1}, +{12254,3,0,-1},{12255,3,1,-1},{12260,3,1,-1},{12264,3,1,-1},{12268,3,1,-1}, +{12273,3,1,-1},{12281,3,1,-1},{12286,3,1,-1},{12290,3,1,-1},{12294,3,1,-1}, +{12299,3,1,-1},{12303,3,1,-1},{12307,3,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_4_ss0_ss1[] = { +{7704,4,0,-1},{7713,4,0,-1},{7722,4,0,-1},{7730,4,0,-1},{7739,4,0,-1}, +{7748,4,0,-1},{7756,4,0,-1},{7765,4,0,-1},{7774,4,0,-1},{7782,4,0,-1}, +{7791,4,0,-1},{7800,4,0,-1},{7808,4,0,-1},{7817,4,0,-1},{7826,4,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7843,4,0,-1},{7852,4,0,-1},{7860,4,0,-1}, +{7865,4,0,-1},{7869,4,0,-1},{7873,4,0,-1},{7878,4,0,-1},{7882,4,0,-1}, +{7886,4,0,-1},{7891,4,0,-1},{7895,4,0,-1},{7899,4,0,-1},{7904,4,0,-1}, +{7908,4,0,-1},{7912,4,0,-1},{7917,4,0,-1},{7921,4,0,-1},{7925,4,0,-1}, +{7930,4,0,-1},{7864,4,0,-1},{7934,4,0,-1},{7938,4,0,-1},{7943,4,0,-1}, +{7947,4,0,-1},{7951,4,0,-1},{7956,4,0,-1},{7960,4,0,-1},{7964,4,0,-1}, +{7969,4,0,-1},{7973,4,0,-1},{7977,4,0,-1},{7982,4,0,-1},{7986,4,0,-1}, +{7990,4,0,-1},{7995,4,0,-1},{7999,4,0,-1},{8003,4,0,-1},{8008,4,0,-1}, +{8012,4,0,-1},{8016,4,0,-1},{8021,4,0,-1},{8025,4,0,-1},{8029,4,0,-1}, +{8034,4,0,-1},{7968,4,0,-1},{8038,4,0,-1},{8042,4,0,-1},{8047,4,0,-1}, +{8051,4,0,-1},{8055,4,0,-1},{8060,4,0,-1},{8064,4,0,-1},{8068,4,0,-1}, +{8073,4,0,-1},{8077,4,0,-1},{8081,4,0,-1},{8086,4,0,-1},{8090,4,0,-1}, +{8094,4,0,-1},{8099,4,0,-1},{8103,4,0,-1},{8107,4,0,-1},{8112,4,0,-1}, +{8116,4,0,-1},{8120,4,0,-1},{8121,4,1,-1},{8125,4,0,-1},{8129,4,0,-1}, +{8130,4,1,-1},{8133,4,0,-1},{8138,4,0,-1},{8139,4,1,-1},{8072,4,0,-1}, +{8142,4,0,-1},{8146,4,0,-1},{8147,4,1,-1},{8151,4,0,-1},{8155,4,0,-1}, +{8156,4,1,-1},{8159,4,0,-1},{8164,4,0,-1},{8165,4,1,-1},{8168,4,0,-1}, +{8172,4,0,-1},{8173,4,1,-1},{8177,4,0,-1},{8181,4,0,-1},{8182,4,1,-1}, +{8185,4,0,-1},{8190,4,0,-1},{8191,4,1,-1},{8194,4,0,-1},{8198,4,0,-1}, +{8199,4,1,-1},{8203,4,0,-1},{8207,4,0,-1},{8208,4,1,-1},{8211,4,0,-1}, +{8216,4,0,-1},{8217,4,1,-1},{8220,4,0,-1},{8224,4,0,-1},{8225,4,1,-1}, +{8229,4,0,-1},{8230,4,1,-1},{8233,4,0,-1},{8234,4,1,-1},{8237,4,0,-1}, +{8238,4,1,-1},{8242,4,0,-1},{8243,4,1,-1},{8176,4,0,-1},{8246,4,0,-1}, +{8247,4,1,-1},{8250,4,0,-1},{8251,4,1,-1},{8255,4,0,-1},{8189,4,1,-1}, +{8259,4,0,-1},{8260,4,1,-1},{8263,4,0,-1},{8264,4,1,-1},{8268,4,0,-1}, +{8269,4,1,-1},{8272,4,0,-1},{8273,4,1,-1},{8276,4,0,-1},{8277,4,1,-1}, +{8281,4,0,-1},{8282,4,1,-1},{8285,4,0,-1},{8286,4,1,-1},{8289,4,0,-1}, +{8290,4,1,-1},{8294,4,0,-1},{8295,4,1,-1},{8299,4,1,-1},{8302,4,0,-1}, +{8303,4,1,-1},{8307,4,0,-1},{8308,4,1,-1},{8311,4,0,-1},{8312,4,1,-1}, +{8315,4,0,-1},{8316,4,1,-1},{8320,4,0,-1},{8321,4,1,-1},{8324,4,0,-1}, +{8325,4,1,-1},{8328,4,0,-1},{8329,4,1,-1},{8333,4,0,-1},{8334,4,1,-1}, +{8337,4,0,-1},{8338,4,1,-1},{8341,4,0,-1},{8342,4,1,-1},{8346,4,0,-1}, +{8347,4,1,-1},{8280,4,0,-1},{8350,4,0,-1},{8351,4,1,-1},{8354,4,0,-1}, +{8355,4,1,-1},{8359,4,0,-1},{8360,4,1,-1},{8293,4,1,-1},{8363,4,0,-1}, +{8364,4,1,-1},{8367,4,0,-1},{8368,4,1,-1},{8372,4,0,-1},{8373,4,1,-1}, +{8376,4,0,-1},{8377,4,1,-1},{8380,4,0,-1},{8381,4,1,-1},{8385,4,0,-1}, +{8386,4,1,-1},{8389,4,0,-1},{8390,4,1,-1},{8393,4,0,-1},{8394,4,1,-1}, +{8398,4,0,-1},{8399,4,1,-1},{8402,4,0,-1},{8403,4,1,-1},{8406,4,0,-1}, +{8407,4,1,-1},{8411,4,0,-1},{8412,4,1,-1},{8415,4,0,-1},{8416,4,1,-1}, +{8419,4,0,-1},{8420,4,1,-1},{8424,4,0,-1},{8425,4,1,-1},{8428,4,0,-1}, +{8429,4,1,-1},{8432,4,0,-1},{8433,4,1,-1},{8437,4,0,-1},{8438,4,1,-1}, +{8441,4,0,-1},{8442,4,1,-1},{8445,4,0,-1},{8446,4,1,-1},{8450,4,0,-1}, +{8451,4,1,-1},{8384,4,0,-1},{8454,4,0,-1},{8455,4,1,-1},{8458,4,0,-1}, +{8459,4,1,-1},{8463,4,0,-1},{8397,4,1,-1},{8467,4,0,-1},{8468,4,1,-1}, +{8471,4,0,-1},{8472,4,1,-1},{8476,4,0,-1},{8477,4,1,-1},{8480,4,0,-1}, +{8481,4,1,-1},{8484,4,0,-1},{8485,4,1,-1},{8489,4,0,-1},{8490,4,1,-1}, +{8493,4,0,-1},{8494,4,1,-1},{8497,4,0,-1},{8498,4,1,-1},{8502,4,0,-1}, +{8503,4,1,-1},{8507,4,1,-1},{8510,4,0,-1},{8511,4,1,-1},{8515,4,0,-1}, +{8519,4,0,-1},{8520,4,1,-1},{8523,4,0,-1},{8524,4,1,-1},{8528,4,0,-1}, +{8529,4,1,-1},{8532,4,0,-1},{8533,4,1,-1},{8536,4,0,-1},{8537,4,1,-1}, +{8541,4,0,-1},{8542,4,1,-1},{8545,4,0,-1},{8546,4,1,-1},{8549,4,0,-1}, +{8550,4,1,-1},{8554,4,0,-1},{8555,4,1,-1},{8488,4,0,-1},{8558,4,0,-1}, +{8559,4,1,-1},{8562,4,0,-1},{8563,4,1,-1},{8567,4,0,-1},{8568,4,1,-1}, +{8501,4,1,-1},{8571,4,0,-1},{8572,4,1,-1},{8575,4,0,-1},{8576,4,1,-1}, +{8580,4,0,-1},{8581,4,1,-1},{8584,4,0,-1},{8585,4,1,-1},{8588,4,0,-1}, +{8589,4,1,-1},{8593,4,0,-1},{8594,4,1,-1},{8597,4,0,-1},{8598,4,1,-1}, +{8601,4,0,-1},{8602,4,1,-1},{8606,4,0,-1},{8607,4,1,-1},{8610,4,0,-1}, +{8611,4,1,-1},{8614,4,0,-1},{8615,4,1,-1},{8619,4,0,-1},{8620,4,1,-1}, +{8623,4,0,-1},{8624,4,1,-1},{8627,4,0,-1},{8628,4,1,-1},{8632,4,0,-1}, +{8633,4,1,-1},{8636,4,0,-1},{8637,4,1,-1},{8640,4,0,-1},{8641,4,1,-1}, +{8645,4,0,-1},{8646,4,1,-1},{8649,4,0,-1},{8650,4,1,-1},{8653,4,0,-1}, +{8654,4,1,-1},{8658,4,0,-1},{8659,4,1,-1},{8592,4,0,-1},{8662,4,0,-1}, +{8663,4,1,-1},{8666,4,0,-1},{8667,4,1,-1},{8671,4,0,-1},{8672,4,1,-1}, +{8605,4,1,-1},{8675,4,0,-1},{8676,4,1,-1},{8679,4,0,-1},{8680,4,1,-1}, +{8684,4,0,-1},{8685,4,1,-1},{8688,4,0,-1},{8689,4,1,-1},{8692,4,0,-1}, +{8693,4,1,-1},{8697,4,0,-1},{8698,4,1,-1},{8701,4,0,-1},{8702,4,1,-1}, +{8705,4,0,-1},{8706,4,1,-1},{8710,4,0,-1},{8711,4,1,-1},{8714,4,0,-1}, +{8715,4,1,-1},{8718,4,0,-1},{8719,4,1,-1},{8723,4,0,-1},{8724,4,1,-1}, +{8727,4,0,-1},{8728,4,1,-1},{8731,4,0,-1},{8732,4,1,-1},{8736,4,0,-1}, +{8737,4,1,-1},{8740,4,0,-1},{8741,4,1,-1},{8744,4,0,-1},{8745,4,1,-1}, +{8749,4,0,-1},{8750,4,1,-1},{8753,4,0,-1},{8754,4,1,-1},{8757,4,0,-1}, +{8758,4,1,-1},{8762,4,0,-1},{8763,4,1,-1},{8696,4,0,-1},{8766,4,0,-1}, +{8767,4,1,-1},{8770,4,0,-1},{8771,4,1,-1},{8775,4,0,-1},{8776,4,1,-1}, +{8709,4,1,-1},{8779,4,0,-1},{8780,4,1,-1},{8783,4,0,-1},{8784,4,1,-1}, +{8788,4,0,-1},{8789,4,1,-1},{8792,4,0,-1},{8793,4,1,-1},{8796,4,0,-1}, +{8797,4,1,-1},{8801,4,0,-1},{8802,4,1,-1},{8805,4,0,-1},{8806,4,1,-1}, +{8809,4,0,-1},{8810,4,1,-1},{8814,4,0,-1},{8815,4,1,-1},{8818,4,0,-1}, +{8819,4,1,-1},{8822,4,0,-1},{8823,4,1,-1},{8827,4,0,-1},{8828,4,1,-1}, +{8831,4,0,-1},{8832,4,1,-1},{8835,4,0,-1},{8836,4,1,-1},{8840,4,0,-1}, +{8841,4,1,-1},{8844,4,0,-1},{8845,4,1,-1},{8848,4,0,-1},{8849,4,1,-1}, +{8853,4,0,-1},{8854,4,1,-1},{8857,4,0,-1},{8858,4,1,-1},{8861,4,0,-1}, +{8862,4,1,-1},{8866,4,0,-1},{8867,4,1,-1},{8800,4,0,-1},{8870,4,0,-1}, +{8871,4,1,-1},{8874,4,0,-1},{8875,4,1,-1},{8879,4,0,-1},{8880,4,1,-1}, +{8813,4,1,-1},{8883,4,0,-1},{8884,4,1,-1},{8887,4,0,-1},{8888,4,1,-1}, +{8892,4,0,-1},{8893,4,1,-1},{8896,4,0,-1},{8897,4,1,-1},{8900,4,0,-1}, +{8901,4,1,-1},{8905,4,0,-1},{8906,4,1,-1},{8909,4,0,-1},{8910,4,1,-1}, +{8913,4,0,-1},{8914,4,1,-1},{8918,4,0,-1},{8919,4,1,-1},{8922,4,0,-1}, +{8923,4,1,-1},{8926,4,0,-1},{8927,4,1,-1},{8931,4,0,-1},{8932,4,1,-1}, +{8935,4,0,-1},{8936,4,1,-1},{8939,4,0,-1},{8940,4,1,-1},{8944,4,0,-1}, +{8945,4,1,-1},{8948,4,0,-1},{8949,4,1,-1},{8952,4,0,-1},{8953,4,1,-1}, +{8957,4,0,-1},{8958,4,1,-1},{8961,4,0,-1},{8962,4,1,-1},{8965,4,0,-1}, +{8966,4,1,-1},{8970,4,0,-1},{8971,4,1,-1},{8904,4,0,-1},{8974,4,0,-1}, +{8975,4,1,-1},{8978,4,0,-1},{8979,4,1,-1},{8983,4,0,-1},{8984,4,1,-1}, +{8917,4,1,-1},{8987,4,0,-1},{8988,4,1,-1},{8991,4,0,-1},{8992,4,1,-1}, +{8996,4,0,-1},{8997,4,1,-1},{9000,4,0,-1},{9001,4,1,-1},{9004,4,0,-1}, +{9005,4,1,-1},{9009,4,0,-1},{9010,4,1,-1},{9013,4,0,-1},{9014,4,1,-1}, +{9017,4,0,-1},{9018,4,1,-1},{9022,4,0,-1},{9023,4,1,-1},{9026,4,0,-1}, +{9027,4,1,-1},{9030,4,0,-1},{9031,4,1,-1},{9035,4,0,-1},{9036,4,1,-1}, +{9039,4,0,-1},{9040,4,1,-1},{9043,4,0,-1},{9044,4,1,-1},{9048,4,0,-1}, +{9049,4,1,-1},{9052,4,0,-1},{9053,4,1,-1},{9056,4,0,-1},{9057,4,1,-1}, +{9061,4,0,-1},{9062,4,1,-1},{9065,4,0,-1},{9066,4,1,-1},{9069,4,0,-1}, +{9070,4,1,-1},{9074,4,0,-1},{9075,4,1,-1},{9008,4,0,-1},{9078,4,0,-1}, +{9079,4,1,-1},{9082,4,0,-1},{9083,4,1,-1},{9087,4,0,-1},{9088,4,1,-1}, +{9021,4,1,-1},{9091,4,0,-1},{9092,4,1,-1},{9095,4,0,-1},{9096,4,1,-1}, +{9100,4,0,-1},{9101,4,1,-1},{9104,4,0,-1},{9105,4,1,-1},{9108,4,0,-1}, +{9109,4,1,-1},{9113,4,0,-1},{9114,4,1,-1},{9117,4,0,-1},{9118,4,1,-1}, +{9121,4,0,-1},{9122,4,1,-1},{9126,4,0,-1},{9127,4,1,-1},{9130,4,0,-1}, +{9131,4,1,-1},{9134,4,0,-1},{9135,4,1,-1},{9139,4,0,-1},{9140,4,1,-1}, +{9143,4,0,-1},{9144,4,1,-1},{9147,4,0,-1},{9148,4,1,-1},{9152,4,0,-1}, +{9153,4,1,-1},{9156,4,0,-1},{9157,4,1,-1},{9160,4,0,-1},{9161,4,1,-1}, +{9165,4,0,-1},{9166,4,1,-1},{9169,4,0,-1},{9170,4,1,-1},{9173,4,0,-1}, +{9174,4,1,-1},{9178,4,0,-1},{9179,4,1,-1},{9112,4,0,-1},{9182,4,0,-1}, +{9183,4,1,-1},{9186,4,0,-1},{9187,4,1,-1},{9191,4,0,-1},{9192,4,1,-1}, +{9125,4,1,-1},{9195,4,0,-1},{9196,4,1,-1},{9199,4,0,-1},{9200,4,1,-1}, +{9204,4,0,-1},{9205,4,1,-1},{9208,4,0,-1},{9209,4,1,-1},{9212,4,0,-1}, +{9213,4,1,-1},{9217,4,0,-1},{9218,4,1,-1},{9221,4,0,-1},{9222,4,1,-1}, +{9225,4,0,-1},{9226,4,1,-1},{9230,4,0,-1},{9231,4,1,-1},{9234,4,0,-1}, +{9235,4,1,-1},{9238,4,0,-1},{9239,4,1,-1},{9243,4,0,-1},{9244,4,1,-1}, +{9247,4,0,-1},{9248,4,1,-1},{9251,4,0,-1},{9252,4,1,-1},{9256,4,0,-1}, +{9257,4,1,-1},{9260,4,0,-1},{9261,4,1,-1},{9264,4,0,-1},{9265,4,1,-1}, +{9269,4,0,-1},{9270,4,1,-1},{9273,4,0,-1},{9274,4,1,-1},{9277,4,0,-1}, +{9278,4,1,-1},{9282,4,0,-1},{9283,4,1,-1},{9216,4,0,-1},{9286,4,0,-1}, +{9287,4,1,-1},{9290,4,0,-1},{9291,4,1,-1},{9295,4,0,-1},{9296,4,1,-1}, +{9229,4,1,-1},{9299,4,0,-1},{9300,4,1,-1},{9303,4,0,-1},{9304,4,1,-1}, +{9308,4,0,-1},{9309,4,1,-1},{9312,4,0,-1},{9313,4,1,-1},{9316,4,0,-1}, +{9317,4,1,-1},{9321,4,0,-1},{9322,4,1,-1},{9325,4,0,-1},{9326,4,1,-1}, +{9329,4,0,-1},{9330,4,1,-1},{9334,4,0,-1},{9335,4,1,-1},{9338,4,0,-1}, +{9339,4,1,-1},{9342,4,0,-1},{9343,4,1,-1},{9347,4,0,-1},{9348,4,1,-1}, +{9351,4,0,-1},{9352,4,1,-1},{9355,4,0,-1},{9356,4,1,-1},{9360,4,0,-1}, +{9361,4,1,-1},{9364,4,0,-1},{9365,4,1,-1},{9368,4,0,-1},{9369,4,1,-1}, +{9373,4,0,-1},{9374,4,1,-1},{9377,4,0,-1},{9378,4,1,-1},{9381,4,0,-1}, +{9382,4,1,-1},{9386,4,0,-1},{9387,4,1,-1},{9320,4,0,-1},{9390,4,0,-1}, +{9391,4,1,-1},{9394,4,0,-1},{9395,4,1,-1},{9399,4,0,-1},{9400,4,1,-1}, +{9333,4,1,-1},{9403,4,0,-1},{9404,4,1,-1},{9407,4,0,-1},{9408,4,1,-1}, +{9412,4,0,-1},{9413,4,1,-1},{9416,4,0,-1},{9417,4,1,-1},{9420,4,0,-1}, +{9421,4,1,-1},{9425,4,0,-1},{9426,4,1,-1},{9429,4,0,-1},{9430,4,1,-1}, +{9433,4,0,-1},{9434,4,1,-1},{9438,4,0,-1},{9439,4,1,-1},{9442,4,0,-1}, +{9443,4,1,-1},{9446,4,0,-1},{9447,4,1,-1},{9451,4,0,-1},{9452,4,1,-1}, +{9455,4,0,-1},{9456,4,1,-1},{9459,4,0,-1},{9460,4,1,-1},{9464,4,0,-1}, +{9465,4,1,-1},{9468,4,0,-1},{9469,4,1,-1},{9472,4,0,-1},{9473,4,1,-1}, +{9477,4,0,-1},{9478,4,1,-1},{9481,4,0,-1},{9482,4,1,-1},{9485,4,0,-1}, +{9486,4,1,-1},{9490,4,0,-1},{9491,4,1,-1},{9424,4,0,-1},{9494,4,0,-1}, +{9495,4,1,-1},{9498,4,0,-1},{9499,4,1,-1},{9503,4,0,-1},{9504,4,1,-1}, +{9437,4,1,-1},{9507,4,0,-1},{9508,4,1,-1},{9511,4,0,-1},{9512,4,1,-1}, +{9516,4,0,-1},{9517,4,1,-1},{9520,4,0,-1},{9521,4,1,-1},{9524,4,0,-1}, +{9525,4,1,-1},{9529,4,0,-1},{9530,4,1,-1},{9533,4,0,-1},{9534,4,1,-1}, +{9537,4,0,-1},{9538,4,1,-1},{9542,4,0,-1},{9543,4,1,-1},{9546,4,0,-1}, +{9547,4,1,-1},{9550,4,0,-1},{9551,4,1,-1},{9555,4,0,-1},{9556,4,1,-1}, +{9559,4,0,-1},{9560,4,1,-1},{9563,4,0,-1},{9564,4,1,-1},{9568,4,0,-1}, +{9569,4,1,-1},{9572,4,0,-1},{9573,4,1,-1},{9576,4,0,-1},{9577,4,1,-1}, +{9581,4,0,-1},{9582,4,1,-1},{9585,4,0,-1},{9586,4,1,-1},{9589,4,0,-1}, +{9590,4,1,-1},{9594,4,0,-1},{9595,4,1,-1},{9528,4,0,-1},{9598,4,0,-1}, +{9599,4,1,-1},{9602,4,0,-1},{9603,4,1,-1},{9607,4,0,-1},{9608,4,1,-1}, +{9541,4,1,-1},{9611,4,0,-1},{9612,4,1,-1},{9615,4,0,-1},{9616,4,1,-1}, +{9620,4,0,-1},{9621,4,1,-1},{9624,4,0,-1},{9625,4,1,-1},{9628,4,0,-1}, +{9629,4,1,-1},{9633,4,0,-1},{9634,4,1,-1},{9637,4,0,-1},{9638,4,1,-1}, +{9641,4,0,-1},{9642,4,1,-1},{9646,4,0,-1},{9647,4,1,-1},{9650,4,0,-1}, +{9651,4,1,-1},{9654,4,0,-1},{9655,4,1,-1},{9659,4,0,-1},{9660,4,1,-1}, +{9663,4,0,-1},{9664,4,1,-1},{9667,4,0,-1},{9668,4,1,-1},{9672,4,0,-1}, +{9673,4,1,-1},{9676,4,0,-1},{9677,4,1,-1},{9680,4,0,-1},{9681,4,1,-1}, +{9685,4,0,-1},{9686,4,1,-1},{9689,4,0,-1},{9690,4,1,-1},{9693,4,0,-1}, +{9694,4,1,-1},{9698,4,0,-1},{9699,4,1,-1},{9632,4,0,-1},{9702,4,0,-1}, +{9703,4,1,-1},{9706,4,0,-1},{9707,4,1,-1},{9711,4,0,-1},{9712,4,1,-1}, +{9645,4,1,-1},{9715,4,0,-1},{9716,4,1,-1},{9719,4,0,-1},{9720,4,1,-1}, +{9724,4,0,-1},{9725,4,1,-1},{9728,4,0,-1},{9729,4,1,-1},{9732,4,0,-1}, +{9733,4,1,-1},{9737,4,0,-1},{9738,4,1,-1},{9741,4,0,-1},{9742,4,1,-1}, +{9745,4,0,-1},{9746,4,1,-1},{9750,4,0,-1},{9751,4,1,-1},{9754,4,0,-1}, +{9755,4,1,-1},{9758,4,0,-1},{9759,4,1,-1},{9763,4,0,-1},{9764,4,1,-1}, +{9767,4,0,-1},{9768,4,1,-1},{9771,4,0,-1},{9772,4,1,-1},{9776,4,0,-1}, +{9777,4,1,-1},{9780,4,0,-1},{9781,4,1,-1},{9784,4,0,-1},{9785,4,1,-1}, +{9789,4,0,-1},{9790,4,1,-1},{9793,4,0,-1},{9794,4,1,-1},{9797,4,0,-1}, +{9798,4,1,-1},{9802,4,0,-1},{9803,4,1,-1},{9736,4,0,-1},{9806,4,0,-1}, +{9807,4,1,-1},{9810,4,0,-1},{9811,4,1,-1},{9815,4,0,-1},{9816,4,1,-1}, +{9749,4,1,-1},{9819,4,0,-1},{9820,4,1,-1},{9823,4,0,-1},{9824,4,1,-1}, +{9828,4,0,-1},{9829,4,1,-1},{9832,4,0,-1},{9833,4,1,-1},{9836,4,0,-1}, +{9837,4,1,-1},{9841,4,0,-1},{9842,4,1,-1},{9845,4,0,-1},{9846,4,1,-1}, +{9849,4,0,-1},{9850,4,1,-1},{9854,4,0,-1},{9855,4,1,-1},{9858,4,0,-1}, +{9859,4,1,-1},{9862,4,0,-1},{9863,4,1,-1},{9867,4,0,-1},{9868,4,1,-1}, +{9871,4,0,-1},{9872,4,1,-1},{9875,4,0,-1},{9876,4,1,-1},{9880,4,0,-1}, +{9881,4,1,-1},{9884,4,0,-1},{9885,4,1,-1},{9888,4,0,-1},{9889,4,1,-1}, +{9893,4,0,-1},{9894,4,1,-1},{9897,4,0,-1},{9898,4,1,-1},{9901,4,0,-1}, +{9902,4,1,-1},{9906,4,0,-1},{9907,4,1,-1},{9840,4,0,-1},{9910,4,0,-1}, +{9911,4,1,-1},{9914,4,0,-1},{9915,4,1,-1},{9919,4,0,-1},{9920,4,1,-1}, +{9853,4,1,-1},{9923,4,0,-1},{9924,4,1,-1},{9927,4,0,-1},{9928,4,1,-1}, +{9932,4,0,-1},{9933,4,1,-1},{9936,4,0,-1},{9937,4,1,-1},{9940,4,0,-1}, +{9941,4,1,-1},{9945,4,0,-1},{9946,4,1,-1},{9949,4,0,-1},{9950,4,1,-1}, +{9953,4,0,-1},{9954,4,1,-1},{9958,4,0,-1},{9959,4,1,-1},{9962,4,0,-1}, +{9963,4,1,-1},{9966,4,0,-1},{9967,4,1,-1},{9971,4,0,-1},{9972,4,1,-1}, +{9975,4,0,-1},{9976,4,1,-1},{9979,4,0,-1},{9980,4,1,-1},{9984,4,0,-1}, +{9985,4,1,-1},{9988,4,0,-1},{9989,4,1,-1},{9992,4,0,-1},{9993,4,1,-1}, +{9997,4,0,-1},{9998,4,1,-1},{10001,4,0,-1},{10002,4,1,-1},{10005,4,0,-1}, +{10006,4,1,-1},{10010,4,0,-1},{10011,4,1,-1},{9944,4,0,-1},{10014,4,0,-1}, +{10015,4,1,-1},{10018,4,0,-1},{10019,4,1,-1},{10023,4,0,-1},{10024,4,1,-1}, +{9957,4,1,-1},{10027,4,0,-1},{10028,4,1,-1},{10031,4,0,-1},{10032,4,1,-1}, +{10036,4,0,-1},{10037,4,1,-1},{10040,4,0,-1},{10041,4,1,-1},{10044,4,0,-1}, +{10045,4,1,-1},{10049,4,0,-1},{10050,4,1,-1},{10053,4,0,-1},{10054,4,1,-1}, +{10057,4,0,-1},{10058,4,1,-1},{10062,4,0,-1},{10063,4,1,-1},{10066,4,0,-1}, +{10067,4,1,-1},{10070,4,0,-1},{10071,4,1,-1},{10075,4,0,-1},{10076,4,1,-1}, +{10079,4,0,-1},{10080,4,1,-1},{10083,4,0,-1},{10084,4,1,-1},{10088,4,0,-1}, +{10089,4,1,-1},{10092,4,0,-1},{10093,4,1,-1},{10096,4,0,-1},{10097,4,1,-1}, +{10101,4,0,-1},{10102,4,1,-1},{10105,4,0,-1},{10106,4,1,-1},{10109,4,0,-1}, +{10110,4,1,-1},{10114,4,0,-1},{10115,4,1,-1},{10048,4,0,-1},{10118,4,0,-1}, +{10119,4,1,-1},{10122,4,0,-1},{10123,4,1,-1},{10127,4,0,-1},{10128,4,1,-1}, +{10061,4,1,-1},{10131,4,0,-1},{10132,4,1,-1},{10135,4,0,-1},{10136,4,1,-1}, +{10140,4,0,-1},{10141,4,1,-1},{10144,4,0,-1},{10145,4,1,-1},{10148,4,0,-1}, +{10149,4,1,-1},{10153,4,0,-1},{10154,4,1,-1},{10157,4,0,-1},{10158,4,1,-1}, +{10161,4,0,-1},{10162,4,1,-1},{10166,4,0,-1},{10167,4,1,-1},{10170,4,0,-1}, +{10171,4,1,-1},{10174,4,0,-1},{10175,4,1,-1},{10179,4,0,-1},{10180,4,1,-1}, +{10183,4,0,-1},{10184,4,1,-1},{10187,4,0,-1},{10188,4,1,-1},{10192,4,0,-1}, +{10193,4,1,-1},{10196,4,0,-1},{10197,4,1,-1},{10200,4,0,-1},{10201,4,1,-1}, +{10205,4,0,-1},{10206,4,1,-1},{10209,4,0,-1},{10210,4,1,-1},{10213,4,0,-1}, +{10214,4,1,-1},{10218,4,0,-1},{10219,4,1,-1},{10152,4,0,-1},{10222,4,0,-1}, +{10223,4,1,-1},{10226,4,0,-1},{10227,4,1,-1},{10231,4,0,-1},{10232,4,1,-1}, +{10165,4,1,-1},{10235,4,0,-1},{10236,4,1,-1},{10239,4,0,-1},{10240,4,1,-1}, +{10244,4,0,-1},{10245,4,1,-1},{10248,4,0,-1},{10249,4,1,-1},{10252,4,0,-1}, +{10253,4,1,-1},{10257,4,0,-1},{10258,4,1,-1},{10261,4,0,-1},{10262,4,1,-1}, +{10265,4,0,-1},{10266,4,1,-1},{10270,4,0,-1},{10271,4,1,-1},{10274,4,0,-1}, +{10275,4,1,-1},{10278,4,0,-1},{10279,4,1,-1},{10283,4,0,-1},{10284,4,1,-1}, +{10287,4,0,-1},{10288,4,1,-1},{10291,4,0,-1},{10292,4,1,-1},{10296,4,0,-1}, +{10297,4,1,-1},{10300,4,0,-1},{10301,4,1,-1},{10304,4,0,-1},{10305,4,1,-1}, +{10309,4,0,-1},{10310,4,1,-1},{10313,4,0,-1},{10314,4,1,-1},{10317,4,0,-1}, +{10318,4,1,-1},{10322,4,0,-1},{10323,4,1,-1},{10256,4,0,-1},{10326,4,0,-1}, +{10327,4,1,-1},{10330,4,0,-1},{10331,4,1,-1},{10335,4,0,-1},{10336,4,1,-1}, +{10269,4,1,-1},{10339,4,0,-1},{10340,4,1,-1},{10343,4,0,-1},{10344,4,1,-1}, +{10348,4,0,-1},{10349,4,1,-1},{10352,4,0,-1},{10353,4,1,-1},{10356,4,0,-1}, +{10357,4,1,-1},{10361,4,0,-1},{10362,4,1,-1},{10365,4,0,-1},{10366,4,1,-1}, +{10369,4,0,-1},{10370,4,1,-1},{10374,4,0,-1},{10375,4,1,-1},{10378,4,0,-1}, +{10379,4,1,-1},{10382,4,0,-1},{10383,4,1,-1},{10387,4,0,-1},{10388,4,1,-1}, +{10391,4,0,-1},{10392,4,1,-1},{10395,4,0,-1},{10396,4,1,-1},{10400,4,0,-1}, +{10401,4,1,-1},{10404,4,0,-1},{10405,4,1,-1},{10408,4,0,-1},{10409,4,1,-1}, +{10413,4,0,-1},{10414,4,1,-1},{10417,4,0,-1},{10418,4,1,-1},{10421,4,0,-1}, +{10422,4,1,-1},{10426,4,0,-1},{10427,4,1,-1},{10360,4,0,-1},{10430,4,0,-1}, +{10431,4,1,-1},{10434,4,0,-1},{10435,4,1,-1},{10439,4,0,-1},{10440,4,1,-1}, +{10373,4,1,-1},{10443,4,0,-1},{10444,4,1,-1},{10447,4,0,-1},{10448,4,1,-1}, +{10452,4,0,-1},{10453,4,1,-1},{10456,4,0,-1},{10457,4,1,-1},{10460,4,0,-1}, +{10461,4,1,-1},{10465,4,0,-1},{10466,4,1,-1},{10469,4,0,-1},{10470,4,1,-1}, +{10473,4,0,-1},{10474,4,1,-1},{10478,4,0,-1},{10479,4,1,-1},{10482,4,0,-1}, +{10483,4,1,-1},{10486,4,0,-1},{10487,4,1,-1},{10491,4,0,-1},{10492,4,1,-1}, +{10495,4,0,-1},{10496,4,1,-1},{10499,4,0,-1},{10500,4,1,-1},{10504,4,0,-1}, +{10505,4,1,-1},{10508,4,0,-1},{10509,4,1,-1},{10512,4,0,-1},{10513,4,1,-1}, +{10517,4,0,-1},{10518,4,1,-1},{10521,4,0,-1},{10522,4,1,-1},{10525,4,0,-1}, +{10526,4,1,-1},{10530,4,0,-1},{10531,4,1,-1},{10464,4,0,-1},{10534,4,0,-1}, +{10535,4,1,-1},{10538,4,0,-1},{10539,4,1,-1},{10543,4,0,-1},{10544,4,1,-1}, +{10477,4,1,-1},{10547,4,0,-1},{10548,4,1,-1},{10551,4,0,-1},{10552,4,1,-1}, +{10556,4,0,-1},{10557,4,1,-1},{10560,4,0,-1},{10561,4,1,-1},{10564,4,0,-1}, +{10565,4,1,-1},{10569,4,0,-1},{10570,4,1,-1},{10573,4,0,-1},{10574,4,1,-1}, +{10577,4,0,-1},{10578,4,1,-1},{10582,4,0,-1},{10583,4,1,-1},{10586,4,0,-1}, +{10587,4,1,-1},{10590,4,0,-1},{10591,4,1,-1},{10595,4,0,-1},{10596,4,1,-1}, +{10599,4,0,-1},{10600,4,1,-1},{10603,4,0,-1},{10604,4,1,-1},{10608,4,0,-1}, +{10609,4,1,-1},{10612,4,0,-1},{10613,4,1,-1},{10616,4,0,-1},{10617,4,1,-1}, +{10621,4,0,-1},{10622,4,1,-1},{10625,4,0,-1},{10626,4,1,-1},{10629,4,0,-1}, +{10630,4,1,-1},{10634,4,0,-1},{10635,4,1,-1},{10568,4,0,-1},{10638,4,0,-1}, +{10639,4,1,-1},{10642,4,0,-1},{10643,4,1,-1},{10647,4,0,-1},{10648,4,1,-1}, +{10581,4,1,-1},{10651,4,0,-1},{10652,4,1,-1},{10655,4,0,-1},{10656,4,1,-1}, +{10660,4,0,-1},{10661,4,1,-1},{10664,4,0,-1},{10665,4,1,-1},{10668,4,0,-1}, +{10669,4,1,-1},{10673,4,0,-1},{10674,4,1,-1},{10677,4,0,-1},{10678,4,1,-1}, +{10681,4,0,-1},{10682,4,1,-1},{10686,4,0,-1},{10687,4,1,-1},{10690,4,0,-1}, +{10691,4,1,-1},{10694,4,0,-1},{10695,4,1,-1},{10699,4,0,-1},{10700,4,1,-1}, +{10703,4,0,-1},{10704,4,1,-1},{10707,4,0,-1},{10708,4,1,-1},{10712,4,0,-1}, +{10713,4,1,-1},{10716,4,0,-1},{10717,4,1,-1},{10720,4,0,-1},{10721,4,1,-1}, +{10725,4,0,-1},{10726,4,1,-1},{10729,4,0,-1},{10730,4,1,-1},{10733,4,0,-1}, +{10734,4,1,-1},{10738,4,0,-1},{10739,4,1,-1},{10672,4,0,-1},{10742,4,0,-1}, +{10743,4,1,-1},{10746,4,0,-1},{10747,4,1,-1},{10751,4,0,-1},{10752,4,1,-1}, +{10685,4,1,-1},{10755,4,0,-1},{10756,4,1,-1},{10759,4,0,-1},{10760,4,1,-1}, +{10764,4,0,-1},{10765,4,1,-1},{10768,4,0,-1},{10769,4,1,-1},{10772,4,0,-1}, +{10773,4,1,-1},{10777,4,0,-1},{10778,4,1,-1},{10781,4,0,-1},{10782,4,1,-1}, +{10785,4,0,-1},{10786,4,1,-1},{10790,4,0,-1},{10791,4,1,-1},{10794,4,0,-1}, +{10795,4,1,-1},{10798,4,0,-1},{10799,4,1,-1},{10803,4,0,-1},{10804,4,1,-1}, +{10807,4,0,-1},{10808,4,1,-1},{10811,4,0,-1},{10812,4,1,-1},{10816,4,0,-1}, +{10817,4,1,-1},{10820,4,0,-1},{10821,4,1,-1},{10824,4,0,-1},{10825,4,1,-1}, +{10829,4,0,-1},{10830,4,1,-1},{10833,4,0,-1},{10834,4,1,-1},{10837,4,0,-1}, +{10838,4,1,-1},{10842,4,0,-1},{10843,4,1,-1},{10776,4,0,-1},{10846,4,0,-1}, +{10847,4,1,-1},{10850,4,0,-1},{10851,4,1,-1},{10855,4,0,-1},{10856,4,1,-1}, +{10789,4,1,-1},{10859,4,0,-1},{10860,4,1,-1},{10863,4,0,-1},{10864,4,1,-1}, +{10868,4,0,-1},{10869,4,1,-1},{10872,4,0,-1},{10873,4,1,-1},{10876,4,0,-1}, +{10877,4,1,-1},{10881,4,0,-1},{10882,4,1,-1},{10885,4,0,-1},{10886,4,1,-1}, +{10889,4,0,-1},{10890,4,1,-1},{10894,4,0,-1},{10895,4,1,-1},{10898,4,0,-1}, +{10899,4,1,-1},{10902,4,0,-1},{10903,4,1,-1},{10907,4,0,-1},{10908,4,1,-1}, +{10911,4,0,-1},{10912,4,1,-1},{10915,4,0,-1},{10916,4,1,-1},{10920,4,0,-1}, +{10921,4,1,-1},{10924,4,0,-1},{10925,4,1,-1},{10928,4,0,-1},{10929,4,1,-1}, +{10933,4,0,-1},{10934,4,1,-1},{10937,4,0,-1},{10938,4,1,-1},{10941,4,0,-1}, +{10942,4,1,-1},{10946,4,0,-1},{10947,4,1,-1},{10880,4,0,-1},{10950,4,0,-1}, +{10951,4,1,-1},{10954,4,0,-1},{10955,4,1,-1},{10959,4,0,-1},{10960,4,1,-1}, +{10893,4,1,-1},{10963,4,0,-1},{10964,4,1,-1},{10967,4,0,-1},{10968,4,1,-1}, +{10972,4,0,-1},{10973,4,1,-1},{10976,4,0,-1},{10977,4,1,-1},{10980,4,0,-1}, +{10981,4,1,-1},{10985,4,0,-1},{10986,4,1,-1},{10989,4,0,-1},{10990,4,1,-1}, +{10993,4,0,-1},{10994,4,1,-1},{10998,4,0,-1},{10999,4,1,-1},{11002,4,0,-1}, +{11003,4,1,-1},{11006,4,0,-1},{11007,4,1,-1},{11012,4,1,-1},{11016,4,1,-1}, +{11020,4,1,-1},{11025,4,1,-1},{11029,4,1,-1},{11033,4,1,-1},{11038,4,1,-1}, +{11042,4,1,-1},{11046,4,1,-1},{11051,4,1,-1},{10984,4,0,-1},{11055,4,1,-1}, +{11058,4,0,-1},{11059,4,1,-1},{10997,4,1,-1},{11067,4,0,-1},{11068,4,1,-1}, +{11072,4,1,-1},{11077,4,1,-1},{11081,4,1,-1},{11085,4,1,-1},{11090,4,1,-1}, +{11094,4,1,-1},{11098,4,1,-1},{11102,4,0,-1},{11103,4,1,-1},{11107,4,1,-1}, +{11111,4,1,-1},{11116,4,1,-1},{11120,4,1,-1},{11129,4,1,-1},{11133,4,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_5_ss0_ss1[] = { +{5269,5,0,-1},{5278,5,0,-1},{5286,5,0,-1},{5295,5,0,-1},{5304,5,0,-1}, +{5312,5,0,-1},{5321,5,0,-1},{5330,5,0,-1},{5264,5,0,-1},{5338,5,0,-1}, +{5347,5,0,-1},{5351,5,0,-1},{5356,5,0,-1},{5360,5,0,-1},{5364,5,0,-1}, +{5369,5,0,-1},{5373,5,0,-1},{5377,5,0,-1},{5382,5,0,-1},{5386,5,0,-1}, +{5390,5,0,-1},{5395,5,0,-1},{5399,5,0,-1},{5403,5,0,-1},{5408,5,0,-1}, +{5412,5,0,-1},{5416,5,0,-1},{5421,5,0,-1},{5425,5,0,-1},{5429,5,0,-1}, +{5434,5,0,-1},{5368,5,0,-1},{5438,5,0,-1},{5442,5,0,-1},{5447,5,0,-1}, +{5451,5,0,-1},{5455,5,0,-1},{5460,5,0,-1},{5464,5,0,-1},{5468,5,0,-1}, +{5473,5,0,-1},{5477,5,0,-1},{5481,5,0,-1},{5486,5,0,-1},{5490,5,0,-1}, +{5494,5,0,-1},{5499,5,0,-1},{5503,5,0,-1},{5507,5,0,-1},{5512,5,0,-1}, +{5516,5,0,-1},{5520,5,0,-1},{5525,5,0,-1},{5529,5,0,-1},{5533,5,0,-1}, +{5538,5,0,-1},{5472,5,0,-1},{5542,5,0,-1},{5546,5,0,-1},{5551,5,0,-1}, +{5555,5,0,-1},{5559,5,0,-1},{5564,5,0,-1},{5568,5,0,-1},{5572,5,0,-1}, +{5577,5,0,-1},{5581,5,0,-1},{5585,5,0,-1},{5590,5,0,-1},{5594,5,0,-1}, +{5598,5,0,-1},{5603,5,0,-1},{5607,5,0,-1},{5611,5,0,-1},{5616,5,0,-1}, +{5620,5,0,-1},{5624,5,0,-1},{5629,5,0,-1},{5633,5,0,-1},{5637,5,0,-1}, +{5638,5,1,-1},{5642,5,0,-1},{5576,5,0,-1},{5646,5,0,-1},{5647,5,1,-1}, +{5650,5,0,-1},{5655,5,0,-1},{5656,5,1,-1},{5659,5,0,-1},{5663,5,0,-1}, +{5668,5,0,-1},{5669,5,1,-1},{5672,5,0,-1},{5676,5,0,-1},{5677,5,1,-1}, +{5681,5,0,-1},{5685,5,0,-1},{5686,5,1,-1},{5689,5,0,-1},{5694,5,0,-1}, +{5695,5,1,-1},{5698,5,0,-1},{5702,5,0,-1},{5703,5,1,-1},{5707,5,0,-1}, +{5711,5,0,-1},{5712,5,1,-1},{5715,5,0,-1},{5720,5,0,-1},{5721,5,1,-1}, +{5724,5,0,-1},{5728,5,0,-1},{5729,5,1,-1},{5733,5,0,-1},{5737,5,0,-1}, +{5738,5,1,-1},{5741,5,0,-1},{5746,5,0,-1},{5747,5,1,-1},{5680,5,0,-1}, +{5750,5,0,-1},{5754,5,0,-1},{5755,5,1,-1},{5759,5,0,-1},{5693,5,1,-1}, +{5763,5,0,-1},{5764,5,1,-1},{5767,5,0,-1},{5772,5,0,-1},{5773,5,1,-1}, +{5776,5,0,-1},{5780,5,0,-1},{5781,5,1,-1},{5785,5,0,-1},{5789,5,0,-1}, +{5790,5,1,-1},{5793,5,0,-1},{5798,5,0,-1},{5799,5,1,-1},{5802,5,0,-1}, +{5806,5,0,-1},{5807,5,1,-1},{5811,5,0,-1},{5815,5,0,-1},{5816,5,1,-1}, +{5819,5,0,-1},{5820,5,1,-1},{5824,5,0,-1},{5825,5,1,-1},{5828,5,0,-1}, +{5829,5,1,-1},{5832,5,0,-1},{5833,5,1,-1},{5837,5,0,-1},{5838,5,1,-1}, +{5841,5,0,-1},{5842,5,1,-1},{5845,5,0,-1},{5850,5,0,-1},{5851,5,1,-1}, +{5784,5,0,-1},{5854,5,0,-1},{5855,5,1,-1},{5858,5,0,-1},{5859,5,1,-1}, +{5863,5,0,-1},{5864,5,1,-1},{5797,5,1,-1},{5867,5,0,-1},{5868,5,1,-1}, +{5871,5,0,-1},{5872,5,1,-1},{5876,5,0,-1},{5877,5,1,-1},{5880,5,0,-1}, +{5881,5,1,-1},{5884,5,0,-1},{5885,5,1,-1},{5890,5,1,-1},{5893,5,0,-1}, +{5894,5,1,-1},{5897,5,0,-1},{5898,5,1,-1},{5902,5,0,-1},{5903,5,1,-1}, +{5906,5,0,-1},{5907,5,1,-1},{5910,5,0,-1},{5911,5,1,-1},{5915,5,0,-1}, +{5916,5,1,-1},{5919,5,0,-1},{5920,5,1,-1},{5923,5,0,-1},{5924,5,1,-1}, +{5928,5,0,-1},{5929,5,1,-1},{5932,5,0,-1},{5933,5,1,-1},{5936,5,0,-1}, +{5937,5,1,-1},{5941,5,0,-1},{5942,5,1,-1},{5945,5,0,-1},{5946,5,1,-1}, +{5949,5,0,-1},{5950,5,1,-1},{5954,5,0,-1},{5955,5,1,-1},{5888,5,0,-1}, +{5958,5,0,-1},{5959,5,1,-1},{5962,5,0,-1},{5963,5,1,-1},{5967,5,0,-1}, +{5968,5,1,-1},{5901,5,1,-1},{5971,5,0,-1},{5972,5,1,-1},{5975,5,0,-1}, +{5976,5,1,-1},{5980,5,0,-1},{5981,5,1,-1},{5984,5,0,-1},{5988,5,0,-1}, +{5989,5,1,-1},{5993,5,0,-1},{5994,5,1,-1},{5997,5,0,-1},{5998,5,1,-1}, +{6001,5,0,-1},{6002,5,1,-1},{6006,5,0,-1},{6007,5,1,-1},{6010,5,0,-1}, +{6011,5,1,-1},{6014,5,0,-1},{6015,5,1,-1},{6019,5,0,-1},{6020,5,1,-1}, +{6023,5,0,-1},{6024,5,1,-1},{6028,5,1,-1},{6032,5,0,-1},{6033,5,1,-1}, +{6036,5,0,-1},{6040,5,0,-1},{6041,5,1,-1},{6045,5,0,-1},{6046,5,1,-1}, +{6049,5,0,-1},{6050,5,1,-1},{6053,5,0,-1},{6054,5,1,-1},{6058,5,0,-1}, +{6059,5,1,-1},{5992,5,0,-1},{6062,5,0,-1},{6063,5,1,-1},{6066,5,0,-1}, +{6067,5,1,-1},{6071,5,0,-1},{6072,5,1,-1},{6005,5,1,-1},{6075,5,0,-1}, +{6076,5,1,-1},{6079,5,0,-1},{6080,5,1,-1},{6084,5,0,-1},{6085,5,1,-1}, +{6088,5,0,-1},{6089,5,1,-1},{6092,5,0,-1},{6093,5,1,-1},{6097,5,0,-1}, +{6098,5,1,-1},{6101,5,0,-1},{6102,5,1,-1},{6105,5,0,-1},{6106,5,1,-1}, +{6110,5,0,-1},{6111,5,1,-1},{6114,5,0,-1},{6115,5,1,-1},{6118,5,0,-1}, +{6119,5,1,-1},{6123,5,0,-1},{6124,5,1,-1},{6127,5,0,-1},{6128,5,1,-1}, +{6131,5,0,-1},{6132,5,1,-1},{6136,5,0,-1},{6137,5,1,-1},{6140,5,0,-1}, +{6141,5,1,-1},{6144,5,0,-1},{6145,5,1,-1},{6149,5,0,-1},{6150,5,1,-1}, +{6153,5,0,-1},{6154,5,1,-1},{6157,5,0,-1},{6158,5,1,-1},{6162,5,0,-1}, +{6163,5,1,-1},{6096,5,0,-1},{6166,5,0,-1},{6167,5,1,-1},{6170,5,0,-1}, +{6171,5,1,-1},{6175,5,0,-1},{6176,5,1,-1},{6109,5,1,-1},{6179,5,0,-1}, +{6180,5,1,-1},{6183,5,0,-1},{6184,5,1,-1},{6188,5,0,-1},{6189,5,1,-1}, +{6192,5,0,-1},{6193,5,1,-1},{6196,5,0,-1},{6197,5,1,-1},{6201,5,0,-1}, +{6202,5,1,-1},{6205,5,0,-1},{6206,5,1,-1},{6209,5,0,-1},{6210,5,1,-1}, +{6214,5,0,-1},{6215,5,1,-1},{6218,5,0,-1},{6219,5,1,-1},{6222,5,0,-1}, +{6223,5,1,-1},{6227,5,0,-1},{6228,5,1,-1},{6231,5,0,-1},{6232,5,1,-1}, +{6235,5,0,-1},{6236,5,1,-1},{6240,5,0,-1},{6241,5,1,-1},{6244,5,0,-1}, +{6245,5,1,-1},{6248,5,0,-1},{6249,5,1,-1},{6253,5,0,-1},{6254,5,1,-1}, +{6257,5,0,-1},{6258,5,1,-1},{6261,5,0,-1},{6262,5,1,-1},{6266,5,0,-1}, +{6267,5,1,-1},{6200,5,0,-1},{6270,5,0,-1},{6271,5,1,-1},{6274,5,0,-1}, +{6275,5,1,-1},{6279,5,0,-1},{6280,5,1,-1},{6213,5,1,-1},{6283,5,0,-1}, +{6284,5,1,-1},{6287,5,0,-1},{6288,5,1,-1},{6292,5,0,-1},{6293,5,1,-1}, +{6296,5,0,-1},{6297,5,1,-1},{6300,5,0,-1},{6301,5,1,-1},{6305,5,0,-1}, +{6306,5,1,-1},{6309,5,0,-1},{6310,5,1,-1},{6313,5,0,-1},{6314,5,1,-1}, +{6318,5,0,-1},{6319,5,1,-1},{6322,5,0,-1},{6323,5,1,-1},{6326,5,0,-1}, +{6327,5,1,-1},{6331,5,0,-1},{6332,5,1,-1},{6335,5,0,-1},{6336,5,1,-1}, +{6339,5,0,-1},{6340,5,1,-1},{6344,5,0,-1},{6345,5,1,-1},{6348,5,0,-1}, +{6349,5,1,-1},{6352,5,0,-1},{6353,5,1,-1},{6357,5,0,-1},{6358,5,1,-1}, +{6361,5,0,-1},{6362,5,1,-1},{6365,5,0,-1},{6366,5,1,-1},{6370,5,0,-1}, +{6371,5,1,-1},{6304,5,0,-1},{6374,5,0,-1},{6375,5,1,-1},{6378,5,0,-1}, +{6379,5,1,-1},{6383,5,0,-1},{6384,5,1,-1},{6317,5,1,-1},{6387,5,0,-1}, +{6388,5,1,-1},{6391,5,0,-1},{6392,5,1,-1},{6396,5,0,-1},{6397,5,1,-1}, +{6400,5,0,-1},{6401,5,1,-1},{6404,5,0,-1},{6405,5,1,-1},{6409,5,0,-1}, +{6410,5,1,-1},{6413,5,0,-1},{6414,5,1,-1},{6417,5,0,-1},{6418,5,1,-1}, +{6422,5,0,-1},{6423,5,1,-1},{6426,5,0,-1},{6427,5,1,-1},{6430,5,0,-1}, +{6431,5,1,-1},{6435,5,0,-1},{6436,5,1,-1},{6439,5,0,-1},{6440,5,1,-1}, +{6443,5,0,-1},{6444,5,1,-1},{6448,5,0,-1},{6449,5,1,-1},{6452,5,0,-1}, +{6453,5,1,-1},{6456,5,0,-1},{6457,5,1,-1},{6461,5,0,-1},{6462,5,1,-1}, +{6465,5,0,-1},{6466,5,1,-1},{6469,5,0,-1},{6470,5,1,-1},{6474,5,0,-1}, +{6475,5,1,-1},{6408,5,0,-1},{6478,5,0,-1},{6479,5,1,-1},{6482,5,0,-1}, +{6483,5,1,-1},{6487,5,0,-1},{6488,5,1,-1},{6421,5,1,-1},{6491,5,0,-1}, +{6492,5,1,-1},{6495,5,0,-1},{6496,5,1,-1},{6500,5,0,-1},{6501,5,1,-1}, +{6504,5,0,-1},{6505,5,1,-1},{6508,5,0,-1},{6509,5,1,-1},{6513,5,0,-1}, +{6514,5,1,-1},{6517,5,0,-1},{6518,5,1,-1},{6521,5,0,-1},{6522,5,1,-1}, +{6526,5,0,-1},{6527,5,1,-1},{6530,5,0,-1},{6531,5,1,-1},{6534,5,0,-1}, +{6535,5,1,-1},{6539,5,0,-1},{6540,5,1,-1},{6543,5,0,-1},{6544,5,1,-1}, +{6547,5,0,-1},{6548,5,1,-1},{6552,5,0,-1},{6553,5,1,-1},{6556,5,0,-1}, +{6557,5,1,-1},{6560,5,0,-1},{6561,5,1,-1},{6565,5,0,-1},{6566,5,1,-1}, +{6569,5,0,-1},{6570,5,1,-1},{6573,5,0,-1},{6574,5,1,-1},{6578,5,0,-1}, +{6579,5,1,-1},{6512,5,0,-1},{6582,5,0,-1},{6583,5,1,-1},{6586,5,0,-1}, +{6587,5,1,-1},{6591,5,0,-1},{6592,5,1,-1},{6525,5,1,-1},{6595,5,0,-1}, +{6596,5,1,-1},{6599,5,0,-1},{6600,5,1,-1},{6604,5,0,-1},{6605,5,1,-1}, +{6608,5,0,-1},{6609,5,1,-1},{6612,5,0,-1},{6613,5,1,-1},{6617,5,0,-1}, +{6618,5,1,-1},{6621,5,0,-1},{6622,5,1,-1},{6625,5,0,-1},{6626,5,1,-1}, +{6630,5,0,-1},{6631,5,1,-1},{6634,5,0,-1},{6635,5,1,-1},{6638,5,0,-1}, +{6639,5,1,-1},{6643,5,0,-1},{6644,5,1,-1},{6647,5,0,-1},{6648,5,1,-1}, +{6651,5,0,-1},{6652,5,1,-1},{6656,5,0,-1},{6657,5,1,-1},{6660,5,0,-1}, +{6661,5,1,-1},{6664,5,0,-1},{6665,5,1,-1},{6669,5,0,-1},{6670,5,1,-1}, +{6673,5,0,-1},{6674,5,1,-1},{6677,5,0,-1},{6678,5,1,-1},{6682,5,0,-1}, +{6683,5,1,-1},{6616,5,0,-1},{6686,5,0,-1},{6687,5,1,-1},{6690,5,0,-1}, +{6691,5,1,-1},{6695,5,0,-1},{6696,5,1,-1},{6629,5,1,-1},{6699,5,0,-1}, +{6700,5,1,-1},{6703,5,0,-1},{6704,5,1,-1},{6708,5,0,-1},{6709,5,1,-1}, +{6712,5,0,-1},{6713,5,1,-1},{6716,5,0,-1},{6717,5,1,-1},{6721,5,0,-1}, +{6722,5,1,-1},{6725,5,0,-1},{6726,5,1,-1},{6729,5,0,-1},{6730,5,1,-1}, +{6734,5,0,-1},{6735,5,1,-1},{6738,5,0,-1},{6739,5,1,-1},{6742,5,0,-1}, +{6743,5,1,-1},{6747,5,0,-1},{6748,5,1,-1},{6751,5,0,-1},{6752,5,1,-1}, +{6755,5,0,-1},{6756,5,1,-1},{6760,5,0,-1},{6761,5,1,-1},{6764,5,0,-1}, +{6765,5,1,-1},{6768,5,0,-1},{6769,5,1,-1},{6773,5,0,-1},{6774,5,1,-1}, +{6777,5,0,-1},{6778,5,1,-1},{6781,5,0,-1},{6782,5,1,-1},{6786,5,0,-1}, +{6787,5,1,-1},{6720,5,0,-1},{6790,5,0,-1},{6791,5,1,-1},{6794,5,0,-1}, +{6795,5,1,-1},{6799,5,0,-1},{6800,5,1,-1},{6733,5,1,-1},{6803,5,0,-1}, +{6804,5,1,-1},{6807,5,0,-1},{6808,5,1,-1},{6812,5,0,-1},{6813,5,1,-1}, +{6816,5,0,-1},{6817,5,1,-1},{6820,5,0,-1},{6821,5,1,-1},{6825,5,0,-1}, +{6826,5,1,-1},{6829,5,0,-1},{6830,5,1,-1},{6833,5,0,-1},{6834,5,1,-1}, +{6838,5,0,-1},{6839,5,1,-1},{6842,5,0,-1},{6843,5,1,-1},{6846,5,0,-1}, +{6847,5,1,-1},{6851,5,0,-1},{6852,5,1,-1},{6855,5,0,-1},{6856,5,1,-1}, +{6859,5,0,-1},{6860,5,1,-1},{6864,5,0,-1},{6865,5,1,-1},{6868,5,0,-1}, +{6869,5,1,-1},{6872,5,0,-1},{6873,5,1,-1},{6877,5,0,-1},{6878,5,1,-1}, +{6881,5,0,-1},{6882,5,1,-1},{6885,5,0,-1},{6886,5,1,-1},{6890,5,0,-1}, +{6891,5,1,-1},{6824,5,0,-1},{6894,5,0,-1},{6895,5,1,-1},{6898,5,0,-1}, +{6899,5,1,-1},{6903,5,0,-1},{6904,5,1,-1},{6837,5,1,-1},{6907,5,0,-1}, +{6908,5,1,-1},{6911,5,0,-1},{6912,5,1,-1},{6916,5,0,-1},{6917,5,1,-1}, +{6920,5,0,-1},{6921,5,1,-1},{6924,5,0,-1},{6925,5,1,-1},{6929,5,0,-1}, +{6930,5,1,-1},{6933,5,0,-1},{6934,5,1,-1},{6937,5,0,-1},{6938,5,1,-1}, +{6942,5,0,-1},{6943,5,1,-1},{6946,5,0,-1},{6947,5,1,-1},{6950,5,0,-1}, +{6951,5,1,-1},{6955,5,0,-1},{6956,5,1,-1},{6959,5,0,-1},{6960,5,1,-1}, +{6963,5,0,-1},{6964,5,1,-1},{6968,5,0,-1},{6969,5,1,-1},{6972,5,0,-1}, +{6973,5,1,-1},{6976,5,0,-1},{6977,5,1,-1},{6981,5,0,-1},{6982,5,1,-1}, +{6985,5,0,-1},{6986,5,1,-1},{6989,5,0,-1},{6990,5,1,-1},{6994,5,0,-1}, +{6995,5,1,-1},{6928,5,0,-1},{6998,5,0,-1},{6999,5,1,-1},{7002,5,0,-1}, +{7003,5,1,-1},{7007,5,0,-1},{7008,5,1,-1},{6941,5,1,-1},{7011,5,0,-1}, +{7012,5,1,-1},{7015,5,0,-1},{7016,5,1,-1},{7020,5,0,-1},{7021,5,1,-1}, +{7024,5,0,-1},{7025,5,1,-1},{7028,5,0,-1},{7029,5,1,-1},{7033,5,0,-1}, +{7034,5,1,-1},{7037,5,0,-1},{7038,5,1,-1},{7041,5,0,-1},{7042,5,1,-1}, +{7046,5,0,-1},{7047,5,1,-1},{7050,5,0,-1},{7051,5,1,-1},{7054,5,0,-1}, +{7055,5,1,-1},{7059,5,0,-1},{7060,5,1,-1},{7063,5,0,-1},{7064,5,1,-1}, +{7067,5,0,-1},{7068,5,1,-1},{7072,5,0,-1},{7073,5,1,-1},{7076,5,0,-1}, +{7077,5,1,-1},{7080,5,0,-1},{7081,5,1,-1},{7085,5,0,-1},{7086,5,1,-1}, +{7089,5,0,-1},{7090,5,1,-1},{7093,5,0,-1},{7094,5,1,-1},{7098,5,0,-1}, +{7099,5,1,-1},{7032,5,0,-1},{7102,5,0,-1},{7103,5,1,-1},{7106,5,0,-1}, +{7107,5,1,-1},{7111,5,0,-1},{7112,5,1,-1},{7045,5,1,-1},{7115,5,0,-1}, +{7116,5,1,-1},{7119,5,0,-1},{7120,5,1,-1},{7124,5,0,-1},{7125,5,1,-1}, +{7128,5,0,-1},{7129,5,1,-1},{7132,5,0,-1},{7133,5,1,-1},{7137,5,0,-1}, +{7138,5,1,-1},{7141,5,0,-1},{7142,5,1,-1},{7145,5,0,-1},{7146,5,1,-1}, +{7150,5,0,-1},{7151,5,1,-1},{7154,5,0,-1},{7155,5,1,-1},{7158,5,0,-1}, +{7159,5,1,-1},{7163,5,0,-1},{7164,5,1,-1},{7167,5,0,-1},{7168,5,1,-1}, +{7171,5,0,-1},{7172,5,1,-1},{7176,5,0,-1},{7177,5,1,-1},{7180,5,0,-1}, +{7181,5,1,-1},{7184,5,0,-1},{7185,5,1,-1},{7189,5,0,-1},{7190,5,1,-1}, +{7193,5,0,-1},{7194,5,1,-1},{7197,5,0,-1},{7198,5,1,-1},{7202,5,0,-1}, +{7203,5,1,-1},{7136,5,0,-1},{7206,5,0,-1},{7207,5,1,-1},{7210,5,0,-1}, +{7211,5,1,-1},{7215,5,0,-1},{7216,5,1,-1},{7149,5,1,-1},{7219,5,0,-1}, +{7220,5,1,-1},{7223,5,0,-1},{7224,5,1,-1},{7228,5,0,-1},{7229,5,1,-1}, +{7232,5,0,-1},{7233,5,1,-1},{7236,5,0,-1},{7237,5,1,-1},{7241,5,0,-1}, +{7242,5,1,-1},{7245,5,0,-1},{7246,5,1,-1},{7249,5,0,-1},{7250,5,1,-1}, +{7254,5,0,-1},{7255,5,1,-1},{7258,5,0,-1},{7259,5,1,-1},{7262,5,0,-1}, +{7263,5,1,-1},{7267,5,0,-1},{7268,5,1,-1},{7271,5,0,-1},{7272,5,1,-1}, +{7275,5,0,-1},{7276,5,1,-1},{7280,5,0,-1},{7281,5,1,-1},{7284,5,0,-1}, +{7285,5,1,-1},{7288,5,0,-1},{7289,5,1,-1},{7293,5,0,-1},{7294,5,1,-1}, +{7297,5,0,-1},{7298,5,1,-1},{7301,5,0,-1},{7302,5,1,-1},{7306,5,0,-1}, +{7307,5,1,-1},{7240,5,0,-1},{7310,5,0,-1},{7311,5,1,-1},{7314,5,0,-1}, +{7315,5,1,-1},{7319,5,0,-1},{7320,5,1,-1},{7253,5,1,-1},{7323,5,0,-1}, +{7324,5,1,-1},{7327,5,0,-1},{7328,5,1,-1},{7332,5,0,-1},{7333,5,1,-1}, +{7336,5,0,-1},{7337,5,1,-1},{7340,5,0,-1},{7341,5,1,-1},{7345,5,0,-1}, +{7346,5,1,-1},{7349,5,0,-1},{7350,5,1,-1},{7353,5,0,-1},{7354,5,1,-1}, +{7358,5,0,-1},{7359,5,1,-1},{7362,5,0,-1},{7363,5,1,-1},{7366,5,0,-1}, +{7367,5,1,-1},{7371,5,0,-1},{7372,5,1,-1},{7375,5,0,-1},{7376,5,1,-1}, +{7379,5,0,-1},{7380,5,1,-1},{7384,5,0,-1},{7385,5,1,-1},{7388,5,0,-1}, +{7389,5,1,-1},{7392,5,0,-1},{7393,5,1,-1},{7397,5,0,-1},{7398,5,1,-1}, +{7401,5,0,-1},{7402,5,1,-1},{7405,5,0,-1},{7406,5,1,-1},{7410,5,0,-1}, +{7411,5,1,-1},{7344,5,0,-1},{7414,5,0,-1},{7415,5,1,-1},{7418,5,0,-1}, +{7419,5,1,-1},{7423,5,0,-1},{7424,5,1,-1},{7357,5,1,-1},{7427,5,0,-1}, +{7428,5,1,-1},{7431,5,0,-1},{7432,5,1,-1},{7436,5,0,-1},{7437,5,1,-1}, +{7440,5,0,-1},{7441,5,1,-1},{7444,5,0,-1},{7445,5,1,-1},{7449,5,0,-1}, +{7450,5,1,-1},{7453,5,0,-1},{7454,5,1,-1},{7457,5,0,-1},{7458,5,1,-1}, +{7462,5,0,-1},{7463,5,1,-1},{7466,5,0,-1},{7467,5,1,-1},{7470,5,0,-1}, +{7471,5,1,-1},{7475,5,0,-1},{7476,5,1,-1},{7479,5,0,-1},{7480,5,1,-1}, +{7483,5,0,-1},{7484,5,1,-1},{7488,5,0,-1},{7489,5,1,-1},{7492,5,0,-1}, +{7493,5,1,-1},{7496,5,0,-1},{7497,5,1,-1},{7501,5,0,-1},{7502,5,1,-1}, +{7505,5,0,-1},{7506,5,1,-1},{7509,5,0,-1},{7510,5,1,-1},{7514,5,0,-1}, +{7515,5,1,-1},{7448,5,0,-1},{7518,5,0,-1},{7519,5,1,-1},{7522,5,0,-1}, +{7523,5,1,-1},{7527,5,0,-1},{7528,5,1,-1},{7461,5,1,-1},{7531,5,0,-1}, +{7532,5,1,-1},{7535,5,0,-1},{7536,5,1,-1},{7540,5,0,-1},{7541,5,1,-1}, +{7544,5,0,-1},{7545,5,1,-1},{7548,5,0,-1},{7549,5,1,-1},{7553,5,0,-1}, +{7554,5,1,-1},{7557,5,0,-1},{7558,5,1,-1},{7561,5,0,-1},{7562,5,1,-1}, +{7566,5,0,-1},{7567,5,1,-1},{7570,5,0,-1},{7571,5,1,-1},{7574,5,0,-1}, +{7575,5,1,-1},{7579,5,0,-1},{7580,5,1,-1},{7583,5,0,-1},{7584,5,1,-1}, +{7587,5,0,-1},{7588,5,1,-1},{7592,5,0,-1},{7593,5,1,-1},{7596,5,0,-1}, +{7597,5,1,-1},{7600,5,0,-1},{7601,5,1,-1},{7605,5,0,-1},{7606,5,1,-1}, +{7609,5,0,-1},{7610,5,1,-1},{7613,5,0,-1},{7614,5,1,-1},{7618,5,0,-1}, +{7619,5,1,-1},{7552,5,0,-1},{7622,5,0,-1},{7623,5,1,-1},{7626,5,0,-1}, +{7627,5,1,-1},{7631,5,0,-1},{7632,5,1,-1},{7565,5,1,-1},{7635,5,0,-1}, +{7636,5,1,-1},{7639,5,0,-1},{7640,5,1,-1},{7644,5,0,-1},{7645,5,1,-1}, +{7648,5,0,-1},{7649,5,1,-1},{7652,5,0,-1},{7653,5,1,-1},{7657,5,0,-1}, +{7658,5,1,-1},{7661,5,0,-1},{7662,5,1,-1},{7665,5,0,-1},{7666,5,1,-1}, +{7670,5,0,-1},{7671,5,1,-1},{7674,5,0,-1},{7675,5,1,-1},{7678,5,0,-1}, +{7679,5,1,-1},{7683,5,0,-1},{7684,5,1,-1},{7687,5,0,-1},{7688,5,1,-1}, +{7691,5,0,-1},{7692,5,1,-1},{7696,5,0,-1},{7697,5,1,-1},{7700,5,0,-1}, +{7701,5,1,-1},{7704,5,0,-1},{7705,5,1,-1},{7709,5,0,-1},{7710,5,1,-1}, +{7713,5,0,-1},{7714,5,1,-1},{7717,5,0,-1},{7718,5,1,-1},{7722,5,0,-1}, +{7723,5,1,-1},{7656,5,0,-1},{7726,5,0,-1},{7727,5,1,-1},{7730,5,0,-1}, +{7731,5,1,-1},{7735,5,0,-1},{7736,5,1,-1},{7669,5,1,-1},{7739,5,0,-1}, +{7740,5,1,-1},{7743,5,0,-1},{7744,5,1,-1},{7748,5,0,-1},{7749,5,1,-1}, +{7752,5,0,-1},{7753,5,1,-1},{7756,5,0,-1},{7757,5,1,-1},{7761,5,0,-1}, +{7762,5,1,-1},{7765,5,0,-1},{7766,5,1,-1},{7769,5,0,-1},{7770,5,1,-1}, +{7774,5,0,-1},{7775,5,1,-1},{7778,5,0,-1},{7779,5,1,-1},{7782,5,0,-1}, +{7783,5,1,-1},{7787,5,0,-1},{7788,5,1,-1},{7791,5,0,-1},{7792,5,1,-1}, +{7795,5,0,-1},{7796,5,1,-1},{7800,5,0,-1},{7801,5,1,-1},{7804,5,0,-1}, +{7805,5,1,-1},{7808,5,0,-1},{7809,5,1,-1},{7813,5,0,-1},{7814,5,1,-1}, +{7817,5,0,-1},{7818,5,1,-1},{7821,5,0,-1},{7822,5,1,-1},{7826,5,0,-1}, +{7827,5,1,-1},{7760,5,0,-1},{7830,5,0,-1},{7831,5,1,-1},{7834,5,0,-1}, +{7835,5,1,-1},{7839,5,0,-1},{7840,5,1,-1},{7773,5,1,-1},{7843,5,0,-1}, +{7844,5,1,-1},{7847,5,0,-1},{7848,5,1,-1},{7852,5,0,-1},{7853,5,1,-1}, +{7856,5,0,-1},{7857,5,1,-1},{7860,5,0,-1},{7861,5,1,-1},{7865,5,0,-1}, +{7866,5,1,-1},{7869,5,0,-1},{7870,5,1,-1},{7873,5,0,-1},{7874,5,1,-1}, +{7878,5,0,-1},{7879,5,1,-1},{7882,5,0,-1},{7883,5,1,-1},{7886,5,0,-1}, +{7887,5,1,-1},{7891,5,0,-1},{7892,5,1,-1},{7895,5,0,-1},{7896,5,1,-1}, +{7899,5,0,-1},{7900,5,1,-1},{7904,5,0,-1},{7905,5,1,-1},{7908,5,0,-1}, +{7909,5,1,-1},{7912,5,0,-1},{7913,5,1,-1},{7917,5,0,-1},{7918,5,1,-1}, +{7921,5,0,-1},{7922,5,1,-1},{7925,5,0,-1},{7926,5,1,-1},{7930,5,0,-1}, +{7931,5,1,-1},{7864,5,0,-1},{7934,5,0,-1},{7935,5,1,-1},{7938,5,0,-1}, +{7939,5,1,-1},{7943,5,0,-1},{7944,5,1,-1},{7877,5,1,-1},{7947,5,0,-1}, +{7948,5,1,-1},{7951,5,0,-1},{7952,5,1,-1},{7956,5,0,-1},{7957,5,1,-1}, +{7960,5,0,-1},{7961,5,1,-1},{7964,5,0,-1},{7965,5,1,-1},{7969,5,0,-1}, +{7970,5,1,-1},{7973,5,0,-1},{7974,5,1,-1},{7977,5,0,-1},{7978,5,1,-1}, +{7982,5,0,-1},{7983,5,1,-1},{7986,5,0,-1},{7987,5,1,-1},{7990,5,0,-1}, +{7991,5,1,-1},{7995,5,0,-1},{7996,5,1,-1},{7999,5,0,-1},{8000,5,1,-1}, +{8003,5,0,-1},{8004,5,1,-1},{8008,5,0,-1},{8009,5,1,-1},{8012,5,0,-1}, +{8013,5,1,-1},{8016,5,0,-1},{8017,5,1,-1},{8021,5,0,-1},{8022,5,1,-1}, +{8025,5,0,-1},{8026,5,1,-1},{8029,5,0,-1},{8030,5,1,-1},{8034,5,0,-1}, +{8035,5,1,-1},{7968,5,0,-1},{8038,5,0,-1},{8039,5,1,-1},{8042,5,0,-1}, +{8043,5,1,-1},{8047,5,0,-1},{8048,5,1,-1},{7981,5,1,-1},{8051,5,0,-1}, +{8052,5,1,-1},{8055,5,0,-1},{8056,5,1,-1},{8060,5,0,-1},{8061,5,1,-1}, +{8064,5,0,-1},{8065,5,1,-1},{8068,5,0,-1},{8069,5,1,-1},{8073,5,0,-1}, +{8074,5,1,-1},{8077,5,0,-1},{8078,5,1,-1},{8081,5,0,-1},{8082,5,1,-1}, +{8086,5,0,-1},{8087,5,1,-1},{8090,5,0,-1},{8091,5,1,-1},{8094,5,0,-1}, +{8095,5,1,-1},{8099,5,0,-1},{8100,5,1,-1},{8103,5,0,-1},{8104,5,1,-1}, +{8107,5,0,-1},{8108,5,1,-1},{8112,5,0,-1},{8113,5,1,-1},{8116,5,0,-1}, +{8117,5,1,-1},{8120,5,0,-1},{8121,5,1,-1},{8125,5,0,-1},{8126,5,1,-1}, +{8129,5,0,-1},{8130,5,1,-1},{8133,5,0,-1},{8134,5,1,-1},{8138,5,0,-1}, +{8139,5,1,-1},{8072,5,0,-1},{8142,5,0,-1},{8143,5,1,-1},{8146,5,0,-1}, +{8147,5,1,-1},{8151,5,0,-1},{8152,5,1,-1},{8085,5,1,-1},{8155,5,0,-1}, +{8156,5,1,-1},{8159,5,0,-1},{8160,5,1,-1},{8164,5,0,-1},{8165,5,1,-1}, +{8168,5,0,-1},{8169,5,1,-1},{8172,5,0,-1},{8173,5,1,-1},{8177,5,0,-1}, +{8178,5,1,-1},{8181,5,0,-1},{8182,5,1,-1},{8185,5,0,-1},{8186,5,1,-1}, +{8190,5,0,-1},{8191,5,1,-1},{8194,5,0,-1},{8195,5,1,-1},{8198,5,0,-1}, +{8199,5,1,-1},{8203,5,0,-1},{8204,5,1,-1},{8207,5,0,-1},{8208,5,1,-1}, +{8211,5,0,-1},{8212,5,1,-1},{8216,5,0,-1},{8217,5,1,-1},{8220,5,0,-1}, +{8221,5,1,-1},{8224,5,0,-1},{8225,5,1,-1},{8229,5,0,-1},{8230,5,1,-1}, +{8233,5,0,-1},{8234,5,1,-1},{8237,5,0,-1},{8238,5,1,-1},{8242,5,0,-1}, +{8243,5,1,-1},{8176,5,0,-1},{8246,5,0,-1},{8247,5,1,-1},{8250,5,0,-1}, +{8251,5,1,-1},{8255,5,0,-1},{8256,5,1,-1},{8189,5,1,-1},{8259,5,0,-1}, +{8260,5,1,-1},{8263,5,0,-1},{8264,5,1,-1},{8268,5,0,-1},{8269,5,1,-1}, +{8272,5,0,-1},{8273,5,1,-1},{8276,5,0,-1},{8277,5,1,-1},{8281,5,0,-1}, +{8282,5,1,-1},{8285,5,0,-1},{8286,5,1,-1},{8289,5,0,-1},{8290,5,1,-1}, +{8294,5,0,-1},{8295,5,1,-1},{8298,5,0,-1},{8299,5,1,-1},{8302,5,0,-1}, +{8303,5,1,-1},{8307,5,0,-1},{8308,5,1,-1},{8311,5,0,-1},{8312,5,1,-1}, +{8315,5,0,-1},{8316,5,1,-1},{8320,5,0,-1},{8321,5,1,-1},{8324,5,0,-1}, +{8325,5,1,-1},{8328,5,0,-1},{8329,5,1,-1},{8333,5,0,-1},{8334,5,1,-1}, +{8337,5,0,-1},{8338,5,1,-1},{8341,5,0,-1},{8342,5,1,-1},{8346,5,0,-1}, +{8347,5,1,-1},{8280,5,0,-1},{8350,5,0,-1},{8351,5,1,-1},{8354,5,0,-1}, +{8355,5,1,-1},{8359,5,0,-1},{8360,5,1,-1},{8293,5,1,-1},{8363,5,0,-1}, +{8364,5,1,-1},{8367,5,0,-1},{8368,5,1,-1},{8372,5,0,-1},{8373,5,1,-1}, +{8376,5,0,-1},{8377,5,1,-1},{8380,5,0,-1},{8381,5,1,-1},{8385,5,0,-1}, +{8386,5,1,-1},{8389,5,0,-1},{8390,5,1,-1},{8393,5,0,-1},{8394,5,1,-1}, +{8398,5,0,-1},{8399,5,1,-1},{8402,5,0,-1},{8403,5,1,-1},{8406,5,0,-1}, +{8407,5,1,-1},{8411,5,0,-1},{8412,5,1,-1},{8415,5,0,-1},{8416,5,1,-1}, +{8419,5,0,-1},{8420,5,1,-1},{8424,5,0,-1},{8425,5,1,-1},{8428,5,0,-1}, +{8429,5,1,-1},{8432,5,0,-1},{8433,5,1,-1},{8437,5,0,-1},{8438,5,1,-1}, +{8441,5,0,-1},{8442,5,1,-1},{8445,5,0,-1},{8446,5,1,-1},{8450,5,0,-1}, +{8451,5,1,-1},{8384,5,0,-1},{8454,5,0,-1},{8455,5,1,-1},{8458,5,0,-1}, +{8459,5,1,-1},{8463,5,0,-1},{8464,5,1,-1},{8397,5,1,-1},{8467,5,0,-1}, +{8468,5,1,-1},{8471,5,0,-1},{8472,5,1,-1},{8476,5,0,-1},{8477,5,1,-1}, +{8480,5,0,-1},{8481,5,1,-1},{8484,5,0,-1},{8485,5,1,-1},{8489,5,0,-1}, +{8490,5,1,-1},{8493,5,0,-1},{8494,5,1,-1},{8497,5,0,-1},{8498,5,1,-1}, +{8502,5,0,-1},{8503,5,1,-1},{8506,5,0,-1},{8507,5,1,-1},{8510,5,0,-1}, +{8511,5,1,-1},{8515,5,0,-1},{8516,5,1,-1},{8519,5,0,-1},{8520,5,1,-1}, +{8523,5,0,-1},{8524,5,1,-1},{8528,5,0,-1},{8529,5,1,-1},{8532,5,0,-1}, +{8533,5,1,-1},{8536,5,0,-1},{8537,5,1,-1},{8541,5,0,-1},{8545,5,0,-1}, +{8549,5,0,-1},{8554,5,0,-1},{8488,5,0,-1},{8558,5,0,-1},{8562,5,0,-1}, +{8567,5,0,-1},{8501,5,1,-1},{8571,5,0,-1},{8575,5,0,-1},{8580,5,0,-1}, +{8584,5,0,-1},{8585,5,1,-1},{8588,5,0,-1},{8589,5,1,-1},{8597,5,0,-1}, +{8601,5,0,-1},{8606,5,0,-1},{8610,5,0,-1},{8614,5,0,-1},{8619,5,0,-1}, +{8623,5,0,-1},{8627,5,0,-1},{8632,5,0,-1},{8636,5,0,-1},{8640,5,0,-1}, +{8641,5,1,-1},{8649,5,0,-1},{8653,5,0,-1},{8658,5,0,-1},{8662,5,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS6, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_6_ss0_ss1[] = { +{8112,6,0,-1},{8120,6,0,-1},{8129,6,0,-1},{8138,6,0,-1},{8146,6,0,-1}, +{8155,6,0,-1},{8164,6,0,-1},{8098,6,0,-1},{8172,6,0,-1},{8181,6,0,-1}, +{8190,6,0,-1},{8198,6,0,-1},{8207,6,0,-1},{8211,6,0,-1},{8216,6,0,-1}, +{8220,6,0,-1},{8224,6,0,-1},{8229,6,0,-1},{8233,6,0,-1},{8237,6,0,-1}, +{8242,6,0,-1},{8246,6,0,-1},{8250,6,0,-1},{8255,6,0,-1},{8259,6,0,-1}, +{8263,6,0,-1},{8268,6,0,-1},{8202,6,0,-1},{8272,6,0,-1},{8276,6,0,-1}, +{8281,6,0,-1},{8285,6,0,-1},{8289,6,0,-1},{8294,6,0,-1},{8298,6,0,-1}, +{8302,6,0,-1},{8307,6,0,-1},{8311,6,0,-1},{8315,6,0,-1},{8320,6,0,-1}, +{8324,6,0,-1},{8328,6,0,-1},{8333,6,0,-1},{8337,6,0,-1},{8341,6,0,-1}, +{8346,6,0,-1},{8350,6,0,-1},{8354,6,0,-1},{8355,6,1,-1},{8359,6,0,-1}, +{8363,6,0,-1},{8364,6,1,-1},{8367,6,0,-1},{8372,6,0,-1},{8373,6,1,-1}, +{8306,6,0,-1},{8376,6,0,-1},{8380,6,0,-1},{8381,6,1,-1},{8385,6,0,-1}, +{8389,6,0,-1},{8390,6,1,-1},{8393,6,0,-1},{8398,6,0,-1},{8399,6,1,-1}, +{8402,6,0,-1},{8406,6,0,-1},{8407,6,1,-1},{8411,6,0,-1},{8412,6,1,-1}, +{8415,6,0,-1},{8416,6,1,-1},{8419,6,0,-1},{8420,6,1,-1},{8424,6,0,-1}, +{8425,6,1,-1},{8428,6,0,-1},{8432,6,0,-1},{8433,6,1,-1},{8437,6,0,-1}, +{8441,6,0,-1},{8442,6,1,-1},{8445,6,0,-1},{8450,6,0,-1},{8451,6,1,-1}, +{8454,6,0,-1},{8458,6,0,-1},{8459,6,1,-1},{8463,6,0,-1},{8467,6,0,-1}, +{8468,6,1,-1},{8471,6,0,-1},{8476,6,0,-1},{8477,6,1,-1},{8410,6,0,-1}, +{8480,6,0,-1},{8484,6,0,-1},{8485,6,1,-1},{8489,6,0,-1},{8490,6,1,-1}, +{8423,6,1,-1},{8493,6,0,-1},{8494,6,1,-1},{8497,6,0,-1},{8498,6,1,-1}, +{8502,6,0,-1},{8503,6,1,-1},{8506,6,0,-1},{8507,6,1,-1},{8510,6,0,-1}, +{8511,6,1,-1},{8515,6,0,-1},{8519,6,0,-1},{8520,6,1,-1},{8523,6,0,-1}, +{8524,6,1,-1},{8528,6,0,-1},{8529,6,1,-1},{8532,6,0,-1},{8533,6,1,-1}, +{8536,6,0,-1},{8537,6,1,-1},{8541,6,0,-1},{8542,6,1,-1},{8545,6,0,-1}, +{8546,6,1,-1},{8549,6,0,-1},{8550,6,1,-1},{8554,6,0,-1},{8555,6,1,-1}, +{8558,6,0,-1},{8559,6,1,-1},{8562,6,0,-1},{8563,6,1,-1},{8567,6,0,-1}, +{8568,6,1,-1},{8571,6,0,-1},{8572,6,1,-1},{8575,6,0,-1},{8576,6,1,-1}, +{8580,6,0,-1},{8581,6,1,-1},{8514,6,0,-1},{8584,6,0,-1},{8585,6,1,-1}, +{8588,6,0,-1},{8589,6,1,-1},{8593,6,0,-1},{8594,6,1,-1},{8527,6,1,-1}, +{8597,6,0,-1},{8598,6,1,-1},{8601,6,0,-1},{8602,6,1,-1},{8606,6,0,-1}, +{8607,6,1,-1},{8610,6,0,-1},{8611,6,1,-1},{8614,6,0,-1},{8615,6,1,-1}, +{8619,6,0,-1},{8620,6,1,-1},{8623,6,0,-1},{8624,6,1,-1},{8627,6,0,-1}, +{8628,6,1,-1},{8632,6,0,-1},{8633,6,1,-1},{8636,6,0,-1},{8637,6,1,-1}, +{8640,6,0,-1},{8641,6,1,-1},{8645,6,0,-1},{8646,6,1,-1},{8649,6,0,-1}, +{8650,6,1,-1},{8653,6,0,-1},{8654,6,1,-1},{8658,6,0,-1},{8659,6,1,-1}, +{8662,6,0,-1},{8663,6,1,-1},{8666,6,0,-1},{8667,6,1,-1},{8671,6,0,-1}, +{8672,6,1,-1},{8675,6,0,-1},{8676,6,1,-1},{8679,6,0,-1},{8680,6,1,-1}, +{8684,6,0,-1},{8685,6,1,-1},{8618,6,0,-1},{8688,6,0,-1},{8689,6,1,-1}, +{8692,6,0,-1},{8693,6,1,-1},{8697,6,0,-1},{8698,6,1,-1},{8631,6,1,-1}, +{8701,6,0,-1},{8702,6,1,-1},{8705,6,0,-1},{8706,6,1,-1},{8710,6,0,-1}, +{8711,6,1,-1},{8714,6,0,-1},{8715,6,1,-1},{8718,6,0,-1},{8719,6,1,-1}, +{8723,6,0,-1},{8724,6,1,-1},{8727,6,0,-1},{8728,6,1,-1},{8731,6,0,-1}, +{8732,6,1,-1},{8736,6,0,-1},{8737,6,1,-1},{8740,6,0,-1},{8741,6,1,-1}, +{8744,6,0,-1},{8745,6,1,-1},{8749,6,0,-1},{8750,6,1,-1},{8753,6,0,-1}, +{8754,6,1,-1},{8757,6,0,-1},{8758,6,1,-1},{8762,6,0,-1},{8763,6,1,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8771,6,1,-1},{8775,6,0,-1},{8776,6,1,-1}, +{8779,6,0,-1},{8780,6,1,-1},{8783,6,0,-1},{8784,6,1,-1},{8788,6,0,-1}, +{8789,6,1,-1},{8722,6,0,-1},{8792,6,0,-1},{8793,6,1,-1},{8796,6,0,-1}, +{8797,6,1,-1},{8801,6,0,-1},{8802,6,1,-1},{8735,6,1,-1},{8805,6,0,-1}, +{8806,6,1,-1},{8810,6,1,-1},{8814,6,0,-1},{8815,6,1,-1},{8818,6,0,-1}, +{8822,6,0,-1},{8823,6,1,-1},{8827,6,0,-1},{8828,6,1,-1},{8831,6,0,-1}, +{8832,6,1,-1},{8835,6,0,-1},{8836,6,1,-1},{8840,6,0,-1},{8841,6,1,-1}, +{8844,6,0,-1},{8845,6,1,-1},{8848,6,0,-1},{8849,6,1,-1},{8853,6,0,-1}, +{8854,6,1,-1},{8857,6,0,-1},{8858,6,1,-1},{8861,6,0,-1},{8862,6,1,-1}, +{8866,6,0,-1},{8867,6,1,-1},{8870,6,0,-1},{8871,6,1,-1},{8874,6,0,-1}, +{8875,6,1,-1},{8879,6,0,-1},{8880,6,1,-1},{8883,6,0,-1},{8884,6,1,-1}, +{8887,6,0,-1},{8888,6,1,-1},{8892,6,0,-1},{8893,6,1,-1},{8826,6,0,-1}, +{8896,6,0,-1},{8897,6,1,-1},{8900,6,0,-1},{8901,6,1,-1},{8905,6,0,-1}, +{8906,6,1,-1},{8839,6,1,-1},{8909,6,0,-1},{8910,6,1,-1},{8913,6,0,-1}, +{8914,6,1,-1},{8918,6,0,-1},{8919,6,1,-1},{8922,6,0,-1},{8923,6,1,-1}, +{8926,6,0,-1},{8927,6,1,-1},{8931,6,0,-1},{8932,6,1,-1},{8935,6,0,-1}, +{8936,6,1,-1},{8939,6,0,-1},{8940,6,1,-1},{8944,6,0,-1},{8945,6,1,-1}, +{8948,6,0,-1},{8949,6,1,-1},{8952,6,0,-1},{8953,6,1,-1},{8957,6,0,-1}, +{8958,6,1,-1},{8961,6,0,-1},{8962,6,1,-1},{8965,6,0,-1},{8966,6,1,-1}, +{8970,6,0,-1},{8971,6,1,-1},{8974,6,0,-1},{8975,6,1,-1},{8978,6,0,-1}, +{8979,6,1,-1},{8983,6,0,-1},{8984,6,1,-1},{8987,6,0,-1},{8988,6,1,-1}, +{8991,6,0,-1},{8992,6,1,-1},{8996,6,0,-1},{8997,6,1,-1},{8930,6,0,-1}, +{9000,6,0,-1},{9001,6,1,-1},{9004,6,0,-1},{9005,6,1,-1},{9009,6,0,-1}, +{9010,6,1,-1},{8943,6,1,-1},{9013,6,0,-1},{9014,6,1,-1},{9017,6,0,-1}, +{9018,6,1,-1},{9022,6,0,-1},{9023,6,1,-1},{9026,6,0,-1},{9027,6,1,-1}, +{9030,6,0,-1},{9031,6,1,-1},{9035,6,0,-1},{9036,6,1,-1},{9039,6,0,-1}, +{9040,6,1,-1},{9043,6,0,-1},{9044,6,1,-1},{9048,6,0,-1},{9049,6,1,-1}, +{9052,6,0,-1},{9053,6,1,-1},{9056,6,0,-1},{9057,6,1,-1},{9061,6,0,-1}, +{9062,6,1,-1},{9065,6,0,-1},{9066,6,1,-1},{9069,6,0,-1},{9070,6,1,-1}, +{9074,6,0,-1},{9075,6,1,-1},{9078,6,0,-1},{9079,6,1,-1},{9082,6,0,-1}, +{9083,6,1,-1},{9087,6,0,-1},{9088,6,1,-1},{9091,6,0,-1},{9092,6,1,-1}, +{9095,6,0,-1},{9096,6,1,-1},{9100,6,0,-1},{9101,6,1,-1},{9034,6,0,-1}, +{9104,6,0,-1},{9105,6,1,-1},{9108,6,0,-1},{9109,6,1,-1},{9113,6,0,-1}, +{9114,6,1,-1},{9047,6,1,-1},{9117,6,0,-1},{9118,6,1,-1},{9121,6,0,-1}, +{9122,6,1,-1},{9126,6,0,-1},{9127,6,1,-1},{9130,6,0,-1},{9131,6,1,-1}, +{9134,6,0,-1},{9135,6,1,-1},{9139,6,0,-1},{9140,6,1,-1},{9143,6,0,-1}, +{9144,6,1,-1},{9147,6,0,-1},{9148,6,1,-1},{9152,6,0,-1},{9153,6,1,-1}, +{9156,6,0,-1},{9157,6,1,-1},{9160,6,0,-1},{9161,6,1,-1},{9165,6,0,-1}, +{9166,6,1,-1},{9169,6,0,-1},{9170,6,1,-1},{9173,6,0,-1},{9174,6,1,-1}, +{9178,6,0,-1},{9179,6,1,-1},{9182,6,0,-1},{9183,6,1,-1},{9186,6,0,-1}, +{9187,6,1,-1},{9191,6,0,-1},{9192,6,1,-1},{9195,6,0,-1},{9196,6,1,-1}, +{9199,6,0,-1},{9200,6,1,-1},{9204,6,0,-1},{9205,6,1,-1},{9138,6,0,-1}, +{9208,6,0,-1},{9209,6,1,-1},{9212,6,0,-1},{9213,6,1,-1},{9217,6,0,-1}, +{9218,6,1,-1},{9151,6,1,-1},{9221,6,0,-1},{9222,6,1,-1},{9225,6,0,-1}, +{9226,6,1,-1},{9230,6,0,-1},{9231,6,1,-1},{9234,6,0,-1},{9235,6,1,-1}, +{9238,6,0,-1},{9239,6,1,-1},{9243,6,0,-1},{9244,6,1,-1},{9247,6,0,-1}, +{9248,6,1,-1},{9251,6,0,-1},{9252,6,1,-1},{9256,6,0,-1},{9257,6,1,-1}, +{9260,6,0,-1},{9261,6,1,-1},{9264,6,0,-1},{9265,6,1,-1},{9269,6,0,-1}, +{9270,6,1,-1},{9273,6,0,-1},{9274,6,1,-1},{9277,6,0,-1},{9278,6,1,-1}, +{9282,6,0,-1},{9283,6,1,-1},{9286,6,0,-1},{9287,6,1,-1},{9290,6,0,-1}, +{9291,6,1,-1},{9295,6,0,-1},{9296,6,1,-1},{9299,6,0,-1},{9300,6,1,-1}, +{9303,6,0,-1},{9304,6,1,-1},{9308,6,0,-1},{9309,6,1,-1},{9242,6,0,-1}, +{9312,6,0,-1},{9313,6,1,-1},{9316,6,0,-1},{9317,6,1,-1},{9321,6,0,-1}, +{9322,6,1,-1},{9255,6,1,-1},{9325,6,0,-1},{9326,6,1,-1},{9329,6,0,-1}, +{9330,6,1,-1},{9334,6,0,-1},{9335,6,1,-1},{9338,6,0,-1},{9339,6,1,-1}, +{9342,6,0,-1},{9343,6,1,-1},{9347,6,0,-1},{9348,6,1,-1},{9351,6,0,-1}, +{9352,6,1,-1},{9355,6,0,-1},{9356,6,1,-1},{9360,6,0,-1},{9361,6,1,-1}, +{9364,6,0,-1},{9365,6,1,-1},{9368,6,0,-1},{9369,6,1,-1},{9373,6,0,-1}, +{9374,6,1,-1},{9377,6,0,-1},{9378,6,1,-1},{9381,6,0,-1},{9382,6,1,-1}, +{9386,6,0,-1},{9387,6,1,-1},{9390,6,0,-1},{9391,6,1,-1},{9394,6,0,-1}, +{9395,6,1,-1},{9399,6,0,-1},{9400,6,1,-1},{9403,6,0,-1},{9404,6,1,-1}, +{9407,6,0,-1},{9408,6,1,-1},{9412,6,0,-1},{9413,6,1,-1},{9346,6,0,-1}, +{9416,6,0,-1},{9417,6,1,-1},{9420,6,0,-1},{9421,6,1,-1},{9425,6,0,-1}, +{9426,6,1,-1},{9359,6,1,-1},{9429,6,0,-1},{9430,6,1,-1},{9433,6,0,-1}, +{9434,6,1,-1},{9438,6,0,-1},{9439,6,1,-1},{9442,6,0,-1},{9443,6,1,-1}, +{9446,6,0,-1},{9447,6,1,-1},{9451,6,0,-1},{9452,6,1,-1},{9455,6,0,-1}, +{9456,6,1,-1},{9459,6,0,-1},{9460,6,1,-1},{9464,6,0,-1},{9465,6,1,-1}, +{9468,6,0,-1},{9469,6,1,-1},{9472,6,0,-1},{9473,6,1,-1},{9477,6,0,-1}, +{9478,6,1,-1},{9481,6,0,-1},{9482,6,1,-1},{9485,6,0,-1},{9486,6,1,-1}, +{9490,6,0,-1},{9491,6,1,-1},{9494,6,0,-1},{9495,6,1,-1},{9498,6,0,-1}, +{9499,6,1,-1},{9503,6,0,-1},{9504,6,1,-1},{9507,6,0,-1},{9508,6,1,-1}, +{9511,6,0,-1},{9512,6,1,-1},{9516,6,0,-1},{9517,6,1,-1},{9450,6,0,-1}, +{9520,6,0,-1},{9521,6,1,-1},{9524,6,0,-1},{9525,6,1,-1},{9529,6,0,-1}, +{9530,6,1,-1},{9463,6,1,-1},{9533,6,0,-1},{9534,6,1,-1},{9537,6,0,-1}, +{9538,6,1,-1},{9542,6,0,-1},{9543,6,1,-1},{9546,6,0,-1},{9547,6,1,-1}, +{9550,6,0,-1},{9551,6,1,-1},{9555,6,0,-1},{9556,6,1,-1},{9559,6,0,-1}, +{9560,6,1,-1},{9563,6,0,-1},{9564,6,1,-1},{9568,6,0,-1},{9569,6,1,-1}, +{9572,6,0,-1},{9573,6,1,-1},{9576,6,0,-1},{9577,6,1,-1},{9581,6,0,-1}, +{9582,6,1,-1},{9585,6,0,-1},{9586,6,1,-1},{9589,6,0,-1},{9590,6,1,-1}, +{9594,6,0,-1},{9595,6,1,-1},{9598,6,0,-1},{9599,6,1,-1},{9602,6,0,-1}, +{9603,6,1,-1},{9607,6,0,-1},{9608,6,1,-1},{9611,6,0,-1},{9612,6,1,-1}, +{9615,6,0,-1},{9616,6,1,-1},{9620,6,0,-1},{9621,6,1,-1},{9554,6,0,-1}, +{9624,6,0,-1},{9625,6,1,-1},{9628,6,0,-1},{9629,6,1,-1},{9633,6,0,-1}, +{9634,6,1,-1},{9567,6,1,-1},{9637,6,0,-1},{9638,6,1,-1},{9641,6,0,-1}, +{9642,6,1,-1},{9646,6,0,-1},{9647,6,1,-1},{9650,6,0,-1},{9651,6,1,-1}, +{9654,6,0,-1},{9655,6,1,-1},{9659,6,0,-1},{9660,6,1,-1},{9663,6,0,-1}, +{9664,6,1,-1},{9667,6,0,-1},{9668,6,1,-1},{9672,6,0,-1},{9673,6,1,-1}, +{9676,6,0,-1},{9677,6,1,-1},{9680,6,0,-1},{9681,6,1,-1},{9685,6,0,-1}, +{9686,6,1,-1},{9689,6,0,-1},{9690,6,1,-1},{9693,6,0,-1},{9694,6,1,-1}, +{9698,6,0,-1},{9699,6,1,-1},{9702,6,0,-1},{9703,6,1,-1},{9706,6,0,-1}, +{9707,6,1,-1},{9711,6,0,-1},{9712,6,1,-1},{9715,6,0,-1},{9716,6,1,-1}, +{9719,6,0,-1},{9720,6,1,-1},{9724,6,0,-1},{9725,6,1,-1},{9658,6,0,-1}, +{9728,6,0,-1},{9729,6,1,-1},{9732,6,0,-1},{9733,6,1,-1},{9737,6,0,-1}, +{9738,6,1,-1},{9671,6,1,-1},{9741,6,0,-1},{9742,6,1,-1},{9745,6,0,-1}, +{9746,6,1,-1},{9750,6,0,-1},{9751,6,1,-1},{9754,6,0,-1},{9755,6,1,-1}, +{9758,6,0,-1},{9759,6,1,-1},{9763,6,0,-1},{9764,6,1,-1},{9767,6,0,-1}, +{9768,6,1,-1},{9771,6,0,-1},{9772,6,1,-1},{9776,6,0,-1},{9777,6,1,-1}, +{9780,6,0,-1},{9781,6,1,-1},{9784,6,0,-1},{9785,6,1,-1},{9789,6,0,-1}, +{9790,6,1,-1},{9793,6,0,-1},{9794,6,1,-1},{9797,6,0,-1},{9798,6,1,-1}, +{9802,6,0,-1},{9803,6,1,-1},{9806,6,0,-1},{9807,6,1,-1},{9810,6,0,-1}, +{9811,6,1,-1},{9815,6,0,-1},{9816,6,1,-1},{9819,6,0,-1},{9820,6,1,-1}, +{9823,6,0,-1},{9824,6,1,-1},{9828,6,0,-1},{9829,6,1,-1},{9762,6,0,-1}, +{9832,6,0,-1},{9833,6,1,-1},{9836,6,0,-1},{9837,6,1,-1},{9841,6,0,-1}, +{9842,6,1,-1},{9775,6,1,-1},{9845,6,0,-1},{9846,6,1,-1},{9849,6,0,-1}, +{9850,6,1,-1},{9854,6,0,-1},{9855,6,1,-1},{9858,6,0,-1},{9859,6,1,-1}, +{9862,6,0,-1},{9863,6,1,-1},{9867,6,0,-1},{9868,6,1,-1},{9871,6,0,-1}, +{9872,6,1,-1},{9875,6,0,-1},{9876,6,1,-1},{9880,6,0,-1},{9881,6,1,-1}, +{9884,6,0,-1},{9885,6,1,-1},{9888,6,0,-1},{9889,6,1,-1},{9893,6,0,-1}, +{9894,6,1,-1},{9897,6,0,-1},{9898,6,1,-1},{9901,6,0,-1},{9902,6,1,-1}, +{9906,6,0,-1},{9907,6,1,-1},{9910,6,0,-1},{9911,6,1,-1},{9914,6,0,-1}, +{9915,6,1,-1},{9919,6,0,-1},{9920,6,1,-1},{9923,6,0,-1},{9924,6,1,-1}, +{9927,6,0,-1},{9928,6,1,-1},{9932,6,0,-1},{9933,6,1,-1},{9866,6,0,-1}, +{9936,6,0,-1},{9937,6,1,-1},{9940,6,0,-1},{9941,6,1,-1},{9945,6,0,-1}, +{9946,6,1,-1},{9879,6,1,-1},{9949,6,0,-1},{9950,6,1,-1},{9953,6,0,-1}, +{9954,6,1,-1},{9958,6,0,-1},{9959,6,1,-1},{9962,6,0,-1},{9963,6,1,-1}, +{9966,6,0,-1},{9967,6,1,-1},{9971,6,0,-1},{9972,6,1,-1},{9975,6,0,-1}, +{9976,6,1,-1},{9979,6,0,-1},{9980,6,1,-1},{9984,6,0,-1},{9985,6,1,-1}, +{9988,6,0,-1},{9989,6,1,-1},{9992,6,0,-1},{9993,6,1,-1},{9997,6,0,-1}, +{9998,6,1,-1},{10001,6,0,-1},{10002,6,1,-1},{10005,6,0,-1},{10006,6,1,-1}, +{10010,6,0,-1},{10011,6,1,-1},{10014,6,0,-1},{10015,6,1,-1},{10018,6,0,-1}, +{10019,6,1,-1},{10023,6,0,-1},{10024,6,1,-1},{10027,6,0,-1},{10028,6,1,-1}, +{10031,6,0,-1},{10032,6,1,-1},{10036,6,0,-1},{10037,6,1,-1},{9970,6,0,-1}, +{10040,6,0,-1},{10041,6,1,-1},{10044,6,0,-1},{10045,6,1,-1},{10049,6,0,-1}, +{10050,6,1,-1},{9983,6,1,-1},{10053,6,0,-1},{10054,6,1,-1},{10057,6,0,-1}, +{10058,6,1,-1},{10062,6,0,-1},{10063,6,1,-1},{10066,6,0,-1},{10067,6,1,-1}, +{10070,6,0,-1},{10071,6,1,-1},{10075,6,0,-1},{10076,6,1,-1},{10079,6,0,-1}, +{10080,6,1,-1},{10083,6,0,-1},{10084,6,1,-1},{10088,6,0,-1},{10089,6,1,-1}, +{10092,6,0,-1},{10093,6,1,-1},{10096,6,0,-1},{10097,6,1,-1},{10101,6,0,-1}, +{10102,6,1,-1},{10105,6,0,-1},{10106,6,1,-1},{10109,6,0,-1},{10110,6,1,-1}, +{10114,6,0,-1},{10115,6,1,-1},{10118,6,0,-1},{10119,6,1,-1},{10122,6,0,-1}, +{10123,6,1,-1},{10127,6,0,-1},{10128,6,1,-1},{10131,6,0,-1},{10132,6,1,-1}, +{10135,6,0,-1},{10136,6,1,-1},{10140,6,0,-1},{10141,6,1,-1},{10074,6,0,-1}, +{10144,6,0,-1},{10145,6,1,-1},{10148,6,0,-1},{10149,6,1,-1},{10153,6,0,-1}, +{10154,6,1,-1},{10087,6,1,-1},{10157,6,0,-1},{10158,6,1,-1},{10161,6,0,-1}, +{10162,6,1,-1},{10166,6,0,-1},{10167,6,1,-1},{10170,6,0,-1},{10171,6,1,-1}, +{10174,6,0,-1},{10175,6,1,-1},{10179,6,0,-1},{10180,6,1,-1},{10183,6,0,-1}, +{10184,6,1,-1},{10187,6,0,-1},{10188,6,1,-1},{10192,6,0,-1},{10193,6,1,-1}, +{10196,6,0,-1},{10197,6,1,-1},{10200,6,0,-1},{10201,6,1,-1},{10205,6,0,-1}, +{10206,6,1,-1},{10209,6,0,-1},{10210,6,1,-1},{10213,6,0,-1},{10214,6,1,-1}, +{10218,6,0,-1},{10219,6,1,-1},{10222,6,0,-1},{10223,6,1,-1},{10226,6,0,-1}, +{10227,6,1,-1},{10231,6,0,-1},{10232,6,1,-1},{10235,6,0,-1},{10236,6,1,-1}, +{10239,6,0,-1},{10240,6,1,-1},{10244,6,0,-1},{10245,6,1,-1},{10178,6,0,-1}, +{10248,6,0,-1},{10249,6,1,-1},{10252,6,0,-1},{10253,6,1,-1},{10257,6,0,-1}, +{10258,6,1,-1},{10191,6,1,-1},{10261,6,0,-1},{10262,6,1,-1},{10265,6,0,-1}, +{10266,6,1,-1},{10270,6,0,-1},{10271,6,1,-1},{10274,6,0,-1},{10275,6,1,-1}, +{10278,6,0,-1},{10279,6,1,-1},{10283,6,0,-1},{10284,6,1,-1},{10287,6,0,-1}, +{10288,6,1,-1},{10291,6,0,-1},{10292,6,1,-1},{10296,6,0,-1},{10297,6,1,-1}, +{10300,6,0,-1},{10301,6,1,-1},{10304,6,0,-1},{10305,6,1,-1},{10309,6,0,-1}, +{10310,6,1,-1},{10313,6,0,-1},{10314,6,1,-1},{10317,6,0,-1},{10318,6,1,-1}, +{10322,6,0,-1},{10323,6,1,-1},{10326,6,0,-1},{10327,6,1,-1},{10330,6,0,-1}, +{10331,6,1,-1},{10335,6,0,-1},{10336,6,1,-1},{10339,6,0,-1},{10340,6,1,-1}, +{10343,6,0,-1},{10344,6,1,-1},{10348,6,0,-1},{10349,6,1,-1},{10282,6,0,-1}, +{10352,6,0,-1},{10353,6,1,-1},{10356,6,0,-1},{10357,6,1,-1},{10361,6,0,-1}, +{10362,6,1,-1},{10295,6,1,-1},{10365,6,0,-1},{10366,6,1,-1},{10369,6,0,-1}, +{10370,6,1,-1},{10374,6,0,-1},{10375,6,1,-1},{10378,6,0,-1},{10379,6,1,-1}, +{10382,6,0,-1},{10383,6,1,-1},{10387,6,0,-1},{10388,6,1,-1},{10391,6,0,-1}, +{10392,6,1,-1},{10395,6,0,-1},{10396,6,1,-1},{10400,6,0,-1},{10401,6,1,-1}, +{10404,6,0,-1},{10405,6,1,-1},{10408,6,0,-1},{10409,6,1,-1},{10413,6,0,-1}, +{10414,6,1,-1},{10417,6,0,-1},{10418,6,1,-1},{10421,6,0,-1},{10422,6,1,-1}, +{10426,6,0,-1},{10427,6,1,-1},{10430,6,0,-1},{10431,6,1,-1},{10434,6,0,-1}, +{10435,6,1,-1},{10439,6,0,-1},{10440,6,1,-1},{10443,6,0,-1},{10444,6,1,-1}, +{10447,6,0,-1},{10448,6,1,-1},{10452,6,0,-1},{10453,6,1,-1},{10386,6,0,-1}, +{10456,6,0,-1},{10457,6,1,-1},{10460,6,0,-1},{10461,6,1,-1},{10465,6,0,-1}, +{10466,6,1,-1},{10399,6,1,-1},{10469,6,0,-1},{10470,6,1,-1},{10473,6,0,-1}, +{10474,6,1,-1},{10478,6,0,-1},{10479,6,1,-1},{10482,6,0,-1},{10483,6,1,-1}, +{10486,6,0,-1},{10487,6,1,-1},{10491,6,0,-1},{10492,6,1,-1},{10495,6,0,-1}, +{10496,6,1,-1},{10499,6,0,-1},{10500,6,1,-1},{10504,6,0,-1},{10505,6,1,-1}, +{10508,6,0,-1},{10509,6,1,-1},{10512,6,0,-1},{10513,6,1,-1},{10517,6,0,-1}, +{10518,6,1,-1},{10521,6,0,-1},{10522,6,1,-1},{10525,6,0,-1},{10526,6,1,-1}, +{10530,6,0,-1},{10531,6,1,-1},{10534,6,0,-1},{10535,6,1,-1},{10538,6,0,-1}, +{10539,6,1,-1},{10543,6,0,-1},{10544,6,1,-1},{10547,6,0,-1},{10548,6,1,-1}, +{10551,6,0,-1},{10552,6,1,-1},{10556,6,0,-1},{10557,6,1,-1},{10490,6,0,-1}, +{10560,6,0,-1},{10561,6,1,-1},{10564,6,0,-1},{10565,6,1,-1},{10569,6,0,-1}, +{10570,6,1,-1},{10503,6,1,-1},{10573,6,0,-1},{10574,6,1,-1},{10577,6,0,-1}, +{10578,6,1,-1},{10582,6,0,-1},{10583,6,1,-1},{10586,6,0,-1},{10587,6,1,-1}, +{10590,6,0,-1},{10591,6,1,-1},{10595,6,0,-1},{10596,6,1,-1},{10599,6,0,-1}, +{10600,6,1,-1},{10603,6,0,-1},{10604,6,1,-1},{10608,6,0,-1},{10609,6,1,-1}, +{10612,6,0,-1},{10613,6,1,-1},{10616,6,0,-1},{10617,6,1,-1},{10621,6,0,-1}, +{10622,6,1,-1},{10625,6,0,-1},{10626,6,1,-1},{10629,6,0,-1},{10630,6,1,-1}, +{10634,6,0,-1},{10635,6,1,-1},{10638,6,0,-1},{10639,6,1,-1},{10642,6,0,-1}, +{10643,6,1,-1},{10647,6,0,-1},{10648,6,1,-1},{10651,6,0,-1},{10652,6,1,-1}, +{10655,6,0,-1},{10656,6,1,-1},{10660,6,0,-1},{10661,6,1,-1},{10594,6,0,-1}, +{10664,6,0,-1},{10665,6,1,-1},{10668,6,0,-1},{10669,6,1,-1},{10673,6,0,-1}, +{10674,6,1,-1},{10607,6,1,-1},{10677,6,0,-1},{10678,6,1,-1},{10681,6,0,-1}, +{10682,6,1,-1},{10686,6,0,-1},{10687,6,1,-1},{10690,6,0,-1},{10691,6,1,-1}, +{10694,6,0,-1},{10695,6,1,-1},{10699,6,0,-1},{10700,6,1,-1},{10703,6,0,-1}, +{10704,6,1,-1},{10707,6,0,-1},{10708,6,1,-1},{10712,6,0,-1},{10713,6,1,-1}, +{10716,6,0,-1},{10717,6,1,-1},{10720,6,0,-1},{10721,6,1,-1},{10725,6,0,-1}, +{10726,6,1,-1},{10729,6,0,-1},{10730,6,1,-1},{10733,6,0,-1},{10734,6,1,-1}, +{10738,6,0,-1},{10739,6,1,-1},{10742,6,0,-1},{10743,6,1,-1},{10746,6,0,-1}, +{10747,6,1,-1},{10751,6,0,-1},{10752,6,1,-1},{10755,6,0,-1},{10756,6,1,-1}, +{10759,6,0,-1},{10760,6,1,-1},{10764,6,0,-1},{10765,6,1,-1},{10698,6,0,-1}, +{10768,6,0,-1},{10769,6,1,-1},{10772,6,0,-1},{10773,6,1,-1},{10777,6,0,-1}, +{10778,6,1,-1},{10711,6,1,-1},{10781,6,0,-1},{10782,6,1,-1},{10785,6,0,-1}, +{10786,6,1,-1},{10790,6,0,-1},{10791,6,1,-1},{10794,6,0,-1},{10795,6,1,-1}, +{10798,6,0,-1},{10799,6,1,-1},{10803,6,0,-1},{10804,6,1,-1},{10807,6,0,-1}, +{10808,6,1,-1},{10811,6,0,-1},{10812,6,1,-1},{10816,6,0,-1},{10817,6,1,-1}, +{10820,6,0,-1},{10821,6,1,-1},{10824,6,0,-1},{10825,6,1,-1},{10829,6,0,-1}, +{10830,6,1,-1},{10833,6,0,-1},{10834,6,1,-1},{10837,6,0,-1},{10838,6,1,-1}, +{10842,6,0,-1},{10843,6,1,-1},{10846,6,0,-1},{10847,6,1,-1},{10850,6,0,-1}, +{10851,6,1,-1},{10855,6,0,-1},{10856,6,1,-1},{10859,6,0,-1},{10860,6,1,-1}, +{10863,6,0,-1},{10864,6,1,-1},{10868,6,0,-1},{10869,6,1,-1},{10802,6,0,-1}, +{10872,6,0,-1},{10873,6,1,-1},{10876,6,0,-1},{10877,6,1,-1},{10881,6,0,-1}, +{10882,6,1,-1},{10815,6,1,-1},{10885,6,0,-1},{10886,6,1,-1},{10889,6,0,-1}, +{10890,6,1,-1},{10894,6,0,-1},{10895,6,1,-1},{10898,6,0,-1},{10899,6,1,-1}, +{10902,6,0,-1},{10903,6,1,-1},{10907,6,0,-1},{10908,6,1,-1},{10911,6,0,-1}, +{10912,6,1,-1},{10915,6,0,-1},{10916,6,1,-1},{10920,6,0,-1},{10921,6,1,-1}, +{10924,6,0,-1},{10925,6,1,-1},{10928,6,0,-1},{10929,6,1,-1},{10933,6,0,-1}, +{10934,6,1,-1},{10937,6,0,-1},{10938,6,1,-1},{10941,6,0,-1},{10942,6,1,-1}, +{10946,6,0,-1},{10947,6,1,-1},{10950,6,0,-1},{10951,6,1,-1},{10954,6,0,-1}, +{10955,6,1,-1},{10959,6,0,-1},{10960,6,1,-1},{10963,6,0,-1},{10964,6,1,-1}, +{10967,6,0,-1},{10968,6,1,-1},{10972,6,0,-1},{10973,6,1,-1},{10906,6,0,-1}, +{10976,6,0,-1},{10977,6,1,-1},{10980,6,0,-1},{10981,6,1,-1},{10985,6,0,-1}, +{10986,6,1,-1},{10919,6,1,-1},{10989,6,0,-1},{10990,6,1,-1},{10993,6,0,-1}, +{10994,6,1,-1},{10998,6,0,-1},{10999,6,1,-1},{11002,6,0,-1},{11003,6,1,-1}, +{11006,6,0,-1},{11007,6,1,-1},{11011,6,0,-1},{11012,6,1,-1},{11015,6,0,-1}, +{11016,6,1,-1},{11019,6,0,-1},{11020,6,1,-1},{11024,6,0,-1},{11025,6,1,-1}, +{11028,6,0,-1},{11029,6,1,-1},{11032,6,0,-1},{11033,6,1,-1},{11037,6,0,-1}, +{11038,6,1,-1},{11041,6,0,-1},{11042,6,1,-1},{11045,6,0,-1},{11046,6,1,-1}, +{11050,6,0,-1},{11051,6,1,-1},{11054,6,0,-1},{11055,6,1,-1},{11058,6,0,-1}, +{11059,6,1,-1},{11063,6,0,-1},{11064,6,1,-1},{11067,6,0,-1},{11068,6,1,-1}, +{11071,6,0,-1},{11072,6,1,-1},{11076,6,0,-1},{11077,6,1,-1},{11010,6,0,-1}, +{11080,6,0,-1},{11081,6,1,-1},{11084,6,0,-1},{11085,6,1,-1},{11089,6,0,-1}, +{11090,6,1,-1},{11023,6,1,-1},{11093,6,0,-1},{11094,6,1,-1},{11097,6,0,-1}, +{11098,6,1,-1},{11102,6,0,-1},{11103,6,1,-1},{11106,6,0,-1},{11107,6,1,-1}, +{11110,6,0,-1},{11111,6,1,-1},{11115,6,0,-1},{11116,6,1,-1},{11119,6,0,-1}, +{11120,6,1,-1},{11123,6,0,-1},{11124,6,1,-1},{11128,6,0,-1},{11129,6,1,-1}, +{11132,6,0,-1},{11133,6,1,-1},{11136,6,0,-1},{11137,6,1,-1},{11141,6,0,-1}, +{11142,6,1,-1},{11145,6,0,-1},{11146,6,1,-1},{11149,6,0,-1},{11150,6,1,-1}, +{11154,6,0,-1},{11155,6,1,-1},{11158,6,0,-1},{11159,6,1,-1},{11162,6,0,-1}, +{11163,6,1,-1},{11167,6,0,-1},{11168,6,1,-1},{11171,6,0,-1},{11172,6,1,-1}, +{11175,6,0,-1},{11176,6,1,-1},{11180,6,0,-1},{11181,6,1,-1},{11114,6,0,-1}, +{11184,6,0,-1},{11185,6,1,-1},{11188,6,0,-1},{11189,6,1,-1},{11193,6,0,-1}, +{11194,6,1,-1},{11127,6,1,-1},{11197,6,0,-1},{11198,6,1,-1},{11201,6,0,-1}, +{11202,6,1,-1},{11206,6,0,-1},{11207,6,1,-1},{11210,6,0,-1},{11211,6,1,-1}, +{11214,6,0,-1},{11215,6,1,-1},{11219,6,0,-1},{11220,6,1,-1},{11223,6,0,-1}, +{11224,6,1,-1},{11227,6,0,-1},{11228,6,1,-1},{11232,6,0,-1},{11233,6,1,-1}, +{11236,6,0,-1},{11237,6,1,-1},{11240,6,0,-1},{11241,6,1,-1},{11245,6,0,-1}, +{11246,6,1,-1},{11249,6,0,-1},{11250,6,1,-1},{11253,6,0,-1},{11254,6,1,-1}, +{11258,6,0,-1},{11259,6,1,-1},{11262,6,0,-1},{11263,6,1,-1},{11266,6,0,-1}, +{11267,6,1,-1},{11271,6,0,-1},{11272,6,1,-1},{11275,6,0,-1},{11276,6,1,-1}, +{11279,6,0,-1},{11280,6,1,-1},{11284,6,0,-1},{11285,6,1,-1},{11218,6,0,-1}, +{11288,6,0,-1},{11289,6,1,-1},{11292,6,0,-1},{11293,6,1,-1},{11297,6,0,-1}, +{11298,6,1,-1},{11231,6,1,-1},{11301,6,0,-1},{11302,6,1,-1},{11305,6,0,-1}, +{11306,6,1,-1},{11310,6,0,-1},{11311,6,1,-1},{11314,6,0,-1},{11315,6,1,-1}, +{11318,6,0,-1},{11319,6,1,-1},{11323,6,0,-1},{11324,6,1,-1},{11327,6,0,-1}, +{11328,6,1,-1},{11331,6,0,-1},{11332,6,1,-1},{11336,6,0,-1},{11337,6,1,-1}, +{11340,6,0,-1},{11341,6,1,-1},{11344,6,0,-1},{11345,6,1,-1},{11349,6,0,-1}, +{11350,6,1,-1},{11353,6,0,-1},{11354,6,1,-1},{11357,6,0,-1},{11358,6,1,-1}, +{11362,6,0,-1},{11363,6,1,-1},{11366,6,0,-1},{11367,6,1,-1},{11370,6,0,-1}, +{11371,6,1,-1},{11375,6,0,-1},{11376,6,1,-1},{11379,6,0,-1},{11380,6,1,-1}, +{11383,6,0,-1},{11384,6,1,-1},{11388,6,0,-1},{11389,6,1,-1},{11322,6,0,-1}, +{11392,6,0,-1},{11393,6,1,-1},{11396,6,0,-1},{11397,6,1,-1},{11401,6,0,-1}, +{11402,6,1,-1},{11335,6,1,-1},{11405,6,0,-1},{11406,6,1,-1},{11409,6,0,-1}, +{11410,6,1,-1},{11414,6,0,-1},{11415,6,1,-1},{11418,6,0,-1},{11419,6,1,-1}, +{11422,6,0,-1},{11423,6,1,-1},{11427,6,0,-1},{11428,6,1,-1},{11431,6,0,-1}, +{11432,6,1,-1},{11435,6,0,-1},{11436,6,1,-1},{11440,6,0,-1},{11441,6,1,-1}, +{11444,6,0,-1},{11445,6,1,-1},{11448,6,0,-1},{11449,6,1,-1},{11453,6,0,-1}, +{11454,6,1,-1},{11457,6,0,-1},{11458,6,1,-1},{11461,6,0,-1},{11462,6,1,-1}, +{11466,6,0,-1},{11467,6,1,-1},{11470,6,0,-1},{11471,6,1,-1},{11474,6,0,-1}, +{11475,6,1,-1},{11479,6,0,-1},{11480,6,1,-1},{11483,6,0,-1},{11484,6,1,-1}, +{11487,6,0,-1},{11488,6,1,-1},{11492,6,0,-1},{11493,6,1,-1},{11426,6,0,-1}, +{11496,6,0,-1},{11497,6,1,-1},{11500,6,0,-1},{11501,6,1,-1},{11505,6,0,-1}, +{11506,6,1,-1},{11439,6,1,-1},{11509,6,0,-1},{11510,6,1,-1},{11513,6,0,-1}, +{11514,6,1,-1},{11518,6,0,-1},{11519,6,1,-1},{11522,6,0,-1},{11523,6,1,-1}, +{11526,6,0,-1},{11527,6,1,-1},{11531,6,0,-1},{11532,6,1,-1},{11535,6,0,-1}, +{11536,6,1,-1},{11539,6,0,-1},{11540,6,1,-1},{11544,6,0,-1},{11545,6,1,-1}, +{11548,6,0,-1},{11549,6,1,-1},{11552,6,0,-1},{11553,6,1,-1},{11557,6,0,-1}, +{11558,6,1,-1},{11561,6,0,-1},{11562,6,1,-1},{11565,6,0,-1},{11566,6,1,-1}, +{11570,6,0,-1},{11571,6,1,-1},{11574,6,0,-1},{11575,6,1,-1},{11578,6,0,-1}, +{11579,6,1,-1},{11583,6,0,-1},{11584,6,1,-1},{11587,6,0,-1},{11588,6,1,-1}, +{11591,6,0,-1},{11592,6,1,-1},{11596,6,0,-1},{11597,6,1,-1},{11530,6,0,-1}, +{11600,6,0,-1},{11601,6,1,-1},{11604,6,0,-1},{11605,6,1,-1},{11609,6,0,-1}, +{11610,6,1,-1},{11543,6,1,-1},{11613,6,0,-1},{11614,6,1,-1},{11617,6,0,-1}, +{11622,6,0,-1},{11623,6,1,-1},{11626,6,0,-1},{11627,6,1,-1},{11630,6,0,-1}, +{11631,6,1,-1},{11635,6,0,-1},{11636,6,1,-1},{11639,6,0,-1},{11640,6,1,-1}, +{11643,6,0,-1},{11644,6,1,-1},{11648,6,0,-1},{11649,6,1,-1},{11652,6,0,-1}, +{11653,6,1,-1},{11656,6,0,-1},{11657,6,1,-1},{11661,6,0,-1},{11662,6,1,-1}, +{11665,6,0,-1},{11666,6,1,-1},{11674,6,0,-1},{11675,6,1,-1},{11678,6,0,-1}, +{11679,6,1,-1},{11682,6,0,-1},{11683,6,1,-1},{11687,6,0,-1},{11688,6,1,-1}, +{11691,6,0,-1},{11692,6,1,-1},{11695,6,0,-1},{11696,6,1,-1},{11700,6,0,-1}, +{11701,6,1,-1},{11704,6,0,-1},{11705,6,1,-1},{11708,6,0,-1},{11709,6,1,-1}, +{11713,6,0,-1},{11717,6,0,-1},{11726,6,0,-1},{11730,6,0,-1},{11734,6,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS7, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_7_ss0_ss1[] = { +{11752,7,0,-1},{11760,7,0,-1},{11769,7,0,-1},{11778,7,0,-1},{11786,7,0,-1}, +{11795,7,0,-1},{11799,7,0,-1},{11804,7,0,-1},{11738,7,0,-1},{11808,7,0,-1}, +{11812,7,0,-1},{11817,7,0,-1},{11821,7,0,-1},{11825,7,0,-1},{11830,7,0,-1}, +{11834,7,0,-1},{11838,7,0,-1},{11843,7,0,-1},{11847,7,0,-1},{11851,7,0,-1}, +{11856,7,0,-1},{11860,7,0,-1},{11864,7,0,-1},{11869,7,0,-1},{11873,7,0,-1}, +{11877,7,0,-1},{11882,7,0,-1},{11886,7,0,-1},{11890,7,0,-1},{11895,7,0,-1}, +{11899,7,0,-1},{11903,7,0,-1},{11908,7,0,-1},{11842,7,0,-1},{11912,7,0,-1}, +{11916,7,0,-1},{11921,7,0,-1},{11925,7,0,-1},{11929,7,0,-1},{11934,7,0,-1}, +{11938,7,0,-1},{11942,7,0,-1},{11947,7,0,-1},{11951,7,0,-1},{11955,7,0,-1}, +{11960,7,0,-1},{11964,7,0,-1},{11968,7,0,-1},{11973,7,0,-1},{11977,7,0,-1}, +{11981,7,0,-1},{11986,7,0,-1},{11990,7,0,-1},{11994,7,0,-1},{11999,7,0,-1}, +{12003,7,0,-1},{12007,7,0,-1},{12012,7,0,-1},{11946,7,0,-1},{12016,7,0,-1}, +{12020,7,0,-1},{12025,7,0,-1},{12026,7,1,-1},{12029,7,0,-1},{12033,7,0,-1}, +{12034,7,1,-1},{12038,7,0,-1},{12042,7,0,-1},{12046,7,0,-1},{12047,7,1,-1}, +{12051,7,0,-1},{12055,7,0,-1},{12056,7,1,-1},{12059,7,0,-1},{12064,7,0,-1}, +{12065,7,1,-1},{12068,7,0,-1},{12072,7,0,-1},{12073,7,1,-1},{12077,7,0,-1}, +{12081,7,0,-1},{12082,7,1,-1},{12085,7,0,-1},{12090,7,0,-1},{12091,7,1,-1}, +{12094,7,0,-1},{12098,7,0,-1},{12099,7,1,-1},{12103,7,0,-1},{12107,7,0,-1}, +{12108,7,1,-1},{12111,7,0,-1},{12116,7,0,-1},{12117,7,1,-1},{12050,7,0,-1}, +{12120,7,0,-1},{12124,7,0,-1},{12125,7,1,-1},{12129,7,0,-1},{12063,7,1,-1}, +{12133,7,0,-1},{12134,7,1,-1},{12137,7,0,-1},{12142,7,0,-1},{12143,7,1,-1}, +{12146,7,0,-1},{12150,7,0,-1},{12151,7,1,-1},{12155,7,0,-1},{12159,7,0,-1}, +{12160,7,1,-1},{12163,7,0,-1},{12168,7,0,-1},{12169,7,1,-1},{12172,7,0,-1}, +{12176,7,0,-1},{12177,7,1,-1},{12181,7,0,-1},{12185,7,0,-1},{12186,7,1,-1}, +{12189,7,0,-1},{12190,7,1,-1},{12194,7,0,-1},{12195,7,1,-1},{12198,7,0,-1}, +{12199,7,1,-1},{12202,7,0,-1},{12203,7,1,-1},{12207,7,0,-1},{12208,7,1,-1}, +{12211,7,0,-1},{12212,7,1,-1},{12215,7,0,-1},{12220,7,0,-1},{12221,7,1,-1}, +{12154,7,0,-1},{12224,7,0,-1},{12225,7,1,-1},{12228,7,0,-1},{12229,7,1,-1}, +{12233,7,0,-1},{12234,7,1,-1},{12167,7,1,-1},{12237,7,0,-1},{12238,7,1,-1}, +{12241,7,0,-1},{12242,7,1,-1},{12246,7,0,-1},{12247,7,1,-1},{12250,7,0,-1}, +{12251,7,1,-1},{12254,7,0,-1},{12255,7,1,-1},{12260,7,1,-1},{12263,7,0,-1}, +{12264,7,1,-1},{12267,7,0,-1},{12268,7,1,-1},{12272,7,0,-1},{12273,7,1,-1}, +{12276,7,0,-1},{12277,7,1,-1},{12280,7,0,-1},{12281,7,1,-1},{12285,7,0,-1}, +{12286,7,1,-1},{12289,7,0,-1},{12290,7,1,-1},{12293,7,0,-1},{12294,7,1,-1}, +{12298,7,0,-1},{12299,7,1,-1},{12302,7,0,-1},{12303,7,1,-1},{12306,7,0,-1}, +{12307,7,1,-1},{12311,7,0,-1},{12312,7,1,-1},{12315,7,0,-1},{12316,7,1,-1}, +{12319,7,0,-1},{12320,7,1,-1},{12324,7,0,-1},{12325,7,1,-1},{12258,7,0,-1}, +{12328,7,0,-1},{12329,7,1,-1},{12332,7,0,-1},{12333,7,1,-1},{12337,7,0,-1}, +{12338,7,1,-1},{12271,7,1,-1},{12341,7,0,-1},{12342,7,1,-1},{12345,7,0,-1}, +{12346,7,1,-1},{12350,7,0,-1},{12351,7,1,-1},{12354,7,0,-1},{12355,7,1,-1}, +{12358,7,0,-1},{12359,7,1,-1},{12363,7,0,-1},{12367,7,0,-1},{12368,7,1,-1}, +{12371,7,0,-1},{12372,7,1,-1},{12376,7,0,-1},{12377,7,1,-1},{12380,7,0,-1}, +{12381,7,1,-1},{12384,7,0,-1},{12385,7,1,-1},{12389,7,0,-1},{12390,7,1,-1}, +{12393,7,0,-1},{12394,7,1,-1},{12397,7,0,-1},{12398,7,1,-1},{12402,7,0,-1}, +{12403,7,1,-1},{12407,7,1,-1},{12410,7,0,-1},{12411,7,1,-1},{12415,7,0,-1}, +{12419,7,0,-1},{12420,7,1,-1},{12423,7,0,-1},{12424,7,1,-1},{12428,7,0,-1}, +{12429,7,1,-1},{12362,7,0,-1},{12432,7,0,-1},{12433,7,1,-1},{12436,7,0,-1}, +{12437,7,1,-1},{12441,7,0,-1},{12442,7,1,-1},{12375,7,1,-1},{12445,7,0,-1}, +{12446,7,1,-1},{12449,7,0,-1},{12450,7,1,-1},{12454,7,0,-1},{12455,7,1,-1}, +{12458,7,0,-1},{12459,7,1,-1},{12462,7,0,-1},{12463,7,1,-1},{12467,7,0,-1}, +{12468,7,1,-1},{12471,7,0,-1},{12472,7,1,-1},{12475,7,0,-1},{12476,7,1,-1}, +{12480,7,0,-1},{12481,7,1,-1},{12484,7,0,-1},{12485,7,1,-1},{12488,7,0,-1}, +{12489,7,1,-1},{12493,7,0,-1},{12494,7,1,-1},{12497,7,0,-1},{12498,7,1,-1}, +{12501,7,0,-1},{12502,7,1,-1},{12506,7,0,-1},{12507,7,1,-1},{12510,7,0,-1}, +{12511,7,1,-1},{12514,7,0,-1},{12515,7,1,-1},{12519,7,0,-1},{12520,7,1,-1}, +{12523,7,0,-1},{12524,7,1,-1},{12527,7,0,-1},{12528,7,1,-1},{12532,7,0,-1}, +{12533,7,1,-1},{12466,7,0,-1},{12536,7,0,-1},{12537,7,1,-1},{12540,7,0,-1}, +{12541,7,1,-1},{12545,7,0,-1},{12546,7,1,-1},{12479,7,1,-1},{12549,7,0,-1}, +{12550,7,1,-1},{12553,7,0,-1},{12554,7,1,-1},{12558,7,0,-1},{12559,7,1,-1}, +{12562,7,0,-1},{12563,7,1,-1},{12566,7,0,-1},{12567,7,1,-1},{12571,7,0,-1}, +{12572,7,1,-1},{12575,7,0,-1},{12576,7,1,-1},{12579,7,0,-1},{12580,7,1,-1}, +{12584,7,0,-1},{12585,7,1,-1},{12588,7,0,-1},{12589,7,1,-1},{12592,7,0,-1}, +{12593,7,1,-1},{12597,7,0,-1},{12598,7,1,-1},{12601,7,0,-1},{12602,7,1,-1}, +{12605,7,0,-1},{12606,7,1,-1},{12610,7,0,-1},{12611,7,1,-1},{12614,7,0,-1}, +{12615,7,1,-1},{12618,7,0,-1},{12619,7,1,-1},{12623,7,0,-1},{12624,7,1,-1}, +{12627,7,0,-1},{12628,7,1,-1},{12631,7,0,-1},{12632,7,1,-1},{12636,7,0,-1}, +{12637,7,1,-1},{12570,7,0,-1},{12640,7,0,-1},{12641,7,1,-1},{12644,7,0,-1}, +{12645,7,1,-1},{12649,7,0,-1},{12650,7,1,-1},{12583,7,1,-1},{12653,7,0,-1}, +{12654,7,1,-1},{12657,7,0,-1},{12658,7,1,-1},{12662,7,0,-1},{12663,7,1,-1}, +{12666,7,0,-1},{12667,7,1,-1},{12670,7,0,-1},{12671,7,1,-1},{12675,7,0,-1}, +{12676,7,1,-1},{12679,7,0,-1},{12680,7,1,-1},{12683,7,0,-1},{12684,7,1,-1}, +{12688,7,0,-1},{12689,7,1,-1},{12692,7,0,-1},{12693,7,1,-1},{12696,7,0,-1}, +{12697,7,1,-1},{12701,7,0,-1},{12702,7,1,-1},{12705,7,0,-1},{12706,7,1,-1}, +{12709,7,0,-1},{12710,7,1,-1},{12714,7,0,-1},{12715,7,1,-1},{12718,7,0,-1}, +{12719,7,1,-1},{12722,7,0,-1},{12723,7,1,-1},{12727,7,0,-1},{12728,7,1,-1}, +{12731,7,0,-1},{12732,7,1,-1},{12735,7,0,-1},{12736,7,1,-1},{12740,7,0,-1}, +{12741,7,1,-1},{12674,7,0,-1},{12744,7,0,-1},{12745,7,1,-1},{12748,7,0,-1}, +{12749,7,1,-1},{12753,7,0,-1},{12754,7,1,-1},{12687,7,1,-1},{12757,7,0,-1}, +{12758,7,1,-1},{12761,7,0,-1},{12762,7,1,-1},{12766,7,0,-1},{12767,7,1,-1}, +{12770,7,0,-1},{12771,7,1,-1},{12774,7,0,-1},{12775,7,1,-1},{12779,7,0,-1}, +{12780,7,1,-1},{12783,7,0,-1},{12784,7,1,-1},{12787,7,0,-1},{12788,7,1,-1}, +{12792,7,0,-1},{12793,7,1,-1},{12796,7,0,-1},{12797,7,1,-1},{12800,7,0,-1}, +{12801,7,1,-1},{12805,7,0,-1},{12806,7,1,-1},{12809,7,0,-1},{12810,7,1,-1}, +{12813,7,0,-1},{12814,7,1,-1},{12818,7,0,-1},{12819,7,1,-1},{12822,7,0,-1}, +{12823,7,1,-1},{12826,7,0,-1},{12827,7,1,-1},{12831,7,0,-1},{12832,7,1,-1}, +{12835,7,0,-1},{12836,7,1,-1},{12839,7,0,-1},{12840,7,1,-1},{12844,7,0,-1}, +{12845,7,1,-1},{12778,7,0,-1},{12848,7,0,-1},{12849,7,1,-1},{12852,7,0,-1}, +{12853,7,1,-1},{12857,7,0,-1},{12858,7,1,-1},{12791,7,1,-1},{12861,7,0,-1}, +{12862,7,1,-1},{12865,7,0,-1},{12866,7,1,-1},{12870,7,0,-1},{12871,7,1,-1}, +{12874,7,0,-1},{12875,7,1,-1},{12878,7,0,-1},{12879,7,1,-1},{12883,7,0,-1}, +{12884,7,1,-1},{12887,7,0,-1},{12888,7,1,-1},{12891,7,0,-1},{12892,7,1,-1}, +{12896,7,0,-1},{12897,7,1,-1},{12900,7,0,-1},{12901,7,1,-1},{12904,7,0,-1}, +{12905,7,1,-1},{12909,7,0,-1},{12910,7,1,-1},{12913,7,0,-1},{12914,7,1,-1}, +{12917,7,0,-1},{12918,7,1,-1},{12922,7,0,-1},{12923,7,1,-1},{12926,7,0,-1}, +{12927,7,1,-1},{12930,7,0,-1},{12931,7,1,-1},{12935,7,0,-1},{12936,7,1,-1}, +{12939,7,0,-1},{12940,7,1,-1},{12943,7,0,-1},{12944,7,1,-1},{12948,7,0,-1}, +{12949,7,1,-1},{12882,7,0,-1},{12952,7,0,-1},{12953,7,1,-1},{12956,7,0,-1}, +{12957,7,1,-1},{12961,7,0,-1},{12962,7,1,-1},{12895,7,1,-1},{12965,7,0,-1}, +{12966,7,1,-1},{12969,7,0,-1},{12970,7,1,-1},{12974,7,0,-1},{12975,7,1,-1}, +{12978,7,0,-1},{12979,7,1,-1},{12982,7,0,-1},{12983,7,1,-1},{12987,7,0,-1}, +{12988,7,1,-1},{12991,7,0,-1},{12992,7,1,-1},{12995,7,0,-1},{12996,7,1,-1}, +{13000,7,0,-1},{13001,7,1,-1},{13004,7,0,-1},{13005,7,1,-1},{13008,7,0,-1}, +{13009,7,1,-1},{13013,7,0,-1},{13014,7,1,-1},{13017,7,0,-1},{13018,7,1,-1}, +{13021,7,0,-1},{13022,7,1,-1},{13026,7,0,-1},{13027,7,1,-1},{13030,7,0,-1}, +{13031,7,1,-1},{13034,7,0,-1},{13035,7,1,-1},{13039,7,0,-1},{13040,7,1,-1}, +{13043,7,0,-1},{13044,7,1,-1},{13047,7,0,-1},{13048,7,1,-1},{13052,7,0,-1}, +{13053,7,1,-1},{12986,7,0,-1},{13056,7,0,-1},{13057,7,1,-1},{13060,7,0,-1}, +{13061,7,1,-1},{13065,7,0,-1},{13066,7,1,-1},{12999,7,1,-1},{13069,7,0,-1}, +{13070,7,1,-1},{13073,7,0,-1},{13074,7,1,-1},{13078,7,0,-1},{13079,7,1,-1}, +{13082,7,0,-1},{13083,7,1,-1},{13086,7,0,-1},{13087,7,1,-1},{13091,7,0,-1}, +{13092,7,1,-1},{13095,7,0,-1},{13096,7,1,-1},{13099,7,0,-1},{13100,7,1,-1}, +{13104,7,0,-1},{13105,7,1,-1},{13108,7,0,-1},{13109,7,1,-1},{13112,7,0,-1}, +{13113,7,1,-1},{13117,7,0,-1},{13118,7,1,-1},{13121,7,0,-1},{13122,7,1,-1}, +{13125,7,0,-1},{13126,7,1,-1},{13130,7,0,-1},{13131,7,1,-1},{13134,7,0,-1}, +{13135,7,1,-1},{13138,7,0,-1},{13139,7,1,-1},{13143,7,0,-1},{13144,7,1,-1}, +{13147,7,0,-1},{13148,7,1,-1},{13151,7,0,-1},{13152,7,1,-1},{13156,7,0,-1}, +{13157,7,1,-1},{13090,7,0,-1},{13160,7,0,-1},{13161,7,1,-1},{13164,7,0,-1}, +{13165,7,1,-1},{13169,7,0,-1},{13170,7,1,-1},{13103,7,1,-1},{13173,7,0,-1}, +{13174,7,1,-1},{13177,7,0,-1},{13178,7,1,-1},{13182,7,0,-1},{13183,7,1,-1}, +{13186,7,0,-1},{13187,7,1,-1},{13190,7,0,-1},{13191,7,1,-1},{13195,7,0,-1}, +{13196,7,1,-1},{13199,7,0,-1},{13200,7,1,-1},{13203,7,0,-1},{13204,7,1,-1}, +{13208,7,0,-1},{13209,7,1,-1},{13212,7,0,-1},{13213,7,1,-1},{13216,7,0,-1}, +{13217,7,1,-1},{13221,7,0,-1},{13222,7,1,-1},{13225,7,0,-1},{13226,7,1,-1}, +{13229,7,0,-1},{13230,7,1,-1},{13234,7,0,-1},{13235,7,1,-1},{13238,7,0,-1}, +{13239,7,1,-1},{13242,7,0,-1},{13243,7,1,-1},{13247,7,0,-1},{13248,7,1,-1}, +{13251,7,0,-1},{13252,7,1,-1},{13255,7,0,-1},{13256,7,1,-1},{13260,7,0,-1}, +{13261,7,1,-1},{13194,7,0,-1},{13264,7,0,-1},{13265,7,1,-1},{13268,7,0,-1}, +{13269,7,1,-1},{13273,7,0,-1},{13274,7,1,-1},{13207,7,1,-1},{13277,7,0,-1}, +{13278,7,1,-1},{13281,7,0,-1},{13282,7,1,-1},{13286,7,0,-1},{13287,7,1,-1}, +{13290,7,0,-1},{13291,7,1,-1},{13294,7,0,-1},{13295,7,1,-1},{13299,7,0,-1}, +{13300,7,1,-1},{13303,7,0,-1},{13304,7,1,-1},{13307,7,0,-1},{13308,7,1,-1}, +{13312,7,0,-1},{13313,7,1,-1},{13316,7,0,-1},{13317,7,1,-1},{13320,7,0,-1}, +{13321,7,1,-1},{13325,7,0,-1},{13326,7,1,-1},{13329,7,0,-1},{13330,7,1,-1}, +{13333,7,0,-1},{13334,7,1,-1},{13338,7,0,-1},{13339,7,1,-1},{13342,7,0,-1}, +{13343,7,1,-1},{13346,7,0,-1},{13347,7,1,-1},{13351,7,0,-1},{13352,7,1,-1}, +{13355,7,0,-1},{13356,7,1,-1},{13359,7,0,-1},{13360,7,1,-1},{13364,7,0,-1}, +{13365,7,1,-1},{13298,7,0,-1},{13368,7,0,-1},{13369,7,1,-1},{13372,7,0,-1}, +{13373,7,1,-1},{13377,7,0,-1},{13378,7,1,-1},{13311,7,1,-1},{13381,7,0,-1}, +{13382,7,1,-1},{13385,7,0,-1},{13386,7,1,-1},{13390,7,0,-1},{13391,7,1,-1}, +{13394,7,0,-1},{13395,7,1,-1},{13398,7,0,-1},{13399,7,1,-1},{13403,7,0,-1}, +{13404,7,1,-1},{13407,7,0,-1},{13408,7,1,-1},{13411,7,0,-1},{13412,7,1,-1}, +{13416,7,0,-1},{13417,7,1,-1},{13420,7,0,-1},{13421,7,1,-1},{13424,7,0,-1}, +{13425,7,1,-1},{13429,7,0,-1},{13430,7,1,-1},{13433,7,0,-1},{13434,7,1,-1}, +{13437,7,0,-1},{13438,7,1,-1},{13442,7,0,-1},{13443,7,1,-1},{13446,7,0,-1}, +{13447,7,1,-1},{13450,7,0,-1},{13451,7,1,-1},{13455,7,0,-1},{13456,7,1,-1}, +{13459,7,0,-1},{13460,7,1,-1},{13463,7,0,-1},{13464,7,1,-1},{13468,7,0,-1}, +{13469,7,1,-1},{13402,7,0,-1},{13472,7,0,-1},{13473,7,1,-1},{13476,7,0,-1}, +{13477,7,1,-1},{13481,7,0,-1},{13482,7,1,-1},{13415,7,1,-1},{13485,7,0,-1}, +{13486,7,1,-1},{13489,7,0,-1},{13490,7,1,-1},{13494,7,0,-1},{13495,7,1,-1}, +{13498,7,0,-1},{13499,7,1,-1},{13502,7,0,-1},{13503,7,1,-1},{13507,7,0,-1}, +{13508,7,1,-1},{13511,7,0,-1},{13512,7,1,-1},{13515,7,0,-1},{13516,7,1,-1}, +{13520,7,0,-1},{13521,7,1,-1},{13524,7,0,-1},{13525,7,1,-1},{13528,7,0,-1}, +{13529,7,1,-1},{13533,7,0,-1},{13534,7,1,-1},{13537,7,0,-1},{13538,7,1,-1}, +{13541,7,0,-1},{13542,7,1,-1},{13546,7,0,-1},{13547,7,1,-1},{13550,7,0,-1}, +{13551,7,1,-1},{13554,7,0,-1},{13555,7,1,-1},{13559,7,0,-1},{13560,7,1,-1}, +{13563,7,0,-1},{13564,7,1,-1},{13567,7,0,-1},{13568,7,1,-1},{13572,7,0,-1}, +{13573,7,1,-1},{13506,7,0,-1},{13576,7,0,-1},{13577,7,1,-1},{13580,7,0,-1}, +{13581,7,1,-1},{13585,7,0,-1},{13586,7,1,-1},{13519,7,1,-1},{13589,7,0,-1}, +{13590,7,1,-1},{13593,7,0,-1},{13594,7,1,-1},{13598,7,0,-1},{13599,7,1,-1}, +{13602,7,0,-1},{13603,7,1,-1},{13606,7,0,-1},{13607,7,1,-1},{13611,7,0,-1}, +{13612,7,1,-1},{13615,7,0,-1},{13616,7,1,-1},{13619,7,0,-1},{13620,7,1,-1}, +{13624,7,0,-1},{13625,7,1,-1},{13628,7,0,-1},{13629,7,1,-1},{13632,7,0,-1}, +{13633,7,1,-1},{13637,7,0,-1},{13638,7,1,-1},{13641,7,0,-1},{13642,7,1,-1}, +{13645,7,0,-1},{13646,7,1,-1},{13650,7,0,-1},{13651,7,1,-1},{13654,7,0,-1}, +{13655,7,1,-1},{13658,7,0,-1},{13659,7,1,-1},{13663,7,0,-1},{13664,7,1,-1}, +{13667,7,0,-1},{13668,7,1,-1},{13671,7,0,-1},{13672,7,1,-1},{13676,7,0,-1}, +{13677,7,1,-1},{13610,7,0,-1},{13680,7,0,-1},{13681,7,1,-1},{13684,7,0,-1}, +{13685,7,1,-1},{13689,7,0,-1},{13690,7,1,-1},{13623,7,1,-1},{13693,7,0,-1}, +{13694,7,1,-1},{13697,7,0,-1},{13698,7,1,-1},{13702,7,0,-1},{13703,7,1,-1}, +{13706,7,0,-1},{13707,7,1,-1},{13710,7,0,-1},{13711,7,1,-1},{13715,7,0,-1}, +{13716,7,1,-1},{13719,7,0,-1},{13720,7,1,-1},{13723,7,0,-1},{13724,7,1,-1}, +{13728,7,0,-1},{13729,7,1,-1},{13732,7,0,-1},{13733,7,1,-1},{13736,7,0,-1}, +{13737,7,1,-1},{13741,7,0,-1},{13742,7,1,-1},{13745,7,0,-1},{13746,7,1,-1}, +{13749,7,0,-1},{13750,7,1,-1},{13754,7,0,-1},{13755,7,1,-1},{13758,7,0,-1}, +{13759,7,1,-1},{13762,7,0,-1},{13763,7,1,-1},{13767,7,0,-1},{13768,7,1,-1}, +{13771,7,0,-1},{13772,7,1,-1},{13775,7,0,-1},{13776,7,1,-1},{13780,7,0,-1}, +{13781,7,1,-1},{13714,7,0,-1},{13784,7,0,-1},{13785,7,1,-1},{13788,7,0,-1}, +{13789,7,1,-1},{13793,7,0,-1},{13794,7,1,-1},{13727,7,1,-1},{13797,7,0,-1}, +{13798,7,1,-1},{13801,7,0,-1},{13802,7,1,-1},{13806,7,0,-1},{13807,7,1,-1}, +{13810,7,0,-1},{13811,7,1,-1},{13814,7,0,-1},{13815,7,1,-1},{13819,7,0,-1}, +{13820,7,1,-1},{13823,7,0,-1},{13824,7,1,-1},{13827,7,0,-1},{13828,7,1,-1}, +{13832,7,0,-1},{13833,7,1,-1},{13836,7,0,-1},{13837,7,1,-1},{13840,7,0,-1}, +{13841,7,1,-1},{13845,7,0,-1},{13846,7,1,-1},{13849,7,0,-1},{13850,7,1,-1}, +{13853,7,0,-1},{13854,7,1,-1},{13858,7,0,-1},{13859,7,1,-1},{13862,7,0,-1}, +{13863,7,1,-1},{13866,7,0,-1},{13867,7,1,-1},{13871,7,0,-1},{13872,7,1,-1}, +{13875,7,0,-1},{13876,7,1,-1},{13879,7,0,-1},{13880,7,1,-1},{13884,7,0,-1}, +{13885,7,1,-1},{13818,7,0,-1},{13888,7,0,-1},{13889,7,1,-1},{13892,7,0,-1}, +{13893,7,1,-1},{13897,7,0,-1},{13898,7,1,-1},{13831,7,1,-1},{13901,7,0,-1}, +{13902,7,1,-1},{13905,7,0,-1},{13906,7,1,-1},{13910,7,0,-1},{13911,7,1,-1}, +{13914,7,0,-1},{13915,7,1,-1},{13918,7,0,-1},{13919,7,1,-1},{13923,7,0,-1}, +{13924,7,1,-1},{13927,7,0,-1},{13928,7,1,-1},{13931,7,0,-1},{13932,7,1,-1}, +{13936,7,0,-1},{13937,7,1,-1},{13940,7,0,-1},{13941,7,1,-1},{13944,7,0,-1}, +{13945,7,1,-1},{13949,7,0,-1},{13950,7,1,-1},{13953,7,0,-1},{13954,7,1,-1}, +{13957,7,0,-1},{13958,7,1,-1},{13962,7,0,-1},{13963,7,1,-1},{13966,7,0,-1}, +{13967,7,1,-1},{13970,7,0,-1},{13971,7,1,-1},{13975,7,0,-1},{13976,7,1,-1}, +{13979,7,0,-1},{13980,7,1,-1},{13983,7,0,-1},{13984,7,1,-1},{13988,7,0,-1}, +{13989,7,1,-1},{13922,7,0,-1},{13992,7,0,-1},{13993,7,1,-1},{13996,7,0,-1}, +{13997,7,1,-1},{14001,7,0,-1},{14002,7,1,-1},{13935,7,1,-1},{14005,7,0,-1}, +{14006,7,1,-1},{14009,7,0,-1},{14010,7,1,-1},{14014,7,0,-1},{14015,7,1,-1}, +{14018,7,0,-1},{14019,7,1,-1},{14022,7,0,-1},{14023,7,1,-1},{14027,7,0,-1}, +{14028,7,1,-1},{14031,7,0,-1},{14032,7,1,-1},{14035,7,0,-1},{14036,7,1,-1}, +{14040,7,0,-1},{14041,7,1,-1},{14044,7,0,-1},{14045,7,1,-1},{14048,7,0,-1}, +{14049,7,1,-1},{14053,7,0,-1},{14054,7,1,-1},{14057,7,0,-1},{14058,7,1,-1}, +{14061,7,0,-1},{14062,7,1,-1},{14066,7,0,-1},{14067,7,1,-1},{14070,7,0,-1}, +{14071,7,1,-1},{14074,7,0,-1},{14075,7,1,-1},{14079,7,0,-1},{14080,7,1,-1}, +{14083,7,0,-1},{14084,7,1,-1},{14087,7,0,-1},{14088,7,1,-1},{14092,7,0,-1}, +{14093,7,1,-1},{14026,7,0,-1},{14096,7,0,-1},{14097,7,1,-1},{14100,7,0,-1}, +{14101,7,1,-1},{14105,7,0,-1},{14106,7,1,-1},{14039,7,1,-1},{14109,7,0,-1}, +{14110,7,1,-1},{14113,7,0,-1},{14114,7,1,-1},{14118,7,0,-1},{14119,7,1,-1}, +{14122,7,0,-1},{14123,7,1,-1},{14126,7,0,-1},{14127,7,1,-1},{14131,7,0,-1}, +{14132,7,1,-1},{14135,7,0,-1},{14136,7,1,-1},{14139,7,0,-1},{14140,7,1,-1}, +{14144,7,0,-1},{14145,7,1,-1},{14148,7,0,-1},{14149,7,1,-1},{14152,7,0,-1}, +{14153,7,1,-1},{14157,7,0,-1},{14158,7,1,-1},{14161,7,0,-1},{14162,7,1,-1}, +{14165,7,0,-1},{14166,7,1,-1},{14170,7,0,-1},{14171,7,1,-1},{14174,7,0,-1}, +{14175,7,1,-1},{14178,7,0,-1},{14179,7,1,-1},{14183,7,0,-1},{14184,7,1,-1}, +{14187,7,0,-1},{14188,7,1,-1},{14191,7,0,-1},{14192,7,1,-1},{14196,7,0,-1}, +{14197,7,1,-1},{14130,7,0,-1},{14200,7,0,-1},{14201,7,1,-1},{14204,7,0,-1}, +{14205,7,1,-1},{14209,7,0,-1},{14210,7,1,-1},{14143,7,1,-1},{14213,7,0,-1}, +{14214,7,1,-1},{14217,7,0,-1},{14218,7,1,-1},{14222,7,0,-1},{14223,7,1,-1}, +{14226,7,0,-1},{14227,7,1,-1},{14230,7,0,-1},{14231,7,1,-1},{14235,7,0,-1}, +{14236,7,1,-1},{14239,7,0,-1},{14240,7,1,-1},{14243,7,0,-1},{14244,7,1,-1}, +{14248,7,0,-1},{14249,7,1,-1},{14252,7,0,-1},{14253,7,1,-1},{14256,7,0,-1}, +{14257,7,1,-1},{14261,7,0,-1},{14262,7,1,-1},{14265,7,0,-1},{14266,7,1,-1}, +{14269,7,0,-1},{14270,7,1,-1},{14274,7,0,-1},{14275,7,1,-1},{14278,7,0,-1}, +{14279,7,1,-1},{14282,7,0,-1},{14283,7,1,-1},{14287,7,0,-1},{14288,7,1,-1}, +{14291,7,0,-1},{14292,7,1,-1},{14295,7,0,-1},{14296,7,1,-1},{14300,7,0,-1}, +{14301,7,1,-1},{14234,7,0,-1},{14304,7,0,-1},{14305,7,1,-1},{14308,7,0,-1}, +{14309,7,1,-1},{14313,7,0,-1},{14314,7,1,-1},{14247,7,1,-1},{14317,7,0,-1}, +{14318,7,1,-1},{14321,7,0,-1},{14322,7,1,-1},{14326,7,0,-1},{14327,7,1,-1}, +{14330,7,0,-1},{14331,7,1,-1},{14334,7,0,-1},{14335,7,1,-1},{14339,7,0,-1}, +{14340,7,1,-1},{14343,7,0,-1},{14344,7,1,-1},{14347,7,0,-1},{14348,7,1,-1}, +{14352,7,0,-1},{14353,7,1,-1},{14356,7,0,-1},{14357,7,1,-1},{14360,7,0,-1}, +{14361,7,1,-1},{14365,7,0,-1},{14366,7,1,-1},{14369,7,0,-1},{14370,7,1,-1}, +{14373,7,0,-1},{14374,7,1,-1},{14378,7,0,-1},{14379,7,1,-1},{14382,7,0,-1}, +{14383,7,1,-1},{14386,7,0,-1},{14387,7,1,-1},{14391,7,0,-1},{14392,7,1,-1}, +{14395,7,0,-1},{14396,7,1,-1},{14399,7,0,-1},{14400,7,1,-1},{14404,7,0,-1}, +{14405,7,1,-1},{14338,7,0,-1},{14408,7,0,-1},{14409,7,1,-1},{14412,7,0,-1}, +{14413,7,1,-1},{14417,7,0,-1},{14418,7,1,-1},{14351,7,1,-1},{14421,7,0,-1}, +{14422,7,1,-1},{14425,7,0,-1},{14426,7,1,-1},{14430,7,0,-1},{14431,7,1,-1}, +{14434,7,0,-1},{14435,7,1,-1},{14438,7,0,-1},{14439,7,1,-1},{14443,7,0,-1}, +{14444,7,1,-1},{14447,7,0,-1},{14448,7,1,-1},{14451,7,0,-1},{14452,7,1,-1}, +{14456,7,0,-1},{14457,7,1,-1},{14460,7,0,-1},{14461,7,1,-1},{14464,7,0,-1}, +{14465,7,1,-1},{14469,7,0,-1},{14470,7,1,-1},{14473,7,0,-1},{14474,7,1,-1}, +{14477,7,0,-1},{14478,7,1,-1},{14482,7,0,-1},{14483,7,1,-1},{14486,7,0,-1}, +{14487,7,1,-1},{14490,7,0,-1},{14491,7,1,-1},{14495,7,0,-1},{14496,7,1,-1}, +{14499,7,0,-1},{14500,7,1,-1},{14503,7,0,-1},{14504,7,1,-1},{14508,7,0,-1}, +{14509,7,1,-1},{14442,7,0,-1},{14512,7,0,-1},{14513,7,1,-1},{14516,7,0,-1}, +{14517,7,1,-1},{14521,7,0,-1},{14522,7,1,-1},{14455,7,1,-1},{14525,7,0,-1}, +{14526,7,1,-1},{14529,7,0,-1},{14530,7,1,-1},{14534,7,0,-1},{14535,7,1,-1}, +{14538,7,0,-1},{14539,7,1,-1},{14542,7,0,-1},{14543,7,1,-1},{14547,7,0,-1}, +{14548,7,1,-1},{14551,7,0,-1},{14552,7,1,-1},{14555,7,0,-1},{14556,7,1,-1}, +{14560,7,0,-1},{14561,7,1,-1},{14564,7,0,-1},{14565,7,1,-1},{14568,7,0,-1}, +{14569,7,1,-1},{14573,7,0,-1},{14574,7,1,-1},{14577,7,0,-1},{14578,7,1,-1}, +{14581,7,0,-1},{14582,7,1,-1},{14586,7,0,-1},{14587,7,1,-1},{14590,7,0,-1}, +{14591,7,1,-1},{14594,7,0,-1},{14595,7,1,-1},{14599,7,0,-1},{14600,7,1,-1}, +{14603,7,0,-1},{14604,7,1,-1},{14607,7,0,-1},{14608,7,1,-1},{14612,7,0,-1}, +{14613,7,1,-1},{14546,7,0,-1},{14616,7,0,-1},{14617,7,1,-1},{14620,7,0,-1}, +{14621,7,1,-1},{14625,7,0,-1},{14626,7,1,-1},{14559,7,1,-1},{14629,7,0,-1}, +{14630,7,1,-1},{14633,7,0,-1},{14634,7,1,-1},{14638,7,0,-1},{14639,7,1,-1}, +{14642,7,0,-1},{14643,7,1,-1},{14646,7,0,-1},{14647,7,1,-1},{14651,7,0,-1}, +{14652,7,1,-1},{14655,7,0,-1},{14656,7,1,-1},{14659,7,0,-1},{14660,7,1,-1}, +{14664,7,0,-1},{14665,7,1,-1},{14668,7,0,-1},{14669,7,1,-1},{14672,7,0,-1}, +{14673,7,1,-1},{14677,7,0,-1},{14678,7,1,-1},{14681,7,0,-1},{14682,7,1,-1}, +{14685,7,0,-1},{14686,7,1,-1},{14690,7,0,-1},{14691,7,1,-1},{14694,7,0,-1}, +{14695,7,1,-1},{14698,7,0,-1},{14699,7,1,-1},{14703,7,0,-1},{14704,7,1,-1}, +{14707,7,0,-1},{14708,7,1,-1},{14711,7,0,-1},{14712,7,1,-1},{14716,7,0,-1}, +{14717,7,1,-1},{14650,7,0,-1},{14720,7,0,-1},{14721,7,1,-1},{14724,7,0,-1}, +{14725,7,1,-1},{14729,7,0,-1},{14730,7,1,-1},{14663,7,1,-1},{14733,7,0,-1}, +{14734,7,1,-1},{14737,7,0,-1},{14738,7,1,-1},{14742,7,0,-1},{14743,7,1,-1}, +{14746,7,0,-1},{14747,7,1,-1},{14750,7,0,-1},{14751,7,1,-1},{14755,7,0,-1}, +{14756,7,1,-1},{14759,7,0,-1},{14760,7,1,-1},{14763,7,0,-1},{14764,7,1,-1}, +{14768,7,0,-1},{14769,7,1,-1},{14772,7,0,-1},{14773,7,1,-1},{14776,7,0,-1}, +{14777,7,1,-1},{14781,7,0,-1},{14782,7,1,-1},{14785,7,0,-1},{14786,7,1,-1}, +{14789,7,0,-1},{14790,7,1,-1},{14794,7,0,-1},{14795,7,1,-1},{14798,7,0,-1}, +{14799,7,1,-1},{14802,7,0,-1},{14803,7,1,-1},{14807,7,0,-1},{14808,7,1,-1}, +{14811,7,0,-1},{14812,7,1,-1},{14815,7,0,-1},{14816,7,1,-1},{14820,7,0,-1}, +{14821,7,1,-1},{14754,7,0,-1},{14824,7,0,-1},{14825,7,1,-1},{14828,7,0,-1}, +{14829,7,1,-1},{14833,7,0,-1},{14834,7,1,-1},{14767,7,1,-1},{14837,7,0,-1}, +{14838,7,1,-1},{14841,7,0,-1},{14842,7,1,-1},{14846,7,0,-1},{14847,7,1,-1}, +{14850,7,0,-1},{14851,7,1,-1},{14854,7,0,-1},{14855,7,1,-1},{14859,7,0,-1}, +{14860,7,1,-1},{14863,7,0,-1},{14864,7,1,-1},{14867,7,0,-1},{14868,7,1,-1}, +{14872,7,0,-1},{14873,7,1,-1},{14876,7,0,-1},{14877,7,1,-1},{14880,7,0,-1}, +{14881,7,1,-1},{14885,7,0,-1},{14886,7,1,-1},{14889,7,0,-1},{14890,7,1,-1}, +{14893,7,0,-1},{14894,7,1,-1},{14898,7,0,-1},{14899,7,1,-1},{14902,7,0,-1}, +{14903,7,1,-1},{14906,7,0,-1},{14907,7,1,-1},{14911,7,0,-1},{14912,7,1,-1}, +{14915,7,0,-1},{14916,7,1,-1},{14919,7,0,-1},{14920,7,1,-1},{14924,7,0,-1}, +{14925,7,1,-1},{14858,7,0,-1},{14928,7,0,-1},{14929,7,1,-1},{14932,7,0,-1}, +{14933,7,1,-1},{14937,7,0,-1},{14938,7,1,-1},{14871,7,1,-1},{14941,7,0,-1}, +{14942,7,1,-1},{14945,7,0,-1},{14946,7,1,-1},{14950,7,0,-1},{14951,7,1,-1}, +{14954,7,0,-1},{14955,7,1,-1},{14958,7,0,-1},{14959,7,1,-1},{14963,7,0,-1}, +{14964,7,1,-1},{14967,7,0,-1},{14968,7,1,-1},{14971,7,0,-1},{14972,7,1,-1}, +{14976,7,0,-1},{14977,7,1,-1},{14980,7,0,-1},{14981,7,1,-1},{14984,7,0,-1}, +{14985,7,1,-1},{14989,7,0,-1},{14990,7,1,-1},{14993,7,0,-1},{14994,7,1,-1}, +{14997,7,0,-1},{14998,7,1,-1},{15002,7,0,-1},{15003,7,1,-1},{15006,7,0,-1}, +{15007,7,1,-1},{15010,7,0,-1},{15011,7,1,-1},{15015,7,0,-1},{15016,7,1,-1}, +{15019,7,0,-1},{15020,7,1,-1},{15023,7,0,-1},{15024,7,1,-1},{15028,7,0,-1}, +{15029,7,1,-1},{14962,7,0,-1},{15032,7,0,-1},{15033,7,1,-1},{15036,7,0,-1}, +{15037,7,1,-1},{15041,7,0,-1},{15042,7,1,-1},{14975,7,1,-1},{15045,7,0,-1}, +{15046,7,1,-1},{15049,7,0,-1},{15050,7,1,-1},{15054,7,0,-1},{15055,7,1,-1}, +{15058,7,0,-1},{15059,7,1,-1},{15062,7,0,-1},{15063,7,1,-1},{15067,7,0,-1}, +{15068,7,1,-1},{15071,7,0,-1},{15072,7,1,-1},{15075,7,0,-1},{15076,7,1,-1}, +{15080,7,0,-1},{15081,7,1,-1},{15084,7,0,-1},{15085,7,1,-1},{15088,7,0,-1}, +{15089,7,1,-1},{15093,7,0,-1},{15094,7,1,-1},{15097,7,0,-1},{15098,7,1,-1}, +{15101,7,0,-1},{15102,7,1,-1},{15106,7,0,-1},{15107,7,1,-1},{15110,7,0,-1}, +{15111,7,1,-1},{15114,7,0,-1},{15115,7,1,-1},{15119,7,0,-1},{15120,7,1,-1}, +{15123,7,0,-1},{15124,7,1,-1},{15127,7,0,-1},{15128,7,1,-1},{15132,7,0,-1}, +{15133,7,1,-1},{15066,7,0,-1},{15136,7,0,-1},{15137,7,1,-1},{15140,7,0,-1}, +{15141,7,1,-1},{15145,7,0,-1},{15146,7,1,-1},{15079,7,1,-1},{15149,7,0,-1}, +{15150,7,1,-1},{15153,7,0,-1},{15154,7,1,-1},{15158,7,0,-1},{15159,7,1,-1}, +{15162,7,0,-1},{15163,7,1,-1},{15166,7,0,-1},{15167,7,1,-1},{15171,7,0,-1}, +{15172,7,1,-1},{15175,7,0,-1},{15176,7,1,-1},{15179,7,0,-1},{15180,7,1,-1}, +{15184,7,0,-1},{15185,7,1,-1},{15188,7,0,-1},{15189,7,1,-1},{15192,7,0,-1}, +{15193,7,1,-1},{15197,7,0,-1},{15198,7,1,-1},{15201,7,0,-1},{15202,7,1,-1}, +{15205,7,0,-1},{15206,7,1,-1},{15210,7,0,-1},{15211,7,1,-1},{15214,7,0,-1}, +{15215,7,1,-1},{15218,7,0,-1},{15219,7,1,-1},{15223,7,0,-1},{15224,7,1,-1}, +{15227,7,0,-1},{15228,7,1,-1},{15231,7,0,-1},{15232,7,1,-1},{15236,7,0,-1}, +{15237,7,1,-1},{15170,7,0,-1},{15240,7,0,-1},{15241,7,1,-1},{15244,7,0,-1}, +{15245,7,1,-1},{15249,7,0,-1},{15250,7,1,-1},{15183,7,1,-1},{15253,7,0,-1}, +{15254,7,1,-1},{15257,7,0,-1},{15258,7,1,-1},{15262,7,0,-1},{15263,7,1,-1}, +{15266,7,0,-1},{15267,7,1,-1},{15270,7,0,-1},{15271,7,1,-1},{15275,7,0,-1}, +{15276,7,1,-1},{15279,7,0,-1},{15280,7,1,-1},{15284,7,1,-1},{15288,7,0,-1}, +{15289,7,1,-1},{15292,7,0,-1},{15293,7,1,-1},{15296,7,0,-1},{15297,7,1,-1}, +{15301,7,0,-1},{15302,7,1,-1},{15305,7,0,-1},{15306,7,1,-1},{15309,7,0,-1}, +{15310,7,1,-1},{15314,7,0,-1},{15315,7,1,-1},{15318,7,0,-1},{15319,7,1,-1}, +{15322,7,0,-1},{15323,7,1,-1},{15327,7,0,-1},{15328,7,1,-1},{15331,7,0,-1}, +{15332,7,1,-1},{15336,7,1,-1},{15340,7,0,-1},{15341,7,1,-1},{15344,7,0,-1}, +{15345,7,1,-1},{15348,7,0,-1},{15349,7,1,-1},{15353,7,0,-1},{15354,7,1,-1}, +{15357,7,0,-1},{15361,7,0,-1},{15366,7,0,-1},{15370,7,0,-1},{15374,7,0,-1}}; diff --git a/tests/testsuite.at b/tests/testsuite.at index fed0018..0efd333 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -37,3 +37,9 @@ cat $abs_srcdir/tx_power/tx_power_test.err > experr AT_CHECK([$abs_top_builddir/tests/tx_power/tx_power_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([meas]) +AT_KEYWORDS([meas]) +cat $abs_srcdir/meas/meas_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/meas/meas_test], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 Gerrit-PatchSet: 8 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 Mon Jul 10 12:33:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 12:33:41 +0000 Subject: [PATCH] libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1526 to look at the new patch set (#7). Add function to generate random identifier The function is a wrapper on top of getrandom() (if available via glibc) or corresponding syscall. If neither is available than insecure random generation is used as a fallback (which is clearly indicated to the caller). It's intended to generate small random data good enough for session identifiers and keys. To generate long-term cryptographic keys it's better to use special crypto libraries like GnuTLS instead. The size of the output is deliberately limited to decrease the chance of entropy pool depletion. It's still possible via successive calls but the caller can find a way to deplete the entropy anyway so it's not our concern. As an example it's used to replace old insecure random number generator in osmo-auc-gen utility. Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Related: OS#1694 --- M configure.ac M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map M utils/osmo-auc-gen.c 5 files changed, 75 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1526/7 diff --git a/configure.ac b/configure.ac index 96757df..d662d8f 100644 --- a/configure.ac +++ b/configure.ac @@ -68,6 +68,9 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") +# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped +AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include ]]) + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index a879d33..ea388cd 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -38,6 +38,9 @@ #define GSM_MAX_FN (26*51*2048) +/* Max length of random identifier which can be requested via osmo_get_rand_id() */ +#define OSMO_MAX_RAND_ID_LEN 16 + struct gsm_time { uint32_t fn; /* FN count */ uint16_t t1; /* FN div (26*51) */ @@ -60,6 +63,8 @@ const char *gsm_band_name(enum gsm_band band); enum gsm_band gsm_band_parse(const char *mhz); +int osmo_get_rand_id(uint8_t *out, size_t len); + /*! * Decode a sequence of GSM 03.38 encoded 7 bit characters. * diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 2c980d2..0392705 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -91,6 +91,14 @@ #include #include #include +#include +#include + +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) +#include +#elif HAVE_DECL_SYS_GETRANDOM +#include +#endif #include "../../config.h" @@ -387,6 +395,61 @@ return y; } +static inline void fallback_insecure_rand(uint8_t *out, size_t len) +{ + int i; + + srand(time(NULL)); + + for (i = 0; i < len; out[i++] = rand()); +} + +/*! Generate random identifier + * \param[out] out Buffer to be filled with random data + * \param[in] len Number of random bytes required + * \returns 0 on success, or a negative error code on error. + */ +int osmo_get_rand_id(uint8_t *out, size_t len) +{ + int rc; + + /* this function is intended for generating short identifiers only, not arbitrary-length random data */ + if (len > OSMO_MAX_RAND_ID_LEN) + return -E2BIG; + + /* we use /dev/urandom (default when GRND_RANDOM flag is not set) which is fine as (at least on GNU/Linux >= 4.8) + both /dev/(u)random numbers are coming from the same CSPRNG anyway - see also RFC4086 */ +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) + rc = getrandom(out, len, GRND_NONBLOCK); +#elif HAVE_DECL_SYS_GETRANDOM +#pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") + /* FIXME: this can be removed once we bump glibc requirements to 2.25 */ + rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); +#else +#pragma message ("Insecure random fallback is used: no getrandom syscall available!") + /* Fallback for systems without getrandom() syscall */ + rc = 0; +#endif + if (rc < 0) { /* getrandom() failed entirely */ + switch (errno) { + case EAGAIN: /* the requested entropy is not available: fallback to insecure generator and let + application decide if it's OK with */ + fallback_insecure_rand(out, len); + default: /* intentional fall-through */ + return -errno; + } + } + if (rc != len) { /* the system call was interrupted by a signal: this should not actually happen + (according to getrandom(2)) as long as OSMO_MAX_RAND_ID_LEN < 256 because we do not set + GRND_RANDOM but let's be paranoid and check/fallback anyway */ + fallback_insecure_rand(out + rc, len); + + return -EAGAIN; + } + + return 0; +} + /*! Build the RSL uplink measurement IE (3GPP TS 08.58 ? 9.3.25) * \param[in] mru Unidirectional measurement report structure * \param[in] dtxd_used Indicates if DTXd was used during measurement report diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ad7e013..f56962c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -39,6 +39,7 @@ osmo_sitype_strs; osmo_c4; +osmo_get_rand_id; bitvec_add_range1024; comp128; comp128v2; diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 76c4927..92fc25c 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -34,6 +34,7 @@ #include #include +#include static void dump_triplets_dat(struct osmo_auth_vector *vec) { @@ -225,15 +226,8 @@ } if (!rand_is_set) { - int i; - printf("WARNING: We're using really weak random numbers!\n\n"); - srand(time(NULL)); - - for (i = 0; i < 4; ++i) { - uint32_t r; - r = rand(); - memcpy(&_rand[i*4], &r, 4); - } + if (osmo_get_rand_id(_rand, 16) < 0) + printf("WARNING: We're using really weak random numbers!\n\n"); } if (test_aud.type == OSMO_AUTH_TYPE_NONE || -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 10 12:42:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 12:42:15 +0000 Subject: osmo-trx[master]: LimeSDR: Fix sample value range In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 12:47:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 12:47:04 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify polling troubleshooting 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/2859 to look at the new patch set (#5). Simplify polling troubleshooting * introduce enum describing poll kind and use it in set_polling() * move state change into set_polling() * move logging into set_polling() and unify output * move duplicated code into static function * adjust tests to match unified logging output Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Related: OS#1524 --- M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/tbf/TbfTest.err 5 files changed, 85 insertions(+), 90 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/59/2859/5 diff --git a/src/tbf.cpp b/src/tbf.cpp index b2acb11..4871076 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -593,16 +593,50 @@ return 0; } -void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts) +void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t) { - LOGP(DRLCMAC, LOGL_DEBUG, - "%s: Scheduling polling at FN %d TS %d\n", - name(), new_poll_fn, ts); + const char *chan = "UNKNOWN"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH))) + chan = "CCCH"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) + chan = "PACCH"; + + if ((state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) && (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH)))) + LOGP(DRLCMACDL, LOGL_ERROR, + "%s Attempt to schedule polling on %s (FN=%d, TS=%d) with both CCCH and PACCH flags set - FIXME!\n", + name(), chan, poll_fn, poll_ts); /* schedule polling */ poll_state = GPRS_RLCMAC_POLL_SCHED; poll_fn = new_poll_fn; poll_ts = ts; + + switch (t) { + case GPRS_RLCMAC_POLL_UL_ASS: + ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled UL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ASS: + dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled DL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_UL_ACK: + ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; + + LOGP(DRLCMACUL, LOGL_DEBUG, "%s Scheduled UL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ACK: + LOGP(DRLCMACDL, LOGL_DEBUG, "%s Scheduled DL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + } } void gprs_rlcmac_tbf::poll_timeout() @@ -1133,11 +1167,7 @@ talloc_free(mac_control_block); if (poll_ass_dl) { - set_polling(new_poll_fn, ts); - dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled DL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ASS); } else { dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; new_dl_tbf->set_state(GPRS_RLCMAC_FLOW); @@ -1234,11 +1264,7 @@ bitvec_free(ass_vec); talloc_free(mac_control_block); - set_polling(new_poll_fn, ts); - ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled UL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ASS); return msg; } diff --git a/src/tbf.h b/src/tbf.h index cd8d694..c13e61f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -54,6 +54,13 @@ GPRS_RLCMAC_RELEASING, /* releasing, wait to free TBI/USF */ }; +enum gprs_rlcmac_tbf_poll_type { + GPRS_RLCMAC_POLL_UL_ASS, + GPRS_RLCMAC_POLL_DL_ASS, + GPRS_RLCMAC_POLL_UL_ACK, + GPRS_RLCMAC_POLL_DL_ACK, +}; + enum gprs_rlcmac_tbf_poll_state { GPRS_RLCMAC_POLL_NONE = 0, GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ @@ -173,7 +180,7 @@ int check_polling(uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp); - void set_polling(uint32_t poll_fn, uint8_t ts); + void set_polling(uint32_t poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t); void poll_timeout(); /** tlli handling */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 375d642..6aa17bb 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -855,10 +855,8 @@ rc = check_polling(fn, ts, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ACK); - LOGP(DRLCMACDL, LOGL_DEBUG, "Polling scheduled in this " - "TS %d\n", ts); m_tx_counter = 0; /* start timer whenever we send the final block */ if (is_final) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1e0898a..81d3b24 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -158,9 +158,8 @@ m_contention_resolution_done = 1; if (final) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ACK); /* waiting for final acknowledge */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; m_final_ack_sent = 1; } else ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 2002379..1eca822 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -63,8 +63,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -151,8 +150,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -239,8 +237,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -1621,8 +1618,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1706,8 +1702,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1757,8 +1752,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1788,8 +1782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654292 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654292, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654292, TS=7 msg block (BSN 0, CS-4): 0f 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 @@ -1845,8 +1838,7 @@ TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654348 TS 7 -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654348, TS=7 +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654348, TS=7) Scheduling control message at RTS for TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=48 28 5e ac ce f1 0f 1d 00 00 88 40 09 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1916,8 +1908,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2012,8 +2003,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654340 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654340, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654340, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2093,8 +2083,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2247,8 +2236,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2337,8 +2325,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2795,8 +2782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because 20 blocks sent. -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW): Scheduling polling at FN 2654379 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled DL Acknowledgement polling on PACCH (FN=2654379, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled Ack/Nack polling on FN=2654379, TS=7 msg block (BSN 20, CS-1): 0f 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654366 block=6 data=08 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 @@ -3024,8 +3010,7 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE): Scheduling polling at FN 2654413 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on FN=2654413, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on UNKNOWN (FN=2654413, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654400 block=2 data=48 08 20 08 0c 72 00 02 18 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3258,8 +3243,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654461 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654461, TS=7) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654461, TS=7 msg block (BSN 10, CS-1): 0f 03 14 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 @@ -3388,8 +3372,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3483,8 +3466,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3728,8 +3710,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4063,8 +4044,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4343,8 +4323,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4582,8 +4561,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4785,8 +4763,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4966,8 +4943,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5128,8 +5104,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5286,8 +5261,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5431,8 +5405,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5749,8 +5722,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-5): 0f 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5820,8 +5792,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-6): 0f 40 00 00 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5888,8 +5859,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-7): 0f 00 00 02 a0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5959,8 +5929,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-9): 0f 00 00 02 00 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -6268,8 +6237,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6445,8 +6413,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6906,8 +6873,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f9 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -7991,8 +7957,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Scheduling polling at FN 2654292 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=2654292, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on PACCH (FN=2654292, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=48 08 00 00 0c 72 00 02 08 00 80 c8 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Gerrit-PatchSet: 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 Mon Jul 10 12:48:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 12:48:54 +0000 Subject: osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 12:56:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 12:56:01 +0000 Subject: [PATCH] osmo-bts[master]: jenkins helpers: some minimal documentation/comments + print... Message-ID: Review at https://gerrit.osmocom.org/3164 jenkins helpers: some minimal documentation/comments + print errors We should print meaningful error messages in case a user doesn't have the required local PATH set up, or doesn't specify a required command line argument. Change-Id: I30a2935f93ade69222b1e0c3e212ee10e17c1823 --- M contrib/jenkins_bts_model.sh M contrib/jenkins_bts_trx.sh M contrib/jenkins_common.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 7 files changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/64/3164/1 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index c44daa7..33bfdc7 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -1,6 +1,14 @@ #!/bin/sh +# this is a dispatcher script which will call the bts-model-specific +# script based on the bts model specified as command line argument + bts_model="$1" +if [ "x$bts_model" == "x" ]; then + echo "Error: You have to specify the BTS model as first argument, e.g. $0 sysmo" + exit 2 +fi + if [ ! -d "./contrib" ]; then echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" exit 1 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4ff..9e95809 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-trx # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43..bce771d 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -1,5 +1,14 @@ #!/bin/sh +# this is a common helper script that is shared among all BTS model +# specific helper scripts like jenkins_sysmobts.sh. You shouldn't call +# this directly, but rather indirectly via the bts-specific scripts + +if ! [ -x "$(command -v osmo-deps.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex base="$PWD" diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d5..a2d9514 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-lc15 # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 6ad5358..b3dc07f 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-octphy # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004..c23009d 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-octphy + osmo-bts-trx # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249..6645181 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-sysmo # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh -- To view, visit https://gerrit.osmocom.org/3164 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30a2935f93ade69222b1e0c3e212ee10e17c1823 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 12:58:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 12:58:40 +0000 Subject: [PATCH] libosmo-abis[master]: jenkins.sh: Proper error message if local environment isn't ... Message-ID: Review at https://gerrit.osmocom.org/3165 jenkins.sh: Proper error message if local environment isn't set up Change-Id: Ibb34f07164adb175a44f460d02f54586b56a5b95 --- M contrib/jenkins.sh 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/65/3165/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f1019e4..88eda80 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,10 @@ #!/bin/sh +# jenkins build helper script for libosmo-abis. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi set -ex -- To view, visit https://gerrit.osmocom.org/3165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb34f07164adb175a44f460d02f54586b56a5b95 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:00:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:00:18 +0000 Subject: [PATCH] libosmo-netif[master]: jenkins.sh: Proper error message if local environment isn't ... Message-ID: Review at https://gerrit.osmocom.org/3166 jenkins.sh: Proper error message if local environment isn't set up Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 --- M contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/66/3166/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2fce993..5bb1020 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +# jenkins build helper script for libosmo-netif. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:01:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:01:24 +0000 Subject: [PATCH] libosmo-sccp[master]: jenkins.sh: Proper error message if local environment isn't ... Message-ID: Review at https://gerrit.osmocom.org/3167 jenkins.sh: Proper error message if local environment isn't set up Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 --- M contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/67/3167/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 897c464..38c1134 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +# jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:02:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:02:08 +0000 Subject: [PATCH] openbsc[master]: WIP: Support for TS 04.14 conformance test commands Message-ID: Review at https://gerrit.osmocom.org/3168 WIP: Support for TS 04.14 conformance test commands Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c --- M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/gsm_04_14.h M openbsc/src/libmsc/Makefile.am M openbsc/src/libmsc/gsm_04_08.c A openbsc/src/libmsc/gsm_04_14.c 5 files changed, 153 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/3168/1 diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 2740a5d..db03caa 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -36,6 +36,7 @@ gprs_utils.h \ gsm_04_08.h \ gsm_04_11.h \ + gsm_04_14.h \ gsm_04_80.h \ gsm_data.h \ gsm_data_shared.h \ diff --git a/openbsc/include/openbsc/gsm_04_14.h b/openbsc/include/openbsc/gsm_04_14.h new file mode 100644 index 0000000..3cdbe04 --- /dev/null +++ b/openbsc/include/openbsc/gsm_04_14.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode); +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs); +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology); + +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg); diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am index 9d966db..c219a35 100644 --- a/openbsc/src/libmsc/Makefile.am +++ b/openbsc/src/libmsc/Makefile.am @@ -27,6 +27,7 @@ db.c \ gsm_04_08.c \ gsm_04_11.c \ + gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ mncc.c \ diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 89108e4..7e5267e 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -4027,6 +4028,9 @@ release_anchor(conn); rc = handle_rcv_ussd(conn, msg); break; + case GSM48_PDISC_TEST: + rc = gsm0414_rcv_test(conn, msg); + break; default: LOGP(DRLL, LOGL_NOTICE, "Unknown " "GSM 04.08 discriminator 0x%02x\n", pdisc); diff --git a/openbsc/src/libmsc/gsm_04_14.c b/openbsc/src/libmsc/gsm_04_14.c new file mode 100644 index 0000000..23de23e --- /dev/null +++ b/openbsc/src/libmsc/gsm_04_14.c @@ -0,0 +1,132 @@ +/* GSM MS Testing Layer 3 messages + * 3GPP TS 44.014 / GSM TS 04.14 */ + +/* (C) 2017 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 "bscconfig.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct msgb *create_gsm0414_msg(uint8_t msg_type) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); + struct gsm48_hdr *gh; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_TEST; + gh->msg_type = msg_type; + return msg; +} + +static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + return gsm0808_submit_dtap(conn, msg, 0, 0); +} + +static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) +{ + struct msgb *msg = create_gsm0414_msg(msg_type); + + return gsm0414_conn_sendmsg(conn, msg); +} + + +/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); + uint8_t subch; + + subch = (loop_mode << 1); + msgb_put_u8(msg, subch); + + msg->lchan = conn->lchan; + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a OPEN_LOOP_CMD according to Section 8.3 */ +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); +} + +/* Send a ACT_EMMI_CMD according to Section 8.8 */ +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); +} + +/* Send a DEACT_EMMI_CMD according to Section 8.10 */ +int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); +} + +/* Send a TEST_INTERFACE according to Section 8.11 */ +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); + msgb_put_u8(msg, tested_devs); + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); + msgb_put_u8(msg, technology); + return gsm0414_conn_sendmsg(conn, msg); +} + + + +/* Entry point for incoming GSM48_PDISC_TEST received from MS */ +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + + if (msgb_l3len(msg) < sizeof(*gh)) + return -1; + + LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", + get_value_string(gsm414_msgt_names, gh->msg_type)); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:02:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:02:08 +0000 Subject: [PATCH] openbsc[master]: Add VTY commands for experimentation with TS 04.14 commands Message-ID: Review at https://gerrit.osmocom.org/3169 Add VTY commands for experimentation with TS 04.14 commands TS 04.14 (TS 44.014) specifies a series of commands specific to conformance testing. Let's add some VTY commands to play (at least initially) with closing and opening voice loops in the MS. Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678 --- M openbsc/src/libmsc/vty_interface_layer3.c 1 file changed, 94 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/69/3169/1 diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index e503291..7a38b64 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -479,6 +480,97 @@ subscr_put(subscr); talloc_free(text); + return CMD_SUCCESS; +} + +static int loop_by_char(uint8_t ch) +{ + switch (ch) { + case 'a': + return GSM414_LOOP_A; + case 'b': + return GSM414_LOOP_B; + case 'c': + return GSM414_LOOP_C; + case 'd': + return GSM414_LOOP_D; + case 'e': + return GSM414_LOOP_E; + case 'f': + return GSM414_LOOP_F; + case 'i': + return GSM414_LOOP_I; + } + return -1; +} + +DEFUN(subscriber_mstest_close, + subscriber_mstest_close_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test close-loop (a|b|c|d|e|f|i)", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Close a TCH Loop inside the MS\n" + "Loop Type A\n" + "Loop Type B\n" + "Loop Type C\n" + "Loop Type D\n" + "Loop Type E\n" + "Loop Type F\n" + "Loop Type I\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]); + const char *loop_str; + int loop_mode; + + if (!subscr) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + loop_str = argv[2]; + loop_mode = loop_by_char(loop_str[0]); + + conn = connection_for_subscr(subscr); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + subscr_put(subscr); + return CMD_WARNING; + } + + gsm0414_tx_close_tch_loop_cmd(conn, loop_mode); + + return CMD_SUCCESS; +} + +DEFUN(subscriber_mstest_open, + subscriber_mstest_open_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test open-loop", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Open a TCH Loop inside the MS\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]); + + if (!subscr) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + conn = connection_for_subscr(subscr); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + subscr_put(subscr); + return CMD_WARNING; + } + + gsm0414_tx_open_loop_cmd(conn); + return CMD_SUCCESS; } @@ -1166,6 +1258,8 @@ install_element_ve(&subscriber_silent_call_start_cmd); install_element_ve(&subscriber_silent_call_stop_cmd); install_element_ve(&subscriber_ussd_notify_cmd); + install_element_ve(&subscriber_mstest_close_cmd); + install_element_ve(&subscriber_mstest_open_cmd); install_element_ve(&subscriber_update_cmd); install_element_ve(&show_stats_cmd); install_element_ve(&show_smsqueue_cmd); -- To view, visit https://gerrit.osmocom.org/3169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:02:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:02:09 +0000 Subject: [PATCH] openbsc[master]: jenkins.sh: Proper error message if local environment isn't ... Message-ID: Review at https://gerrit.osmocom.org/3170 jenkins.sh: Proper error message if local environment isn't set up Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 --- M contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3170/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 0021947..030ebda 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:03:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:03:49 +0000 Subject: [PATCH] osmo-pcu[master]: jenkins.sh: Proper error message if local environment isn't ... Message-ID: Review at https://gerrit.osmocom.org/3171 jenkins.sh: Proper error message if local environment isn't set up Change-Id: Ibd24ba6024714f3d7aac14ef661acf52de2a3825 --- M contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/71/3171/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 5222476..75f28f3 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/bin/sh +# jenkins build helper script for osmo-pcu. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3171 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd24ba6024714f3d7aac14ef661acf52de2a3825 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:05:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:05:55 +0000 Subject: libosmo-sccp[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:05:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:05:58 +0000 Subject: [MERGED] libosmo-sccp[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins.sh: Proper error message if local environment isn't set up ...................................................................... jenkins.sh: Proper error message if local environment isn't set up Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 --- M 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 index 897c464..38c1134 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +# jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:06:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:06:04 +0000 Subject: libosmo-netif[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:06:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:06:05 +0000 Subject: [MERGED] libosmo-netif[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins.sh: Proper error message if local environment isn't set up ...................................................................... jenkins.sh: Proper error message if local environment isn't set up Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 --- M 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 index 2fce993..5bb1020 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +# jenkins build helper script for libosmo-netif. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:06:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:06:19 +0000 Subject: osmo-bts[master]: jenkins helpers: some minimal documentation/comments + print... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3164 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I30a2935f93ade69222b1e0c3e212ee10e17c1823 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:06:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:06:20 +0000 Subject: [MERGED] osmo-bts[master]: jenkins helpers: some minimal documentation/comments + print... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins helpers: some minimal documentation/comments + print errors ...................................................................... jenkins helpers: some minimal documentation/comments + print errors We should print meaningful error messages in case a user doesn't have the required local PATH set up, or doesn't specify a required command line argument. Change-Id: I30a2935f93ade69222b1e0c3e212ee10e17c1823 --- M contrib/jenkins_bts_model.sh M contrib/jenkins_bts_trx.sh M contrib/jenkins_common.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 7 files changed, 22 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index c44daa7..33bfdc7 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -1,6 +1,14 @@ #!/bin/sh +# this is a dispatcher script which will call the bts-model-specific +# script based on the bts model specified as command line argument + bts_model="$1" +if [ "x$bts_model" == "x" ]; then + echo "Error: You have to specify the BTS model as first argument, e.g. $0 sysmo" + exit 2 +fi + if [ ! -d "./contrib" ]; then echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" exit 1 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4ff..9e95809 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-trx # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43..bce771d 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -1,5 +1,14 @@ #!/bin/sh +# this is a common helper script that is shared among all BTS model +# specific helper scripts like jenkins_sysmobts.sh. You shouldn't call +# this directly, but rather indirectly via the bts-specific scripts + +if ! [ -x "$(command -v osmo-deps.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex base="$PWD" diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d5..a2d9514 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-lc15 # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 6ad5358..b3dc07f 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-octphy # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004..c23009d 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-octphy + osmo-bts-trx # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249..6645181 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-sysmo # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh -- To view, visit https://gerrit.osmocom.org/3164 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30a2935f93ade69222b1e0c3e212ee10e17c1823 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:06:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:06:28 +0000 Subject: libosmo-abis[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibb34f07164adb175a44f460d02f54586b56a5b95 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: 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 Jul 10 13:06:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:06:31 +0000 Subject: [MERGED] libosmo-abis[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins.sh: Proper error message if local environment isn't set up ...................................................................... jenkins.sh: Proper error message if local environment isn't set up Change-Id: Ibb34f07164adb175a44f460d02f54586b56a5b95 --- M contrib/jenkins.sh 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f1019e4..88eda80 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,10 @@ #!/bin/sh +# jenkins build helper script for libosmo-abis. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi set -ex -- To view, visit https://gerrit.osmocom.org/3165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibb34f07164adb175a44f460d02f54586b56a5b95 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:07:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:07:30 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-sysmo: Include frame number in MEAS IND In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bts-sysmo: Include frame number in MEAS IND ...................................................................... osmo-bts-sysmo: Include frame number in MEAS IND l1_if.c does not generate struct osmo_phsap_prim l1sap properly. The frame number is not included in this struct. This renders the logic that processes the reported measurements non functional, since the logic (see measurement.c) is not able to detect the end of the measurement period. This commit fixes the problem by adding the missing frame number to the l1sap structure. Change-Id: I09241d6cc2ff09e71a3d723d90e4468108a27ae1 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Objections: Neels Hofmeyr: I would prefer this is not merged as is diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 94fb679..a4bfffb 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -897,7 +897,7 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - GsmL1_MeasParam_t *m) + uint32_t fn, GsmL1_MeasParam_t *m) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); @@ -908,6 +908,7 @@ l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); + l1sap.u.info.u.meas_ind.fn = fn; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -936,7 +937,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, &data_ind->measParam); + process_meas_res(trx, chan_nr, fn, &data_ind->measParam); gsm_fn2gsmtime(&g_time, fn); -- To view, visit https://gerrit.osmocom.org/3052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09241d6cc2ff09e71a3d723d90e4468108a27ae1 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:08:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:08:17 +0000 Subject: osmo-bts[master]: measurement: fix measurment report In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 13:08:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 13:08:51 +0000 Subject: osmo-bts[master]: octphy: remap frame number in MEAS_IND In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ecb27c018bf4ad5151878a6ad34026fd0f801a1 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 14:01:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 14:01:06 +0000 Subject: osmo-pcu[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3171 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd24ba6024714f3d7aac14ef661acf52de2a3825 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 14:01:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 14:01:07 +0000 Subject: [MERGED] osmo-pcu[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins.sh: Proper error message if local environment isn't set up ...................................................................... jenkins.sh: Proper error message if local environment isn't set up Change-Id: Ibd24ba6024714f3d7aac14ef661acf52de2a3825 --- M 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 index 5222476..75f28f3 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/bin/sh +# jenkins build helper script for osmo-pcu. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3171 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibd24ba6024714f3d7aac14ef661acf52de2a3825 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 14:03:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 10 Jul 2017 14:03:46 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify polling troubleshooting 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/2859 to look at the new patch set (#6). Simplify polling troubleshooting * introduce enum describing poll kind and use it in set_polling() * move state change into set_polling() * move logging into set_polling() and unify output * move duplicated code into static function * adjust tests to match unified logging output Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Related: OS#1524 --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/tbf/TbfTest.err 6 files changed, 88 insertions(+), 91 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/59/2859/6 diff --git a/src/bts.cpp b/src/bts.cpp index 5f7d9e8..302daf9 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1360,7 +1360,9 @@ } /* set control ts to current MS's TS, until assignment complete */ - LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no); + LOGP(DRLCMAC, LOGL_DEBUG, "%s change control TS %d -> %d until assinment is complete.\n", + tbf_name(ul_tbf), ul_tbf->control_ts, ts_no); + ul_tbf->control_ts = ts_no; /* schedule uplink assignment */ ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; diff --git a/src/tbf.cpp b/src/tbf.cpp index b2acb11..4871076 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -593,16 +593,50 @@ return 0; } -void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts) +void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t) { - LOGP(DRLCMAC, LOGL_DEBUG, - "%s: Scheduling polling at FN %d TS %d\n", - name(), new_poll_fn, ts); + const char *chan = "UNKNOWN"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH))) + chan = "CCCH"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) + chan = "PACCH"; + + if ((state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) && (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH)))) + LOGP(DRLCMACDL, LOGL_ERROR, + "%s Attempt to schedule polling on %s (FN=%d, TS=%d) with both CCCH and PACCH flags set - FIXME!\n", + name(), chan, poll_fn, poll_ts); /* schedule polling */ poll_state = GPRS_RLCMAC_POLL_SCHED; poll_fn = new_poll_fn; poll_ts = ts; + + switch (t) { + case GPRS_RLCMAC_POLL_UL_ASS: + ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled UL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ASS: + dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled DL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_UL_ACK: + ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; + + LOGP(DRLCMACUL, LOGL_DEBUG, "%s Scheduled UL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ACK: + LOGP(DRLCMACDL, LOGL_DEBUG, "%s Scheduled DL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + } } void gprs_rlcmac_tbf::poll_timeout() @@ -1133,11 +1167,7 @@ talloc_free(mac_control_block); if (poll_ass_dl) { - set_polling(new_poll_fn, ts); - dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled DL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ASS); } else { dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; new_dl_tbf->set_state(GPRS_RLCMAC_FLOW); @@ -1234,11 +1264,7 @@ bitvec_free(ass_vec); talloc_free(mac_control_block); - set_polling(new_poll_fn, ts); - ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled UL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ASS); return msg; } diff --git a/src/tbf.h b/src/tbf.h index cd8d694..c13e61f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -54,6 +54,13 @@ GPRS_RLCMAC_RELEASING, /* releasing, wait to free TBI/USF */ }; +enum gprs_rlcmac_tbf_poll_type { + GPRS_RLCMAC_POLL_UL_ASS, + GPRS_RLCMAC_POLL_DL_ASS, + GPRS_RLCMAC_POLL_UL_ACK, + GPRS_RLCMAC_POLL_DL_ACK, +}; + enum gprs_rlcmac_tbf_poll_state { GPRS_RLCMAC_POLL_NONE = 0, GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ @@ -173,7 +180,7 @@ int check_polling(uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp); - void set_polling(uint32_t poll_fn, uint8_t ts); + void set_polling(uint32_t poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t); void poll_timeout(); /** tlli handling */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 375d642..6aa17bb 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -855,10 +855,8 @@ rc = check_polling(fn, ts, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ACK); - LOGP(DRLCMACDL, LOGL_DEBUG, "Polling scheduled in this " - "TS %d\n", ts); m_tx_counter = 0; /* start timer whenever we send the final block */ if (is_final) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1e0898a..81d3b24 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -158,9 +158,8 @@ m_contention_resolution_done = 1; if (final) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ACK); /* waiting for final acknowledge */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; m_final_ack_sent = 1; } else ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 2002379..1eca822 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -63,8 +63,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -151,8 +150,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -239,8 +237,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -1621,8 +1618,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1706,8 +1702,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1757,8 +1752,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1788,8 +1782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654292 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654292, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654292, TS=7 msg block (BSN 0, CS-4): 0f 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 @@ -1845,8 +1838,7 @@ TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654348 TS 7 -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654348, TS=7 +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654348, TS=7) Scheduling control message at RTS for TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=48 28 5e ac ce f1 0f 1d 00 00 88 40 09 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1916,8 +1908,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2012,8 +2003,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654340 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654340, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654340, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2093,8 +2083,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2247,8 +2236,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2337,8 +2325,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2795,8 +2782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because 20 blocks sent. -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW): Scheduling polling at FN 2654379 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled DL Acknowledgement polling on PACCH (FN=2654379, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled Ack/Nack polling on FN=2654379, TS=7 msg block (BSN 20, CS-1): 0f 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654366 block=6 data=08 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 @@ -3024,8 +3010,7 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE): Scheduling polling at FN 2654413 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on FN=2654413, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on UNKNOWN (FN=2654413, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654400 block=2 data=48 08 20 08 0c 72 00 02 18 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3258,8 +3243,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654461 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654461, TS=7) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654461, TS=7 msg block (BSN 10, CS-1): 0f 03 14 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 @@ -3388,8 +3372,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3483,8 +3466,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3728,8 +3710,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4063,8 +4044,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4343,8 +4323,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4582,8 +4561,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4785,8 +4763,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4966,8 +4943,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5128,8 +5104,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5286,8 +5261,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5431,8 +5405,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5749,8 +5722,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-5): 0f 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5820,8 +5792,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-6): 0f 40 00 00 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5888,8 +5859,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-7): 0f 00 00 02 a0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5959,8 +5929,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-9): 0f 00 00 02 00 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -6268,8 +6237,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6445,8 +6413,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6906,8 +6873,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f9 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -7991,8 +7957,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Scheduling polling at FN 2654292 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=2654292, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on PACCH (FN=2654292, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=48 08 00 00 0c 72 00 02 08 00 80 c8 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Gerrit-PatchSet: 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 Jul 10 14:24:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 10 Jul 2017 14:24:22 +0000 Subject: [PATCH] openbsc[master]: jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' Message-ID: Review at https://gerrit.osmocom.org/3172 jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' We are building with libosmo-sccp tag 'old_sua' until the new sigtran has been applied. Since osmo-iuh commit e26bc1855326399733ee78ac84c8d33319f36dfb "move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client" osmo-iuh requires libosmo-sccp master. A similar 'old_sua' tag is in place in osmo-iuh.git, to match libosmo-sccp 'old_sua'. Do that to fix the jenkins build of --enable-iu. Change-Id: I7c98b8bb1027fe8b47d8dcc4e0b94c1b42e44c52 --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/72/3172/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 0021947..068ee34 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -19,6 +19,7 @@ if [ "x$IU" = "x--enable-iu" ]; then sccp_branch="old_sua" + osmo_iuh_branch="old_sua" fi osmo-build-dep.sh libosmo-abis @@ -30,7 +31,7 @@ if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh + osmo-build-dep.sh osmo-iuh $osmo_iuh_branch fi set +x -- To view, visit https://gerrit.osmocom.org/3172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c98b8bb1027fe8b47d8dcc4e0b94c1b42e44c52 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 10 14:35:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 10 Jul 2017 14:35:23 +0000 Subject: openbsc[master]: jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7c98b8bb1027fe8b47d8dcc4e0b94c1b42e44c52 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 14:35:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 10 Jul 2017 14:35:25 +0000 Subject: [MERGED] openbsc[master]: jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' ...................................................................... jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' We are building with libosmo-sccp tag 'old_sua' until the new sigtran has been applied. Since osmo-iuh commit e26bc1855326399733ee78ac84c8d33319f36dfb "move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client" osmo-iuh requires libosmo-sccp master. A similar 'old_sua' tag is in place in osmo-iuh.git, to match libosmo-sccp 'old_sua'. Do that to fix the jenkins build of --enable-iu. Change-Id: I7c98b8bb1027fe8b47d8dcc4e0b94c1b42e44c52 --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 0021947..068ee34 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -19,6 +19,7 @@ if [ "x$IU" = "x--enable-iu" ]; then sccp_branch="old_sua" + osmo_iuh_branch="old_sua" fi osmo-build-dep.sh libosmo-abis @@ -30,7 +31,7 @@ if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh + osmo-build-dep.sh osmo-iuh $osmo_iuh_branch fi set +x -- To view, visit https://gerrit.osmocom.org/3172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7c98b8bb1027fe8b47d8dcc4e0b94c1b42e44c52 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 10 15:26:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 15:26:16 +0000 Subject: libosmocore[master]: Ignore broken everything log level In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 15:26:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 15:26:18 +0000 Subject: [MERGED] libosmocore[master]: Ignore broken everything log level In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Ignore broken everything log level ...................................................................... Ignore broken everything log level * when reading config file (or vty command) ignore "logging level .. everything" level * when writing config file, skip "logging level .. everything" level In both cases print corresponding deprecation warning. The "everything" level is not working as advertised for quite some time anyway. This will allow us to gradually deprecate broken "everything" parameter giving users enough time to update their config files before removing it entirely. Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f Related: OS#71 --- M src/vty/logging_vty.c 1 file changed, 9 insertions(+), 2 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 758f0b9..01480b1 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -213,6 +213,11 @@ return CMD_WARNING; } + if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */ + vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE); + return CMD_SUCCESS; + } + /* Check for special case where we want to set global log level */ if (!strcmp(argv[0], "all")) { log_set_log_level(tgt, level); @@ -730,8 +735,10 @@ osmo_str2lower(cat_lower, osmo_log_info->cat[i].name+1); osmo_str2lower(level_lower, log_level_str(cat->loglevel)); - vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, - VTY_NEWLINE); + if (strcmp(level_lower, "everything") != 0) /* FIXME: remove this check once 'everything' is phased out */ + vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE); + else + LOGP(DLSTATS, LOGL_ERROR, "logging level everything is deprecated and should not be used\n"); } /* FIXME: levels */ -- To view, visit https://gerrit.osmocom.org/3148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73d5c4f238beb88981ad25caa69f64ad6fb7209f Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jul 10 15:27:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 15:27:45 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 6: you can simply convert your function to be a wrapper around fn->gsmtime->string, i.e. calling the two existing functions in a row. -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 15:30:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 15:30:20 +0000 Subject: openbsc[master]: Fix BTS attribute requests In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/2868/3/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 1595: if (bts->type != GSM_BTS_TYPE_OSMOBTS) { > hmm having learned from nanobts->sysmobts checks... we should avoid direct I actually think this is correct here. We are moving towards simply stating "osmobts" as BTS model in the openbsc.cfg, and then having exactly this code figuring out the specific model/version/capabilities of the OsmoBTS on the other end. So it makes sense with TYPE_OSMOBTS but not with NANOBTS or any other IPA bts model. If anything, "bts model sysmobts" in the config is going to be a sysnonym to "bts model osmobts", if it isn't already. -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 10 16:13:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 16:13:21 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: SMPP: Document Osmocom extensions Message-ID: Review at https://gerrit.osmocom.org/3173 SMPP: Document Osmocom extensions Change-Id: I4cedd07a33633bdd2350d2bda0a22cc0c631c0a9 --- M OsmoNITB/chapters/smpp.adoc 1 file changed, 51 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/73/3173/1 diff --git a/OsmoNITB/chapters/smpp.adoc b/OsmoNITB/chapters/smpp.adoc index eacbb80..23951ba 100644 --- a/OsmoNITB/chapters/smpp.adoc +++ b/OsmoNITB/chapters/smpp.adoc @@ -59,8 +59,8 @@ more specific route should be routed to this ESME. Use the `deliver-src-imsi` command to indicate that the SMPP DELIVER -messages for MO SMS should state the IMSI (rather than the MSISDN) as -source address. +messages for MO SMS and the SMPP ALERT should state the IMSI (rather +than the MSISDN) as source address. Use the `osmocom-extensions` command to request that Osmocom specific extension TLVs shall be included in the SMPP PDUs. Those extensions @@ -82,6 +82,7 @@ The following example configuration snippet shows a single ESME 'galactica' with a prefix-route of all national numbers stating with 2342: + ---- smpp local-tcp-port 2775 @@ -93,3 +94,51 @@ osmocom-extensions route prefix national isdn 2342 ---- + + +=== Osmocom SMPP protocol extensions + +Osmocom has implemented some extensions to the SMPP v3.4 protocol. + +These extensions can be enabled using the `osmocom-extensions` VTY +command at `esme` level. + +The TLV definitions can be found in the +`` header file provided by +libosmocore. + +==== RF channel measuremets + +When the Osmocom SMPP extensions are enabled, we add the following +TLVs to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length (Octets) | Purpose +| TLVID_osmo_arfcn | 0x2300 | 2 | GSM ARFCN of the radio interface +| TLVID_osmo_ta | 0x2301 | 1 | Timing Advance on the radio interface +| TLVID_osmo_ms_l1_txpwr | 0x2307 | 1 | Transmit Power of the MS in uplink direction +| TLVID_osmo_rxlev_ul | 0x2302 | 2 | Uplink receive level as measured by BTS in dBm (int16_t) +| TLVID_osmo_rxqual_ul | 0x2303 | 1 | Uplink RxQual value as measured by BTS +| TLVID_osmo_rxlev_dl | 0x2304 | 2 | Downlink receive level as measured by MS in dBm (int16_t) +| TLVID_osmo_rxqual_dl | 0x2305 | 1 | Downlink RxQual value as measured by MS +|=== + +All of the above values reflect the *last measurement report* as +recieved vi A-bis RSL from the BTS. It is thus a snapshot value (of +the average within one 480ms SACCH period), and not an average over +all the SACCH periods during which the channel was open or the SMS was +received. Not all measurement reports contain all the values. So you +might not get an TLVID_osmo_rxlev_dl IE, as that particular uplink +frame might habe benn lost for the given snapshot we report. + +==== Equipment IMEI + +If we know the IMEI of the subscribers phone, we add the following TLV +to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length | Purpose +| TLVID_osmo_imei | 0x2306 | variable | IMEI of the subscibers phone (ME) +|=== -- To view, visit https://gerrit.osmocom.org/3173 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4cedd07a33633bdd2350d2bda0a22cc0c631c0a9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 16:14:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 16:14:45 +0000 Subject: [MERGED] osmo-bts[master]: measurement: fix measurment report In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: measurement: fix measurment report ...................................................................... measurement: fix measurment report The end of the measurement reporting period is not aligned with the SACCH block where the results are reported. The tables that are used to detect the end of the measurement period are therefore wrong. The frame number of the SACCH block must be used and not the TDMA frame number (modulo 104) of the measurement reporing interval. The tables are oriented to the frame number of the first SACCH block, at the beginning of an interval. However, when a SACCH block is received it will always contain the result of the recently passed measurement reporting period. To match the tables, introduce another lookup table to remap each SACCH block that ends to the matching beginning block number. Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 --- M configure.ac M src/common/measurement.c M tests/Makefile.am A tests/meas/Makefile.am A tests/meas/meas_test.c A tests/meas/meas_test.ok A tests/meas/sysmobts_fr_samples.h M tests/testsuite.at 8 files changed, 3,447 insertions(+), 25 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index b2700d5..64231b3 100644 --- a/configure.ac +++ b/configure.ac @@ -192,4 +192,5 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/meas/Makefile Makefile) diff --git a/src/common/measurement.c b/src/common/measurement.c index dba3543..3b32bf2 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -23,18 +23,27 @@ * 6 6 and 7 78 to 77 90, 12, 38, 64 * 7 6 and 7 91 to 90 103, 25, 51, 77 */ -/* measurement period ends at fn % 104 == ? */ static const uint8_t tchf_meas_rep_fn104[] = { - [0] = 103, - [1] = 12, - [2] = 25, - [3] = 38, - [4] = 51, - [5] = 64, - [6] = 77, - [7] = 90, + [0] = 90, + [1] = 103, + [2] = 12, + [3] = 25, + [4] = 38, + [5] = 51, + [6] = 64, + [7] = 77, }; static const uint8_t tchh0_meas_rep_fn104[] = { + [0] = 90, + [1] = 90, + [2] = 12, + [3] = 12, + [4] = 38, + [5] = 38, + [6] = 64, + [7] = 64, +}; +static const uint8_t tchh1_meas_rep_fn104[] = { [0] = 103, [1] = 103, [2] = 25, @@ -43,16 +52,6 @@ [5] = 51, [6] = 77, [7] = 77, -}; -static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12, - [1] = 12, - [2] = 38, - [3] = 38, - [4] = 64, - [5] = 64, - [6] = 90, - [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan @@ -86,6 +85,46 @@ [3] = 36 + 18 }; +/* Note: The reporting of the measurement results is done via the SACCH channel. + * The measurement interval is not alligned with the interval in which the + * SACCH is tranmitted. When we receive the measurement indication with the + * SACCH block, the coresponding measurement interval will already have ended + * and we will get the results late, but on spot with the beginning of the + * next measurement interval. + * + * For example: We get a measurement indication on FN%104=38 in TS=2. Then we + * will have to look at 3GPP TS 45.008, secton 8.4.1 (or 3GPP TS 05.02 Clause 7 + * Table 1 of 9) what value we need to feed into the lookup tables in order to + * detect the measurement period ending. In this example the "real" ending + * was on FN%104=12. This is the value we have to look for in + * tchf_meas_rep_fn104 to know that a measurement period has just ended. */ + +/* See also 3GPP TS 05.02 Clause 7 Table 1 of 9: + * Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5) */ +static uint8_t translate_tch_meas_rep_fn104(uint8_t fn_mod) +{ + switch (fn_mod) { + case 25: + return 103; + case 38: + return 12; + case 51: + return 25; + case 64: + return 38; + case 77: + return 51; + case 90: + return 64; + case 103: + return 77; + case 12: + return 90; + } + + /* Invalid / not of interest */ + return 0; +} /* determine if a measurement period ends at the given frame number */ static int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn) @@ -102,12 +141,12 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (tchf_meas_rep_fn104[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_TCH_H: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (lchan->nr == 0) tbl = tchh0_meas_rep_fn104; else @@ -132,9 +171,11 @@ break; } - DEBUGP(DMEAS, - "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", - gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + if (rc == 1) { + DEBUGP(DMEAS, + "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", + gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + } return rc; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 5b6f65e..d2b4181 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power +SUBDIRS = paging cipher agch misc handover tx_power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am new file mode 100644 index 0000000..8dd0582 --- /dev/null +++ b/tests/meas/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +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 +EXTRA_DIST = meas_test.ok + +meas_test_SOURCES = meas_test.c +meas_test_LDADD = $(top_builddir)/src/common/libbts.a $(LDADD) diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c new file mode 100644 index 0000000..c87350b --- /dev/null +++ b/tests/meas/meas_test.c @@ -0,0 +1,222 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct gsm_bts *bts; +struct gsm_bts_trx *trx; + +struct fn_sample { + uint32_t fn; + uint8_t ts; + uint8_t ss; + int rc; +}; + +#include "sysmobts_fr_samples.h" + +void test_fn_sample(struct fn_sample *s, unsigned int len, uint8_t pchan, uint8_t tsmap) +{ + int rc; + struct gsm_lchan *lchan; + unsigned int i; + unsigned int delta = 0; + uint8_t tsmap_result = 0; + uint32_t fn_prev = 0; + struct gsm_time gsm_time; + + + printf("\n\n"); + printf("===========================================================\n"); + + for (i = 0; i < len; i++) { + + lchan = &trx->ts[s[i].ts].lchan[s[i].ss]; + trx->ts[s[i].ts].pchan = pchan; + lchan->meas.num_ul_meas = 1; + + rc = lchan_meas_check_compute(lchan, s[i].fn); + if (rc) { + gsm_fn2gsmtime(&gsm_time, s[i].fn); + fprintf(stdout, "Testing: ts[%i]->lchan[%i], fn=%u=>%s, fn%%104=%u, rc=%i, delta=%i\n", s[i].ts, + s[i].ss, s[i].fn, osmo_dump_gsmtime(&gsm_time), s[i].fn % 104, rc, s[i].fn - fn_prev); + fn_prev = s[i].fn; + tsmap_result |= (1 << s[i].ts); + } else + delta++; + + /* If the test data set provides a return + * code, we check that as well */ + if (s[i].rc != -1) + OSMO_ASSERT(s[i].rc == rc); + } + + /* Make sure that we exactly trigger on the right frames + * timeslots must match exactlty to what we expect */ + OSMO_ASSERT(tsmap_result == tsmap); +} + +int main(int argc, char **argv) +{ + void *tall_bts_ctx; + + tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); + msgb_talloc_ctx_init(tall_bts_ctx, 0); + + bts_log_init(NULL); + osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; + + bts = gsm_bts_alloc(tall_bts_ctx); + if (!bts) { + fprintf(stderr, "Failed to create BTS structure\n"); + exit(1); + } + trx = gsm_bts_trx_alloc(bts); + if (!trx) { + fprintf(stderr, "Failed to TRX structure\n"); + exit(1); + } + + if (bts_init(bts) < 0) { + fprintf(stderr, "unable to to open bts\n"); + exit(1); + } + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test full rate */ + test_fn_sample(test_fn_tch_f_ts_2_3, ARRAY_SIZE(test_fn_tch_f_ts_2_3), GSM_PCHAN_TCH_F, (1 << 2) | (1 << 3)); + test_fn_sample(test_fn_tch_f_ts_4_5, ARRAY_SIZE(test_fn_tch_f_ts_4_5), GSM_PCHAN_TCH_F, (1 << 4) | (1 << 5)); + test_fn_sample(test_fn_tch_f_ts_6_7, ARRAY_SIZE(test_fn_tch_f_ts_6_7), GSM_PCHAN_TCH_F, (1 << 6) | (1 << 7)); + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test half rate */ + test_fn_sample(test_fn_tch_h_ts_2_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_2_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 2)); + test_fn_sample(test_fn_tch_h_ts_3_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_3_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 3)); + test_fn_sample(test_fn_tch_h_ts_4_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_4_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 4)); + test_fn_sample(test_fn_tch_h_ts_5_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_5_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 5)); + test_fn_sample(test_fn_tch_h_ts_6_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_6_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 6)); + test_fn_sample(test_fn_tch_h_ts_7_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_7_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 7)); + + printf("Success\n"); + + return 0; +} + +/* Stubs */ +void bts_model_abis_close(struct gsm_bts *bts) +{ +} + +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int obj_kind, void *obj) +{ + return 0; +} + +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + return 0; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj, uint8_t adm_state) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +void trx_get_hlayer1(void) +{ +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return 0; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return 0; +} + +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) +{ + return 0; +} diff --git a/tests/meas/meas_test.ok b/tests/meas/meas_test.ok new file mode 100644 index 0000000..2b76604 --- /dev/null +++ b/tests/meas/meas_test.ok @@ -0,0 +1,542 @@ + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=10958 +Testing: ts[2]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=104 +Testing: ts[3]->lchan[0], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11595=>011595/08/25/18/23, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11686=>011686/08/12/07/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11699=>011699/08/25/20/23, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11790=>011790/08/12/09/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11803=>011803/08/25/22/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11894=>011894/08/12/11/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11907=>011907/08/25/24/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11998=>011998/09/12/13/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12011=>012011/09/25/26/27, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12102=>012102/09/12/15/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12115=>012115/09/25/28/31, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12206=>012206/09/12/17/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12219=>012219/09/25/30/31, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12310=>012310/09/12/19/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12323=>012323/09/25/32/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12414=>012414/09/12/21/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12427=>012427/09/25/34/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12518=>012518/09/12/23/22, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12531=>012531/09/25/36/35, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12622=>012622/09/12/25/26, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12635=>012635/09/25/38/39, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=5888=>005888/04/12/23/00, fn%104=64, rc=1, delta=5888 +Testing: ts[4]->lchan[0], fn=5992=>005992/04/12/25/00, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6096=>006096/04/12/27/00, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6200=>006200/04/12/29/04, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=6213=>006213/04/25/42/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6304=>006304/04/12/31/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6317=>006317/04/25/44/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6408=>006408/04/12/33/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6421=>006421/04/25/46/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6512=>006512/04/12/35/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6525=>006525/04/25/48/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6616=>006616/04/12/37/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6629=>006629/04/25/50/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6720=>006720/05/12/39/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6733=>006733/05/25/01/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6824=>006824/05/12/41/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6837=>006837/05/25/03/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6928=>006928/05/12/43/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6941=>006941/05/25/05/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7032=>007032/05/12/45/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7045=>007045/05/25/07/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7136=>007136/05/12/47/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7149=>007149/05/25/09/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7240=>007240/05/12/49/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7253=>007253/05/25/11/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7344=>007344/05/12/00/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7357=>007357/05/25/13/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7448=>007448/05/12/02/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7461=>007461/05/25/15/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7552=>007552/05/12/04/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7565=>007565/05/25/17/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7656=>007656/05/12/06/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7669=>007669/05/25/19/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7773=>007773/05/25/21/41, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7877=>007877/05/25/23/41, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7981=>007981/06/25/25/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8085=>008085/06/25/27/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>008592/06/12/24/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8605=>008605/06/25/37/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>008696/06/12/26/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8709=>008709/06/25/39/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>008800/06/12/28/44, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8813=>008813/06/25/41/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>008904/06/12/30/44, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8917=>008917/06/25/43/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>009008/06/12/32/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9021=>009021/06/25/45/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>009112/06/12/34/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9125=>009125/06/25/47/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>009216/06/12/36/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9229=>009229/06/25/49/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>009320/07/12/38/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9333=>009333/07/25/00/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>009424/07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9437=>009437/07/25/02/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>009528/07/12/42/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9541=>009541/07/25/04/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>009632/07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9645=>009645/07/25/06/17, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8618=>008618/06/12/50/14, fn%104=90, rc=1, delta=8618 +Testing: ts[6]->lchan[0], fn=8722=>008722/06/12/01/18, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8826=>008826/06/12/03/18, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8930=>008930/06/12/05/18, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=8943=>008943/06/25/18/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>009034/06/12/07/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9047=>009047/06/25/20/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>009138/06/12/09/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9151=>009151/06/25/22/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>009242/06/12/11/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9255=>009255/06/25/24/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>009346/07/12/13/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9359=>009359/07/25/26/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>009450/07/12/15/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9463=>009463/07/25/28/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>009554/07/12/17/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9567=>009567/07/25/30/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>009658/07/12/19/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9671=>009671/07/25/32/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>009762/07/12/21/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9775=>009775/07/25/34/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>009866/07/12/23/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9879=>009879/07/25/36/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>009970/07/12/25/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9983=>009983/07/25/38/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>010074/07/12/27/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10087=>010087/07/25/40/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>010178/07/12/29/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10191=>010191/07/25/42/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>010282/07/12/31/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10295=>010295/07/25/44/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>010386/07/12/33/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10399=>010399/07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>010490/07/12/35/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10503=>010503/07/25/48/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>010594/07/12/37/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10607=>010607/07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>010698/08/12/39/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10711=>010711/08/25/01/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>010802/08/12/41/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10815=>010815/08/25/03/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>010906/08/12/43/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10919=>010919/08/25/05/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>011010/08/12/45/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11023=>011023/08/25/07/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>011114/08/12/47/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11127=>011127/08/25/09/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>011218/08/12/49/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11231=>011231/08/25/11/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>011322/08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11335=>011335/08/25/13/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>011426/08/12/02/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11439=>011439/08/25/15/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>011530/08/12/04/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11543=>011543/08/25/17/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11634=>011634/08/12/06/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11647=>011647/08/25/19/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11738=>011738/08/12/08/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11751=>011751/08/25/21/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11842=>011842/08/12/10/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11855=>011855/08/25/23/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11946=>011946/09/12/12/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11959=>011959/09/25/25/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12050=>012050/09/12/14/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12063=>012063/09/25/27/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12154=>012154/09/12/16/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12167=>012167/09/25/29/31, fn%104=103, rc=1, delta=13 + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=8982=>008982/06/12/06/22, fn%104=38, rc=1, delta=8982 +Testing: ts[2]->lchan[0], fn=9086=>009086/06/12/08/22, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9190=>009190/06/12/10/22, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9294=>009294/07/12/12/26, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9398=>009398/07/12/14/26, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[1], fn=9411=>009411/07/25/27/39, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9502=>009502/07/12/16/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9515=>009515/07/25/29/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9606=>009606/07/12/18/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9619=>009619/07/25/31/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9710=>009710/07/12/20/30, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9723=>009723/07/25/33/43, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9814=>009814/07/12/22/34, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9827=>009827/07/25/35/47, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9918=>009918/07/12/24/34, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9931=>009931/07/25/37/47, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10022=>010022/07/12/26/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10035=>010035/07/25/39/51, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10126=>010126/07/12/28/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10139=>010139/07/25/41/51, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10230=>010230/07/12/30/38, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10243=>010243/07/25/43/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10334=>010334/07/12/32/42, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10347=>010347/07/25/45/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10438=>010438/07/12/34/42, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10451=>010451/07/25/47/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10542=>010542/07/12/36/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10555=>010555/07/25/49/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10646=>010646/08/12/38/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10659=>010659/08/25/00/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10750=>010750/08/12/40/46, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10763=>010763/08/25/02/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10854=>010854/08/12/42/50, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10867=>010867/08/25/04/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10971=>010971/08/25/06/11, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11075=>011075/08/25/08/15, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11179=>011179/08/25/10/15, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11283=>011283/08/25/12/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11387=>011387/08/25/14/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 + + +=========================================================== +Testing: ts[3]->lchan[0], fn=10022=>010022/07/12/26/38, fn%104=38, rc=1, delta=10022 +Testing: ts[3]->lchan[1], fn=10035=>010035/07/25/39/51, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10126=>010126/07/12/28/38, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10139=>010139/07/25/41/51, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10230=>010230/07/12/30/38, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10243=>010243/07/25/43/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10334=>010334/07/12/32/42, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10347=>010347/07/25/45/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10438=>010438/07/12/34/42, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10451=>010451/07/25/47/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10542=>010542/07/12/36/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10555=>010555/07/25/49/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10646=>010646/08/12/38/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10659=>010659/08/25/00/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10750=>010750/08/12/40/46, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10763=>010763/08/25/02/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10854=>010854/08/12/42/50, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10867=>010867/08/25/04/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10958=>010958/08/12/44/50, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10971=>010971/08/25/06/11, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11062=>011062/08/12/46/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11075=>011075/08/25/08/15, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11166=>011166/08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11179=>011179/08/25/10/15, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11270=>011270/08/12/50/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11283=>011283/08/25/12/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11374=>011374/08/12/01/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11387=>011387/08/25/14/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11478=>011478/08/12/03/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11491=>011491/08/25/16/19, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11582=>011582/08/12/05/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11595=>011595/08/25/18/23, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11686=>011686/08/12/07/10, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11699=>011699/08/25/20/23, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11790=>011790/08/12/09/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11803=>011803/08/25/22/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11894=>011894/08/12/11/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11907=>011907/08/25/24/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11998=>011998/09/12/13/14, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12011=>012011/09/25/26/27, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=12102=>012102/09/12/15/18, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12115=>012115/09/25/28/31, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=7760 +Testing: ts[4]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[1], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>008592/06/12/24/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8605=>008605/06/25/37/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>008696/06/12/26/40, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8709=>008709/06/25/39/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>008800/06/12/28/44, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8813=>008813/06/25/41/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>008904/06/12/30/44, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8917=>008917/06/25/43/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>009008/06/12/32/48, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9021=>009021/06/25/45/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>009112/06/12/34/48, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9125=>009125/06/25/47/09, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>009216/06/12/36/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9229=>009229/06/25/49/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>009320/07/12/38/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9333=>009333/07/25/00/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>009424/07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9437=>009437/07/25/02/13, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>009528/07/12/42/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9541=>009541/07/25/04/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>009632/07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9645=>009645/07/25/06/17, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9736=>009736/07/12/46/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9749=>009749/07/25/08/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9840=>009840/07/12/48/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9853=>009853/07/25/10/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9944=>009944/07/12/50/08, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9957=>009957/07/25/12/21, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10048=>010048/07/12/01/12, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10061=>010061/07/25/14/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10152=>010152/07/12/03/12, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10165=>010165/07/25/16/25, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10256=>010256/07/12/05/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10269=>010269/07/25/18/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10360=>010360/07/12/07/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10373=>010373/07/25/20/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10464=>010464/07/12/09/16, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10477=>010477/07/25/22/29, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10568=>010568/07/12/11/20, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10581=>010581/07/25/24/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10672=>010672/08/12/13/20, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10685=>010685/08/25/26/33, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10776=>010776/08/12/15/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10789=>010789/08/25/28/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10880=>010880/08/12/17/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10893=>010893/08/25/30/37, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10984=>010984/08/12/19/24, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10997=>010997/08/25/32/37, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[5]->lchan[0], fn=5264=>005264/03/12/11/40, fn%104=64, rc=1, delta=5264 +Testing: ts[5]->lchan[0], fn=5368=>005368/04/12/13/40, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5472=>005472/04/12/15/44, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5576=>005576/04/12/17/44, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5680=>005680/04/12/19/48, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[1], fn=5693=>005693/04/25/32/09, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5784=>005784/04/12/21/48, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5797=>005797/04/25/34/09, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5888=>005888/04/12/23/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5901=>005901/04/25/36/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5992=>005992/04/12/25/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6005=>006005/04/25/38/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6096=>006096/04/12/27/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6109=>006109/04/25/40/13, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6200=>006200/04/12/29/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6213=>006213/04/25/42/17, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6304=>006304/04/12/31/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6317=>006317/04/25/44/17, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6408=>006408/04/12/33/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6421=>006421/04/25/46/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6512=>006512/04/12/35/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6525=>006525/04/25/48/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6616=>006616/04/12/37/08, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6629=>006629/04/25/50/21, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6720=>006720/05/12/39/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6733=>006733/05/25/01/25, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6824=>006824/05/12/41/12, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6837=>006837/05/25/03/25, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6928=>006928/05/12/43/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6941=>006941/05/25/05/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7032=>007032/05/12/45/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7045=>007045/05/25/07/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7136=>007136/05/12/47/16, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7149=>007149/05/25/09/29, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7240=>007240/05/12/49/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7253=>007253/05/25/11/33, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7344=>007344/05/12/00/20, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7357=>007357/05/25/13/33, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7448=>007448/05/12/02/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7461=>007461/05/25/15/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7552=>007552/05/12/04/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7565=>007565/05/25/17/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7656=>007656/05/12/06/24, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7669=>007669/05/25/19/37, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7760=>007760/05/12/08/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7773=>007773/05/25/21/41, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7864=>007864/05/12/10/28, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7877=>007877/05/25/23/41, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7968=>007968/06/12/12/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7981=>007981/06/25/25/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8072=>008072/06/12/14/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8085=>008085/06/25/27/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8176=>008176/06/12/16/32, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8189=>008189/06/25/29/45, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8280=>008280/06/12/18/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8293=>008293/06/25/31/49, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8384=>008384/06/12/20/36, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8397=>008397/06/25/33/49, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8488=>008488/06/12/22/40, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8501=>008501/06/25/35/01, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8098=>008098/06/12/40/06, fn%104=90, rc=1, delta=8098 +Testing: ts[6]->lchan[0], fn=8202=>008202/06/12/42/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8306=>008306/06/12/44/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8410=>008410/06/12/46/10, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[1], fn=8423=>008423/06/25/08/23, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8514=>008514/06/12/48/14, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8527=>008527/06/25/10/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8618=>008618/06/12/50/14, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8631=>008631/06/25/12/27, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8722=>008722/06/12/01/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8735=>008735/06/25/14/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8826=>008826/06/12/03/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8839=>008839/06/25/16/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8930=>008930/06/12/05/18, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8943=>008943/06/25/18/31, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>009034/06/12/07/22, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9047=>009047/06/25/20/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>009138/06/12/09/22, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9151=>009151/06/25/22/35, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>009242/06/12/11/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9255=>009255/06/25/24/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>009346/07/12/13/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9359=>009359/07/25/26/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>009450/07/12/15/26, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9463=>009463/07/25/28/39, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>009554/07/12/17/30, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9567=>009567/07/25/30/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>009658/07/12/19/30, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9671=>009671/07/25/32/43, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>009762/07/12/21/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9775=>009775/07/25/34/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>009866/07/12/23/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9879=>009879/07/25/36/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>009970/07/12/25/34, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9983=>009983/07/25/38/47, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>010074/07/12/27/38, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10087=>010087/07/25/40/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>010178/07/12/29/38, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10191=>010191/07/25/42/51, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>010282/07/12/31/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10295=>010295/07/25/44/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>010386/07/12/33/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10399=>010399/07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>010490/07/12/35/42, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10503=>010503/07/25/48/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>010594/07/12/37/46, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10607=>010607/07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>010698/08/12/39/46, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10711=>010711/08/25/01/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>010802/08/12/41/50, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10815=>010815/08/25/03/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>010906/08/12/43/50, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10919=>010919/08/25/05/11, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>011010/08/12/45/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11023=>011023/08/25/07/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>011114/08/12/47/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11127=>011127/08/25/09/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>011218/08/12/49/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11231=>011231/08/25/11/15, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>011322/08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11335=>011335/08/25/13/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>011426/08/12/02/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11439=>011439/08/25/15/19, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>011530/08/12/04/10, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11543=>011543/08/25/17/23, fn%104=103, rc=1, delta=13 + + +=========================================================== +Testing: ts[7]->lchan[0], fn=11738=>011738/08/12/08/10, fn%104=90, rc=1, delta=11738 +Testing: ts[7]->lchan[0], fn=11842=>011842/08/12/10/14, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=11946=>011946/09/12/12/14, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=12050=>012050/09/12/14/18, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[1], fn=12063=>012063/09/25/27/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12154=>012154/09/12/16/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12167=>012167/09/25/29/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12258=>012258/09/12/18/18, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12271=>012271/09/25/31/31, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12362=>012362/09/12/20/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12375=>012375/09/25/33/35, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12466=>012466/09/12/22/22, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12479=>012479/09/25/35/35, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12570=>012570/09/12/24/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12583=>012583/09/25/37/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12674=>012674/09/12/26/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12687=>012687/09/25/39/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12778=>012778/09/12/28/26, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12791=>012791/09/25/41/39, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12882=>012882/09/12/30/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12895=>012895/09/25/43/43, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12986=>012986/09/12/32/30, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12999=>012999/09/25/45/43, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13090=>013090/09/12/34/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13103=>013103/09/25/47/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13194=>013194/09/12/36/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13207=>013207/09/25/49/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13298=>013298/10/12/38/34, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13311=>013311/10/25/00/47, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13402=>013402/10/12/40/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13415=>013415/10/25/02/51, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13506=>013506/10/12/42/38, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13519=>013519/10/25/04/51, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13610=>013610/10/12/44/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13623=>013623/10/25/06/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13714=>013714/10/12/46/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13727=>013727/10/25/08/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13818=>013818/10/12/48/42, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13831=>013831/10/25/10/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13922=>013922/10/12/50/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13935=>013935/10/25/12/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14026=>014026/10/12/01/46, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14039=>014039/10/25/14/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14130=>014130/10/12/03/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14143=>014143/10/25/16/11, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14234=>014234/10/12/05/50, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14247=>014247/10/25/18/11, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14338=>014338/10/12/07/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14351=>014351/10/25/20/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14442=>014442/10/12/09/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14455=>014455/10/25/22/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14546=>014546/10/12/11/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14559=>014559/10/25/24/15, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14650=>014650/11/12/13/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14663=>014663/11/25/26/19, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14754=>014754/11/12/15/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14767=>014767/11/25/28/19, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14858=>014858/11/12/17/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14871=>014871/11/25/30/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14962=>014962/11/12/19/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14975=>014975/11/25/32/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15066=>015066/11/12/21/10, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15079=>015079/11/25/34/23, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15170=>015170/11/12/23/14, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15183=>015183/11/25/36/27, fn%104=103, rc=1, delta=13 +Success diff --git a/tests/meas/sysmobts_fr_samples.h b/tests/meas/sysmobts_fr_samples.h new file mode 100644 index 0000000..ee70bd7 --- /dev/null +++ b/tests/meas/sysmobts_fr_samples.h @@ -0,0 +1,2601 @@ +/* The following dataset was generated using a sysmobts in order to have + * some real data from a real phy to test against. */ + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS2 and TS3 */ +struct fn_sample test_fn_tch_f_ts_2_3[] = { +{10954,2,0,-1},{10959,2,0,-1},{10972,2,0,-1},{10976,2,0,-1},{10980,2,0,-1}, +{10985,2,0,-1},{10989,2,0,-1},{10993,2,0,-1},{10998,2,0,-1},{11002,2,0,-1}, +{11006,2,0,-1},{11011,2,0,-1},{11015,2,0,-1},{11019,2,0,-1},{11024,2,0,-1}, +{11028,2,0,-1},{10958,2,0,-1},{11032,2,0,-1},{11037,2,0,-1},{11041,2,0,-1}, +{11045,2,0,-1},{11050,2,0,-1},{11054,2,0,-1},{11058,2,0,-1},{11063,2,0,-1}, +{11067,2,0,-1},{11071,2,0,-1},{11076,2,0,-1},{11080,2,0,-1},{11084,2,0,-1}, +{11089,2,0,-1},{11093,2,0,-1},{11097,2,0,-1},{11102,2,0,-1},{11106,2,0,-1}, +{11110,2,0,-1},{11115,2,0,-1},{11119,2,0,-1},{11123,2,0,-1},{11128,2,0,-1}, +{11132,2,0,-1},{11062,2,0,-1},{11136,2,0,-1},{11141,2,0,-1},{11145,2,0,-1}, +{11149,2,0,-1},{11154,2,0,-1},{11158,2,0,-1},{11162,2,0,-1},{11167,2,0,-1}, +{11171,2,0,-1},{11175,2,0,-1},{11180,2,0,-1},{11184,2,0,-1},{11188,2,0,-1}, +{11193,2,0,-1},{11197,2,0,-1},{11201,2,0,-1},{11206,2,0,-1},{11210,2,0,-1}, +{11214,2,0,-1},{11219,2,0,-1},{11223,2,0,-1},{11227,2,0,-1},{11232,2,0,-1}, +{11236,2,0,-1},{11166,2,0,-1},{11240,2,0,-1},{11245,2,0,-1},{11249,2,0,-1}, +{11253,2,0,-1},{11258,2,0,-1},{11262,2,0,-1},{11266,2,0,-1},{11271,2,0,-1}, +{11275,2,0,-1},{11279,2,0,-1},{11284,2,0,-1},{11288,2,0,-1},{11292,2,0,-1}, +{11297,2,0,-1},{11301,2,0,-1},{11305,2,0,-1},{11310,2,0,-1},{11314,2,0,-1}, +{11318,2,0,-1},{11323,2,0,-1},{11327,2,0,-1},{11331,2,0,-1},{11336,2,0,-1}, +{11340,2,0,-1},{11270,2,0,-1},{11344,2,0,-1},{11349,2,0,-1},{11353,2,0,-1}, +{11357,2,0,-1},{11362,2,0,-1},{11366,2,0,-1},{11370,2,0,-1},{11375,2,0,-1}, +{11379,2,0,-1},{11383,2,0,-1},{11388,2,0,-1},{11392,2,0,-1},{11396,2,0,-1}, +{11401,2,0,-1},{11405,2,0,-1},{11409,2,0,-1},{11414,2,0,-1},{11418,2,0,-1}, +{11422,2,0,-1},{11427,2,0,-1},{11431,2,0,-1},{11431,3,0,-1},{11435,2,0,-1}, +{11435,3,0,-1},{11440,2,0,-1},{11440,3,0,-1},{11444,2,0,-1},{11444,3,0,-1}, +{11374,2,0,-1},{11448,2,0,-1},{11448,3,0,-1},{11453,2,0,-1},{11453,3,0,-1}, +{11457,2,0,-1},{11457,3,0,-1},{11461,2,0,-1},{11461,3,0,-1},{11466,2,0,-1}, +{11466,3,0,-1},{11470,2,0,-1},{11470,3,0,-1},{11474,2,0,-1},{11474,3,0,-1}, +{11479,2,0,-1},{11479,3,0,-1},{11483,2,0,-1},{11483,3,0,-1},{11487,2,0,-1}, +{11487,3,0,-1},{11492,2,0,-1},{11492,3,0,-1},{11496,2,0,-1},{11496,3,0,-1}, +{11500,2,0,-1},{11500,3,0,-1},{11505,2,0,-1},{11505,3,0,-1},{11509,2,0,-1}, +{11509,3,0,-1},{11513,2,0,-1},{11513,3,0,-1},{11518,2,0,-1},{11518,3,0,-1}, +{11522,2,0,-1},{11522,3,0,-1},{11526,2,0,-1},{11526,3,0,-1},{11531,2,0,-1}, +{11531,3,0,-1},{11535,2,0,-1},{11535,3,0,-1},{11539,2,0,-1},{11539,3,0,-1}, +{11544,2,0,-1},{11544,3,0,-1},{11548,2,0,-1},{11548,3,0,-1},{11478,2,0,-1}, +{11552,2,0,-1},{11552,3,0,-1},{11557,2,0,-1},{11557,3,0,-1},{11561,2,0,-1}, +{11561,3,0,-1},{11491,3,0,-1},{11565,2,0,-1},{11565,3,0,-1},{11570,2,0,-1}, +{11570,3,0,-1},{11574,2,0,-1},{11574,3,0,-1},{11578,2,0,-1},{11578,3,0,-1}, +{11583,2,0,-1},{11583,3,0,-1},{11587,2,0,-1},{11587,3,0,-1},{11591,2,0,-1}, +{11591,3,0,-1},{11596,2,0,-1},{11596,3,0,-1},{11600,2,0,-1},{11600,3,0,-1}, +{11604,2,0,-1},{11604,3,0,-1},{11609,2,0,-1},{11609,3,0,-1},{11613,2,0,-1}, +{11613,3,0,-1},{11617,2,0,-1},{11617,3,0,-1},{11622,2,0,-1},{11622,3,0,-1}, +{11626,2,0,-1},{11626,3,0,-1},{11630,2,0,-1},{11630,3,0,-1},{11635,2,0,-1}, +{11635,3,0,-1},{11639,2,0,-1},{11639,3,0,-1},{11643,2,0,-1},{11643,3,0,-1}, +{11648,2,0,-1},{11648,3,0,-1},{11652,2,0,-1},{11652,3,0,-1},{11582,2,0,-1}, +{11656,2,0,-1},{11656,3,0,-1},{11661,2,0,-1},{11661,3,0,-1},{11665,2,0,-1}, +{11665,3,0,-1},{11595,3,0,-1},{11669,2,0,-1},{11669,3,0,-1},{11674,2,0,-1}, +{11674,3,0,-1},{11678,2,0,-1},{11678,3,0,-1},{11682,2,0,-1},{11682,3,0,-1}, +{11687,2,0,-1},{11687,3,0,-1},{11691,2,0,-1},{11691,3,0,-1},{11695,2,0,-1}, +{11695,3,0,-1},{11700,2,0,-1},{11700,3,0,-1},{11704,2,0,-1},{11704,3,0,-1}, +{11708,2,0,-1},{11708,3,0,-1},{11713,2,0,-1},{11713,3,0,-1},{11717,2,0,-1}, +{11717,3,0,-1},{11721,2,0,-1},{11721,3,0,-1},{11726,2,0,-1},{11726,3,0,-1}, +{11730,2,0,-1},{11730,3,0,-1},{11734,2,0,-1},{11734,3,0,-1},{11739,2,0,-1}, +{11739,3,0,-1},{11743,2,0,-1},{11743,3,0,-1},{11747,2,0,-1},{11747,3,0,-1}, +{11752,2,0,-1},{11752,3,0,-1},{11756,2,0,-1},{11756,3,0,-1},{11686,2,0,-1}, +{11760,2,0,-1},{11760,3,0,-1},{11765,2,0,-1},{11765,3,0,-1},{11769,2,0,-1}, +{11769,3,0,-1},{11699,3,0,-1},{11773,2,0,-1},{11773,3,0,-1},{11778,2,0,-1}, +{11778,3,0,-1},{11782,2,0,-1},{11782,3,0,-1},{11786,2,0,-1},{11786,3,0,-1}, +{11791,2,0,-1},{11791,3,0,-1},{11795,2,0,-1},{11795,3,0,-1},{11799,2,0,-1}, +{11799,3,0,-1},{11804,2,0,-1},{11804,3,0,-1},{11808,2,0,-1},{11808,3,0,-1}, +{11812,2,0,-1},{11812,3,0,-1},{11817,2,0,-1},{11817,3,0,-1},{11821,2,0,-1}, +{11821,3,0,-1},{11825,2,0,-1},{11825,3,0,-1},{11830,2,0,-1},{11830,3,0,-1}, +{11834,2,0,-1},{11834,3,0,-1},{11838,2,0,-1},{11838,3,0,-1},{11843,2,0,-1}, +{11843,3,0,-1},{11847,2,0,-1},{11847,3,0,-1},{11851,2,0,-1},{11851,3,0,-1}, +{11856,2,0,-1},{11856,3,0,-1},{11860,2,0,-1},{11860,3,0,-1},{11790,2,0,-1}, +{11864,2,0,-1},{11864,3,0,-1},{11869,2,0,-1},{11869,3,0,-1},{11873,2,0,-1}, +{11873,3,0,-1},{11803,3,0,-1},{11877,2,0,-1},{11877,3,0,-1},{11882,2,0,-1}, +{11882,3,0,-1},{11886,2,0,-1},{11886,3,0,-1},{11890,2,0,-1},{11890,3,0,-1}, +{11895,2,0,-1},{11895,3,0,-1},{11899,2,0,-1},{11899,3,0,-1},{11903,2,0,-1}, +{11903,3,0,-1},{11908,2,0,-1},{11908,3,0,-1},{11912,2,0,-1},{11912,3,0,-1}, +{11916,2,0,-1},{11916,3,0,-1},{11921,2,0,-1},{11921,3,0,-1},{11925,2,0,-1}, +{11925,3,0,-1},{11929,2,0,-1},{11929,3,0,-1},{11934,2,0,-1},{11934,3,0,-1}, +{11938,2,0,-1},{11938,3,0,-1},{11942,2,0,-1},{11942,3,0,-1},{11947,2,0,-1}, +{11947,3,0,-1},{11951,2,0,-1},{11951,3,0,-1},{11955,2,0,-1},{11955,3,0,-1}, +{11960,2,0,-1},{11960,3,0,-1},{11964,2,0,-1},{11964,3,0,-1},{11894,2,0,-1}, +{11968,2,0,-1},{11968,3,0,-1},{11973,2,0,-1},{11973,3,0,-1},{11977,2,0,-1}, +{11977,3,0,-1},{11907,3,0,-1},{11981,2,0,-1},{11981,3,0,-1},{11986,2,0,-1}, +{11986,3,0,-1},{11990,2,0,-1},{11990,3,0,-1},{11994,2,0,-1},{11994,3,0,-1}, +{11999,2,0,-1},{11999,3,0,-1},{12003,2,0,-1},{12003,3,0,-1},{12007,2,0,-1}, +{12007,3,0,-1},{12012,2,0,-1},{12012,3,0,-1},{12016,2,0,-1},{12016,3,0,-1}, +{12020,2,0,-1},{12020,3,0,-1},{12025,2,0,-1},{12025,3,0,-1},{12029,2,0,-1}, +{12029,3,0,-1},{12033,2,0,-1},{12033,3,0,-1},{12038,2,0,-1},{12038,3,0,-1}, +{12042,2,0,-1},{12042,3,0,-1},{12046,2,0,-1},{12046,3,0,-1},{12051,2,0,-1}, +{12051,3,0,-1},{12055,2,0,-1},{12055,3,0,-1},{12059,2,0,-1},{12059,3,0,-1}, +{12064,2,0,-1},{12064,3,0,-1},{12068,2,0,-1},{12068,3,0,-1},{11998,2,0,-1}, +{12072,2,0,-1},{12072,3,0,-1},{12077,2,0,-1},{12077,3,0,-1},{12081,2,0,-1}, +{12081,3,0,-1},{12011,3,0,-1},{12085,2,0,-1},{12085,3,0,-1},{12090,2,0,-1}, +{12090,3,0,-1},{12094,2,0,-1},{12094,3,0,-1},{12098,2,0,-1},{12098,3,0,-1}, +{12103,2,0,-1},{12103,3,0,-1},{12107,2,0,-1},{12107,3,0,-1},{12111,2,0,-1}, +{12111,3,0,-1},{12116,2,0,-1},{12116,3,0,-1},{12120,2,0,-1},{12120,3,0,-1}, +{12124,2,0,-1},{12124,3,0,-1},{12129,2,0,-1},{12129,3,0,-1},{12133,2,0,-1}, +{12133,3,0,-1},{12137,2,0,-1},{12137,3,0,-1},{12142,2,0,-1},{12142,3,0,-1}, +{12146,2,0,-1},{12146,3,0,-1},{12150,2,0,-1},{12150,3,0,-1},{12155,2,0,-1}, +{12155,3,0,-1},{12159,2,0,-1},{12159,3,0,-1},{12163,2,0,-1},{12163,3,0,-1}, +{12168,2,0,-1},{12168,3,0,-1},{12172,2,0,-1},{12172,3,0,-1},{12102,2,0,-1}, +{12176,2,0,-1},{12176,3,0,-1},{12181,2,0,-1},{12181,3,0,-1},{12185,2,0,-1}, +{12185,3,0,-1},{12115,3,0,-1},{12189,2,0,-1},{12189,3,0,-1},{12194,2,0,-1}, +{12194,3,0,-1},{12198,2,0,-1},{12198,3,0,-1},{12202,2,0,-1},{12202,3,0,-1}, +{12207,2,0,-1},{12207,3,0,-1},{12211,2,0,-1},{12211,3,0,-1},{12215,2,0,-1}, +{12215,3,0,-1},{12220,2,0,-1},{12220,3,0,-1},{12224,2,0,-1},{12224,3,0,-1}, +{12228,2,0,-1},{12228,3,0,-1},{12233,2,0,-1},{12233,3,0,-1},{12237,2,0,-1}, +{12237,3,0,-1},{12241,2,0,-1},{12241,3,0,-1},{12246,2,0,-1},{12246,3,0,-1}, +{12250,2,0,-1},{12250,3,0,-1},{12254,2,0,-1},{12254,3,0,-1},{12259,2,0,-1}, +{12259,3,0,-1},{12263,2,0,-1},{12263,3,0,-1},{12267,2,0,-1},{12267,3,0,-1}, +{12272,2,0,-1},{12272,3,0,-1},{12276,2,0,-1},{12276,3,0,-1},{12206,2,0,-1}, +{12280,2,0,-1},{12280,3,0,-1},{12285,2,0,-1},{12285,3,0,-1},{12289,2,0,-1}, +{12289,3,0,-1},{12219,3,0,-1},{12293,2,0,-1},{12293,3,0,-1},{12298,2,0,-1}, +{12298,3,0,-1},{12302,2,0,-1},{12302,3,0,-1},{12306,2,0,-1},{12306,3,0,-1}, +{12311,2,0,-1},{12311,3,0,-1},{12315,2,0,-1},{12315,3,0,-1},{12319,2,0,-1}, +{12319,3,0,-1},{12324,2,0,-1},{12324,3,0,-1},{12328,2,0,-1},{12328,3,0,-1}, +{12332,2,0,-1},{12332,3,0,-1},{12337,2,0,-1},{12337,3,0,-1},{12341,2,0,-1}, +{12341,3,0,-1},{12345,2,0,-1},{12345,3,0,-1},{12350,2,0,-1},{12350,3,0,-1}, +{12354,2,0,-1},{12354,3,0,-1},{12358,2,0,-1},{12358,3,0,-1},{12363,2,0,-1}, +{12363,3,0,-1},{12367,2,0,-1},{12367,3,0,-1},{12371,2,0,-1},{12371,3,0,-1}, +{12376,2,0,-1},{12376,3,0,-1},{12380,2,0,-1},{12380,3,0,-1},{12310,2,0,-1}, +{12384,2,0,-1},{12384,3,0,-1},{12389,2,0,-1},{12389,3,0,-1},{12393,2,0,-1}, +{12393,3,0,-1},{12323,3,0,-1},{12397,2,0,-1},{12397,3,0,-1},{12402,2,0,-1}, +{12402,3,0,-1},{12406,2,0,-1},{12406,3,0,-1},{12410,2,0,-1},{12410,3,0,-1}, +{12415,2,0,-1},{12415,3,0,-1},{12419,2,0,-1},{12419,3,0,-1},{12423,2,0,-1}, +{12423,3,0,-1},{12428,2,0,-1},{12428,3,0,-1},{12432,2,0,-1},{12432,3,0,-1}, +{12436,2,0,-1},{12436,3,0,-1},{12441,2,0,-1},{12441,3,0,-1},{12445,2,0,-1}, +{12445,3,0,-1},{12449,2,0,-1},{12449,3,0,-1},{12454,2,0,-1},{12454,3,0,-1}, +{12458,2,0,-1},{12458,3,0,-1},{12462,2,0,-1},{12462,3,0,-1},{12467,2,0,-1}, +{12467,3,0,-1},{12471,2,0,-1},{12471,3,0,-1},{12475,2,0,-1},{12475,3,0,-1}, +{12480,2,0,-1},{12480,3,0,-1},{12484,2,0,-1},{12484,3,0,-1},{12414,2,0,-1}, +{12488,2,0,-1},{12488,3,0,-1},{12493,2,0,-1},{12493,3,0,-1},{12497,2,0,-1}, +{12497,3,0,-1},{12427,3,0,-1},{12501,2,0,-1},{12501,3,0,-1},{12506,2,0,-1}, +{12506,3,0,-1},{12510,2,0,-1},{12510,3,0,-1},{12514,2,0,-1},{12514,3,0,-1}, +{12519,2,0,-1},{12519,3,0,-1},{12523,2,0,-1},{12523,3,0,-1},{12527,2,0,-1}, +{12527,3,0,-1},{12532,2,0,-1},{12532,3,0,-1},{12536,2,0,-1},{12536,3,0,-1}, +{12540,2,0,-1},{12540,3,0,-1},{12545,2,0,-1},{12545,3,0,-1},{12549,2,0,-1}, +{12549,3,0,-1},{12553,2,0,-1},{12553,3,0,-1},{12558,2,0,-1},{12558,3,0,-1}, +{12562,2,0,-1},{12562,3,0,-1},{12566,2,0,-1},{12566,3,0,-1},{12571,2,0,-1}, +{12571,3,0,-1},{12575,2,0,-1},{12575,3,0,-1},{12579,2,0,-1},{12579,3,0,-1}, +{12584,2,0,-1},{12584,3,0,-1},{12588,2,0,-1},{12588,3,0,-1},{12518,2,0,-1}, +{12592,2,0,-1},{12592,3,0,-1},{12597,2,0,-1},{12597,3,0,-1},{12601,2,0,-1}, +{12601,3,0,-1},{12531,3,0,-1},{12605,2,0,-1},{12605,3,0,-1},{12610,2,0,-1}, +{12610,3,0,-1},{12614,2,0,-1},{12614,3,0,-1},{12618,2,0,-1},{12618,3,0,-1}, +{12623,2,0,-1},{12623,3,0,-1},{12627,2,0,-1},{12627,3,0,-1},{12631,2,0,-1}, +{12631,3,0,-1},{12636,2,0,-1},{12636,3,0,-1},{12640,2,0,-1},{12640,3,0,-1}, +{12644,2,0,-1},{12644,3,0,-1},{12649,2,0,-1},{12649,3,0,-1},{12653,2,0,-1}, +{12653,3,0,-1},{12657,2,0,-1},{12657,3,0,-1},{12662,2,0,-1},{12662,3,0,-1}, +{12666,2,0,-1},{12666,3,0,-1},{12670,2,0,-1},{12670,3,0,-1},{12675,2,0,-1}, +{12675,3,0,-1},{12679,2,0,-1},{12679,3,0,-1},{12683,2,0,-1},{12683,3,0,-1}, +{12688,2,0,-1},{12688,3,0,-1},{12692,2,0,-1},{12692,3,0,-1},{12622,2,0,-1}, +{12696,2,0,-1},{12696,3,0,-1},{12701,2,0,-1},{12701,3,0,-1},{12705,2,0,-1}, +{12705,3,0,-1},{12635,3,0,-1},{12709,2,0,-1},{12709,3,0,-1},{12714,2,0,-1}, +{12714,3,0,-1},{12718,2,0,-1},{12718,3,0,-1},{12722,2,0,-1},{12722,3,0,-1}, +{12727,2,0,-1},{12727,3,0,-1},{12731,2,0,-1},{12731,3,0,-1},{12735,2,0,-1}, +{12735,3,0,-1},{12740,2,0,-1},{12740,3,0,-1},{12744,2,0,-1},{12744,3,0,-1}, +{12748,2,0,-1},{12748,3,0,-1},{12753,2,0,-1},{12753,3,0,-1},{12757,2,0,-1}, +{12757,3,0,-1},{12761,2,0,-1},{12761,3,0,-1},{12766,2,0,-1},{12766,3,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS4 and TS5 */ +struct fn_sample test_fn_tch_f_ts_4_5[] = { +{3407,0,1,-1},{3427,0,1,-1},{3458,0,1,-1},{3509,0,1,-1},{3529,0,1,-1}, +{3560,0,1,-1},{3611,0,1,-1},{3662,0,1,-1},{3713,0,1,-1},{3764,0,1,-1}, +{3780,0,2,-1},{3821,0,2,-1},{3872,0,2,-1},{3882,0,2,-1},{3923,0,2,-1}, +{3974,0,2,-1},{3984,0,2,-1},{4025,0,2,-1},{4076,0,2,-1},{4127,0,2,-1}, +{4178,0,2,-1},{5871,4,0,-1},{5876,4,0,-1},{5880,4,0,-1},{5884,4,0,-1}, +{5889,4,0,-1},{5893,4,0,-1},{5897,4,0,-1},{5902,4,0,-1},{5906,4,0,-1}, +{5910,4,0,-1},{5915,4,0,-1},{5919,4,0,-1},{5923,4,0,-1},{5928,4,0,-1}, +{5932,4,0,-1},{5936,4,0,-1},{5941,4,0,-1},{5945,4,0,-1},{5949,4,0,-1}, +{5954,4,0,-1},{5958,4,0,-1},{5888,4,0,-1},{5962,4,0,-1},{5967,4,0,-1}, +{5971,4,0,-1},{5975,4,0,-1},{5980,4,0,-1},{5984,4,0,-1},{5988,4,0,-1}, +{5993,4,0,-1},{5997,4,0,-1},{6001,4,0,-1},{6006,4,0,-1},{6010,4,0,-1}, +{6014,4,0,-1},{6019,4,0,-1},{6023,4,0,-1},{6027,4,0,-1},{6032,4,0,-1}, +{6036,4,0,-1},{6040,4,0,-1},{6045,4,0,-1},{6049,4,0,-1},{6053,4,0,-1}, +{6058,4,0,-1},{6062,4,0,-1},{5992,4,0,-1},{6066,4,0,-1},{6071,4,0,-1}, +{6075,4,0,-1},{6079,4,0,-1},{6084,4,0,-1},{6088,4,0,-1},{6092,4,0,-1}, +{6097,4,0,-1},{6101,4,0,-1},{6105,4,0,-1},{6110,4,0,-1},{6114,4,0,-1}, +{6118,4,0,-1},{6123,4,0,-1},{6127,4,0,-1},{6131,4,0,-1},{6136,4,0,-1}, +{6140,4,0,-1},{6144,4,0,-1},{6149,4,0,-1},{6153,4,0,-1},{6157,4,0,-1}, +{6162,4,0,-1},{6166,4,0,-1},{6096,4,0,-1},{6170,4,0,-1},{6175,4,0,-1}, +{6175,5,0,-1},{6179,4,0,-1},{6179,5,0,-1},{6183,4,0,-1},{6183,5,0,-1}, +{6188,4,0,-1},{6188,5,0,-1},{6192,4,0,-1},{6192,5,0,-1},{6196,4,0,-1}, +{6196,5,0,-1},{6201,4,0,-1},{6201,5,0,-1},{6205,4,0,-1},{6205,5,0,-1}, +{6209,4,0,-1},{6209,5,0,-1},{6214,4,0,-1},{6214,5,0,-1},{6218,4,0,-1}, +{6218,5,0,-1},{6222,4,0,-1},{6222,5,0,-1},{6227,4,0,-1},{6227,5,0,-1}, +{6231,4,0,-1},{6231,5,0,-1},{6235,4,0,-1},{6235,5,0,-1},{6240,4,0,-1}, +{6240,5,0,-1},{6244,4,0,-1},{6244,5,0,-1},{6248,4,0,-1},{6248,5,0,-1}, +{6253,4,0,-1},{6253,5,0,-1},{6257,4,0,-1},{6257,5,0,-1},{6261,4,0,-1}, +{6261,5,0,-1},{6266,4,0,-1},{6266,5,0,-1},{6270,4,0,-1},{6270,5,0,-1}, +{6200,4,0,-1},{6274,4,0,-1},{6274,5,0,-1},{6279,4,0,-1},{6279,5,0,-1}, +{6283,4,0,-1},{6283,5,0,-1},{6213,5,0,-1},{6287,4,0,-1},{6287,5,0,-1}, +{6292,4,0,-1},{6292,5,0,-1},{6296,4,0,-1},{6296,5,0,-1},{6300,4,0,-1}, +{6300,5,0,-1},{6305,4,0,-1},{6305,5,0,-1},{6309,4,0,-1},{6309,5,0,-1}, +{6313,4,0,-1},{6313,5,0,-1},{6318,4,0,-1},{6318,5,0,-1},{6322,4,0,-1}, +{6322,5,0,-1},{6326,4,0,-1},{6326,5,0,-1},{6331,4,0,-1},{6331,5,0,-1}, +{6335,4,0,-1},{6335,5,0,-1},{6339,4,0,-1},{6339,5,0,-1},{6344,4,0,-1}, +{6344,5,0,-1},{6348,4,0,-1},{6348,5,0,-1},{6352,4,0,-1},{6352,5,0,-1}, +{6357,4,0,-1},{6357,5,0,-1},{6361,4,0,-1},{6361,5,0,-1},{6365,4,0,-1}, +{6365,5,0,-1},{6370,4,0,-1},{6370,5,0,-1},{6374,4,0,-1},{6374,5,0,-1}, +{6304,4,0,-1},{6378,4,0,-1},{6378,5,0,-1},{6383,4,0,-1},{6383,5,0,-1}, +{6387,4,0,-1},{6387,5,0,-1},{6317,5,0,-1},{6391,4,0,-1},{6391,5,0,-1}, +{6396,4,0,-1},{6396,5,0,-1},{6400,4,0,-1},{6400,5,0,-1},{6404,4,0,-1}, +{6404,5,0,-1},{6409,4,0,-1},{6409,5,0,-1},{6413,4,0,-1},{6413,5,0,-1}, +{6417,4,0,-1},{6417,5,0,-1},{6422,4,0,-1},{6422,5,0,-1},{6426,4,0,-1}, +{6426,5,0,-1},{6430,4,0,-1},{6430,5,0,-1},{6435,4,0,-1},{6435,5,0,-1}, +{6439,4,0,-1},{6439,5,0,-1},{6443,4,0,-1},{6443,5,0,-1},{6448,4,0,-1}, +{6448,5,0,-1},{6452,4,0,-1},{6452,5,0,-1},{6456,4,0,-1},{6456,5,0,-1}, +{6461,4,0,-1},{6461,5,0,-1},{6465,4,0,-1},{6465,5,0,-1},{6469,4,0,-1}, +{6469,5,0,-1},{6474,4,0,-1},{6474,5,0,-1},{6478,4,0,-1},{6478,5,0,-1}, +{6408,4,0,-1},{6482,4,0,-1},{6482,5,0,-1},{6487,4,0,-1},{6487,5,0,-1}, +{6491,4,0,-1},{6491,5,0,-1},{6421,5,0,-1},{6495,4,0,-1},{6495,5,0,-1}, +{6500,4,0,-1},{6500,5,0,-1},{6504,4,0,-1},{6504,5,0,-1},{6508,4,0,-1}, +{6508,5,0,-1},{6513,4,0,-1},{6513,5,0,-1},{6517,4,0,-1},{6517,5,0,-1}, +{6521,4,0,-1},{6521,5,0,-1},{6526,4,0,-1},{6526,5,0,-1},{6530,4,0,-1}, +{6530,5,0,-1},{6534,4,0,-1},{6534,5,0,-1},{6539,4,0,-1},{6539,5,0,-1}, +{6543,4,0,-1},{6543,5,0,-1},{6547,4,0,-1},{6547,5,0,-1},{6552,4,0,-1}, +{6552,5,0,-1},{6556,4,0,-1},{6556,5,0,-1},{6560,4,0,-1},{6560,5,0,-1}, +{6565,4,0,-1},{6565,5,0,-1},{6569,4,0,-1},{6569,5,0,-1},{6573,4,0,-1}, +{6573,5,0,-1},{6578,4,0,-1},{6578,5,0,-1},{6582,4,0,-1},{6582,5,0,-1}, +{6512,4,0,-1},{6586,4,0,-1},{6586,5,0,-1},{6591,4,0,-1},{6591,5,0,-1}, +{6595,4,0,-1},{6595,5,0,-1},{6525,5,0,-1},{6599,4,0,-1},{6599,5,0,-1}, +{6604,4,0,-1},{6604,5,0,-1},{6608,4,0,-1},{6608,5,0,-1},{6612,4,0,-1}, +{6612,5,0,-1},{6617,4,0,-1},{6617,5,0,-1},{6621,4,0,-1},{6621,5,0,-1}, +{6625,4,0,-1},{6625,5,0,-1},{6630,4,0,-1},{6630,5,0,-1},{6634,4,0,-1}, +{6634,5,0,-1},{6638,4,0,-1},{6638,5,0,-1},{6643,4,0,-1},{6643,5,0,-1}, +{6647,4,0,-1},{6647,5,0,-1},{6651,4,0,-1},{6651,5,0,-1},{6656,4,0,-1}, +{6656,5,0,-1},{6660,4,0,-1},{6660,5,0,-1},{6664,4,0,-1},{6664,5,0,-1}, +{6669,4,0,-1},{6669,5,0,-1},{6673,4,0,-1},{6673,5,0,-1},{6677,4,0,-1}, +{6677,5,0,-1},{6682,4,0,-1},{6682,5,0,-1},{6686,4,0,-1},{6686,5,0,-1}, +{6616,4,0,-1},{6690,4,0,-1},{6690,5,0,-1},{6695,4,0,-1},{6695,5,0,-1}, +{6699,4,0,-1},{6699,5,0,-1},{6629,5,0,-1},{6703,4,0,-1},{6703,5,0,-1}, +{6708,4,0,-1},{6708,5,0,-1},{6712,4,0,-1},{6712,5,0,-1},{6716,4,0,-1}, +{6716,5,0,-1},{6721,4,0,-1},{6721,5,0,-1},{6725,4,0,-1},{6725,5,0,-1}, +{6729,4,0,-1},{6729,5,0,-1},{6734,4,0,-1},{6734,5,0,-1},{6738,4,0,-1}, +{6738,5,0,-1},{6742,4,0,-1},{6742,5,0,-1},{6747,4,0,-1},{6747,5,0,-1}, +{6751,4,0,-1},{6751,5,0,-1},{6755,4,0,-1},{6755,5,0,-1},{6760,4,0,-1}, +{6760,5,0,-1},{6764,4,0,-1},{6764,5,0,-1},{6768,4,0,-1},{6768,5,0,-1}, +{6773,4,0,-1},{6773,5,0,-1},{6777,4,0,-1},{6777,5,0,-1},{6781,4,0,-1}, +{6781,5,0,-1},{6786,4,0,-1},{6786,5,0,-1},{6790,4,0,-1},{6790,5,0,-1}, +{6720,4,0,-1},{6794,4,0,-1},{6794,5,0,-1},{6799,4,0,-1},{6799,5,0,-1}, +{6803,4,0,-1},{6803,5,0,-1},{6733,5,0,-1},{6807,4,0,-1},{6807,5,0,-1}, +{6812,4,0,-1},{6812,5,0,-1},{6816,4,0,-1},{6816,5,0,-1},{6820,4,0,-1}, +{6820,5,0,-1},{6825,4,0,-1},{6825,5,0,-1},{6829,4,0,-1},{6829,5,0,-1}, +{6833,4,0,-1},{6833,5,0,-1},{6838,4,0,-1},{6838,5,0,-1},{6842,4,0,-1}, +{6842,5,0,-1},{6846,4,0,-1},{6846,5,0,-1},{6851,4,0,-1},{6851,5,0,-1}, +{6855,4,0,-1},{6855,5,0,-1},{6859,4,0,-1},{6859,5,0,-1},{6864,4,0,-1}, +{6864,5,0,-1},{6868,4,0,-1},{6868,5,0,-1},{6872,4,0,-1},{6872,5,0,-1}, +{6877,4,0,-1},{6877,5,0,-1},{6881,4,0,-1},{6881,5,0,-1},{6885,4,0,-1}, +{6885,5,0,-1},{6890,4,0,-1},{6890,5,0,-1},{6894,4,0,-1},{6894,5,0,-1}, +{6824,4,0,-1},{6898,4,0,-1},{6898,5,0,-1},{6903,4,0,-1},{6903,5,0,-1}, +{6907,4,0,-1},{6907,5,0,-1},{6837,5,0,-1},{6911,4,0,-1},{6911,5,0,-1}, +{6916,4,0,-1},{6916,5,0,-1},{6920,4,0,-1},{6920,5,0,-1},{6924,4,0,-1}, +{6924,5,0,-1},{6929,4,0,-1},{6929,5,0,-1},{6933,4,0,-1},{6933,5,0,-1}, +{6937,4,0,-1},{6937,5,0,-1},{6942,4,0,-1},{6942,5,0,-1},{6946,4,0,-1}, +{6946,5,0,-1},{6950,4,0,-1},{6950,5,0,-1},{6955,4,0,-1},{6955,5,0,-1}, +{6959,4,0,-1},{6959,5,0,-1},{6963,4,0,-1},{6963,5,0,-1},{6968,4,0,-1}, +{6968,5,0,-1},{6972,4,0,-1},{6972,5,0,-1},{6976,4,0,-1},{6976,5,0,-1}, +{6981,4,0,-1},{6981,5,0,-1},{6985,4,0,-1},{6985,5,0,-1},{6989,4,0,-1}, +{6989,5,0,-1},{6994,4,0,-1},{6994,5,0,-1},{6998,4,0,-1},{6998,5,0,-1}, +{6928,4,0,-1},{7002,4,0,-1},{7002,5,0,-1},{7007,4,0,-1},{7007,5,0,-1}, +{7011,4,0,-1},{7011,5,0,-1},{6941,5,0,-1},{7015,4,0,-1},{7015,5,0,-1}, +{7020,4,0,-1},{7020,5,0,-1},{7024,4,0,-1},{7024,5,0,-1},{7028,4,0,-1}, +{7028,5,0,-1},{7033,4,0,-1},{7033,5,0,-1},{7037,4,0,-1},{7037,5,0,-1}, +{7041,4,0,-1},{7041,5,0,-1},{7046,4,0,-1},{7046,5,0,-1},{7050,4,0,-1}, +{7050,5,0,-1},{7054,4,0,-1},{7054,5,0,-1},{7059,4,0,-1},{7059,5,0,-1}, +{7063,4,0,-1},{7063,5,0,-1},{7067,4,0,-1},{7067,5,0,-1},{7072,4,0,-1}, +{7072,5,0,-1},{7076,4,0,-1},{7076,5,0,-1},{7080,4,0,-1},{7080,5,0,-1}, +{7085,4,0,-1},{7085,5,0,-1},{7089,4,0,-1},{7089,5,0,-1},{7093,4,0,-1}, +{7093,5,0,-1},{7098,4,0,-1},{7098,5,0,-1},{7102,4,0,-1},{7102,5,0,-1}, +{7032,4,0,-1},{7106,4,0,-1},{7106,5,0,-1},{7111,4,0,-1},{7111,5,0,-1}, +{7115,4,0,-1},{7115,5,0,-1},{7045,5,0,-1},{7119,4,0,-1},{7119,5,0,-1}, +{7124,4,0,-1},{7124,5,0,-1},{7128,4,0,-1},{7128,5,0,-1},{7132,4,0,-1}, +{7132,5,0,-1},{7137,4,0,-1},{7137,5,0,-1},{7141,4,0,-1},{7141,5,0,-1}, +{7145,4,0,-1},{7145,5,0,-1},{7150,4,0,-1},{7150,5,0,-1},{7154,4,0,-1}, +{7154,5,0,-1},{7158,4,0,-1},{7158,5,0,-1},{7163,4,0,-1},{7163,5,0,-1}, +{7167,4,0,-1},{7167,5,0,-1},{7171,4,0,-1},{7171,5,0,-1},{7176,4,0,-1}, +{7176,5,0,-1},{7180,4,0,-1},{7180,5,0,-1},{7184,4,0,-1},{7184,5,0,-1}, +{7189,4,0,-1},{7189,5,0,-1},{7193,4,0,-1},{7193,5,0,-1},{7197,4,0,-1}, +{7197,5,0,-1},{7202,4,0,-1},{7202,5,0,-1},{7206,4,0,-1},{7206,5,0,-1}, +{7136,4,0,-1},{7210,4,0,-1},{7210,5,0,-1},{7215,4,0,-1},{7215,5,0,-1}, +{7219,4,0,-1},{7219,5,0,-1},{7149,5,0,-1},{7223,4,0,-1},{7223,5,0,-1}, +{7228,4,0,-1},{7228,5,0,-1},{7232,4,0,-1},{7232,5,0,-1},{7236,4,0,-1}, +{7236,5,0,-1},{7241,4,0,-1},{7241,5,0,-1},{7245,4,0,-1},{7245,5,0,-1}, +{7249,4,0,-1},{7249,5,0,-1},{7254,4,0,-1},{7254,5,0,-1},{7258,4,0,-1}, +{7258,5,0,-1},{7262,4,0,-1},{7262,5,0,-1},{7267,4,0,-1},{7267,5,0,-1}, +{7271,4,0,-1},{7271,5,0,-1},{7275,4,0,-1},{7275,5,0,-1},{7280,4,0,-1}, +{7280,5,0,-1},{7284,4,0,-1},{7284,5,0,-1},{7288,4,0,-1},{7288,5,0,-1}, +{7293,4,0,-1},{7293,5,0,-1},{7297,4,0,-1},{7297,5,0,-1},{7301,4,0,-1}, +{7301,5,0,-1},{7306,4,0,-1},{7306,5,0,-1},{7310,4,0,-1},{7310,5,0,-1}, +{7240,4,0,-1},{7314,4,0,-1},{7314,5,0,-1},{7319,4,0,-1},{7319,5,0,-1}, +{7323,4,0,-1},{7323,5,0,-1},{7253,5,0,-1},{7327,4,0,-1},{7327,5,0,-1}, +{7332,4,0,-1},{7332,5,0,-1},{7336,4,0,-1},{7336,5,0,-1},{7340,4,0,-1}, +{7340,5,0,-1},{7345,4,0,-1},{7345,5,0,-1},{7349,4,0,-1},{7349,5,0,-1}, +{7353,4,0,-1},{7353,5,0,-1},{7358,4,0,-1},{7358,5,0,-1},{7362,4,0,-1}, +{7362,5,0,-1},{7366,4,0,-1},{7366,5,0,-1},{7371,4,0,-1},{7371,5,0,-1}, +{7375,4,0,-1},{7375,5,0,-1},{7379,4,0,-1},{7379,5,0,-1},{7384,4,0,-1}, +{7384,5,0,-1},{7388,4,0,-1},{7388,5,0,-1},{7392,4,0,-1},{7392,5,0,-1}, +{7397,4,0,-1},{7397,5,0,-1},{7401,4,0,-1},{7401,5,0,-1},{7405,4,0,-1}, +{7405,5,0,-1},{7410,4,0,-1},{7410,5,0,-1},{7414,4,0,-1},{7414,5,0,-1}, +{7344,4,0,-1},{7418,4,0,-1},{7418,5,0,-1},{7423,4,0,-1},{7423,5,0,-1}, +{7427,4,0,-1},{7427,5,0,-1},{7357,5,0,-1},{7431,4,0,-1},{7431,5,0,-1}, +{7436,4,0,-1},{7436,5,0,-1},{7440,4,0,-1},{7440,5,0,-1},{7444,4,0,-1}, +{7444,5,0,-1},{7449,4,0,-1},{7449,5,0,-1},{7453,4,0,-1},{7453,5,0,-1}, +{7457,4,0,-1},{7457,5,0,-1},{7462,4,0,-1},{7462,5,0,-1},{7466,4,0,-1}, +{7466,5,0,-1},{7470,4,0,-1},{7470,5,0,-1},{7475,4,0,-1},{7475,5,0,-1}, +{7479,4,0,-1},{7479,5,0,-1},{7483,4,0,-1},{7483,5,0,-1},{7488,4,0,-1}, +{7488,5,0,-1},{7492,4,0,-1},{7492,5,0,-1},{7496,4,0,-1},{7496,5,0,-1}, +{7501,4,0,-1},{7501,5,0,-1},{7505,4,0,-1},{7505,5,0,-1},{7509,4,0,-1}, +{7509,5,0,-1},{7514,4,0,-1},{7514,5,0,-1},{7518,4,0,-1},{7518,5,0,-1}, +{7448,4,0,-1},{7522,4,0,-1},{7522,5,0,-1},{7527,4,0,-1},{7527,5,0,-1}, +{7531,4,0,-1},{7531,5,0,-1},{7461,5,0,-1},{7535,4,0,-1},{7535,5,0,-1}, +{7540,4,0,-1},{7540,5,0,-1},{7544,4,0,-1},{7544,5,0,-1},{7548,4,0,-1}, +{7548,5,0,-1},{7553,4,0,-1},{7553,5,0,-1},{7557,4,0,-1},{7557,5,0,-1}, +{7561,4,0,-1},{7561,5,0,-1},{7566,4,0,-1},{7566,5,0,-1},{7570,4,0,-1}, +{7570,5,0,-1},{7574,4,0,-1},{7574,5,0,-1},{7579,4,0,-1},{7579,5,0,-1}, +{7583,4,0,-1},{7583,5,0,-1},{7587,4,0,-1},{7587,5,0,-1},{7592,4,0,-1}, +{7592,5,0,-1},{7596,4,0,-1},{7596,5,0,-1},{7600,4,0,-1},{7600,5,0,-1}, +{7605,4,0,-1},{7605,5,0,-1},{7609,4,0,-1},{7609,5,0,-1},{7613,4,0,-1}, +{7613,5,0,-1},{7618,4,0,-1},{7618,5,0,-1},{7622,4,0,-1},{7622,5,0,-1}, +{7552,4,0,-1},{7626,4,0,-1},{7626,5,0,-1},{7631,4,0,-1},{7631,5,0,-1}, +{7635,4,0,-1},{7635,5,0,-1},{7565,5,0,-1},{7639,4,0,-1},{7639,5,0,-1}, +{7644,4,0,-1},{7644,5,0,-1},{7648,4,0,-1},{7648,5,0,-1},{7652,4,0,-1}, +{7652,5,0,-1},{7657,4,0,-1},{7657,5,0,-1},{7661,4,0,-1},{7661,5,0,-1}, +{7665,4,0,-1},{7665,5,0,-1},{7670,4,0,-1},{7670,5,0,-1},{7674,4,0,-1}, +{7674,5,0,-1},{7678,4,0,-1},{7678,5,0,-1},{7683,4,0,-1},{7683,5,0,-1}, +{7687,4,0,-1},{7687,5,0,-1},{7691,4,0,-1},{7691,5,0,-1},{7696,4,0,-1}, +{7696,5,0,-1},{7700,4,0,-1},{7700,5,0,-1},{7704,4,0,-1},{7704,5,0,-1}, +{7709,4,0,-1},{7709,5,0,-1},{7713,4,0,-1},{7713,5,0,-1},{7717,4,0,-1}, +{7717,5,0,-1},{7722,4,0,-1},{7722,5,0,-1},{7726,4,0,-1},{7726,5,0,-1}, +{7656,4,0,-1},{7730,4,0,-1},{7730,5,0,-1},{7735,4,0,-1},{7735,5,0,-1}, +{7739,4,0,-1},{7739,5,0,-1},{7669,5,0,-1},{7743,4,0,-1},{7743,5,0,-1}, +{7748,4,0,-1},{7748,5,0,-1},{7752,4,0,-1},{7752,5,0,-1},{7756,4,0,-1}, +{7756,5,0,-1},{7761,4,0,-1},{7761,5,0,-1},{7765,4,0,-1},{7765,5,0,-1}, +{7769,4,0,-1},{7769,5,0,-1},{7774,4,0,-1},{7774,5,0,-1},{7778,4,0,-1}, +{7778,5,0,-1},{7782,4,0,-1},{7782,5,0,-1},{7787,4,0,-1},{7787,5,0,-1}, +{7791,4,0,-1},{7791,5,0,-1},{7795,4,0,-1},{7795,5,0,-1},{7800,4,0,-1}, +{7800,5,0,-1},{7804,4,0,-1},{7804,5,0,-1},{7808,4,0,-1},{7808,5,0,-1}, +{7813,4,0,-1},{7813,5,0,-1},{7817,4,0,-1},{7817,5,0,-1},{7821,4,0,-1}, +{7821,5,0,-1},{7826,4,0,-1},{7826,5,0,-1},{7830,4,0,-1},{7830,5,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7834,5,0,-1},{7839,4,0,-1},{7839,5,0,-1}, +{7843,4,0,-1},{7843,5,0,-1},{7773,5,0,-1},{7847,4,0,-1},{7847,5,0,-1}, +{7852,4,0,-1},{7852,5,0,-1},{7856,4,0,-1},{7856,5,0,-1},{7860,4,0,-1}, +{7860,5,0,-1},{7865,4,0,-1},{7865,5,0,-1},{7869,4,0,-1},{7869,5,0,-1}, +{7873,4,0,-1},{7873,5,0,-1},{7878,4,0,-1},{7878,5,0,-1},{7882,4,0,-1}, +{7882,5,0,-1},{7886,4,0,-1},{7886,5,0,-1},{7891,4,0,-1},{7891,5,0,-1}, +{7895,4,0,-1},{7895,5,0,-1},{7899,4,0,-1},{7899,5,0,-1},{7904,4,0,-1}, +{7904,5,0,-1},{7908,4,0,-1},{7908,5,0,-1},{7912,4,0,-1},{7912,5,0,-1}, +{7917,4,0,-1},{7917,5,0,-1},{7921,4,0,-1},{7921,5,0,-1},{7925,4,0,-1}, +{7925,5,0,-1},{7930,4,0,-1},{7930,5,0,-1},{7934,4,0,-1},{7934,5,0,-1}, +{7864,4,0,-1},{7938,4,0,-1},{7938,5,0,-1},{7943,4,0,-1},{7943,5,0,-1}, +{7947,4,0,-1},{7947,5,0,-1},{7877,5,0,-1},{7951,4,0,-1},{7951,5,0,-1}, +{7956,4,0,-1},{7956,5,0,-1},{7960,4,0,-1},{7960,5,0,-1},{7964,4,0,-1}, +{7964,5,0,-1},{7969,4,0,-1},{7969,5,0,-1},{7973,4,0,-1},{7973,5,0,-1}, +{7977,4,0,-1},{7977,5,0,-1},{7982,4,0,-1},{7982,5,0,-1},{7986,4,0,-1}, +{7986,5,0,-1},{7990,4,0,-1},{7990,5,0,-1},{7995,4,0,-1},{7995,5,0,-1}, +{7999,4,0,-1},{7999,5,0,-1},{8003,4,0,-1},{8003,5,0,-1},{8008,4,0,-1}, +{8008,5,0,-1},{8012,4,0,-1},{8012,5,0,-1},{8016,4,0,-1},{8016,5,0,-1}, +{8021,4,0,-1},{8021,5,0,-1},{8025,4,0,-1},{8025,5,0,-1},{8029,4,0,-1}, +{8029,5,0,-1},{8034,4,0,-1},{8034,5,0,-1},{8038,4,0,-1},{8038,5,0,-1}, +{7968,4,0,-1},{8042,4,0,-1},{8042,5,0,-1},{8047,4,0,-1},{8047,5,0,-1}, +{8051,4,0,-1},{8051,5,0,-1},{7981,5,0,-1},{8055,4,0,-1},{8055,5,0,-1}, +{8060,4,0,-1},{8060,5,0,-1},{8064,4,0,-1},{8064,5,0,-1},{8068,4,0,-1}, +{8068,5,0,-1},{8073,4,0,-1},{8073,5,0,-1},{8077,4,0,-1},{8077,5,0,-1}, +{8081,4,0,-1},{8081,5,0,-1},{8086,4,0,-1},{8086,5,0,-1},{8090,4,0,-1}, +{8090,5,0,-1},{8094,4,0,-1},{8094,5,0,-1},{8099,4,0,-1},{8099,5,0,-1}, +{8103,4,0,-1},{8103,5,0,-1},{8107,4,0,-1},{8107,5,0,-1},{8112,4,0,-1}, +{8112,5,0,-1},{8116,4,0,-1},{8116,5,0,-1},{8120,4,0,-1},{8120,5,0,-1}, +{8125,4,0,-1},{8125,5,0,-1},{8129,4,0,-1},{8129,5,0,-1},{8133,4,0,-1}, +{8133,5,0,-1},{8138,4,0,-1},{8138,5,0,-1},{8142,4,0,-1},{8142,5,0,-1}, +{8072,4,0,-1},{8146,4,0,-1},{8146,5,0,-1},{8151,4,0,-1},{8151,5,0,-1}, +{8155,4,0,-1},{8155,5,0,-1},{8085,5,0,-1},{8159,4,0,-1},{8159,5,0,-1}, +{8164,4,0,-1},{8164,5,0,-1},{8168,4,0,-1},{8168,5,0,-1},{8172,4,0,-1}, +{8172,5,0,-1},{8177,4,0,-1},{8177,5,0,-1},{8181,4,0,-1},{8181,5,0,-1}, +{8185,4,0,-1},{8185,5,0,-1},{8190,4,0,-1},{8190,5,0,-1},{8194,4,0,-1}, +{8194,5,0,-1},{8198,4,0,-1},{8198,5,0,-1},{8203,4,0,-1},{8203,5,0,-1}, +{8207,4,0,-1},{8207,5,0,-1},{8211,4,0,-1},{8211,5,0,-1},{8216,4,0,-1}, +{8216,5,0,-1},{8220,4,0,-1},{8220,5,0,-1},{8224,4,0,-1},{8224,5,0,-1}, +{8229,4,0,-1},{8229,5,0,-1},{8233,4,0,-1},{8233,5,0,-1},{8237,4,0,-1}, +{8237,5,0,-1},{8242,4,0,-1},{8242,5,0,-1},{8246,4,0,-1},{8246,5,0,-1}, +{8176,4,0,-1},{8250,4,0,-1},{8250,5,0,-1},{8255,4,0,-1},{8255,5,0,-1}, +{8259,4,0,-1},{8259,5,0,-1},{8189,5,0,-1},{8263,4,0,-1},{8263,5,0,-1}, +{8268,4,0,-1},{8268,5,0,-1},{8272,4,0,-1},{8272,5,0,-1},{8276,4,0,-1}, +{8276,5,0,-1},{8281,4,0,-1},{8281,5,0,-1},{8285,4,0,-1},{8285,5,0,-1}, +{8289,4,0,-1},{8289,5,0,-1},{8294,4,0,-1},{8294,5,0,-1},{8298,4,0,-1}, +{8298,5,0,-1},{8302,4,0,-1},{8302,5,0,-1},{8307,4,0,-1},{8307,5,0,-1}, +{8311,4,0,-1},{8311,5,0,-1},{8315,4,0,-1},{8315,5,0,-1},{8320,4,0,-1}, +{8320,5,0,-1},{8324,4,0,-1},{8324,5,0,-1},{8328,4,0,-1},{8328,5,0,-1}, +{8333,4,0,-1},{8333,5,0,-1},{8337,4,0,-1},{8337,5,0,-1},{8341,4,0,-1}, +{8341,5,0,-1},{8346,4,0,-1},{8346,5,0,-1},{8350,4,0,-1},{8350,5,0,-1}, +{8280,4,0,-1},{8354,4,0,-1},{8354,5,0,-1},{8359,4,0,-1},{8359,5,0,-1}, +{8363,4,0,-1},{8363,5,0,-1},{8293,5,0,-1},{8367,4,0,-1},{8367,5,0,-1}, +{8372,4,0,-1},{8372,5,0,-1},{8376,4,0,-1},{8376,5,0,-1},{8380,4,0,-1}, +{8380,5,0,-1},{8385,4,0,-1},{8385,5,0,-1},{8389,4,0,-1},{8389,5,0,-1}, +{8393,4,0,-1},{8393,5,0,-1},{8398,4,0,-1},{8398,5,0,-1},{8402,4,0,-1}, +{8402,5,0,-1},{8406,4,0,-1},{8406,5,0,-1},{8411,4,0,-1},{8411,5,0,-1}, +{8415,4,0,-1},{8415,5,0,-1},{8419,4,0,-1},{8419,5,0,-1},{8424,4,0,-1}, +{8424,5,0,-1},{8428,4,0,-1},{8428,5,0,-1},{8432,4,0,-1},{8432,5,0,-1}, +{8437,4,0,-1},{8437,5,0,-1},{8441,4,0,-1},{8441,5,0,-1},{8445,4,0,-1}, +{8445,5,0,-1},{8450,4,0,-1},{8450,5,0,-1},{8454,4,0,-1},{8454,5,0,-1}, +{8384,4,0,-1},{8458,4,0,-1},{8458,5,0,-1},{8463,4,0,-1},{8463,5,0,-1}, +{8467,4,0,-1},{8467,5,0,-1},{8397,5,0,-1},{8471,4,0,-1},{8471,5,0,-1}, +{8476,4,0,-1},{8476,5,0,-1},{8480,4,0,-1},{8480,5,0,-1},{8484,4,0,-1}, +{8484,5,0,-1},{8489,4,0,-1},{8489,5,0,-1},{8493,4,0,-1},{8493,5,0,-1}, +{8497,4,0,-1},{8497,5,0,-1},{8502,4,0,-1},{8502,5,0,-1},{8506,4,0,-1}, +{8506,5,0,-1},{8510,4,0,-1},{8510,5,0,-1},{8515,4,0,-1},{8515,5,0,-1}, +{8519,4,0,-1},{8519,5,0,-1},{8523,4,0,-1},{8523,5,0,-1},{8528,4,0,-1}, +{8528,5,0,-1},{8532,4,0,-1},{8532,5,0,-1},{8536,4,0,-1},{8536,5,0,-1}, +{8541,4,0,-1},{8541,5,0,-1},{8545,4,0,-1},{8545,5,0,-1},{8549,4,0,-1}, +{8549,5,0,-1},{8554,4,0,-1},{8554,5,0,-1},{8558,4,0,-1},{8558,5,0,-1}, +{8488,4,0,-1},{8562,4,0,-1},{8562,5,0,-1},{8567,4,0,-1},{8567,5,0,-1}, +{8571,4,0,-1},{8571,5,0,-1},{8501,5,0,-1},{8575,4,0,-1},{8575,5,0,-1}, +{8580,4,0,-1},{8580,5,0,-1},{8584,4,0,-1},{8584,5,0,-1},{8588,4,0,-1}, +{8588,5,0,-1},{8593,4,0,-1},{8593,5,0,-1},{8597,4,0,-1},{8597,5,0,-1}, +{8601,4,0,-1},{8601,5,0,-1},{8606,4,0,-1},{8606,5,0,-1},{8610,4,0,-1}, +{8610,5,0,-1},{8614,4,0,-1},{8614,5,0,-1},{8619,4,0,-1},{8619,5,0,-1}, +{8623,4,0,-1},{8623,5,0,-1},{8627,4,0,-1},{8627,5,0,-1},{8632,4,0,-1}, +{8632,5,0,-1},{8636,4,0,-1},{8636,5,0,-1},{8640,4,0,-1},{8640,5,0,-1}, +{8645,4,0,-1},{8645,5,0,-1},{8649,4,0,-1},{8649,5,0,-1},{8653,4,0,-1}, +{8653,5,0,-1},{8658,4,0,-1},{8658,5,0,-1},{8662,4,0,-1},{8662,5,0,-1}, +{8592,4,0,-1},{8666,4,0,-1},{8666,5,0,-1},{8671,4,0,-1},{8671,5,0,-1}, +{8675,4,0,-1},{8675,5,0,-1},{8605,5,0,-1},{8679,4,0,-1},{8679,5,0,-1}, +{8684,4,0,-1},{8684,5,0,-1},{8688,4,0,-1},{8688,5,0,-1},{8692,4,0,-1}, +{8692,5,0,-1},{8697,4,0,-1},{8697,5,0,-1},{8701,4,0,-1},{8701,5,0,-1}, +{8705,4,0,-1},{8705,5,0,-1},{8710,4,0,-1},{8710,5,0,-1},{8714,4,0,-1}, +{8714,5,0,-1},{8718,4,0,-1},{8718,5,0,-1},{8723,4,0,-1},{8723,5,0,-1}, +{8727,4,0,-1},{8727,5,0,-1},{8731,4,0,-1},{8731,5,0,-1},{8736,4,0,-1}, +{8736,5,0,-1},{8740,4,0,-1},{8740,5,0,-1},{8744,4,0,-1},{8744,5,0,-1}, +{8749,4,0,-1},{8749,5,0,-1},{8753,4,0,-1},{8753,5,0,-1},{8757,4,0,-1}, +{8757,5,0,-1},{8762,4,0,-1},{8762,5,0,-1},{8766,4,0,-1},{8766,5,0,-1}, +{8696,4,0,-1},{8770,4,0,-1},{8770,5,0,-1},{8775,4,0,-1},{8775,5,0,-1}, +{8779,4,0,-1},{8779,5,0,-1},{8709,5,0,-1},{8783,4,0,-1},{8783,5,0,-1}, +{8788,4,0,-1},{8788,5,0,-1},{8792,4,0,-1},{8792,5,0,-1},{8796,4,0,-1}, +{8796,5,0,-1},{8801,4,0,-1},{8801,5,0,-1},{8805,4,0,-1},{8805,5,0,-1}, +{8809,4,0,-1},{8809,5,0,-1},{8814,4,0,-1},{8814,5,0,-1},{8818,4,0,-1}, +{8818,5,0,-1},{8822,4,0,-1},{8822,5,0,-1},{8827,4,0,-1},{8827,5,0,-1}, +{8831,4,0,-1},{8831,5,0,-1},{8835,4,0,-1},{8835,5,0,-1},{8840,4,0,-1}, +{8840,5,0,-1},{8844,4,0,-1},{8844,5,0,-1},{8848,4,0,-1},{8848,5,0,-1}, +{8853,4,0,-1},{8853,5,0,-1},{8857,4,0,-1},{8857,5,0,-1},{8861,4,0,-1}, +{8861,5,0,-1},{8866,4,0,-1},{8866,5,0,-1},{8870,4,0,-1},{8870,5,0,-1}, +{8800,4,0,-1},{8874,4,0,-1},{8874,5,0,-1},{8879,4,0,-1},{8879,5,0,-1}, +{8883,4,0,-1},{8883,5,0,-1},{8813,5,0,-1},{8887,4,0,-1},{8887,5,0,-1}, +{8892,4,0,-1},{8892,5,0,-1},{8896,4,0,-1},{8896,5,0,-1},{8900,4,0,-1}, +{8900,5,0,-1},{8905,4,0,-1},{8905,5,0,-1},{8909,4,0,-1},{8909,5,0,-1}, +{8913,4,0,-1},{8913,5,0,-1},{8918,4,0,-1},{8918,5,0,-1},{8922,4,0,-1}, +{8922,5,0,-1},{8926,4,0,-1},{8926,5,0,-1},{8931,4,0,-1},{8931,5,0,-1}, +{8935,4,0,-1},{8935,5,0,-1},{8939,4,0,-1},{8939,5,0,-1},{8944,4,0,-1}, +{8944,5,0,-1},{8948,4,0,-1},{8948,5,0,-1},{8952,4,0,-1},{8952,5,0,-1}, +{8957,4,0,-1},{8957,5,0,-1},{8961,4,0,-1},{8961,5,0,-1},{8965,4,0,-1}, +{8965,5,0,-1},{8970,4,0,-1},{8970,5,0,-1},{8974,4,0,-1},{8974,5,0,-1}, +{8904,4,0,-1},{8978,4,0,-1},{8978,5,0,-1},{8983,4,0,-1},{8983,5,0,-1}, +{8987,4,0,-1},{8987,5,0,-1},{8917,5,0,-1},{8991,4,0,-1},{8991,5,0,-1}, +{8996,4,0,-1},{8996,5,0,-1},{9000,4,0,-1},{9000,5,0,-1},{9004,4,0,-1}, +{9004,5,0,-1},{9009,4,0,-1},{9009,5,0,-1},{9013,4,0,-1},{9013,5,0,-1}, +{9017,4,0,-1},{9017,5,0,-1},{9022,4,0,-1},{9022,5,0,-1},{9026,4,0,-1}, +{9026,5,0,-1},{9030,4,0,-1},{9030,5,0,-1},{9035,4,0,-1},{9035,5,0,-1}, +{9039,4,0,-1},{9039,5,0,-1},{9043,4,0,-1},{9043,5,0,-1},{9048,4,0,-1}, +{9048,5,0,-1},{9052,4,0,-1},{9052,5,0,-1},{9056,4,0,-1},{9056,5,0,-1}, +{9061,4,0,-1},{9061,5,0,-1},{9065,4,0,-1},{9065,5,0,-1},{9069,4,0,-1}, +{9069,5,0,-1},{9074,4,0,-1},{9074,5,0,-1},{9078,4,0,-1},{9078,5,0,-1}, +{9008,4,0,-1},{9082,4,0,-1},{9082,5,0,-1},{9087,4,0,-1},{9087,5,0,-1}, +{9091,4,0,-1},{9091,5,0,-1},{9021,5,0,-1},{9095,4,0,-1},{9095,5,0,-1}, +{9100,4,0,-1},{9100,5,0,-1},{9104,4,0,-1},{9104,5,0,-1},{9108,4,0,-1}, +{9108,5,0,-1},{9113,4,0,-1},{9113,5,0,-1},{9117,4,0,-1},{9117,5,0,-1}, +{9121,4,0,-1},{9121,5,0,-1},{9126,4,0,-1},{9126,5,0,-1},{9130,4,0,-1}, +{9130,5,0,-1},{9134,4,0,-1},{9134,5,0,-1},{9139,4,0,-1},{9139,5,0,-1}, +{9143,4,0,-1},{9143,5,0,-1},{9147,4,0,-1},{9147,5,0,-1},{9152,4,0,-1}, +{9152,5,0,-1},{9156,4,0,-1},{9156,5,0,-1},{9160,4,0,-1},{9160,5,0,-1}, +{9165,4,0,-1},{9165,5,0,-1},{9169,4,0,-1},{9169,5,0,-1},{9173,4,0,-1}, +{9173,5,0,-1},{9178,4,0,-1},{9178,5,0,-1},{9182,4,0,-1},{9182,5,0,-1}, +{9112,4,0,-1},{9186,4,0,-1},{9186,5,0,-1},{9191,4,0,-1},{9191,5,0,-1}, +{9195,4,0,-1},{9195,5,0,-1},{9125,5,0,-1},{9199,4,0,-1},{9199,5,0,-1}, +{9204,4,0,-1},{9204,5,0,-1},{9208,4,0,-1},{9208,5,0,-1},{9212,4,0,-1}, +{9212,5,0,-1},{9217,4,0,-1},{9217,5,0,-1},{9221,4,0,-1},{9221,5,0,-1}, +{9225,4,0,-1},{9225,5,0,-1},{9230,4,0,-1},{9230,5,0,-1},{9234,4,0,-1}, +{9234,5,0,-1},{9238,4,0,-1},{9238,5,0,-1},{9243,4,0,-1},{9243,5,0,-1}, +{9247,4,0,-1},{9247,5,0,-1},{9251,4,0,-1},{9251,5,0,-1},{9256,4,0,-1}, +{9256,5,0,-1},{9260,4,0,-1},{9260,5,0,-1},{9264,4,0,-1},{9264,5,0,-1}, +{9269,4,0,-1},{9269,5,0,-1},{9273,4,0,-1},{9273,5,0,-1},{9277,4,0,-1}, +{9277,5,0,-1},{9282,4,0,-1},{9282,5,0,-1},{9286,4,0,-1},{9286,5,0,-1}, +{9216,4,0,-1},{9290,4,0,-1},{9290,5,0,-1},{9295,4,0,-1},{9295,5,0,-1}, +{9299,4,0,-1},{9299,5,0,-1},{9229,5,0,-1},{9303,4,0,-1},{9303,5,0,-1}, +{9308,4,0,-1},{9308,5,0,-1},{9312,4,0,-1},{9312,5,0,-1},{9316,4,0,-1}, +{9316,5,0,-1},{9321,4,0,-1},{9321,5,0,-1},{9325,4,0,-1},{9325,5,0,-1}, +{9329,4,0,-1},{9329,5,0,-1},{9334,4,0,-1},{9334,5,0,-1},{9338,4,0,-1}, +{9338,5,0,-1},{9342,4,0,-1},{9342,5,0,-1},{9347,4,0,-1},{9347,5,0,-1}, +{9351,4,0,-1},{9351,5,0,-1},{9355,4,0,-1},{9355,5,0,-1},{9360,4,0,-1}, +{9360,5,0,-1},{9364,4,0,-1},{9364,5,0,-1},{9368,4,0,-1},{9368,5,0,-1}, +{9373,4,0,-1},{9373,5,0,-1},{9377,4,0,-1},{9377,5,0,-1},{9381,4,0,-1}, +{9381,5,0,-1},{9386,4,0,-1},{9386,5,0,-1},{9390,4,0,-1},{9390,5,0,-1}, +{9320,4,0,-1},{9394,4,0,-1},{9394,5,0,-1},{9399,4,0,-1},{9399,5,0,-1}, +{9403,4,0,-1},{9403,5,0,-1},{9333,5,0,-1},{9407,4,0,-1},{9407,5,0,-1}, +{9412,4,0,-1},{9412,5,0,-1},{9416,4,0,-1},{9416,5,0,-1},{9420,4,0,-1}, +{9420,5,0,-1},{9425,4,0,-1},{9425,5,0,-1},{9429,4,0,-1},{9429,5,0,-1}, +{9433,4,0,-1},{9433,5,0,-1},{9438,4,0,-1},{9438,5,0,-1},{9442,4,0,-1}, +{9442,5,0,-1},{9446,4,0,-1},{9446,5,0,-1},{9451,4,0,-1},{9451,5,0,-1}, +{9455,4,0,-1},{9455,5,0,-1},{9459,4,0,-1},{9459,5,0,-1},{9464,4,0,-1}, +{9464,5,0,-1},{9468,4,0,-1},{9468,5,0,-1},{9472,4,0,-1},{9472,5,0,-1}, +{9477,4,0,-1},{9477,5,0,-1},{9481,4,0,-1},{9481,5,0,-1},{9485,4,0,-1}, +{9485,5,0,-1},{9490,4,0,-1},{9490,5,0,-1},{9494,4,0,-1},{9494,5,0,-1}, +{9424,4,0,-1},{9498,4,0,-1},{9498,5,0,-1},{9503,4,0,-1},{9503,5,0,-1}, +{9507,4,0,-1},{9507,5,0,-1},{9437,5,0,-1},{9511,4,0,-1},{9511,5,0,-1}, +{9516,4,0,-1},{9516,5,0,-1},{9520,4,0,-1},{9520,5,0,-1},{9524,4,0,-1}, +{9524,5,0,-1},{9529,4,0,-1},{9529,5,0,-1},{9533,4,0,-1},{9533,5,0,-1}, +{9537,4,0,-1},{9537,5,0,-1},{9542,4,0,-1},{9542,5,0,-1},{9546,4,0,-1}, +{9546,5,0,-1},{9550,4,0,-1},{9550,5,0,-1},{9555,4,0,-1},{9555,5,0,-1}, +{9559,4,0,-1},{9559,5,0,-1},{9563,4,0,-1},{9563,5,0,-1},{9568,4,0,-1}, +{9568,5,0,-1},{9572,4,0,-1},{9572,5,0,-1},{9576,4,0,-1},{9576,5,0,-1}, +{9581,4,0,-1},{9581,5,0,-1},{9585,4,0,-1},{9585,5,0,-1},{9589,4,0,-1}, +{9589,5,0,-1},{9594,4,0,-1},{9594,5,0,-1},{9598,4,0,-1},{9598,5,0,-1}, +{9528,4,0,-1},{9602,4,0,-1},{9602,5,0,-1},{9607,4,0,-1},{9607,5,0,-1}, +{9611,4,0,-1},{9611,5,0,-1},{9541,5,0,-1},{9615,4,0,-1},{9615,5,0,-1}, +{9620,4,0,-1},{9620,5,0,-1},{9624,4,0,-1},{9624,5,0,-1},{9628,4,0,-1}, +{9628,5,0,-1},{9633,4,0,-1},{9633,5,0,-1},{9637,4,0,-1},{9637,5,0,-1}, +{9641,4,0,-1},{9641,5,0,-1},{9646,4,0,-1},{9646,5,0,-1},{9650,4,0,-1}, +{9650,5,0,-1},{9654,4,0,-1},{9654,5,0,-1},{9659,4,0,-1},{9659,5,0,-1}, +{9663,4,0,-1},{9663,5,0,-1},{9667,4,0,-1},{9667,5,0,-1},{9672,4,0,-1}, +{9672,5,0,-1},{9676,4,0,-1},{9676,5,0,-1},{9680,4,0,-1},{9680,5,0,-1}, +{9685,4,0,-1},{9689,4,0,-1},{9689,5,0,-1},{9693,4,0,-1},{9698,4,0,-1}, +{9702,4,0,-1},{9632,4,0,-1},{9706,4,0,-1},{9706,5,0,-1},{9711,4,0,-1}, +{9711,5,0,-1},{9715,4,0,-1},{9715,5,0,-1},{9645,5,0,-1},{9719,4,0,-1}, +{9719,5,0,-1},{9724,4,0,-1},{9724,5,0,-1},{9728,4,0,-1},{9728,5,0,-1}, +{9732,4,0,-1},{9737,4,0,-1},{9741,4,0,-1},{9741,5,0,-1},{9745,4,0,-1}, +{9745,5,0,-1},{9750,4,0,-1},{9754,4,0,-1},{9758,4,0,-1},{9763,4,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS6 and TS7 */ +struct fn_sample test_fn_tch_f_ts_6_7[] = { +{4753,0,1,-1},{4784,0,1,-1},{4835,0,1,-1},{4855,0,1,-1},{4886,0,1,-1}, +{4937,0,1,-1},{4957,0,1,-1},{4988,0,1,-1},{5039,0,1,-1},{5090,0,1,-1}, +{5141,0,1,-1},{5198,0,2,-1},{5208,0,2,-1},{5249,0,2,-1},{5300,0,2,-1}, +{5310,0,2,-1},{5351,0,2,-1},{5402,0,2,-1},{5453,0,2,-1},{5504,0,2,-1}, +{5555,0,2,-1},{8597,6,0,-1},{8627,6,0,-1},{8632,6,0,-1},{8636,6,0,-1}, +{8640,6,0,-1},{8645,6,0,-1},{8649,6,0,-1},{8653,6,0,-1},{8658,6,0,-1}, +{8662,6,0,-1},{8666,6,0,-1},{8671,6,0,-1},{8675,6,0,-1},{8679,6,0,-1}, +{8684,6,0,-1},{8688,6,0,-1},{8618,6,0,-1},{8692,6,0,-1},{8697,6,0,-1}, +{8701,6,0,-1},{8705,6,0,-1},{8710,6,0,-1},{8714,6,0,-1},{8718,6,0,-1}, +{8723,6,0,-1},{8727,6,0,-1},{8731,6,0,-1},{8736,6,0,-1},{8740,6,0,-1}, +{8744,6,0,-1},{8749,6,0,-1},{8753,6,0,-1},{8757,6,0,-1},{8762,6,0,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8775,6,0,-1},{8779,6,0,-1},{8783,6,0,-1}, +{8788,6,0,-1},{8792,6,0,-1},{8722,6,0,-1},{8796,6,0,-1},{8801,6,0,-1}, +{8805,6,0,-1},{8809,6,0,-1},{8814,6,0,-1},{8818,6,0,-1},{8822,6,0,-1}, +{8827,6,0,-1},{8831,6,0,-1},{8835,6,0,-1},{8840,6,0,-1},{8844,6,0,-1}, +{8848,6,0,-1},{8853,6,0,-1},{8857,6,0,-1},{8861,6,0,-1},{8866,6,0,-1}, +{8870,6,0,-1},{8874,6,0,-1},{8874,7,0,-1},{8879,6,0,-1},{8879,7,0,-1}, +{8883,6,0,-1},{8883,7,0,-1},{8887,6,0,-1},{8887,7,0,-1},{8892,6,0,-1}, +{8892,7,0,-1},{8896,6,0,-1},{8896,7,0,-1},{8826,6,0,-1},{8900,6,0,-1}, +{8900,7,0,-1},{8905,6,0,-1},{8905,7,0,-1},{8909,6,0,-1},{8909,7,0,-1}, +{8913,6,0,-1},{8913,7,0,-1},{8918,6,0,-1},{8918,7,0,-1},{8922,6,0,-1}, +{8922,7,0,-1},{8926,6,0,-1},{8926,7,0,-1},{8931,6,0,-1},{8931,7,0,-1}, +{8935,6,0,-1},{8935,7,0,-1},{8939,6,0,-1},{8939,7,0,-1},{8944,6,0,-1}, +{8944,7,0,-1},{8948,6,0,-1},{8948,7,0,-1},{8952,6,0,-1},{8952,7,0,-1}, +{8957,6,0,-1},{8957,7,0,-1},{8961,6,0,-1},{8961,7,0,-1},{8965,6,0,-1}, +{8965,7,0,-1},{8970,6,0,-1},{8970,7,0,-1},{8974,6,0,-1},{8974,7,0,-1}, +{8978,6,0,-1},{8978,7,0,-1},{8983,6,0,-1},{8983,7,0,-1},{8987,6,0,-1}, +{8987,7,0,-1},{8991,6,0,-1},{8991,7,0,-1},{8996,6,0,-1},{8996,7,0,-1}, +{9000,6,0,-1},{9000,7,0,-1},{8930,6,0,-1},{9004,6,0,-1},{9004,7,0,-1}, +{9009,6,0,-1},{9009,7,0,-1},{9013,6,0,-1},{9013,7,0,-1},{8943,7,0,-1}, +{9017,6,0,-1},{9017,7,0,-1},{9022,6,0,-1},{9022,7,0,-1},{9026,6,0,-1}, +{9026,7,0,-1},{9030,6,0,-1},{9030,7,0,-1},{9035,6,0,-1},{9035,7,0,-1}, +{9039,6,0,-1},{9039,7,0,-1},{9043,6,0,-1},{9043,7,0,-1},{9048,6,0,-1}, +{9048,7,0,-1},{9052,6,0,-1},{9052,7,0,-1},{9056,6,0,-1},{9056,7,0,-1}, +{9061,6,0,-1},{9061,7,0,-1},{9065,6,0,-1},{9065,7,0,-1},{9069,6,0,-1}, +{9069,7,0,-1},{9074,6,0,-1},{9074,7,0,-1},{9078,6,0,-1},{9078,7,0,-1}, +{9082,6,0,-1},{9082,7,0,-1},{9087,6,0,-1},{9087,7,0,-1},{9091,6,0,-1}, +{9091,7,0,-1},{9095,6,0,-1},{9095,7,0,-1},{9100,6,0,-1},{9100,7,0,-1}, +{9104,6,0,-1},{9104,7,0,-1},{9034,6,0,-1},{9108,6,0,-1},{9108,7,0,-1}, +{9113,6,0,-1},{9113,7,0,-1},{9117,6,0,-1},{9117,7,0,-1},{9047,7,0,-1}, +{9121,6,0,-1},{9121,7,0,-1},{9126,6,0,-1},{9126,7,0,-1},{9130,6,0,-1}, +{9130,7,0,-1},{9134,6,0,-1},{9134,7,0,-1},{9139,6,0,-1},{9139,7,0,-1}, +{9143,6,0,-1},{9143,7,0,-1},{9147,6,0,-1},{9147,7,0,-1},{9152,6,0,-1}, +{9152,7,0,-1},{9156,6,0,-1},{9156,7,0,-1},{9160,6,0,-1},{9160,7,0,-1}, +{9165,6,0,-1},{9165,7,0,-1},{9169,6,0,-1},{9169,7,0,-1},{9173,6,0,-1}, +{9173,7,0,-1},{9178,6,0,-1},{9178,7,0,-1},{9182,6,0,-1},{9182,7,0,-1}, +{9186,6,0,-1},{9186,7,0,-1},{9191,6,0,-1},{9191,7,0,-1},{9195,6,0,-1}, +{9195,7,0,-1},{9199,6,0,-1},{9199,7,0,-1},{9204,6,0,-1},{9204,7,0,-1}, +{9208,6,0,-1},{9208,7,0,-1},{9138,6,0,-1},{9212,6,0,-1},{9212,7,0,-1}, +{9217,6,0,-1},{9217,7,0,-1},{9221,6,0,-1},{9221,7,0,-1},{9151,7,0,-1}, +{9225,6,0,-1},{9225,7,0,-1},{9230,6,0,-1},{9230,7,0,-1},{9234,6,0,-1}, +{9234,7,0,-1},{9238,6,0,-1},{9238,7,0,-1},{9243,6,0,-1},{9243,7,0,-1}, +{9247,6,0,-1},{9247,7,0,-1},{9251,6,0,-1},{9251,7,0,-1},{9256,6,0,-1}, +{9256,7,0,-1},{9260,6,0,-1},{9260,7,0,-1},{9264,6,0,-1},{9264,7,0,-1}, +{9269,6,0,-1},{9269,7,0,-1},{9273,6,0,-1},{9273,7,0,-1},{9277,6,0,-1}, +{9277,7,0,-1},{9282,6,0,-1},{9282,7,0,-1},{9286,6,0,-1},{9286,7,0,-1}, +{9290,6,0,-1},{9290,7,0,-1},{9295,6,0,-1},{9295,7,0,-1},{9299,6,0,-1}, +{9299,7,0,-1},{9303,6,0,-1},{9303,7,0,-1},{9308,6,0,-1},{9308,7,0,-1}, +{9312,6,0,-1},{9312,7,0,-1},{9242,6,0,-1},{9316,6,0,-1},{9316,7,0,-1}, +{9321,6,0,-1},{9321,7,0,-1},{9325,6,0,-1},{9325,7,0,-1},{9255,7,0,-1}, +{9329,6,0,-1},{9329,7,0,-1},{9334,6,0,-1},{9334,7,0,-1},{9338,6,0,-1}, +{9338,7,0,-1},{9342,6,0,-1},{9342,7,0,-1},{9347,6,0,-1},{9347,7,0,-1}, +{9351,6,0,-1},{9351,7,0,-1},{9355,6,0,-1},{9355,7,0,-1},{9360,6,0,-1}, +{9360,7,0,-1},{9364,6,0,-1},{9364,7,0,-1},{9368,6,0,-1},{9368,7,0,-1}, +{9373,6,0,-1},{9373,7,0,-1},{9377,6,0,-1},{9377,7,0,-1},{9381,6,0,-1}, +{9381,7,0,-1},{9386,6,0,-1},{9386,7,0,-1},{9390,6,0,-1},{9390,7,0,-1}, +{9394,6,0,-1},{9394,7,0,-1},{9399,6,0,-1},{9399,7,0,-1},{9403,6,0,-1}, +{9403,7,0,-1},{9407,6,0,-1},{9407,7,0,-1},{9412,6,0,-1},{9412,7,0,-1}, +{9416,6,0,-1},{9416,7,0,-1},{9346,6,0,-1},{9420,6,0,-1},{9420,7,0,-1}, +{9425,6,0,-1},{9425,7,0,-1},{9429,6,0,-1},{9429,7,0,-1},{9359,7,0,-1}, +{9433,6,0,-1},{9433,7,0,-1},{9438,6,0,-1},{9438,7,0,-1},{9442,6,0,-1}, +{9442,7,0,-1},{9446,6,0,-1},{9446,7,0,-1},{9451,6,0,-1},{9451,7,0,-1}, +{9455,6,0,-1},{9455,7,0,-1},{9459,6,0,-1},{9459,7,0,-1},{9464,6,0,-1}, +{9464,7,0,-1},{9468,6,0,-1},{9468,7,0,-1},{9472,6,0,-1},{9472,7,0,-1}, +{9477,6,0,-1},{9477,7,0,-1},{9481,6,0,-1},{9481,7,0,-1},{9485,6,0,-1}, +{9485,7,0,-1},{9490,6,0,-1},{9490,7,0,-1},{9494,6,0,-1},{9494,7,0,-1}, +{9498,6,0,-1},{9498,7,0,-1},{9503,6,0,-1},{9503,7,0,-1},{9507,6,0,-1}, +{9507,7,0,-1},{9511,6,0,-1},{9511,7,0,-1},{9516,6,0,-1},{9516,7,0,-1}, +{9520,6,0,-1},{9520,7,0,-1},{9450,6,0,-1},{9524,6,0,-1},{9524,7,0,-1}, +{9529,6,0,-1},{9529,7,0,-1},{9533,6,0,-1},{9533,7,0,-1},{9463,7,0,-1}, +{9537,6,0,-1},{9537,7,0,-1},{9542,6,0,-1},{9542,7,0,-1},{9546,6,0,-1}, +{9546,7,0,-1},{9550,6,0,-1},{9550,7,0,-1},{9555,6,0,-1},{9555,7,0,-1}, +{9559,6,0,-1},{9559,7,0,-1},{9563,6,0,-1},{9563,7,0,-1},{9568,6,0,-1}, +{9568,7,0,-1},{9572,6,0,-1},{9572,7,0,-1},{9576,6,0,-1},{9576,7,0,-1}, +{9581,6,0,-1},{9581,7,0,-1},{9585,6,0,-1},{9585,7,0,-1},{9589,6,0,-1}, +{9589,7,0,-1},{9594,6,0,-1},{9594,7,0,-1},{9598,6,0,-1},{9598,7,0,-1}, +{9602,6,0,-1},{9602,7,0,-1},{9607,6,0,-1},{9607,7,0,-1},{9611,6,0,-1}, +{9611,7,0,-1},{9615,6,0,-1},{9615,7,0,-1},{9620,6,0,-1},{9620,7,0,-1}, +{9624,6,0,-1},{9624,7,0,-1},{9554,6,0,-1},{9628,6,0,-1},{9628,7,0,-1}, +{9633,6,0,-1},{9633,7,0,-1},{9637,6,0,-1},{9637,7,0,-1},{9567,7,0,-1}, +{9641,6,0,-1},{9641,7,0,-1},{9646,6,0,-1},{9646,7,0,-1},{9650,6,0,-1}, +{9650,7,0,-1},{9654,6,0,-1},{9654,7,0,-1},{9659,6,0,-1},{9659,7,0,-1}, +{9663,6,0,-1},{9663,7,0,-1},{9667,6,0,-1},{9667,7,0,-1},{9672,6,0,-1}, +{9672,7,0,-1},{9676,6,0,-1},{9676,7,0,-1},{9680,6,0,-1},{9680,7,0,-1}, +{9685,6,0,-1},{9685,7,0,-1},{9689,6,0,-1},{9689,7,0,-1},{9693,6,0,-1}, +{9693,7,0,-1},{9698,6,0,-1},{9698,7,0,-1},{9702,6,0,-1},{9702,7,0,-1}, +{9706,6,0,-1},{9706,7,0,-1},{9711,6,0,-1},{9711,7,0,-1},{9715,6,0,-1}, +{9715,7,0,-1},{9719,6,0,-1},{9719,7,0,-1},{9724,6,0,-1},{9724,7,0,-1}, +{9728,6,0,-1},{9728,7,0,-1},{9658,6,0,-1},{9732,6,0,-1},{9732,7,0,-1}, +{9737,6,0,-1},{9737,7,0,-1},{9741,6,0,-1},{9741,7,0,-1},{9671,7,0,-1}, +{9745,6,0,-1},{9745,7,0,-1},{9750,6,0,-1},{9750,7,0,-1},{9754,6,0,-1}, +{9754,7,0,-1},{9758,6,0,-1},{9758,7,0,-1},{9763,6,0,-1},{9763,7,0,-1}, +{9767,6,0,-1},{9767,7,0,-1},{9771,6,0,-1},{9771,7,0,-1},{9776,6,0,-1}, +{9776,7,0,-1},{9780,6,0,-1},{9780,7,0,-1},{9784,6,0,-1},{9784,7,0,-1}, +{9789,6,0,-1},{9789,7,0,-1},{9793,6,0,-1},{9793,7,0,-1},{9797,6,0,-1}, +{9797,7,0,-1},{9802,6,0,-1},{9802,7,0,-1},{9806,6,0,-1},{9806,7,0,-1}, +{9810,6,0,-1},{9810,7,0,-1},{9815,6,0,-1},{9815,7,0,-1},{9819,6,0,-1}, +{9819,7,0,-1},{9823,6,0,-1},{9823,7,0,-1},{9828,6,0,-1},{9828,7,0,-1}, +{9832,6,0,-1},{9832,7,0,-1},{9762,6,0,-1},{9836,6,0,-1},{9836,7,0,-1}, +{9841,6,0,-1},{9841,7,0,-1},{9845,6,0,-1},{9845,7,0,-1},{9775,7,0,-1}, +{9849,6,0,-1},{9849,7,0,-1},{9854,6,0,-1},{9854,7,0,-1},{9858,6,0,-1}, +{9858,7,0,-1},{9862,6,0,-1},{9862,7,0,-1},{9867,6,0,-1},{9867,7,0,-1}, +{9871,6,0,-1},{9871,7,0,-1},{9875,6,0,-1},{9875,7,0,-1},{9880,6,0,-1}, +{9880,7,0,-1},{9884,6,0,-1},{9884,7,0,-1},{9888,6,0,-1},{9888,7,0,-1}, +{9893,6,0,-1},{9893,7,0,-1},{9897,6,0,-1},{9897,7,0,-1},{9901,6,0,-1}, +{9901,7,0,-1},{9906,6,0,-1},{9906,7,0,-1},{9910,6,0,-1},{9910,7,0,-1}, +{9914,6,0,-1},{9914,7,0,-1},{9919,6,0,-1},{9919,7,0,-1},{9923,6,0,-1}, +{9923,7,0,-1},{9927,6,0,-1},{9927,7,0,-1},{9932,6,0,-1},{9932,7,0,-1}, +{9936,6,0,-1},{9936,7,0,-1},{9866,6,0,-1},{9940,6,0,-1},{9940,7,0,-1}, +{9945,6,0,-1},{9945,7,0,-1},{9949,6,0,-1},{9949,7,0,-1},{9879,7,0,-1}, +{9953,6,0,-1},{9953,7,0,-1},{9958,6,0,-1},{9958,7,0,-1},{9962,6,0,-1}, +{9962,7,0,-1},{9966,6,0,-1},{9966,7,0,-1},{9971,6,0,-1},{9971,7,0,-1}, +{9975,6,0,-1},{9975,7,0,-1},{9979,6,0,-1},{9979,7,0,-1},{9984,6,0,-1}, +{9984,7,0,-1},{9988,6,0,-1},{9988,7,0,-1},{9992,6,0,-1},{9992,7,0,-1}, +{9997,6,0,-1},{9997,7,0,-1},{10001,6,0,-1},{10001,7,0,-1},{10005,6,0,-1}, +{10005,7,0,-1},{10010,6,0,-1},{10010,7,0,-1},{10014,6,0,-1},{10014,7,0,-1}, +{10018,6,0,-1},{10018,7,0,-1},{10023,6,0,-1},{10023,7,0,-1},{10027,6,0,-1}, +{10027,7,0,-1},{10031,6,0,-1},{10031,7,0,-1},{10036,6,0,-1},{10036,7,0,-1}, +{10040,6,0,-1},{10040,7,0,-1},{9970,6,0,-1},{10044,6,0,-1},{10044,7,0,-1}, +{10049,6,0,-1},{10049,7,0,-1},{10053,6,0,-1},{10053,7,0,-1},{9983,7,0,-1}, +{10057,6,0,-1},{10057,7,0,-1},{10062,6,0,-1},{10062,7,0,-1},{10066,6,0,-1}, +{10066,7,0,-1},{10070,6,0,-1},{10070,7,0,-1},{10075,6,0,-1},{10075,7,0,-1}, +{10079,6,0,-1},{10079,7,0,-1},{10083,6,0,-1},{10083,7,0,-1},{10088,6,0,-1}, +{10088,7,0,-1},{10092,6,0,-1},{10092,7,0,-1},{10096,6,0,-1},{10096,7,0,-1}, +{10101,6,0,-1},{10101,7,0,-1},{10105,6,0,-1},{10105,7,0,-1},{10109,6,0,-1}, +{10109,7,0,-1},{10114,6,0,-1},{10114,7,0,-1},{10118,6,0,-1},{10118,7,0,-1}, +{10122,6,0,-1},{10122,7,0,-1},{10127,6,0,-1},{10127,7,0,-1},{10131,6,0,-1}, +{10131,7,0,-1},{10135,6,0,-1},{10135,7,0,-1},{10140,6,0,-1},{10140,7,0,-1}, +{10144,6,0,-1},{10144,7,0,-1},{10074,6,0,-1},{10148,6,0,-1},{10148,7,0,-1}, +{10153,6,0,-1},{10153,7,0,-1},{10157,6,0,-1},{10157,7,0,-1},{10087,7,0,-1}, +{10161,6,0,-1},{10161,7,0,-1},{10166,6,0,-1},{10166,7,0,-1},{10170,6,0,-1}, +{10170,7,0,-1},{10174,6,0,-1},{10174,7,0,-1},{10179,6,0,-1},{10179,7,0,-1}, +{10183,6,0,-1},{10183,7,0,-1},{10187,6,0,-1},{10187,7,0,-1},{10192,6,0,-1}, +{10192,7,0,-1},{10196,6,0,-1},{10196,7,0,-1},{10200,6,0,-1},{10200,7,0,-1}, +{10205,6,0,-1},{10205,7,0,-1},{10209,6,0,-1},{10209,7,0,-1},{10213,6,0,-1}, +{10213,7,0,-1},{10218,6,0,-1},{10218,7,0,-1},{10222,6,0,-1},{10222,7,0,-1}, +{10226,6,0,-1},{10226,7,0,-1},{10231,6,0,-1},{10231,7,0,-1},{10235,6,0,-1}, +{10235,7,0,-1},{10239,6,0,-1},{10239,7,0,-1},{10244,6,0,-1},{10244,7,0,-1}, +{10248,6,0,-1},{10248,7,0,-1},{10178,6,0,-1},{10252,6,0,-1},{10252,7,0,-1}, +{10257,6,0,-1},{10257,7,0,-1},{10261,6,0,-1},{10261,7,0,-1},{10191,7,0,-1}, +{10265,6,0,-1},{10265,7,0,-1},{10270,6,0,-1},{10270,7,0,-1},{10274,6,0,-1}, +{10274,7,0,-1},{10278,6,0,-1},{10278,7,0,-1},{10283,6,0,-1},{10283,7,0,-1}, +{10287,6,0,-1},{10287,7,0,-1},{10291,6,0,-1},{10291,7,0,-1},{10296,6,0,-1}, +{10296,7,0,-1},{10300,6,0,-1},{10300,7,0,-1},{10304,6,0,-1},{10304,7,0,-1}, +{10309,6,0,-1},{10309,7,0,-1},{10313,6,0,-1},{10313,7,0,-1},{10317,6,0,-1}, +{10317,7,0,-1},{10322,6,0,-1},{10322,7,0,-1},{10326,6,0,-1},{10326,7,0,-1}, +{10330,6,0,-1},{10330,7,0,-1},{10335,6,0,-1},{10335,7,0,-1},{10339,6,0,-1}, +{10339,7,0,-1},{10343,6,0,-1},{10343,7,0,-1},{10348,6,0,-1},{10348,7,0,-1}, +{10352,6,0,-1},{10352,7,0,-1},{10282,6,0,-1},{10356,6,0,-1},{10356,7,0,-1}, +{10361,6,0,-1},{10361,7,0,-1},{10365,6,0,-1},{10365,7,0,-1},{10295,7,0,-1}, +{10369,6,0,-1},{10369,7,0,-1},{10374,6,0,-1},{10374,7,0,-1},{10378,6,0,-1}, +{10378,7,0,-1},{10382,6,0,-1},{10382,7,0,-1},{10387,6,0,-1},{10387,7,0,-1}, +{10391,6,0,-1},{10391,7,0,-1},{10395,6,0,-1},{10395,7,0,-1},{10400,6,0,-1}, +{10400,7,0,-1},{10404,6,0,-1},{10404,7,0,-1},{10408,6,0,-1},{10408,7,0,-1}, +{10413,6,0,-1},{10413,7,0,-1},{10417,6,0,-1},{10417,7,0,-1},{10421,6,0,-1}, +{10421,7,0,-1},{10426,6,0,-1},{10426,7,0,-1},{10430,6,0,-1},{10430,7,0,-1}, +{10434,6,0,-1},{10434,7,0,-1},{10439,6,0,-1},{10439,7,0,-1},{10443,6,0,-1}, +{10443,7,0,-1},{10447,6,0,-1},{10447,7,0,-1},{10452,6,0,-1},{10452,7,0,-1}, +{10456,6,0,-1},{10456,7,0,-1},{10386,6,0,-1},{10460,6,0,-1},{10460,7,0,-1}, +{10465,6,0,-1},{10465,7,0,-1},{10469,6,0,-1},{10469,7,0,-1},{10399,7,0,-1}, +{10473,6,0,-1},{10473,7,0,-1},{10478,6,0,-1},{10478,7,0,-1},{10482,6,0,-1}, +{10482,7,0,-1},{10486,6,0,-1},{10486,7,0,-1},{10491,6,0,-1},{10491,7,0,-1}, +{10495,6,0,-1},{10495,7,0,-1},{10499,6,0,-1},{10499,7,0,-1},{10504,6,0,-1}, +{10504,7,0,-1},{10508,6,0,-1},{10508,7,0,-1},{10512,6,0,-1},{10512,7,0,-1}, +{10517,6,0,-1},{10517,7,0,-1},{10521,6,0,-1},{10521,7,0,-1},{10525,6,0,-1}, +{10525,7,0,-1},{10530,6,0,-1},{10530,7,0,-1},{10534,6,0,-1},{10534,7,0,-1}, +{10538,6,0,-1},{10538,7,0,-1},{10543,6,0,-1},{10543,7,0,-1},{10547,6,0,-1}, +{10547,7,0,-1},{10551,6,0,-1},{10551,7,0,-1},{10556,6,0,-1},{10556,7,0,-1}, +{10560,6,0,-1},{10560,7,0,-1},{10490,6,0,-1},{10564,6,0,-1},{10564,7,0,-1}, +{10569,6,0,-1},{10569,7,0,-1},{10573,6,0,-1},{10573,7,0,-1},{10503,7,0,-1}, +{10577,6,0,-1},{10577,7,0,-1},{10582,6,0,-1},{10582,7,0,-1},{10586,6,0,-1}, +{10586,7,0,-1},{10590,6,0,-1},{10590,7,0,-1},{10595,6,0,-1},{10595,7,0,-1}, +{10599,6,0,-1},{10599,7,0,-1},{10603,6,0,-1},{10603,7,0,-1},{10608,6,0,-1}, +{10608,7,0,-1},{10612,6,0,-1},{10612,7,0,-1},{10616,6,0,-1},{10616,7,0,-1}, +{10621,6,0,-1},{10621,7,0,-1},{10625,6,0,-1},{10625,7,0,-1},{10629,6,0,-1}, +{10629,7,0,-1},{10634,6,0,-1},{10634,7,0,-1},{10638,6,0,-1},{10638,7,0,-1}, +{10642,6,0,-1},{10642,7,0,-1},{10647,6,0,-1},{10647,7,0,-1},{10651,6,0,-1}, +{10651,7,0,-1},{10655,6,0,-1},{10655,7,0,-1},{10660,6,0,-1},{10660,7,0,-1}, +{10664,6,0,-1},{10664,7,0,-1},{10594,6,0,-1},{10668,6,0,-1},{10668,7,0,-1}, +{10673,6,0,-1},{10673,7,0,-1},{10677,6,0,-1},{10677,7,0,-1},{10607,7,0,-1}, +{10681,6,0,-1},{10681,7,0,-1},{10686,6,0,-1},{10686,7,0,-1},{10690,6,0,-1}, +{10690,7,0,-1},{10694,6,0,-1},{10694,7,0,-1},{10699,6,0,-1},{10699,7,0,-1}, +{10703,6,0,-1},{10703,7,0,-1},{10707,6,0,-1},{10707,7,0,-1},{10712,6,0,-1}, +{10712,7,0,-1},{10716,6,0,-1},{10716,7,0,-1},{10720,6,0,-1},{10720,7,0,-1}, +{10725,6,0,-1},{10725,7,0,-1},{10729,6,0,-1},{10729,7,0,-1},{10733,6,0,-1}, +{10733,7,0,-1},{10738,6,0,-1},{10738,7,0,-1},{10742,6,0,-1},{10742,7,0,-1}, +{10746,6,0,-1},{10746,7,0,-1},{10751,6,0,-1},{10751,7,0,-1},{10755,6,0,-1}, +{10755,7,0,-1},{10759,6,0,-1},{10759,7,0,-1},{10764,6,0,-1},{10764,7,0,-1}, +{10768,6,0,-1},{10768,7,0,-1},{10698,6,0,-1},{10772,6,0,-1},{10772,7,0,-1}, +{10777,6,0,-1},{10777,7,0,-1},{10781,6,0,-1},{10781,7,0,-1},{10711,7,0,-1}, +{10785,6,0,-1},{10785,7,0,-1},{10790,6,0,-1},{10790,7,0,-1},{10794,6,0,-1}, +{10794,7,0,-1},{10798,6,0,-1},{10798,7,0,-1},{10803,6,0,-1},{10803,7,0,-1}, +{10807,6,0,-1},{10807,7,0,-1},{10811,6,0,-1},{10811,7,0,-1},{10816,6,0,-1}, +{10816,7,0,-1},{10820,6,0,-1},{10820,7,0,-1},{10824,6,0,-1},{10824,7,0,-1}, +{10829,6,0,-1},{10829,7,0,-1},{10833,6,0,-1},{10833,7,0,-1},{10837,6,0,-1}, +{10837,7,0,-1},{10842,6,0,-1},{10842,7,0,-1},{10846,6,0,-1},{10846,7,0,-1}, +{10850,6,0,-1},{10850,7,0,-1},{10855,6,0,-1},{10855,7,0,-1},{10859,6,0,-1}, +{10859,7,0,-1},{10863,6,0,-1},{10863,7,0,-1},{10868,6,0,-1},{10868,7,0,-1}, +{10872,6,0,-1},{10872,7,0,-1},{10802,6,0,-1},{10876,6,0,-1},{10876,7,0,-1}, +{10881,6,0,-1},{10881,7,0,-1},{10885,6,0,-1},{10885,7,0,-1},{10815,7,0,-1}, +{10889,6,0,-1},{10889,7,0,-1},{10894,6,0,-1},{10894,7,0,-1},{10898,6,0,-1}, +{10898,7,0,-1},{10902,6,0,-1},{10902,7,0,-1},{10907,6,0,-1},{10907,7,0,-1}, +{10911,6,0,-1},{10911,7,0,-1},{10915,6,0,-1},{10915,7,0,-1},{10920,6,0,-1}, +{10920,7,0,-1},{10924,6,0,-1},{10924,7,0,-1},{10928,6,0,-1},{10928,7,0,-1}, +{10933,6,0,-1},{10933,7,0,-1},{10937,6,0,-1},{10937,7,0,-1},{10941,6,0,-1}, +{10941,7,0,-1},{10946,6,0,-1},{10946,7,0,-1},{10950,6,0,-1},{10950,7,0,-1}, +{10954,6,0,-1},{10954,7,0,-1},{10959,6,0,-1},{10959,7,0,-1},{10963,6,0,-1}, +{10963,7,0,-1},{10967,6,0,-1},{10967,7,0,-1},{10972,6,0,-1},{10972,7,0,-1}, +{10976,6,0,-1},{10976,7,0,-1},{10906,6,0,-1},{10980,6,0,-1},{10980,7,0,-1}, +{10985,6,0,-1},{10985,7,0,-1},{10989,6,0,-1},{10989,7,0,-1},{10919,7,0,-1}, +{10993,6,0,-1},{10993,7,0,-1},{10998,6,0,-1},{10998,7,0,-1},{11002,6,0,-1}, +{11002,7,0,-1},{11006,6,0,-1},{11006,7,0,-1},{11011,6,0,-1},{11011,7,0,-1}, +{11015,6,0,-1},{11015,7,0,-1},{11019,6,0,-1},{11019,7,0,-1},{11024,6,0,-1}, +{11024,7,0,-1},{11028,6,0,-1},{11028,7,0,-1},{11032,6,0,-1},{11032,7,0,-1}, +{11037,6,0,-1},{11037,7,0,-1},{11041,6,0,-1},{11041,7,0,-1},{11045,6,0,-1}, +{11045,7,0,-1},{11050,6,0,-1},{11050,7,0,-1},{11054,6,0,-1},{11054,7,0,-1}, +{11058,6,0,-1},{11058,7,0,-1},{11063,6,0,-1},{11063,7,0,-1},{11067,6,0,-1}, +{11067,7,0,-1},{11071,6,0,-1},{11071,7,0,-1},{11076,6,0,-1},{11076,7,0,-1}, +{11080,6,0,-1},{11080,7,0,-1},{11010,6,0,-1},{11084,6,0,-1},{11084,7,0,-1}, +{11089,6,0,-1},{11089,7,0,-1},{11093,6,0,-1},{11093,7,0,-1},{11023,7,0,-1}, +{11097,6,0,-1},{11097,7,0,-1},{11102,6,0,-1},{11102,7,0,-1},{11106,6,0,-1}, +{11106,7,0,-1},{11110,6,0,-1},{11110,7,0,-1},{11115,6,0,-1},{11115,7,0,-1}, +{11119,6,0,-1},{11119,7,0,-1},{11123,6,0,-1},{11123,7,0,-1},{11128,6,0,-1}, +{11128,7,0,-1},{11132,6,0,-1},{11132,7,0,-1},{11136,6,0,-1},{11136,7,0,-1}, +{11141,6,0,-1},{11141,7,0,-1},{11145,6,0,-1},{11145,7,0,-1},{11149,6,0,-1}, +{11149,7,0,-1},{11154,6,0,-1},{11154,7,0,-1},{11158,6,0,-1},{11158,7,0,-1}, +{11162,6,0,-1},{11162,7,0,-1},{11167,6,0,-1},{11167,7,0,-1},{11171,6,0,-1}, +{11171,7,0,-1},{11175,6,0,-1},{11175,7,0,-1},{11180,6,0,-1},{11180,7,0,-1}, +{11184,6,0,-1},{11184,7,0,-1},{11114,6,0,-1},{11188,6,0,-1},{11188,7,0,-1}, +{11193,6,0,-1},{11193,7,0,-1},{11197,6,0,-1},{11197,7,0,-1},{11127,7,0,-1}, +{11201,6,0,-1},{11201,7,0,-1},{11206,6,0,-1},{11206,7,0,-1},{11210,6,0,-1}, +{11210,7,0,-1},{11214,6,0,-1},{11214,7,0,-1},{11219,6,0,-1},{11219,7,0,-1}, +{11223,6,0,-1},{11223,7,0,-1},{11227,6,0,-1},{11227,7,0,-1},{11232,6,0,-1}, +{11232,7,0,-1},{11236,6,0,-1},{11236,7,0,-1},{11240,6,0,-1},{11240,7,0,-1}, +{11245,6,0,-1},{11245,7,0,-1},{11249,6,0,-1},{11249,7,0,-1},{11253,6,0,-1}, +{11253,7,0,-1},{11258,6,0,-1},{11258,7,0,-1},{11262,6,0,-1},{11262,7,0,-1}, +{11266,6,0,-1},{11266,7,0,-1},{11271,6,0,-1},{11271,7,0,-1},{11275,6,0,-1}, +{11275,7,0,-1},{11279,6,0,-1},{11279,7,0,-1},{11284,6,0,-1},{11284,7,0,-1}, +{11288,6,0,-1},{11288,7,0,-1},{11218,6,0,-1},{11292,6,0,-1},{11292,7,0,-1}, +{11297,6,0,-1},{11297,7,0,-1},{11301,6,0,-1},{11301,7,0,-1},{11231,7,0,-1}, +{11305,6,0,-1},{11305,7,0,-1},{11310,6,0,-1},{11310,7,0,-1},{11314,6,0,-1}, +{11314,7,0,-1},{11318,6,0,-1},{11318,7,0,-1},{11323,6,0,-1},{11323,7,0,-1}, +{11327,6,0,-1},{11327,7,0,-1},{11331,6,0,-1},{11331,7,0,-1},{11336,6,0,-1}, +{11336,7,0,-1},{11340,6,0,-1},{11340,7,0,-1},{11344,6,0,-1},{11344,7,0,-1}, +{11349,6,0,-1},{11349,7,0,-1},{11353,6,0,-1},{11353,7,0,-1},{11357,6,0,-1}, +{11357,7,0,-1},{11362,6,0,-1},{11362,7,0,-1},{11366,6,0,-1},{11366,7,0,-1}, +{11370,6,0,-1},{11370,7,0,-1},{11375,6,0,-1},{11375,7,0,-1},{11379,6,0,-1}, +{11379,7,0,-1},{11383,6,0,-1},{11383,7,0,-1},{11388,6,0,-1},{11388,7,0,-1}, +{11392,6,0,-1},{11392,7,0,-1},{11322,6,0,-1},{11396,6,0,-1},{11396,7,0,-1}, +{11401,6,0,-1},{11401,7,0,-1},{11405,6,0,-1},{11405,7,0,-1},{11335,7,0,-1}, +{11409,6,0,-1},{11409,7,0,-1},{11414,6,0,-1},{11414,7,0,-1},{11418,6,0,-1}, +{11418,7,0,-1},{11422,6,0,-1},{11422,7,0,-1},{11427,6,0,-1},{11427,7,0,-1}, +{11431,6,0,-1},{11431,7,0,-1},{11435,6,0,-1},{11435,7,0,-1},{11440,6,0,-1}, +{11440,7,0,-1},{11444,6,0,-1},{11444,7,0,-1},{11448,6,0,-1},{11448,7,0,-1}, +{11453,6,0,-1},{11453,7,0,-1},{11457,6,0,-1},{11457,7,0,-1},{11461,6,0,-1}, +{11461,7,0,-1},{11466,6,0,-1},{11466,7,0,-1},{11470,6,0,-1},{11470,7,0,-1}, +{11474,6,0,-1},{11474,7,0,-1},{11479,6,0,-1},{11479,7,0,-1},{11483,6,0,-1}, +{11483,7,0,-1},{11487,6,0,-1},{11487,7,0,-1},{11492,6,0,-1},{11492,7,0,-1}, +{11496,6,0,-1},{11496,7,0,-1},{11426,6,0,-1},{11500,6,0,-1},{11500,7,0,-1}, +{11505,6,0,-1},{11505,7,0,-1},{11509,6,0,-1},{11509,7,0,-1},{11439,7,0,-1}, +{11513,6,0,-1},{11513,7,0,-1},{11518,6,0,-1},{11518,7,0,-1},{11522,6,0,-1}, +{11522,7,0,-1},{11526,6,0,-1},{11526,7,0,-1},{11531,6,0,-1},{11531,7,0,-1}, +{11535,6,0,-1},{11535,7,0,-1},{11539,6,0,-1},{11539,7,0,-1},{11544,6,0,-1}, +{11544,7,0,-1},{11548,6,0,-1},{11548,7,0,-1},{11552,6,0,-1},{11552,7,0,-1}, +{11557,6,0,-1},{11557,7,0,-1},{11561,6,0,-1},{11561,7,0,-1},{11565,6,0,-1}, +{11565,7,0,-1},{11570,6,0,-1},{11570,7,0,-1},{11574,6,0,-1},{11574,7,0,-1}, +{11578,6,0,-1},{11578,7,0,-1},{11583,6,0,-1},{11583,7,0,-1},{11587,6,0,-1}, +{11587,7,0,-1},{11591,6,0,-1},{11591,7,0,-1},{11596,6,0,-1},{11596,7,0,-1}, +{11600,6,0,-1},{11600,7,0,-1},{11530,6,0,-1},{11604,6,0,-1},{11604,7,0,-1}, +{11609,6,0,-1},{11609,7,0,-1},{11613,6,0,-1},{11613,7,0,-1},{11543,7,0,-1}, +{11617,6,0,-1},{11617,7,0,-1},{11622,6,0,-1},{11622,7,0,-1},{11626,6,0,-1}, +{11626,7,0,-1},{11630,6,0,-1},{11630,7,0,-1},{11635,6,0,-1},{11635,7,0,-1}, +{11639,6,0,-1},{11639,7,0,-1},{11643,6,0,-1},{11643,7,0,-1},{11648,6,0,-1}, +{11648,7,0,-1},{11652,6,0,-1},{11652,7,0,-1},{11656,6,0,-1},{11656,7,0,-1}, +{11661,6,0,-1},{11661,7,0,-1},{11665,6,0,-1},{11665,7,0,-1},{11669,6,0,-1}, +{11669,7,0,-1},{11674,6,0,-1},{11674,7,0,-1},{11678,6,0,-1},{11678,7,0,-1}, +{11682,6,0,-1},{11682,7,0,-1},{11687,6,0,-1},{11687,7,0,-1},{11691,6,0,-1}, +{11691,7,0,-1},{11695,6,0,-1},{11695,7,0,-1},{11700,6,0,-1},{11700,7,0,-1}, +{11704,6,0,-1},{11704,7,0,-1},{11634,6,0,-1},{11708,6,0,-1},{11708,7,0,-1}, +{11713,6,0,-1},{11713,7,0,-1},{11717,6,0,-1},{11717,7,0,-1},{11647,7,0,-1}, +{11721,6,0,-1},{11721,7,0,-1},{11726,6,0,-1},{11726,7,0,-1},{11730,6,0,-1}, +{11730,7,0,-1},{11734,6,0,-1},{11734,7,0,-1},{11739,6,0,-1},{11739,7,0,-1}, +{11743,6,0,-1},{11743,7,0,-1},{11747,6,0,-1},{11747,7,0,-1},{11752,6,0,-1}, +{11752,7,0,-1},{11756,6,0,-1},{11756,7,0,-1},{11760,6,0,-1},{11760,7,0,-1}, +{11765,6,0,-1},{11765,7,0,-1},{11769,6,0,-1},{11769,7,0,-1},{11773,6,0,-1}, +{11773,7,0,-1},{11778,6,0,-1},{11778,7,0,-1},{11782,6,0,-1},{11782,7,0,-1}, +{11786,6,0,-1},{11786,7,0,-1},{11791,6,0,-1},{11791,7,0,-1},{11795,6,0,-1}, +{11795,7,0,-1},{11799,6,0,-1},{11799,7,0,-1},{11804,6,0,-1},{11804,7,0,-1}, +{11808,6,0,-1},{11808,7,0,-1},{11738,6,0,-1},{11812,6,0,-1},{11812,7,0,-1}, +{11817,6,0,-1},{11817,7,0,-1},{11821,6,0,-1},{11821,7,0,-1},{11751,7,0,-1}, +{11825,6,0,-1},{11825,7,0,-1},{11830,6,0,-1},{11830,7,0,-1},{11834,6,0,-1}, +{11834,7,0,-1},{11838,6,0,-1},{11838,7,0,-1},{11843,6,0,-1},{11843,7,0,-1}, +{11847,6,0,-1},{11847,7,0,-1},{11851,6,0,-1},{11851,7,0,-1},{11856,6,0,-1}, +{11856,7,0,-1},{11860,6,0,-1},{11860,7,0,-1},{11864,6,0,-1},{11864,7,0,-1}, +{11869,6,0,-1},{11869,7,0,-1},{11873,6,0,-1},{11873,7,0,-1},{11877,6,0,-1}, +{11877,7,0,-1},{11882,6,0,-1},{11882,7,0,-1},{11886,6,0,-1},{11886,7,0,-1}, +{11890,6,0,-1},{11890,7,0,-1},{11895,6,0,-1},{11895,7,0,-1},{11899,6,0,-1}, +{11899,7,0,-1},{11903,6,0,-1},{11903,7,0,-1},{11908,6,0,-1},{11908,7,0,-1}, +{11912,6,0,-1},{11912,7,0,-1},{11842,6,0,-1},{11916,6,0,-1},{11916,7,0,-1}, +{11921,6,0,-1},{11921,7,0,-1},{11925,6,0,-1},{11925,7,0,-1},{11855,7,0,-1}, +{11929,6,0,-1},{11929,7,0,-1},{11934,6,0,-1},{11934,7,0,-1},{11938,6,0,-1}, +{11938,7,0,-1},{11942,6,0,-1},{11942,7,0,-1},{11947,6,0,-1},{11947,7,0,-1}, +{11951,6,0,-1},{11951,7,0,-1},{11955,6,0,-1},{11955,7,0,-1},{11960,6,0,-1}, +{11960,7,0,-1},{11964,6,0,-1},{11964,7,0,-1},{11968,6,0,-1},{11968,7,0,-1}, +{11973,6,0,-1},{11973,7,0,-1},{11977,6,0,-1},{11977,7,0,-1},{11981,6,0,-1}, +{11981,7,0,-1},{11986,6,0,-1},{11986,7,0,-1},{11990,6,0,-1},{11990,7,0,-1}, +{11994,6,0,-1},{11994,7,0,-1},{11999,6,0,-1},{11999,7,0,-1},{12003,6,0,-1}, +{12003,7,0,-1},{12007,6,0,-1},{12007,7,0,-1},{12012,6,0,-1},{12012,7,0,-1}, +{12016,6,0,-1},{12016,7,0,-1},{11946,6,0,-1},{12020,6,0,-1},{12020,7,0,-1}, +{12025,6,0,-1},{12025,7,0,-1},{12029,6,0,-1},{12029,7,0,-1},{11959,7,0,-1}, +{12033,6,0,-1},{12033,7,0,-1},{12038,6,0,-1},{12038,7,0,-1},{12042,6,0,-1}, +{12042,7,0,-1},{12046,6,0,-1},{12046,7,0,-1},{12051,6,0,-1},{12051,7,0,-1}, +{12055,6,0,-1},{12055,7,0,-1},{12059,6,0,-1},{12059,7,0,-1},{12064,6,0,-1}, +{12064,7,0,-1},{12068,6,0,-1},{12068,7,0,-1},{12072,6,0,-1},{12072,7,0,-1}, +{12077,6,0,-1},{12077,7,0,-1},{12081,6,0,-1},{12081,7,0,-1},{12085,6,0,-1}, +{12085,7,0,-1},{12090,6,0,-1},{12090,7,0,-1},{12094,6,0,-1},{12094,7,0,-1}, +{12098,6,0,-1},{12098,7,0,-1},{12103,6,0,-1},{12103,7,0,-1},{12107,6,0,-1}, +{12107,7,0,-1},{12111,6,0,-1},{12111,7,0,-1},{12116,6,0,-1},{12116,7,0,-1}, +{12120,6,0,-1},{12120,7,0,-1},{12050,6,0,-1},{12124,6,0,-1},{12124,7,0,-1}, +{12129,6,0,-1},{12129,7,0,-1},{12133,6,0,-1},{12133,7,0,-1},{12063,7,0,-1}, +{12137,6,0,-1},{12137,7,0,-1},{12142,6,0,-1},{12142,7,0,-1},{12146,6,0,-1}, +{12146,7,0,-1},{12150,6,0,-1},{12150,7,0,-1},{12155,6,0,-1},{12155,7,0,-1}, +{12159,6,0,-1},{12159,7,0,-1},{12163,6,0,-1},{12163,7,0,-1},{12168,6,0,-1}, +{12168,7,0,-1},{12172,6,0,-1},{12172,7,0,-1},{12176,6,0,-1},{12176,7,0,-1}, +{12181,6,0,-1},{12181,7,0,-1},{12185,6,0,-1},{12185,7,0,-1},{12189,6,0,-1}, +{12189,7,0,-1},{12194,6,0,-1},{12194,7,0,-1},{12198,6,0,-1},{12198,7,0,-1}, +{12202,6,0,-1},{12202,7,0,-1},{12207,6,0,-1},{12207,7,0,-1},{12211,6,0,-1}, +{12211,7,0,-1},{12215,6,0,-1},{12215,7,0,-1},{12220,6,0,-1},{12220,7,0,-1}, +{12224,6,0,-1},{12224,7,0,-1},{12154,6,0,-1},{12228,6,0,-1},{12228,7,0,-1}, +{12233,6,0,-1},{12233,7,0,-1},{12237,6,0,-1},{12237,7,0,-1},{12167,7,0,-1}, +{12241,6,0,-1},{12241,7,0,-1},{12246,6,0,-1},{12246,7,0,-1},{12250,7,0,-1}, +{12254,7,0,-1},{12259,6,0,-1},{12259,7,0,-1},{12263,7,0,-1},{12267,7,0,-1}, +{12272,6,0,-1},{12272,7,0,-1},{12276,6,0,-1},{12276,7,0,-1},{12280,6,0,-1}, +{12280,7,0,-1},{12285,6,0,-1},{12285,7,0,-1},{12289,7,0,-1},{12293,7,0,-1}, +{12298,7,0,-1},{12302,7,0,-1},{12306,6,0,-1},{12306,7,0,-1},{12311,6,0,-1}, +{12311,7,0,-1},{12315,7,0,-1},{12319,7,0,-1},{12324,7,0,-1},{12328,7,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS2, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_2_ss0_ss1[] = { +{8252,0,1,-1},{8987,2,0,-1},{8996,2,0,-1},{9004,2,0,-1},{9013,2,0,-1}, +{9022,2,0,-1},{9030,2,0,-1},{9039,2,0,-1},{9043,2,0,-1},{9048,2,0,-1}, +{8982,2,0,-1},{9056,2,0,-1},{9065,2,0,-1},{9074,2,0,-1},{9082,2,0,-1}, +{9091,2,0,-1},{9100,2,0,-1},{9108,2,0,-1},{9117,2,0,-1},{9126,2,0,-1}, +{9134,2,0,-1},{9143,2,0,-1},{9152,2,0,-1},{9086,2,0,-1},{9160,2,0,-1}, +{9169,2,0,-1},{9173,2,0,-1},{9178,2,0,-1},{9182,2,0,-1},{9186,2,0,-1}, +{9191,2,0,-1},{9195,2,0,-1},{9199,2,0,-1},{9204,2,0,-1},{9208,2,0,-1}, +{9212,2,0,-1},{9217,2,0,-1},{9221,2,0,-1},{9225,2,0,-1},{9230,2,0,-1}, +{9234,2,0,-1},{9238,2,0,-1},{9243,2,0,-1},{9247,2,0,-1},{9251,2,0,-1}, +{9256,2,0,-1},{9190,2,0,-1},{9260,2,0,-1},{9264,2,0,-1},{9269,2,0,-1}, +{9273,2,0,-1},{9277,2,0,-1},{9282,2,0,-1},{9286,2,0,-1},{9290,2,0,-1}, +{9295,2,0,-1},{9299,2,0,-1},{9303,2,0,-1},{9308,2,0,-1},{9312,2,0,-1}, +{9316,2,0,-1},{9321,2,0,-1},{9325,2,0,-1},{9329,2,0,-1},{9334,2,0,-1}, +{9338,2,0,-1},{9342,2,0,-1},{9347,2,0,-1},{9351,2,0,-1},{9355,2,0,-1}, +{9360,2,0,-1},{9294,2,0,-1},{9364,2,0,-1},{9368,2,0,-1},{9369,2,1,-1}, +{9373,2,0,-1},{9377,2,0,-1},{9381,2,0,-1},{9382,2,1,-1},{9386,2,0,-1}, +{9390,2,0,-1},{9391,2,1,-1},{9394,2,0,-1},{9395,2,1,-1},{9399,2,0,-1}, +{9403,2,0,-1},{9404,2,1,-1},{9407,2,0,-1},{9412,2,0,-1},{9413,2,1,-1}, +{9416,2,0,-1},{9420,2,0,-1},{9421,2,1,-1},{9425,2,0,-1},{9429,2,0,-1}, +{9430,2,1,-1},{9433,2,0,-1},{9438,2,0,-1},{9439,2,1,-1},{9442,2,0,-1}, +{9446,2,0,-1},{9447,2,1,-1},{9451,2,0,-1},{9455,2,0,-1},{9456,2,1,-1}, +{9459,2,0,-1},{9464,2,0,-1},{9465,2,1,-1},{9398,2,0,-1},{9468,2,0,-1}, +{9472,2,0,-1},{9473,2,1,-1},{9477,2,0,-1},{9411,2,1,-1},{9481,2,0,-1}, +{9482,2,1,-1},{9485,2,0,-1},{9490,2,0,-1},{9491,2,1,-1},{9494,2,0,-1}, +{9498,2,0,-1},{9499,2,1,-1},{9503,2,0,-1},{9504,2,1,-1},{9507,2,0,-1}, +{9508,2,1,-1},{9511,2,0,-1},{9512,2,1,-1},{9516,2,0,-1},{9517,2,1,-1}, +{9520,2,0,-1},{9521,2,1,-1},{9524,2,0,-1},{9525,2,1,-1},{9529,2,0,-1}, +{9533,2,0,-1},{9534,2,1,-1},{9537,2,0,-1},{9538,2,1,-1},{9542,2,0,-1}, +{9543,2,1,-1},{9546,2,0,-1},{9547,2,1,-1},{9550,2,0,-1},{9551,2,1,-1}, +{9555,2,0,-1},{9556,2,1,-1},{9559,2,0,-1},{9560,2,1,-1},{9563,2,0,-1}, +{9564,2,1,-1},{9568,2,0,-1},{9569,2,1,-1},{9502,2,0,-1},{9573,2,1,-1}, +{9576,2,0,-1},{9577,2,1,-1},{9581,2,0,-1},{9582,2,1,-1},{9515,2,1,-1}, +{9585,2,0,-1},{9586,2,1,-1},{9589,2,0,-1},{9590,2,1,-1},{9594,2,0,-1}, +{9595,2,1,-1},{9598,2,0,-1},{9599,2,1,-1},{9602,2,0,-1},{9603,2,1,-1}, +{9607,2,0,-1},{9608,2,1,-1},{9611,2,0,-1},{9612,2,1,-1},{9615,2,0,-1}, +{9616,2,1,-1},{9620,2,0,-1},{9621,2,1,-1},{9624,2,0,-1},{9625,2,1,-1}, +{9628,2,0,-1},{9629,2,1,-1},{9633,2,0,-1},{9634,2,1,-1},{9637,2,0,-1}, +{9638,2,1,-1},{9641,2,0,-1},{9642,2,1,-1},{9646,2,0,-1},{9647,2,1,-1}, +{9650,2,0,-1},{9651,2,1,-1},{9654,2,0,-1},{9655,2,1,-1},{9659,2,0,-1}, +{9660,2,1,-1},{9663,2,0,-1},{9664,2,1,-1},{9667,2,0,-1},{9668,2,1,-1}, +{9672,2,0,-1},{9673,2,1,-1},{9606,2,0,-1},{9676,2,0,-1},{9677,2,1,-1}, +{9680,2,0,-1},{9681,2,1,-1},{9685,2,0,-1},{9686,2,1,-1},{9619,2,1,-1}, +{9689,2,0,-1},{9690,2,1,-1},{9693,2,0,-1},{9694,2,1,-1},{9698,2,0,-1}, +{9699,2,1,-1},{9702,2,0,-1},{9703,2,1,-1},{9706,2,0,-1},{9707,2,1,-1}, +{9711,2,0,-1},{9712,2,1,-1},{9715,2,0,-1},{9716,2,1,-1},{9719,2,0,-1}, +{9724,2,0,-1},{9725,2,1,-1},{9728,2,0,-1},{9729,2,1,-1},{9732,2,0,-1}, +{9733,2,1,-1},{9737,2,0,-1},{9738,2,1,-1},{9741,2,0,-1},{9742,2,1,-1}, +{9745,2,0,-1},{9746,2,1,-1},{9750,2,0,-1},{9751,2,1,-1},{9754,2,0,-1}, +{9755,2,1,-1},{9758,2,0,-1},{9759,2,1,-1},{9764,2,1,-1},{9767,2,0,-1}, +{9768,2,1,-1},{9771,2,0,-1},{9776,2,0,-1},{9777,2,1,-1},{9710,2,0,-1}, +{9780,2,0,-1},{9781,2,1,-1},{9784,2,0,-1},{9785,2,1,-1},{9789,2,0,-1}, +{9790,2,1,-1},{9723,2,1,-1},{9793,2,0,-1},{9794,2,1,-1},{9797,2,0,-1}, +{9798,2,1,-1},{9802,2,0,-1},{9803,2,1,-1},{9806,2,0,-1},{9807,2,1,-1}, +{9810,2,0,-1},{9811,2,1,-1},{9815,2,0,-1},{9816,2,1,-1},{9819,2,0,-1}, +{9820,2,1,-1},{9823,2,0,-1},{9824,2,1,-1},{9828,2,0,-1},{9829,2,1,-1}, +{9832,2,0,-1},{9833,2,1,-1},{9836,2,0,-1},{9837,2,1,-1},{9841,2,0,-1}, +{9842,2,1,-1},{9845,2,0,-1},{9846,2,1,-1},{9849,2,0,-1},{9850,2,1,-1}, +{9854,2,0,-1},{9855,2,1,-1},{9858,2,0,-1},{9859,2,1,-1},{9862,2,0,-1}, +{9863,2,1,-1},{9867,2,0,-1},{9868,2,1,-1},{9871,2,0,-1},{9872,2,1,-1}, +{9875,2,0,-1},{9876,2,1,-1},{9880,2,0,-1},{9881,2,1,-1},{9814,2,0,-1}, +{9884,2,0,-1},{9885,2,1,-1},{9888,2,0,-1},{9889,2,1,-1},{9893,2,0,-1}, +{9894,2,1,-1},{9827,2,1,-1},{9897,2,0,-1},{9898,2,1,-1},{9901,2,0,-1}, +{9902,2,1,-1},{9906,2,0,-1},{9907,2,1,-1},{9910,2,0,-1},{9911,2,1,-1}, +{9914,2,0,-1},{9915,2,1,-1},{9919,2,0,-1},{9920,2,1,-1},{9923,2,0,-1}, +{9924,2,1,-1},{9927,2,0,-1},{9928,2,1,-1},{9932,2,0,-1},{9933,2,1,-1}, +{9936,2,0,-1},{9937,2,1,-1},{9940,2,0,-1},{9941,2,1,-1},{9945,2,0,-1}, +{9946,2,1,-1},{9949,2,0,-1},{9950,2,1,-1},{9953,2,0,-1},{9954,2,1,-1}, +{9958,2,0,-1},{9959,2,1,-1},{9962,2,0,-1},{9963,2,1,-1},{9966,2,0,-1}, +{9967,2,1,-1},{9971,2,0,-1},{9972,2,1,-1},{9975,2,0,-1},{9976,2,1,-1}, +{9979,2,0,-1},{9980,2,1,-1},{9984,2,0,-1},{9985,2,1,-1},{9918,2,0,-1}, +{9988,2,0,-1},{9989,2,1,-1},{9992,2,0,-1},{9993,2,1,-1},{9997,2,0,-1}, +{9998,2,1,-1},{9931,2,1,-1},{10001,2,0,-1},{10002,2,1,-1},{10005,2,0,-1}, +{10006,2,1,-1},{10010,2,0,-1},{10011,2,1,-1},{10014,2,0,-1},{10015,2,1,-1}, +{10018,2,0,-1},{10019,2,1,-1},{10023,2,0,-1},{10024,2,1,-1},{10027,2,0,-1}, +{10028,2,1,-1},{10031,2,0,-1},{10032,2,1,-1},{10036,2,0,-1},{10037,2,1,-1}, +{10040,2,0,-1},{10041,2,1,-1},{10044,2,0,-1},{10045,2,1,-1},{10049,2,0,-1}, +{10050,2,1,-1},{10053,2,0,-1},{10054,2,1,-1},{10057,2,0,-1},{10058,2,1,-1}, +{10062,2,0,-1},{10063,2,1,-1},{10066,2,0,-1},{10067,2,1,-1},{10070,2,0,-1}, +{10071,2,1,-1},{10075,2,0,-1},{10076,2,1,-1},{10079,2,0,-1},{10080,2,1,-1}, +{10083,2,0,-1},{10084,2,1,-1},{10088,2,0,-1},{10089,2,1,-1},{10022,2,0,-1}, +{10092,2,0,-1},{10093,2,1,-1},{10096,2,0,-1},{10097,2,1,-1},{10101,2,0,-1}, +{10102,2,1,-1},{10035,2,1,-1},{10105,2,0,-1},{10106,2,1,-1},{10109,2,0,-1}, +{10110,2,1,-1},{10114,2,0,-1},{10115,2,1,-1},{10118,2,0,-1},{10119,2,1,-1}, +{10122,2,0,-1},{10123,2,1,-1},{10127,2,0,-1},{10128,2,1,-1},{10131,2,0,-1}, +{10132,2,1,-1},{10135,2,0,-1},{10136,2,1,-1},{10140,2,0,-1},{10141,2,1,-1}, +{10144,2,0,-1},{10145,2,1,-1},{10148,2,0,-1},{10149,2,1,-1},{10153,2,0,-1}, +{10154,2,1,-1},{10157,2,0,-1},{10158,2,1,-1},{10161,2,0,-1},{10162,2,1,-1}, +{10166,2,0,-1},{10167,2,1,-1},{10170,2,0,-1},{10171,2,1,-1},{10174,2,0,-1}, +{10175,2,1,-1},{10179,2,0,-1},{10180,2,1,-1},{10183,2,0,-1},{10184,2,1,-1}, +{10187,2,0,-1},{10188,2,1,-1},{10192,2,0,-1},{10193,2,1,-1},{10126,2,0,-1}, +{10196,2,0,-1},{10197,2,1,-1},{10200,2,0,-1},{10201,2,1,-1},{10205,2,0,-1}, +{10206,2,1,-1},{10139,2,1,-1},{10209,2,0,-1},{10210,2,1,-1},{10213,2,0,-1}, +{10214,2,1,-1},{10218,2,0,-1},{10219,2,1,-1},{10222,2,0,-1},{10223,2,1,-1}, +{10226,2,0,-1},{10227,2,1,-1},{10231,2,0,-1},{10232,2,1,-1},{10235,2,0,-1}, +{10236,2,1,-1},{10239,2,0,-1},{10240,2,1,-1},{10244,2,0,-1},{10245,2,1,-1}, +{10248,2,0,-1},{10249,2,1,-1},{10252,2,0,-1},{10253,2,1,-1},{10257,2,0,-1}, +{10258,2,1,-1},{10261,2,0,-1},{10262,2,1,-1},{10265,2,0,-1},{10266,2,1,-1}, +{10270,2,0,-1},{10271,2,1,-1},{10274,2,0,-1},{10275,2,1,-1},{10278,2,0,-1}, +{10279,2,1,-1},{10283,2,0,-1},{10284,2,1,-1},{10287,2,0,-1},{10288,2,1,-1}, +{10291,2,0,-1},{10292,2,1,-1},{10296,2,0,-1},{10297,2,1,-1},{10230,2,0,-1}, +{10300,2,0,-1},{10301,2,1,-1},{10304,2,0,-1},{10305,2,1,-1},{10309,2,0,-1}, +{10310,2,1,-1},{10243,2,1,-1},{10313,2,0,-1},{10314,2,1,-1},{10317,2,0,-1}, +{10318,2,1,-1},{10322,2,0,-1},{10323,2,1,-1},{10326,2,0,-1},{10327,2,1,-1}, +{10330,2,0,-1},{10331,2,1,-1},{10335,2,0,-1},{10336,2,1,-1},{10339,2,0,-1}, +{10340,2,1,-1},{10343,2,0,-1},{10344,2,1,-1},{10348,2,0,-1},{10349,2,1,-1}, +{10352,2,0,-1},{10353,2,1,-1},{10356,2,0,-1},{10357,2,1,-1},{10361,2,0,-1}, +{10362,2,1,-1},{10365,2,0,-1},{10366,2,1,-1},{10369,2,0,-1},{10370,2,1,-1}, +{10374,2,0,-1},{10375,2,1,-1},{10378,2,0,-1},{10379,2,1,-1},{10382,2,0,-1}, +{10383,2,1,-1},{10387,2,0,-1},{10388,2,1,-1},{10391,2,0,-1},{10392,2,1,-1}, +{10395,2,0,-1},{10396,2,1,-1},{10400,2,0,-1},{10401,2,1,-1},{10334,2,0,-1}, +{10404,2,0,-1},{10405,2,1,-1},{10408,2,0,-1},{10409,2,1,-1},{10413,2,0,-1}, +{10414,2,1,-1},{10347,2,1,-1},{10417,2,0,-1},{10418,2,1,-1},{10421,2,0,-1}, +{10422,2,1,-1},{10426,2,0,-1},{10427,2,1,-1},{10430,2,0,-1},{10431,2,1,-1}, +{10434,2,0,-1},{10435,2,1,-1},{10439,2,0,-1},{10440,2,1,-1},{10443,2,0,-1}, +{10444,2,1,-1},{10447,2,0,-1},{10448,2,1,-1},{10452,2,0,-1},{10453,2,1,-1}, +{10456,2,0,-1},{10457,2,1,-1},{10460,2,0,-1},{10461,2,1,-1},{10465,2,0,-1}, +{10466,2,1,-1},{10469,2,0,-1},{10470,2,1,-1},{10473,2,0,-1},{10474,2,1,-1}, +{10478,2,0,-1},{10479,2,1,-1},{10482,2,0,-1},{10483,2,1,-1},{10486,2,0,-1}, +{10487,2,1,-1},{10491,2,0,-1},{10492,2,1,-1},{10495,2,0,-1},{10496,2,1,-1}, +{10499,2,0,-1},{10500,2,1,-1},{10504,2,0,-1},{10505,2,1,-1},{10438,2,0,-1}, +{10508,2,0,-1},{10509,2,1,-1},{10512,2,0,-1},{10513,2,1,-1},{10517,2,0,-1}, +{10518,2,1,-1},{10451,2,1,-1},{10521,2,0,-1},{10522,2,1,-1},{10525,2,0,-1}, +{10526,2,1,-1},{10530,2,0,-1},{10531,2,1,-1},{10534,2,0,-1},{10535,2,1,-1}, +{10538,2,0,-1},{10539,2,1,-1},{10543,2,0,-1},{10544,2,1,-1},{10547,2,0,-1}, +{10548,2,1,-1},{10551,2,0,-1},{10552,2,1,-1},{10556,2,0,-1},{10557,2,1,-1}, +{10560,2,0,-1},{10561,2,1,-1},{10564,2,0,-1},{10565,2,1,-1},{10569,2,0,-1}, +{10570,2,1,-1},{10573,2,0,-1},{10574,2,1,-1},{10577,2,0,-1},{10578,2,1,-1}, +{10582,2,0,-1},{10583,2,1,-1},{10586,2,0,-1},{10587,2,1,-1},{10590,2,0,-1}, +{10591,2,1,-1},{10595,2,0,-1},{10596,2,1,-1},{10599,2,0,-1},{10600,2,1,-1}, +{10603,2,0,-1},{10604,2,1,-1},{10608,2,0,-1},{10609,2,1,-1},{10542,2,0,-1}, +{10612,2,0,-1},{10613,2,1,-1},{10616,2,0,-1},{10617,2,1,-1},{10621,2,0,-1}, +{10622,2,1,-1},{10555,2,1,-1},{10625,2,0,-1},{10626,2,1,-1},{10629,2,0,-1}, +{10630,2,1,-1},{10634,2,0,-1},{10635,2,1,-1},{10638,2,0,-1},{10639,2,1,-1}, +{10642,2,0,-1},{10643,2,1,-1},{10647,2,0,-1},{10648,2,1,-1},{10651,2,0,-1}, +{10652,2,1,-1},{10655,2,0,-1},{10656,2,1,-1},{10660,2,0,-1},{10661,2,1,-1}, +{10664,2,0,-1},{10665,2,1,-1},{10668,2,0,-1},{10669,2,1,-1},{10673,2,0,-1}, +{10674,2,1,-1},{10677,2,0,-1},{10678,2,1,-1},{10681,2,0,-1},{10682,2,1,-1}, +{10686,2,0,-1},{10687,2,1,-1},{10690,2,0,-1},{10691,2,1,-1},{10694,2,0,-1}, +{10695,2,1,-1},{10699,2,0,-1},{10700,2,1,-1},{10703,2,0,-1},{10704,2,1,-1}, +{10707,2,0,-1},{10708,2,1,-1},{10712,2,0,-1},{10713,2,1,-1},{10646,2,0,-1}, +{10716,2,0,-1},{10717,2,1,-1},{10720,2,0,-1},{10721,2,1,-1},{10725,2,0,-1}, +{10726,2,1,-1},{10659,2,1,-1},{10729,2,0,-1},{10730,2,1,-1},{10733,2,0,-1}, +{10734,2,1,-1},{10738,2,0,-1},{10739,2,1,-1},{10742,2,0,-1},{10743,2,1,-1}, +{10746,2,0,-1},{10747,2,1,-1},{10751,2,0,-1},{10752,2,1,-1},{10755,2,0,-1}, +{10756,2,1,-1},{10759,2,0,-1},{10760,2,1,-1},{10764,2,0,-1},{10765,2,1,-1}, +{10768,2,0,-1},{10769,2,1,-1},{10772,2,0,-1},{10773,2,1,-1},{10777,2,0,-1}, +{10778,2,1,-1},{10781,2,0,-1},{10782,2,1,-1},{10785,2,0,-1},{10786,2,1,-1}, +{10790,2,0,-1},{10791,2,1,-1},{10794,2,0,-1},{10795,2,1,-1},{10798,2,0,-1}, +{10799,2,1,-1},{10803,2,0,-1},{10804,2,1,-1},{10807,2,0,-1},{10808,2,1,-1}, +{10811,2,0,-1},{10812,2,1,-1},{10816,2,0,-1},{10817,2,1,-1},{10750,2,0,-1}, +{10820,2,0,-1},{10821,2,1,-1},{10824,2,0,-1},{10825,2,1,-1},{10829,2,0,-1}, +{10830,2,1,-1},{10763,2,1,-1},{10833,2,0,-1},{10834,2,1,-1},{10837,2,0,-1}, +{10838,2,1,-1},{10842,2,0,-1},{10843,2,1,-1},{10846,2,0,-1},{10847,2,1,-1}, +{10850,2,0,-1},{10851,2,1,-1},{10855,2,0,-1},{10856,2,1,-1},{10859,2,0,-1}, +{10860,2,1,-1},{10863,2,0,-1},{10864,2,1,-1},{10868,2,0,-1},{10869,2,1,-1}, +{10872,2,0,-1},{10873,2,1,-1},{10876,2,0,-1},{10877,2,1,-1},{10881,2,0,-1}, +{10882,2,1,-1},{10885,2,0,-1},{10886,2,1,-1},{10889,2,0,-1},{10890,2,1,-1}, +{10894,2,0,-1},{10895,2,1,-1},{10898,2,0,-1},{10899,2,1,-1},{10902,2,0,-1}, +{10903,2,1,-1},{10907,2,0,-1},{10908,2,1,-1},{10911,2,0,-1},{10912,2,1,-1}, +{10915,2,0,-1},{10916,2,1,-1},{10920,2,0,-1},{10921,2,1,-1},{10854,2,0,-1}, +{10924,2,0,-1},{10925,2,1,-1},{10928,2,0,-1},{10929,2,1,-1},{10933,2,0,-1}, +{10934,2,1,-1},{10867,2,1,-1},{10937,2,0,-1},{10938,2,1,-1},{10941,2,0,-1}, +{10942,2,1,-1},{10946,2,0,-1},{10947,2,1,-1},{10950,2,0,-1},{10951,2,1,-1}, +{10954,2,0,-1},{10955,2,1,-1},{10959,2,0,-1},{10960,2,1,-1},{10963,2,0,-1}, +{10964,2,1,-1},{10967,2,0,-1},{10968,2,1,-1},{10972,2,0,-1},{10973,2,1,-1}, +{10976,2,0,-1},{10977,2,1,-1},{10980,2,0,-1},{10981,2,1,-1},{10985,2,0,-1}, +{10986,2,1,-1},{10989,2,0,-1},{10990,2,1,-1},{10993,2,0,-1},{10994,2,1,-1}, +{10998,2,0,-1},{10999,2,1,-1},{11002,2,0,-1},{11003,2,1,-1},{11006,2,0,-1}, +{11007,2,1,-1},{11011,2,0,-1},{11012,2,1,-1},{11015,2,0,-1},{11016,2,1,-1}, +{11019,2,0,-1},{11020,2,1,-1},{11024,2,0,-1},{11025,2,1,-1},{10958,2,0,-1}, +{11028,2,0,-1},{11029,2,1,-1},{11032,2,0,-1},{11033,2,1,-1},{11037,2,0,-1}, +{11038,2,1,-1},{10971,2,1,-1},{11041,2,0,-1},{11042,2,1,-1},{11045,2,0,-1}, +{11046,2,1,-1},{11050,2,0,-1},{11051,2,1,-1},{11054,2,0,-1},{11055,2,1,-1}, +{11058,2,0,-1},{11059,2,1,-1},{11063,2,0,-1},{11064,2,1,-1},{11067,2,0,-1}, +{11068,2,1,-1},{11071,2,0,-1},{11072,2,1,-1},{11076,2,0,-1},{11077,2,1,-1}, +{11080,2,0,-1},{11081,2,1,-1},{11084,2,0,-1},{11085,2,1,-1},{11089,2,0,-1}, +{11090,2,1,-1},{11093,2,0,-1},{11094,2,1,-1},{11097,2,0,-1},{11098,2,1,-1}, +{11102,2,0,-1},{11103,2,1,-1},{11106,2,0,-1},{11107,2,1,-1},{11110,2,0,-1}, +{11111,2,1,-1},{11115,2,0,-1},{11116,2,1,-1},{11119,2,0,-1},{11120,2,1,-1}, +{11123,2,0,-1},{11124,2,1,-1},{11128,2,0,-1},{11129,2,1,-1},{11062,2,0,-1}, +{11132,2,0,-1},{11133,2,1,-1},{11136,2,0,-1},{11137,2,1,-1},{11141,2,0,-1}, +{11142,2,1,-1},{11075,2,1,-1},{11145,2,0,-1},{11146,2,1,-1},{11149,2,0,-1}, +{11150,2,1,-1},{11154,2,0,-1},{11155,2,1,-1},{11158,2,0,-1},{11159,2,1,-1}, +{11162,2,0,-1},{11163,2,1,-1},{11167,2,0,-1},{11168,2,1,-1},{11171,2,0,-1}, +{11172,2,1,-1},{11175,2,0,-1},{11176,2,1,-1},{11180,2,0,-1},{11181,2,1,-1}, +{11184,2,0,-1},{11185,2,1,-1},{11188,2,0,-1},{11189,2,1,-1},{11193,2,0,-1}, +{11194,2,1,-1},{11197,2,0,-1},{11198,2,1,-1},{11201,2,0,-1},{11202,2,1,-1}, +{11206,2,0,-1},{11207,2,1,-1},{11210,2,0,-1},{11211,2,1,-1},{11214,2,0,-1}, +{11215,2,1,-1},{11219,2,0,-1},{11220,2,1,-1},{11223,2,0,-1},{11224,2,1,-1}, +{11227,2,0,-1},{11228,2,1,-1},{11232,2,0,-1},{11233,2,1,-1},{11166,2,0,-1}, +{11236,2,0,-1},{11237,2,1,-1},{11240,2,0,-1},{11241,2,1,-1},{11245,2,0,-1}, +{11246,2,1,-1},{11179,2,1,-1},{11249,2,0,-1},{11250,2,1,-1},{11253,2,0,-1}, +{11254,2,1,-1},{11258,2,0,-1},{11259,2,1,-1},{11262,2,0,-1},{11263,2,1,-1}, +{11266,2,0,-1},{11267,2,1,-1},{11271,2,0,-1},{11272,2,1,-1},{11275,2,0,-1}, +{11276,2,1,-1},{11279,2,0,-1},{11280,2,1,-1},{11284,2,0,-1},{11285,2,1,-1}, +{11288,2,0,-1},{11289,2,1,-1},{11292,2,0,-1},{11293,2,1,-1},{11297,2,0,-1}, +{11298,2,1,-1},{11301,2,0,-1},{11302,2,1,-1},{11305,2,0,-1},{11306,2,1,-1}, +{11310,2,0,-1},{11311,2,1,-1},{11314,2,0,-1},{11315,2,1,-1},{11318,2,0,-1}, +{11319,2,1,-1},{11323,2,0,-1},{11324,2,1,-1},{11327,2,0,-1},{11328,2,1,-1}, +{11331,2,0,-1},{11332,2,1,-1},{11336,2,0,-1},{11337,2,1,-1},{11270,2,0,-1}, +{11340,2,0,-1},{11341,2,1,-1},{11344,2,0,-1},{11345,2,1,-1},{11349,2,0,-1}, +{11350,2,1,-1},{11283,2,1,-1},{11353,2,0,-1},{11354,2,1,-1},{11357,2,0,-1}, +{11358,2,1,-1},{11362,2,0,-1},{11363,2,1,-1},{11366,2,0,-1},{11367,2,1,-1}, +{11370,2,0,-1},{11371,2,1,-1},{11375,2,0,-1},{11376,2,1,-1},{11379,2,0,-1}, +{11380,2,1,-1},{11383,2,0,-1},{11384,2,1,-1},{11388,2,0,-1},{11389,2,1,-1}, +{11392,2,0,-1},{11393,2,1,-1},{11396,2,0,-1},{11397,2,1,-1},{11401,2,0,-1}, +{11402,2,1,-1},{11405,2,0,-1},{11406,2,1,-1},{11409,2,0,-1},{11410,2,1,-1}, +{11414,2,0,-1},{11415,2,1,-1},{11418,2,0,-1},{11419,2,1,-1},{11422,2,0,-1}, +{11423,2,1,-1},{11427,2,0,-1},{11428,2,1,-1},{11431,2,0,-1},{11432,2,1,-1}, +{11435,2,0,-1},{11436,2,1,-1},{11440,2,0,-1},{11441,2,1,-1},{11374,2,0,-1}, +{11444,2,0,-1},{11445,2,1,-1},{11448,2,0,-1},{11449,2,1,-1},{11453,2,0,-1}, +{11454,2,1,-1},{11387,2,1,-1},{11457,2,0,-1},{11458,2,1,-1},{11461,2,0,-1}, +{11462,2,1,-1},{11466,2,0,-1},{11467,2,1,-1},{11470,2,0,-1},{11471,2,1,-1}, +{11474,2,0,-1},{11475,2,1,-1},{11479,2,0,-1},{11480,2,1,-1},{11483,2,0,-1}, +{11484,2,1,-1},{11487,2,0,-1},{11488,2,1,-1},{11492,2,0,-1},{11493,2,1,-1}, +{11496,2,0,-1},{11497,2,1,-1},{11500,2,0,-1},{11501,2,1,-1},{11505,2,0,-1}, +{11506,2,1,-1},{11509,2,0,-1},{11510,2,1,-1},{11513,2,0,-1},{11514,2,1,-1}, +{11518,2,0,-1},{11519,2,1,-1},{11522,2,0,-1},{11523,2,1,-1},{11526,2,0,-1}, +{11527,2,1,-1},{11531,2,0,-1},{11532,2,1,-1},{11535,2,0,-1},{11536,2,1,-1}, +{11539,2,0,-1},{11540,2,1,-1},{11544,2,0,-1},{11545,2,1,-1},{11478,2,0,-1}, +{11548,2,0,-1},{11549,2,1,-1},{11552,2,0,-1},{11553,2,1,-1},{11557,2,0,-1}, +{11558,2,1,-1},{11491,2,1,-1},{11561,2,0,-1},{11562,2,1,-1},{11565,2,0,-1}, +{11566,2,1,-1},{11570,2,0,-1},{11571,2,1,-1},{11574,2,0,-1},{11575,2,1,-1}, +{11578,2,0,-1},{11579,2,1,-1},{11583,2,0,-1},{11584,2,1,-1},{11587,2,0,-1}, +{11588,2,1,-1},{11591,2,0,-1},{11596,2,0,-1},{11597,2,1,-1},{11600,2,0,-1}, +{11601,2,1,-1},{11604,2,0,-1},{11605,2,1,-1},{11609,2,0,-1},{11610,2,1,-1}, +{11613,2,0,-1},{11614,2,1,-1},{11617,2,0,-1},{11618,2,1,-1},{11622,2,0,-1}, +{11623,2,1,-1},{11626,2,0,-1},{11627,2,1,-1},{11630,2,0,-1},{11631,2,1,-1}, +{11635,2,0,-1},{11636,2,1,-1},{11639,2,0,-1},{11640,2,1,-1},{11648,2,0,-1}, +{11649,2,1,-1},{11582,2,0,-1},{11652,2,0,-1},{11653,2,1,-1},{11656,2,0,-1}, +{11657,2,1,-1},{11661,2,0,-1},{11662,2,1,-1},{11665,2,0,-1},{11666,2,1,-1}, +{11669,2,0,-1},{11670,2,1,-1},{11674,2,0,-1},{11675,2,1,-1},{11678,2,0,-1}, +{11679,2,1,-1},{11682,2,0,-1},{11683,2,1,-1},{11687,2,0,-1},{11688,2,1,-1}, +{11691,2,0,-1},{11692,2,1,-1},{11700,2,0,-1},{11704,2,0,-1},{11708,2,0,-1}, +{11713,2,0,-1},{11717,2,0,-1},{11721,2,0,-1},{11726,2,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS3, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_3_ss0_ss1[] = { +{10001,3,0,-1},{10002,3,1,-1},{10005,3,0,-1},{10006,3,1,-1},{10010,3,0,-1}, +{10011,3,1,-1},{10014,3,0,-1},{10015,3,1,-1},{10018,3,0,-1},{10019,3,1,-1}, +{10023,3,0,-1},{10024,3,1,-1},{10027,3,0,-1},{10028,3,1,-1},{10031,3,0,-1}, +{10032,3,1,-1},{10036,3,0,-1},{10037,3,1,-1},{10040,3,0,-1},{10041,3,1,-1}, +{10044,3,0,-1},{10045,3,1,-1},{10049,3,0,-1},{10050,3,1,-1},{10053,3,0,-1}, +{10054,3,1,-1},{10057,3,0,-1},{10058,3,1,-1},{10062,3,0,-1},{10063,3,1,-1}, +{10066,3,0,-1},{10067,3,1,-1},{10070,3,0,-1},{10071,3,1,-1},{10075,3,0,-1}, +{10076,3,1,-1},{10079,3,0,-1},{10080,3,1,-1},{10083,3,0,-1},{10084,3,1,-1}, +{10088,3,0,-1},{10089,3,1,-1},{10022,3,0,-1},{10092,3,0,-1},{10093,3,1,-1}, +{10096,3,0,-1},{10097,3,1,-1},{10101,3,0,-1},{10102,3,1,-1},{10035,3,1,-1}, +{10105,3,0,-1},{10106,3,1,-1},{10109,3,0,-1},{10110,3,1,-1},{10114,3,0,-1}, +{10115,3,1,-1},{10118,3,0,-1},{10119,3,1,-1},{10122,3,0,-1},{10123,3,1,-1}, +{10127,3,0,-1},{10128,3,1,-1},{10131,3,0,-1},{10132,3,1,-1},{10135,3,0,-1}, +{10136,3,1,-1},{10140,3,0,-1},{10141,3,1,-1},{10144,3,0,-1},{10145,3,1,-1}, +{10148,3,0,-1},{10149,3,1,-1},{10153,3,0,-1},{10154,3,1,-1},{10157,3,0,-1}, +{10158,3,1,-1},{10161,3,0,-1},{10162,3,1,-1},{10166,3,0,-1},{10167,3,1,-1}, +{10170,3,0,-1},{10171,3,1,-1},{10174,3,0,-1},{10175,3,1,-1},{10179,3,0,-1}, +{10180,3,1,-1},{10183,3,0,-1},{10184,3,1,-1},{10187,3,0,-1},{10188,3,1,-1}, +{10192,3,0,-1},{10193,3,1,-1},{10126,3,0,-1},{10196,3,0,-1},{10197,3,1,-1}, +{10200,3,0,-1},{10201,3,1,-1},{10205,3,0,-1},{10206,3,1,-1},{10139,3,1,-1}, +{10209,3,0,-1},{10210,3,1,-1},{10213,3,0,-1},{10214,3,1,-1},{10218,3,0,-1}, +{10219,3,1,-1},{10222,3,0,-1},{10223,3,1,-1},{10226,3,0,-1},{10227,3,1,-1}, +{10231,3,0,-1},{10232,3,1,-1},{10235,3,0,-1},{10236,3,1,-1},{10239,3,0,-1}, +{10240,3,1,-1},{10244,3,0,-1},{10245,3,1,-1},{10248,3,0,-1},{10249,3,1,-1}, +{10252,3,0,-1},{10253,3,1,-1},{10257,3,0,-1},{10258,3,1,-1},{10261,3,0,-1}, +{10262,3,1,-1},{10265,3,0,-1},{10266,3,1,-1},{10270,3,0,-1},{10271,3,1,-1}, +{10274,3,0,-1},{10275,3,1,-1},{10278,3,0,-1},{10279,3,1,-1},{10283,3,0,-1}, +{10284,3,1,-1},{10287,3,0,-1},{10288,3,1,-1},{10291,3,0,-1},{10292,3,1,-1}, +{10296,3,0,-1},{10297,3,1,-1},{10230,3,0,-1},{10300,3,0,-1},{10301,3,1,-1}, +{10304,3,0,-1},{10305,3,1,-1},{10309,3,0,-1},{10310,3,1,-1},{10243,3,1,-1}, +{10313,3,0,-1},{10314,3,1,-1},{10317,3,0,-1},{10318,3,1,-1},{10322,3,0,-1}, +{10323,3,1,-1},{10326,3,0,-1},{10327,3,1,-1},{10330,3,0,-1},{10331,3,1,-1}, +{10335,3,0,-1},{10336,3,1,-1},{10339,3,0,-1},{10340,3,1,-1},{10343,3,0,-1}, +{10344,3,1,-1},{10348,3,0,-1},{10349,3,1,-1},{10352,3,0,-1},{10353,3,1,-1}, +{10356,3,0,-1},{10357,3,1,-1},{10361,3,0,-1},{10362,3,1,-1},{10365,3,0,-1}, +{10366,3,1,-1},{10369,3,0,-1},{10370,3,1,-1},{10374,3,0,-1},{10375,3,1,-1}, +{10378,3,0,-1},{10379,3,1,-1},{10382,3,0,-1},{10383,3,1,-1},{10387,3,0,-1}, +{10388,3,1,-1},{10391,3,0,-1},{10392,3,1,-1},{10395,3,0,-1},{10396,3,1,-1}, +{10400,3,0,-1},{10401,3,1,-1},{10334,3,0,-1},{10404,3,0,-1},{10405,3,1,-1}, +{10408,3,0,-1},{10409,3,1,-1},{10413,3,0,-1},{10414,3,1,-1},{10347,3,1,-1}, +{10417,3,0,-1},{10418,3,1,-1},{10421,3,0,-1},{10422,3,1,-1},{10426,3,0,-1}, +{10427,3,1,-1},{10430,3,0,-1},{10431,3,1,-1},{10434,3,0,-1},{10435,3,1,-1}, +{10439,3,0,-1},{10440,3,1,-1},{10443,3,0,-1},{10444,3,1,-1},{10447,3,0,-1}, +{10448,3,1,-1},{10452,3,0,-1},{10453,3,1,-1},{10456,3,0,-1},{10457,3,1,-1}, +{10460,3,0,-1},{10461,3,1,-1},{10465,3,0,-1},{10466,3,1,-1},{10469,3,0,-1}, +{10470,3,1,-1},{10473,3,0,-1},{10474,3,1,-1},{10478,3,0,-1},{10479,3,1,-1}, +{10482,3,0,-1},{10483,3,1,-1},{10486,3,0,-1},{10487,3,1,-1},{10491,3,0,-1}, +{10492,3,1,-1},{10495,3,0,-1},{10496,3,1,-1},{10499,3,0,-1},{10500,3,1,-1}, +{10504,3,0,-1},{10505,3,1,-1},{10438,3,0,-1},{10508,3,0,-1},{10509,3,1,-1}, +{10512,3,0,-1},{10513,3,1,-1},{10517,3,0,-1},{10518,3,1,-1},{10451,3,1,-1}, +{10521,3,0,-1},{10522,3,1,-1},{10525,3,0,-1},{10526,3,1,-1},{10530,3,0,-1}, +{10531,3,1,-1},{10534,3,0,-1},{10535,3,1,-1},{10538,3,0,-1},{10539,3,1,-1}, +{10543,3,0,-1},{10544,3,1,-1},{10547,3,0,-1},{10548,3,1,-1},{10551,3,0,-1}, +{10552,3,1,-1},{10556,3,0,-1},{10557,3,1,-1},{10560,3,0,-1},{10561,3,1,-1}, +{10564,3,0,-1},{10565,3,1,-1},{10569,3,0,-1},{10570,3,1,-1},{10573,3,0,-1}, +{10574,3,1,-1},{10577,3,0,-1},{10578,3,1,-1},{10582,3,0,-1},{10583,3,1,-1}, +{10586,3,0,-1},{10587,3,1,-1},{10590,3,0,-1},{10591,3,1,-1},{10595,3,0,-1}, +{10596,3,1,-1},{10599,3,0,-1},{10600,3,1,-1},{10603,3,0,-1},{10604,3,1,-1}, +{10608,3,0,-1},{10609,3,1,-1},{10542,3,0,-1},{10612,3,0,-1},{10613,3,1,-1}, +{10616,3,0,-1},{10617,3,1,-1},{10621,3,0,-1},{10622,3,1,-1},{10555,3,1,-1}, +{10625,3,0,-1},{10626,3,1,-1},{10629,3,0,-1},{10630,3,1,-1},{10634,3,0,-1}, +{10635,3,1,-1},{10638,3,0,-1},{10639,3,1,-1},{10642,3,0,-1},{10643,3,1,-1}, +{10647,3,0,-1},{10648,3,1,-1},{10651,3,0,-1},{10652,3,1,-1},{10655,3,0,-1}, +{10656,3,1,-1},{10660,3,0,-1},{10661,3,1,-1},{10664,3,0,-1},{10665,3,1,-1}, +{10668,3,0,-1},{10669,3,1,-1},{10673,3,0,-1},{10674,3,1,-1},{10677,3,0,-1}, +{10678,3,1,-1},{10681,3,0,-1},{10682,3,1,-1},{10686,3,0,-1},{10687,3,1,-1}, +{10690,3,0,-1},{10691,3,1,-1},{10694,3,0,-1},{10695,3,1,-1},{10699,3,0,-1}, +{10700,3,1,-1},{10703,3,0,-1},{10704,3,1,-1},{10707,3,0,-1},{10708,3,1,-1}, +{10712,3,0,-1},{10713,3,1,-1},{10646,3,0,-1},{10716,3,0,-1},{10717,3,1,-1}, +{10720,3,0,-1},{10721,3,1,-1},{10725,3,0,-1},{10726,3,1,-1},{10659,3,1,-1}, +{10729,3,0,-1},{10730,3,1,-1},{10733,3,0,-1},{10734,3,1,-1},{10738,3,0,-1}, +{10739,3,1,-1},{10742,3,0,-1},{10743,3,1,-1},{10746,3,0,-1},{10747,3,1,-1}, +{10751,3,0,-1},{10752,3,1,-1},{10755,3,0,-1},{10756,3,1,-1},{10759,3,0,-1}, +{10760,3,1,-1},{10764,3,0,-1},{10765,3,1,-1},{10768,3,0,-1},{10769,3,1,-1}, +{10772,3,0,-1},{10773,3,1,-1},{10777,3,0,-1},{10778,3,1,-1},{10781,3,0,-1}, +{10782,3,1,-1},{10785,3,0,-1},{10786,3,1,-1},{10790,3,0,-1},{10791,3,1,-1}, +{10794,3,0,-1},{10795,3,1,-1},{10798,3,0,-1},{10799,3,1,-1},{10803,3,0,-1}, +{10804,3,1,-1},{10807,3,0,-1},{10808,3,1,-1},{10811,3,0,-1},{10812,3,1,-1}, +{10816,3,0,-1},{10817,3,1,-1},{10750,3,0,-1},{10820,3,0,-1},{10821,3,1,-1}, +{10824,3,0,-1},{10825,3,1,-1},{10829,3,0,-1},{10830,3,1,-1},{10763,3,1,-1}, +{10833,3,0,-1},{10834,3,1,-1},{10837,3,0,-1},{10838,3,1,-1},{10842,3,0,-1}, +{10843,3,1,-1},{10846,3,0,-1},{10847,3,1,-1},{10850,3,0,-1},{10851,3,1,-1}, +{10855,3,0,-1},{10856,3,1,-1},{10859,3,0,-1},{10860,3,1,-1},{10863,3,0,-1}, +{10864,3,1,-1},{10868,3,0,-1},{10869,3,1,-1},{10872,3,0,-1},{10873,3,1,-1}, +{10876,3,0,-1},{10877,3,1,-1},{10881,3,0,-1},{10882,3,1,-1},{10885,3,0,-1}, +{10886,3,1,-1},{10889,3,0,-1},{10890,3,1,-1},{10894,3,0,-1},{10895,3,1,-1}, +{10898,3,0,-1},{10899,3,1,-1},{10902,3,0,-1},{10903,3,1,-1},{10907,3,0,-1}, +{10908,3,1,-1},{10911,3,0,-1},{10912,3,1,-1},{10915,3,0,-1},{10916,3,1,-1}, +{10920,3,0,-1},{10921,3,1,-1},{10854,3,0,-1},{10924,3,0,-1},{10925,3,1,-1}, +{10928,3,0,-1},{10929,3,1,-1},{10933,3,0,-1},{10934,3,1,-1},{10867,3,1,-1}, +{10937,3,0,-1},{10938,3,1,-1},{10941,3,0,-1},{10942,3,1,-1},{10946,3,0,-1}, +{10947,3,1,-1},{10950,3,0,-1},{10951,3,1,-1},{10954,3,0,-1},{10955,3,1,-1}, +{10959,3,0,-1},{10960,3,1,-1},{10963,3,0,-1},{10964,3,1,-1},{10967,3,0,-1}, +{10968,3,1,-1},{10972,3,0,-1},{10973,3,1,-1},{10976,3,0,-1},{10977,3,1,-1}, +{10980,3,0,-1},{10981,3,1,-1},{10985,3,0,-1},{10986,3,1,-1},{10989,3,0,-1}, +{10990,3,1,-1},{10993,3,0,-1},{10994,3,1,-1},{10998,3,0,-1},{10999,3,1,-1}, +{11002,3,0,-1},{11003,3,1,-1},{11006,3,0,-1},{11007,3,1,-1},{11011,3,0,-1}, +{11012,3,1,-1},{11015,3,0,-1},{11016,3,1,-1},{11019,3,0,-1},{11020,3,1,-1}, +{11024,3,0,-1},{11025,3,1,-1},{10958,3,0,-1},{11028,3,0,-1},{11029,3,1,-1}, +{11032,3,0,-1},{11033,3,1,-1},{11037,3,0,-1},{11038,3,1,-1},{10971,3,1,-1}, +{11041,3,0,-1},{11042,3,1,-1},{11045,3,0,-1},{11046,3,1,-1},{11050,3,0,-1}, +{11051,3,1,-1},{11054,3,0,-1},{11055,3,1,-1},{11058,3,0,-1},{11059,3,1,-1}, +{11063,3,0,-1},{11064,3,1,-1},{11067,3,0,-1},{11068,3,1,-1},{11071,3,0,-1}, +{11072,3,1,-1},{11076,3,0,-1},{11077,3,1,-1},{11080,3,0,-1},{11081,3,1,-1}, +{11084,3,0,-1},{11085,3,1,-1},{11089,3,0,-1},{11090,3,1,-1},{11093,3,0,-1}, +{11094,3,1,-1},{11097,3,0,-1},{11098,3,1,-1},{11102,3,0,-1},{11103,3,1,-1}, +{11106,3,0,-1},{11107,3,1,-1},{11110,3,0,-1},{11111,3,1,-1},{11115,3,0,-1}, +{11116,3,1,-1},{11119,3,0,-1},{11120,3,1,-1},{11123,3,0,-1},{11124,3,1,-1}, +{11128,3,0,-1},{11129,3,1,-1},{11062,3,0,-1},{11132,3,0,-1},{11133,3,1,-1}, +{11136,3,0,-1},{11137,3,1,-1},{11141,3,0,-1},{11142,3,1,-1},{11075,3,1,-1}, +{11145,3,0,-1},{11146,3,1,-1},{11149,3,0,-1},{11150,3,1,-1},{11154,3,0,-1}, +{11155,3,1,-1},{11158,3,0,-1},{11159,3,1,-1},{11162,3,0,-1},{11163,3,1,-1}, +{11167,3,0,-1},{11168,3,1,-1},{11171,3,0,-1},{11172,3,1,-1},{11175,3,0,-1}, +{11176,3,1,-1},{11180,3,0,-1},{11181,3,1,-1},{11184,3,0,-1},{11185,3,1,-1}, +{11188,3,0,-1},{11189,3,1,-1},{11193,3,0,-1},{11194,3,1,-1},{11197,3,0,-1}, +{11198,3,1,-1},{11201,3,0,-1},{11202,3,1,-1},{11206,3,0,-1},{11207,3,1,-1}, +{11210,3,0,-1},{11211,3,1,-1},{11214,3,0,-1},{11215,3,1,-1},{11219,3,0,-1}, +{11220,3,1,-1},{11223,3,0,-1},{11224,3,1,-1},{11227,3,0,-1},{11228,3,1,-1}, +{11232,3,0,-1},{11233,3,1,-1},{11166,3,0,-1},{11236,3,0,-1},{11237,3,1,-1}, +{11240,3,0,-1},{11241,3,1,-1},{11245,3,0,-1},{11246,3,1,-1},{11179,3,1,-1}, +{11249,3,0,-1},{11250,3,1,-1},{11253,3,0,-1},{11254,3,1,-1},{11258,3,0,-1}, +{11259,3,1,-1},{11262,3,0,-1},{11263,3,1,-1},{11266,3,0,-1},{11267,3,1,-1}, +{11271,3,0,-1},{11272,3,1,-1},{11275,3,0,-1},{11276,3,1,-1},{11279,3,0,-1}, +{11280,3,1,-1},{11284,3,0,-1},{11285,3,1,-1},{11288,3,0,-1},{11289,3,1,-1}, +{11292,3,0,-1},{11293,3,1,-1},{11297,3,0,-1},{11298,3,1,-1},{11301,3,0,-1}, +{11302,3,1,-1},{11305,3,0,-1},{11306,3,1,-1},{11310,3,0,-1},{11311,3,1,-1}, +{11314,3,0,-1},{11315,3,1,-1},{11318,3,0,-1},{11319,3,1,-1},{11323,3,0,-1}, +{11324,3,1,-1},{11327,3,0,-1},{11328,3,1,-1},{11331,3,0,-1},{11332,3,1,-1}, +{11336,3,0,-1},{11337,3,1,-1},{11270,3,0,-1},{11340,3,0,-1},{11341,3,1,-1}, +{11344,3,0,-1},{11345,3,1,-1},{11349,3,0,-1},{11350,3,1,-1},{11283,3,1,-1}, +{11353,3,0,-1},{11354,3,1,-1},{11357,3,0,-1},{11358,3,1,-1},{11362,3,0,-1}, +{11363,3,1,-1},{11366,3,0,-1},{11367,3,1,-1},{11370,3,0,-1},{11371,3,1,-1}, +{11375,3,0,-1},{11376,3,1,-1},{11379,3,0,-1},{11380,3,1,-1},{11383,3,0,-1}, +{11384,3,1,-1},{11388,3,0,-1},{11389,3,1,-1},{11392,3,0,-1},{11393,3,1,-1}, +{11396,3,0,-1},{11397,3,1,-1},{11401,3,0,-1},{11402,3,1,-1},{11405,3,0,-1}, +{11406,3,1,-1},{11409,3,0,-1},{11410,3,1,-1},{11414,3,0,-1},{11415,3,1,-1}, +{11418,3,0,-1},{11419,3,1,-1},{11422,3,0,-1},{11423,3,1,-1},{11427,3,0,-1}, +{11428,3,1,-1},{11431,3,0,-1},{11432,3,1,-1},{11435,3,0,-1},{11436,3,1,-1}, +{11440,3,0,-1},{11441,3,1,-1},{11374,3,0,-1},{11444,3,0,-1},{11445,3,1,-1}, +{11448,3,0,-1},{11449,3,1,-1},{11453,3,0,-1},{11454,3,1,-1},{11387,3,1,-1}, +{11457,3,0,-1},{11458,3,1,-1},{11461,3,0,-1},{11462,3,1,-1},{11466,3,0,-1}, +{11467,3,1,-1},{11470,3,0,-1},{11471,3,1,-1},{11474,3,0,-1},{11475,3,1,-1}, +{11479,3,0,-1},{11480,3,1,-1},{11483,3,0,-1},{11484,3,1,-1},{11487,3,0,-1}, +{11488,3,1,-1},{11492,3,0,-1},{11493,3,1,-1},{11496,3,0,-1},{11497,3,1,-1}, +{11500,3,0,-1},{11501,3,1,-1},{11505,3,0,-1},{11506,3,1,-1},{11509,3,0,-1}, +{11510,3,1,-1},{11513,3,0,-1},{11514,3,1,-1},{11518,3,0,-1},{11519,3,1,-1}, +{11522,3,0,-1},{11523,3,1,-1},{11526,3,0,-1},{11527,3,1,-1},{11531,3,0,-1}, +{11532,3,1,-1},{11535,3,0,-1},{11536,3,1,-1},{11539,3,0,-1},{11540,3,1,-1}, +{11544,3,0,-1},{11545,3,1,-1},{11478,3,0,-1},{11548,3,0,-1},{11549,3,1,-1}, +{11552,3,0,-1},{11553,3,1,-1},{11557,3,0,-1},{11558,3,1,-1},{11491,3,1,-1}, +{11561,3,0,-1},{11562,3,1,-1},{11565,3,0,-1},{11566,3,1,-1},{11570,3,0,-1}, +{11571,3,1,-1},{11574,3,0,-1},{11575,3,1,-1},{11578,3,0,-1},{11579,3,1,-1}, +{11583,3,0,-1},{11584,3,1,-1},{11587,3,0,-1},{11588,3,1,-1},{11591,3,0,-1}, +{11592,3,1,-1},{11596,3,0,-1},{11597,3,1,-1},{11600,3,0,-1},{11601,3,1,-1}, +{11604,3,0,-1},{11605,3,1,-1},{11609,3,0,-1},{11610,3,1,-1},{11613,3,0,-1}, +{11614,3,1,-1},{11617,3,0,-1},{11618,3,1,-1},{11622,3,0,-1},{11623,3,1,-1}, +{11626,3,0,-1},{11627,3,1,-1},{11630,3,0,-1},{11631,3,1,-1},{11635,3,0,-1}, +{11636,3,1,-1},{11639,3,0,-1},{11640,3,1,-1},{11643,3,0,-1},{11644,3,1,-1}, +{11648,3,0,-1},{11649,3,1,-1},{11582,3,0,-1},{11652,3,0,-1},{11653,3,1,-1}, +{11656,3,0,-1},{11657,3,1,-1},{11661,3,0,-1},{11662,3,1,-1},{11595,3,1,-1}, +{11665,3,0,-1},{11666,3,1,-1},{11669,3,0,-1},{11670,3,1,-1},{11674,3,0,-1}, +{11675,3,1,-1},{11678,3,0,-1},{11679,3,1,-1},{11682,3,0,-1},{11683,3,1,-1}, +{11687,3,0,-1},{11688,3,1,-1},{11691,3,0,-1},{11692,3,1,-1},{11695,3,0,-1}, +{11696,3,1,-1},{11700,3,0,-1},{11701,3,1,-1},{11704,3,0,-1},{11705,3,1,-1}, +{11708,3,0,-1},{11709,3,1,-1},{11713,3,0,-1},{11714,3,1,-1},{11717,3,0,-1}, +{11718,3,1,-1},{11721,3,0,-1},{11722,3,1,-1},{11726,3,0,-1},{11727,3,1,-1}, +{11730,3,0,-1},{11731,3,1,-1},{11734,3,0,-1},{11735,3,1,-1},{11739,3,0,-1}, +{11740,3,1,-1},{11743,3,0,-1},{11744,3,1,-1},{11747,3,0,-1},{11748,3,1,-1}, +{11752,3,0,-1},{11753,3,1,-1},{11686,3,0,-1},{11756,3,0,-1},{11757,3,1,-1}, +{11760,3,0,-1},{11761,3,1,-1},{11765,3,0,-1},{11766,3,1,-1},{11699,3,1,-1}, +{11769,3,0,-1},{11770,3,1,-1},{11773,3,0,-1},{11774,3,1,-1},{11778,3,0,-1}, +{11779,3,1,-1},{11782,3,0,-1},{11783,3,1,-1},{11786,3,0,-1},{11787,3,1,-1}, +{11791,3,0,-1},{11792,3,1,-1},{11795,3,0,-1},{11796,3,1,-1},{11799,3,0,-1}, +{11800,3,1,-1},{11804,3,0,-1},{11805,3,1,-1},{11808,3,0,-1},{11809,3,1,-1}, +{11812,3,0,-1},{11813,3,1,-1},{11817,3,0,-1},{11818,3,1,-1},{11821,3,0,-1}, +{11822,3,1,-1},{11825,3,0,-1},{11826,3,1,-1},{11830,3,0,-1},{11831,3,1,-1}, +{11834,3,0,-1},{11835,3,1,-1},{11838,3,0,-1},{11839,3,1,-1},{11843,3,0,-1}, +{11844,3,1,-1},{11847,3,0,-1},{11848,3,1,-1},{11851,3,0,-1},{11852,3,1,-1}, +{11856,3,0,-1},{11857,3,1,-1},{11790,3,0,-1},{11860,3,0,-1},{11861,3,1,-1}, +{11864,3,0,-1},{11865,3,1,-1},{11869,3,0,-1},{11870,3,1,-1},{11803,3,1,-1}, +{11873,3,0,-1},{11874,3,1,-1},{11877,3,0,-1},{11878,3,1,-1},{11882,3,0,-1}, +{11883,3,1,-1},{11886,3,0,-1},{11887,3,1,-1},{11890,3,0,-1},{11891,3,1,-1}, +{11895,3,0,-1},{11896,3,1,-1},{11899,3,0,-1},{11900,3,1,-1},{11903,3,0,-1}, +{11904,3,1,-1},{11908,3,0,-1},{11909,3,1,-1},{11912,3,0,-1},{11913,3,1,-1}, +{11916,3,0,-1},{11917,3,1,-1},{11921,3,0,-1},{11922,3,1,-1},{11925,3,0,-1}, +{11926,3,1,-1},{11929,3,0,-1},{11930,3,1,-1},{11934,3,0,-1},{11935,3,1,-1}, +{11938,3,0,-1},{11939,3,1,-1},{11942,3,0,-1},{11943,3,1,-1},{11947,3,0,-1}, +{11948,3,1,-1},{11951,3,0,-1},{11952,3,1,-1},{11955,3,0,-1},{11956,3,1,-1}, +{11960,3,0,-1},{11961,3,1,-1},{11894,3,0,-1},{11964,3,0,-1},{11965,3,1,-1}, +{11968,3,0,-1},{11969,3,1,-1},{11973,3,0,-1},{11974,3,1,-1},{11907,3,1,-1}, +{11977,3,0,-1},{11978,3,1,-1},{11981,3,0,-1},{11982,3,1,-1},{11986,3,0,-1}, +{11987,3,1,-1},{11990,3,0,-1},{11991,3,1,-1},{11994,3,0,-1},{11995,3,1,-1}, +{11999,3,0,-1},{12000,3,1,-1},{12003,3,0,-1},{12004,3,1,-1},{12007,3,0,-1}, +{12008,3,1,-1},{12012,3,0,-1},{12013,3,1,-1},{12016,3,0,-1},{12017,3,1,-1}, +{12020,3,0,-1},{12021,3,1,-1},{12025,3,0,-1},{12026,3,1,-1},{12029,3,0,-1}, +{12030,3,1,-1},{12033,3,0,-1},{12034,3,1,-1},{12038,3,0,-1},{12039,3,1,-1}, +{12042,3,0,-1},{12043,3,1,-1},{12046,3,0,-1},{12047,3,1,-1},{12051,3,0,-1}, +{12052,3,1,-1},{12055,3,0,-1},{12056,3,1,-1},{12059,3,0,-1},{12060,3,1,-1}, +{12064,3,0,-1},{12065,3,1,-1},{11998,3,0,-1},{12068,3,0,-1},{12069,3,1,-1}, +{12072,3,0,-1},{12073,3,1,-1},{12077,3,0,-1},{12078,3,1,-1},{12011,3,1,-1}, +{12081,3,0,-1},{12082,3,1,-1},{12085,3,0,-1},{12086,3,1,-1},{12090,3,0,-1}, +{12091,3,1,-1},{12094,3,0,-1},{12095,3,1,-1},{12098,3,0,-1},{12099,3,1,-1}, +{12103,3,0,-1},{12104,3,1,-1},{12107,3,0,-1},{12108,3,1,-1},{12111,3,0,-1}, +{12112,3,1,-1},{12116,3,0,-1},{12117,3,1,-1},{12120,3,0,-1},{12121,3,1,-1}, +{12124,3,0,-1},{12125,3,1,-1},{12129,3,0,-1},{12130,3,1,-1},{12133,3,0,-1}, +{12134,3,1,-1},{12137,3,0,-1},{12138,3,1,-1},{12142,3,0,-1},{12143,3,1,-1}, +{12146,3,0,-1},{12147,3,1,-1},{12150,3,0,-1},{12151,3,1,-1},{12155,3,0,-1}, +{12156,3,1,-1},{12159,3,0,-1},{12160,3,1,-1},{12164,3,1,-1},{12168,3,0,-1}, +{12169,3,1,-1},{12102,3,0,-1},{12172,3,0,-1},{12173,3,1,-1},{12176,3,0,-1}, +{12177,3,1,-1},{12181,3,0,-1},{12182,3,1,-1},{12115,3,1,-1},{12185,3,0,-1}, +{12186,3,1,-1},{12189,3,0,-1},{12190,3,1,-1},{12194,3,0,-1},{12195,3,1,-1}, +{12198,3,0,-1},{12199,3,1,-1},{12202,3,0,-1},{12203,3,1,-1},{12207,3,0,-1}, +{12208,3,1,-1},{12211,3,0,-1},{12212,3,1,-1},{12216,3,1,-1},{12220,3,0,-1}, +{12221,3,1,-1},{12224,3,0,-1},{12225,3,1,-1},{12228,3,0,-1},{12229,3,1,-1}, +{12233,3,0,-1},{12234,3,1,-1},{12237,3,0,-1},{12238,3,1,-1},{12241,3,0,-1}, +{12242,3,1,-1},{12246,3,0,-1},{12247,3,1,-1},{12250,3,0,-1},{12251,3,1,-1}, +{12254,3,0,-1},{12255,3,1,-1},{12260,3,1,-1},{12264,3,1,-1},{12268,3,1,-1}, +{12273,3,1,-1},{12281,3,1,-1},{12286,3,1,-1},{12290,3,1,-1},{12294,3,1,-1}, +{12299,3,1,-1},{12303,3,1,-1},{12307,3,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_4_ss0_ss1[] = { +{7704,4,0,-1},{7713,4,0,-1},{7722,4,0,-1},{7730,4,0,-1},{7739,4,0,-1}, +{7748,4,0,-1},{7756,4,0,-1},{7765,4,0,-1},{7774,4,0,-1},{7782,4,0,-1}, +{7791,4,0,-1},{7800,4,0,-1},{7808,4,0,-1},{7817,4,0,-1},{7826,4,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7843,4,0,-1},{7852,4,0,-1},{7860,4,0,-1}, +{7865,4,0,-1},{7869,4,0,-1},{7873,4,0,-1},{7878,4,0,-1},{7882,4,0,-1}, +{7886,4,0,-1},{7891,4,0,-1},{7895,4,0,-1},{7899,4,0,-1},{7904,4,0,-1}, +{7908,4,0,-1},{7912,4,0,-1},{7917,4,0,-1},{7921,4,0,-1},{7925,4,0,-1}, +{7930,4,0,-1},{7864,4,0,-1},{7934,4,0,-1},{7938,4,0,-1},{7943,4,0,-1}, +{7947,4,0,-1},{7951,4,0,-1},{7956,4,0,-1},{7960,4,0,-1},{7964,4,0,-1}, +{7969,4,0,-1},{7973,4,0,-1},{7977,4,0,-1},{7982,4,0,-1},{7986,4,0,-1}, +{7990,4,0,-1},{7995,4,0,-1},{7999,4,0,-1},{8003,4,0,-1},{8008,4,0,-1}, +{8012,4,0,-1},{8016,4,0,-1},{8021,4,0,-1},{8025,4,0,-1},{8029,4,0,-1}, +{8034,4,0,-1},{7968,4,0,-1},{8038,4,0,-1},{8042,4,0,-1},{8047,4,0,-1}, +{8051,4,0,-1},{8055,4,0,-1},{8060,4,0,-1},{8064,4,0,-1},{8068,4,0,-1}, +{8073,4,0,-1},{8077,4,0,-1},{8081,4,0,-1},{8086,4,0,-1},{8090,4,0,-1}, +{8094,4,0,-1},{8099,4,0,-1},{8103,4,0,-1},{8107,4,0,-1},{8112,4,0,-1}, +{8116,4,0,-1},{8120,4,0,-1},{8121,4,1,-1},{8125,4,0,-1},{8129,4,0,-1}, +{8130,4,1,-1},{8133,4,0,-1},{8138,4,0,-1},{8139,4,1,-1},{8072,4,0,-1}, +{8142,4,0,-1},{8146,4,0,-1},{8147,4,1,-1},{8151,4,0,-1},{8155,4,0,-1}, +{8156,4,1,-1},{8159,4,0,-1},{8164,4,0,-1},{8165,4,1,-1},{8168,4,0,-1}, +{8172,4,0,-1},{8173,4,1,-1},{8177,4,0,-1},{8181,4,0,-1},{8182,4,1,-1}, +{8185,4,0,-1},{8190,4,0,-1},{8191,4,1,-1},{8194,4,0,-1},{8198,4,0,-1}, +{8199,4,1,-1},{8203,4,0,-1},{8207,4,0,-1},{8208,4,1,-1},{8211,4,0,-1}, +{8216,4,0,-1},{8217,4,1,-1},{8220,4,0,-1},{8224,4,0,-1},{8225,4,1,-1}, +{8229,4,0,-1},{8230,4,1,-1},{8233,4,0,-1},{8234,4,1,-1},{8237,4,0,-1}, +{8238,4,1,-1},{8242,4,0,-1},{8243,4,1,-1},{8176,4,0,-1},{8246,4,0,-1}, +{8247,4,1,-1},{8250,4,0,-1},{8251,4,1,-1},{8255,4,0,-1},{8189,4,1,-1}, +{8259,4,0,-1},{8260,4,1,-1},{8263,4,0,-1},{8264,4,1,-1},{8268,4,0,-1}, +{8269,4,1,-1},{8272,4,0,-1},{8273,4,1,-1},{8276,4,0,-1},{8277,4,1,-1}, +{8281,4,0,-1},{8282,4,1,-1},{8285,4,0,-1},{8286,4,1,-1},{8289,4,0,-1}, +{8290,4,1,-1},{8294,4,0,-1},{8295,4,1,-1},{8299,4,1,-1},{8302,4,0,-1}, +{8303,4,1,-1},{8307,4,0,-1},{8308,4,1,-1},{8311,4,0,-1},{8312,4,1,-1}, +{8315,4,0,-1},{8316,4,1,-1},{8320,4,0,-1},{8321,4,1,-1},{8324,4,0,-1}, +{8325,4,1,-1},{8328,4,0,-1},{8329,4,1,-1},{8333,4,0,-1},{8334,4,1,-1}, +{8337,4,0,-1},{8338,4,1,-1},{8341,4,0,-1},{8342,4,1,-1},{8346,4,0,-1}, +{8347,4,1,-1},{8280,4,0,-1},{8350,4,0,-1},{8351,4,1,-1},{8354,4,0,-1}, +{8355,4,1,-1},{8359,4,0,-1},{8360,4,1,-1},{8293,4,1,-1},{8363,4,0,-1}, +{8364,4,1,-1},{8367,4,0,-1},{8368,4,1,-1},{8372,4,0,-1},{8373,4,1,-1}, +{8376,4,0,-1},{8377,4,1,-1},{8380,4,0,-1},{8381,4,1,-1},{8385,4,0,-1}, +{8386,4,1,-1},{8389,4,0,-1},{8390,4,1,-1},{8393,4,0,-1},{8394,4,1,-1}, +{8398,4,0,-1},{8399,4,1,-1},{8402,4,0,-1},{8403,4,1,-1},{8406,4,0,-1}, +{8407,4,1,-1},{8411,4,0,-1},{8412,4,1,-1},{8415,4,0,-1},{8416,4,1,-1}, +{8419,4,0,-1},{8420,4,1,-1},{8424,4,0,-1},{8425,4,1,-1},{8428,4,0,-1}, +{8429,4,1,-1},{8432,4,0,-1},{8433,4,1,-1},{8437,4,0,-1},{8438,4,1,-1}, +{8441,4,0,-1},{8442,4,1,-1},{8445,4,0,-1},{8446,4,1,-1},{8450,4,0,-1}, +{8451,4,1,-1},{8384,4,0,-1},{8454,4,0,-1},{8455,4,1,-1},{8458,4,0,-1}, +{8459,4,1,-1},{8463,4,0,-1},{8397,4,1,-1},{8467,4,0,-1},{8468,4,1,-1}, +{8471,4,0,-1},{8472,4,1,-1},{8476,4,0,-1},{8477,4,1,-1},{8480,4,0,-1}, +{8481,4,1,-1},{8484,4,0,-1},{8485,4,1,-1},{8489,4,0,-1},{8490,4,1,-1}, +{8493,4,0,-1},{8494,4,1,-1},{8497,4,0,-1},{8498,4,1,-1},{8502,4,0,-1}, +{8503,4,1,-1},{8507,4,1,-1},{8510,4,0,-1},{8511,4,1,-1},{8515,4,0,-1}, +{8519,4,0,-1},{8520,4,1,-1},{8523,4,0,-1},{8524,4,1,-1},{8528,4,0,-1}, +{8529,4,1,-1},{8532,4,0,-1},{8533,4,1,-1},{8536,4,0,-1},{8537,4,1,-1}, +{8541,4,0,-1},{8542,4,1,-1},{8545,4,0,-1},{8546,4,1,-1},{8549,4,0,-1}, +{8550,4,1,-1},{8554,4,0,-1},{8555,4,1,-1},{8488,4,0,-1},{8558,4,0,-1}, +{8559,4,1,-1},{8562,4,0,-1},{8563,4,1,-1},{8567,4,0,-1},{8568,4,1,-1}, +{8501,4,1,-1},{8571,4,0,-1},{8572,4,1,-1},{8575,4,0,-1},{8576,4,1,-1}, +{8580,4,0,-1},{8581,4,1,-1},{8584,4,0,-1},{8585,4,1,-1},{8588,4,0,-1}, +{8589,4,1,-1},{8593,4,0,-1},{8594,4,1,-1},{8597,4,0,-1},{8598,4,1,-1}, +{8601,4,0,-1},{8602,4,1,-1},{8606,4,0,-1},{8607,4,1,-1},{8610,4,0,-1}, +{8611,4,1,-1},{8614,4,0,-1},{8615,4,1,-1},{8619,4,0,-1},{8620,4,1,-1}, +{8623,4,0,-1},{8624,4,1,-1},{8627,4,0,-1},{8628,4,1,-1},{8632,4,0,-1}, +{8633,4,1,-1},{8636,4,0,-1},{8637,4,1,-1},{8640,4,0,-1},{8641,4,1,-1}, +{8645,4,0,-1},{8646,4,1,-1},{8649,4,0,-1},{8650,4,1,-1},{8653,4,0,-1}, +{8654,4,1,-1},{8658,4,0,-1},{8659,4,1,-1},{8592,4,0,-1},{8662,4,0,-1}, +{8663,4,1,-1},{8666,4,0,-1},{8667,4,1,-1},{8671,4,0,-1},{8672,4,1,-1}, +{8605,4,1,-1},{8675,4,0,-1},{8676,4,1,-1},{8679,4,0,-1},{8680,4,1,-1}, +{8684,4,0,-1},{8685,4,1,-1},{8688,4,0,-1},{8689,4,1,-1},{8692,4,0,-1}, +{8693,4,1,-1},{8697,4,0,-1},{8698,4,1,-1},{8701,4,0,-1},{8702,4,1,-1}, +{8705,4,0,-1},{8706,4,1,-1},{8710,4,0,-1},{8711,4,1,-1},{8714,4,0,-1}, +{8715,4,1,-1},{8718,4,0,-1},{8719,4,1,-1},{8723,4,0,-1},{8724,4,1,-1}, +{8727,4,0,-1},{8728,4,1,-1},{8731,4,0,-1},{8732,4,1,-1},{8736,4,0,-1}, +{8737,4,1,-1},{8740,4,0,-1},{8741,4,1,-1},{8744,4,0,-1},{8745,4,1,-1}, +{8749,4,0,-1},{8750,4,1,-1},{8753,4,0,-1},{8754,4,1,-1},{8757,4,0,-1}, +{8758,4,1,-1},{8762,4,0,-1},{8763,4,1,-1},{8696,4,0,-1},{8766,4,0,-1}, +{8767,4,1,-1},{8770,4,0,-1},{8771,4,1,-1},{8775,4,0,-1},{8776,4,1,-1}, +{8709,4,1,-1},{8779,4,0,-1},{8780,4,1,-1},{8783,4,0,-1},{8784,4,1,-1}, +{8788,4,0,-1},{8789,4,1,-1},{8792,4,0,-1},{8793,4,1,-1},{8796,4,0,-1}, +{8797,4,1,-1},{8801,4,0,-1},{8802,4,1,-1},{8805,4,0,-1},{8806,4,1,-1}, +{8809,4,0,-1},{8810,4,1,-1},{8814,4,0,-1},{8815,4,1,-1},{8818,4,0,-1}, +{8819,4,1,-1},{8822,4,0,-1},{8823,4,1,-1},{8827,4,0,-1},{8828,4,1,-1}, +{8831,4,0,-1},{8832,4,1,-1},{8835,4,0,-1},{8836,4,1,-1},{8840,4,0,-1}, +{8841,4,1,-1},{8844,4,0,-1},{8845,4,1,-1},{8848,4,0,-1},{8849,4,1,-1}, +{8853,4,0,-1},{8854,4,1,-1},{8857,4,0,-1},{8858,4,1,-1},{8861,4,0,-1}, +{8862,4,1,-1},{8866,4,0,-1},{8867,4,1,-1},{8800,4,0,-1},{8870,4,0,-1}, +{8871,4,1,-1},{8874,4,0,-1},{8875,4,1,-1},{8879,4,0,-1},{8880,4,1,-1}, +{8813,4,1,-1},{8883,4,0,-1},{8884,4,1,-1},{8887,4,0,-1},{8888,4,1,-1}, +{8892,4,0,-1},{8893,4,1,-1},{8896,4,0,-1},{8897,4,1,-1},{8900,4,0,-1}, +{8901,4,1,-1},{8905,4,0,-1},{8906,4,1,-1},{8909,4,0,-1},{8910,4,1,-1}, +{8913,4,0,-1},{8914,4,1,-1},{8918,4,0,-1},{8919,4,1,-1},{8922,4,0,-1}, +{8923,4,1,-1},{8926,4,0,-1},{8927,4,1,-1},{8931,4,0,-1},{8932,4,1,-1}, +{8935,4,0,-1},{8936,4,1,-1},{8939,4,0,-1},{8940,4,1,-1},{8944,4,0,-1}, +{8945,4,1,-1},{8948,4,0,-1},{8949,4,1,-1},{8952,4,0,-1},{8953,4,1,-1}, +{8957,4,0,-1},{8958,4,1,-1},{8961,4,0,-1},{8962,4,1,-1},{8965,4,0,-1}, +{8966,4,1,-1},{8970,4,0,-1},{8971,4,1,-1},{8904,4,0,-1},{8974,4,0,-1}, +{8975,4,1,-1},{8978,4,0,-1},{8979,4,1,-1},{8983,4,0,-1},{8984,4,1,-1}, +{8917,4,1,-1},{8987,4,0,-1},{8988,4,1,-1},{8991,4,0,-1},{8992,4,1,-1}, +{8996,4,0,-1},{8997,4,1,-1},{9000,4,0,-1},{9001,4,1,-1},{9004,4,0,-1}, +{9005,4,1,-1},{9009,4,0,-1},{9010,4,1,-1},{9013,4,0,-1},{9014,4,1,-1}, +{9017,4,0,-1},{9018,4,1,-1},{9022,4,0,-1},{9023,4,1,-1},{9026,4,0,-1}, +{9027,4,1,-1},{9030,4,0,-1},{9031,4,1,-1},{9035,4,0,-1},{9036,4,1,-1}, +{9039,4,0,-1},{9040,4,1,-1},{9043,4,0,-1},{9044,4,1,-1},{9048,4,0,-1}, +{9049,4,1,-1},{9052,4,0,-1},{9053,4,1,-1},{9056,4,0,-1},{9057,4,1,-1}, +{9061,4,0,-1},{9062,4,1,-1},{9065,4,0,-1},{9066,4,1,-1},{9069,4,0,-1}, +{9070,4,1,-1},{9074,4,0,-1},{9075,4,1,-1},{9008,4,0,-1},{9078,4,0,-1}, +{9079,4,1,-1},{9082,4,0,-1},{9083,4,1,-1},{9087,4,0,-1},{9088,4,1,-1}, +{9021,4,1,-1},{9091,4,0,-1},{9092,4,1,-1},{9095,4,0,-1},{9096,4,1,-1}, +{9100,4,0,-1},{9101,4,1,-1},{9104,4,0,-1},{9105,4,1,-1},{9108,4,0,-1}, +{9109,4,1,-1},{9113,4,0,-1},{9114,4,1,-1},{9117,4,0,-1},{9118,4,1,-1}, +{9121,4,0,-1},{9122,4,1,-1},{9126,4,0,-1},{9127,4,1,-1},{9130,4,0,-1}, +{9131,4,1,-1},{9134,4,0,-1},{9135,4,1,-1},{9139,4,0,-1},{9140,4,1,-1}, +{9143,4,0,-1},{9144,4,1,-1},{9147,4,0,-1},{9148,4,1,-1},{9152,4,0,-1}, +{9153,4,1,-1},{9156,4,0,-1},{9157,4,1,-1},{9160,4,0,-1},{9161,4,1,-1}, +{9165,4,0,-1},{9166,4,1,-1},{9169,4,0,-1},{9170,4,1,-1},{9173,4,0,-1}, +{9174,4,1,-1},{9178,4,0,-1},{9179,4,1,-1},{9112,4,0,-1},{9182,4,0,-1}, +{9183,4,1,-1},{9186,4,0,-1},{9187,4,1,-1},{9191,4,0,-1},{9192,4,1,-1}, +{9125,4,1,-1},{9195,4,0,-1},{9196,4,1,-1},{9199,4,0,-1},{9200,4,1,-1}, +{9204,4,0,-1},{9205,4,1,-1},{9208,4,0,-1},{9209,4,1,-1},{9212,4,0,-1}, +{9213,4,1,-1},{9217,4,0,-1},{9218,4,1,-1},{9221,4,0,-1},{9222,4,1,-1}, +{9225,4,0,-1},{9226,4,1,-1},{9230,4,0,-1},{9231,4,1,-1},{9234,4,0,-1}, +{9235,4,1,-1},{9238,4,0,-1},{9239,4,1,-1},{9243,4,0,-1},{9244,4,1,-1}, +{9247,4,0,-1},{9248,4,1,-1},{9251,4,0,-1},{9252,4,1,-1},{9256,4,0,-1}, +{9257,4,1,-1},{9260,4,0,-1},{9261,4,1,-1},{9264,4,0,-1},{9265,4,1,-1}, +{9269,4,0,-1},{9270,4,1,-1},{9273,4,0,-1},{9274,4,1,-1},{9277,4,0,-1}, +{9278,4,1,-1},{9282,4,0,-1},{9283,4,1,-1},{9216,4,0,-1},{9286,4,0,-1}, +{9287,4,1,-1},{9290,4,0,-1},{9291,4,1,-1},{9295,4,0,-1},{9296,4,1,-1}, +{9229,4,1,-1},{9299,4,0,-1},{9300,4,1,-1},{9303,4,0,-1},{9304,4,1,-1}, +{9308,4,0,-1},{9309,4,1,-1},{9312,4,0,-1},{9313,4,1,-1},{9316,4,0,-1}, +{9317,4,1,-1},{9321,4,0,-1},{9322,4,1,-1},{9325,4,0,-1},{9326,4,1,-1}, +{9329,4,0,-1},{9330,4,1,-1},{9334,4,0,-1},{9335,4,1,-1},{9338,4,0,-1}, +{9339,4,1,-1},{9342,4,0,-1},{9343,4,1,-1},{9347,4,0,-1},{9348,4,1,-1}, +{9351,4,0,-1},{9352,4,1,-1},{9355,4,0,-1},{9356,4,1,-1},{9360,4,0,-1}, +{9361,4,1,-1},{9364,4,0,-1},{9365,4,1,-1},{9368,4,0,-1},{9369,4,1,-1}, +{9373,4,0,-1},{9374,4,1,-1},{9377,4,0,-1},{9378,4,1,-1},{9381,4,0,-1}, +{9382,4,1,-1},{9386,4,0,-1},{9387,4,1,-1},{9320,4,0,-1},{9390,4,0,-1}, +{9391,4,1,-1},{9394,4,0,-1},{9395,4,1,-1},{9399,4,0,-1},{9400,4,1,-1}, +{9333,4,1,-1},{9403,4,0,-1},{9404,4,1,-1},{9407,4,0,-1},{9408,4,1,-1}, +{9412,4,0,-1},{9413,4,1,-1},{9416,4,0,-1},{9417,4,1,-1},{9420,4,0,-1}, +{9421,4,1,-1},{9425,4,0,-1},{9426,4,1,-1},{9429,4,0,-1},{9430,4,1,-1}, +{9433,4,0,-1},{9434,4,1,-1},{9438,4,0,-1},{9439,4,1,-1},{9442,4,0,-1}, +{9443,4,1,-1},{9446,4,0,-1},{9447,4,1,-1},{9451,4,0,-1},{9452,4,1,-1}, +{9455,4,0,-1},{9456,4,1,-1},{9459,4,0,-1},{9460,4,1,-1},{9464,4,0,-1}, +{9465,4,1,-1},{9468,4,0,-1},{9469,4,1,-1},{9472,4,0,-1},{9473,4,1,-1}, +{9477,4,0,-1},{9478,4,1,-1},{9481,4,0,-1},{9482,4,1,-1},{9485,4,0,-1}, +{9486,4,1,-1},{9490,4,0,-1},{9491,4,1,-1},{9424,4,0,-1},{9494,4,0,-1}, +{9495,4,1,-1},{9498,4,0,-1},{9499,4,1,-1},{9503,4,0,-1},{9504,4,1,-1}, +{9437,4,1,-1},{9507,4,0,-1},{9508,4,1,-1},{9511,4,0,-1},{9512,4,1,-1}, +{9516,4,0,-1},{9517,4,1,-1},{9520,4,0,-1},{9521,4,1,-1},{9524,4,0,-1}, +{9525,4,1,-1},{9529,4,0,-1},{9530,4,1,-1},{9533,4,0,-1},{9534,4,1,-1}, +{9537,4,0,-1},{9538,4,1,-1},{9542,4,0,-1},{9543,4,1,-1},{9546,4,0,-1}, +{9547,4,1,-1},{9550,4,0,-1},{9551,4,1,-1},{9555,4,0,-1},{9556,4,1,-1}, +{9559,4,0,-1},{9560,4,1,-1},{9563,4,0,-1},{9564,4,1,-1},{9568,4,0,-1}, +{9569,4,1,-1},{9572,4,0,-1},{9573,4,1,-1},{9576,4,0,-1},{9577,4,1,-1}, +{9581,4,0,-1},{9582,4,1,-1},{9585,4,0,-1},{9586,4,1,-1},{9589,4,0,-1}, +{9590,4,1,-1},{9594,4,0,-1},{9595,4,1,-1},{9528,4,0,-1},{9598,4,0,-1}, +{9599,4,1,-1},{9602,4,0,-1},{9603,4,1,-1},{9607,4,0,-1},{9608,4,1,-1}, +{9541,4,1,-1},{9611,4,0,-1},{9612,4,1,-1},{9615,4,0,-1},{9616,4,1,-1}, +{9620,4,0,-1},{9621,4,1,-1},{9624,4,0,-1},{9625,4,1,-1},{9628,4,0,-1}, +{9629,4,1,-1},{9633,4,0,-1},{9634,4,1,-1},{9637,4,0,-1},{9638,4,1,-1}, +{9641,4,0,-1},{9642,4,1,-1},{9646,4,0,-1},{9647,4,1,-1},{9650,4,0,-1}, +{9651,4,1,-1},{9654,4,0,-1},{9655,4,1,-1},{9659,4,0,-1},{9660,4,1,-1}, +{9663,4,0,-1},{9664,4,1,-1},{9667,4,0,-1},{9668,4,1,-1},{9672,4,0,-1}, +{9673,4,1,-1},{9676,4,0,-1},{9677,4,1,-1},{9680,4,0,-1},{9681,4,1,-1}, +{9685,4,0,-1},{9686,4,1,-1},{9689,4,0,-1},{9690,4,1,-1},{9693,4,0,-1}, +{9694,4,1,-1},{9698,4,0,-1},{9699,4,1,-1},{9632,4,0,-1},{9702,4,0,-1}, +{9703,4,1,-1},{9706,4,0,-1},{9707,4,1,-1},{9711,4,0,-1},{9712,4,1,-1}, +{9645,4,1,-1},{9715,4,0,-1},{9716,4,1,-1},{9719,4,0,-1},{9720,4,1,-1}, +{9724,4,0,-1},{9725,4,1,-1},{9728,4,0,-1},{9729,4,1,-1},{9732,4,0,-1}, +{9733,4,1,-1},{9737,4,0,-1},{9738,4,1,-1},{9741,4,0,-1},{9742,4,1,-1}, +{9745,4,0,-1},{9746,4,1,-1},{9750,4,0,-1},{9751,4,1,-1},{9754,4,0,-1}, +{9755,4,1,-1},{9758,4,0,-1},{9759,4,1,-1},{9763,4,0,-1},{9764,4,1,-1}, +{9767,4,0,-1},{9768,4,1,-1},{9771,4,0,-1},{9772,4,1,-1},{9776,4,0,-1}, +{9777,4,1,-1},{9780,4,0,-1},{9781,4,1,-1},{9784,4,0,-1},{9785,4,1,-1}, +{9789,4,0,-1},{9790,4,1,-1},{9793,4,0,-1},{9794,4,1,-1},{9797,4,0,-1}, +{9798,4,1,-1},{9802,4,0,-1},{9803,4,1,-1},{9736,4,0,-1},{9806,4,0,-1}, +{9807,4,1,-1},{9810,4,0,-1},{9811,4,1,-1},{9815,4,0,-1},{9816,4,1,-1}, +{9749,4,1,-1},{9819,4,0,-1},{9820,4,1,-1},{9823,4,0,-1},{9824,4,1,-1}, +{9828,4,0,-1},{9829,4,1,-1},{9832,4,0,-1},{9833,4,1,-1},{9836,4,0,-1}, +{9837,4,1,-1},{9841,4,0,-1},{9842,4,1,-1},{9845,4,0,-1},{9846,4,1,-1}, +{9849,4,0,-1},{9850,4,1,-1},{9854,4,0,-1},{9855,4,1,-1},{9858,4,0,-1}, +{9859,4,1,-1},{9862,4,0,-1},{9863,4,1,-1},{9867,4,0,-1},{9868,4,1,-1}, +{9871,4,0,-1},{9872,4,1,-1},{9875,4,0,-1},{9876,4,1,-1},{9880,4,0,-1}, +{9881,4,1,-1},{9884,4,0,-1},{9885,4,1,-1},{9888,4,0,-1},{9889,4,1,-1}, +{9893,4,0,-1},{9894,4,1,-1},{9897,4,0,-1},{9898,4,1,-1},{9901,4,0,-1}, +{9902,4,1,-1},{9906,4,0,-1},{9907,4,1,-1},{9840,4,0,-1},{9910,4,0,-1}, +{9911,4,1,-1},{9914,4,0,-1},{9915,4,1,-1},{9919,4,0,-1},{9920,4,1,-1}, +{9853,4,1,-1},{9923,4,0,-1},{9924,4,1,-1},{9927,4,0,-1},{9928,4,1,-1}, +{9932,4,0,-1},{9933,4,1,-1},{9936,4,0,-1},{9937,4,1,-1},{9940,4,0,-1}, +{9941,4,1,-1},{9945,4,0,-1},{9946,4,1,-1},{9949,4,0,-1},{9950,4,1,-1}, +{9953,4,0,-1},{9954,4,1,-1},{9958,4,0,-1},{9959,4,1,-1},{9962,4,0,-1}, +{9963,4,1,-1},{9966,4,0,-1},{9967,4,1,-1},{9971,4,0,-1},{9972,4,1,-1}, +{9975,4,0,-1},{9976,4,1,-1},{9979,4,0,-1},{9980,4,1,-1},{9984,4,0,-1}, +{9985,4,1,-1},{9988,4,0,-1},{9989,4,1,-1},{9992,4,0,-1},{9993,4,1,-1}, +{9997,4,0,-1},{9998,4,1,-1},{10001,4,0,-1},{10002,4,1,-1},{10005,4,0,-1}, +{10006,4,1,-1},{10010,4,0,-1},{10011,4,1,-1},{9944,4,0,-1},{10014,4,0,-1}, +{10015,4,1,-1},{10018,4,0,-1},{10019,4,1,-1},{10023,4,0,-1},{10024,4,1,-1}, +{9957,4,1,-1},{10027,4,0,-1},{10028,4,1,-1},{10031,4,0,-1},{10032,4,1,-1}, +{10036,4,0,-1},{10037,4,1,-1},{10040,4,0,-1},{10041,4,1,-1},{10044,4,0,-1}, +{10045,4,1,-1},{10049,4,0,-1},{10050,4,1,-1},{10053,4,0,-1},{10054,4,1,-1}, +{10057,4,0,-1},{10058,4,1,-1},{10062,4,0,-1},{10063,4,1,-1},{10066,4,0,-1}, +{10067,4,1,-1},{10070,4,0,-1},{10071,4,1,-1},{10075,4,0,-1},{10076,4,1,-1}, +{10079,4,0,-1},{10080,4,1,-1},{10083,4,0,-1},{10084,4,1,-1},{10088,4,0,-1}, +{10089,4,1,-1},{10092,4,0,-1},{10093,4,1,-1},{10096,4,0,-1},{10097,4,1,-1}, +{10101,4,0,-1},{10102,4,1,-1},{10105,4,0,-1},{10106,4,1,-1},{10109,4,0,-1}, +{10110,4,1,-1},{10114,4,0,-1},{10115,4,1,-1},{10048,4,0,-1},{10118,4,0,-1}, +{10119,4,1,-1},{10122,4,0,-1},{10123,4,1,-1},{10127,4,0,-1},{10128,4,1,-1}, +{10061,4,1,-1},{10131,4,0,-1},{10132,4,1,-1},{10135,4,0,-1},{10136,4,1,-1}, +{10140,4,0,-1},{10141,4,1,-1},{10144,4,0,-1},{10145,4,1,-1},{10148,4,0,-1}, +{10149,4,1,-1},{10153,4,0,-1},{10154,4,1,-1},{10157,4,0,-1},{10158,4,1,-1}, +{10161,4,0,-1},{10162,4,1,-1},{10166,4,0,-1},{10167,4,1,-1},{10170,4,0,-1}, +{10171,4,1,-1},{10174,4,0,-1},{10175,4,1,-1},{10179,4,0,-1},{10180,4,1,-1}, +{10183,4,0,-1},{10184,4,1,-1},{10187,4,0,-1},{10188,4,1,-1},{10192,4,0,-1}, +{10193,4,1,-1},{10196,4,0,-1},{10197,4,1,-1},{10200,4,0,-1},{10201,4,1,-1}, +{10205,4,0,-1},{10206,4,1,-1},{10209,4,0,-1},{10210,4,1,-1},{10213,4,0,-1}, +{10214,4,1,-1},{10218,4,0,-1},{10219,4,1,-1},{10152,4,0,-1},{10222,4,0,-1}, +{10223,4,1,-1},{10226,4,0,-1},{10227,4,1,-1},{10231,4,0,-1},{10232,4,1,-1}, +{10165,4,1,-1},{10235,4,0,-1},{10236,4,1,-1},{10239,4,0,-1},{10240,4,1,-1}, +{10244,4,0,-1},{10245,4,1,-1},{10248,4,0,-1},{10249,4,1,-1},{10252,4,0,-1}, +{10253,4,1,-1},{10257,4,0,-1},{10258,4,1,-1},{10261,4,0,-1},{10262,4,1,-1}, +{10265,4,0,-1},{10266,4,1,-1},{10270,4,0,-1},{10271,4,1,-1},{10274,4,0,-1}, +{10275,4,1,-1},{10278,4,0,-1},{10279,4,1,-1},{10283,4,0,-1},{10284,4,1,-1}, +{10287,4,0,-1},{10288,4,1,-1},{10291,4,0,-1},{10292,4,1,-1},{10296,4,0,-1}, +{10297,4,1,-1},{10300,4,0,-1},{10301,4,1,-1},{10304,4,0,-1},{10305,4,1,-1}, +{10309,4,0,-1},{10310,4,1,-1},{10313,4,0,-1},{10314,4,1,-1},{10317,4,0,-1}, +{10318,4,1,-1},{10322,4,0,-1},{10323,4,1,-1},{10256,4,0,-1},{10326,4,0,-1}, +{10327,4,1,-1},{10330,4,0,-1},{10331,4,1,-1},{10335,4,0,-1},{10336,4,1,-1}, +{10269,4,1,-1},{10339,4,0,-1},{10340,4,1,-1},{10343,4,0,-1},{10344,4,1,-1}, +{10348,4,0,-1},{10349,4,1,-1},{10352,4,0,-1},{10353,4,1,-1},{10356,4,0,-1}, +{10357,4,1,-1},{10361,4,0,-1},{10362,4,1,-1},{10365,4,0,-1},{10366,4,1,-1}, +{10369,4,0,-1},{10370,4,1,-1},{10374,4,0,-1},{10375,4,1,-1},{10378,4,0,-1}, +{10379,4,1,-1},{10382,4,0,-1},{10383,4,1,-1},{10387,4,0,-1},{10388,4,1,-1}, +{10391,4,0,-1},{10392,4,1,-1},{10395,4,0,-1},{10396,4,1,-1},{10400,4,0,-1}, +{10401,4,1,-1},{10404,4,0,-1},{10405,4,1,-1},{10408,4,0,-1},{10409,4,1,-1}, +{10413,4,0,-1},{10414,4,1,-1},{10417,4,0,-1},{10418,4,1,-1},{10421,4,0,-1}, +{10422,4,1,-1},{10426,4,0,-1},{10427,4,1,-1},{10360,4,0,-1},{10430,4,0,-1}, +{10431,4,1,-1},{10434,4,0,-1},{10435,4,1,-1},{10439,4,0,-1},{10440,4,1,-1}, +{10373,4,1,-1},{10443,4,0,-1},{10444,4,1,-1},{10447,4,0,-1},{10448,4,1,-1}, +{10452,4,0,-1},{10453,4,1,-1},{10456,4,0,-1},{10457,4,1,-1},{10460,4,0,-1}, +{10461,4,1,-1},{10465,4,0,-1},{10466,4,1,-1},{10469,4,0,-1},{10470,4,1,-1}, +{10473,4,0,-1},{10474,4,1,-1},{10478,4,0,-1},{10479,4,1,-1},{10482,4,0,-1}, +{10483,4,1,-1},{10486,4,0,-1},{10487,4,1,-1},{10491,4,0,-1},{10492,4,1,-1}, +{10495,4,0,-1},{10496,4,1,-1},{10499,4,0,-1},{10500,4,1,-1},{10504,4,0,-1}, +{10505,4,1,-1},{10508,4,0,-1},{10509,4,1,-1},{10512,4,0,-1},{10513,4,1,-1}, +{10517,4,0,-1},{10518,4,1,-1},{10521,4,0,-1},{10522,4,1,-1},{10525,4,0,-1}, +{10526,4,1,-1},{10530,4,0,-1},{10531,4,1,-1},{10464,4,0,-1},{10534,4,0,-1}, +{10535,4,1,-1},{10538,4,0,-1},{10539,4,1,-1},{10543,4,0,-1},{10544,4,1,-1}, +{10477,4,1,-1},{10547,4,0,-1},{10548,4,1,-1},{10551,4,0,-1},{10552,4,1,-1}, +{10556,4,0,-1},{10557,4,1,-1},{10560,4,0,-1},{10561,4,1,-1},{10564,4,0,-1}, +{10565,4,1,-1},{10569,4,0,-1},{10570,4,1,-1},{10573,4,0,-1},{10574,4,1,-1}, +{10577,4,0,-1},{10578,4,1,-1},{10582,4,0,-1},{10583,4,1,-1},{10586,4,0,-1}, +{10587,4,1,-1},{10590,4,0,-1},{10591,4,1,-1},{10595,4,0,-1},{10596,4,1,-1}, +{10599,4,0,-1},{10600,4,1,-1},{10603,4,0,-1},{10604,4,1,-1},{10608,4,0,-1}, +{10609,4,1,-1},{10612,4,0,-1},{10613,4,1,-1},{10616,4,0,-1},{10617,4,1,-1}, +{10621,4,0,-1},{10622,4,1,-1},{10625,4,0,-1},{10626,4,1,-1},{10629,4,0,-1}, +{10630,4,1,-1},{10634,4,0,-1},{10635,4,1,-1},{10568,4,0,-1},{10638,4,0,-1}, +{10639,4,1,-1},{10642,4,0,-1},{10643,4,1,-1},{10647,4,0,-1},{10648,4,1,-1}, +{10581,4,1,-1},{10651,4,0,-1},{10652,4,1,-1},{10655,4,0,-1},{10656,4,1,-1}, +{10660,4,0,-1},{10661,4,1,-1},{10664,4,0,-1},{10665,4,1,-1},{10668,4,0,-1}, +{10669,4,1,-1},{10673,4,0,-1},{10674,4,1,-1},{10677,4,0,-1},{10678,4,1,-1}, +{10681,4,0,-1},{10682,4,1,-1},{10686,4,0,-1},{10687,4,1,-1},{10690,4,0,-1}, +{10691,4,1,-1},{10694,4,0,-1},{10695,4,1,-1},{10699,4,0,-1},{10700,4,1,-1}, +{10703,4,0,-1},{10704,4,1,-1},{10707,4,0,-1},{10708,4,1,-1},{10712,4,0,-1}, +{10713,4,1,-1},{10716,4,0,-1},{10717,4,1,-1},{10720,4,0,-1},{10721,4,1,-1}, +{10725,4,0,-1},{10726,4,1,-1},{10729,4,0,-1},{10730,4,1,-1},{10733,4,0,-1}, +{10734,4,1,-1},{10738,4,0,-1},{10739,4,1,-1},{10672,4,0,-1},{10742,4,0,-1}, +{10743,4,1,-1},{10746,4,0,-1},{10747,4,1,-1},{10751,4,0,-1},{10752,4,1,-1}, +{10685,4,1,-1},{10755,4,0,-1},{10756,4,1,-1},{10759,4,0,-1},{10760,4,1,-1}, +{10764,4,0,-1},{10765,4,1,-1},{10768,4,0,-1},{10769,4,1,-1},{10772,4,0,-1}, +{10773,4,1,-1},{10777,4,0,-1},{10778,4,1,-1},{10781,4,0,-1},{10782,4,1,-1}, +{10785,4,0,-1},{10786,4,1,-1},{10790,4,0,-1},{10791,4,1,-1},{10794,4,0,-1}, +{10795,4,1,-1},{10798,4,0,-1},{10799,4,1,-1},{10803,4,0,-1},{10804,4,1,-1}, +{10807,4,0,-1},{10808,4,1,-1},{10811,4,0,-1},{10812,4,1,-1},{10816,4,0,-1}, +{10817,4,1,-1},{10820,4,0,-1},{10821,4,1,-1},{10824,4,0,-1},{10825,4,1,-1}, +{10829,4,0,-1},{10830,4,1,-1},{10833,4,0,-1},{10834,4,1,-1},{10837,4,0,-1}, +{10838,4,1,-1},{10842,4,0,-1},{10843,4,1,-1},{10776,4,0,-1},{10846,4,0,-1}, +{10847,4,1,-1},{10850,4,0,-1},{10851,4,1,-1},{10855,4,0,-1},{10856,4,1,-1}, +{10789,4,1,-1},{10859,4,0,-1},{10860,4,1,-1},{10863,4,0,-1},{10864,4,1,-1}, +{10868,4,0,-1},{10869,4,1,-1},{10872,4,0,-1},{10873,4,1,-1},{10876,4,0,-1}, +{10877,4,1,-1},{10881,4,0,-1},{10882,4,1,-1},{10885,4,0,-1},{10886,4,1,-1}, +{10889,4,0,-1},{10890,4,1,-1},{10894,4,0,-1},{10895,4,1,-1},{10898,4,0,-1}, +{10899,4,1,-1},{10902,4,0,-1},{10903,4,1,-1},{10907,4,0,-1},{10908,4,1,-1}, +{10911,4,0,-1},{10912,4,1,-1},{10915,4,0,-1},{10916,4,1,-1},{10920,4,0,-1}, +{10921,4,1,-1},{10924,4,0,-1},{10925,4,1,-1},{10928,4,0,-1},{10929,4,1,-1}, +{10933,4,0,-1},{10934,4,1,-1},{10937,4,0,-1},{10938,4,1,-1},{10941,4,0,-1}, +{10942,4,1,-1},{10946,4,0,-1},{10947,4,1,-1},{10880,4,0,-1},{10950,4,0,-1}, +{10951,4,1,-1},{10954,4,0,-1},{10955,4,1,-1},{10959,4,0,-1},{10960,4,1,-1}, +{10893,4,1,-1},{10963,4,0,-1},{10964,4,1,-1},{10967,4,0,-1},{10968,4,1,-1}, +{10972,4,0,-1},{10973,4,1,-1},{10976,4,0,-1},{10977,4,1,-1},{10980,4,0,-1}, +{10981,4,1,-1},{10985,4,0,-1},{10986,4,1,-1},{10989,4,0,-1},{10990,4,1,-1}, +{10993,4,0,-1},{10994,4,1,-1},{10998,4,0,-1},{10999,4,1,-1},{11002,4,0,-1}, +{11003,4,1,-1},{11006,4,0,-1},{11007,4,1,-1},{11012,4,1,-1},{11016,4,1,-1}, +{11020,4,1,-1},{11025,4,1,-1},{11029,4,1,-1},{11033,4,1,-1},{11038,4,1,-1}, +{11042,4,1,-1},{11046,4,1,-1},{11051,4,1,-1},{10984,4,0,-1},{11055,4,1,-1}, +{11058,4,0,-1},{11059,4,1,-1},{10997,4,1,-1},{11067,4,0,-1},{11068,4,1,-1}, +{11072,4,1,-1},{11077,4,1,-1},{11081,4,1,-1},{11085,4,1,-1},{11090,4,1,-1}, +{11094,4,1,-1},{11098,4,1,-1},{11102,4,0,-1},{11103,4,1,-1},{11107,4,1,-1}, +{11111,4,1,-1},{11116,4,1,-1},{11120,4,1,-1},{11129,4,1,-1},{11133,4,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_5_ss0_ss1[] = { +{5269,5,0,-1},{5278,5,0,-1},{5286,5,0,-1},{5295,5,0,-1},{5304,5,0,-1}, +{5312,5,0,-1},{5321,5,0,-1},{5330,5,0,-1},{5264,5,0,-1},{5338,5,0,-1}, +{5347,5,0,-1},{5351,5,0,-1},{5356,5,0,-1},{5360,5,0,-1},{5364,5,0,-1}, +{5369,5,0,-1},{5373,5,0,-1},{5377,5,0,-1},{5382,5,0,-1},{5386,5,0,-1}, +{5390,5,0,-1},{5395,5,0,-1},{5399,5,0,-1},{5403,5,0,-1},{5408,5,0,-1}, +{5412,5,0,-1},{5416,5,0,-1},{5421,5,0,-1},{5425,5,0,-1},{5429,5,0,-1}, +{5434,5,0,-1},{5368,5,0,-1},{5438,5,0,-1},{5442,5,0,-1},{5447,5,0,-1}, +{5451,5,0,-1},{5455,5,0,-1},{5460,5,0,-1},{5464,5,0,-1},{5468,5,0,-1}, +{5473,5,0,-1},{5477,5,0,-1},{5481,5,0,-1},{5486,5,0,-1},{5490,5,0,-1}, +{5494,5,0,-1},{5499,5,0,-1},{5503,5,0,-1},{5507,5,0,-1},{5512,5,0,-1}, +{5516,5,0,-1},{5520,5,0,-1},{5525,5,0,-1},{5529,5,0,-1},{5533,5,0,-1}, +{5538,5,0,-1},{5472,5,0,-1},{5542,5,0,-1},{5546,5,0,-1},{5551,5,0,-1}, +{5555,5,0,-1},{5559,5,0,-1},{5564,5,0,-1},{5568,5,0,-1},{5572,5,0,-1}, +{5577,5,0,-1},{5581,5,0,-1},{5585,5,0,-1},{5590,5,0,-1},{5594,5,0,-1}, +{5598,5,0,-1},{5603,5,0,-1},{5607,5,0,-1},{5611,5,0,-1},{5616,5,0,-1}, +{5620,5,0,-1},{5624,5,0,-1},{5629,5,0,-1},{5633,5,0,-1},{5637,5,0,-1}, +{5638,5,1,-1},{5642,5,0,-1},{5576,5,0,-1},{5646,5,0,-1},{5647,5,1,-1}, +{5650,5,0,-1},{5655,5,0,-1},{5656,5,1,-1},{5659,5,0,-1},{5663,5,0,-1}, +{5668,5,0,-1},{5669,5,1,-1},{5672,5,0,-1},{5676,5,0,-1},{5677,5,1,-1}, +{5681,5,0,-1},{5685,5,0,-1},{5686,5,1,-1},{5689,5,0,-1},{5694,5,0,-1}, +{5695,5,1,-1},{5698,5,0,-1},{5702,5,0,-1},{5703,5,1,-1},{5707,5,0,-1}, +{5711,5,0,-1},{5712,5,1,-1},{5715,5,0,-1},{5720,5,0,-1},{5721,5,1,-1}, +{5724,5,0,-1},{5728,5,0,-1},{5729,5,1,-1},{5733,5,0,-1},{5737,5,0,-1}, +{5738,5,1,-1},{5741,5,0,-1},{5746,5,0,-1},{5747,5,1,-1},{5680,5,0,-1}, +{5750,5,0,-1},{5754,5,0,-1},{5755,5,1,-1},{5759,5,0,-1},{5693,5,1,-1}, +{5763,5,0,-1},{5764,5,1,-1},{5767,5,0,-1},{5772,5,0,-1},{5773,5,1,-1}, +{5776,5,0,-1},{5780,5,0,-1},{5781,5,1,-1},{5785,5,0,-1},{5789,5,0,-1}, +{5790,5,1,-1},{5793,5,0,-1},{5798,5,0,-1},{5799,5,1,-1},{5802,5,0,-1}, +{5806,5,0,-1},{5807,5,1,-1},{5811,5,0,-1},{5815,5,0,-1},{5816,5,1,-1}, +{5819,5,0,-1},{5820,5,1,-1},{5824,5,0,-1},{5825,5,1,-1},{5828,5,0,-1}, +{5829,5,1,-1},{5832,5,0,-1},{5833,5,1,-1},{5837,5,0,-1},{5838,5,1,-1}, +{5841,5,0,-1},{5842,5,1,-1},{5845,5,0,-1},{5850,5,0,-1},{5851,5,1,-1}, +{5784,5,0,-1},{5854,5,0,-1},{5855,5,1,-1},{5858,5,0,-1},{5859,5,1,-1}, +{5863,5,0,-1},{5864,5,1,-1},{5797,5,1,-1},{5867,5,0,-1},{5868,5,1,-1}, +{5871,5,0,-1},{5872,5,1,-1},{5876,5,0,-1},{5877,5,1,-1},{5880,5,0,-1}, +{5881,5,1,-1},{5884,5,0,-1},{5885,5,1,-1},{5890,5,1,-1},{5893,5,0,-1}, +{5894,5,1,-1},{5897,5,0,-1},{5898,5,1,-1},{5902,5,0,-1},{5903,5,1,-1}, +{5906,5,0,-1},{5907,5,1,-1},{5910,5,0,-1},{5911,5,1,-1},{5915,5,0,-1}, +{5916,5,1,-1},{5919,5,0,-1},{5920,5,1,-1},{5923,5,0,-1},{5924,5,1,-1}, +{5928,5,0,-1},{5929,5,1,-1},{5932,5,0,-1},{5933,5,1,-1},{5936,5,0,-1}, +{5937,5,1,-1},{5941,5,0,-1},{5942,5,1,-1},{5945,5,0,-1},{5946,5,1,-1}, +{5949,5,0,-1},{5950,5,1,-1},{5954,5,0,-1},{5955,5,1,-1},{5888,5,0,-1}, +{5958,5,0,-1},{5959,5,1,-1},{5962,5,0,-1},{5963,5,1,-1},{5967,5,0,-1}, +{5968,5,1,-1},{5901,5,1,-1},{5971,5,0,-1},{5972,5,1,-1},{5975,5,0,-1}, +{5976,5,1,-1},{5980,5,0,-1},{5981,5,1,-1},{5984,5,0,-1},{5988,5,0,-1}, +{5989,5,1,-1},{5993,5,0,-1},{5994,5,1,-1},{5997,5,0,-1},{5998,5,1,-1}, +{6001,5,0,-1},{6002,5,1,-1},{6006,5,0,-1},{6007,5,1,-1},{6010,5,0,-1}, +{6011,5,1,-1},{6014,5,0,-1},{6015,5,1,-1},{6019,5,0,-1},{6020,5,1,-1}, +{6023,5,0,-1},{6024,5,1,-1},{6028,5,1,-1},{6032,5,0,-1},{6033,5,1,-1}, +{6036,5,0,-1},{6040,5,0,-1},{6041,5,1,-1},{6045,5,0,-1},{6046,5,1,-1}, +{6049,5,0,-1},{6050,5,1,-1},{6053,5,0,-1},{6054,5,1,-1},{6058,5,0,-1}, +{6059,5,1,-1},{5992,5,0,-1},{6062,5,0,-1},{6063,5,1,-1},{6066,5,0,-1}, +{6067,5,1,-1},{6071,5,0,-1},{6072,5,1,-1},{6005,5,1,-1},{6075,5,0,-1}, +{6076,5,1,-1},{6079,5,0,-1},{6080,5,1,-1},{6084,5,0,-1},{6085,5,1,-1}, +{6088,5,0,-1},{6089,5,1,-1},{6092,5,0,-1},{6093,5,1,-1},{6097,5,0,-1}, +{6098,5,1,-1},{6101,5,0,-1},{6102,5,1,-1},{6105,5,0,-1},{6106,5,1,-1}, +{6110,5,0,-1},{6111,5,1,-1},{6114,5,0,-1},{6115,5,1,-1},{6118,5,0,-1}, +{6119,5,1,-1},{6123,5,0,-1},{6124,5,1,-1},{6127,5,0,-1},{6128,5,1,-1}, +{6131,5,0,-1},{6132,5,1,-1},{6136,5,0,-1},{6137,5,1,-1},{6140,5,0,-1}, +{6141,5,1,-1},{6144,5,0,-1},{6145,5,1,-1},{6149,5,0,-1},{6150,5,1,-1}, +{6153,5,0,-1},{6154,5,1,-1},{6157,5,0,-1},{6158,5,1,-1},{6162,5,0,-1}, +{6163,5,1,-1},{6096,5,0,-1},{6166,5,0,-1},{6167,5,1,-1},{6170,5,0,-1}, +{6171,5,1,-1},{6175,5,0,-1},{6176,5,1,-1},{6109,5,1,-1},{6179,5,0,-1}, +{6180,5,1,-1},{6183,5,0,-1},{6184,5,1,-1},{6188,5,0,-1},{6189,5,1,-1}, +{6192,5,0,-1},{6193,5,1,-1},{6196,5,0,-1},{6197,5,1,-1},{6201,5,0,-1}, +{6202,5,1,-1},{6205,5,0,-1},{6206,5,1,-1},{6209,5,0,-1},{6210,5,1,-1}, +{6214,5,0,-1},{6215,5,1,-1},{6218,5,0,-1},{6219,5,1,-1},{6222,5,0,-1}, +{6223,5,1,-1},{6227,5,0,-1},{6228,5,1,-1},{6231,5,0,-1},{6232,5,1,-1}, +{6235,5,0,-1},{6236,5,1,-1},{6240,5,0,-1},{6241,5,1,-1},{6244,5,0,-1}, +{6245,5,1,-1},{6248,5,0,-1},{6249,5,1,-1},{6253,5,0,-1},{6254,5,1,-1}, +{6257,5,0,-1},{6258,5,1,-1},{6261,5,0,-1},{6262,5,1,-1},{6266,5,0,-1}, +{6267,5,1,-1},{6200,5,0,-1},{6270,5,0,-1},{6271,5,1,-1},{6274,5,0,-1}, +{6275,5,1,-1},{6279,5,0,-1},{6280,5,1,-1},{6213,5,1,-1},{6283,5,0,-1}, +{6284,5,1,-1},{6287,5,0,-1},{6288,5,1,-1},{6292,5,0,-1},{6293,5,1,-1}, +{6296,5,0,-1},{6297,5,1,-1},{6300,5,0,-1},{6301,5,1,-1},{6305,5,0,-1}, +{6306,5,1,-1},{6309,5,0,-1},{6310,5,1,-1},{6313,5,0,-1},{6314,5,1,-1}, +{6318,5,0,-1},{6319,5,1,-1},{6322,5,0,-1},{6323,5,1,-1},{6326,5,0,-1}, +{6327,5,1,-1},{6331,5,0,-1},{6332,5,1,-1},{6335,5,0,-1},{6336,5,1,-1}, +{6339,5,0,-1},{6340,5,1,-1},{6344,5,0,-1},{6345,5,1,-1},{6348,5,0,-1}, +{6349,5,1,-1},{6352,5,0,-1},{6353,5,1,-1},{6357,5,0,-1},{6358,5,1,-1}, +{6361,5,0,-1},{6362,5,1,-1},{6365,5,0,-1},{6366,5,1,-1},{6370,5,0,-1}, +{6371,5,1,-1},{6304,5,0,-1},{6374,5,0,-1},{6375,5,1,-1},{6378,5,0,-1}, +{6379,5,1,-1},{6383,5,0,-1},{6384,5,1,-1},{6317,5,1,-1},{6387,5,0,-1}, +{6388,5,1,-1},{6391,5,0,-1},{6392,5,1,-1},{6396,5,0,-1},{6397,5,1,-1}, +{6400,5,0,-1},{6401,5,1,-1},{6404,5,0,-1},{6405,5,1,-1},{6409,5,0,-1}, +{6410,5,1,-1},{6413,5,0,-1},{6414,5,1,-1},{6417,5,0,-1},{6418,5,1,-1}, +{6422,5,0,-1},{6423,5,1,-1},{6426,5,0,-1},{6427,5,1,-1},{6430,5,0,-1}, +{6431,5,1,-1},{6435,5,0,-1},{6436,5,1,-1},{6439,5,0,-1},{6440,5,1,-1}, +{6443,5,0,-1},{6444,5,1,-1},{6448,5,0,-1},{6449,5,1,-1},{6452,5,0,-1}, +{6453,5,1,-1},{6456,5,0,-1},{6457,5,1,-1},{6461,5,0,-1},{6462,5,1,-1}, +{6465,5,0,-1},{6466,5,1,-1},{6469,5,0,-1},{6470,5,1,-1},{6474,5,0,-1}, +{6475,5,1,-1},{6408,5,0,-1},{6478,5,0,-1},{6479,5,1,-1},{6482,5,0,-1}, +{6483,5,1,-1},{6487,5,0,-1},{6488,5,1,-1},{6421,5,1,-1},{6491,5,0,-1}, +{6492,5,1,-1},{6495,5,0,-1},{6496,5,1,-1},{6500,5,0,-1},{6501,5,1,-1}, +{6504,5,0,-1},{6505,5,1,-1},{6508,5,0,-1},{6509,5,1,-1},{6513,5,0,-1}, +{6514,5,1,-1},{6517,5,0,-1},{6518,5,1,-1},{6521,5,0,-1},{6522,5,1,-1}, +{6526,5,0,-1},{6527,5,1,-1},{6530,5,0,-1},{6531,5,1,-1},{6534,5,0,-1}, +{6535,5,1,-1},{6539,5,0,-1},{6540,5,1,-1},{6543,5,0,-1},{6544,5,1,-1}, +{6547,5,0,-1},{6548,5,1,-1},{6552,5,0,-1},{6553,5,1,-1},{6556,5,0,-1}, +{6557,5,1,-1},{6560,5,0,-1},{6561,5,1,-1},{6565,5,0,-1},{6566,5,1,-1}, +{6569,5,0,-1},{6570,5,1,-1},{6573,5,0,-1},{6574,5,1,-1},{6578,5,0,-1}, +{6579,5,1,-1},{6512,5,0,-1},{6582,5,0,-1},{6583,5,1,-1},{6586,5,0,-1}, +{6587,5,1,-1},{6591,5,0,-1},{6592,5,1,-1},{6525,5,1,-1},{6595,5,0,-1}, +{6596,5,1,-1},{6599,5,0,-1},{6600,5,1,-1},{6604,5,0,-1},{6605,5,1,-1}, +{6608,5,0,-1},{6609,5,1,-1},{6612,5,0,-1},{6613,5,1,-1},{6617,5,0,-1}, +{6618,5,1,-1},{6621,5,0,-1},{6622,5,1,-1},{6625,5,0,-1},{6626,5,1,-1}, +{6630,5,0,-1},{6631,5,1,-1},{6634,5,0,-1},{6635,5,1,-1},{6638,5,0,-1}, +{6639,5,1,-1},{6643,5,0,-1},{6644,5,1,-1},{6647,5,0,-1},{6648,5,1,-1}, +{6651,5,0,-1},{6652,5,1,-1},{6656,5,0,-1},{6657,5,1,-1},{6660,5,0,-1}, +{6661,5,1,-1},{6664,5,0,-1},{6665,5,1,-1},{6669,5,0,-1},{6670,5,1,-1}, +{6673,5,0,-1},{6674,5,1,-1},{6677,5,0,-1},{6678,5,1,-1},{6682,5,0,-1}, +{6683,5,1,-1},{6616,5,0,-1},{6686,5,0,-1},{6687,5,1,-1},{6690,5,0,-1}, +{6691,5,1,-1},{6695,5,0,-1},{6696,5,1,-1},{6629,5,1,-1},{6699,5,0,-1}, +{6700,5,1,-1},{6703,5,0,-1},{6704,5,1,-1},{6708,5,0,-1},{6709,5,1,-1}, +{6712,5,0,-1},{6713,5,1,-1},{6716,5,0,-1},{6717,5,1,-1},{6721,5,0,-1}, +{6722,5,1,-1},{6725,5,0,-1},{6726,5,1,-1},{6729,5,0,-1},{6730,5,1,-1}, +{6734,5,0,-1},{6735,5,1,-1},{6738,5,0,-1},{6739,5,1,-1},{6742,5,0,-1}, +{6743,5,1,-1},{6747,5,0,-1},{6748,5,1,-1},{6751,5,0,-1},{6752,5,1,-1}, +{6755,5,0,-1},{6756,5,1,-1},{6760,5,0,-1},{6761,5,1,-1},{6764,5,0,-1}, +{6765,5,1,-1},{6768,5,0,-1},{6769,5,1,-1},{6773,5,0,-1},{6774,5,1,-1}, +{6777,5,0,-1},{6778,5,1,-1},{6781,5,0,-1},{6782,5,1,-1},{6786,5,0,-1}, +{6787,5,1,-1},{6720,5,0,-1},{6790,5,0,-1},{6791,5,1,-1},{6794,5,0,-1}, +{6795,5,1,-1},{6799,5,0,-1},{6800,5,1,-1},{6733,5,1,-1},{6803,5,0,-1}, +{6804,5,1,-1},{6807,5,0,-1},{6808,5,1,-1},{6812,5,0,-1},{6813,5,1,-1}, +{6816,5,0,-1},{6817,5,1,-1},{6820,5,0,-1},{6821,5,1,-1},{6825,5,0,-1}, +{6826,5,1,-1},{6829,5,0,-1},{6830,5,1,-1},{6833,5,0,-1},{6834,5,1,-1}, +{6838,5,0,-1},{6839,5,1,-1},{6842,5,0,-1},{6843,5,1,-1},{6846,5,0,-1}, +{6847,5,1,-1},{6851,5,0,-1},{6852,5,1,-1},{6855,5,0,-1},{6856,5,1,-1}, +{6859,5,0,-1},{6860,5,1,-1},{6864,5,0,-1},{6865,5,1,-1},{6868,5,0,-1}, +{6869,5,1,-1},{6872,5,0,-1},{6873,5,1,-1},{6877,5,0,-1},{6878,5,1,-1}, +{6881,5,0,-1},{6882,5,1,-1},{6885,5,0,-1},{6886,5,1,-1},{6890,5,0,-1}, +{6891,5,1,-1},{6824,5,0,-1},{6894,5,0,-1},{6895,5,1,-1},{6898,5,0,-1}, +{6899,5,1,-1},{6903,5,0,-1},{6904,5,1,-1},{6837,5,1,-1},{6907,5,0,-1}, +{6908,5,1,-1},{6911,5,0,-1},{6912,5,1,-1},{6916,5,0,-1},{6917,5,1,-1}, +{6920,5,0,-1},{6921,5,1,-1},{6924,5,0,-1},{6925,5,1,-1},{6929,5,0,-1}, +{6930,5,1,-1},{6933,5,0,-1},{6934,5,1,-1},{6937,5,0,-1},{6938,5,1,-1}, +{6942,5,0,-1},{6943,5,1,-1},{6946,5,0,-1},{6947,5,1,-1},{6950,5,0,-1}, +{6951,5,1,-1},{6955,5,0,-1},{6956,5,1,-1},{6959,5,0,-1},{6960,5,1,-1}, +{6963,5,0,-1},{6964,5,1,-1},{6968,5,0,-1},{6969,5,1,-1},{6972,5,0,-1}, +{6973,5,1,-1},{6976,5,0,-1},{6977,5,1,-1},{6981,5,0,-1},{6982,5,1,-1}, +{6985,5,0,-1},{6986,5,1,-1},{6989,5,0,-1},{6990,5,1,-1},{6994,5,0,-1}, +{6995,5,1,-1},{6928,5,0,-1},{6998,5,0,-1},{6999,5,1,-1},{7002,5,0,-1}, +{7003,5,1,-1},{7007,5,0,-1},{7008,5,1,-1},{6941,5,1,-1},{7011,5,0,-1}, +{7012,5,1,-1},{7015,5,0,-1},{7016,5,1,-1},{7020,5,0,-1},{7021,5,1,-1}, +{7024,5,0,-1},{7025,5,1,-1},{7028,5,0,-1},{7029,5,1,-1},{7033,5,0,-1}, +{7034,5,1,-1},{7037,5,0,-1},{7038,5,1,-1},{7041,5,0,-1},{7042,5,1,-1}, +{7046,5,0,-1},{7047,5,1,-1},{7050,5,0,-1},{7051,5,1,-1},{7054,5,0,-1}, +{7055,5,1,-1},{7059,5,0,-1},{7060,5,1,-1},{7063,5,0,-1},{7064,5,1,-1}, +{7067,5,0,-1},{7068,5,1,-1},{7072,5,0,-1},{7073,5,1,-1},{7076,5,0,-1}, +{7077,5,1,-1},{7080,5,0,-1},{7081,5,1,-1},{7085,5,0,-1},{7086,5,1,-1}, +{7089,5,0,-1},{7090,5,1,-1},{7093,5,0,-1},{7094,5,1,-1},{7098,5,0,-1}, +{7099,5,1,-1},{7032,5,0,-1},{7102,5,0,-1},{7103,5,1,-1},{7106,5,0,-1}, +{7107,5,1,-1},{7111,5,0,-1},{7112,5,1,-1},{7045,5,1,-1},{7115,5,0,-1}, +{7116,5,1,-1},{7119,5,0,-1},{7120,5,1,-1},{7124,5,0,-1},{7125,5,1,-1}, +{7128,5,0,-1},{7129,5,1,-1},{7132,5,0,-1},{7133,5,1,-1},{7137,5,0,-1}, +{7138,5,1,-1},{7141,5,0,-1},{7142,5,1,-1},{7145,5,0,-1},{7146,5,1,-1}, +{7150,5,0,-1},{7151,5,1,-1},{7154,5,0,-1},{7155,5,1,-1},{7158,5,0,-1}, +{7159,5,1,-1},{7163,5,0,-1},{7164,5,1,-1},{7167,5,0,-1},{7168,5,1,-1}, +{7171,5,0,-1},{7172,5,1,-1},{7176,5,0,-1},{7177,5,1,-1},{7180,5,0,-1}, +{7181,5,1,-1},{7184,5,0,-1},{7185,5,1,-1},{7189,5,0,-1},{7190,5,1,-1}, +{7193,5,0,-1},{7194,5,1,-1},{7197,5,0,-1},{7198,5,1,-1},{7202,5,0,-1}, +{7203,5,1,-1},{7136,5,0,-1},{7206,5,0,-1},{7207,5,1,-1},{7210,5,0,-1}, +{7211,5,1,-1},{7215,5,0,-1},{7216,5,1,-1},{7149,5,1,-1},{7219,5,0,-1}, +{7220,5,1,-1},{7223,5,0,-1},{7224,5,1,-1},{7228,5,0,-1},{7229,5,1,-1}, +{7232,5,0,-1},{7233,5,1,-1},{7236,5,0,-1},{7237,5,1,-1},{7241,5,0,-1}, +{7242,5,1,-1},{7245,5,0,-1},{7246,5,1,-1},{7249,5,0,-1},{7250,5,1,-1}, +{7254,5,0,-1},{7255,5,1,-1},{7258,5,0,-1},{7259,5,1,-1},{7262,5,0,-1}, +{7263,5,1,-1},{7267,5,0,-1},{7268,5,1,-1},{7271,5,0,-1},{7272,5,1,-1}, +{7275,5,0,-1},{7276,5,1,-1},{7280,5,0,-1},{7281,5,1,-1},{7284,5,0,-1}, +{7285,5,1,-1},{7288,5,0,-1},{7289,5,1,-1},{7293,5,0,-1},{7294,5,1,-1}, +{7297,5,0,-1},{7298,5,1,-1},{7301,5,0,-1},{7302,5,1,-1},{7306,5,0,-1}, +{7307,5,1,-1},{7240,5,0,-1},{7310,5,0,-1},{7311,5,1,-1},{7314,5,0,-1}, +{7315,5,1,-1},{7319,5,0,-1},{7320,5,1,-1},{7253,5,1,-1},{7323,5,0,-1}, +{7324,5,1,-1},{7327,5,0,-1},{7328,5,1,-1},{7332,5,0,-1},{7333,5,1,-1}, +{7336,5,0,-1},{7337,5,1,-1},{7340,5,0,-1},{7341,5,1,-1},{7345,5,0,-1}, +{7346,5,1,-1},{7349,5,0,-1},{7350,5,1,-1},{7353,5,0,-1},{7354,5,1,-1}, +{7358,5,0,-1},{7359,5,1,-1},{7362,5,0,-1},{7363,5,1,-1},{7366,5,0,-1}, +{7367,5,1,-1},{7371,5,0,-1},{7372,5,1,-1},{7375,5,0,-1},{7376,5,1,-1}, +{7379,5,0,-1},{7380,5,1,-1},{7384,5,0,-1},{7385,5,1,-1},{7388,5,0,-1}, +{7389,5,1,-1},{7392,5,0,-1},{7393,5,1,-1},{7397,5,0,-1},{7398,5,1,-1}, +{7401,5,0,-1},{7402,5,1,-1},{7405,5,0,-1},{7406,5,1,-1},{7410,5,0,-1}, +{7411,5,1,-1},{7344,5,0,-1},{7414,5,0,-1},{7415,5,1,-1},{7418,5,0,-1}, +{7419,5,1,-1},{7423,5,0,-1},{7424,5,1,-1},{7357,5,1,-1},{7427,5,0,-1}, +{7428,5,1,-1},{7431,5,0,-1},{7432,5,1,-1},{7436,5,0,-1},{7437,5,1,-1}, +{7440,5,0,-1},{7441,5,1,-1},{7444,5,0,-1},{7445,5,1,-1},{7449,5,0,-1}, +{7450,5,1,-1},{7453,5,0,-1},{7454,5,1,-1},{7457,5,0,-1},{7458,5,1,-1}, +{7462,5,0,-1},{7463,5,1,-1},{7466,5,0,-1},{7467,5,1,-1},{7470,5,0,-1}, +{7471,5,1,-1},{7475,5,0,-1},{7476,5,1,-1},{7479,5,0,-1},{7480,5,1,-1}, +{7483,5,0,-1},{7484,5,1,-1},{7488,5,0,-1},{7489,5,1,-1},{7492,5,0,-1}, +{7493,5,1,-1},{7496,5,0,-1},{7497,5,1,-1},{7501,5,0,-1},{7502,5,1,-1}, +{7505,5,0,-1},{7506,5,1,-1},{7509,5,0,-1},{7510,5,1,-1},{7514,5,0,-1}, +{7515,5,1,-1},{7448,5,0,-1},{7518,5,0,-1},{7519,5,1,-1},{7522,5,0,-1}, +{7523,5,1,-1},{7527,5,0,-1},{7528,5,1,-1},{7461,5,1,-1},{7531,5,0,-1}, +{7532,5,1,-1},{7535,5,0,-1},{7536,5,1,-1},{7540,5,0,-1},{7541,5,1,-1}, +{7544,5,0,-1},{7545,5,1,-1},{7548,5,0,-1},{7549,5,1,-1},{7553,5,0,-1}, +{7554,5,1,-1},{7557,5,0,-1},{7558,5,1,-1},{7561,5,0,-1},{7562,5,1,-1}, +{7566,5,0,-1},{7567,5,1,-1},{7570,5,0,-1},{7571,5,1,-1},{7574,5,0,-1}, +{7575,5,1,-1},{7579,5,0,-1},{7580,5,1,-1},{7583,5,0,-1},{7584,5,1,-1}, +{7587,5,0,-1},{7588,5,1,-1},{7592,5,0,-1},{7593,5,1,-1},{7596,5,0,-1}, +{7597,5,1,-1},{7600,5,0,-1},{7601,5,1,-1},{7605,5,0,-1},{7606,5,1,-1}, +{7609,5,0,-1},{7610,5,1,-1},{7613,5,0,-1},{7614,5,1,-1},{7618,5,0,-1}, +{7619,5,1,-1},{7552,5,0,-1},{7622,5,0,-1},{7623,5,1,-1},{7626,5,0,-1}, +{7627,5,1,-1},{7631,5,0,-1},{7632,5,1,-1},{7565,5,1,-1},{7635,5,0,-1}, +{7636,5,1,-1},{7639,5,0,-1},{7640,5,1,-1},{7644,5,0,-1},{7645,5,1,-1}, +{7648,5,0,-1},{7649,5,1,-1},{7652,5,0,-1},{7653,5,1,-1},{7657,5,0,-1}, +{7658,5,1,-1},{7661,5,0,-1},{7662,5,1,-1},{7665,5,0,-1},{7666,5,1,-1}, +{7670,5,0,-1},{7671,5,1,-1},{7674,5,0,-1},{7675,5,1,-1},{7678,5,0,-1}, +{7679,5,1,-1},{7683,5,0,-1},{7684,5,1,-1},{7687,5,0,-1},{7688,5,1,-1}, +{7691,5,0,-1},{7692,5,1,-1},{7696,5,0,-1},{7697,5,1,-1},{7700,5,0,-1}, +{7701,5,1,-1},{7704,5,0,-1},{7705,5,1,-1},{7709,5,0,-1},{7710,5,1,-1}, +{7713,5,0,-1},{7714,5,1,-1},{7717,5,0,-1},{7718,5,1,-1},{7722,5,0,-1}, +{7723,5,1,-1},{7656,5,0,-1},{7726,5,0,-1},{7727,5,1,-1},{7730,5,0,-1}, +{7731,5,1,-1},{7735,5,0,-1},{7736,5,1,-1},{7669,5,1,-1},{7739,5,0,-1}, +{7740,5,1,-1},{7743,5,0,-1},{7744,5,1,-1},{7748,5,0,-1},{7749,5,1,-1}, +{7752,5,0,-1},{7753,5,1,-1},{7756,5,0,-1},{7757,5,1,-1},{7761,5,0,-1}, +{7762,5,1,-1},{7765,5,0,-1},{7766,5,1,-1},{7769,5,0,-1},{7770,5,1,-1}, +{7774,5,0,-1},{7775,5,1,-1},{7778,5,0,-1},{7779,5,1,-1},{7782,5,0,-1}, +{7783,5,1,-1},{7787,5,0,-1},{7788,5,1,-1},{7791,5,0,-1},{7792,5,1,-1}, +{7795,5,0,-1},{7796,5,1,-1},{7800,5,0,-1},{7801,5,1,-1},{7804,5,0,-1}, +{7805,5,1,-1},{7808,5,0,-1},{7809,5,1,-1},{7813,5,0,-1},{7814,5,1,-1}, +{7817,5,0,-1},{7818,5,1,-1},{7821,5,0,-1},{7822,5,1,-1},{7826,5,0,-1}, +{7827,5,1,-1},{7760,5,0,-1},{7830,5,0,-1},{7831,5,1,-1},{7834,5,0,-1}, +{7835,5,1,-1},{7839,5,0,-1},{7840,5,1,-1},{7773,5,1,-1},{7843,5,0,-1}, +{7844,5,1,-1},{7847,5,0,-1},{7848,5,1,-1},{7852,5,0,-1},{7853,5,1,-1}, +{7856,5,0,-1},{7857,5,1,-1},{7860,5,0,-1},{7861,5,1,-1},{7865,5,0,-1}, +{7866,5,1,-1},{7869,5,0,-1},{7870,5,1,-1},{7873,5,0,-1},{7874,5,1,-1}, +{7878,5,0,-1},{7879,5,1,-1},{7882,5,0,-1},{7883,5,1,-1},{7886,5,0,-1}, +{7887,5,1,-1},{7891,5,0,-1},{7892,5,1,-1},{7895,5,0,-1},{7896,5,1,-1}, +{7899,5,0,-1},{7900,5,1,-1},{7904,5,0,-1},{7905,5,1,-1},{7908,5,0,-1}, +{7909,5,1,-1},{7912,5,0,-1},{7913,5,1,-1},{7917,5,0,-1},{7918,5,1,-1}, +{7921,5,0,-1},{7922,5,1,-1},{7925,5,0,-1},{7926,5,1,-1},{7930,5,0,-1}, +{7931,5,1,-1},{7864,5,0,-1},{7934,5,0,-1},{7935,5,1,-1},{7938,5,0,-1}, +{7939,5,1,-1},{7943,5,0,-1},{7944,5,1,-1},{7877,5,1,-1},{7947,5,0,-1}, +{7948,5,1,-1},{7951,5,0,-1},{7952,5,1,-1},{7956,5,0,-1},{7957,5,1,-1}, +{7960,5,0,-1},{7961,5,1,-1},{7964,5,0,-1},{7965,5,1,-1},{7969,5,0,-1}, +{7970,5,1,-1},{7973,5,0,-1},{7974,5,1,-1},{7977,5,0,-1},{7978,5,1,-1}, +{7982,5,0,-1},{7983,5,1,-1},{7986,5,0,-1},{7987,5,1,-1},{7990,5,0,-1}, +{7991,5,1,-1},{7995,5,0,-1},{7996,5,1,-1},{7999,5,0,-1},{8000,5,1,-1}, +{8003,5,0,-1},{8004,5,1,-1},{8008,5,0,-1},{8009,5,1,-1},{8012,5,0,-1}, +{8013,5,1,-1},{8016,5,0,-1},{8017,5,1,-1},{8021,5,0,-1},{8022,5,1,-1}, +{8025,5,0,-1},{8026,5,1,-1},{8029,5,0,-1},{8030,5,1,-1},{8034,5,0,-1}, +{8035,5,1,-1},{7968,5,0,-1},{8038,5,0,-1},{8039,5,1,-1},{8042,5,0,-1}, +{8043,5,1,-1},{8047,5,0,-1},{8048,5,1,-1},{7981,5,1,-1},{8051,5,0,-1}, +{8052,5,1,-1},{8055,5,0,-1},{8056,5,1,-1},{8060,5,0,-1},{8061,5,1,-1}, +{8064,5,0,-1},{8065,5,1,-1},{8068,5,0,-1},{8069,5,1,-1},{8073,5,0,-1}, +{8074,5,1,-1},{8077,5,0,-1},{8078,5,1,-1},{8081,5,0,-1},{8082,5,1,-1}, +{8086,5,0,-1},{8087,5,1,-1},{8090,5,0,-1},{8091,5,1,-1},{8094,5,0,-1}, +{8095,5,1,-1},{8099,5,0,-1},{8100,5,1,-1},{8103,5,0,-1},{8104,5,1,-1}, +{8107,5,0,-1},{8108,5,1,-1},{8112,5,0,-1},{8113,5,1,-1},{8116,5,0,-1}, +{8117,5,1,-1},{8120,5,0,-1},{8121,5,1,-1},{8125,5,0,-1},{8126,5,1,-1}, +{8129,5,0,-1},{8130,5,1,-1},{8133,5,0,-1},{8134,5,1,-1},{8138,5,0,-1}, +{8139,5,1,-1},{8072,5,0,-1},{8142,5,0,-1},{8143,5,1,-1},{8146,5,0,-1}, +{8147,5,1,-1},{8151,5,0,-1},{8152,5,1,-1},{8085,5,1,-1},{8155,5,0,-1}, +{8156,5,1,-1},{8159,5,0,-1},{8160,5,1,-1},{8164,5,0,-1},{8165,5,1,-1}, +{8168,5,0,-1},{8169,5,1,-1},{8172,5,0,-1},{8173,5,1,-1},{8177,5,0,-1}, +{8178,5,1,-1},{8181,5,0,-1},{8182,5,1,-1},{8185,5,0,-1},{8186,5,1,-1}, +{8190,5,0,-1},{8191,5,1,-1},{8194,5,0,-1},{8195,5,1,-1},{8198,5,0,-1}, +{8199,5,1,-1},{8203,5,0,-1},{8204,5,1,-1},{8207,5,0,-1},{8208,5,1,-1}, +{8211,5,0,-1},{8212,5,1,-1},{8216,5,0,-1},{8217,5,1,-1},{8220,5,0,-1}, +{8221,5,1,-1},{8224,5,0,-1},{8225,5,1,-1},{8229,5,0,-1},{8230,5,1,-1}, +{8233,5,0,-1},{8234,5,1,-1},{8237,5,0,-1},{8238,5,1,-1},{8242,5,0,-1}, +{8243,5,1,-1},{8176,5,0,-1},{8246,5,0,-1},{8247,5,1,-1},{8250,5,0,-1}, +{8251,5,1,-1},{8255,5,0,-1},{8256,5,1,-1},{8189,5,1,-1},{8259,5,0,-1}, +{8260,5,1,-1},{8263,5,0,-1},{8264,5,1,-1},{8268,5,0,-1},{8269,5,1,-1}, +{8272,5,0,-1},{8273,5,1,-1},{8276,5,0,-1},{8277,5,1,-1},{8281,5,0,-1}, +{8282,5,1,-1},{8285,5,0,-1},{8286,5,1,-1},{8289,5,0,-1},{8290,5,1,-1}, +{8294,5,0,-1},{8295,5,1,-1},{8298,5,0,-1},{8299,5,1,-1},{8302,5,0,-1}, +{8303,5,1,-1},{8307,5,0,-1},{8308,5,1,-1},{8311,5,0,-1},{8312,5,1,-1}, +{8315,5,0,-1},{8316,5,1,-1},{8320,5,0,-1},{8321,5,1,-1},{8324,5,0,-1}, +{8325,5,1,-1},{8328,5,0,-1},{8329,5,1,-1},{8333,5,0,-1},{8334,5,1,-1}, +{8337,5,0,-1},{8338,5,1,-1},{8341,5,0,-1},{8342,5,1,-1},{8346,5,0,-1}, +{8347,5,1,-1},{8280,5,0,-1},{8350,5,0,-1},{8351,5,1,-1},{8354,5,0,-1}, +{8355,5,1,-1},{8359,5,0,-1},{8360,5,1,-1},{8293,5,1,-1},{8363,5,0,-1}, +{8364,5,1,-1},{8367,5,0,-1},{8368,5,1,-1},{8372,5,0,-1},{8373,5,1,-1}, +{8376,5,0,-1},{8377,5,1,-1},{8380,5,0,-1},{8381,5,1,-1},{8385,5,0,-1}, +{8386,5,1,-1},{8389,5,0,-1},{8390,5,1,-1},{8393,5,0,-1},{8394,5,1,-1}, +{8398,5,0,-1},{8399,5,1,-1},{8402,5,0,-1},{8403,5,1,-1},{8406,5,0,-1}, +{8407,5,1,-1},{8411,5,0,-1},{8412,5,1,-1},{8415,5,0,-1},{8416,5,1,-1}, +{8419,5,0,-1},{8420,5,1,-1},{8424,5,0,-1},{8425,5,1,-1},{8428,5,0,-1}, +{8429,5,1,-1},{8432,5,0,-1},{8433,5,1,-1},{8437,5,0,-1},{8438,5,1,-1}, +{8441,5,0,-1},{8442,5,1,-1},{8445,5,0,-1},{8446,5,1,-1},{8450,5,0,-1}, +{8451,5,1,-1},{8384,5,0,-1},{8454,5,0,-1},{8455,5,1,-1},{8458,5,0,-1}, +{8459,5,1,-1},{8463,5,0,-1},{8464,5,1,-1},{8397,5,1,-1},{8467,5,0,-1}, +{8468,5,1,-1},{8471,5,0,-1},{8472,5,1,-1},{8476,5,0,-1},{8477,5,1,-1}, +{8480,5,0,-1},{8481,5,1,-1},{8484,5,0,-1},{8485,5,1,-1},{8489,5,0,-1}, +{8490,5,1,-1},{8493,5,0,-1},{8494,5,1,-1},{8497,5,0,-1},{8498,5,1,-1}, +{8502,5,0,-1},{8503,5,1,-1},{8506,5,0,-1},{8507,5,1,-1},{8510,5,0,-1}, +{8511,5,1,-1},{8515,5,0,-1},{8516,5,1,-1},{8519,5,0,-1},{8520,5,1,-1}, +{8523,5,0,-1},{8524,5,1,-1},{8528,5,0,-1},{8529,5,1,-1},{8532,5,0,-1}, +{8533,5,1,-1},{8536,5,0,-1},{8537,5,1,-1},{8541,5,0,-1},{8545,5,0,-1}, +{8549,5,0,-1},{8554,5,0,-1},{8488,5,0,-1},{8558,5,0,-1},{8562,5,0,-1}, +{8567,5,0,-1},{8501,5,1,-1},{8571,5,0,-1},{8575,5,0,-1},{8580,5,0,-1}, +{8584,5,0,-1},{8585,5,1,-1},{8588,5,0,-1},{8589,5,1,-1},{8597,5,0,-1}, +{8601,5,0,-1},{8606,5,0,-1},{8610,5,0,-1},{8614,5,0,-1},{8619,5,0,-1}, +{8623,5,0,-1},{8627,5,0,-1},{8632,5,0,-1},{8636,5,0,-1},{8640,5,0,-1}, +{8641,5,1,-1},{8649,5,0,-1},{8653,5,0,-1},{8658,5,0,-1},{8662,5,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS6, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_6_ss0_ss1[] = { +{8112,6,0,-1},{8120,6,0,-1},{8129,6,0,-1},{8138,6,0,-1},{8146,6,0,-1}, +{8155,6,0,-1},{8164,6,0,-1},{8098,6,0,-1},{8172,6,0,-1},{8181,6,0,-1}, +{8190,6,0,-1},{8198,6,0,-1},{8207,6,0,-1},{8211,6,0,-1},{8216,6,0,-1}, +{8220,6,0,-1},{8224,6,0,-1},{8229,6,0,-1},{8233,6,0,-1},{8237,6,0,-1}, +{8242,6,0,-1},{8246,6,0,-1},{8250,6,0,-1},{8255,6,0,-1},{8259,6,0,-1}, +{8263,6,0,-1},{8268,6,0,-1},{8202,6,0,-1},{8272,6,0,-1},{8276,6,0,-1}, +{8281,6,0,-1},{8285,6,0,-1},{8289,6,0,-1},{8294,6,0,-1},{8298,6,0,-1}, +{8302,6,0,-1},{8307,6,0,-1},{8311,6,0,-1},{8315,6,0,-1},{8320,6,0,-1}, +{8324,6,0,-1},{8328,6,0,-1},{8333,6,0,-1},{8337,6,0,-1},{8341,6,0,-1}, +{8346,6,0,-1},{8350,6,0,-1},{8354,6,0,-1},{8355,6,1,-1},{8359,6,0,-1}, +{8363,6,0,-1},{8364,6,1,-1},{8367,6,0,-1},{8372,6,0,-1},{8373,6,1,-1}, +{8306,6,0,-1},{8376,6,0,-1},{8380,6,0,-1},{8381,6,1,-1},{8385,6,0,-1}, +{8389,6,0,-1},{8390,6,1,-1},{8393,6,0,-1},{8398,6,0,-1},{8399,6,1,-1}, +{8402,6,0,-1},{8406,6,0,-1},{8407,6,1,-1},{8411,6,0,-1},{8412,6,1,-1}, +{8415,6,0,-1},{8416,6,1,-1},{8419,6,0,-1},{8420,6,1,-1},{8424,6,0,-1}, +{8425,6,1,-1},{8428,6,0,-1},{8432,6,0,-1},{8433,6,1,-1},{8437,6,0,-1}, +{8441,6,0,-1},{8442,6,1,-1},{8445,6,0,-1},{8450,6,0,-1},{8451,6,1,-1}, +{8454,6,0,-1},{8458,6,0,-1},{8459,6,1,-1},{8463,6,0,-1},{8467,6,0,-1}, +{8468,6,1,-1},{8471,6,0,-1},{8476,6,0,-1},{8477,6,1,-1},{8410,6,0,-1}, +{8480,6,0,-1},{8484,6,0,-1},{8485,6,1,-1},{8489,6,0,-1},{8490,6,1,-1}, +{8423,6,1,-1},{8493,6,0,-1},{8494,6,1,-1},{8497,6,0,-1},{8498,6,1,-1}, +{8502,6,0,-1},{8503,6,1,-1},{8506,6,0,-1},{8507,6,1,-1},{8510,6,0,-1}, +{8511,6,1,-1},{8515,6,0,-1},{8519,6,0,-1},{8520,6,1,-1},{8523,6,0,-1}, +{8524,6,1,-1},{8528,6,0,-1},{8529,6,1,-1},{8532,6,0,-1},{8533,6,1,-1}, +{8536,6,0,-1},{8537,6,1,-1},{8541,6,0,-1},{8542,6,1,-1},{8545,6,0,-1}, +{8546,6,1,-1},{8549,6,0,-1},{8550,6,1,-1},{8554,6,0,-1},{8555,6,1,-1}, +{8558,6,0,-1},{8559,6,1,-1},{8562,6,0,-1},{8563,6,1,-1},{8567,6,0,-1}, +{8568,6,1,-1},{8571,6,0,-1},{8572,6,1,-1},{8575,6,0,-1},{8576,6,1,-1}, +{8580,6,0,-1},{8581,6,1,-1},{8514,6,0,-1},{8584,6,0,-1},{8585,6,1,-1}, +{8588,6,0,-1},{8589,6,1,-1},{8593,6,0,-1},{8594,6,1,-1},{8527,6,1,-1}, +{8597,6,0,-1},{8598,6,1,-1},{8601,6,0,-1},{8602,6,1,-1},{8606,6,0,-1}, +{8607,6,1,-1},{8610,6,0,-1},{8611,6,1,-1},{8614,6,0,-1},{8615,6,1,-1}, +{8619,6,0,-1},{8620,6,1,-1},{8623,6,0,-1},{8624,6,1,-1},{8627,6,0,-1}, +{8628,6,1,-1},{8632,6,0,-1},{8633,6,1,-1},{8636,6,0,-1},{8637,6,1,-1}, +{8640,6,0,-1},{8641,6,1,-1},{8645,6,0,-1},{8646,6,1,-1},{8649,6,0,-1}, +{8650,6,1,-1},{8653,6,0,-1},{8654,6,1,-1},{8658,6,0,-1},{8659,6,1,-1}, +{8662,6,0,-1},{8663,6,1,-1},{8666,6,0,-1},{8667,6,1,-1},{8671,6,0,-1}, +{8672,6,1,-1},{8675,6,0,-1},{8676,6,1,-1},{8679,6,0,-1},{8680,6,1,-1}, +{8684,6,0,-1},{8685,6,1,-1},{8618,6,0,-1},{8688,6,0,-1},{8689,6,1,-1}, +{8692,6,0,-1},{8693,6,1,-1},{8697,6,0,-1},{8698,6,1,-1},{8631,6,1,-1}, +{8701,6,0,-1},{8702,6,1,-1},{8705,6,0,-1},{8706,6,1,-1},{8710,6,0,-1}, +{8711,6,1,-1},{8714,6,0,-1},{8715,6,1,-1},{8718,6,0,-1},{8719,6,1,-1}, +{8723,6,0,-1},{8724,6,1,-1},{8727,6,0,-1},{8728,6,1,-1},{8731,6,0,-1}, +{8732,6,1,-1},{8736,6,0,-1},{8737,6,1,-1},{8740,6,0,-1},{8741,6,1,-1}, +{8744,6,0,-1},{8745,6,1,-1},{8749,6,0,-1},{8750,6,1,-1},{8753,6,0,-1}, +{8754,6,1,-1},{8757,6,0,-1},{8758,6,1,-1},{8762,6,0,-1},{8763,6,1,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8771,6,1,-1},{8775,6,0,-1},{8776,6,1,-1}, +{8779,6,0,-1},{8780,6,1,-1},{8783,6,0,-1},{8784,6,1,-1},{8788,6,0,-1}, +{8789,6,1,-1},{8722,6,0,-1},{8792,6,0,-1},{8793,6,1,-1},{8796,6,0,-1}, +{8797,6,1,-1},{8801,6,0,-1},{8802,6,1,-1},{8735,6,1,-1},{8805,6,0,-1}, +{8806,6,1,-1},{8810,6,1,-1},{8814,6,0,-1},{8815,6,1,-1},{8818,6,0,-1}, +{8822,6,0,-1},{8823,6,1,-1},{8827,6,0,-1},{8828,6,1,-1},{8831,6,0,-1}, +{8832,6,1,-1},{8835,6,0,-1},{8836,6,1,-1},{8840,6,0,-1},{8841,6,1,-1}, +{8844,6,0,-1},{8845,6,1,-1},{8848,6,0,-1},{8849,6,1,-1},{8853,6,0,-1}, +{8854,6,1,-1},{8857,6,0,-1},{8858,6,1,-1},{8861,6,0,-1},{8862,6,1,-1}, +{8866,6,0,-1},{8867,6,1,-1},{8870,6,0,-1},{8871,6,1,-1},{8874,6,0,-1}, +{8875,6,1,-1},{8879,6,0,-1},{8880,6,1,-1},{8883,6,0,-1},{8884,6,1,-1}, +{8887,6,0,-1},{8888,6,1,-1},{8892,6,0,-1},{8893,6,1,-1},{8826,6,0,-1}, +{8896,6,0,-1},{8897,6,1,-1},{8900,6,0,-1},{8901,6,1,-1},{8905,6,0,-1}, +{8906,6,1,-1},{8839,6,1,-1},{8909,6,0,-1},{8910,6,1,-1},{8913,6,0,-1}, +{8914,6,1,-1},{8918,6,0,-1},{8919,6,1,-1},{8922,6,0,-1},{8923,6,1,-1}, +{8926,6,0,-1},{8927,6,1,-1},{8931,6,0,-1},{8932,6,1,-1},{8935,6,0,-1}, +{8936,6,1,-1},{8939,6,0,-1},{8940,6,1,-1},{8944,6,0,-1},{8945,6,1,-1}, +{8948,6,0,-1},{8949,6,1,-1},{8952,6,0,-1},{8953,6,1,-1},{8957,6,0,-1}, +{8958,6,1,-1},{8961,6,0,-1},{8962,6,1,-1},{8965,6,0,-1},{8966,6,1,-1}, +{8970,6,0,-1},{8971,6,1,-1},{8974,6,0,-1},{8975,6,1,-1},{8978,6,0,-1}, +{8979,6,1,-1},{8983,6,0,-1},{8984,6,1,-1},{8987,6,0,-1},{8988,6,1,-1}, +{8991,6,0,-1},{8992,6,1,-1},{8996,6,0,-1},{8997,6,1,-1},{8930,6,0,-1}, +{9000,6,0,-1},{9001,6,1,-1},{9004,6,0,-1},{9005,6,1,-1},{9009,6,0,-1}, +{9010,6,1,-1},{8943,6,1,-1},{9013,6,0,-1},{9014,6,1,-1},{9017,6,0,-1}, +{9018,6,1,-1},{9022,6,0,-1},{9023,6,1,-1},{9026,6,0,-1},{9027,6,1,-1}, +{9030,6,0,-1},{9031,6,1,-1},{9035,6,0,-1},{9036,6,1,-1},{9039,6,0,-1}, +{9040,6,1,-1},{9043,6,0,-1},{9044,6,1,-1},{9048,6,0,-1},{9049,6,1,-1}, +{9052,6,0,-1},{9053,6,1,-1},{9056,6,0,-1},{9057,6,1,-1},{9061,6,0,-1}, +{9062,6,1,-1},{9065,6,0,-1},{9066,6,1,-1},{9069,6,0,-1},{9070,6,1,-1}, +{9074,6,0,-1},{9075,6,1,-1},{9078,6,0,-1},{9079,6,1,-1},{9082,6,0,-1}, +{9083,6,1,-1},{9087,6,0,-1},{9088,6,1,-1},{9091,6,0,-1},{9092,6,1,-1}, +{9095,6,0,-1},{9096,6,1,-1},{9100,6,0,-1},{9101,6,1,-1},{9034,6,0,-1}, +{9104,6,0,-1},{9105,6,1,-1},{9108,6,0,-1},{9109,6,1,-1},{9113,6,0,-1}, +{9114,6,1,-1},{9047,6,1,-1},{9117,6,0,-1},{9118,6,1,-1},{9121,6,0,-1}, +{9122,6,1,-1},{9126,6,0,-1},{9127,6,1,-1},{9130,6,0,-1},{9131,6,1,-1}, +{9134,6,0,-1},{9135,6,1,-1},{9139,6,0,-1},{9140,6,1,-1},{9143,6,0,-1}, +{9144,6,1,-1},{9147,6,0,-1},{9148,6,1,-1},{9152,6,0,-1},{9153,6,1,-1}, +{9156,6,0,-1},{9157,6,1,-1},{9160,6,0,-1},{9161,6,1,-1},{9165,6,0,-1}, +{9166,6,1,-1},{9169,6,0,-1},{9170,6,1,-1},{9173,6,0,-1},{9174,6,1,-1}, +{9178,6,0,-1},{9179,6,1,-1},{9182,6,0,-1},{9183,6,1,-1},{9186,6,0,-1}, +{9187,6,1,-1},{9191,6,0,-1},{9192,6,1,-1},{9195,6,0,-1},{9196,6,1,-1}, +{9199,6,0,-1},{9200,6,1,-1},{9204,6,0,-1},{9205,6,1,-1},{9138,6,0,-1}, +{9208,6,0,-1},{9209,6,1,-1},{9212,6,0,-1},{9213,6,1,-1},{9217,6,0,-1}, +{9218,6,1,-1},{9151,6,1,-1},{9221,6,0,-1},{9222,6,1,-1},{9225,6,0,-1}, +{9226,6,1,-1},{9230,6,0,-1},{9231,6,1,-1},{9234,6,0,-1},{9235,6,1,-1}, +{9238,6,0,-1},{9239,6,1,-1},{9243,6,0,-1},{9244,6,1,-1},{9247,6,0,-1}, +{9248,6,1,-1},{9251,6,0,-1},{9252,6,1,-1},{9256,6,0,-1},{9257,6,1,-1}, +{9260,6,0,-1},{9261,6,1,-1},{9264,6,0,-1},{9265,6,1,-1},{9269,6,0,-1}, +{9270,6,1,-1},{9273,6,0,-1},{9274,6,1,-1},{9277,6,0,-1},{9278,6,1,-1}, +{9282,6,0,-1},{9283,6,1,-1},{9286,6,0,-1},{9287,6,1,-1},{9290,6,0,-1}, +{9291,6,1,-1},{9295,6,0,-1},{9296,6,1,-1},{9299,6,0,-1},{9300,6,1,-1}, +{9303,6,0,-1},{9304,6,1,-1},{9308,6,0,-1},{9309,6,1,-1},{9242,6,0,-1}, +{9312,6,0,-1},{9313,6,1,-1},{9316,6,0,-1},{9317,6,1,-1},{9321,6,0,-1}, +{9322,6,1,-1},{9255,6,1,-1},{9325,6,0,-1},{9326,6,1,-1},{9329,6,0,-1}, +{9330,6,1,-1},{9334,6,0,-1},{9335,6,1,-1},{9338,6,0,-1},{9339,6,1,-1}, +{9342,6,0,-1},{9343,6,1,-1},{9347,6,0,-1},{9348,6,1,-1},{9351,6,0,-1}, +{9352,6,1,-1},{9355,6,0,-1},{9356,6,1,-1},{9360,6,0,-1},{9361,6,1,-1}, +{9364,6,0,-1},{9365,6,1,-1},{9368,6,0,-1},{9369,6,1,-1},{9373,6,0,-1}, +{9374,6,1,-1},{9377,6,0,-1},{9378,6,1,-1},{9381,6,0,-1},{9382,6,1,-1}, +{9386,6,0,-1},{9387,6,1,-1},{9390,6,0,-1},{9391,6,1,-1},{9394,6,0,-1}, +{9395,6,1,-1},{9399,6,0,-1},{9400,6,1,-1},{9403,6,0,-1},{9404,6,1,-1}, +{9407,6,0,-1},{9408,6,1,-1},{9412,6,0,-1},{9413,6,1,-1},{9346,6,0,-1}, +{9416,6,0,-1},{9417,6,1,-1},{9420,6,0,-1},{9421,6,1,-1},{9425,6,0,-1}, +{9426,6,1,-1},{9359,6,1,-1},{9429,6,0,-1},{9430,6,1,-1},{9433,6,0,-1}, +{9434,6,1,-1},{9438,6,0,-1},{9439,6,1,-1},{9442,6,0,-1},{9443,6,1,-1}, +{9446,6,0,-1},{9447,6,1,-1},{9451,6,0,-1},{9452,6,1,-1},{9455,6,0,-1}, +{9456,6,1,-1},{9459,6,0,-1},{9460,6,1,-1},{9464,6,0,-1},{9465,6,1,-1}, +{9468,6,0,-1},{9469,6,1,-1},{9472,6,0,-1},{9473,6,1,-1},{9477,6,0,-1}, +{9478,6,1,-1},{9481,6,0,-1},{9482,6,1,-1},{9485,6,0,-1},{9486,6,1,-1}, +{9490,6,0,-1},{9491,6,1,-1},{9494,6,0,-1},{9495,6,1,-1},{9498,6,0,-1}, +{9499,6,1,-1},{9503,6,0,-1},{9504,6,1,-1},{9507,6,0,-1},{9508,6,1,-1}, +{9511,6,0,-1},{9512,6,1,-1},{9516,6,0,-1},{9517,6,1,-1},{9450,6,0,-1}, +{9520,6,0,-1},{9521,6,1,-1},{9524,6,0,-1},{9525,6,1,-1},{9529,6,0,-1}, +{9530,6,1,-1},{9463,6,1,-1},{9533,6,0,-1},{9534,6,1,-1},{9537,6,0,-1}, +{9538,6,1,-1},{9542,6,0,-1},{9543,6,1,-1},{9546,6,0,-1},{9547,6,1,-1}, +{9550,6,0,-1},{9551,6,1,-1},{9555,6,0,-1},{9556,6,1,-1},{9559,6,0,-1}, +{9560,6,1,-1},{9563,6,0,-1},{9564,6,1,-1},{9568,6,0,-1},{9569,6,1,-1}, +{9572,6,0,-1},{9573,6,1,-1},{9576,6,0,-1},{9577,6,1,-1},{9581,6,0,-1}, +{9582,6,1,-1},{9585,6,0,-1},{9586,6,1,-1},{9589,6,0,-1},{9590,6,1,-1}, +{9594,6,0,-1},{9595,6,1,-1},{9598,6,0,-1},{9599,6,1,-1},{9602,6,0,-1}, +{9603,6,1,-1},{9607,6,0,-1},{9608,6,1,-1},{9611,6,0,-1},{9612,6,1,-1}, +{9615,6,0,-1},{9616,6,1,-1},{9620,6,0,-1},{9621,6,1,-1},{9554,6,0,-1}, +{9624,6,0,-1},{9625,6,1,-1},{9628,6,0,-1},{9629,6,1,-1},{9633,6,0,-1}, +{9634,6,1,-1},{9567,6,1,-1},{9637,6,0,-1},{9638,6,1,-1},{9641,6,0,-1}, +{9642,6,1,-1},{9646,6,0,-1},{9647,6,1,-1},{9650,6,0,-1},{9651,6,1,-1}, +{9654,6,0,-1},{9655,6,1,-1},{9659,6,0,-1},{9660,6,1,-1},{9663,6,0,-1}, +{9664,6,1,-1},{9667,6,0,-1},{9668,6,1,-1},{9672,6,0,-1},{9673,6,1,-1}, +{9676,6,0,-1},{9677,6,1,-1},{9680,6,0,-1},{9681,6,1,-1},{9685,6,0,-1}, +{9686,6,1,-1},{9689,6,0,-1},{9690,6,1,-1},{9693,6,0,-1},{9694,6,1,-1}, +{9698,6,0,-1},{9699,6,1,-1},{9702,6,0,-1},{9703,6,1,-1},{9706,6,0,-1}, +{9707,6,1,-1},{9711,6,0,-1},{9712,6,1,-1},{9715,6,0,-1},{9716,6,1,-1}, +{9719,6,0,-1},{9720,6,1,-1},{9724,6,0,-1},{9725,6,1,-1},{9658,6,0,-1}, +{9728,6,0,-1},{9729,6,1,-1},{9732,6,0,-1},{9733,6,1,-1},{9737,6,0,-1}, +{9738,6,1,-1},{9671,6,1,-1},{9741,6,0,-1},{9742,6,1,-1},{9745,6,0,-1}, +{9746,6,1,-1},{9750,6,0,-1},{9751,6,1,-1},{9754,6,0,-1},{9755,6,1,-1}, +{9758,6,0,-1},{9759,6,1,-1},{9763,6,0,-1},{9764,6,1,-1},{9767,6,0,-1}, +{9768,6,1,-1},{9771,6,0,-1},{9772,6,1,-1},{9776,6,0,-1},{9777,6,1,-1}, +{9780,6,0,-1},{9781,6,1,-1},{9784,6,0,-1},{9785,6,1,-1},{9789,6,0,-1}, +{9790,6,1,-1},{9793,6,0,-1},{9794,6,1,-1},{9797,6,0,-1},{9798,6,1,-1}, +{9802,6,0,-1},{9803,6,1,-1},{9806,6,0,-1},{9807,6,1,-1},{9810,6,0,-1}, +{9811,6,1,-1},{9815,6,0,-1},{9816,6,1,-1},{9819,6,0,-1},{9820,6,1,-1}, +{9823,6,0,-1},{9824,6,1,-1},{9828,6,0,-1},{9829,6,1,-1},{9762,6,0,-1}, +{9832,6,0,-1},{9833,6,1,-1},{9836,6,0,-1},{9837,6,1,-1},{9841,6,0,-1}, +{9842,6,1,-1},{9775,6,1,-1},{9845,6,0,-1},{9846,6,1,-1},{9849,6,0,-1}, +{9850,6,1,-1},{9854,6,0,-1},{9855,6,1,-1},{9858,6,0,-1},{9859,6,1,-1}, +{9862,6,0,-1},{9863,6,1,-1},{9867,6,0,-1},{9868,6,1,-1},{9871,6,0,-1}, +{9872,6,1,-1},{9875,6,0,-1},{9876,6,1,-1},{9880,6,0,-1},{9881,6,1,-1}, +{9884,6,0,-1},{9885,6,1,-1},{9888,6,0,-1},{9889,6,1,-1},{9893,6,0,-1}, +{9894,6,1,-1},{9897,6,0,-1},{9898,6,1,-1},{9901,6,0,-1},{9902,6,1,-1}, +{9906,6,0,-1},{9907,6,1,-1},{9910,6,0,-1},{9911,6,1,-1},{9914,6,0,-1}, +{9915,6,1,-1},{9919,6,0,-1},{9920,6,1,-1},{9923,6,0,-1},{9924,6,1,-1}, +{9927,6,0,-1},{9928,6,1,-1},{9932,6,0,-1},{9933,6,1,-1},{9866,6,0,-1}, +{9936,6,0,-1},{9937,6,1,-1},{9940,6,0,-1},{9941,6,1,-1},{9945,6,0,-1}, +{9946,6,1,-1},{9879,6,1,-1},{9949,6,0,-1},{9950,6,1,-1},{9953,6,0,-1}, +{9954,6,1,-1},{9958,6,0,-1},{9959,6,1,-1},{9962,6,0,-1},{9963,6,1,-1}, +{9966,6,0,-1},{9967,6,1,-1},{9971,6,0,-1},{9972,6,1,-1},{9975,6,0,-1}, +{9976,6,1,-1},{9979,6,0,-1},{9980,6,1,-1},{9984,6,0,-1},{9985,6,1,-1}, +{9988,6,0,-1},{9989,6,1,-1},{9992,6,0,-1},{9993,6,1,-1},{9997,6,0,-1}, +{9998,6,1,-1},{10001,6,0,-1},{10002,6,1,-1},{10005,6,0,-1},{10006,6,1,-1}, +{10010,6,0,-1},{10011,6,1,-1},{10014,6,0,-1},{10015,6,1,-1},{10018,6,0,-1}, +{10019,6,1,-1},{10023,6,0,-1},{10024,6,1,-1},{10027,6,0,-1},{10028,6,1,-1}, +{10031,6,0,-1},{10032,6,1,-1},{10036,6,0,-1},{10037,6,1,-1},{9970,6,0,-1}, +{10040,6,0,-1},{10041,6,1,-1},{10044,6,0,-1},{10045,6,1,-1},{10049,6,0,-1}, +{10050,6,1,-1},{9983,6,1,-1},{10053,6,0,-1},{10054,6,1,-1},{10057,6,0,-1}, +{10058,6,1,-1},{10062,6,0,-1},{10063,6,1,-1},{10066,6,0,-1},{10067,6,1,-1}, +{10070,6,0,-1},{10071,6,1,-1},{10075,6,0,-1},{10076,6,1,-1},{10079,6,0,-1}, +{10080,6,1,-1},{10083,6,0,-1},{10084,6,1,-1},{10088,6,0,-1},{10089,6,1,-1}, +{10092,6,0,-1},{10093,6,1,-1},{10096,6,0,-1},{10097,6,1,-1},{10101,6,0,-1}, +{10102,6,1,-1},{10105,6,0,-1},{10106,6,1,-1},{10109,6,0,-1},{10110,6,1,-1}, +{10114,6,0,-1},{10115,6,1,-1},{10118,6,0,-1},{10119,6,1,-1},{10122,6,0,-1}, +{10123,6,1,-1},{10127,6,0,-1},{10128,6,1,-1},{10131,6,0,-1},{10132,6,1,-1}, +{10135,6,0,-1},{10136,6,1,-1},{10140,6,0,-1},{10141,6,1,-1},{10074,6,0,-1}, +{10144,6,0,-1},{10145,6,1,-1},{10148,6,0,-1},{10149,6,1,-1},{10153,6,0,-1}, +{10154,6,1,-1},{10087,6,1,-1},{10157,6,0,-1},{10158,6,1,-1},{10161,6,0,-1}, +{10162,6,1,-1},{10166,6,0,-1},{10167,6,1,-1},{10170,6,0,-1},{10171,6,1,-1}, +{10174,6,0,-1},{10175,6,1,-1},{10179,6,0,-1},{10180,6,1,-1},{10183,6,0,-1}, +{10184,6,1,-1},{10187,6,0,-1},{10188,6,1,-1},{10192,6,0,-1},{10193,6,1,-1}, +{10196,6,0,-1},{10197,6,1,-1},{10200,6,0,-1},{10201,6,1,-1},{10205,6,0,-1}, +{10206,6,1,-1},{10209,6,0,-1},{10210,6,1,-1},{10213,6,0,-1},{10214,6,1,-1}, +{10218,6,0,-1},{10219,6,1,-1},{10222,6,0,-1},{10223,6,1,-1},{10226,6,0,-1}, +{10227,6,1,-1},{10231,6,0,-1},{10232,6,1,-1},{10235,6,0,-1},{10236,6,1,-1}, +{10239,6,0,-1},{10240,6,1,-1},{10244,6,0,-1},{10245,6,1,-1},{10178,6,0,-1}, +{10248,6,0,-1},{10249,6,1,-1},{10252,6,0,-1},{10253,6,1,-1},{10257,6,0,-1}, +{10258,6,1,-1},{10191,6,1,-1},{10261,6,0,-1},{10262,6,1,-1},{10265,6,0,-1}, +{10266,6,1,-1},{10270,6,0,-1},{10271,6,1,-1},{10274,6,0,-1},{10275,6,1,-1}, +{10278,6,0,-1},{10279,6,1,-1},{10283,6,0,-1},{10284,6,1,-1},{10287,6,0,-1}, +{10288,6,1,-1},{10291,6,0,-1},{10292,6,1,-1},{10296,6,0,-1},{10297,6,1,-1}, +{10300,6,0,-1},{10301,6,1,-1},{10304,6,0,-1},{10305,6,1,-1},{10309,6,0,-1}, +{10310,6,1,-1},{10313,6,0,-1},{10314,6,1,-1},{10317,6,0,-1},{10318,6,1,-1}, +{10322,6,0,-1},{10323,6,1,-1},{10326,6,0,-1},{10327,6,1,-1},{10330,6,0,-1}, +{10331,6,1,-1},{10335,6,0,-1},{10336,6,1,-1},{10339,6,0,-1},{10340,6,1,-1}, +{10343,6,0,-1},{10344,6,1,-1},{10348,6,0,-1},{10349,6,1,-1},{10282,6,0,-1}, +{10352,6,0,-1},{10353,6,1,-1},{10356,6,0,-1},{10357,6,1,-1},{10361,6,0,-1}, +{10362,6,1,-1},{10295,6,1,-1},{10365,6,0,-1},{10366,6,1,-1},{10369,6,0,-1}, +{10370,6,1,-1},{10374,6,0,-1},{10375,6,1,-1},{10378,6,0,-1},{10379,6,1,-1}, +{10382,6,0,-1},{10383,6,1,-1},{10387,6,0,-1},{10388,6,1,-1},{10391,6,0,-1}, +{10392,6,1,-1},{10395,6,0,-1},{10396,6,1,-1},{10400,6,0,-1},{10401,6,1,-1}, +{10404,6,0,-1},{10405,6,1,-1},{10408,6,0,-1},{10409,6,1,-1},{10413,6,0,-1}, +{10414,6,1,-1},{10417,6,0,-1},{10418,6,1,-1},{10421,6,0,-1},{10422,6,1,-1}, +{10426,6,0,-1},{10427,6,1,-1},{10430,6,0,-1},{10431,6,1,-1},{10434,6,0,-1}, +{10435,6,1,-1},{10439,6,0,-1},{10440,6,1,-1},{10443,6,0,-1},{10444,6,1,-1}, +{10447,6,0,-1},{10448,6,1,-1},{10452,6,0,-1},{10453,6,1,-1},{10386,6,0,-1}, +{10456,6,0,-1},{10457,6,1,-1},{10460,6,0,-1},{10461,6,1,-1},{10465,6,0,-1}, +{10466,6,1,-1},{10399,6,1,-1},{10469,6,0,-1},{10470,6,1,-1},{10473,6,0,-1}, +{10474,6,1,-1},{10478,6,0,-1},{10479,6,1,-1},{10482,6,0,-1},{10483,6,1,-1}, +{10486,6,0,-1},{10487,6,1,-1},{10491,6,0,-1},{10492,6,1,-1},{10495,6,0,-1}, +{10496,6,1,-1},{10499,6,0,-1},{10500,6,1,-1},{10504,6,0,-1},{10505,6,1,-1}, +{10508,6,0,-1},{10509,6,1,-1},{10512,6,0,-1},{10513,6,1,-1},{10517,6,0,-1}, +{10518,6,1,-1},{10521,6,0,-1},{10522,6,1,-1},{10525,6,0,-1},{10526,6,1,-1}, +{10530,6,0,-1},{10531,6,1,-1},{10534,6,0,-1},{10535,6,1,-1},{10538,6,0,-1}, +{10539,6,1,-1},{10543,6,0,-1},{10544,6,1,-1},{10547,6,0,-1},{10548,6,1,-1}, +{10551,6,0,-1},{10552,6,1,-1},{10556,6,0,-1},{10557,6,1,-1},{10490,6,0,-1}, +{10560,6,0,-1},{10561,6,1,-1},{10564,6,0,-1},{10565,6,1,-1},{10569,6,0,-1}, +{10570,6,1,-1},{10503,6,1,-1},{10573,6,0,-1},{10574,6,1,-1},{10577,6,0,-1}, +{10578,6,1,-1},{10582,6,0,-1},{10583,6,1,-1},{10586,6,0,-1},{10587,6,1,-1}, +{10590,6,0,-1},{10591,6,1,-1},{10595,6,0,-1},{10596,6,1,-1},{10599,6,0,-1}, +{10600,6,1,-1},{10603,6,0,-1},{10604,6,1,-1},{10608,6,0,-1},{10609,6,1,-1}, +{10612,6,0,-1},{10613,6,1,-1},{10616,6,0,-1},{10617,6,1,-1},{10621,6,0,-1}, +{10622,6,1,-1},{10625,6,0,-1},{10626,6,1,-1},{10629,6,0,-1},{10630,6,1,-1}, +{10634,6,0,-1},{10635,6,1,-1},{10638,6,0,-1},{10639,6,1,-1},{10642,6,0,-1}, +{10643,6,1,-1},{10647,6,0,-1},{10648,6,1,-1},{10651,6,0,-1},{10652,6,1,-1}, +{10655,6,0,-1},{10656,6,1,-1},{10660,6,0,-1},{10661,6,1,-1},{10594,6,0,-1}, +{10664,6,0,-1},{10665,6,1,-1},{10668,6,0,-1},{10669,6,1,-1},{10673,6,0,-1}, +{10674,6,1,-1},{10607,6,1,-1},{10677,6,0,-1},{10678,6,1,-1},{10681,6,0,-1}, +{10682,6,1,-1},{10686,6,0,-1},{10687,6,1,-1},{10690,6,0,-1},{10691,6,1,-1}, +{10694,6,0,-1},{10695,6,1,-1},{10699,6,0,-1},{10700,6,1,-1},{10703,6,0,-1}, +{10704,6,1,-1},{10707,6,0,-1},{10708,6,1,-1},{10712,6,0,-1},{10713,6,1,-1}, +{10716,6,0,-1},{10717,6,1,-1},{10720,6,0,-1},{10721,6,1,-1},{10725,6,0,-1}, +{10726,6,1,-1},{10729,6,0,-1},{10730,6,1,-1},{10733,6,0,-1},{10734,6,1,-1}, +{10738,6,0,-1},{10739,6,1,-1},{10742,6,0,-1},{10743,6,1,-1},{10746,6,0,-1}, +{10747,6,1,-1},{10751,6,0,-1},{10752,6,1,-1},{10755,6,0,-1},{10756,6,1,-1}, +{10759,6,0,-1},{10760,6,1,-1},{10764,6,0,-1},{10765,6,1,-1},{10698,6,0,-1}, +{10768,6,0,-1},{10769,6,1,-1},{10772,6,0,-1},{10773,6,1,-1},{10777,6,0,-1}, +{10778,6,1,-1},{10711,6,1,-1},{10781,6,0,-1},{10782,6,1,-1},{10785,6,0,-1}, +{10786,6,1,-1},{10790,6,0,-1},{10791,6,1,-1},{10794,6,0,-1},{10795,6,1,-1}, +{10798,6,0,-1},{10799,6,1,-1},{10803,6,0,-1},{10804,6,1,-1},{10807,6,0,-1}, +{10808,6,1,-1},{10811,6,0,-1},{10812,6,1,-1},{10816,6,0,-1},{10817,6,1,-1}, +{10820,6,0,-1},{10821,6,1,-1},{10824,6,0,-1},{10825,6,1,-1},{10829,6,0,-1}, +{10830,6,1,-1},{10833,6,0,-1},{10834,6,1,-1},{10837,6,0,-1},{10838,6,1,-1}, +{10842,6,0,-1},{10843,6,1,-1},{10846,6,0,-1},{10847,6,1,-1},{10850,6,0,-1}, +{10851,6,1,-1},{10855,6,0,-1},{10856,6,1,-1},{10859,6,0,-1},{10860,6,1,-1}, +{10863,6,0,-1},{10864,6,1,-1},{10868,6,0,-1},{10869,6,1,-1},{10802,6,0,-1}, +{10872,6,0,-1},{10873,6,1,-1},{10876,6,0,-1},{10877,6,1,-1},{10881,6,0,-1}, +{10882,6,1,-1},{10815,6,1,-1},{10885,6,0,-1},{10886,6,1,-1},{10889,6,0,-1}, +{10890,6,1,-1},{10894,6,0,-1},{10895,6,1,-1},{10898,6,0,-1},{10899,6,1,-1}, +{10902,6,0,-1},{10903,6,1,-1},{10907,6,0,-1},{10908,6,1,-1},{10911,6,0,-1}, +{10912,6,1,-1},{10915,6,0,-1},{10916,6,1,-1},{10920,6,0,-1},{10921,6,1,-1}, +{10924,6,0,-1},{10925,6,1,-1},{10928,6,0,-1},{10929,6,1,-1},{10933,6,0,-1}, +{10934,6,1,-1},{10937,6,0,-1},{10938,6,1,-1},{10941,6,0,-1},{10942,6,1,-1}, +{10946,6,0,-1},{10947,6,1,-1},{10950,6,0,-1},{10951,6,1,-1},{10954,6,0,-1}, +{10955,6,1,-1},{10959,6,0,-1},{10960,6,1,-1},{10963,6,0,-1},{10964,6,1,-1}, +{10967,6,0,-1},{10968,6,1,-1},{10972,6,0,-1},{10973,6,1,-1},{10906,6,0,-1}, +{10976,6,0,-1},{10977,6,1,-1},{10980,6,0,-1},{10981,6,1,-1},{10985,6,0,-1}, +{10986,6,1,-1},{10919,6,1,-1},{10989,6,0,-1},{10990,6,1,-1},{10993,6,0,-1}, +{10994,6,1,-1},{10998,6,0,-1},{10999,6,1,-1},{11002,6,0,-1},{11003,6,1,-1}, +{11006,6,0,-1},{11007,6,1,-1},{11011,6,0,-1},{11012,6,1,-1},{11015,6,0,-1}, +{11016,6,1,-1},{11019,6,0,-1},{11020,6,1,-1},{11024,6,0,-1},{11025,6,1,-1}, +{11028,6,0,-1},{11029,6,1,-1},{11032,6,0,-1},{11033,6,1,-1},{11037,6,0,-1}, +{11038,6,1,-1},{11041,6,0,-1},{11042,6,1,-1},{11045,6,0,-1},{11046,6,1,-1}, +{11050,6,0,-1},{11051,6,1,-1},{11054,6,0,-1},{11055,6,1,-1},{11058,6,0,-1}, +{11059,6,1,-1},{11063,6,0,-1},{11064,6,1,-1},{11067,6,0,-1},{11068,6,1,-1}, +{11071,6,0,-1},{11072,6,1,-1},{11076,6,0,-1},{11077,6,1,-1},{11010,6,0,-1}, +{11080,6,0,-1},{11081,6,1,-1},{11084,6,0,-1},{11085,6,1,-1},{11089,6,0,-1}, +{11090,6,1,-1},{11023,6,1,-1},{11093,6,0,-1},{11094,6,1,-1},{11097,6,0,-1}, +{11098,6,1,-1},{11102,6,0,-1},{11103,6,1,-1},{11106,6,0,-1},{11107,6,1,-1}, +{11110,6,0,-1},{11111,6,1,-1},{11115,6,0,-1},{11116,6,1,-1},{11119,6,0,-1}, +{11120,6,1,-1},{11123,6,0,-1},{11124,6,1,-1},{11128,6,0,-1},{11129,6,1,-1}, +{11132,6,0,-1},{11133,6,1,-1},{11136,6,0,-1},{11137,6,1,-1},{11141,6,0,-1}, +{11142,6,1,-1},{11145,6,0,-1},{11146,6,1,-1},{11149,6,0,-1},{11150,6,1,-1}, +{11154,6,0,-1},{11155,6,1,-1},{11158,6,0,-1},{11159,6,1,-1},{11162,6,0,-1}, +{11163,6,1,-1},{11167,6,0,-1},{11168,6,1,-1},{11171,6,0,-1},{11172,6,1,-1}, +{11175,6,0,-1},{11176,6,1,-1},{11180,6,0,-1},{11181,6,1,-1},{11114,6,0,-1}, +{11184,6,0,-1},{11185,6,1,-1},{11188,6,0,-1},{11189,6,1,-1},{11193,6,0,-1}, +{11194,6,1,-1},{11127,6,1,-1},{11197,6,0,-1},{11198,6,1,-1},{11201,6,0,-1}, +{11202,6,1,-1},{11206,6,0,-1},{11207,6,1,-1},{11210,6,0,-1},{11211,6,1,-1}, +{11214,6,0,-1},{11215,6,1,-1},{11219,6,0,-1},{11220,6,1,-1},{11223,6,0,-1}, +{11224,6,1,-1},{11227,6,0,-1},{11228,6,1,-1},{11232,6,0,-1},{11233,6,1,-1}, +{11236,6,0,-1},{11237,6,1,-1},{11240,6,0,-1},{11241,6,1,-1},{11245,6,0,-1}, +{11246,6,1,-1},{11249,6,0,-1},{11250,6,1,-1},{11253,6,0,-1},{11254,6,1,-1}, +{11258,6,0,-1},{11259,6,1,-1},{11262,6,0,-1},{11263,6,1,-1},{11266,6,0,-1}, +{11267,6,1,-1},{11271,6,0,-1},{11272,6,1,-1},{11275,6,0,-1},{11276,6,1,-1}, +{11279,6,0,-1},{11280,6,1,-1},{11284,6,0,-1},{11285,6,1,-1},{11218,6,0,-1}, +{11288,6,0,-1},{11289,6,1,-1},{11292,6,0,-1},{11293,6,1,-1},{11297,6,0,-1}, +{11298,6,1,-1},{11231,6,1,-1},{11301,6,0,-1},{11302,6,1,-1},{11305,6,0,-1}, +{11306,6,1,-1},{11310,6,0,-1},{11311,6,1,-1},{11314,6,0,-1},{11315,6,1,-1}, +{11318,6,0,-1},{11319,6,1,-1},{11323,6,0,-1},{11324,6,1,-1},{11327,6,0,-1}, +{11328,6,1,-1},{11331,6,0,-1},{11332,6,1,-1},{11336,6,0,-1},{11337,6,1,-1}, +{11340,6,0,-1},{11341,6,1,-1},{11344,6,0,-1},{11345,6,1,-1},{11349,6,0,-1}, +{11350,6,1,-1},{11353,6,0,-1},{11354,6,1,-1},{11357,6,0,-1},{11358,6,1,-1}, +{11362,6,0,-1},{11363,6,1,-1},{11366,6,0,-1},{11367,6,1,-1},{11370,6,0,-1}, +{11371,6,1,-1},{11375,6,0,-1},{11376,6,1,-1},{11379,6,0,-1},{11380,6,1,-1}, +{11383,6,0,-1},{11384,6,1,-1},{11388,6,0,-1},{11389,6,1,-1},{11322,6,0,-1}, +{11392,6,0,-1},{11393,6,1,-1},{11396,6,0,-1},{11397,6,1,-1},{11401,6,0,-1}, +{11402,6,1,-1},{11335,6,1,-1},{11405,6,0,-1},{11406,6,1,-1},{11409,6,0,-1}, +{11410,6,1,-1},{11414,6,0,-1},{11415,6,1,-1},{11418,6,0,-1},{11419,6,1,-1}, +{11422,6,0,-1},{11423,6,1,-1},{11427,6,0,-1},{11428,6,1,-1},{11431,6,0,-1}, +{11432,6,1,-1},{11435,6,0,-1},{11436,6,1,-1},{11440,6,0,-1},{11441,6,1,-1}, +{11444,6,0,-1},{11445,6,1,-1},{11448,6,0,-1},{11449,6,1,-1},{11453,6,0,-1}, +{11454,6,1,-1},{11457,6,0,-1},{11458,6,1,-1},{11461,6,0,-1},{11462,6,1,-1}, +{11466,6,0,-1},{11467,6,1,-1},{11470,6,0,-1},{11471,6,1,-1},{11474,6,0,-1}, +{11475,6,1,-1},{11479,6,0,-1},{11480,6,1,-1},{11483,6,0,-1},{11484,6,1,-1}, +{11487,6,0,-1},{11488,6,1,-1},{11492,6,0,-1},{11493,6,1,-1},{11426,6,0,-1}, +{11496,6,0,-1},{11497,6,1,-1},{11500,6,0,-1},{11501,6,1,-1},{11505,6,0,-1}, +{11506,6,1,-1},{11439,6,1,-1},{11509,6,0,-1},{11510,6,1,-1},{11513,6,0,-1}, +{11514,6,1,-1},{11518,6,0,-1},{11519,6,1,-1},{11522,6,0,-1},{11523,6,1,-1}, +{11526,6,0,-1},{11527,6,1,-1},{11531,6,0,-1},{11532,6,1,-1},{11535,6,0,-1}, +{11536,6,1,-1},{11539,6,0,-1},{11540,6,1,-1},{11544,6,0,-1},{11545,6,1,-1}, +{11548,6,0,-1},{11549,6,1,-1},{11552,6,0,-1},{11553,6,1,-1},{11557,6,0,-1}, +{11558,6,1,-1},{11561,6,0,-1},{11562,6,1,-1},{11565,6,0,-1},{11566,6,1,-1}, +{11570,6,0,-1},{11571,6,1,-1},{11574,6,0,-1},{11575,6,1,-1},{11578,6,0,-1}, +{11579,6,1,-1},{11583,6,0,-1},{11584,6,1,-1},{11587,6,0,-1},{11588,6,1,-1}, +{11591,6,0,-1},{11592,6,1,-1},{11596,6,0,-1},{11597,6,1,-1},{11530,6,0,-1}, +{11600,6,0,-1},{11601,6,1,-1},{11604,6,0,-1},{11605,6,1,-1},{11609,6,0,-1}, +{11610,6,1,-1},{11543,6,1,-1},{11613,6,0,-1},{11614,6,1,-1},{11617,6,0,-1}, +{11622,6,0,-1},{11623,6,1,-1},{11626,6,0,-1},{11627,6,1,-1},{11630,6,0,-1}, +{11631,6,1,-1},{11635,6,0,-1},{11636,6,1,-1},{11639,6,0,-1},{11640,6,1,-1}, +{11643,6,0,-1},{11644,6,1,-1},{11648,6,0,-1},{11649,6,1,-1},{11652,6,0,-1}, +{11653,6,1,-1},{11656,6,0,-1},{11657,6,1,-1},{11661,6,0,-1},{11662,6,1,-1}, +{11665,6,0,-1},{11666,6,1,-1},{11674,6,0,-1},{11675,6,1,-1},{11678,6,0,-1}, +{11679,6,1,-1},{11682,6,0,-1},{11683,6,1,-1},{11687,6,0,-1},{11688,6,1,-1}, +{11691,6,0,-1},{11692,6,1,-1},{11695,6,0,-1},{11696,6,1,-1},{11700,6,0,-1}, +{11701,6,1,-1},{11704,6,0,-1},{11705,6,1,-1},{11708,6,0,-1},{11709,6,1,-1}, +{11713,6,0,-1},{11717,6,0,-1},{11726,6,0,-1},{11730,6,0,-1},{11734,6,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS7, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_7_ss0_ss1[] = { +{11752,7,0,-1},{11760,7,0,-1},{11769,7,0,-1},{11778,7,0,-1},{11786,7,0,-1}, +{11795,7,0,-1},{11799,7,0,-1},{11804,7,0,-1},{11738,7,0,-1},{11808,7,0,-1}, +{11812,7,0,-1},{11817,7,0,-1},{11821,7,0,-1},{11825,7,0,-1},{11830,7,0,-1}, +{11834,7,0,-1},{11838,7,0,-1},{11843,7,0,-1},{11847,7,0,-1},{11851,7,0,-1}, +{11856,7,0,-1},{11860,7,0,-1},{11864,7,0,-1},{11869,7,0,-1},{11873,7,0,-1}, +{11877,7,0,-1},{11882,7,0,-1},{11886,7,0,-1},{11890,7,0,-1},{11895,7,0,-1}, +{11899,7,0,-1},{11903,7,0,-1},{11908,7,0,-1},{11842,7,0,-1},{11912,7,0,-1}, +{11916,7,0,-1},{11921,7,0,-1},{11925,7,0,-1},{11929,7,0,-1},{11934,7,0,-1}, +{11938,7,0,-1},{11942,7,0,-1},{11947,7,0,-1},{11951,7,0,-1},{11955,7,0,-1}, +{11960,7,0,-1},{11964,7,0,-1},{11968,7,0,-1},{11973,7,0,-1},{11977,7,0,-1}, +{11981,7,0,-1},{11986,7,0,-1},{11990,7,0,-1},{11994,7,0,-1},{11999,7,0,-1}, +{12003,7,0,-1},{12007,7,0,-1},{12012,7,0,-1},{11946,7,0,-1},{12016,7,0,-1}, +{12020,7,0,-1},{12025,7,0,-1},{12026,7,1,-1},{12029,7,0,-1},{12033,7,0,-1}, +{12034,7,1,-1},{12038,7,0,-1},{12042,7,0,-1},{12046,7,0,-1},{12047,7,1,-1}, +{12051,7,0,-1},{12055,7,0,-1},{12056,7,1,-1},{12059,7,0,-1},{12064,7,0,-1}, +{12065,7,1,-1},{12068,7,0,-1},{12072,7,0,-1},{12073,7,1,-1},{12077,7,0,-1}, +{12081,7,0,-1},{12082,7,1,-1},{12085,7,0,-1},{12090,7,0,-1},{12091,7,1,-1}, +{12094,7,0,-1},{12098,7,0,-1},{12099,7,1,-1},{12103,7,0,-1},{12107,7,0,-1}, +{12108,7,1,-1},{12111,7,0,-1},{12116,7,0,-1},{12117,7,1,-1},{12050,7,0,-1}, +{12120,7,0,-1},{12124,7,0,-1},{12125,7,1,-1},{12129,7,0,-1},{12063,7,1,-1}, +{12133,7,0,-1},{12134,7,1,-1},{12137,7,0,-1},{12142,7,0,-1},{12143,7,1,-1}, +{12146,7,0,-1},{12150,7,0,-1},{12151,7,1,-1},{12155,7,0,-1},{12159,7,0,-1}, +{12160,7,1,-1},{12163,7,0,-1},{12168,7,0,-1},{12169,7,1,-1},{12172,7,0,-1}, +{12176,7,0,-1},{12177,7,1,-1},{12181,7,0,-1},{12185,7,0,-1},{12186,7,1,-1}, +{12189,7,0,-1},{12190,7,1,-1},{12194,7,0,-1},{12195,7,1,-1},{12198,7,0,-1}, +{12199,7,1,-1},{12202,7,0,-1},{12203,7,1,-1},{12207,7,0,-1},{12208,7,1,-1}, +{12211,7,0,-1},{12212,7,1,-1},{12215,7,0,-1},{12220,7,0,-1},{12221,7,1,-1}, +{12154,7,0,-1},{12224,7,0,-1},{12225,7,1,-1},{12228,7,0,-1},{12229,7,1,-1}, +{12233,7,0,-1},{12234,7,1,-1},{12167,7,1,-1},{12237,7,0,-1},{12238,7,1,-1}, +{12241,7,0,-1},{12242,7,1,-1},{12246,7,0,-1},{12247,7,1,-1},{12250,7,0,-1}, +{12251,7,1,-1},{12254,7,0,-1},{12255,7,1,-1},{12260,7,1,-1},{12263,7,0,-1}, +{12264,7,1,-1},{12267,7,0,-1},{12268,7,1,-1},{12272,7,0,-1},{12273,7,1,-1}, +{12276,7,0,-1},{12277,7,1,-1},{12280,7,0,-1},{12281,7,1,-1},{12285,7,0,-1}, +{12286,7,1,-1},{12289,7,0,-1},{12290,7,1,-1},{12293,7,0,-1},{12294,7,1,-1}, +{12298,7,0,-1},{12299,7,1,-1},{12302,7,0,-1},{12303,7,1,-1},{12306,7,0,-1}, +{12307,7,1,-1},{12311,7,0,-1},{12312,7,1,-1},{12315,7,0,-1},{12316,7,1,-1}, +{12319,7,0,-1},{12320,7,1,-1},{12324,7,0,-1},{12325,7,1,-1},{12258,7,0,-1}, +{12328,7,0,-1},{12329,7,1,-1},{12332,7,0,-1},{12333,7,1,-1},{12337,7,0,-1}, +{12338,7,1,-1},{12271,7,1,-1},{12341,7,0,-1},{12342,7,1,-1},{12345,7,0,-1}, +{12346,7,1,-1},{12350,7,0,-1},{12351,7,1,-1},{12354,7,0,-1},{12355,7,1,-1}, +{12358,7,0,-1},{12359,7,1,-1},{12363,7,0,-1},{12367,7,0,-1},{12368,7,1,-1}, +{12371,7,0,-1},{12372,7,1,-1},{12376,7,0,-1},{12377,7,1,-1},{12380,7,0,-1}, +{12381,7,1,-1},{12384,7,0,-1},{12385,7,1,-1},{12389,7,0,-1},{12390,7,1,-1}, +{12393,7,0,-1},{12394,7,1,-1},{12397,7,0,-1},{12398,7,1,-1},{12402,7,0,-1}, +{12403,7,1,-1},{12407,7,1,-1},{12410,7,0,-1},{12411,7,1,-1},{12415,7,0,-1}, +{12419,7,0,-1},{12420,7,1,-1},{12423,7,0,-1},{12424,7,1,-1},{12428,7,0,-1}, +{12429,7,1,-1},{12362,7,0,-1},{12432,7,0,-1},{12433,7,1,-1},{12436,7,0,-1}, +{12437,7,1,-1},{12441,7,0,-1},{12442,7,1,-1},{12375,7,1,-1},{12445,7,0,-1}, +{12446,7,1,-1},{12449,7,0,-1},{12450,7,1,-1},{12454,7,0,-1},{12455,7,1,-1}, +{12458,7,0,-1},{12459,7,1,-1},{12462,7,0,-1},{12463,7,1,-1},{12467,7,0,-1}, +{12468,7,1,-1},{12471,7,0,-1},{12472,7,1,-1},{12475,7,0,-1},{12476,7,1,-1}, +{12480,7,0,-1},{12481,7,1,-1},{12484,7,0,-1},{12485,7,1,-1},{12488,7,0,-1}, +{12489,7,1,-1},{12493,7,0,-1},{12494,7,1,-1},{12497,7,0,-1},{12498,7,1,-1}, +{12501,7,0,-1},{12502,7,1,-1},{12506,7,0,-1},{12507,7,1,-1},{12510,7,0,-1}, +{12511,7,1,-1},{12514,7,0,-1},{12515,7,1,-1},{12519,7,0,-1},{12520,7,1,-1}, +{12523,7,0,-1},{12524,7,1,-1},{12527,7,0,-1},{12528,7,1,-1},{12532,7,0,-1}, +{12533,7,1,-1},{12466,7,0,-1},{12536,7,0,-1},{12537,7,1,-1},{12540,7,0,-1}, +{12541,7,1,-1},{12545,7,0,-1},{12546,7,1,-1},{12479,7,1,-1},{12549,7,0,-1}, +{12550,7,1,-1},{12553,7,0,-1},{12554,7,1,-1},{12558,7,0,-1},{12559,7,1,-1}, +{12562,7,0,-1},{12563,7,1,-1},{12566,7,0,-1},{12567,7,1,-1},{12571,7,0,-1}, +{12572,7,1,-1},{12575,7,0,-1},{12576,7,1,-1},{12579,7,0,-1},{12580,7,1,-1}, +{12584,7,0,-1},{12585,7,1,-1},{12588,7,0,-1},{12589,7,1,-1},{12592,7,0,-1}, +{12593,7,1,-1},{12597,7,0,-1},{12598,7,1,-1},{12601,7,0,-1},{12602,7,1,-1}, +{12605,7,0,-1},{12606,7,1,-1},{12610,7,0,-1},{12611,7,1,-1},{12614,7,0,-1}, +{12615,7,1,-1},{12618,7,0,-1},{12619,7,1,-1},{12623,7,0,-1},{12624,7,1,-1}, +{12627,7,0,-1},{12628,7,1,-1},{12631,7,0,-1},{12632,7,1,-1},{12636,7,0,-1}, +{12637,7,1,-1},{12570,7,0,-1},{12640,7,0,-1},{12641,7,1,-1},{12644,7,0,-1}, +{12645,7,1,-1},{12649,7,0,-1},{12650,7,1,-1},{12583,7,1,-1},{12653,7,0,-1}, +{12654,7,1,-1},{12657,7,0,-1},{12658,7,1,-1},{12662,7,0,-1},{12663,7,1,-1}, +{12666,7,0,-1},{12667,7,1,-1},{12670,7,0,-1},{12671,7,1,-1},{12675,7,0,-1}, +{12676,7,1,-1},{12679,7,0,-1},{12680,7,1,-1},{12683,7,0,-1},{12684,7,1,-1}, +{12688,7,0,-1},{12689,7,1,-1},{12692,7,0,-1},{12693,7,1,-1},{12696,7,0,-1}, +{12697,7,1,-1},{12701,7,0,-1},{12702,7,1,-1},{12705,7,0,-1},{12706,7,1,-1}, +{12709,7,0,-1},{12710,7,1,-1},{12714,7,0,-1},{12715,7,1,-1},{12718,7,0,-1}, +{12719,7,1,-1},{12722,7,0,-1},{12723,7,1,-1},{12727,7,0,-1},{12728,7,1,-1}, +{12731,7,0,-1},{12732,7,1,-1},{12735,7,0,-1},{12736,7,1,-1},{12740,7,0,-1}, +{12741,7,1,-1},{12674,7,0,-1},{12744,7,0,-1},{12745,7,1,-1},{12748,7,0,-1}, +{12749,7,1,-1},{12753,7,0,-1},{12754,7,1,-1},{12687,7,1,-1},{12757,7,0,-1}, +{12758,7,1,-1},{12761,7,0,-1},{12762,7,1,-1},{12766,7,0,-1},{12767,7,1,-1}, +{12770,7,0,-1},{12771,7,1,-1},{12774,7,0,-1},{12775,7,1,-1},{12779,7,0,-1}, +{12780,7,1,-1},{12783,7,0,-1},{12784,7,1,-1},{12787,7,0,-1},{12788,7,1,-1}, +{12792,7,0,-1},{12793,7,1,-1},{12796,7,0,-1},{12797,7,1,-1},{12800,7,0,-1}, +{12801,7,1,-1},{12805,7,0,-1},{12806,7,1,-1},{12809,7,0,-1},{12810,7,1,-1}, +{12813,7,0,-1},{12814,7,1,-1},{12818,7,0,-1},{12819,7,1,-1},{12822,7,0,-1}, +{12823,7,1,-1},{12826,7,0,-1},{12827,7,1,-1},{12831,7,0,-1},{12832,7,1,-1}, +{12835,7,0,-1},{12836,7,1,-1},{12839,7,0,-1},{12840,7,1,-1},{12844,7,0,-1}, +{12845,7,1,-1},{12778,7,0,-1},{12848,7,0,-1},{12849,7,1,-1},{12852,7,0,-1}, +{12853,7,1,-1},{12857,7,0,-1},{12858,7,1,-1},{12791,7,1,-1},{12861,7,0,-1}, +{12862,7,1,-1},{12865,7,0,-1},{12866,7,1,-1},{12870,7,0,-1},{12871,7,1,-1}, +{12874,7,0,-1},{12875,7,1,-1},{12878,7,0,-1},{12879,7,1,-1},{12883,7,0,-1}, +{12884,7,1,-1},{12887,7,0,-1},{12888,7,1,-1},{12891,7,0,-1},{12892,7,1,-1}, +{12896,7,0,-1},{12897,7,1,-1},{12900,7,0,-1},{12901,7,1,-1},{12904,7,0,-1}, +{12905,7,1,-1},{12909,7,0,-1},{12910,7,1,-1},{12913,7,0,-1},{12914,7,1,-1}, +{12917,7,0,-1},{12918,7,1,-1},{12922,7,0,-1},{12923,7,1,-1},{12926,7,0,-1}, +{12927,7,1,-1},{12930,7,0,-1},{12931,7,1,-1},{12935,7,0,-1},{12936,7,1,-1}, +{12939,7,0,-1},{12940,7,1,-1},{12943,7,0,-1},{12944,7,1,-1},{12948,7,0,-1}, +{12949,7,1,-1},{12882,7,0,-1},{12952,7,0,-1},{12953,7,1,-1},{12956,7,0,-1}, +{12957,7,1,-1},{12961,7,0,-1},{12962,7,1,-1},{12895,7,1,-1},{12965,7,0,-1}, +{12966,7,1,-1},{12969,7,0,-1},{12970,7,1,-1},{12974,7,0,-1},{12975,7,1,-1}, +{12978,7,0,-1},{12979,7,1,-1},{12982,7,0,-1},{12983,7,1,-1},{12987,7,0,-1}, +{12988,7,1,-1},{12991,7,0,-1},{12992,7,1,-1},{12995,7,0,-1},{12996,7,1,-1}, +{13000,7,0,-1},{13001,7,1,-1},{13004,7,0,-1},{13005,7,1,-1},{13008,7,0,-1}, +{13009,7,1,-1},{13013,7,0,-1},{13014,7,1,-1},{13017,7,0,-1},{13018,7,1,-1}, +{13021,7,0,-1},{13022,7,1,-1},{13026,7,0,-1},{13027,7,1,-1},{13030,7,0,-1}, +{13031,7,1,-1},{13034,7,0,-1},{13035,7,1,-1},{13039,7,0,-1},{13040,7,1,-1}, +{13043,7,0,-1},{13044,7,1,-1},{13047,7,0,-1},{13048,7,1,-1},{13052,7,0,-1}, +{13053,7,1,-1},{12986,7,0,-1},{13056,7,0,-1},{13057,7,1,-1},{13060,7,0,-1}, +{13061,7,1,-1},{13065,7,0,-1},{13066,7,1,-1},{12999,7,1,-1},{13069,7,0,-1}, +{13070,7,1,-1},{13073,7,0,-1},{13074,7,1,-1},{13078,7,0,-1},{13079,7,1,-1}, +{13082,7,0,-1},{13083,7,1,-1},{13086,7,0,-1},{13087,7,1,-1},{13091,7,0,-1}, +{13092,7,1,-1},{13095,7,0,-1},{13096,7,1,-1},{13099,7,0,-1},{13100,7,1,-1}, +{13104,7,0,-1},{13105,7,1,-1},{13108,7,0,-1},{13109,7,1,-1},{13112,7,0,-1}, +{13113,7,1,-1},{13117,7,0,-1},{13118,7,1,-1},{13121,7,0,-1},{13122,7,1,-1}, +{13125,7,0,-1},{13126,7,1,-1},{13130,7,0,-1},{13131,7,1,-1},{13134,7,0,-1}, +{13135,7,1,-1},{13138,7,0,-1},{13139,7,1,-1},{13143,7,0,-1},{13144,7,1,-1}, +{13147,7,0,-1},{13148,7,1,-1},{13151,7,0,-1},{13152,7,1,-1},{13156,7,0,-1}, +{13157,7,1,-1},{13090,7,0,-1},{13160,7,0,-1},{13161,7,1,-1},{13164,7,0,-1}, +{13165,7,1,-1},{13169,7,0,-1},{13170,7,1,-1},{13103,7,1,-1},{13173,7,0,-1}, +{13174,7,1,-1},{13177,7,0,-1},{13178,7,1,-1},{13182,7,0,-1},{13183,7,1,-1}, +{13186,7,0,-1},{13187,7,1,-1},{13190,7,0,-1},{13191,7,1,-1},{13195,7,0,-1}, +{13196,7,1,-1},{13199,7,0,-1},{13200,7,1,-1},{13203,7,0,-1},{13204,7,1,-1}, +{13208,7,0,-1},{13209,7,1,-1},{13212,7,0,-1},{13213,7,1,-1},{13216,7,0,-1}, +{13217,7,1,-1},{13221,7,0,-1},{13222,7,1,-1},{13225,7,0,-1},{13226,7,1,-1}, +{13229,7,0,-1},{13230,7,1,-1},{13234,7,0,-1},{13235,7,1,-1},{13238,7,0,-1}, +{13239,7,1,-1},{13242,7,0,-1},{13243,7,1,-1},{13247,7,0,-1},{13248,7,1,-1}, +{13251,7,0,-1},{13252,7,1,-1},{13255,7,0,-1},{13256,7,1,-1},{13260,7,0,-1}, +{13261,7,1,-1},{13194,7,0,-1},{13264,7,0,-1},{13265,7,1,-1},{13268,7,0,-1}, +{13269,7,1,-1},{13273,7,0,-1},{13274,7,1,-1},{13207,7,1,-1},{13277,7,0,-1}, +{13278,7,1,-1},{13281,7,0,-1},{13282,7,1,-1},{13286,7,0,-1},{13287,7,1,-1}, +{13290,7,0,-1},{13291,7,1,-1},{13294,7,0,-1},{13295,7,1,-1},{13299,7,0,-1}, +{13300,7,1,-1},{13303,7,0,-1},{13304,7,1,-1},{13307,7,0,-1},{13308,7,1,-1}, +{13312,7,0,-1},{13313,7,1,-1},{13316,7,0,-1},{13317,7,1,-1},{13320,7,0,-1}, +{13321,7,1,-1},{13325,7,0,-1},{13326,7,1,-1},{13329,7,0,-1},{13330,7,1,-1}, +{13333,7,0,-1},{13334,7,1,-1},{13338,7,0,-1},{13339,7,1,-1},{13342,7,0,-1}, +{13343,7,1,-1},{13346,7,0,-1},{13347,7,1,-1},{13351,7,0,-1},{13352,7,1,-1}, +{13355,7,0,-1},{13356,7,1,-1},{13359,7,0,-1},{13360,7,1,-1},{13364,7,0,-1}, +{13365,7,1,-1},{13298,7,0,-1},{13368,7,0,-1},{13369,7,1,-1},{13372,7,0,-1}, +{13373,7,1,-1},{13377,7,0,-1},{13378,7,1,-1},{13311,7,1,-1},{13381,7,0,-1}, +{13382,7,1,-1},{13385,7,0,-1},{13386,7,1,-1},{13390,7,0,-1},{13391,7,1,-1}, +{13394,7,0,-1},{13395,7,1,-1},{13398,7,0,-1},{13399,7,1,-1},{13403,7,0,-1}, +{13404,7,1,-1},{13407,7,0,-1},{13408,7,1,-1},{13411,7,0,-1},{13412,7,1,-1}, +{13416,7,0,-1},{13417,7,1,-1},{13420,7,0,-1},{13421,7,1,-1},{13424,7,0,-1}, +{13425,7,1,-1},{13429,7,0,-1},{13430,7,1,-1},{13433,7,0,-1},{13434,7,1,-1}, +{13437,7,0,-1},{13438,7,1,-1},{13442,7,0,-1},{13443,7,1,-1},{13446,7,0,-1}, +{13447,7,1,-1},{13450,7,0,-1},{13451,7,1,-1},{13455,7,0,-1},{13456,7,1,-1}, +{13459,7,0,-1},{13460,7,1,-1},{13463,7,0,-1},{13464,7,1,-1},{13468,7,0,-1}, +{13469,7,1,-1},{13402,7,0,-1},{13472,7,0,-1},{13473,7,1,-1},{13476,7,0,-1}, +{13477,7,1,-1},{13481,7,0,-1},{13482,7,1,-1},{13415,7,1,-1},{13485,7,0,-1}, +{13486,7,1,-1},{13489,7,0,-1},{13490,7,1,-1},{13494,7,0,-1},{13495,7,1,-1}, +{13498,7,0,-1},{13499,7,1,-1},{13502,7,0,-1},{13503,7,1,-1},{13507,7,0,-1}, +{13508,7,1,-1},{13511,7,0,-1},{13512,7,1,-1},{13515,7,0,-1},{13516,7,1,-1}, +{13520,7,0,-1},{13521,7,1,-1},{13524,7,0,-1},{13525,7,1,-1},{13528,7,0,-1}, +{13529,7,1,-1},{13533,7,0,-1},{13534,7,1,-1},{13537,7,0,-1},{13538,7,1,-1}, +{13541,7,0,-1},{13542,7,1,-1},{13546,7,0,-1},{13547,7,1,-1},{13550,7,0,-1}, +{13551,7,1,-1},{13554,7,0,-1},{13555,7,1,-1},{13559,7,0,-1},{13560,7,1,-1}, +{13563,7,0,-1},{13564,7,1,-1},{13567,7,0,-1},{13568,7,1,-1},{13572,7,0,-1}, +{13573,7,1,-1},{13506,7,0,-1},{13576,7,0,-1},{13577,7,1,-1},{13580,7,0,-1}, +{13581,7,1,-1},{13585,7,0,-1},{13586,7,1,-1},{13519,7,1,-1},{13589,7,0,-1}, +{13590,7,1,-1},{13593,7,0,-1},{13594,7,1,-1},{13598,7,0,-1},{13599,7,1,-1}, +{13602,7,0,-1},{13603,7,1,-1},{13606,7,0,-1},{13607,7,1,-1},{13611,7,0,-1}, +{13612,7,1,-1},{13615,7,0,-1},{13616,7,1,-1},{13619,7,0,-1},{13620,7,1,-1}, +{13624,7,0,-1},{13625,7,1,-1},{13628,7,0,-1},{13629,7,1,-1},{13632,7,0,-1}, +{13633,7,1,-1},{13637,7,0,-1},{13638,7,1,-1},{13641,7,0,-1},{13642,7,1,-1}, +{13645,7,0,-1},{13646,7,1,-1},{13650,7,0,-1},{13651,7,1,-1},{13654,7,0,-1}, +{13655,7,1,-1},{13658,7,0,-1},{13659,7,1,-1},{13663,7,0,-1},{13664,7,1,-1}, +{13667,7,0,-1},{13668,7,1,-1},{13671,7,0,-1},{13672,7,1,-1},{13676,7,0,-1}, +{13677,7,1,-1},{13610,7,0,-1},{13680,7,0,-1},{13681,7,1,-1},{13684,7,0,-1}, +{13685,7,1,-1},{13689,7,0,-1},{13690,7,1,-1},{13623,7,1,-1},{13693,7,0,-1}, +{13694,7,1,-1},{13697,7,0,-1},{13698,7,1,-1},{13702,7,0,-1},{13703,7,1,-1}, +{13706,7,0,-1},{13707,7,1,-1},{13710,7,0,-1},{13711,7,1,-1},{13715,7,0,-1}, +{13716,7,1,-1},{13719,7,0,-1},{13720,7,1,-1},{13723,7,0,-1},{13724,7,1,-1}, +{13728,7,0,-1},{13729,7,1,-1},{13732,7,0,-1},{13733,7,1,-1},{13736,7,0,-1}, +{13737,7,1,-1},{13741,7,0,-1},{13742,7,1,-1},{13745,7,0,-1},{13746,7,1,-1}, +{13749,7,0,-1},{13750,7,1,-1},{13754,7,0,-1},{13755,7,1,-1},{13758,7,0,-1}, +{13759,7,1,-1},{13762,7,0,-1},{13763,7,1,-1},{13767,7,0,-1},{13768,7,1,-1}, +{13771,7,0,-1},{13772,7,1,-1},{13775,7,0,-1},{13776,7,1,-1},{13780,7,0,-1}, +{13781,7,1,-1},{13714,7,0,-1},{13784,7,0,-1},{13785,7,1,-1},{13788,7,0,-1}, +{13789,7,1,-1},{13793,7,0,-1},{13794,7,1,-1},{13727,7,1,-1},{13797,7,0,-1}, +{13798,7,1,-1},{13801,7,0,-1},{13802,7,1,-1},{13806,7,0,-1},{13807,7,1,-1}, +{13810,7,0,-1},{13811,7,1,-1},{13814,7,0,-1},{13815,7,1,-1},{13819,7,0,-1}, +{13820,7,1,-1},{13823,7,0,-1},{13824,7,1,-1},{13827,7,0,-1},{13828,7,1,-1}, +{13832,7,0,-1},{13833,7,1,-1},{13836,7,0,-1},{13837,7,1,-1},{13840,7,0,-1}, +{13841,7,1,-1},{13845,7,0,-1},{13846,7,1,-1},{13849,7,0,-1},{13850,7,1,-1}, +{13853,7,0,-1},{13854,7,1,-1},{13858,7,0,-1},{13859,7,1,-1},{13862,7,0,-1}, +{13863,7,1,-1},{13866,7,0,-1},{13867,7,1,-1},{13871,7,0,-1},{13872,7,1,-1}, +{13875,7,0,-1},{13876,7,1,-1},{13879,7,0,-1},{13880,7,1,-1},{13884,7,0,-1}, +{13885,7,1,-1},{13818,7,0,-1},{13888,7,0,-1},{13889,7,1,-1},{13892,7,0,-1}, +{13893,7,1,-1},{13897,7,0,-1},{13898,7,1,-1},{13831,7,1,-1},{13901,7,0,-1}, +{13902,7,1,-1},{13905,7,0,-1},{13906,7,1,-1},{13910,7,0,-1},{13911,7,1,-1}, +{13914,7,0,-1},{13915,7,1,-1},{13918,7,0,-1},{13919,7,1,-1},{13923,7,0,-1}, +{13924,7,1,-1},{13927,7,0,-1},{13928,7,1,-1},{13931,7,0,-1},{13932,7,1,-1}, +{13936,7,0,-1},{13937,7,1,-1},{13940,7,0,-1},{13941,7,1,-1},{13944,7,0,-1}, +{13945,7,1,-1},{13949,7,0,-1},{13950,7,1,-1},{13953,7,0,-1},{13954,7,1,-1}, +{13957,7,0,-1},{13958,7,1,-1},{13962,7,0,-1},{13963,7,1,-1},{13966,7,0,-1}, +{13967,7,1,-1},{13970,7,0,-1},{13971,7,1,-1},{13975,7,0,-1},{13976,7,1,-1}, +{13979,7,0,-1},{13980,7,1,-1},{13983,7,0,-1},{13984,7,1,-1},{13988,7,0,-1}, +{13989,7,1,-1},{13922,7,0,-1},{13992,7,0,-1},{13993,7,1,-1},{13996,7,0,-1}, +{13997,7,1,-1},{14001,7,0,-1},{14002,7,1,-1},{13935,7,1,-1},{14005,7,0,-1}, +{14006,7,1,-1},{14009,7,0,-1},{14010,7,1,-1},{14014,7,0,-1},{14015,7,1,-1}, +{14018,7,0,-1},{14019,7,1,-1},{14022,7,0,-1},{14023,7,1,-1},{14027,7,0,-1}, +{14028,7,1,-1},{14031,7,0,-1},{14032,7,1,-1},{14035,7,0,-1},{14036,7,1,-1}, +{14040,7,0,-1},{14041,7,1,-1},{14044,7,0,-1},{14045,7,1,-1},{14048,7,0,-1}, +{14049,7,1,-1},{14053,7,0,-1},{14054,7,1,-1},{14057,7,0,-1},{14058,7,1,-1}, +{14061,7,0,-1},{14062,7,1,-1},{14066,7,0,-1},{14067,7,1,-1},{14070,7,0,-1}, +{14071,7,1,-1},{14074,7,0,-1},{14075,7,1,-1},{14079,7,0,-1},{14080,7,1,-1}, +{14083,7,0,-1},{14084,7,1,-1},{14087,7,0,-1},{14088,7,1,-1},{14092,7,0,-1}, +{14093,7,1,-1},{14026,7,0,-1},{14096,7,0,-1},{14097,7,1,-1},{14100,7,0,-1}, +{14101,7,1,-1},{14105,7,0,-1},{14106,7,1,-1},{14039,7,1,-1},{14109,7,0,-1}, +{14110,7,1,-1},{14113,7,0,-1},{14114,7,1,-1},{14118,7,0,-1},{14119,7,1,-1}, +{14122,7,0,-1},{14123,7,1,-1},{14126,7,0,-1},{14127,7,1,-1},{14131,7,0,-1}, +{14132,7,1,-1},{14135,7,0,-1},{14136,7,1,-1},{14139,7,0,-1},{14140,7,1,-1}, +{14144,7,0,-1},{14145,7,1,-1},{14148,7,0,-1},{14149,7,1,-1},{14152,7,0,-1}, +{14153,7,1,-1},{14157,7,0,-1},{14158,7,1,-1},{14161,7,0,-1},{14162,7,1,-1}, +{14165,7,0,-1},{14166,7,1,-1},{14170,7,0,-1},{14171,7,1,-1},{14174,7,0,-1}, +{14175,7,1,-1},{14178,7,0,-1},{14179,7,1,-1},{14183,7,0,-1},{14184,7,1,-1}, +{14187,7,0,-1},{14188,7,1,-1},{14191,7,0,-1},{14192,7,1,-1},{14196,7,0,-1}, +{14197,7,1,-1},{14130,7,0,-1},{14200,7,0,-1},{14201,7,1,-1},{14204,7,0,-1}, +{14205,7,1,-1},{14209,7,0,-1},{14210,7,1,-1},{14143,7,1,-1},{14213,7,0,-1}, +{14214,7,1,-1},{14217,7,0,-1},{14218,7,1,-1},{14222,7,0,-1},{14223,7,1,-1}, +{14226,7,0,-1},{14227,7,1,-1},{14230,7,0,-1},{14231,7,1,-1},{14235,7,0,-1}, +{14236,7,1,-1},{14239,7,0,-1},{14240,7,1,-1},{14243,7,0,-1},{14244,7,1,-1}, +{14248,7,0,-1},{14249,7,1,-1},{14252,7,0,-1},{14253,7,1,-1},{14256,7,0,-1}, +{14257,7,1,-1},{14261,7,0,-1},{14262,7,1,-1},{14265,7,0,-1},{14266,7,1,-1}, +{14269,7,0,-1},{14270,7,1,-1},{14274,7,0,-1},{14275,7,1,-1},{14278,7,0,-1}, +{14279,7,1,-1},{14282,7,0,-1},{14283,7,1,-1},{14287,7,0,-1},{14288,7,1,-1}, +{14291,7,0,-1},{14292,7,1,-1},{14295,7,0,-1},{14296,7,1,-1},{14300,7,0,-1}, +{14301,7,1,-1},{14234,7,0,-1},{14304,7,0,-1},{14305,7,1,-1},{14308,7,0,-1}, +{14309,7,1,-1},{14313,7,0,-1},{14314,7,1,-1},{14247,7,1,-1},{14317,7,0,-1}, +{14318,7,1,-1},{14321,7,0,-1},{14322,7,1,-1},{14326,7,0,-1},{14327,7,1,-1}, +{14330,7,0,-1},{14331,7,1,-1},{14334,7,0,-1},{14335,7,1,-1},{14339,7,0,-1}, +{14340,7,1,-1},{14343,7,0,-1},{14344,7,1,-1},{14347,7,0,-1},{14348,7,1,-1}, +{14352,7,0,-1},{14353,7,1,-1},{14356,7,0,-1},{14357,7,1,-1},{14360,7,0,-1}, +{14361,7,1,-1},{14365,7,0,-1},{14366,7,1,-1},{14369,7,0,-1},{14370,7,1,-1}, +{14373,7,0,-1},{14374,7,1,-1},{14378,7,0,-1},{14379,7,1,-1},{14382,7,0,-1}, +{14383,7,1,-1},{14386,7,0,-1},{14387,7,1,-1},{14391,7,0,-1},{14392,7,1,-1}, +{14395,7,0,-1},{14396,7,1,-1},{14399,7,0,-1},{14400,7,1,-1},{14404,7,0,-1}, +{14405,7,1,-1},{14338,7,0,-1},{14408,7,0,-1},{14409,7,1,-1},{14412,7,0,-1}, +{14413,7,1,-1},{14417,7,0,-1},{14418,7,1,-1},{14351,7,1,-1},{14421,7,0,-1}, +{14422,7,1,-1},{14425,7,0,-1},{14426,7,1,-1},{14430,7,0,-1},{14431,7,1,-1}, +{14434,7,0,-1},{14435,7,1,-1},{14438,7,0,-1},{14439,7,1,-1},{14443,7,0,-1}, +{14444,7,1,-1},{14447,7,0,-1},{14448,7,1,-1},{14451,7,0,-1},{14452,7,1,-1}, +{14456,7,0,-1},{14457,7,1,-1},{14460,7,0,-1},{14461,7,1,-1},{14464,7,0,-1}, +{14465,7,1,-1},{14469,7,0,-1},{14470,7,1,-1},{14473,7,0,-1},{14474,7,1,-1}, +{14477,7,0,-1},{14478,7,1,-1},{14482,7,0,-1},{14483,7,1,-1},{14486,7,0,-1}, +{14487,7,1,-1},{14490,7,0,-1},{14491,7,1,-1},{14495,7,0,-1},{14496,7,1,-1}, +{14499,7,0,-1},{14500,7,1,-1},{14503,7,0,-1},{14504,7,1,-1},{14508,7,0,-1}, +{14509,7,1,-1},{14442,7,0,-1},{14512,7,0,-1},{14513,7,1,-1},{14516,7,0,-1}, +{14517,7,1,-1},{14521,7,0,-1},{14522,7,1,-1},{14455,7,1,-1},{14525,7,0,-1}, +{14526,7,1,-1},{14529,7,0,-1},{14530,7,1,-1},{14534,7,0,-1},{14535,7,1,-1}, +{14538,7,0,-1},{14539,7,1,-1},{14542,7,0,-1},{14543,7,1,-1},{14547,7,0,-1}, +{14548,7,1,-1},{14551,7,0,-1},{14552,7,1,-1},{14555,7,0,-1},{14556,7,1,-1}, +{14560,7,0,-1},{14561,7,1,-1},{14564,7,0,-1},{14565,7,1,-1},{14568,7,0,-1}, +{14569,7,1,-1},{14573,7,0,-1},{14574,7,1,-1},{14577,7,0,-1},{14578,7,1,-1}, +{14581,7,0,-1},{14582,7,1,-1},{14586,7,0,-1},{14587,7,1,-1},{14590,7,0,-1}, +{14591,7,1,-1},{14594,7,0,-1},{14595,7,1,-1},{14599,7,0,-1},{14600,7,1,-1}, +{14603,7,0,-1},{14604,7,1,-1},{14607,7,0,-1},{14608,7,1,-1},{14612,7,0,-1}, +{14613,7,1,-1},{14546,7,0,-1},{14616,7,0,-1},{14617,7,1,-1},{14620,7,0,-1}, +{14621,7,1,-1},{14625,7,0,-1},{14626,7,1,-1},{14559,7,1,-1},{14629,7,0,-1}, +{14630,7,1,-1},{14633,7,0,-1},{14634,7,1,-1},{14638,7,0,-1},{14639,7,1,-1}, +{14642,7,0,-1},{14643,7,1,-1},{14646,7,0,-1},{14647,7,1,-1},{14651,7,0,-1}, +{14652,7,1,-1},{14655,7,0,-1},{14656,7,1,-1},{14659,7,0,-1},{14660,7,1,-1}, +{14664,7,0,-1},{14665,7,1,-1},{14668,7,0,-1},{14669,7,1,-1},{14672,7,0,-1}, +{14673,7,1,-1},{14677,7,0,-1},{14678,7,1,-1},{14681,7,0,-1},{14682,7,1,-1}, +{14685,7,0,-1},{14686,7,1,-1},{14690,7,0,-1},{14691,7,1,-1},{14694,7,0,-1}, +{14695,7,1,-1},{14698,7,0,-1},{14699,7,1,-1},{14703,7,0,-1},{14704,7,1,-1}, +{14707,7,0,-1},{14708,7,1,-1},{14711,7,0,-1},{14712,7,1,-1},{14716,7,0,-1}, +{14717,7,1,-1},{14650,7,0,-1},{14720,7,0,-1},{14721,7,1,-1},{14724,7,0,-1}, +{14725,7,1,-1},{14729,7,0,-1},{14730,7,1,-1},{14663,7,1,-1},{14733,7,0,-1}, +{14734,7,1,-1},{14737,7,0,-1},{14738,7,1,-1},{14742,7,0,-1},{14743,7,1,-1}, +{14746,7,0,-1},{14747,7,1,-1},{14750,7,0,-1},{14751,7,1,-1},{14755,7,0,-1}, +{14756,7,1,-1},{14759,7,0,-1},{14760,7,1,-1},{14763,7,0,-1},{14764,7,1,-1}, +{14768,7,0,-1},{14769,7,1,-1},{14772,7,0,-1},{14773,7,1,-1},{14776,7,0,-1}, +{14777,7,1,-1},{14781,7,0,-1},{14782,7,1,-1},{14785,7,0,-1},{14786,7,1,-1}, +{14789,7,0,-1},{14790,7,1,-1},{14794,7,0,-1},{14795,7,1,-1},{14798,7,0,-1}, +{14799,7,1,-1},{14802,7,0,-1},{14803,7,1,-1},{14807,7,0,-1},{14808,7,1,-1}, +{14811,7,0,-1},{14812,7,1,-1},{14815,7,0,-1},{14816,7,1,-1},{14820,7,0,-1}, +{14821,7,1,-1},{14754,7,0,-1},{14824,7,0,-1},{14825,7,1,-1},{14828,7,0,-1}, +{14829,7,1,-1},{14833,7,0,-1},{14834,7,1,-1},{14767,7,1,-1},{14837,7,0,-1}, +{14838,7,1,-1},{14841,7,0,-1},{14842,7,1,-1},{14846,7,0,-1},{14847,7,1,-1}, +{14850,7,0,-1},{14851,7,1,-1},{14854,7,0,-1},{14855,7,1,-1},{14859,7,0,-1}, +{14860,7,1,-1},{14863,7,0,-1},{14864,7,1,-1},{14867,7,0,-1},{14868,7,1,-1}, +{14872,7,0,-1},{14873,7,1,-1},{14876,7,0,-1},{14877,7,1,-1},{14880,7,0,-1}, +{14881,7,1,-1},{14885,7,0,-1},{14886,7,1,-1},{14889,7,0,-1},{14890,7,1,-1}, +{14893,7,0,-1},{14894,7,1,-1},{14898,7,0,-1},{14899,7,1,-1},{14902,7,0,-1}, +{14903,7,1,-1},{14906,7,0,-1},{14907,7,1,-1},{14911,7,0,-1},{14912,7,1,-1}, +{14915,7,0,-1},{14916,7,1,-1},{14919,7,0,-1},{14920,7,1,-1},{14924,7,0,-1}, +{14925,7,1,-1},{14858,7,0,-1},{14928,7,0,-1},{14929,7,1,-1},{14932,7,0,-1}, +{14933,7,1,-1},{14937,7,0,-1},{14938,7,1,-1},{14871,7,1,-1},{14941,7,0,-1}, +{14942,7,1,-1},{14945,7,0,-1},{14946,7,1,-1},{14950,7,0,-1},{14951,7,1,-1}, +{14954,7,0,-1},{14955,7,1,-1},{14958,7,0,-1},{14959,7,1,-1},{14963,7,0,-1}, +{14964,7,1,-1},{14967,7,0,-1},{14968,7,1,-1},{14971,7,0,-1},{14972,7,1,-1}, +{14976,7,0,-1},{14977,7,1,-1},{14980,7,0,-1},{14981,7,1,-1},{14984,7,0,-1}, +{14985,7,1,-1},{14989,7,0,-1},{14990,7,1,-1},{14993,7,0,-1},{14994,7,1,-1}, +{14997,7,0,-1},{14998,7,1,-1},{15002,7,0,-1},{15003,7,1,-1},{15006,7,0,-1}, +{15007,7,1,-1},{15010,7,0,-1},{15011,7,1,-1},{15015,7,0,-1},{15016,7,1,-1}, +{15019,7,0,-1},{15020,7,1,-1},{15023,7,0,-1},{15024,7,1,-1},{15028,7,0,-1}, +{15029,7,1,-1},{14962,7,0,-1},{15032,7,0,-1},{15033,7,1,-1},{15036,7,0,-1}, +{15037,7,1,-1},{15041,7,0,-1},{15042,7,1,-1},{14975,7,1,-1},{15045,7,0,-1}, +{15046,7,1,-1},{15049,7,0,-1},{15050,7,1,-1},{15054,7,0,-1},{15055,7,1,-1}, +{15058,7,0,-1},{15059,7,1,-1},{15062,7,0,-1},{15063,7,1,-1},{15067,7,0,-1}, +{15068,7,1,-1},{15071,7,0,-1},{15072,7,1,-1},{15075,7,0,-1},{15076,7,1,-1}, +{15080,7,0,-1},{15081,7,1,-1},{15084,7,0,-1},{15085,7,1,-1},{15088,7,0,-1}, +{15089,7,1,-1},{15093,7,0,-1},{15094,7,1,-1},{15097,7,0,-1},{15098,7,1,-1}, +{15101,7,0,-1},{15102,7,1,-1},{15106,7,0,-1},{15107,7,1,-1},{15110,7,0,-1}, +{15111,7,1,-1},{15114,7,0,-1},{15115,7,1,-1},{15119,7,0,-1},{15120,7,1,-1}, +{15123,7,0,-1},{15124,7,1,-1},{15127,7,0,-1},{15128,7,1,-1},{15132,7,0,-1}, +{15133,7,1,-1},{15066,7,0,-1},{15136,7,0,-1},{15137,7,1,-1},{15140,7,0,-1}, +{15141,7,1,-1},{15145,7,0,-1},{15146,7,1,-1},{15079,7,1,-1},{15149,7,0,-1}, +{15150,7,1,-1},{15153,7,0,-1},{15154,7,1,-1},{15158,7,0,-1},{15159,7,1,-1}, +{15162,7,0,-1},{15163,7,1,-1},{15166,7,0,-1},{15167,7,1,-1},{15171,7,0,-1}, +{15172,7,1,-1},{15175,7,0,-1},{15176,7,1,-1},{15179,7,0,-1},{15180,7,1,-1}, +{15184,7,0,-1},{15185,7,1,-1},{15188,7,0,-1},{15189,7,1,-1},{15192,7,0,-1}, +{15193,7,1,-1},{15197,7,0,-1},{15198,7,1,-1},{15201,7,0,-1},{15202,7,1,-1}, +{15205,7,0,-1},{15206,7,1,-1},{15210,7,0,-1},{15211,7,1,-1},{15214,7,0,-1}, +{15215,7,1,-1},{15218,7,0,-1},{15219,7,1,-1},{15223,7,0,-1},{15224,7,1,-1}, +{15227,7,0,-1},{15228,7,1,-1},{15231,7,0,-1},{15232,7,1,-1},{15236,7,0,-1}, +{15237,7,1,-1},{15170,7,0,-1},{15240,7,0,-1},{15241,7,1,-1},{15244,7,0,-1}, +{15245,7,1,-1},{15249,7,0,-1},{15250,7,1,-1},{15183,7,1,-1},{15253,7,0,-1}, +{15254,7,1,-1},{15257,7,0,-1},{15258,7,1,-1},{15262,7,0,-1},{15263,7,1,-1}, +{15266,7,0,-1},{15267,7,1,-1},{15270,7,0,-1},{15271,7,1,-1},{15275,7,0,-1}, +{15276,7,1,-1},{15279,7,0,-1},{15280,7,1,-1},{15284,7,1,-1},{15288,7,0,-1}, +{15289,7,1,-1},{15292,7,0,-1},{15293,7,1,-1},{15296,7,0,-1},{15297,7,1,-1}, +{15301,7,0,-1},{15302,7,1,-1},{15305,7,0,-1},{15306,7,1,-1},{15309,7,0,-1}, +{15310,7,1,-1},{15314,7,0,-1},{15315,7,1,-1},{15318,7,0,-1},{15319,7,1,-1}, +{15322,7,0,-1},{15323,7,1,-1},{15327,7,0,-1},{15328,7,1,-1},{15331,7,0,-1}, +{15332,7,1,-1},{15336,7,1,-1},{15340,7,0,-1},{15341,7,1,-1},{15344,7,0,-1}, +{15345,7,1,-1},{15348,7,0,-1},{15349,7,1,-1},{15353,7,0,-1},{15354,7,1,-1}, +{15357,7,0,-1},{15361,7,0,-1},{15366,7,0,-1},{15370,7,0,-1},{15374,7,0,-1}}; diff --git a/tests/testsuite.at b/tests/testsuite.at index fed0018..0efd333 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -37,3 +37,9 @@ cat $abs_srcdir/tx_power/tx_power_test.err > experr AT_CHECK([$abs_top_builddir/tests/tx_power/tx_power_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([meas]) +AT_KEYWORDS([meas]) +cat $abs_srcdir/meas/meas_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/meas/meas_test], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 Gerrit-PatchSet: 9 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 Mon Jul 10 16:16:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 16:16:49 +0000 Subject: osmo-gsm-manuals[master]: SMPP: Document Osmocom extensions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3173 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4cedd07a33633bdd2350d2bda0a22cc0c631c0a9 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 Mon Jul 10 16:16:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 16:16:51 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: SMPP: Document Osmocom extensions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SMPP: Document Osmocom extensions ...................................................................... SMPP: Document Osmocom extensions Change-Id: I4cedd07a33633bdd2350d2bda0a22cc0c631c0a9 --- M OsmoNITB/chapters/smpp.adoc 1 file changed, 51 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoNITB/chapters/smpp.adoc b/OsmoNITB/chapters/smpp.adoc index eacbb80..23951ba 100644 --- a/OsmoNITB/chapters/smpp.adoc +++ b/OsmoNITB/chapters/smpp.adoc @@ -59,8 +59,8 @@ more specific route should be routed to this ESME. Use the `deliver-src-imsi` command to indicate that the SMPP DELIVER -messages for MO SMS should state the IMSI (rather than the MSISDN) as -source address. +messages for MO SMS and the SMPP ALERT should state the IMSI (rather +than the MSISDN) as source address. Use the `osmocom-extensions` command to request that Osmocom specific extension TLVs shall be included in the SMPP PDUs. Those extensions @@ -82,6 +82,7 @@ The following example configuration snippet shows a single ESME 'galactica' with a prefix-route of all national numbers stating with 2342: + ---- smpp local-tcp-port 2775 @@ -93,3 +94,51 @@ osmocom-extensions route prefix national isdn 2342 ---- + + +=== Osmocom SMPP protocol extensions + +Osmocom has implemented some extensions to the SMPP v3.4 protocol. + +These extensions can be enabled using the `osmocom-extensions` VTY +command at `esme` level. + +The TLV definitions can be found in the +`` header file provided by +libosmocore. + +==== RF channel measuremets + +When the Osmocom SMPP extensions are enabled, we add the following +TLVs to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length (Octets) | Purpose +| TLVID_osmo_arfcn | 0x2300 | 2 | GSM ARFCN of the radio interface +| TLVID_osmo_ta | 0x2301 | 1 | Timing Advance on the radio interface +| TLVID_osmo_ms_l1_txpwr | 0x2307 | 1 | Transmit Power of the MS in uplink direction +| TLVID_osmo_rxlev_ul | 0x2302 | 2 | Uplink receive level as measured by BTS in dBm (int16_t) +| TLVID_osmo_rxqual_ul | 0x2303 | 1 | Uplink RxQual value as measured by BTS +| TLVID_osmo_rxlev_dl | 0x2304 | 2 | Downlink receive level as measured by MS in dBm (int16_t) +| TLVID_osmo_rxqual_dl | 0x2305 | 1 | Downlink RxQual value as measured by MS +|=== + +All of the above values reflect the *last measurement report* as +recieved vi A-bis RSL from the BTS. It is thus a snapshot value (of +the average within one 480ms SACCH period), and not an average over +all the SACCH periods during which the channel was open or the SMS was +received. Not all measurement reports contain all the values. So you +might not get an TLVID_osmo_rxlev_dl IE, as that particular uplink +frame might habe benn lost for the given snapshot we report. + +==== Equipment IMEI + +If we know the IMEI of the subscribers phone, we add the following TLV +to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length | Purpose +| TLVID_osmo_imei | 0x2306 | variable | IMEI of the subscibers phone (ME) +|=== -- To view, visit https://gerrit.osmocom.org/3173 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4cedd07a33633bdd2350d2bda0a22cc0c631c0a9 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 Mon Jul 10 16:18:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 16:18:13 +0000 Subject: [PATCH] openbsc[master]: Support for TS 04.14 conformance test commands In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3168 to look at the new patch set (#2). Support for TS 04.14 conformance test commands Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c --- M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/gsm_04_14.h M openbsc/src/libmsc/Makefile.am M openbsc/src/libmsc/gsm_04_08.c A openbsc/src/libmsc/gsm_04_14.c 5 files changed, 153 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/3168/2 diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 2740a5d..db03caa 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -36,6 +36,7 @@ gprs_utils.h \ gsm_04_08.h \ gsm_04_11.h \ + gsm_04_14.h \ gsm_04_80.h \ gsm_data.h \ gsm_data_shared.h \ diff --git a/openbsc/include/openbsc/gsm_04_14.h b/openbsc/include/openbsc/gsm_04_14.h new file mode 100644 index 0000000..3cdbe04 --- /dev/null +++ b/openbsc/include/openbsc/gsm_04_14.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode); +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs); +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology); + +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg); diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am index 9d966db..c219a35 100644 --- a/openbsc/src/libmsc/Makefile.am +++ b/openbsc/src/libmsc/Makefile.am @@ -27,6 +27,7 @@ db.c \ gsm_04_08.c \ gsm_04_11.c \ + gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ mncc.c \ diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 89108e4..7e5267e 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -4027,6 +4028,9 @@ release_anchor(conn); rc = handle_rcv_ussd(conn, msg); break; + case GSM48_PDISC_TEST: + rc = gsm0414_rcv_test(conn, msg); + break; default: LOGP(DRLL, LOGL_NOTICE, "Unknown " "GSM 04.08 discriminator 0x%02x\n", pdisc); diff --git a/openbsc/src/libmsc/gsm_04_14.c b/openbsc/src/libmsc/gsm_04_14.c new file mode 100644 index 0000000..23de23e --- /dev/null +++ b/openbsc/src/libmsc/gsm_04_14.c @@ -0,0 +1,132 @@ +/* GSM MS Testing Layer 3 messages + * 3GPP TS 44.014 / GSM TS 04.14 */ + +/* (C) 2017 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 "bscconfig.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct msgb *create_gsm0414_msg(uint8_t msg_type) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); + struct gsm48_hdr *gh; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_TEST; + gh->msg_type = msg_type; + return msg; +} + +static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + return gsm0808_submit_dtap(conn, msg, 0, 0); +} + +static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) +{ + struct msgb *msg = create_gsm0414_msg(msg_type); + + return gsm0414_conn_sendmsg(conn, msg); +} + + +/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); + uint8_t subch; + + subch = (loop_mode << 1); + msgb_put_u8(msg, subch); + + msg->lchan = conn->lchan; + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a OPEN_LOOP_CMD according to Section 8.3 */ +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); +} + +/* Send a ACT_EMMI_CMD according to Section 8.8 */ +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); +} + +/* Send a DEACT_EMMI_CMD according to Section 8.10 */ +int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); +} + +/* Send a TEST_INTERFACE according to Section 8.11 */ +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); + msgb_put_u8(msg, tested_devs); + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); + msgb_put_u8(msg, technology); + return gsm0414_conn_sendmsg(conn, msg); +} + + + +/* Entry point for incoming GSM48_PDISC_TEST received from MS */ +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + + if (msgb_l3len(msg) < sizeof(*gh)) + return -1; + + LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", + get_value_string(gsm414_msgt_names, gh->msg_type)); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 16:21:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 16:21:08 +0000 Subject: [MERGED] osmo-bts[master]: octphy: remap frame number in MEAS_IND In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: remap frame number in MEAS_IND ...................................................................... octphy: remap frame number in MEAS_IND The octasic phy stamps the SACCH channel that carries the measurmenet indication with the frame number of the last SACCH that falls within the measurement period. The higher layers expect the frame number to be aligned to the SACCH channel after, which marks also the beginning of the next measurement period. Make the octphy code compatible to the higher layers by remapping the measurement indication frame number. Change-Id: I8ecb27c018bf4ad5151878a6ad34026fd0f801a1 --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 52 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 740d808..20a84f8 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -774,6 +774,57 @@ * handling of messages coming up from PHY ***********************************************************************/ +/* When the measurement indication is received from the phy, the phy will + * automatically stamp it with the frame number that matches the frame + * number of the SACCH channel that marks the end of the measurement + * period. (e.g. fn%104=90, on a TCH/H, TS0). However, the upper layers + * expect the frame number to be aligned to the next SACCH frame after, + * after the end of the measurement period that has just passed. (e.g. + * (fn%104=10, on a TCH/H, TS0). The following function remaps the frame + * number in order to match the higher layers expectations. + * See also: 3GPP TS 05.02 Clause 7 Table 1 of 9 Mapping of logical channels + * onto physical channels (see subclauses 6.3, 6.4, 6.5) */ +static uint32_t translate_tch_meas_rep_fn104_reverse(uint32_t fn) +{ + uint8_t new_fn_mod; + uint8_t fn_mod; + + fn_mod = fn % 104; + + switch (fn_mod) { + case 103: + new_fn_mod = 25; + break; + case 12: + new_fn_mod = 38; + break; + case 25: + new_fn_mod = 51; + break; + case 38: + new_fn_mod = 64; + break; + case 51: + new_fn_mod = 77; + break; + case 64: + new_fn_mod = 90; + break; + case 77: + new_fn_mod = 103; + break; + case 90: + new_fn_mod = 12; + break; + default: + /* No translation for frame numbers + * fall out of the raster */ + new_fn_mod = fn_mod; + } + + return (fn - fn_mod) + new_fn_mod; +} + static void process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, uint32_t fn, uint32_t data_len, tOCTVC1_GSM_MEASUREMENT_INFO * m) @@ -812,7 +863,7 @@ l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) ((m->sRSSIDbm >> 8) * -1); /* copy logical frame number to MEAS IND data structure */ - l1sap.u.info.u.meas_ind.fn = fn; + l1sap.u.info.u.meas_ind.fn = translate_tch_meas_rep_fn104_reverse(fn); /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ -- To view, visit https://gerrit.osmocom.org/3118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ecb27c018bf4ad5151878a6ad34026fd0f801a1 Gerrit-PatchSet: 5 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 Mon Jul 10 16:21:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 10 Jul 2017 16:21:32 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 6: > you can simply convert your function to be a wrapper around > fn->gsmtime->string, i.e. calling the two existing functions in a > row. I agree with Harald. Feel free to use it in several places in osmo-bts where currently osmo_dump_gsmtime is used. -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 16:30:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 16:30:07 +0000 Subject: openbsc[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 16:30:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 16:30:09 +0000 Subject: [MERGED] openbsc[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins.sh: Proper error message if local environment isn't set up ...................................................................... jenkins.sh: Proper error message if local environment isn't set up Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 --- M 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 index 068ee34..7e7ccf0 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 16:31:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 16:31:33 +0000 Subject: osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 17:19:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 17:19:50 +0000 Subject: [MERGED] openbsc[master]: 04.08: find a portable way to obtain the timezone offset In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: 04.08: find a portable way to obtain the timezone offset ...................................................................... 04.08: find a portable way to obtain the timezone offset Portable GMT offset calculation to display correct time on GSM. Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 --- M openbsc/src/libmsc/gsm_04_08.c 1 file changed, 10 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 89108e4..f926223 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -861,12 +861,19 @@ else { /* Need to get GSM offset and convert into 15 min units */ /* This probably breaks if gmtoff returns a value not evenly divisible by 15? */ - local_time = localtime(&cur_t); #ifdef HAVE_TM_GMTOFF_IN_TM + local_time = localtime(&cur_t); tzunits = (local_time->tm_gmtoff/60)/15; #else -#warning find a portable way to obtain the timezone offset - tzunits = 0; + /* find timezone offset */ + time_t utc; + double offsetFromUTC; + utc = mktime(gmt_time); + local_time = localtime(&cur_t); + offsetFromUTC = difftime(cur_t, utc); + if (local_time->tm_isdst) + offsetFromUTC += 3600.0; + tzunits = ((int)offsetFromUTC) / 60 / 15; #endif if (tzunits < 0) { tzunits = tzunits/-1; -- To view, visit https://gerrit.osmocom.org/3128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 Gerrit-PatchSet: 8 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jul 10 17:19:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 17:19:56 +0000 Subject: [MERGED] openbsc[master]: sgsn: Fill the cch_pdp with a value coming from the tlv stru... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsn: Fill the cch_pdp with a value coming from the tlv structure ...................................................................... sgsn: Fill the cch_pdp with a value coming from the tlv structure For some GGSNs we need to insert the PDP Charging Characteristics that were returned. We receive these values from GSUP and will fill them into the tlv structure when finding the ggsn context. Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 --- M openbsc/include/openbsc/gprs_sgsn.h M openbsc/src/gprs/gprs_sgsn.c M openbsc/src/gprs/gprs_subscriber.c M openbsc/src/gprs/sgsn_libgtp.c 4 files changed, 42 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index fd86174..4e49c08 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -393,6 +393,8 @@ char apn_str[GSM_APN_LENGTH]; uint8_t qos_subscribed[20]; size_t qos_subscribed_len; + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; struct sgsn_subscriber_data { @@ -407,6 +409,9 @@ uint8_t hlr[9]; size_t hlr_len; + + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; #define SGSN_ERROR_CAUSE_NONE (-1) diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 071dd97..fbea5b9 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -698,10 +698,21 @@ sgsn_auth_update(mmctx); } -static void insert_qos(struct tlv_parsed *tp, struct sgsn_subscriber_pdp_data *pdp) +static void insert_extra(struct tlv_parsed *tp, + struct sgsn_subscriber_data *data, + struct sgsn_subscriber_pdp_data *pdp) { tp->lv[OSMO_IE_GSM_SUB_QOS].len = pdp->qos_subscribed_len; tp->lv[OSMO_IE_GSM_SUB_QOS].val = pdp->qos_subscribed; + + /* Prefer PDP charging characteristics of per subscriber one */ + if (pdp->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(pdp->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &pdp->pdp_charg[0]; + } else if (data->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(data->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &data->pdp_charg[0]; + } } /** @@ -750,7 +761,7 @@ { allow_any_apn = 1; selected_apn_str = ""; - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); continue; } if (!llist_empty(&sgsn_apn_ctxts)) { @@ -759,7 +770,7 @@ if (apn_ctx == NULL) continue; } - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = pdp->apn_str; break; } @@ -767,13 +778,13 @@ /* Check whether the given APN is granted */ llist_for_each_entry(pdp, &mmctx->subscr->sgsn_data->pdp_list, list) { if (strcmp(pdp->apn_str, "*") == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; allow_any_apn = 1; continue; } if (strcasecmp(pdp->apn_str, req_apn_str) == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; break; } diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c index 1bb5141..c90ba70 100644 --- a/openbsc/src/gprs/gprs_subscriber.c +++ b/openbsc/src/gprs/gprs_subscriber.c @@ -324,6 +324,13 @@ } } + if (gsup_msg->pdp_charg_enc && gsup_msg->pdp_charg_enc_len >= sizeof(sdata->pdp_charg)) { + memcpy(&sdata->pdp_charg, gsup_msg->pdp_charg_enc, sizeof(sdata->pdp_charg)); + sdata->has_pdp_charg = 1; + } else { + sdata->has_pdp_charg = 0; + } + if (gsup_msg->pdp_info_compl) { rc = gprs_subscr_pdp_data_clear(subscr); if (rc > 0) @@ -367,6 +374,13 @@ pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + + if (pdp_info->pdp_charg_enc && pdp_info->pdp_charg_enc_len >= sizeof(pdp_data->pdp_charg)) { + memcpy(&pdp_data->pdp_charg, pdp_info->pdp_charg_enc, sizeof(pdp_data->pdp_charg)); + pdp_data->has_pdp_charg = 1; + } else { + pdp_data->has_pdp_charg = 0; + } } } diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 001e611..90ac48a 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -234,6 +234,13 @@ memcpy(pdp->qos_req.v, qos, pdp->qos_req.l); } + /* charging characteristics if present */ + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) { + OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); + memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), + TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); + } + /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); memcpy(pdp->gsnlc.v, &sgsn->cfg.gtp_listenaddr.sin_addr, -- To view, visit https://gerrit.osmocom.org/3161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 17:20:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 17:20:01 +0000 Subject: [MERGED] openbsc[master]: libmsc: Fix VTY output for handover counters. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: Fix VTY output for handover counters. ...................................................................... libmsc: Fix VTY output for handover counters. Handover countrs belong to BSC, but we mistakenly take values from MSC counters. Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 --- M openbsc/src/libmsc/vty_interface_layer3.c 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index e503291..042da9c 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -833,11 +833,11 @@ VTY_NEWLINE); vty_out(vty, "Handover : %lu attempted, %lu no_channel, %lu timeout, " "%lu completed, %lu failed%s", - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, VTY_NEWLINE); vty_out(vty, "SMS MO : %lu submitted, %lu no receiver%s", net->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED].current, -- To view, visit https://gerrit.osmocom.org/3159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jul 10 18:00:05 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 10 Jul 2017 18:00:05 +0000 Subject: osmo-trx[master]: LimeSDR: Fix sample value range In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 18:00:26 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 10 Jul 2017 18:00:26 +0000 Subject: [MERGED] osmo-trx[master]: LimeSDR: Fix sample value range In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: LimeSDR: Fix sample value range ...................................................................... LimeSDR: Fix sample value range when "sc16" stream arg is passed to SoapyUHD sample value range is -32768 to 32767 Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index a69d6c3..778c772 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -1185,7 +1185,7 @@ double uhd_device::fullScaleInputValue() { if (dev_type == LIMESDR) - return (double) 2047 * LIMESDR_TX_AMPL; + return (double) SHRT_MAX * LIMESDR_TX_AMPL; if (dev_type == UMTRX) return (double) SHRT_MAX * UMTRX_TX_AMPL; else @@ -1194,7 +1194,6 @@ double uhd_device::fullScaleOutputValue() { - if (dev_type == LIMESDR) return (double) 2047; return (double) SHRT_MAX; } -- To view, visit https://gerrit.osmocom.org/3075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jul 10 18:27:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 18:27:22 +0000 Subject: openbsc[master]: Support for TS 04.14 conformance test commands In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 18:27:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 18:27:24 +0000 Subject: [MERGED] openbsc[master]: Support for TS 04.14 conformance test commands In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Support for TS 04.14 conformance test commands ...................................................................... Support for TS 04.14 conformance test commands Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c --- M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/gsm_04_14.h M openbsc/src/libmsc/Makefile.am M openbsc/src/libmsc/gsm_04_08.c A openbsc/src/libmsc/gsm_04_14.c 5 files changed, 153 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 2740a5d..db03caa 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -36,6 +36,7 @@ gprs_utils.h \ gsm_04_08.h \ gsm_04_11.h \ + gsm_04_14.h \ gsm_04_80.h \ gsm_data.h \ gsm_data_shared.h \ diff --git a/openbsc/include/openbsc/gsm_04_14.h b/openbsc/include/openbsc/gsm_04_14.h new file mode 100644 index 0000000..3cdbe04 --- /dev/null +++ b/openbsc/include/openbsc/gsm_04_14.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode); +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs); +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology); + +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg); diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am index 9d966db..c219a35 100644 --- a/openbsc/src/libmsc/Makefile.am +++ b/openbsc/src/libmsc/Makefile.am @@ -27,6 +27,7 @@ db.c \ gsm_04_08.c \ gsm_04_11.c \ + gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ mncc.c \ diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index f926223..9d19025 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -4034,6 +4035,9 @@ release_anchor(conn); rc = handle_rcv_ussd(conn, msg); break; + case GSM48_PDISC_TEST: + rc = gsm0414_rcv_test(conn, msg); + break; default: LOGP(DRLL, LOGL_NOTICE, "Unknown " "GSM 04.08 discriminator 0x%02x\n", pdisc); diff --git a/openbsc/src/libmsc/gsm_04_14.c b/openbsc/src/libmsc/gsm_04_14.c new file mode 100644 index 0000000..23de23e --- /dev/null +++ b/openbsc/src/libmsc/gsm_04_14.c @@ -0,0 +1,132 @@ +/* GSM MS Testing Layer 3 messages + * 3GPP TS 44.014 / GSM TS 04.14 */ + +/* (C) 2017 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 "bscconfig.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct msgb *create_gsm0414_msg(uint8_t msg_type) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); + struct gsm48_hdr *gh; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_TEST; + gh->msg_type = msg_type; + return msg; +} + +static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + return gsm0808_submit_dtap(conn, msg, 0, 0); +} + +static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) +{ + struct msgb *msg = create_gsm0414_msg(msg_type); + + return gsm0414_conn_sendmsg(conn, msg); +} + + +/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); + uint8_t subch; + + subch = (loop_mode << 1); + msgb_put_u8(msg, subch); + + msg->lchan = conn->lchan; + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a OPEN_LOOP_CMD according to Section 8.3 */ +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); +} + +/* Send a ACT_EMMI_CMD according to Section 8.8 */ +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); +} + +/* Send a DEACT_EMMI_CMD according to Section 8.10 */ +int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); +} + +/* Send a TEST_INTERFACE according to Section 8.11 */ +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); + msgb_put_u8(msg, tested_devs); + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); + msgb_put_u8(msg, technology); + return gsm0414_conn_sendmsg(conn, msg); +} + + + +/* Entry point for incoming GSM48_PDISC_TEST received from MS */ +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + + if (msgb_l3len(msg) < sizeof(*gh)) + return -1; + + LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", + get_value_string(gsm414_msgt_names, gh->msg_type)); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c Gerrit-PatchSet: 4 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 Jul 10 18:45:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 18:45:18 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 18:45:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 18:45:20 +0000 Subject: [MERGED] osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests/auc: Don't require python3 ...................................................................... tests/auc: Don't require python3 Our jenkins buildslave does not have python3 installed so call python2 instead. Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Ticket: SYS#3322 --- M debian/control M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 571c24e..934abea 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python3, + python2.7, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 0efa7ac..3a1c2b1 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python2 # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jul 10 19:18:11 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 10 Jul 2017 19:18:11 +0000 Subject: openbsc[master]: Fix BTS attribute requests In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/2868/3/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 1595: if (bts->type != GSM_BTS_TYPE_OSMOBTS) { > I actually think this is correct here. We are moving towards simply statin "bts model sysmobts" is deprecated but I wondered why we still check type and not features. Anyway let's not have this discussion right now and here. -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From admin at opensuse.org Mon Jul 10 19:53:56 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 19:53:56 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5963db5faed4f_5caec8af781388127@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/x86_64 Package network:osmocom:nightly/libosmocore failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 227s] -[..] Encoding / Decoding cycle : OK [ 227s] -[..] Encoding / Decoding cycle : OK [ 227s] - [ 227s] -[+] Testing: gsm0503_mcs9 [ 227s] -[.] Input length : ret = 606 exp = 606 -> OK [ 227s] -[.] Output length : ret = 1836 exp = 1836 -> OK [ 227s] -[.] Random vector checks: [ 227s] -[..] Encoding / Decoding cycle : OK [ 227s] -[..] Encoding / Decoding cycle : OK [ 227s] -[..] Encoding / Decoding cycle : OK [ 227s] - [ 227s] ./testsuite.at:57: exit code was 132, expected 0 [ 227s] 9. testsuite.at:54: 9. conv_gsm0503 (testsuite.at:54): FAILED (testsuite.at:57) [ 227s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 227s] make[1]: *** [override_dh_auto_test] Error 1 [ 227s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 227s] debian/rules:15: recipe for target 'build' failed [ 227s] make: *** [build] Error 2 [ 227s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 227s] [ 227s] build31 failed "build libosmocore_0.9.6.20170710.dsc" at Mon Jul 10 19:53:39 UTC 2017. [ 227s] [ 227s] ### VM INTERACTION START ### [ 229s] Powering off. [ 229s] [ 211.436489] reboot: Power down [ 230s] ### VM INTERACTION END ### [ 230s] [ 230s] build31 failed "build libosmocore_0.9.6.20170710.dsc" at Mon Jul 10 19:53:43 UTC 2017. [ 230s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:09:22 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:09:22 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5963df05cfc1_5caec8af7813919fc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_8.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 126s] tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(pdp->pdp_charg); [ 126s] ^ [ 126s] gprs_sgsn.c:710:10: note: each undeclared identifier is reported only once for each function it appears in [ 126s] Makefile:637: recipe for target 'gprs_sgsn.o' failed [ 126s] make[4]: *** [gprs_sgsn.o] Error 1 [ 126s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/src/gprs' [ 126s] Makefile:443: recipe for target 'all-recursive' failed [ 126s] make[3]: *** [all-recursive] Error 1 [ 126s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src' [ 126s] Makefile:515: recipe for target 'all-recursive' failed [ 126s] make[2]: *** [all-recursive] Error 1 [ 126s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 126s] Makefile:423: recipe for target 'all' failed [ 126s] make[1]: *** [all] Error 2 [ 126s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 126s] dh_auto_build: make -j1 returned exit code 2 [ 126s] debian/rules:13: recipe for target 'build' failed [ 126s] make: *** [build] Error 2 [ 126s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 126s] [ 126s] lamb11 failed "build openbsc_0.15.1.20170710.dsc" at Mon Jul 10 20:09:04 UTC 2017. [ 126s] [ 126s] ### VM INTERACTION START ### [ 127s] Powering off. [ 127s] [ 113.675446] reboot: Power down [ 127s] ### VM INTERACTION END ### [ 127s] [ 127s] lamb11 failed "build openbsc_0.15.1.20170710.dsc" at Mon Jul 10 20:09:05 UTC 2017. [ 127s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:19:22 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:19:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5963e156be8fe_5caec8af7813939ba@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 59s] /usr/bin/env: 'python2': No such file or directory [ 59s] Makefile:787: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 59s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 59s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 59s] Makefile:513: recipe for target 'all-recursive' failed [ 59s] make[4]: *** [all-recursive] Error 1 [ 59s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 59s] Makefile:382: recipe for target 'all-recursive' failed [ 59s] make[3]: *** [all-recursive] Error 1 [ 59s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 59s] Makefile:405: recipe for target 'all-recursive' failed [ 59s] make[2]: *** [all-recursive] Error 1 [ 59s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 59s] Makefile:352: recipe for target 'all' failed [ 59s] make[1]: *** [all] Error 2 [ 59s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 59s] dh_auto_build: make -j1 returned exit code 2 [ 59s] debian/rules:7: recipe for target 'build' failed [ 59s] make: *** [build] Error 2 [ 59s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 59s] [ 59s] build85 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:19:15 UTC 2017. [ 59s] [ 59s] ### VM INTERACTION START ### [ 62s] [ 53.252177] reboot: Power down [ 62s] ### VM INTERACTION END ### [ 62s] [ 62s] build85 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:19:19 UTC 2017. [ 62s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:22:13 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:22:13 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5963e20d88e94_5caec8af781394766@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 164s] /usr/bin/env: 'python2': No such file or directory [ 164s] Makefile:787: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 164s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 164s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 164s] Makefile:513: recipe for target 'all-recursive' failed [ 164s] make[4]: *** [all-recursive] Error 1 [ 164s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 164s] Makefile:382: recipe for target 'all-recursive' failed [ 164s] make[3]: *** [all-recursive] Error 1 [ 164s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 164s] Makefile:405: recipe for target 'all-recursive' failed [ 164s] make[2]: *** [all-recursive] Error 1 [ 164s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 164s] Makefile:352: recipe for target 'all' failed [ 164s] make[1]: *** [all] Error 2 [ 164s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 164s] dh_auto_build: make -j1 returned exit code 2 [ 164s] debian/rules:7: recipe for target 'build' failed [ 164s] make: *** [build] Error 2 [ 164s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 164s] [ 164s] cloud122 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:21:55 UTC 2017. [ 164s] [ 164s] ### VM INTERACTION START ### [ 167s] [ 144.305058] reboot: Power down [ 168s] ### VM INTERACTION END ### [ 168s] [ 168s] cloud122 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:22:00 UTC 2017. [ 168s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:23:22 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:23:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5963e24a6ea7e_5caec8af78139533b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 179s] Makefile:774: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 179s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 179s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 179s] Makefile:502: recipe for target 'all-recursive' failed [ 179s] make[4]: *** [all-recursive] Error 1 [ 179s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 179s] Makefile:370: recipe for target 'all-recursive' failed [ 179s] make[3]: *** [all-recursive] Error 1 [ 179s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 179s] Makefile:393: recipe for target 'all-recursive' failed [ 179s] make[2]: *** [all-recursive] Error 1 [ 179s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 179s] Makefile:339: recipe for target 'all' failed [ 179s] make[1]: *** [all] Error 2 [ 179s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 179s] dh_auto_build: make -j1 returned exit code 2 [ 179s] debian/rules:7: recipe for target 'build' failed [ 179s] make: *** [build] Error 2 [ 179s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 179s] [ 179s] lamb51 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:23:17 UTC 2017. [ 179s] [ 179s] ### VM INTERACTION START ### [ 180s] Powering off. [ 180s] [ 165.058936] reboot: Power down [ 180s] ### VM INTERACTION END ### [ 180s] [ 180s] lamb51 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:23:18 UTC 2017. [ 180s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:23:39 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:23:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5963e264d9d61_5caec8af7813955e4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 202s] Makefile:774: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 202s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 202s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 202s] Makefile:502: recipe for target 'all-recursive' failed [ 202s] make[4]: *** [all-recursive] Error 1 [ 202s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 202s] Makefile:370: recipe for target 'all-recursive' failed [ 202s] make[3]: *** [all-recursive] Error 1 [ 202s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 202s] Makefile:393: recipe for target 'all-recursive' failed [ 202s] make[2]: *** [all-recursive] Error 1 [ 202s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 202s] Makefile:339: recipe for target 'all' failed [ 202s] make[1]: *** [all] Error 2 [ 202s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 202s] dh_auto_build: make -j1 returned exit code 2 [ 202s] debian/rules:7: recipe for target 'build' failed [ 202s] make: *** [build] Error 2 [ 202s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 203s] [ 203s] lamb28 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:23:30 UTC 2017. [ 203s] [ 203s] ### VM INTERACTION START ### [ 204s] Powering off. [ 204s] [ 181.779164] reboot: Power down [ 204s] ### VM INTERACTION END ### [ 204s] [ 204s] lamb28 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:23:31 UTC 2017. [ 204s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:25:39 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:25:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5963e2ddb009c_5caec8af781396054@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 84s] /usr/bin/env: 'python2': No such file or directory [ 84s] Makefile:787: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 84s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 84s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:513: recipe for target 'all-recursive' failed [ 84s] make[4]: *** [all-recursive] Error 1 [ 84s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:382: recipe for target 'all-recursive' failed [ 84s] make[3]: *** [all-recursive] Error 1 [ 84s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 84s] Makefile:405: recipe for target 'all-recursive' failed [ 84s] make[2]: *** [all-recursive] Error 1 [ 84s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 84s] Makefile:352: recipe for target 'all' failed [ 84s] make[1]: *** [all] Error 2 [ 84s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 84s] dh_auto_build: make -j1 returned exit code 2 [ 84s] debian/rules:7: recipe for target 'build' failed [ 84s] make: *** [build] Error 2 [ 84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 84s] [ 84s] lamb03 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:25:20 UTC 2017. [ 84s] [ 84s] ### VM INTERACTION START ### [ 87s] [ 73.725862] reboot: Power down [ 87s] ### VM INTERACTION END ### [ 87s] [ 87s] lamb03 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:25:24 UTC 2017. [ 87s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:27:22 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:27:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5963e33b5627c_5caec8af781396613@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 125s] ../../src/common/libbts.a(l1sap.o): In function `l1sap_ph_rts_ind': [ 125s] /usr/src/packages/BUILD/src/common/l1sap.c:659: undefined reference to `osmo_dump_gsmtime' [ 125s] ../../src/common/libbts.a(l1sap.o): In function `lchan_pdtch_ph_rts_ind_loop': [ 125s] /usr/src/packages/BUILD/src/common/l1sap.c:626: undefined reference to `osmo_dump_gsmtime' [ 125s] ../../src/common/libbts.a(l1sap.o):/usr/src/packages/BUILD/src/common/l1sap.c:620: more undefined references to `osmo_dump_gsmtime' follow [ 125s] collect2: error: ld returned 1 exit status [ 125s] Makefile:360: recipe for target 'osmo-bts-trx' failed [ 125s] make[4]: *** [osmo-bts-trx] Error 1 [ 125s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bts-trx' [ 125s] Makefile:333: recipe for target 'all-recursive' failed [ 125s] make[3]: *** [all-recursive] Error 1 [ 125s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 125s] Makefile:383: recipe for target 'all-recursive' failed [ 125s] make[2]: *** [all-recursive] Error 1 [ 125s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 125s] Makefile:323: recipe for target 'all' failed [ 125s] make[1]: *** [all] Error 2 [ 125s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 125s] dh_auto_build: make -j1 returned exit code 2 [ 125s] debian/rules:12: recipe for target 'build' failed [ 125s] make: *** [build] Error 2 [ 125s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 125s] [ 125s] cloud123 failed "build osmo-bts_0.5.0.20170710.dsc" at Mon Jul 10 20:27:02 UTC 2017. [ 125s] [ 125s] ### VM INTERACTION START ### [ 126s] Powering off. [ 126s] [ 103.840416] reboot: Power down [ 128s] ### VM INTERACTION END ### -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:27:39 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:27:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5963e357ca087_5caec8af781396810@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 141s] /usr/bin/env: 'python2': No such file or directory [ 141s] Makefile:787: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 141s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 141s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 141s] Makefile:513: recipe for target 'all-recursive' failed [ 141s] make[4]: *** [all-recursive] Error 1 [ 141s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 141s] Makefile:382: recipe for target 'all-recursive' failed [ 141s] make[3]: *** [all-recursive] Error 1 [ 141s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 141s] Makefile:405: recipe for target 'all-recursive' failed [ 141s] make[2]: *** [all-recursive] Error 1 [ 141s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 141s] Makefile:352: recipe for target 'all' failed [ 141s] make[1]: *** [all] Error 2 [ 141s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 141s] dh_auto_build: make -j1 returned exit code 2 [ 141s] debian/rules:7: recipe for target 'build' failed [ 141s] make: *** [build] Error 2 [ 141s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 141s] [ 141s] cloud103 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:27:25 UTC 2017. [ 141s] [ 141s] ### VM INTERACTION START ### [ 145s] [ 116.385613] reboot: Power down [ 147s] ### VM INTERACTION END ### [ 147s] [ 147s] cloud103 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:27:31 UTC 2017. [ 147s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:27:56 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:27:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5963e3596e6c3_5caec8af7813969b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 134s] /usr/bin/env: 'python2': No such file or directory [ 134s] Makefile:787: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 134s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 134s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 134s] Makefile:513: recipe for target 'all-recursive' failed [ 134s] make[4]: *** [all-recursive] Error 1 [ 134s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 134s] Makefile:382: recipe for target 'all-recursive' failed [ 134s] make[3]: *** [all-recursive] Error 1 [ 134s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 134s] Makefile:405: recipe for target 'all-recursive' failed [ 134s] make[2]: *** [all-recursive] Error 1 [ 134s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 134s] Makefile:352: recipe for target 'all' failed [ 134s] make[1]: *** [all] Error 2 [ 134s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 134s] dh_auto_build: make -j1 returned exit code 2 [ 134s] debian/rules:7: recipe for target 'build' failed [ 134s] make: *** [build] Error 2 [ 134s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 134s] [ 134s] cloud125 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:27:22 UTC 2017. [ 134s] [ 134s] ### VM INTERACTION START ### [ 137s] [ 107.553463] reboot: Power down [ 151s] ### VM INTERACTION END ### [ 151s] [ 151s] cloud125 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:27:39 UTC 2017. [ 151s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:28:47 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:28:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5963e39448fa6_5caec8af7813972c2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 112s] /usr/bin/env: 'python2': No such file or directory [ 112s] Makefile:787: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 112s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 112s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 112s] Makefile:513: recipe for target 'all-recursive' failed [ 112s] make[4]: *** [all-recursive] Error 1 [ 112s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 112s] Makefile:382: recipe for target 'all-recursive' failed [ 112s] make[3]: *** [all-recursive] Error 1 [ 112s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 112s] Makefile:405: recipe for target 'all-recursive' failed [ 112s] make[2]: *** [all-recursive] Error 1 [ 112s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 112s] Makefile:352: recipe for target 'all' failed [ 112s] make[1]: *** [all] Error 2 [ 112s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 112s] dh_auto_build: make -j1 returned exit code 2 [ 112s] debian/rules:7: recipe for target 'build' failed [ 112s] make: *** [build] Error 2 [ 112s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 112s] [ 112s] lamb55 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:28:29 UTC 2017. [ 112s] [ 112s] ### VM INTERACTION START ### [ 115s] [ 99.478786] reboot: Power down [ 115s] ### VM INTERACTION END ### [ 115s] [ 115s] lamb55 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:28:33 UTC 2017. [ 115s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:30:14 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:30:14 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5963e3ec38ce1_5caec8af781397552@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 51s] /usr/bin/env: 'python2': No such file or directory [ 51s] Makefile:787: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 51s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 51s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 51s] Makefile:513: recipe for target 'all-recursive' failed [ 51s] make[4]: *** [all-recursive] Error 1 [ 51s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 51s] Makefile:382: recipe for target 'all-recursive' failed [ 51s] make[3]: *** [all-recursive] Error 1 [ 51s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 51s] Makefile:405: recipe for target 'all-recursive' failed [ 51s] make[2]: *** [all-recursive] Error 1 [ 51s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 51s] Makefile:352: recipe for target 'all' failed [ 51s] make[1]: *** [all] Error 2 [ 51s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 51s] dh_auto_build: make -j1 returned exit code 2 [ 51s] debian/rules:7: recipe for target 'build' failed [ 51s] make: *** [build] Error 2 [ 51s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 51s] [ 51s] build78 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:29:55 UTC 2017. [ 51s] [ 51s] ### VM INTERACTION START ### [ 54s] [ 45.455898] reboot: Power down [ 54s] ### VM INTERACTION END ### [ 54s] [ 54s] build78 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:29:59 UTC 2017. [ 54s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 10 20:30:48 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 10 Jul 2017 20:30:48 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5963e40c3bc91_5caec8af781397653@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 176s] /usr/bin/env: 'python2': No such file or directory [ 176s] Makefile:787: recipe for target 'auc_ts_55_205_test_sets.c' failed [ 176s] make[5]: *** [auc_ts_55_205_test_sets.c] Error 127 [ 176s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 176s] Makefile:513: recipe for target 'all-recursive' failed [ 176s] make[4]: *** [all-recursive] Error 1 [ 176s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 176s] Makefile:382: recipe for target 'all-recursive' failed [ 176s] make[3]: *** [all-recursive] Error 1 [ 176s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 176s] Makefile:405: recipe for target 'all-recursive' failed [ 176s] make[2]: *** [all-recursive] Error 1 [ 176s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 176s] Makefile:352: recipe for target 'all' failed [ 176s] make[1]: *** [all] Error 2 [ 176s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 176s] dh_auto_build: make -j1 returned exit code 2 [ 176s] debian/rules:7: recipe for target 'build' failed [ 176s] make: *** [build] Error 2 [ 176s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 176s] [ 176s] lamb28 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:30:39 UTC 2017. [ 176s] [ 176s] ### VM INTERACTION START ### [ 180s] [ 158.873265] reboot: Power down [ 180s] ### VM INTERACTION END ### [ 180s] [ 180s] lamb28 failed "build osmo-hlr_0.0.1.20170710.dsc" at Mon Jul 10 20:30:43 UTC 2017. [ 180s] -- 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 Jul 10 20:33:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 20:33:13 +0000 Subject: [PATCH] libosmocore[master]: gsm_04_08.h: Add struct for 9.1.13b GPRS suspension request Message-ID: Review at https://gerrit.osmocom.org/3174 gsm_04_08.h: Add struct for 9.1.13b GPRS suspension request Change-Id: I90113044460a6c511ced14f588876c4280d1cac7 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/3174/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 643f046..01ab599 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -529,6 +529,14 @@ uint8_t mob_alloc[0]; } __attribute__((packed)); +/* Chapter 9.1.13b GPRS suspension request */ +struct gsm48_gprs_susp_req { + uint32_t tlli; + uint8_t ra_id[6]; + uint8_t cause; + uint8_t options[0]; +} __attribute__ ((packed)); + /* Chapter 10.5.2.2 */ struct gsm48_cell_desc { uint8_t bcc:3, -- To view, visit https://gerrit.osmocom.org/3174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90113044460a6c511ced14f588876c4280d1cac7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 21:42:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 21:42:29 +0000 Subject: [PATCH] libosmocore[master]: Add pseudo-random bit sequence generator to libosmcoore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3162 to look at the new patch set (#4). Add pseudo-random bit sequence generator to libosmcoore These PRBS sequences are specified in ITU-T O.150. They are typically used as test data to be transmitted for BER (bit error rate) testing. Change-Id: I227b6a6e86a251460ecb816afa9a7439d5fb94d1 --- M include/Makefile.am A include/osmocom/core/prbs.h M src/Makefile.am A src/prbs.c M tests/Makefile.am A tests/prbs/prbs_test.c A tests/prbs/prbs_test.ok M tests/testsuite.at 8 files changed, 175 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/3162/4 diff --git a/include/Makefile.am b/include/Makefile.am index e0c1a2b..4e92d55 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -31,6 +31,7 @@ osmocom/core/macaddr.h \ osmocom/core/msgb.h \ osmocom/core/panic.h \ + osmocom/core/prbs.h \ osmocom/core/prim.h \ osmocom/core/process.h \ osmocom/core/rate_ctr.h \ diff --git a/include/osmocom/core/prbs.h b/include/osmocom/core/prbs.h new file mode 100644 index 0000000..aaca17d --- /dev/null +++ b/include/osmocom/core/prbs.h @@ -0,0 +1,25 @@ +#pragma once +#include +#include + +/*! \brief definition of a PRBS sequence */ +struct osmo_prbs { + const char *name; /*!< human-readable name */ + unsigned int len; /*!< length in bits */ + uint64_t coeff; /*!< coefficients */ +}; + +/*! \brief state of a given PRBS sequence generator */ +struct osmo_prbs_state { + const struct osmo_prbs *prbs; + uint64_t state; +}; + +extern const struct osmo_prbs osmo_prbs7; +extern const struct osmo_prbs osmo_prbs9; +extern const struct osmo_prbs osmo_prbs11; +extern const struct osmo_prbs osmo_prbs15; + +void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs); +ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state); +int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state); diff --git a/src/Makefile.am b/src/Makefile.am index d8fceca..8e7ef4b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,7 +21,7 @@ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ - conv_acc.c conv_acc_generic.c sercomm.c + conv_acc.c conv_acc_generic.c sercomm.c prbs.c if HAVE_SSE3 libosmocore_la_SOURCES += conv_acc_sse.c diff --git a/src/prbs.c b/src/prbs.c new file mode 100644 index 0000000..be52fd4 --- /dev/null +++ b/src/prbs.c @@ -0,0 +1,74 @@ +/* Osmocom implementation of pseudo-random bit sequence generation */ +/* (C) 2017 by Harald Welte */ + +#include +#include +#include +#include + +/*! \brief PRBS-7 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs7 = { + /* x^7 + x^6 + 1 */ + .name = "PRBS-7", + .len = 7, + .coeff = (1<<6) | (1<<5), +}; + +/*! \brief PRBS-9 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs9 = { + /* x^9 + x^5 + 1 */ + .name = "PRBS-9", + .len = 9, + .coeff = (1<<8) | (1<<4), +}; + +/*! \brief PRBS-11 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs11 = { + /* x^11 + x^9 + 1 */ + .name = "PRBS-11", + .len = 11, + .coeff = (1<<10) | (1<<8), +}; + +/*! \brief PRBS-15 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs15 = { + /* x^15 + x^14+ 1 */ + .name = "PRBS-15", + .len = 15, + .coeff = (1<<14) | (1<<13), +}; + +/*! \brief Initialize the given caller-allocated PRBS state */ +void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs) +{ + memset(st, 0, sizeof(*st)); + st->prbs = prbs; + st->state = 1; +} + +static void osmo_prbs_process_bit(struct osmo_prbs_state *state, ubit_t bit) +{ + state->state >>= 1; + if (bit) + state->state ^= state->prbs->coeff; +} + +/*! \brief Get the next bit out of given PRBS instance */ +ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state) +{ + ubit_t result = state->state & 0x1; + osmo_prbs_process_bit(state, result); + + return result; +} + +/*! \brief Fill buffer of unpacked bits with next bits out of given PRBS instance */ +int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state) +{ + unsigned int i; + + for (i = 0; i < out_len; i++) + out[i] = osmo_prbs_get_ubit(state); + + return i; +} diff --git a/tests/Makefile.am b/tests/Makefile.am index 158c37e..37378fb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test + stats/stats_test prbs/prbs_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -183,6 +183,9 @@ sercomm_sercomm_test_SOURCES = sercomm/sercomm_test.c sercomm_sercomm_test_LDADD = $(top_builddir)/src/libosmocore.la +prbs_prbs_test_SOURCES = prbs/prbs_test.c +prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -226,7 +229,7 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/prbs/prbs_test.c b/tests/prbs/prbs_test.c new file mode 100644 index 0000000..f478635 --- /dev/null +++ b/tests/prbs/prbs_test.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +static void dump_bits(const ubit_t *bits, unsigned int num_bits) +{ + unsigned int i; + + for (i = 0; i < num_bits; i++) { + if (bits[i]) + fputc('1', stdout); + else + fputc('0', stdout); + } + fputc('\n',stdout); +} + +static void test_prbs(const struct osmo_prbs *prbs) +{ + struct osmo_prbs_state st; + unsigned int i; + + printf("Testing PRBS sequence generation '%s'\n", prbs->name); + osmo_prbs_state_init(&st, prbs); + + /* 2 lines */ + for (i = 0; i < 2; i++) { + unsigned int seq_len = (1 << prbs->len)-1; + ubit_t bits[seq_len]; + memset(bits, 0, sizeof(bits)); + osmo_prbs_get_ubits(bits, sizeof(bits), &st); + dump_bits(bits, sizeof(bits)); + } + + printf("\n"); +} + +int main(int argc, char **argv) +{ + test_prbs(&osmo_prbs7); + test_prbs(&osmo_prbs9); + test_prbs(&osmo_prbs11); + test_prbs(&osmo_prbs15); + + exit(0); +} diff --git a/tests/prbs/prbs_test.ok b/tests/prbs/prbs_test.ok new file mode 100644 index 0000000..e0c587c --- /dev/null +++ b/tests/prbs/prbs_test.ok @@ -0,0 +1,16 @@ +Testing PRBS sequence generation 'PRBS-7' +1000001100001010001111001000101100111010100111110100001110001001001101101011011110110001101001011101110011001010101111111000000 +1000001100001010001111001000101100111010100111110100001110001001001101101011011110110001101001011101110011001010101111111000000 + +Testing PRBS sequence generation 'PRBS-9' +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 + +Testing PRBS sequence generation 'PRBS-11' +1000000001010000001000100001010101001000000011010000011100100011011101011101010001010000101000100100010101101010000110000100111100101110011100101111011100100101011101100001010111001000010111010010010100110110001111011101100101010111100000010011000010111110010010001110110101101011000110001110111101101010010110000110011100111111011110000101001100100011111101011000010001110010101101110000110101100111000111110110110001011011101001101010011110000111001100110111111111010000000100100000101101000100110010101111110000100001100101001111100011100011011011011101101101010110110000011011100011101011011010001101100101110111100101010011100000111011000110101110111000101010110100000011001000011111010011000100111110101110001000101101010100110000001111100001100011001111011111100101000011100010011011010111101100010010111010110010100011110001011001101001111110011100001111011001100101111111100100000011101000011010010011100110111011111010101000100000010101000010000010010100010110001010011101000111010010110100110011001111111111100000000011000000011110000011001100011111111011000000101110000100101100101100111100111110011110001111001101100111110111110001010001101000101110010100101110001100101101111100110100011111001011000111001110110111101011010010001100110101111111000100000110101000111000010110110010011011110111101001010010011000110111110111010001010100101000001100010001111010101100100000111101000110010010111110110010001011110101001001000011011010011101100111010111110100010001001010101011000000001110000001101100001110111001101010111110000010001100010101111010000100100100101101101100110110111111011010000101100100100111101101110010110101110011000101111110100100001001101001011110011001001111111011100000101011000100001110101001101000011110010011001110111111101010000010000100010100101010001100000101111000100100110101101111000110100110111001111010111100100010011101010111010000010100100010001101010101110000000101100000100111000101110110100101011001100001111111001100000111111000110000110111100111010011110100111001001110111011101010101010000000000 +1000000001010000001000100001010101001000000011010000011100100011011101011101010001010000101000100100010101101010000110000100111100101110011100101111011100100101011101100001010111001000010111010010010100110110001111011101100101010111100000010011000010111110010010001110110101101011000110001110111101101010010110000110011100111111011110000101001100100011111101011000010001110010101101110000110101100111000111110110110001011011101001101010011110000111001100110111111111010000000100100000101101000100110010101111110000100001100101001111100011100011011011011101101101010110110000011011100011101011011010001101100101110111100101010011100000111011000110101110111000101010110100000011001000011111010011000100111110101110001000101101010100110000001111100001100011001111011111100101000011100010011011010111101100010010111010110010100011110001011001101001111110011100001111011001100101111111100100000011101000011010010011100110111011111010101000100000010101000010000010010100010110001010011101000111010010110100110011001111111111100000000011000000011110000011001100011111111011000000101110000100101100101100111100111110011110001111001101100111110111110001010001101000101110010100101110001100101101111100110100011111001011000111001110110111101011010010001100110101111111000100000110101000111000010110110010011011110111101001010010011000110111110111010001010100101000001100010001111010101100100000111101000110010010111110110010001011110101001001000011011010011101100111010111110100010001001010101011000000001110000001101100001110111001101010111110000010001100010101111010000100100100101101101100110110111111011010000101100100100111101101110010110101110011000101111110100100001001101001011110011001001111111011100000101011000100001110101001101000011110010011001110111111101010000010000100010100101010001100000101111000100100110101101111000110100110111001111010111100100010011101010111010000010100100010001101010101110000000101100000100111000101110110100101011001100001111111001100000111111000110000110111100111010011110100111001001110111011101010101010000000000 + +Testing PRBS sequence generation 'PRBS-15' +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 + diff --git a/tests/testsuite.at b/tests/testsuite.at index 63027d9..f148cf5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -280,3 +280,9 @@ cat $abs_srcdir/sercomm/sercomm_test.ok > expout AT_CHECK([$abs_top_builddir/tests/sercomm/sercomm_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([prbs]) +AT_KEYWORDS([prbs]) +cat $abs_srcdir/prbs/prbs_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3162 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I227b6a6e86a251460ecb816afa9a7439d5fb94d1 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 21:42:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 21:42:56 +0000 Subject: openbsc[master]: Add VTY commands for experimentation with TS 04.14 commands In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 21:43:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 21:43:25 +0000 Subject: [MERGED] openbsc[master]: Add VTY commands for experimentation with TS 04.14 commands In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add VTY commands for experimentation with TS 04.14 commands ...................................................................... Add VTY commands for experimentation with TS 04.14 commands TS 04.14 (TS 44.014) specifies a series of commands specific to conformance testing. Let's add some VTY commands to play (at least initially) with closing and opening voice loops in the MS. Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678 --- M openbsc/src/libmsc/vty_interface_layer3.c 1 file changed, 94 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 042da9c..4a99cf1 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -479,6 +480,97 @@ subscr_put(subscr); talloc_free(text); + return CMD_SUCCESS; +} + +static int loop_by_char(uint8_t ch) +{ + switch (ch) { + case 'a': + return GSM414_LOOP_A; + case 'b': + return GSM414_LOOP_B; + case 'c': + return GSM414_LOOP_C; + case 'd': + return GSM414_LOOP_D; + case 'e': + return GSM414_LOOP_E; + case 'f': + return GSM414_LOOP_F; + case 'i': + return GSM414_LOOP_I; + } + return -1; +} + +DEFUN(subscriber_mstest_close, + subscriber_mstest_close_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test close-loop (a|b|c|d|e|f|i)", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Close a TCH Loop inside the MS\n" + "Loop Type A\n" + "Loop Type B\n" + "Loop Type C\n" + "Loop Type D\n" + "Loop Type E\n" + "Loop Type F\n" + "Loop Type I\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]); + const char *loop_str; + int loop_mode; + + if (!subscr) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + loop_str = argv[2]; + loop_mode = loop_by_char(loop_str[0]); + + conn = connection_for_subscr(subscr); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + subscr_put(subscr); + return CMD_WARNING; + } + + gsm0414_tx_close_tch_loop_cmd(conn, loop_mode); + + return CMD_SUCCESS; +} + +DEFUN(subscriber_mstest_open, + subscriber_mstest_open_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test open-loop", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Open a TCH Loop inside the MS\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]); + + if (!subscr) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + conn = connection_for_subscr(subscr); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + subscr_put(subscr); + return CMD_WARNING; + } + + gsm0414_tx_open_loop_cmd(conn); + return CMD_SUCCESS; } @@ -1166,6 +1258,8 @@ install_element_ve(&subscriber_silent_call_start_cmd); install_element_ve(&subscriber_silent_call_stop_cmd); install_element_ve(&subscriber_ussd_notify_cmd); + install_element_ve(&subscriber_mstest_close_cmd); + install_element_ve(&subscriber_mstest_open_cmd); install_element_ve(&subscriber_update_cmd); install_element_ve(&show_stats_cmd); install_element_ve(&show_smsqueue_cmd); -- To view, visit https://gerrit.osmocom.org/3169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 21:44:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 21:44:15 +0000 Subject: osmo-trx[master]: Remove redundant explicit dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd9cfc3673d828122edb85ba9de7ceb77f0299d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 21:57:58 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 21:57:58 +0000 Subject: [PATCH] libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() 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/3048 to look at the new patch set (#7). utils: add function gsm_fn_as_gsmtime_str() Convert a given frame number into a printable string that displays the sub components of the frame number. Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/3048/7 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index a879d33..bfcef08 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -165,6 +165,9 @@ /* Convert from frame number to GSM time */ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn); +/* Parse GSM Frame Number into printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn); + /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 2c980d2..477f076 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -750,6 +750,17 @@ time->tc = (time->fn / 51) % 8; } +/*! Parse GSM Frame Number into printable string + * \param[in] fn GSM Frame Number + * \returns pointer to printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn) +{ + struct gsm_time time; + + gsm_fn2gsmtime(&time, fn); + return osmo_dump_gsmtime(&time); +} + /*! Encode decoded \ref gsm_time to Frame Number * \param[in] time GSM Time in decoded structure * \returns GSM Frame Number */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ad7e013..714cb25 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -272,6 +272,7 @@ gsm_band_name; gsm_band_parse; gsm_fn2gsmtime; +gsm_fn_as_gsmtime_str; gsm_get_octet_len; gsm_gsmtime2fn; osmo_dump_gsmtime; -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 10 21:59:35 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 10 Jul 2017 21:59:35 +0000 Subject: osmo-trx[master]: Remove redundant explicit dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd9cfc3673d828122edb85ba9de7ceb77f0299d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:09:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 22:09:02 +0000 Subject: libosmocore[master]: Add pseudo-random bit sequence generator to libosmcoore In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3162 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I227b6a6e86a251460ecb816afa9a7439d5fb94d1 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:09:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 22:09:04 +0000 Subject: libosmocore[master]: gsm_04_08.h: Add struct for 9.1.13b GPRS suspension request In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90113044460a6c511ced14f588876c4280d1cac7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:09:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 22:09:06 +0000 Subject: [MERGED] libosmocore[master]: gsm_04_08.h: Add struct for 9.1.13b GPRS suspension request In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm_04_08.h: Add struct for 9.1.13b GPRS suspension request ...................................................................... gsm_04_08.h: Add struct for 9.1.13b GPRS suspension request Change-Id: I90113044460a6c511ced14f588876c4280d1cac7 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 8 insertions(+), 0 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 643f046..01ab599 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -529,6 +529,14 @@ uint8_t mob_alloc[0]; } __attribute__((packed)); +/* Chapter 9.1.13b GPRS suspension request */ +struct gsm48_gprs_susp_req { + uint32_t tlli; + uint8_t ra_id[6]; + uint8_t cause; + uint8_t options[0]; +} __attribute__ ((packed)); + /* Chapter 10.5.2.2 */ struct gsm48_cell_desc { uint8_t bcc:3, -- To view, visit https://gerrit.osmocom.org/3174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I90113044460a6c511ced14f588876c4280d1cac7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:09:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 22:09:07 +0000 Subject: [MERGED] libosmocore[master]: Add pseudo-random bit sequence generator to libosmcoore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add pseudo-random bit sequence generator to libosmcoore ...................................................................... Add pseudo-random bit sequence generator to libosmcoore These PRBS sequences are specified in ITU-T O.150. They are typically used as test data to be transmitted for BER (bit error rate) testing. Change-Id: I227b6a6e86a251460ecb816afa9a7439d5fb94d1 --- M include/Makefile.am A include/osmocom/core/prbs.h M src/Makefile.am A src/prbs.c M tests/Makefile.am A tests/prbs/prbs_test.c A tests/prbs/prbs_test.ok M tests/testsuite.at 8 files changed, 175 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/Makefile.am b/include/Makefile.am index e0c1a2b..4e92d55 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -31,6 +31,7 @@ osmocom/core/macaddr.h \ osmocom/core/msgb.h \ osmocom/core/panic.h \ + osmocom/core/prbs.h \ osmocom/core/prim.h \ osmocom/core/process.h \ osmocom/core/rate_ctr.h \ diff --git a/include/osmocom/core/prbs.h b/include/osmocom/core/prbs.h new file mode 100644 index 0000000..aaca17d --- /dev/null +++ b/include/osmocom/core/prbs.h @@ -0,0 +1,25 @@ +#pragma once +#include +#include + +/*! \brief definition of a PRBS sequence */ +struct osmo_prbs { + const char *name; /*!< human-readable name */ + unsigned int len; /*!< length in bits */ + uint64_t coeff; /*!< coefficients */ +}; + +/*! \brief state of a given PRBS sequence generator */ +struct osmo_prbs_state { + const struct osmo_prbs *prbs; + uint64_t state; +}; + +extern const struct osmo_prbs osmo_prbs7; +extern const struct osmo_prbs osmo_prbs9; +extern const struct osmo_prbs osmo_prbs11; +extern const struct osmo_prbs osmo_prbs15; + +void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs); +ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state); +int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state); diff --git a/src/Makefile.am b/src/Makefile.am index d8fceca..8e7ef4b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,7 +21,7 @@ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ - conv_acc.c conv_acc_generic.c sercomm.c + conv_acc.c conv_acc_generic.c sercomm.c prbs.c if HAVE_SSE3 libosmocore_la_SOURCES += conv_acc_sse.c diff --git a/src/prbs.c b/src/prbs.c new file mode 100644 index 0000000..be52fd4 --- /dev/null +++ b/src/prbs.c @@ -0,0 +1,74 @@ +/* Osmocom implementation of pseudo-random bit sequence generation */ +/* (C) 2017 by Harald Welte */ + +#include +#include +#include +#include + +/*! \brief PRBS-7 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs7 = { + /* x^7 + x^6 + 1 */ + .name = "PRBS-7", + .len = 7, + .coeff = (1<<6) | (1<<5), +}; + +/*! \brief PRBS-9 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs9 = { + /* x^9 + x^5 + 1 */ + .name = "PRBS-9", + .len = 9, + .coeff = (1<<8) | (1<<4), +}; + +/*! \brief PRBS-11 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs11 = { + /* x^11 + x^9 + 1 */ + .name = "PRBS-11", + .len = 11, + .coeff = (1<<10) | (1<<8), +}; + +/*! \brief PRBS-15 according ITU-T O.150 */ +const struct osmo_prbs osmo_prbs15 = { + /* x^15 + x^14+ 1 */ + .name = "PRBS-15", + .len = 15, + .coeff = (1<<14) | (1<<13), +}; + +/*! \brief Initialize the given caller-allocated PRBS state */ +void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs) +{ + memset(st, 0, sizeof(*st)); + st->prbs = prbs; + st->state = 1; +} + +static void osmo_prbs_process_bit(struct osmo_prbs_state *state, ubit_t bit) +{ + state->state >>= 1; + if (bit) + state->state ^= state->prbs->coeff; +} + +/*! \brief Get the next bit out of given PRBS instance */ +ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state) +{ + ubit_t result = state->state & 0x1; + osmo_prbs_process_bit(state, result); + + return result; +} + +/*! \brief Fill buffer of unpacked bits with next bits out of given PRBS instance */ +int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state) +{ + unsigned int i; + + for (i = 0; i < out_len; i++) + out[i] = osmo_prbs_get_ubit(state); + + return i; +} diff --git a/tests/Makefile.am b/tests/Makefile.am index 158c37e..37378fb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test + stats/stats_test prbs/prbs_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -183,6 +183,9 @@ sercomm_sercomm_test_SOURCES = sercomm/sercomm_test.c sercomm_sercomm_test_LDADD = $(top_builddir)/src/libosmocore.la +prbs_prbs_test_SOURCES = prbs/prbs_test.c +prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -226,7 +229,7 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/prbs/prbs_test.c b/tests/prbs/prbs_test.c new file mode 100644 index 0000000..f478635 --- /dev/null +++ b/tests/prbs/prbs_test.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +static void dump_bits(const ubit_t *bits, unsigned int num_bits) +{ + unsigned int i; + + for (i = 0; i < num_bits; i++) { + if (bits[i]) + fputc('1', stdout); + else + fputc('0', stdout); + } + fputc('\n',stdout); +} + +static void test_prbs(const struct osmo_prbs *prbs) +{ + struct osmo_prbs_state st; + unsigned int i; + + printf("Testing PRBS sequence generation '%s'\n", prbs->name); + osmo_prbs_state_init(&st, prbs); + + /* 2 lines */ + for (i = 0; i < 2; i++) { + unsigned int seq_len = (1 << prbs->len)-1; + ubit_t bits[seq_len]; + memset(bits, 0, sizeof(bits)); + osmo_prbs_get_ubits(bits, sizeof(bits), &st); + dump_bits(bits, sizeof(bits)); + } + + printf("\n"); +} + +int main(int argc, char **argv) +{ + test_prbs(&osmo_prbs7); + test_prbs(&osmo_prbs9); + test_prbs(&osmo_prbs11); + test_prbs(&osmo_prbs15); + + exit(0); +} diff --git a/tests/prbs/prbs_test.ok b/tests/prbs/prbs_test.ok new file mode 100644 index 0000000..e0c587c --- /dev/null +++ b/tests/prbs/prbs_test.ok @@ -0,0 +1,16 @@ +Testing PRBS sequence generation 'PRBS-7' +1000001100001010001111001000101100111010100111110100001110001001001101101011011110110001101001011101110011001010101111111000000 +1000001100001010001111001000101100111010100111110100001110001001001101101011011110110001101001011101110011001010101111111000000 + +Testing PRBS sequence generation 'PRBS-9' +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 + +Testing PRBS sequence generation 'PRBS-11' +1000000001010000001000100001010101001000000011010000011100100011011101011101010001010000101000100100010101101010000110000100111100101110011100101111011100100101011101100001010111001000010111010010010100110110001111011101100101010111100000010011000010111110010010001110110101101011000110001110111101101010010110000110011100111111011110000101001100100011111101011000010001110010101101110000110101100111000111110110110001011011101001101010011110000111001100110111111111010000000100100000101101000100110010101111110000100001100101001111100011100011011011011101101101010110110000011011100011101011011010001101100101110111100101010011100000111011000110101110111000101010110100000011001000011111010011000100111110101110001000101101010100110000001111100001100011001111011111100101000011100010011011010111101100010010111010110010100011110001011001101001111110011100001111011001100101111111100100000011101000011010010011100110111011111010101000100000010101000010000010010100010110001010011101000111010010110100110011001111111111100000000011000000011110000011001100011111111011000000101110000100101100101100111100111110011110001111001101100111110111110001010001101000101110010100101110001100101101111100110100011111001011000111001110110111101011010010001100110101111111000100000110101000111000010110110010011011110111101001010010011000110111110111010001010100101000001100010001111010101100100000111101000110010010111110110010001011110101001001000011011010011101100111010111110100010001001010101011000000001110000001101100001110111001101010111110000010001100010101111010000100100100101101101100110110111111011010000101100100100111101101110010110101110011000101111110100100001001101001011110011001001111111011100000101011000100001110101001101000011110010011001110111111101010000010000100010100101010001100000101111000100100110101101111000110100110111001111010111100100010011101010111010000010100100010001101010101110000000101100000100111000101110110100101011001100001111111001100000111111000110000110111100111010011110100111001001110111011101010101010000000000 +1000000001010000001000100001010101001000000011010000011100100011011101011101010001010000101000100100010101101010000110000100111100101110011100101111011100100101011101100001010111001000010111010010010100110110001111011101100101010111100000010011000010111110010010001110110101101011000110001110111101101010010110000110011100111111011110000101001100100011111101011000010001110010101101110000110101100111000111110110110001011011101001101010011110000111001100110111111111010000000100100000101101000100110010101111110000100001100101001111100011100011011011011101101101010110110000011011100011101011011010001101100101110111100101010011100000111011000110101110111000101010110100000011001000011111010011000100111110101110001000101101010100110000001111100001100011001111011111100101000011100010011011010111101100010010111010110010100011110001011001101001111110011100001111011001100101111111100100000011101000011010010011100110111011111010101000100000010101000010000010010100010110001010011101000111010010110100110011001111111111100000000011000000011110000011001100011111111011000000101110000100101100101100111100111110011110001111001101100111110111110001010001101000101110010100101110001100101101111100110100011111001011000111001110110111101011010010001100110101111111000100000110101000111000010110110010011011110111101001010010011000110111110111010001010100101000001100010001111010101100100000111101000110010010111110110010001011110101001001000011011010011101100111010111110100010001001010101011000000001110000001101100001110111001101010111110000010001100010101111010000100100100101101101100110110111111011010000101100100100111101101110010110101110011000101111110100100001001101001011110011001001111111011100000101011000100001110101001101000011110010011001110111111101010000010000100010100101010001100000101111000100100110101101111000110100110111001111010111100100010011101010111010000010100100010001101010101110000000101100000100111000101110110100101011001100001111111001100000111111000110000110111100111010011110100111001001110111011101010101010000000000 + +Testing PRBS sequence generation 'PRBS-15' +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 + diff --git a/tests/testsuite.at b/tests/testsuite.at index 63027d9..f148cf5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -280,3 +280,9 @@ cat $abs_srcdir/sercomm/sercomm_test.ok > expout AT_CHECK([$abs_top_builddir/tests/sercomm/sercomm_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([prbs]) +AT_KEYWORDS([prbs]) +cat $abs_srcdir/prbs/prbs_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3162 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I227b6a6e86a251460ecb816afa9a7439d5fb94d1 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:14:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 22:14:14 +0000 Subject: openbsc[master]: Fix BTS attribute requests In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/2868/3/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 1595: if (bts->type != GSM_BTS_TYPE_OSMOBTS) { > "bts model sysmobts" is deprecated but I wondered why we still check type a Because the "type" is "osmobts". And this triggers the entire feature discovery handshake logic between BTS and BSC, so that *after* this procedure, we can check on features :) -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:14:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 22:14:39 +0000 Subject: openbsc[master]: Fix BTS attribute requests In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 4 Gerrit-Project: openbsc 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 Mon Jul 10 22:14:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 22:14:41 +0000 Subject: [MERGED] openbsc[master]: Fix BTS attribute requests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix BTS attribute requests ...................................................................... Fix BTS attribute requests * fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all BTS' as it's explained in 3GPP TS 52.021 ?9.3. * only request attributes from supported (OsmoBTS) types Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Related: OS#2317 --- M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bsc_init.c 2 files changed, 10 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Objections: Holger Freyther: I would prefer this is not merged as is diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 019d039..cf20d7c 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -1590,10 +1590,17 @@ const uint8_t *attr, uint8_t attr_len) { struct abis_om_hdr *oh; - struct msgb *msg = nm_msgb_alloc(); + struct msgb *msg; + + if (bts->type != GSM_BTS_TYPE_OSMOBTS) { + LOGPC(DNM, LOGL_NOTICE, "Getting attributes from BTS%d type %s is not supported.\n", + bts->nr, btstype2str(bts->type)); + return -EINVAL; + } DEBUGP(DNM, "Get Attr (bts=%d)\n", bts->nr); + msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, attr_len, NM_MT_GET_ATTR, obj_class, bts_nr, trx_nr, ts_nr); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index ec87a7b..ead21b4 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -349,12 +349,12 @@ generate_cell_chan_list(ca, trx->bts); /* Request generic BTS-level attributes */ - abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, bts_attr, sizeof(bts_attr)); + abis_nm_get_attr(trx->bts, NM_OC_BTS, 0xFF, 0xFF, 0xFF, bts_attr, sizeof(bts_attr)); llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; /* Request TRX-level attributes */ - abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, cur_trx->bts->nr, cur_trx->nr, 0xFF, + abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, 0, cur_trx->nr, 0xFF, trx_attr, sizeof(trx_attr)); for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:18:09 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 22:18:09 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 7: > > you can simply convert your function to be a wrapper around > > fn->gsmtime->string, i.e. calling the two existing functions in a > > row. > > I agree with Harald. Feel free to use it in several places in > osmo-bts where currently osmo_dump_gsmtime is used. > > you can simply convert your function to be a wrapper around > > fn->gsmtime->string, i.e. calling the two existing functions in a > > row. > > I agree with Harald. Feel free to use it in several places in > osmo-bts where currently osmo_dump_gsmtime is used. Sorry, I forgot to push the patch. I already did that. Now its there, so you can have a look. -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:34:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 22:34:39 +0000 Subject: [ABANDON] libosmocore[master]: gsm0808: update permitted speech constants In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: gsm0808: update permitted speech constants ...................................................................... Abandoned For some reason this is a duplicate of Icaa768071d4364e671bc7e6d48b82d1f07f93f93 -- To view, visit https://gerrit.osmocom.org/2811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:39:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 10 Jul 2017 22:39:27 +0000 Subject: [PATCH] openbsc[master]: bsc_api: Fix copy+paste error in printing name of RR STATUS PDU Message-ID: Review at https://gerrit.osmocom.org/3175 bsc_api: Fix copy+paste error in printing name of RR STATUS PDU Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5 --- M openbsc/src/libbsc/bsc_api.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/75/3175/1 diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index 7613cac..fa45421 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -604,7 +604,7 @@ break; case GSM48_MT_RR_STATUS: LOGP(DRR, LOGL_NOTICE, "%s (cause: %s)\n", - gsm48_rr_msg_name(GSM48_MT_RR_GPRS_SUSP_REQ), + gsm48_rr_msg_name(GSM48_MT_RR_STATUS), rr_cause_name(gh->data[0])); break; case GSM48_MT_RR_MEAS_REP: -- To view, visit https://gerrit.osmocom.org/3175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jul 10 22:46:25 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 10 Jul 2017 22:46:25 +0000 Subject: [PATCH] openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3127 to look at the new patch set (#8). transaction: reject calls from unidentified subscribers A valid subscriber is indespensible when allocating a new transaction. Return NULL if no subscriber is supplied. This will cause unidentified subscribers to be rejected. Note: Under normal conditions, the problem does not occour, but it is still possible that a misbehaving MS might trigger the problem by sending a SETUP command before authenticating the subscriber. (unencrypted networks) Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d --- M openbsc/src/libmsc/transaction.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/3127/8 diff --git a/openbsc/src/libmsc/transaction.c b/openbsc/src/libmsc/transaction.c index dba4bed..4b46e22 100644 --- a/openbsc/src/libmsc/transaction.c +++ b/openbsc/src/libmsc/transaction.c @@ -70,6 +70,13 @@ DEBUGP(DCC, "subscr=%p, net=%p\n", subscr, net); + /* a valid subscriber is indispensable */ + if (subscr == NULL) { + LOGP(DCC, LOGL_NOTICE, + "unable to alloc transaction, invalid subscriber (NULL)\n"); + return NULL; + } + trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 8 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jul 11 06:08:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 06:08:57 +0000 Subject: openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 8 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 11 06:09:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 06:09:15 +0000 Subject: [MERGED] openbsc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: transaction: reject calls from unidentified subscribers ...................................................................... transaction: reject calls from unidentified subscribers A valid subscriber is indespensible when allocating a new transaction. Return NULL if no subscriber is supplied. This will cause unidentified subscribers to be rejected. Note: Under normal conditions, the problem does not occour, but it is still possible that a misbehaving MS might trigger the problem by sending a SETUP command before authenticating the subscriber. (unencrypted networks) Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d --- M openbsc/src/libmsc/transaction.c 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/transaction.c b/openbsc/src/libmsc/transaction.c index dba4bed..4b46e22 100644 --- a/openbsc/src/libmsc/transaction.c +++ b/openbsc/src/libmsc/transaction.c @@ -70,6 +70,13 @@ DEBUGP(DCC, "subscr=%p, net=%p\n", subscr, net); + /* a valid subscriber is indispensable */ + if (subscr == NULL) { + LOGP(DCC, LOGL_NOTICE, + "unable to alloc transaction, invalid subscriber (NULL)\n"); + return NULL; + } + trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; -- To view, visit https://gerrit.osmocom.org/3127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 8 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jul 11 06:10:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 06:10:27 +0000 Subject: openbsc[master]: bsc_api: Fix copy+paste error in printing name of RR STATUS PDU In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5 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 Tue Jul 11 06:10:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 06:10:30 +0000 Subject: [MERGED] openbsc[master]: bsc_api: Fix copy+paste error in printing name of RR STATUS PDU In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc_api: Fix copy+paste error in printing name of RR STATUS PDU ...................................................................... bsc_api: Fix copy+paste error in printing name of RR STATUS PDU Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5 --- M openbsc/src/libbsc/bsc_api.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index 7613cac..fa45421 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -604,7 +604,7 @@ break; case GSM48_MT_RR_STATUS: LOGP(DRR, LOGL_NOTICE, "%s (cause: %s)\n", - gsm48_rr_msg_name(GSM48_MT_RR_GPRS_SUSP_REQ), + gsm48_rr_msg_name(GSM48_MT_RR_STATUS), rr_cause_name(gh->data[0])); break; case GSM48_MT_RR_MEAS_REP: -- To view, visit https://gerrit.osmocom.org/3175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 11 06:11:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 06:11:22 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 11 06:11:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 06:11:39 +0000 Subject: [MERGED] libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: utils: add function gsm_fn_as_gsmtime_str() ...................................................................... utils: add function gsm_fn_as_gsmtime_str() Convert a given frame number into a printable string that displays the sub components of the frame number. Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map 3 files changed, 15 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index a879d33..bfcef08 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -165,6 +165,9 @@ /* Convert from frame number to GSM time */ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn); +/* Parse GSM Frame Number into printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn); + /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 2c980d2..477f076 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -750,6 +750,17 @@ time->tc = (time->fn / 51) % 8; } +/*! Parse GSM Frame Number into printable string + * \param[in] fn GSM Frame Number + * \returns pointer to printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn) +{ + struct gsm_time time; + + gsm_fn2gsmtime(&time, fn); + return osmo_dump_gsmtime(&time); +} + /*! Encode decoded \ref gsm_time to Frame Number * \param[in] time GSM Time in decoded structure * \returns GSM Frame Number */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ad7e013..714cb25 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -272,6 +272,7 @@ gsm_band_name; gsm_band_parse; gsm_fn2gsmtime; +gsm_fn_as_gsmtime_str; gsm_get_octet_len; gsm_gsmtime2fn; osmo_dump_gsmtime; -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jul 11 06:13:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 06:13:24 +0000 Subject: libosmo-abis[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: maybe it is a good idea if you could send a mailing list post about the intended use case / procedure for your release helpers "by example". If we agree to use it as-is, that text can be copied to the wiki for documentation purpose. -- To view, visit https://gerrit.osmocom.org/3131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 11 10:59:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 10:59:25 +0000 Subject: [PATCH] openbsc[master]: libbsc: Add VTY command to re-send the SYSTEM INFORMATION to... Message-ID: Review at https://gerrit.osmocom.org/3176 libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTS This is useful if you are updating some configuration parameters which affect the content of the SYSTEM INFORMATION messages. Currently, we only send them at the time the RSL connection is established (i.e. when the BTS is initialized), so if you change something, you need to bring down and re-start the BTS. Using the newly-introduced "bts <0-255> resend-system-information" command, you can re-generate + re-send SYSTEM INFORMATION without bringing the BTS down, i.e. without any radio carrier downtime. Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/76/3176/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 9fc2895..91a90c1 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -3830,6 +3830,38 @@ return CMD_SUCCESS; } +DEFUN(bts_resend, bts_resend_cmd, + "bts <0-255> resend-system-information", + "BTS Specific Commands\n" "BTS Number\n" + "Re-generate + re-send BCCH SYSTEM INFORMATION\n") +{ + struct gsm_network *gsmnet; + struct gsm_bts_trx *trx; + struct gsm_bts *bts; + unsigned int bts_nr; + + gsmnet = gsmnet_from_vty(vty); + + bts_nr = atoi(argv[0]); + if (bts_nr >= gsmnet->num_bts) { + vty_out(vty, "BTS number must be between 0 and %d. It was %d.%s", + gsmnet->num_bts, bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + bts = gsm_bts_num(gsmnet, bts_nr); + if (!bts) { + vty_out(vty, "BTS Nr. %d could not be found.%s", bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_for_each_entry_reverse(trx, &bts->trx_list, list) + gsm_bts_trx_set_system_infos(trx); + + return CMD_SUCCESS; +} + + DEFUN(smscb_cmd, smscb_cmd_cmd, "bts <0-255> smscb-command <1-4> HEXSTRING", "BTS related commands\n" "BTS Number\n" @@ -4288,6 +4320,7 @@ install_element(ENABLE_NODE, &drop_bts_cmd); install_element(ENABLE_NODE, &restart_bts_cmd); + install_element(ENABLE_NODE, &bts_resend_cmd); install_element(ENABLE_NODE, &pdch_act_cmd); install_element(ENABLE_NODE, &lchan_act_cmd); install_element(ENABLE_NODE, &lchan_mdcx_cmd); -- To view, visit https://gerrit.osmocom.org/3176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jul 11 11:05:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 11:05:24 +0000 Subject: [PATCH] osmo-hlr[master]: Attempt to fix .deb package Message-ID: Review at https://gerrit.osmocom.org/3177 Attempt to fix .deb package After recent switch to legacy python2 .deb fails on OBS. Let's put known-to-work python3 dependency back but keep the script itself on python without version specifier as it seems to work fine with both versions. Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Related: SYS#3322 --- M debian/control M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/77/3177/1 diff --git a/debian/control b/debian/control index 934abea..571c24e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python2.7, + python3, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 3a1c2b1..058113c 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/3177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jul 11 11:12:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 11:12:09 +0000 Subject: [PATCH] osmo-hlr[master]: Attempt to fix .deb package In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3177 to look at the new patch set (#2). Attempt to fix .deb package After recent switch to legacy python2 .deb fails on OBS. Let's put known-to-work python3 dependency back but keep the script itself on python without version specifier as it seems to work fine with both versions. This, in turn, causes tests to fail on FreeBSD so disable them for now. Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Related: SYS#3322 --- M contrib/jenkins.sh M debian/control M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 3 files changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/77/3177/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f2c9cbb..2d0a7ca 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -31,5 +31,7 @@ autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh +if [ "x$label" != "xFreeBSD_amd64" ]; then + $MAKE check || cat-testlogs.sh +fi $MAKE distcheck || cat-testlogs.sh diff --git a/debian/control b/debian/control index 934abea..571c24e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python2.7, + python3, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 3a1c2b1..058113c 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/3177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 11 12:05:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 12:05:54 +0000 Subject: [PATCH] osmo-hlr[master]: Attempt to fix .deb package In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3177 to look at the new patch set (#3). Attempt to fix .deb package After recent switch to legacy python2 .deb fails on OBS. Let's put known-to-work python3 dependency back but keep the script itself on python without version specifier as it seems to work fine with both versions. This, in turn, causes tests to fail on FreeBSD so disable them for now. Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Related: SYS#3322 --- M contrib/jenkins.sh M debian/control M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 3 files changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/77/3177/3 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f2c9cbb..8378136 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -30,6 +30,8 @@ cd "$base" autoreconf --install --force ./configure -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -$MAKE distcheck || cat-testlogs.sh +if [ "x$label" != "xFreeBSD_amd64" ]; then + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + $MAKE distcheck || cat-testlogs.sh +fi diff --git a/debian/control b/debian/control index 934abea..571c24e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python2.7, + python3, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 3a1c2b1..058113c 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/3177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 11 12:41:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 12:41:12 +0000 Subject: [PATCH] osmo-hlr[master]: Attempt to fix .deb package In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3177 to look at the new patch set (#4). Attempt to fix .deb package After recent switch to legacy python2 .deb fails on OBS. Let's put known-to-work python3 dependency back but keep the script itself on python without version specifier as it seems to work fine with both versions. This, in turn, causes tests to fail on FreeBSD so disable them for now. Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Related: SYS#3322 --- M contrib/jenkins.sh M debian/control M tests/auc/gen_ts_55_205_test_sets/Makefile.am M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 4 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/77/3177/4 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f2c9cbb..2d0a7ca 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -31,5 +31,7 @@ autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh +if [ "x$label" != "xFreeBSD_amd64" ]; then + $MAKE check || cat-testlogs.sh +fi $MAKE distcheck || cat-testlogs.sh diff --git a/debian/control b/debian/control index 934abea..571c24e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python2.7, + python3, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/gen_ts_55_205_test_sets/Makefile.am b/tests/auc/gen_ts_55_205_test_sets/Makefile.am index 3225384..8d84404 100644 --- a/tests/auc/gen_ts_55_205_test_sets/Makefile.am +++ b/tests/auc/gen_ts_55_205_test_sets/Makefile.am @@ -1,6 +1,6 @@ +check_PROGRAMS = pdftxt_2_c.py EXTRA_DIST = \ func_template.c \ main_template.c \ - pdftxt_2_c.py \ ts55_205_test_sets.txt \ $(NULL) diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 3a1c2b1..058113c 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/3177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 11 13:18:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 13:18:29 +0000 Subject: [PATCH] osmo-hlr[master]: Attempt to fix .deb package In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3177 to look at the new patch set (#5). Attempt to fix .deb package After recent switch to legacy python2 .deb fails on OBS. Let's put known-to-work python3 dependency back but keep the script itself on python without version specifier as it seems to work fine with both versions. This, in turn, causes tests to fail on FreeBSD so disable them for now. Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Related: SYS#3322 --- M contrib/jenkins.sh M debian/control M tests/auc/Makefile.am 3 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/77/3177/5 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f2c9cbb..2d0a7ca 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -31,5 +31,7 @@ autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh +if [ "x$label" != "xFreeBSD_amd64" ]; then + $MAKE check || cat-testlogs.sh +fi $MAKE distcheck || cat-testlogs.sh diff --git a/debian/control b/debian/control index 934abea..571c24e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python2.7, + python3, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/Makefile.am b/tests/auc/Makefile.am index 88532bf..9f2974f 100644 --- a/tests/auc/Makefile.am +++ b/tests/auc/Makefile.am @@ -22,11 +22,9 @@ auc_ts_55_205_test_sets.err \ $(NULL) +check_PROGRAMS = auc_ts_55_205_test_sets -noinst_PROGRAMS = \ - auc_test \ - auc_ts_55_205_test_sets \ - $(NULL) +noinst_PROGRAMS = auc_test auc_test_SOURCES = \ auc_test.c \ -- To view, visit https://gerrit.osmocom.org/3177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Gerrit-PatchSet: 5 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 11 13:19:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 13:19:47 +0000 Subject: [PATCH] osmo-hlr[master]: Attempt to fix .deb package In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3177 to look at the new patch set (#6). Attempt to fix .deb package After recent switch to legacy python2 .deb fails on OBS. Let's put known-to-work python3 dependency back but keep the script itself on python without version specifier as it seems to work fine with both versions. This, in turn, causes tests to fail on FreeBSD so disable them for now. Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Related: SYS#3322 --- M contrib/jenkins.sh M debian/control M tests/auc/Makefile.am M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 4 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/77/3177/6 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f2c9cbb..2d0a7ca 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -31,5 +31,7 @@ autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh +if [ "x$label" != "xFreeBSD_amd64" ]; then + $MAKE check || cat-testlogs.sh +fi $MAKE distcheck || cat-testlogs.sh diff --git a/debian/control b/debian/control index 934abea..571c24e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python2.7, + python3, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/Makefile.am b/tests/auc/Makefile.am index 88532bf..9f2974f 100644 --- a/tests/auc/Makefile.am +++ b/tests/auc/Makefile.am @@ -22,11 +22,9 @@ auc_ts_55_205_test_sets.err \ $(NULL) +check_PROGRAMS = auc_ts_55_205_test_sets -noinst_PROGRAMS = \ - auc_test \ - auc_ts_55_205_test_sets \ - $(NULL) +noinst_PROGRAMS = auc_test auc_test_SOURCES = \ auc_test.c \ diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 3a1c2b1..058113c 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/3177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 11 13:23:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 13:23:11 +0000 Subject: [PATCH] osmo-hlr[master]: Attempt to fix .deb package In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3177 to look at the new patch set (#7). Attempt to fix .deb package After recent switch to legacy python2 .deb fails on OBS. Let's put known-to-work python3 dependency back but keep the script itself on python without version specifier as it seems to work fine with both versions. This, in turn, causes tests to fail on FreeBSD so disable them for now. Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Related: SYS#3322 --- M contrib/jenkins.sh M debian/control M tests/auc/Makefile.am M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 4 files changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/77/3177/7 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f2c9cbb..591d6c7 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -31,5 +31,7 @@ autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -$MAKE distcheck || cat-testlogs.sh +if [ "x$label" != "xFreeBSD_amd64" ]; then + $MAKE check || cat-testlogs.sh + $MAKE distcheck || cat-testlogs.sh +fi diff --git a/debian/control b/debian/control index 934abea..571c24e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python2.7, + python3, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/Makefile.am b/tests/auc/Makefile.am index 88532bf..9f2974f 100644 --- a/tests/auc/Makefile.am +++ b/tests/auc/Makefile.am @@ -22,11 +22,9 @@ auc_ts_55_205_test_sets.err \ $(NULL) +check_PROGRAMS = auc_ts_55_205_test_sets -noinst_PROGRAMS = \ - auc_test \ - auc_ts_55_205_test_sets \ - $(NULL) +noinst_PROGRAMS = auc_test auc_test_SOURCES = \ auc_test.c \ diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 3a1c2b1..058113c 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/3177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Gerrit-PatchSet: 7 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 11 15:28:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 15:28:05 +0000 Subject: openbsc[master]: libbsc: Add VTY command to re-send the SYSTEM INFORMATION to... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Doesn't work with si2q yet - I'll look into fix (both bts and bsc side). -- To view, visit https://gerrit.osmocom.org/3176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Tue Jul 11 15:42:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 15:42:48 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Add Message Sequence Chart for a MO calls with ext. MNCC han... Message-ID: Review at https://gerrit.osmocom.org/3178 Add Message Sequence Chart for a MO calls with ext. MNCC handler Change-Id: Ida10fc7ccb345b8cd084c4ecc5f4f7d4ce6c98a0 --- A common/chapters/nitb_mncc_mo_rtp.msc A common/chapters/nitb_mncc_mo_tch.msc 2 files changed, 196 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/78/3178/1 diff --git a/common/chapters/nitb_mncc_mo_rtp.msc b/common/chapters/nitb_mncc_mo_rtp.msc new file mode 100644 index 0000000..768827a --- /dev/null +++ b/common/chapters/nitb_mncc_mo_rtp.msc @@ -0,0 +1,104 @@ +msc { + hscale="4"; + ms [label="MS"], bts [label="BTS"], nitb [label="NITB"], emh [label="External MNCC Hdlr"]; + + |||; + ... [label="Mobile Originated call handled via OsmoNITB, no RTP proxy, IPBTS and external MNCC Handler"]; + |||; + --- [label="User on A-side dials a MO call from his phone"]; + ms <=> nitb [label="RF Channel Establishment"]; + ...; + + # MS sends CC SETUP, deliver it to MNCC + ms -> nitb [label="CC SETUP [MSISDN]"]; + nitb rbox nitb [label="CSTATE_INITIATED"]; + nitb -> emh [label="MNCC-SETUP.ind [CALLING, BEARER_CAP, +FACILITY, CALLED, USERUSER, SSVERSION, CCCAP"]; + emh rbox emh [label="1 CALL_INIT"]; + ...; + + --- [label="Exact time of RTP-CREATE up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_RTP_CREATE[.req]"]; + bts <- nitb [label="RSL IPA CRCX"]; + bts -> nitb [label="RSL IPA CRCX ACK (BTS-IP, BTS-PORT)"]; + nitb -> emh [label="MNCC_RTP_CREATE[.cnf] (BTS-IP, BTS-PORT)"]; + ...; + + nitb <- emh [label="MNCC-CALL-PROC.req [BEARER_CAP, FACILITY, PROGRESS]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + nitb rbox nitb [label="CSTATE_MO_CALL_PROC"]; + ms <- nitb [label="CC CALL PROCEDING"]; + ...; + + # optional + --- [label="Optional PROGRESS, can happen 0-N times"]; + nitb <- emh [label="MNCC-PROGRESS.req [USERUSER]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + ms <- nitb [label="CC PROCEDING"]; + ...; + + # optional + --- [label="Optional; Indicates when B-side is ringing"]; + nitb <- emh [label="MNCC-ALERT.req [FACILITY, PROGRESS, USERUSER]"]; + emh rbox emh [label="4 CALL_DELIVERED"]; + nitb rbox nitb [label="CSTATE_CALL_DELIVERED"]; + ms <- nitb [label="CC ALERTING"]; + ...; + + # ask the BTS to connect its RTP stream to the given IP+PORT + --- [label="Exact time of RTP-CONNECT up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_RTP_CONNECT[.req] (EMH-IP, EMH-PORT)"]; + bts <- nitb [label="RSL IPA MDCX (EMH-IP, EMH-PORT)"]; + bts -> nitb [label="RSL IPA MDCX ACK"]; + nitb -> emh [label="MNCC_RTP_CONNECT[.cnf] (BTS-IP, BTS-PORT)"]; + ...; + + --- [label="User on B-side answers the call"]; + nitb <- emh [label="MNCC-SETUP.rsp [FACILITY, PROGRERSS, CONNETED, USERUSER]"]; + emh rbox emh [label="? CONNECT_INDICATION"]; + nitb rbox nitb [label="CSTATE_CONNECT_IND"]; + ms <- nitb [label="CC CONNECT"]; + ...; + + ms -> nitb [label="CC CONNECT ACK"]; + nitb rbox nitb [label="CSTATE_ACTIVE"]; + nitb -> emh [label="MNCC-SETUP-COMPL.ind"]; + emh rbox emh [label="10 ACTIVE"]; + ...; + ...; + ...; + + --- [label="User on A-side hangs up the call"]; + ms -> nitb [label="CC DISCONNECT"]; + nitb rbox nitb [label="CSTATE_DISCONNET_REQ"]; + nitb -> emh [label="MNCC-DISC.ind [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + emh rbox emh [label="12 DISCONNET_IND"]; + ...; + + nitb <- emh [label="MNCC-RELEASE.req [CAUSE, FACILITY, USERUSER]"]; + emh rbox emh [label="19 RELEASE_REQ"]; + nitb rbox nitb [label="CSTATE_RELEASE_REQ"]; + ms <- nitb [label="CC RELEASE"]; + ...; + + ms -> nitb [label="CC RELEASE COMPLETE"]; + nitb -> emh [label="MNCC-RELEASE.cnf [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + ...; + + ms <=> nitb [label="RF Channel Release"]; + ...; + + + + # bridge two voice calls (by call reference) inside NITB +# nitb <- emh [label="MNCC_BRIDGE"]; + +# nitb <- emh [label="MNCC_FRAME_DROP"]; +# nitb <- emh [label="MNCC_FRAME_RECV"]; + + # not implemented so far +# nitb <- emh [label="MNCC_RTP_FREE"]; + + # direct input/output of voice frames via MNCC socket +# nitb <- emh [label="MNCC_TCHF_FRAME, GSM_TCHF_FRAME_EFR, GSM_TCHH_FRAME, GSM_TCH_FRAME_AMR"]; +} diff --git a/common/chapters/nitb_mncc_mo_tch.msc b/common/chapters/nitb_mncc_mo_tch.msc new file mode 100644 index 0000000..0a44a92 --- /dev/null +++ b/common/chapters/nitb_mncc_mo_tch.msc @@ -0,0 +1,92 @@ +# Mobile Originated call handled via OsmoNITB with RTP proxy or E1 BTS # and external MNCC Handler +msc { + hscale="4"; + ms [label="MS"], bts [label="BTS"], nitb [label="OsmoNITB"], emh [label="External MNCC Hdlr"]; + + |||; + ... [label="Mobile Originated call handled via OsmoNITB with RTP proxy or E1 BTS and external MNCC Handler"]; + |||; + --- [label="User on A-side dials a MO call from his phone"]; + ms <=> nitb [label="RF Channel Establishment"]; + ...; + + # MS sends CC SETUP, deliver it to MNCC + ms -> nitb [label="CC SETUP [MSISDN]"]; + nitb rbox nitb [label="CSTATE_INITIATED"]; + nitb -> emh [label="MNCC-SETUP.ind [CALLING, BEARER_CAP, +FACILITY, CALLED, USERUSER, SSVERSION, CCCAP"]; + emh rbox emh [label="1 CALL_INIT"]; + ...; + + nitb <- emh [label="MNCC-CALL-PROC.req [BEARER_CAP, FACILITY, PROGRESS]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + nitb rbox nitb [label="CSTATE_MO_CALL_PROC"]; + ms <- nitb [label="CC CALL PROCEDING"]; + ...; + + # optional + --- [label="Optional PROGRESS, can happen 0-N times"]; + nitb <- emh [label="MNCC-PROGRESS.req [USERUSER]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + ms <- nitb [label="CC PROCEDING"]; + ...; + + # optional + --- [label="Optional; Indicates when B-side is ringing"]; + nitb <- emh [label="MNCC-ALERT.req [FACILITY, PROGRESS, USERUSER]"]; + emh rbox emh [label="4 CALL_DELIVERED"]; + nitb rbox nitb [label="CSTATE_CALL_DELIVERED"]; + ms <- nitb [label="CC ALERTING"]; + ...; + + # ask the BTS to connect its RTP stream to the given IP+PORT + --- [label="Exact time of MNCC_FRAME_RECV is up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_FRAME_RECV[.req]"]; + ms -> nitb [label="TCH Voice Frame (TRAU or RTP)"]; + nitb ->emh [label="{GSM_{TCHF,TCHH}_FRAME,GSM_TCHF_FRAME_EFR,GSM_TCH_FRAME_AMR}"]; + ms -> nitb [label="TCH Voice Frame (TRAU or RTP)"]; + nitb ->emh [label="{GSM_{TCHF,TCHH}_FRAME,GSM_TCHF_FRAME_EFR,GSM_TCH_FRAME_AMR}"]; + ... [label="Unidirectional voice frames continue"]; + + --- [label="User on B-side answers the call"]; + nitb <- emh [label="MNCC-SETUP.rsp [FACILITY, PROGRERSS, CONNETED, USERUSER]"]; + emh rbox emh [label="? CONNECT_INDICATION"]; + nitb rbox nitb [label="CSTATE_CONNECT_IND"]; + ms <- nitb [label="CC CONNECT"]; + ...; + + ms -> nitb [label="TCH Voice Frame (TRAU or RTP)"]; + nitb ->emh [label="{GSM_{TCHF,TCHH}_FRAME,GSM_TCHF_FRAME_EFR,GSM_TCH_FRAME_AMR}"]; + ...; + nitb <- emh [label="{GSM_{TCHF,TCHH}_FRAME,GSM_TCHF_FRAME_EFR,GSM_TCH_FRAME_AMR}"]; + ms <- nitb [label="TCH Voice Frame (TRAU or RTP)"]; + ... [label="Bi-directional voice frames continue"]; + + ms -> nitb [label="CC CONNECT ACK"]; + nitb rbox nitb [label="CSTATE_ACTIVE"]; + nitb -> emh [label="MNCC-SETUP-COMPL.ind"]; + emh rbox emh [label="10 ACTIVE"]; + ...; + ...; + ...; + + --- [label="User on A-side hangs up the call"]; + ms -> nitb [label="CC DISCONNECT"]; + nitb rbox nitb [label="CSTATE_DISCONNET_REQ"]; + nitb -> emh [label="MNCC-DISC.ind [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + emh rbox emh [label="12 DISCONNET_IND"]; + ...; + + nitb <- emh [label="MNCC-RELEASE.req [CAUSE, FACILITY, USERUSER]"]; + emh rbox emh [label="19 RELEASE_REQ"]; + nitb rbox nitb [label="CSTATE_RELEASE_REQ"]; + ms <- nitb [label="CC RELEASE"]; + ...; + + ms -> nitb [label="CC RELEASE COMPLETE"]; + nitb -> emh [label="MNCC-RELEASE.cnf [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + ...; + + ms <=> nitb [label="RF Channel Release"]; + ...; +} -- To view, visit https://gerrit.osmocom.org/3178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida10fc7ccb345b8cd084c4ecc5f4f7d4ce6c98a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jul 11 15:42:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 15:42:48 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Add Message Sequence Chart for MO call with ext. MNCC in Osm... Message-ID: Review at https://gerrit.osmocom.org/3179 Add Message Sequence Chart for MO call with ext. MNCC in OsmoMSC We simply talk to the MGW instead of the BTS, everything else should remain identical. Change-Id: I5c249cc2144276a25dba4d7bcb086a34b52d6334 --- A common/chapters/msc_mncc_mo_rtp.msc 1 file changed, 90 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/79/3179/1 diff --git a/common/chapters/msc_mncc_mo_rtp.msc b/common/chapters/msc_mncc_mo_rtp.msc new file mode 100644 index 0000000..70197bc --- /dev/null +++ b/common/chapters/msc_mncc_mo_rtp.msc @@ -0,0 +1,90 @@ +msc { + hscale="4"; + ms [label="MS"], mgw [label="MGW"], nitb [label="MSC"], emh [label="External MNCC Hdlr"]; + + |||; + ... [label="Mobile Originated call handled via OsmoMSC, no RTP proxy, IPBTS and external MNCC Handler"]; + |||; + --- [label="User on A-side dials a MO call from his phone"]; + ms <=> nitb [label="RF Channel Establishment"]; + ...; + + # MS sends CC SETUP, deliver it to MNCC + ms -> nitb [label="CC SETUP [MSISDN]"]; + nitb rbox nitb [label="CSTATE_INITIATED"]; + nitb -> emh [label="MNCC-SETUP.ind [CALLING, BEARER_CAP, +FACILITY, CALLED, USERUSER, SSVERSION, CCCAP"]; + emh rbox emh [label="1 CALL_INIT"]; + ...; + + --- [label="Exact time of RTP-CREATE up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_RTP_CREATE[.req]"]; + mgw <- nitb [label="MGCP CRCX"]; + mgw -> nitb [label="MGCP CRCX ACK (MGW-IP, MGW-PORT)"]; + nitb -> emh [label="MNCC_RTP_CREATE[.cnf] (MGW-IP, MGW-PORT)"]; + ...; + + nitb <- emh [label="MNCC-CALL-PROC.req [BEARER_CAP, FACILITY, PROGRESS]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + nitb rbox nitb [label="CSTATE_MO_CALL_PROC"]; + ms <- nitb [label="CC CALL PROCEDING"]; + ...; + + # optional + --- [label="Optional PROGRESS, can happen 0-N times"]; + nitb <- emh [label="MNCC-PROGRESS.req [USERUSER]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + ms <- nitb [label="CC PROCEDING"]; + ...; + + # optional + --- [label="Optional; Indicates when B-side is ringing"]; + nitb <- emh [label="MNCC-ALERT.req [FACILITY, PROGRESS, USERUSER]"]; + emh rbox emh [label="4 CALL_DELIVERED"]; + nitb rbox nitb [label="CSTATE_CALL_DELIVERED"]; + ms <- nitb [label="CC ALERTING"]; + ...; + + # ask the MGW to connect its RTP stream to the given IP+PORT + --- [label="Exact time of RTP-CONNECT up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_RTP_CONNECT[.req] (EMH-IP, EMH-PORT)"]; + mgw <- nitb [label="MGCP MDCX (EMH-IP, EMH-PORT)"]; + mgw -> nitb [label="MGCP MDCX ACK"]; + nitb -> emh [label="MNCC_RTP_CONNECT[.cnf] (MGW-IP, MGW-PORT)"]; + ...; + + --- [label="User on B-side answers the call"]; + nitb <- emh [label="MNCC-SETUP.rsp [FACILITY, PROGRERSS, CONNETED, USERUSER]"]; + emh rbox emh [label="? CONNECT_INDICATION"]; + nitb rbox nitb [label="CSTATE_CONNECT_IND"]; + ms <- nitb [label="CC CONNECT"]; + ...; + + ms -> nitb [label="CC CONNECT ACK"]; + nitb rbox nitb [label="CSTATE_ACTIVE"]; + nitb -> emh [label="MNCC-SETUP-COMPL.ind"]; + emh rbox emh [label="10 ACTIVE"]; + ...; + ...; + ...; + + --- [label="User on A-side hangs up the call"]; + ms -> nitb [label="CC DISCONNECT"]; + nitb rbox nitb [label="CSTATE_DISCONNET_REQ"]; + nitb -> emh [label="MNCC-DISC.ind [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + emh rbox emh [label="12 DISCONNET_IND"]; + ...; + + nitb <- emh [label="MNCC-RELEASE.req [CAUSE, FACILITY, USERUSER]"]; + emh rbox emh [label="19 RELEASE_REQ"]; + nitb rbox nitb [label="CSTATE_RELEASE_REQ"]; + ms <- nitb [label="CC RELEASE"]; + ...; + + ms -> nitb [label="CC RELEASE COMPLETE"]; + nitb -> emh [label="MNCC-RELEASE.cnf [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + ...; + + ms <=> nitb [label="RF Channel Release"]; + ...; +} -- To view, visit https://gerrit.osmocom.org/3179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c249cc2144276a25dba4d7bcb086a34b52d6334 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jul 11 16:13:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 16:13:40 +0000 Subject: [PATCH] osmo-bts[master]: si2q: do not consider count update as error Message-ID: Review at https://gerrit.osmocom.org/3180 si2q: do not consider count update as error The number of SI2quater messages might be updated dynamically by BSC (via 'bts 0 resend-system-information' command for example). Log it but do not return error. Change-Id: I9625be879c672e20543cc40af288828143ffb983 --- M src/common/rsl.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/80/3180/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index fd8bf13..dc176ea 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -315,9 +315,8 @@ count = (uint8_t) bitvec_get_uint(&bv, 4); if (bts->si2q_count && bts->si2q_count != count) { - LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + LOGP(DRSL, LOGL_NOTICE, " Rx RSL SI2quater count updated: %u -> %d\n", bts->si2q_count, count); - return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } bts->si2q_count = count; -- To view, visit https://gerrit.osmocom.org/3180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9625be879c672e20543cc40af288828143ffb983 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jul 11 16:14:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 16:14:22 +0000 Subject: openbsc[master]: libbsc: Add VTY command to re-send the SYSTEM INFORMATION to... In-Reply-To: References: Message-ID: Patch Set 1: BTS-side fix is in 3180. -- To view, visit https://gerrit.osmocom.org/3176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Tue Jul 11 16:22:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 16:22:51 +0000 Subject: [PATCH] osmo-bts[master]: si2q: do not consider count update as error In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3180 to look at the new patch set (#2). si2q: do not consider count update as error The number of SI2quater messages might be updated dynamically by BSC (via 'bts 0 resend-system-information' command for example). Log it but do not return error. Related: OS#2357 Change-Id: I9625be879c672e20543cc40af288828143ffb983 --- M src/common/rsl.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/80/3180/2 diff --git a/src/common/rsl.c b/src/common/rsl.c index fd8bf13..dc176ea 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -315,9 +315,8 @@ count = (uint8_t) bitvec_get_uint(&bv, 4); if (bts->si2q_count && bts->si2q_count != count) { - LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + LOGP(DRSL, LOGL_NOTICE, " Rx RSL SI2quater count updated: %u -> %d\n", bts->si2q_count, count); - return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } bts->si2q_count = count; -- To view, visit https://gerrit.osmocom.org/3180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9625be879c672e20543cc40af288828143ffb983 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 Tue Jul 11 16:36:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 16:36:16 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify polling troubleshooting 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/2859 to look at the new patch set (#7). Simplify polling troubleshooting * introduce enum describing poll kind and use it in set_polling() * move state change into set_polling() * move logging into set_polling() and unify output * move duplicated code into static function * adjust tests to match unified logging output Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Related: OS#1524 --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/tbf/TbfTest.err 6 files changed, 100 insertions(+), 103 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/59/2859/7 diff --git a/src/bts.cpp b/src/bts.cpp index 5f7d9e8..302daf9 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1360,7 +1360,9 @@ } /* set control ts to current MS's TS, until assignment complete */ - LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no); + LOGP(DRLCMAC, LOGL_DEBUG, "%s change control TS %d -> %d until assinment is complete.\n", + tbf_name(ul_tbf), ul_tbf->control_ts, ts_no); + ul_tbf->control_ts = ts_no; /* schedule uplink assignment */ ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; diff --git a/src/tbf.cpp b/src/tbf.cpp index b2acb11..4871076 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -593,16 +593,50 @@ return 0; } -void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts) +void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t) { - LOGP(DRLCMAC, LOGL_DEBUG, - "%s: Scheduling polling at FN %d TS %d\n", - name(), new_poll_fn, ts); + const char *chan = "UNKNOWN"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH))) + chan = "CCCH"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) + chan = "PACCH"; + + if ((state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) && (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH)))) + LOGP(DRLCMACDL, LOGL_ERROR, + "%s Attempt to schedule polling on %s (FN=%d, TS=%d) with both CCCH and PACCH flags set - FIXME!\n", + name(), chan, poll_fn, poll_ts); /* schedule polling */ poll_state = GPRS_RLCMAC_POLL_SCHED; poll_fn = new_poll_fn; poll_ts = ts; + + switch (t) { + case GPRS_RLCMAC_POLL_UL_ASS: + ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled UL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ASS: + dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled DL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_UL_ACK: + ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; + + LOGP(DRLCMACUL, LOGL_DEBUG, "%s Scheduled UL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ACK: + LOGP(DRLCMACDL, LOGL_DEBUG, "%s Scheduled DL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + } } void gprs_rlcmac_tbf::poll_timeout() @@ -1133,11 +1167,7 @@ talloc_free(mac_control_block); if (poll_ass_dl) { - set_polling(new_poll_fn, ts); - dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled DL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ASS); } else { dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; new_dl_tbf->set_state(GPRS_RLCMAC_FLOW); @@ -1234,11 +1264,7 @@ bitvec_free(ass_vec); talloc_free(mac_control_block); - set_polling(new_poll_fn, ts); - ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled UL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ASS); return msg; } diff --git a/src/tbf.h b/src/tbf.h index cd8d694..c13e61f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -54,6 +54,13 @@ GPRS_RLCMAC_RELEASING, /* releasing, wait to free TBI/USF */ }; +enum gprs_rlcmac_tbf_poll_type { + GPRS_RLCMAC_POLL_UL_ASS, + GPRS_RLCMAC_POLL_DL_ASS, + GPRS_RLCMAC_POLL_UL_ACK, + GPRS_RLCMAC_POLL_DL_ACK, +}; + enum gprs_rlcmac_tbf_poll_state { GPRS_RLCMAC_POLL_NONE = 0, GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ @@ -173,7 +180,7 @@ int check_polling(uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp); - void set_polling(uint32_t poll_fn, uint8_t ts); + void set_polling(uint32_t poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t); void poll_timeout(); /** tlli handling */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 375d642..6aa17bb 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -855,10 +855,8 @@ rc = check_polling(fn, ts, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ACK); - LOGP(DRLCMACDL, LOGL_DEBUG, "Polling scheduled in this " - "TS %d\n", ts); m_tx_counter = 0; /* start timer whenever we send the final block */ if (is_final) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1e0898a..81d3b24 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -158,9 +158,8 @@ m_contention_resolution_done = 1; if (final) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ACK); /* waiting for final acknowledge */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; m_final_ack_sent = 1; } else ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 2002379..5f1e00d 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -63,8 +63,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -151,8 +150,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -239,8 +237,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -1617,12 +1614,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +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)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1702,12 +1698,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +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)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1757,8 +1752,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1788,8 +1782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654292 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654292, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654292, TS=7 msg block (BSN 0, CS-4): 0f 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 @@ -1840,13 +1833,12 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf5667788, not yet confirmed Modifying MS object, TLLI = 0xf5667788, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. 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)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654348 TS 7 -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654348, TS=7 +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654348, TS=7) Scheduling control message at RTS for TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=48 28 5e ac ce f1 0f 1d 00 00 88 40 09 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1912,12 +1904,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +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)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2008,12 +1999,11 @@ Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 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 3169. -Change control TS to 7 until assinment is complete. +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)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654340 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654340, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654340, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2089,12 +2079,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +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)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2243,12 +2232,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +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)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2337,8 +2325,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2795,8 +2782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because 20 blocks sent. -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW): Scheduling polling at FN 2654379 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled DL Acknowledgement polling on PACCH (FN=2654379, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled Ack/Nack polling on FN=2654379, TS=7 msg block (BSN 20, CS-1): 0f 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654366 block=6 data=08 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 @@ -3024,8 +3010,7 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE): Scheduling polling at FN 2654413 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on FN=2654413, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on UNKNOWN (FN=2654413, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654400 block=2 data=48 08 20 08 0c 72 00 02 18 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3258,8 +3243,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654461 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654461, TS=7) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654461, TS=7 msg block (BSN 10, CS-1): 0f 03 14 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 @@ -3383,13 +3367,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3478,13 +3461,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3728,8 +3710,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4063,8 +4044,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4343,8 +4323,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4582,8 +4561,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4785,8 +4763,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4966,8 +4943,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5128,8 +5104,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5286,8 +5261,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5431,8 +5405,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5749,8 +5722,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-5): 0f 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5820,8 +5792,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-6): 0f 40 00 00 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5888,8 +5859,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-7): 0f 00 00 02 a0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5959,8 +5929,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-9): 0f 00 00 02 00 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -6263,13 +6232,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6440,13 +6408,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6901,13 +6868,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f9 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -7991,8 +7957,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Scheduling polling at FN 2654292 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=2654292, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on PACCH (FN=2654292, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=48 08 00 00 0c 72 00 02 08 00 80 c8 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Gerrit-PatchSet: 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 Jul 11 16:45:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 11 Jul 2017 16:45:30 +0000 Subject: [PATCH] libosmocore[master]: add DLMGCP logging category for libosmo-mgcp Message-ID: Review at https://gerrit.osmocom.org/3181 add DLMGCP logging category for libosmo-mgcp In the course of splitting up the openbsc.git repository, we will create libosmo-mgcp and need a library logging category for that purpose. Change-Id: I09c587e2d59472cbde852d467d457254746d9e67 --- M include/osmocom/core/logging.h M src/logging.c 2 files changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/3181/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index e058a57..86a6977 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -104,7 +104,8 @@ #define DLSCCP -14 /*!< Osmocom SCCP */ #define DLSUA -15 /*!< Osmocom SUA */ #define DLM3UA -16 /*!< Osmocom M3UA */ -#define OSMO_NUM_DLIB 16 /*!< Number of logging sub-systems in libraries */ +#define DLMGCP -17 /*!< Osmocom MGCP */ +#define OSMO_NUM_DLIB 17 /*!< Number of logging sub-systems in libraries */ /*! Configuration of single log category / sub-system */ struct log_category { diff --git a/src/logging.c b/src/logging.c index 2fb06ba..2e913e5 100644 --- a/src/logging.c +++ b/src/logging.c @@ -161,6 +161,11 @@ .description = "libosmo-sigtran MTP3 User Adaptation", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [INT2IDX(DLMGCP)] = { + .name = "DLMGCP", + .description = "libosmo-mgcp Media Gateway Control Protocol", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, }; /*! descriptive string for each log level */ -- To view, visit https://gerrit.osmocom.org/3181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09c587e2d59472cbde852d467d457254746d9e67 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 11 16:59:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 16:59:02 +0000 Subject: osmo-pcu[master]: Simplify polling troubleshooting In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Gerrit-PatchSet: 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 Tue Jul 11 17:00:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:00:13 +0000 Subject: libosmocore[master]: add DLMGCP logging category for libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 1: I really would prefer not to have a system-installed library with a "stable" API for MGCP based on the existing code. -- To view, visit https://gerrit.osmocom.org/3181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09c587e2d59472cbde852d467d457254746d9e67 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 Jul 11 17:12:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:12:19 +0000 Subject: osmo-bts[master]: si2q: do not consider count update as error In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9625be879c672e20543cc40af288828143ffb983 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 Tue Jul 11 17:12:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:12:20 +0000 Subject: [MERGED] osmo-bts[master]: si2q: do not consider count update as error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: si2q: do not consider count update as error ...................................................................... si2q: do not consider count update as error The number of SI2quater messages might be updated dynamically by BSC (via 'bts 0 resend-system-information' command for example). Log it but do not return error. Related: OS#2357 Change-Id: I9625be879c672e20543cc40af288828143ffb983 --- M src/common/rsl.c 1 file changed, 1 insertion(+), 2 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 fd8bf13..dc176ea 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -315,9 +315,8 @@ count = (uint8_t) bitvec_get_uint(&bv, 4); if (bts->si2q_count && bts->si2q_count != count) { - LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + LOGP(DRSL, LOGL_NOTICE, " Rx RSL SI2quater count updated: %u -> %d\n", bts->si2q_count, count); - return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } bts->si2q_count = count; -- To view, visit https://gerrit.osmocom.org/3180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9625be879c672e20543cc40af288828143ffb983 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 Tue Jul 11 17:12:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:12:34 +0000 Subject: openbsc[master]: libbsc: Add VTY command to re-send the SYSTEM INFORMATION to... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Jul 11 17:12:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:12:36 +0000 Subject: [MERGED] openbsc[master]: libbsc: Add VTY command to re-send the SYSTEM INFORMATION to... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTS ...................................................................... libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTS This is useful if you are updating some configuration parameters which affect the content of the SYSTEM INFORMATION messages. Currently, we only send them at the time the RSL connection is established (i.e. when the BTS is initialized), so if you change something, you need to bring down and re-start the BTS. Using the newly-introduced "bts <0-255> resend-system-information" command, you can re-generate + re-send SYSTEM INFORMATION without bringing the BTS down, i.e. without any radio carrier downtime. Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 33 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/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 9fc2895..91a90c1 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -3830,6 +3830,38 @@ return CMD_SUCCESS; } +DEFUN(bts_resend, bts_resend_cmd, + "bts <0-255> resend-system-information", + "BTS Specific Commands\n" "BTS Number\n" + "Re-generate + re-send BCCH SYSTEM INFORMATION\n") +{ + struct gsm_network *gsmnet; + struct gsm_bts_trx *trx; + struct gsm_bts *bts; + unsigned int bts_nr; + + gsmnet = gsmnet_from_vty(vty); + + bts_nr = atoi(argv[0]); + if (bts_nr >= gsmnet->num_bts) { + vty_out(vty, "BTS number must be between 0 and %d. It was %d.%s", + gsmnet->num_bts, bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + bts = gsm_bts_num(gsmnet, bts_nr); + if (!bts) { + vty_out(vty, "BTS Nr. %d could not be found.%s", bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_for_each_entry_reverse(trx, &bts->trx_list, list) + gsm_bts_trx_set_system_infos(trx); + + return CMD_SUCCESS; +} + + DEFUN(smscb_cmd, smscb_cmd_cmd, "bts <0-255> smscb-command <1-4> HEXSTRING", "BTS related commands\n" "BTS Number\n" @@ -4288,6 +4320,7 @@ install_element(ENABLE_NODE, &drop_bts_cmd); install_element(ENABLE_NODE, &restart_bts_cmd); + install_element(ENABLE_NODE, &bts_resend_cmd); install_element(ENABLE_NODE, &pdch_act_cmd); install_element(ENABLE_NODE, &lchan_act_cmd); install_element(ENABLE_NODE, &lchan_mdcx_cmd); -- To view, visit https://gerrit.osmocom.org/3176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Jul 11 17:12:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:12:41 +0000 Subject: osmo-gsm-manuals[master]: Add Message Sequence Chart for a MO calls with ext. MNCC han... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida10fc7ccb345b8cd084c4ecc5f4f7d4ce6c98a0 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 Tue Jul 11 17:12:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:12:43 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Add Message Sequence Chart for a MO calls with ext. MNCC han... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add Message Sequence Chart for a MO calls with ext. MNCC handler ...................................................................... Add Message Sequence Chart for a MO calls with ext. MNCC handler Change-Id: Ida10fc7ccb345b8cd084c4ecc5f4f7d4ce6c98a0 --- A common/chapters/nitb_mncc_mo_rtp.msc A common/chapters/nitb_mncc_mo_tch.msc 2 files changed, 196 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/nitb_mncc_mo_rtp.msc b/common/chapters/nitb_mncc_mo_rtp.msc new file mode 100644 index 0000000..768827a --- /dev/null +++ b/common/chapters/nitb_mncc_mo_rtp.msc @@ -0,0 +1,104 @@ +msc { + hscale="4"; + ms [label="MS"], bts [label="BTS"], nitb [label="NITB"], emh [label="External MNCC Hdlr"]; + + |||; + ... [label="Mobile Originated call handled via OsmoNITB, no RTP proxy, IPBTS and external MNCC Handler"]; + |||; + --- [label="User on A-side dials a MO call from his phone"]; + ms <=> nitb [label="RF Channel Establishment"]; + ...; + + # MS sends CC SETUP, deliver it to MNCC + ms -> nitb [label="CC SETUP [MSISDN]"]; + nitb rbox nitb [label="CSTATE_INITIATED"]; + nitb -> emh [label="MNCC-SETUP.ind [CALLING, BEARER_CAP, +FACILITY, CALLED, USERUSER, SSVERSION, CCCAP"]; + emh rbox emh [label="1 CALL_INIT"]; + ...; + + --- [label="Exact time of RTP-CREATE up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_RTP_CREATE[.req]"]; + bts <- nitb [label="RSL IPA CRCX"]; + bts -> nitb [label="RSL IPA CRCX ACK (BTS-IP, BTS-PORT)"]; + nitb -> emh [label="MNCC_RTP_CREATE[.cnf] (BTS-IP, BTS-PORT)"]; + ...; + + nitb <- emh [label="MNCC-CALL-PROC.req [BEARER_CAP, FACILITY, PROGRESS]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + nitb rbox nitb [label="CSTATE_MO_CALL_PROC"]; + ms <- nitb [label="CC CALL PROCEDING"]; + ...; + + # optional + --- [label="Optional PROGRESS, can happen 0-N times"]; + nitb <- emh [label="MNCC-PROGRESS.req [USERUSER]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + ms <- nitb [label="CC PROCEDING"]; + ...; + + # optional + --- [label="Optional; Indicates when B-side is ringing"]; + nitb <- emh [label="MNCC-ALERT.req [FACILITY, PROGRESS, USERUSER]"]; + emh rbox emh [label="4 CALL_DELIVERED"]; + nitb rbox nitb [label="CSTATE_CALL_DELIVERED"]; + ms <- nitb [label="CC ALERTING"]; + ...; + + # ask the BTS to connect its RTP stream to the given IP+PORT + --- [label="Exact time of RTP-CONNECT up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_RTP_CONNECT[.req] (EMH-IP, EMH-PORT)"]; + bts <- nitb [label="RSL IPA MDCX (EMH-IP, EMH-PORT)"]; + bts -> nitb [label="RSL IPA MDCX ACK"]; + nitb -> emh [label="MNCC_RTP_CONNECT[.cnf] (BTS-IP, BTS-PORT)"]; + ...; + + --- [label="User on B-side answers the call"]; + nitb <- emh [label="MNCC-SETUP.rsp [FACILITY, PROGRERSS, CONNETED, USERUSER]"]; + emh rbox emh [label="? CONNECT_INDICATION"]; + nitb rbox nitb [label="CSTATE_CONNECT_IND"]; + ms <- nitb [label="CC CONNECT"]; + ...; + + ms -> nitb [label="CC CONNECT ACK"]; + nitb rbox nitb [label="CSTATE_ACTIVE"]; + nitb -> emh [label="MNCC-SETUP-COMPL.ind"]; + emh rbox emh [label="10 ACTIVE"]; + ...; + ...; + ...; + + --- [label="User on A-side hangs up the call"]; + ms -> nitb [label="CC DISCONNECT"]; + nitb rbox nitb [label="CSTATE_DISCONNET_REQ"]; + nitb -> emh [label="MNCC-DISC.ind [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + emh rbox emh [label="12 DISCONNET_IND"]; + ...; + + nitb <- emh [label="MNCC-RELEASE.req [CAUSE, FACILITY, USERUSER]"]; + emh rbox emh [label="19 RELEASE_REQ"]; + nitb rbox nitb [label="CSTATE_RELEASE_REQ"]; + ms <- nitb [label="CC RELEASE"]; + ...; + + ms -> nitb [label="CC RELEASE COMPLETE"]; + nitb -> emh [label="MNCC-RELEASE.cnf [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + ...; + + ms <=> nitb [label="RF Channel Release"]; + ...; + + + + # bridge two voice calls (by call reference) inside NITB +# nitb <- emh [label="MNCC_BRIDGE"]; + +# nitb <- emh [label="MNCC_FRAME_DROP"]; +# nitb <- emh [label="MNCC_FRAME_RECV"]; + + # not implemented so far +# nitb <- emh [label="MNCC_RTP_FREE"]; + + # direct input/output of voice frames via MNCC socket +# nitb <- emh [label="MNCC_TCHF_FRAME, GSM_TCHF_FRAME_EFR, GSM_TCHH_FRAME, GSM_TCH_FRAME_AMR"]; +} diff --git a/common/chapters/nitb_mncc_mo_tch.msc b/common/chapters/nitb_mncc_mo_tch.msc new file mode 100644 index 0000000..0a44a92 --- /dev/null +++ b/common/chapters/nitb_mncc_mo_tch.msc @@ -0,0 +1,92 @@ +# Mobile Originated call handled via OsmoNITB with RTP proxy or E1 BTS # and external MNCC Handler +msc { + hscale="4"; + ms [label="MS"], bts [label="BTS"], nitb [label="OsmoNITB"], emh [label="External MNCC Hdlr"]; + + |||; + ... [label="Mobile Originated call handled via OsmoNITB with RTP proxy or E1 BTS and external MNCC Handler"]; + |||; + --- [label="User on A-side dials a MO call from his phone"]; + ms <=> nitb [label="RF Channel Establishment"]; + ...; + + # MS sends CC SETUP, deliver it to MNCC + ms -> nitb [label="CC SETUP [MSISDN]"]; + nitb rbox nitb [label="CSTATE_INITIATED"]; + nitb -> emh [label="MNCC-SETUP.ind [CALLING, BEARER_CAP, +FACILITY, CALLED, USERUSER, SSVERSION, CCCAP"]; + emh rbox emh [label="1 CALL_INIT"]; + ...; + + nitb <- emh [label="MNCC-CALL-PROC.req [BEARER_CAP, FACILITY, PROGRESS]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + nitb rbox nitb [label="CSTATE_MO_CALL_PROC"]; + ms <- nitb [label="CC CALL PROCEDING"]; + ...; + + # optional + --- [label="Optional PROGRESS, can happen 0-N times"]; + nitb <- emh [label="MNCC-PROGRESS.req [USERUSER]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + ms <- nitb [label="CC PROCEDING"]; + ...; + + # optional + --- [label="Optional; Indicates when B-side is ringing"]; + nitb <- emh [label="MNCC-ALERT.req [FACILITY, PROGRESS, USERUSER]"]; + emh rbox emh [label="4 CALL_DELIVERED"]; + nitb rbox nitb [label="CSTATE_CALL_DELIVERED"]; + ms <- nitb [label="CC ALERTING"]; + ...; + + # ask the BTS to connect its RTP stream to the given IP+PORT + --- [label="Exact time of MNCC_FRAME_RECV is up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_FRAME_RECV[.req]"]; + ms -> nitb [label="TCH Voice Frame (TRAU or RTP)"]; + nitb ->emh [label="{GSM_{TCHF,TCHH}_FRAME,GSM_TCHF_FRAME_EFR,GSM_TCH_FRAME_AMR}"]; + ms -> nitb [label="TCH Voice Frame (TRAU or RTP)"]; + nitb ->emh [label="{GSM_{TCHF,TCHH}_FRAME,GSM_TCHF_FRAME_EFR,GSM_TCH_FRAME_AMR}"]; + ... [label="Unidirectional voice frames continue"]; + + --- [label="User on B-side answers the call"]; + nitb <- emh [label="MNCC-SETUP.rsp [FACILITY, PROGRERSS, CONNETED, USERUSER]"]; + emh rbox emh [label="? CONNECT_INDICATION"]; + nitb rbox nitb [label="CSTATE_CONNECT_IND"]; + ms <- nitb [label="CC CONNECT"]; + ...; + + ms -> nitb [label="TCH Voice Frame (TRAU or RTP)"]; + nitb ->emh [label="{GSM_{TCHF,TCHH}_FRAME,GSM_TCHF_FRAME_EFR,GSM_TCH_FRAME_AMR}"]; + ...; + nitb <- emh [label="{GSM_{TCHF,TCHH}_FRAME,GSM_TCHF_FRAME_EFR,GSM_TCH_FRAME_AMR}"]; + ms <- nitb [label="TCH Voice Frame (TRAU or RTP)"]; + ... [label="Bi-directional voice frames continue"]; + + ms -> nitb [label="CC CONNECT ACK"]; + nitb rbox nitb [label="CSTATE_ACTIVE"]; + nitb -> emh [label="MNCC-SETUP-COMPL.ind"]; + emh rbox emh [label="10 ACTIVE"]; + ...; + ...; + ...; + + --- [label="User on A-side hangs up the call"]; + ms -> nitb [label="CC DISCONNECT"]; + nitb rbox nitb [label="CSTATE_DISCONNET_REQ"]; + nitb -> emh [label="MNCC-DISC.ind [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + emh rbox emh [label="12 DISCONNET_IND"]; + ...; + + nitb <- emh [label="MNCC-RELEASE.req [CAUSE, FACILITY, USERUSER]"]; + emh rbox emh [label="19 RELEASE_REQ"]; + nitb rbox nitb [label="CSTATE_RELEASE_REQ"]; + ms <- nitb [label="CC RELEASE"]; + ...; + + ms -> nitb [label="CC RELEASE COMPLETE"]; + nitb -> emh [label="MNCC-RELEASE.cnf [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + ...; + + ms <=> nitb [label="RF Channel Release"]; + ...; +} -- To view, visit https://gerrit.osmocom.org/3178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida10fc7ccb345b8cd084c4ecc5f4f7d4ce6c98a0 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 Tue Jul 11 17:12:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:12:46 +0000 Subject: osmo-gsm-manuals[master]: Add Message Sequence Chart for MO call with ext. MNCC in Osm... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c249cc2144276a25dba4d7bcb086a34b52d6334 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 Tue Jul 11 17:12:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:12:47 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Add Message Sequence Chart for MO call with ext. MNCC in Osm... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add Message Sequence Chart for MO call with ext. MNCC in OsmoMSC ...................................................................... Add Message Sequence Chart for MO call with ext. MNCC in OsmoMSC We simply talk to the MGW instead of the BTS, everything else should remain identical. Change-Id: I5c249cc2144276a25dba4d7bcb086a34b52d6334 --- A common/chapters/msc_mncc_mo_rtp.msc 1 file changed, 90 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/msc_mncc_mo_rtp.msc b/common/chapters/msc_mncc_mo_rtp.msc new file mode 100644 index 0000000..70197bc --- /dev/null +++ b/common/chapters/msc_mncc_mo_rtp.msc @@ -0,0 +1,90 @@ +msc { + hscale="4"; + ms [label="MS"], mgw [label="MGW"], nitb [label="MSC"], emh [label="External MNCC Hdlr"]; + + |||; + ... [label="Mobile Originated call handled via OsmoMSC, no RTP proxy, IPBTS and external MNCC Handler"]; + |||; + --- [label="User on A-side dials a MO call from his phone"]; + ms <=> nitb [label="RF Channel Establishment"]; + ...; + + # MS sends CC SETUP, deliver it to MNCC + ms -> nitb [label="CC SETUP [MSISDN]"]; + nitb rbox nitb [label="CSTATE_INITIATED"]; + nitb -> emh [label="MNCC-SETUP.ind [CALLING, BEARER_CAP, +FACILITY, CALLED, USERUSER, SSVERSION, CCCAP"]; + emh rbox emh [label="1 CALL_INIT"]; + ...; + + --- [label="Exact time of RTP-CREATE up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_RTP_CREATE[.req]"]; + mgw <- nitb [label="MGCP CRCX"]; + mgw -> nitb [label="MGCP CRCX ACK (MGW-IP, MGW-PORT)"]; + nitb -> emh [label="MNCC_RTP_CREATE[.cnf] (MGW-IP, MGW-PORT)"]; + ...; + + nitb <- emh [label="MNCC-CALL-PROC.req [BEARER_CAP, FACILITY, PROGRESS]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + nitb rbox nitb [label="CSTATE_MO_CALL_PROC"]; + ms <- nitb [label="CC CALL PROCEDING"]; + ...; + + # optional + --- [label="Optional PROGRESS, can happen 0-N times"]; + nitb <- emh [label="MNCC-PROGRESS.req [USERUSER]"]; + emh rbox emh [label="3 MO_CALL_PROC"]; + ms <- nitb [label="CC PROCEDING"]; + ...; + + # optional + --- [label="Optional; Indicates when B-side is ringing"]; + nitb <- emh [label="MNCC-ALERT.req [FACILITY, PROGRESS, USERUSER]"]; + emh rbox emh [label="4 CALL_DELIVERED"]; + nitb rbox nitb [label="CSTATE_CALL_DELIVERED"]; + ms <- nitb [label="CC ALERTING"]; + ...; + + # ask the MGW to connect its RTP stream to the given IP+PORT + --- [label="Exact time of RTP-CONNECT up to Ext MNCC Hdlr"]; + nitb <- emh [label="MNCC_RTP_CONNECT[.req] (EMH-IP, EMH-PORT)"]; + mgw <- nitb [label="MGCP MDCX (EMH-IP, EMH-PORT)"]; + mgw -> nitb [label="MGCP MDCX ACK"]; + nitb -> emh [label="MNCC_RTP_CONNECT[.cnf] (MGW-IP, MGW-PORT)"]; + ...; + + --- [label="User on B-side answers the call"]; + nitb <- emh [label="MNCC-SETUP.rsp [FACILITY, PROGRERSS, CONNETED, USERUSER]"]; + emh rbox emh [label="? CONNECT_INDICATION"]; + nitb rbox nitb [label="CSTATE_CONNECT_IND"]; + ms <- nitb [label="CC CONNECT"]; + ...; + + ms -> nitb [label="CC CONNECT ACK"]; + nitb rbox nitb [label="CSTATE_ACTIVE"]; + nitb -> emh [label="MNCC-SETUP-COMPL.ind"]; + emh rbox emh [label="10 ACTIVE"]; + ...; + ...; + ...; + + --- [label="User on A-side hangs up the call"]; + ms -> nitb [label="CC DISCONNECT"]; + nitb rbox nitb [label="CSTATE_DISCONNET_REQ"]; + nitb -> emh [label="MNCC-DISC.ind [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + emh rbox emh [label="12 DISCONNET_IND"]; + ...; + + nitb <- emh [label="MNCC-RELEASE.req [CAUSE, FACILITY, USERUSER]"]; + emh rbox emh [label="19 RELEASE_REQ"]; + nitb rbox nitb [label="CSTATE_RELEASE_REQ"]; + ms <- nitb [label="CC RELEASE"]; + ...; + + ms -> nitb [label="CC RELEASE COMPLETE"]; + nitb -> emh [label="MNCC-RELEASE.cnf [CAUSE, FACILITY, USERUSER, SSVERSION]"]; + ...; + + ms <=> nitb [label="RF Channel Release"]; + ...; +} -- To view, visit https://gerrit.osmocom.org/3179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c249cc2144276a25dba4d7bcb086a34b52d6334 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 Tue Jul 11 17:13:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:13:21 +0000 Subject: osmo-hlr[master]: Attempt to fix .deb package In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Gerrit-PatchSet: 7 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 11 17:13:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 17:13:22 +0000 Subject: [MERGED] osmo-hlr[master]: Attempt to fix .deb package In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Attempt to fix .deb package ...................................................................... Attempt to fix .deb package After recent switch to legacy python2 .deb fails on OBS. Let's put known-to-work python3 dependency back but keep the script itself on python without version specifier as it seems to work fine with both versions. This, in turn, causes tests to fail on FreeBSD so disable them for now. Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Related: SYS#3322 --- M contrib/jenkins.sh M debian/control M tests/auc/Makefile.am M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 4 files changed, 8 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f2c9cbb..591d6c7 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -31,5 +31,7 @@ autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -$MAKE distcheck || cat-testlogs.sh +if [ "x$label" != "xFreeBSD_amd64" ]; then + $MAKE check || cat-testlogs.sh + $MAKE distcheck || cat-testlogs.sh +fi diff --git a/debian/control b/debian/control index 934abea..571c24e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python2.7, + python3, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/Makefile.am b/tests/auc/Makefile.am index 88532bf..9f2974f 100644 --- a/tests/auc/Makefile.am +++ b/tests/auc/Makefile.am @@ -22,11 +22,9 @@ auc_ts_55_205_test_sets.err \ $(NULL) +check_PROGRAMS = auc_ts_55_205_test_sets -noinst_PROGRAMS = \ - auc_test \ - auc_ts_55_205_test_sets \ - $(NULL) +noinst_PROGRAMS = auc_test auc_test_SOURCES = \ auc_test.c \ diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 3a1c2b1..058113c 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/3177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a87252d411d840fca7362736a8c7877efa6ff52 Gerrit-PatchSet: 7 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jul 11 17:43:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 11 Jul 2017 17:43:05 +0000 Subject: [ABANDON] libosmocore[master]: vty: fix "logging level ... everything" option In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: vty: fix "logging level ... everything" option ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/1582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ib51987fb2f64a70fca130f3799dc8fd71cc7085c Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From admin at opensuse.org Tue Jul 11 19:55:12 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 19:55:12 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59652d296b991_5caec8af78175824e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 270s] -[..] Encoding / Decoding cycle : OK [ 270s] -[..] Encoding / Decoding cycle : OK [ 270s] -[..] Encoding / Decoding cycle : OK [ 270s] - [ 270s] -[+] Testing: gsm0503_mcs9 [ 270s] -[.] Input length : ret = 606 exp = 606 -> OK [ 270s] -[.] Output length : ret = 1836 exp = 1836 -> OK [ 270s] -[.] Random vector checks: [ 270s] -[..] Encoding / Decoding cycle : OK [ 270s] -[..] Encoding / Decoding cycle : OK [ 270s] -[..] Encoding / Decoding cycle : OK [ 270s] - [ 270s] ./testsuite.at:57: exit code was 132, expected 0 [ 270s] 9. testsuite.at:54: 9. conv_gsm0503 (testsuite.at:54): FAILED (testsuite.at:57) [ 270s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 270s] make[1]: *** [override_dh_auto_test] Error 1 [ 270s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 270s] debian/rules:15: recipe for target 'build' failed [ 270s] make: *** [build] Error 2 [ 270s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 270s] [ 270s] build35 failed "build libosmocore_0.9.6.20170711.dsc" at Tue Jul 11 19:54:59 UTC 2017. [ 270s] [ 270s] ### VM INTERACTION START ### [ 273s] [ 255.108227] reboot: Power down [ 275s] ### VM INTERACTION END ### [ 275s] [ 275s] build35 failed "build libosmocore_0.9.6.20170711.dsc" at Tue Jul 11 19:55:05 UTC 2017. [ 275s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 19:58:04 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 19:58:04 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59652ddcf389e_5caec8af7817598fd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 435s] | [ 435s] | This file was extended by libosmocore config.status 0.9.6.20170711, which was [ 435s] | generated by GNU Autoconf 2.69. Invocation command line was [ 435s] | [ 435s] | CONFIG_FILES = [ 435s] | CONFIG_HEADERS = [ 435s] | CONFIG_LINKS = [ 435s] | CONFIG_COMMANDS = [ 435s] | $ ./config.status Doxyfile.core [ 435s] | [ 435s] | on build33 [ 435s] | [ 435s] | config.status:1171: creating Doxyfile.core [ 435s] [ 435s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 435s] make[1]: *** [override_dh_auto_test] Error 1 [ 435s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 435s] debian/rules:15: recipe for target 'build' failed [ 435s] make: *** [build] Error 2 [ 435s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 435s] [ 435s] build33 failed "build libosmocore_0.9.6.20170711.dsc" at Tue Jul 11 19:57:51 UTC 2017. [ 435s] [ 435s] ### VM INTERACTION START ### [ 438s] [ 415.412831] reboot: Power down [ 439s] ### VM INTERACTION END ### [ 439s] [ 439s] build33 failed "build libosmocore_0.9.6.20170711.dsc" at Tue Jul 11 19:57:55 UTC 2017. [ 439s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:06:38 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:06:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59652fda54e68_5caec8af781761810@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 116s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 116s] Makefile:671: recipe for target 'check-am' failed [ 116s] make[5]: *** [check-am] Error 2 [ 116s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 116s] Makefile:523: recipe for target 'check-recursive' failed [ 116s] make[4]: *** [check-recursive] Error 1 [ 116s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 116s] Makefile:382: recipe for target 'check-recursive' failed [ 116s] make[3]: *** [check-recursive] Error 1 [ 116s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 116s] Makefile:405: recipe for target 'check-recursive' failed [ 116s] make[2]: *** [check-recursive] Error 1 [ 116s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 116s] Makefile:696: recipe for target 'check' failed [ 116s] make[1]: *** [check] Error 2 [ 116s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 116s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 116s] debian/rules:7: recipe for target 'build' failed [ 116s] make: *** [build] Error 2 [ 116s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 116s] [ 116s] lamb12 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:06:25 UTC 2017. [ 116s] [ 116s] ### VM INTERACTION START ### [ 119s] [ 104.252487] reboot: Power down [ 119s] ### VM INTERACTION END ### [ 119s] [ 119s] lamb12 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:06:29 UTC 2017. [ 119s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:06:38 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:06:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59652fdaa67a9_5caec8af7817619fb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 114s] Makefile:660: recipe for target 'check-am' failed [ 114s] make[5]: *** [check-am] Error 2 [ 114s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 114s] Makefile:512: recipe for target 'check-recursive' failed [ 114s] make[4]: *** [check-recursive] Error 1 [ 114s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 114s] Makefile:370: recipe for target 'check-recursive' failed [ 114s] make[3]: *** [check-recursive] Error 1 [ 114s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 114s] Makefile:393: recipe for target 'check-recursive' failed [ 114s] make[2]: *** [check-recursive] Error 1 [ 114s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 114s] Makefile:684: recipe for target 'check' failed [ 114s] make[1]: *** [check] Error 2 [ 114s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 114s] dh_auto_test: make -j1 check returned exit code 2 [ 114s] debian/rules:7: recipe for target 'build' failed [ 114s] make: *** [build] Error 2 [ 114s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 114s] [ 114s] lamb66 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:06:29 UTC 2017. [ 114s] [ 114s] ### VM INTERACTION START ### [ 115s] Powering off. [ 115s] [ 101.838909] reboot: Power down [ 115s] ### VM INTERACTION END ### [ 115s] [ 115s] lamb66 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:06:31 UTC 2017. [ 115s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:06:55 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:06:55 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59652ff551e0a_5caec8af781762263@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 119s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 119s] Makefile:671: recipe for target 'check-am' failed [ 119s] make[5]: *** [check-am] Error 2 [ 119s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 119s] Makefile:523: recipe for target 'check-recursive' failed [ 119s] make[4]: *** [check-recursive] Error 1 [ 119s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 119s] Makefile:382: recipe for target 'check-recursive' failed [ 119s] make[3]: *** [check-recursive] Error 1 [ 119s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 119s] Makefile:405: recipe for target 'check-recursive' failed [ 119s] make[2]: *** [check-recursive] Error 1 [ 119s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 119s] Makefile:696: recipe for target 'check' failed [ 119s] make[1]: *** [check] Error 2 [ 119s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 119s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 119s] debian/rules:7: recipe for target 'build' failed [ 119s] make: *** [build] Error 2 [ 119s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 119s] [ 119s] lamb70 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:06:34 UTC 2017. [ 119s] [ 119s] ### VM INTERACTION START ### [ 123s] [ 108.872489] reboot: Power down [ 123s] ### VM INTERACTION END ### [ 123s] [ 123s] lamb70 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:06:38 UTC 2017. [ 123s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:07:47 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:07:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5965301751d2c_5caec8af78176244b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 140s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 140s] Makefile:671: recipe for target 'check-am' failed [ 140s] make[5]: *** [check-am] Error 2 [ 140s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 140s] Makefile:523: recipe for target 'check-recursive' failed [ 140s] make[4]: *** [check-recursive] Error 1 [ 140s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 140s] Makefile:382: recipe for target 'check-recursive' failed [ 140s] make[3]: *** [check-recursive] Error 1 [ 140s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 140s] Makefile:405: recipe for target 'check-recursive' failed [ 140s] make[2]: *** [check-recursive] Error 1 [ 140s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 140s] Makefile:696: recipe for target 'check' failed [ 140s] make[1]: *** [check] Error 2 [ 140s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 140s] dh_auto_test: make -j1 check returned exit code 2 [ 140s] debian/rules:7: recipe for target 'build' failed [ 140s] make: *** [build] Error 2 [ 140s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 140s] [ 140s] lamb54 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:07:29 UTC 2017. [ 140s] [ 140s] ### VM INTERACTION START ### [ 143s] [ 129.739165] reboot: Power down [ 143s] ### VM INTERACTION END ### [ 143s] [ 143s] lamb54 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:07:32 UTC 2017. [ 143s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:08:04 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:08:04 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5965303171820_5caec8af781762572@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 171s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 171s] Makefile:671: recipe for target 'check-am' failed [ 171s] make[5]: *** [check-am] Error 2 [ 171s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 171s] Makefile:523: recipe for target 'check-recursive' failed [ 171s] make[4]: *** [check-recursive] Error 1 [ 171s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 171s] Makefile:382: recipe for target 'check-recursive' failed [ 171s] make[3]: *** [check-recursive] Error 1 [ 171s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 171s] Makefile:405: recipe for target 'check-recursive' failed [ 171s] make[2]: *** [check-recursive] Error 1 [ 171s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 171s] Makefile:696: recipe for target 'check' failed [ 171s] make[1]: *** [check] Error 2 [ 171s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 171s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 171s] debian/rules:7: recipe for target 'build' failed [ 171s] make: *** [build] Error 2 [ 171s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 171s] [ 171s] wildcard2 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:07:44 UTC 2017. [ 171s] [ 171s] ### VM INTERACTION START ### [ 174s] [ 135.137412] reboot: Power down [ 176s] ### VM INTERACTION END ### [ 177s] [ 177s] wildcard2 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:07:50 UTC 2017. [ 177s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:08:55 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:08:55 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5965306def354_5caec8af7817630c6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 83s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 83s] Makefile:671: recipe for target 'check-am' failed [ 83s] make[5]: *** [check-am] Error 2 [ 83s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 83s] Makefile:523: recipe for target 'check-recursive' failed [ 83s] make[4]: *** [check-recursive] Error 1 [ 83s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 83s] Makefile:382: recipe for target 'check-recursive' failed [ 83s] make[3]: *** [check-recursive] Error 1 [ 83s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 83s] Makefile:405: recipe for target 'check-recursive' failed [ 83s] make[2]: *** [check-recursive] Error 1 [ 83s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 83s] Makefile:696: recipe for target 'check' failed [ 83s] make[1]: *** [check] Error 2 [ 83s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 83s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 83s] debian/rules:7: recipe for target 'build' failed [ 83s] make: *** [build] Error 2 [ 83s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 83s] [ 83s] lamb16 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:08:40 UTC 2017. [ 83s] [ 83s] ### VM INTERACTION START ### [ 86s] [ 73.100561] reboot: Power down [ 86s] ### VM INTERACTION END ### [ 86s] [ 86s] lamb16 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:08:44 UTC 2017. [ 86s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:09:12 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:09:12 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5965306eddbb1_5caec8af7817631e0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 107s] Makefile:660: recipe for target 'check-am' failed [ 107s] make[5]: *** [check-am] Error 2 [ 107s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 107s] Makefile:512: recipe for target 'check-recursive' failed [ 107s] make[4]: *** [check-recursive] Error 1 [ 107s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 107s] Makefile:370: recipe for target 'check-recursive' failed [ 107s] make[3]: *** [check-recursive] Error 1 [ 107s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 107s] Makefile:393: recipe for target 'check-recursive' failed [ 107s] make[2]: *** [check-recursive] Error 1 [ 107s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 107s] Makefile:684: recipe for target 'check' failed [ 107s] make[1]: *** [check] Error 2 [ 107s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 107s] dh_auto_test: make -j1 check returned exit code 2 [ 107s] debian/rules:7: recipe for target 'build' failed [ 107s] make: *** [build] Error 2 [ 107s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 107s] [ 107s] lamb18 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:08:58 UTC 2017. [ 107s] [ 107s] ### VM INTERACTION START ### [ 108s] Powering off. [ 108s] [ 95.110836] reboot: Power down [ 108s] ### VM INTERACTION END ### [ 108s] [ 108s] lamb18 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:08:59 UTC 2017. [ 108s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:09:12 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:09:12 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5965306fcc1b4_5caec8af7817632df@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 84s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:671: recipe for target 'check-am' failed [ 84s] make[5]: *** [check-am] Error 2 [ 84s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:523: recipe for target 'check-recursive' failed [ 84s] make[4]: *** [check-recursive] Error 1 [ 84s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:382: recipe for target 'check-recursive' failed [ 84s] make[3]: *** [check-recursive] Error 1 [ 84s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 84s] Makefile:405: recipe for target 'check-recursive' failed [ 84s] make[2]: *** [check-recursive] Error 1 [ 84s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 84s] Makefile:696: recipe for target 'check' failed [ 84s] make[1]: *** [check] Error 2 [ 84s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 84s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 84s] debian/rules:7: recipe for target 'build' failed [ 84s] make: *** [build] Error 2 [ 84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 84s] [ 84s] lamb11 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:09:07 UTC 2017. [ 84s] [ 84s] ### VM INTERACTION START ### [ 87s] [ 74.785187] reboot: Power down [ 88s] ### VM INTERACTION END ### [ 88s] [ 88s] lamb11 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:09:11 UTC 2017. [ 88s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:12:03 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:12:03 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59653122676d1_5caec8af781764160@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 181s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 181s] Makefile:671: recipe for target 'check-am' failed [ 181s] make[5]: *** [check-am] Error 2 [ 181s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 181s] Makefile:523: recipe for target 'check-recursive' failed [ 181s] make[4]: *** [check-recursive] Error 1 [ 181s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 181s] Makefile:382: recipe for target 'check-recursive' failed [ 181s] make[3]: *** [check-recursive] Error 1 [ 181s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 181s] Makefile:405: recipe for target 'check-recursive' failed [ 181s] make[2]: *** [check-recursive] Error 1 [ 181s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 181s] Makefile:696: recipe for target 'check' failed [ 181s] make[1]: *** [check] Error 2 [ 181s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 181s] dh_auto_test: make -j1 check returned exit code 2 [ 181s] debian/rules:7: recipe for target 'build' failed [ 181s] make: *** [build] Error 2 [ 181s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 181s] [ 181s] lamb55 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:11:50 UTC 2017. [ 181s] [ 181s] ### VM INTERACTION START ### [ 184s] [ 170.622197] reboot: Power down [ 184s] ### VM INTERACTION END ### [ 184s] [ 184s] lamb55 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:11:54 UTC 2017. [ 184s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 11 20:17:46 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 11 Jul 2017 20:17:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5965326f6318f_5caec8af7817651b9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 88s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 88s] Makefile:671: recipe for target 'check-am' failed [ 88s] make[5]: *** [check-am] Error 2 [ 88s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 88s] Makefile:523: recipe for target 'check-recursive' failed [ 88s] make[4]: *** [check-recursive] Error 1 [ 88s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 88s] Makefile:382: recipe for target 'check-recursive' failed [ 88s] make[3]: *** [check-recursive] Error 1 [ 88s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 88s] Makefile:405: recipe for target 'check-recursive' failed [ 88s] make[2]: *** [check-recursive] Error 1 [ 88s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 88s] Makefile:696: recipe for target 'check' failed [ 88s] make[1]: *** [check] Error 2 [ 88s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 88s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 88s] debian/rules:7: recipe for target 'build' failed [ 88s] make: *** [build] Error 2 [ 88s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 88s] [ 88s] lamb23 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:17:38 UTC 2017. [ 88s] [ 88s] ### VM INTERACTION START ### [ 91s] [ 78.915179] reboot: Power down [ 91s] ### VM INTERACTION END ### [ 91s] [ 91s] lamb23 failed "build osmo-hlr_0.0.1.20170711.dsc" at Tue Jul 11 20:17:42 UTC 2017. [ 91s] -- 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 Jul 11 22:42:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 22:42:58 +0000 Subject: [PATCH] libosmo-abis[master]: check for missing result of rate_ctr_group_alloc() Message-ID: Review at https://gerrit.osmocom.org/3182 check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. Change-Id: Iff8506832d3472ab193b19b43cfbe7a9511075d1 Related: OS#2361 --- M src/e1_input.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/82/3182/1 diff --git a/src/e1_input.c b/src/e1_input.c index 40e36b4..3cf810f 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -364,6 +364,11 @@ line->num = e1_nr; line->rate_ctr = rate_ctr_group_alloc(line, &e1inp_ctr_g_d, line->num); + if (!line->rate_ctr) { + LOGP(DLINP, LOGL_ERROR, "Cannot allocate counter group\n"); + talloc_free(line); + return NULL; + } line->num_ts = NUM_E1_TS; for (i = 0; i < line->num_ts; i++) { -- To view, visit https://gerrit.osmocom.org/3182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff8506832d3472ab193b19b43cfbe7a9511075d1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jul 11 22:47:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 22:47:23 +0000 Subject: [PATCH] osmo-pcu[master]: check for missing result of rate_ctr_group_alloc() Message-ID: Review at https://gerrit.osmocom.org/3183 check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. Change-Id: Id6d780c67b4af15aaa5c6f2b8b00f2a0b70a7385 Related: OS#2361 --- M src/bts.cpp M src/tbf.cpp 2 files changed, 26 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/83/3183/1 diff --git a/src/bts.cpp b/src/bts.cpp index 5192646..2d289d7 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -207,7 +207,9 @@ } m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); + OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); + OSMO_ASSERT(m_statg); } BTS::~BTS() diff --git a/src/tbf.cpp b/src/tbf.cpp index 48e8289..bbed29c 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -760,6 +760,10 @@ tbf->name(), tbf->trx->trx_no, tbf->ul_slots(), tbf->dl_slots()); tbf->m_ctrs = rate_ctr_group_alloc(tbf, &tbf_ctrg_desc, 0); + if (!tbf->m_ctrs) { + LOGP(DRLCMAC, LOGL_ERROR, "Couldn't allocate TBF counters\n"); + return -1; + } return 0; } @@ -844,6 +848,11 @@ tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_egprs_ctrg_desc, 0); tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_gprs_ctrg_desc, 0); + if (!tbf->m_ul_egprs_ctrs || !tbf->m_ul_gprs_ctrs) { + LOGP(DRLCMAC, LOGL_ERROR, "Couldn't allocate TBF UL counters\n"); + talloc_free(tbf); + return NULL; + } llist_add(&tbf->list(), &bts->bts->ul_tbfs()); tbf->bts->tbf_ul_created(); @@ -930,8 +939,18 @@ if (tbf->is_egprs_enabled()) { tbf->egprs_calc_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"); + talloc_free(tbf); + return NULL; + } } else { tbf->m_dl_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_gprs_ctrg_desc, 0); + if (!tbf->m_dl_gprs_ctrs) { + LOGP(DRLCMAC, LOGL_ERROR, "Couldn't allocate GPRS DL counters\n"); + talloc_free(tbf); + return NULL; + } } llist_add(&tbf->list(), &bts->bts->dl_tbfs()); @@ -1439,6 +1458,11 @@ &tbf_ul_egprs_ctrg_desc, 0); ul_tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ul_gprs_ctrg_desc, 0); + if (!ul_tbf->m_ctrs || !ul_tbf->m_ul_egprs_ctrs || !ul_tbf->m_ul_gprs_ctrs) { + LOGP(DRLCMAC, LOGL_ERROR, "Cound not allocate TBF UL rate counters\n"); + talloc_free(ul_tbf); + return NULL; + } return ul_tbf; } -- To view, visit https://gerrit.osmocom.org/3183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6d780c67b4af15aaa5c6f2b8b00f2a0b70a7385 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jul 11 22:48:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 11 Jul 2017 22:48:00 +0000 Subject: [PATCH] openbsc[master]: check for missing result of rate_ctr_group_alloc() Message-ID: Review at https://gerrit.osmocom.org/3184 check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. RelateD: OS#2361 Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 --- M openbsc/src/gprs/gb_proxy.c M openbsc/src/gprs/gb_proxy_peer.c M openbsc/src/gprs/gprs_sgsn.c M openbsc/src/libbsc/net_init.c M openbsc/src/libcommon-cs/common_cs.c 5 files changed, 32 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/84/3184/1 diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index d95139f..3603e14 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -1431,6 +1431,10 @@ INIT_LLIST_HEAD(&cfg->bts_peers); cfg->ctrg = rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0); + if (!cfg->ctrg) { + LOGP(DGPRS, LOGL_ERROR, "Cannot allocate global counter group!\n"); + return -1; + } clock_gettime(CLOCK_REALTIME, &tp); return 0; diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/openbsc/src/gprs/gb_proxy_peer.c index 5365ff0..8909687 100644 --- a/openbsc/src/gprs/gb_proxy_peer.c +++ b/openbsc/src/gprs/gb_proxy_peer.c @@ -177,6 +177,10 @@ peer->bvci = bvci; peer->ctrg = rate_ctr_group_alloc(peer, &peer_ctrg_desc, bvci); + if (!peer->ctrg) { + talloc_free(peer); + return NULL; + } peer->cfg = cfg; llist_add(&peer->list, &cfg->bts_peers); diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index fbea5b9..3c363bc 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -129,6 +129,7 @@ void sgsn_rate_ctr_init() { sgsn->rate_ctrs = rate_ctr_group_alloc(tall_bsc_ctx, &sgsn_ctrg_desc, 0); + OSMO_ASSERT(sgsn->rate_ctrs); } /* look-up an SGSN MM context based on Iu UE context (struct ue_conn_ctx)*/ @@ -229,6 +230,11 @@ LOGMMCTXP(LOGL_DEBUG, ctx, "Allocated with %s cipher.\n", get_value_string(gprs_cipher_names, ctx->ciph_algo)); ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, tlli); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } INIT_LLIST_HEAD(&ctx->pdp_list); llist_add(&ctx->list, &sgsn_mm_ctxts); @@ -252,6 +258,11 @@ ctx->pmm_state = PMM_DETACHED; ctx->auth_triplet.key_seq = GSM_KEY_SEQ_INVAL; ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, 0); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } /* Need to get RAID from IU conn */ ctx->ra = ctx->iu.ue_ctx->ra_id; @@ -379,6 +390,11 @@ pdp->mm = mm; pdp->nsapi = nsapi; pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi); + if (!pdp->ctrg) { + LOGPDPCTXP(LOGL_ERROR, pdp, "Error allocation counter group\n"); + talloc_free(pdp); + return NULL; + } llist_add(&pdp->list, &mm->pdp_list); llist_add(&pdp->g_list, &sgsn_pdp_ctxts); diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index bc5ed35..4dfc258 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -61,6 +61,10 @@ /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); + if (!net->bsc_ctrs) { + talloc_free(net); + return NULL; + } gsm_net_update_ctype(net); diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 7905802..d299427 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -75,6 +75,10 @@ /* init statistics */ net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); + if (!net->msc_ctrs) { + talloc_free(net); + return NULL; + } net->active_calls = osmo_counter_alloc("msc.active_calls"); net->mncc_recv = mncc_recv; -- To view, visit https://gerrit.osmocom.org/3184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jul 11 23:42:57 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 11 Jul 2017 23:42:57 +0000 Subject: openbsc[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 11 23:45:04 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 11 Jul 2017 23:45:04 +0000 Subject: osmo-pcu[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6d780c67b4af15aaa5c6f2b8b00f2a0b70a7385 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 11 23:47:12 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 11 Jul 2017 23:47:12 +0000 Subject: libosmo-abis[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff8506832d3472ab193b19b43cfbe7a9511075d1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 11 23:53:56 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 11 Jul 2017 23:53:56 +0000 Subject: libosmocore[master]: add DLMGCP logging category for libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09c587e2d59472cbde852d467d457254746d9e67 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Wed Jul 12 05:12:42 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 12 Jul 2017 05:12:42 +0000 Subject: [PATCH] openbsc[master]: libcommon: Fix log output for bts>0. Message-ID: Review at https://gerrit.osmocom.org/3185 libcommon: Fix log output for bts>0. Fixes regression probably introduced in c696cc28. For bts>0 logging doesn't show bts number correctly when printing lchan identification string - it will always show it as "bts=0". The reason for this is that the identification string is cached before bts->nr value is set to a proper value. This patch sets bts->nr as part of the first step of the bts structure initialization, before caching happens thus making sure the cached identification string is cached with the correct values. Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libcommon/gsm_data.c M openbsc/src/libcommon/gsm_data_shared.c M openbsc/tests/channel/channel_test.c M openbsc/tests/gsm0408/gsm0408_test.c 5 files changed, 11 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/85/3185/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 4c71a07..369668d 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -900,7 +900,7 @@ }; -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx); +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); diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index db7de08..f1049e9 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -286,12 +286,13 @@ if (!model && type != GSM_BTS_TYPE_UNKNOWN) return NULL; - bts = gsm_bts_alloc(net); + bts = gsm_bts_alloc(net, net->num_bts); if (!bts) return NULL; + net->num_bts++; + bts->network = net; - bts->nr = net->num_bts++; bts->type = type; bts->model = model; bts->bsic = bsic; diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 8992636..d792f3b 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -312,7 +312,7 @@ .initial_mcs = 6, }; -struct gsm_bts *gsm_bts_alloc(void *ctx) +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) { struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); int i; @@ -320,6 +320,7 @@ if (!bts) return NULL; + bts->nr = bts_num; bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); bts->ms_max_power = 15; /* dBm */ diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 88293d0..77a9da1 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -70,7 +70,7 @@ network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->location_area_code = 23; s_conn.network = network; diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 5a8c6ca..17ca5bb 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -153,7 +153,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 319, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -168,7 +168,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 318, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -188,7 +188,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); @@ -216,7 +216,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jul 12 05:18:34 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 12 Jul 2017 05:18:34 +0000 Subject: openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Patch Set 1: Btw, Harald - any reason we're caching lchan log string, but doesn't cache pchan log string? -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 05:21:35 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 12 Jul 2017 05:21:35 +0000 Subject: [PATCH] openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3185 to look at the new patch set (#2). libcommon: Fix log output for bts>0. Fixes regression probably introduced in c696cc28. For bts>0 logging doesn't show bts number correctly when printing lchan identification string - it will always show it as "bts=0". The reason for this is that the identification string is cached before bts->nr value is set to a proper value. This patch sets bts->nr as part of the first step of the bts structure initialization, before caching happens thus making sure the cached identification string is cached with the correct values. Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libcommon/gsm_data.c M openbsc/src/libcommon/gsm_data_shared.c M openbsc/tests/channel/channel_test.c M openbsc/tests/gsm0408/gsm0408_test.c 5 files changed, 12 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/85/3185/2 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 4c71a07..369668d 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -900,7 +900,7 @@ }; -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx); +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); diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index db7de08..f1049e9 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -286,12 +286,13 @@ if (!model && type != GSM_BTS_TYPE_UNKNOWN) return NULL; - bts = gsm_bts_alloc(net); + bts = gsm_bts_alloc(net, net->num_bts); if (!bts) return NULL; + net->num_bts++; + bts->network = net; - bts->nr = net->num_bts++; bts->type = type; bts->model = model; bts->bsic = bsic; diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 8992636..d792f3b 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -312,7 +312,7 @@ .initial_mcs = 6, }; -struct gsm_bts *gsm_bts_alloc(void *ctx) +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) { struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); int i; @@ -320,6 +320,7 @@ if (!bts) return NULL; + bts->nr = bts_num; bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); bts->ms_max_power = 15; /* dBm */ diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 88293d0..77a9da1 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -70,7 +70,7 @@ network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->location_area_code = 23; s_conn.network = network; diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 5a8c6ca..63b5c7c 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -153,7 +153,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 319, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -168,7 +168,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 318, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -188,7 +188,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); @@ -216,7 +216,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; @@ -249,7 +249,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 08:41:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 12 Jul 2017 08:41:04 +0000 Subject: [PATCH] osmo-hlr[master]: deb: use python in shebang Message-ID: Review at https://gerrit.osmocom.org/3186 deb: use python in shebang This should fix the .deb build on OBS. Change-Id: I095e5c273e30a6e124833bf58b231c6367ab48d6 --- M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/86/3186/1 diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 058113c..acc0f7d 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,5 +1,5 @@ -#!/usr/bin/env python - +#!/usr/bin/python +# FIXME: use python3 once buildslaves are updated. # Convert test sets pasted from 3GPP TS 55.205 to C code. # (C) 2016 by sysmocom s.f.m.c. GmbH -- To view, visit https://gerrit.osmocom.org/3186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I095e5c273e30a6e124833bf58b231c6367ab48d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jul 12 08:47:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 12 Jul 2017 08:47:48 +0000 Subject: openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris 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 Jul 12 09:26:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 09:26:32 +0000 Subject: openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) > Btw, Harald - any reason we're caching lchan log string, but > doesn't cache pchan log string? We don't print pchan names anywhere nearly as frequently as lchan names. Have you seen the pchan name printing show up in any profiles? We can certainly add it if needed. https://gerrit.osmocom.org/#/c/3185/2/openbsc/tests/channel/channel_test.c File openbsc/tests/channel/channel_test.c: Line 73: bts = gsm_bts_alloc(network, 0); actually, as you're modifying the test case, it would make a lot of sense to extend it to cover the actual situation with multiple BTSs and verifyng that the string contains the right BTS number. -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 12 12:16:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 12:16:25 +0000 Subject: [PATCH] osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client* Message-ID: Review at https://gerrit.osmocom.org/3187 move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client* To help split openbsc.git to separate MSC and SGSN repositories, place the common Iu interface related code here in libosmo-ranap. The code depends on libosmo-ranap tightly. One reason to want this separate from libosmo-ranap could be that it uses libosmo-sigtran, accepting an sccp instance. However, including in libosmo-ranap is the simplest way to go. The osmo-iuh build depends on libosmo-sigtran anyway because of OsmoHNBGW, and all current users of libosmo-ranap also naturally link libosmo-sigtran already. Apply prefix ranap_iu_ and RANAP_IU_ to allow smooth transition from the openbsc.git iu_ to the libranap ranap_iu_ implementations. Prune unneeded #include statements. In iu_client_vty.c, remove the legacy "net." from a VTY error message, it is not known which name the parent node of 'iu' has. Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 --- M include/osmocom/ranap/Makefile.am A include/osmocom/ranap/iu_client.h M src/Makefile.am A src/iu_client.c A src/iu_client_vty.c 5 files changed, 966 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/87/3187/1 diff --git a/include/osmocom/ranap/Makefile.am b/include/osmocom/ranap/Makefile.am index 0f83e03..1606928 100644 --- a/include/osmocom/ranap/Makefile.am +++ b/include/osmocom/ranap/Makefile.am @@ -12,6 +12,7 @@ ranap_common_cn.h \ ranap_msg_factory.h \ iu_helpers.h \ + iu_client.h \ RANAP_AccuracyFulfilmentIndicator.h \ RANAP_AllocationOrRetentionPriority.h \ RANAP_AlternativeRABConfigurationRequest.h \ diff --git a/include/osmocom/ranap/iu_client.h b/include/osmocom/ranap/iu_client.h new file mode 100644 index 0000000..fd3ccf3 --- /dev/null +++ b/include/osmocom/ranap/iu_client.h @@ -0,0 +1,81 @@ +#pragma once + +#include + +#include +#include +#include + +struct msgb; +struct osmo_auth_vector; + +struct RANAP_RAB_SetupOrModifiedItemIEs_s; +struct RANAP_Cause; + +/* Debugging switches from asn1c and osmo-iuh */ +extern int asn_debug; +extern int asn1_xer_print; + +enum ranap_nsap_addr_enc { + RANAP_NSAP_ADDR_ENC_X213, + RANAP_NSAP_ADDR_ENC_V4RAW, +}; + +struct ranap_ue_conn_ctx { + struct llist_head list; + /* TODO: It's not needed to store the full SCCP address for each + * UE. Rather than that, a pointer to the RNC should be far + * sufficient */ + struct osmo_sccp_addr sccp_addr; + uint32_t conn_id; + int integrity_active; + struct gprs_ra_id ra_id; + enum ranap_nsap_addr_enc rab_assign_addr_enc; +}; + +enum ranap_iu_event_type { + RANAP_IU_EVENT_RAB_ASSIGN, + RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, + RANAP_IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ + RANAP_IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ + /* FIXME: maybe RANAP_IU_EVENT_IU_RELEASE and RANAP_IU_EVENT_LINK_INVALIDATED + * should be combined to one generic event that simply means the + * ranap_ue_conn_ctx should no longer be used, for whatever reason. */ +}; + +extern const struct value_string ranap_iu_event_type_names[]; +static inline const char *ranap_iu_event_type_str(enum ranap_iu_event_type e) +{ + return get_value_string(ranap_iu_event_type_names, e); +} + +/* Implementations of iu_recv_cb_t shall find the ranap_ue_conn_ctx in msg->dst. */ +typedef int (* ranap_iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, + /* TODO "gprs_" in generic CS+PS domain ^ */ + uint16_t *sai); + +typedef int (* ranap_iu_event_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, + enum ranap_iu_event_type type, void *data); + +typedef int (* ranap_iu_rab_ass_resp_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id, + struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb); + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc); +int ranap_iu_vty_config_write(struct vty *vty, const char *indent); + +struct ranap_ue_conn_ctx *ranap_ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id); diff --git a/src/Makefile.am b/src/Makefile.am index bb1ebbd..48918b0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,7 +54,7 @@ libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \ - ranap_common_cn.c + ranap_common_cn.c iu_client.c iu_client_vty.c # build the actual HomeNodeB gateway # diff --git a/src/iu_client.c b/src/iu_client.c new file mode 100644 index 0000000..9e472ea --- /dev/null +++ b/src/iu_client.c @@ -0,0 +1,753 @@ +/* Common parts of IuCS and IuPS interfaces implementation */ + +/* (C) 2016-2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the + * PLMN identity is a BCD representation of the MCC and MNC. + * See iu_grnc_id_parse(). */ +struct iu_grnc_id { + uint16_t mcc; + uint16_t mnc; + uint16_t rnc_id; +}; + +/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has + * called us and is currently reachable at the given osmo_sccp_addr. So, when we + * know a LAC for a subscriber, we can page it at the RNC matching that LAC or + * RAC. An HNB-GW typically presents itself as if it were a single RNC, even + * though it may have several RNCs in hNodeBs connected to it. Those will then + * share the same RNC id, which they actually receive and adopt from the HNB-GW + * in the HNBAP HNB REGISTER ACCEPT message. */ +struct iu_rnc { + struct llist_head entry; + + uint16_t rnc_id; + uint16_t lac; /* Location Area Code (used for CS and PS) */ + uint8_t rac; /* Routing Area Code (used for PS only) */ + struct osmo_sccp_addr sccp_addr; +}; + +void *talloc_iu_ctx; + +/* Implement the extern asn_debug from libasn1c to indicate whether to print + * asn.1 debug messages (see libasn1c). */ +int asn_debug = 0; + +/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary + * code decoded and encoded during Iu communication should be logged to stderr + * (see asn.1 generated code in osmo-iuh). */ +int asn1_xer_print = 0; + +void *talloc_asn1_ctx; + +ranap_iu_recv_cb_t global_iu_recv_cb = NULL; +ranap_iu_event_cb_t global_iu_event_cb = NULL; +int iu_log_subsystem = 0; + +#define LOGPIU(level, fmt, args...) \ + LOGP(iu_log_subsystem, level, fmt, ## args) + +static LLIST_HEAD(ue_conn_ctx_list); +static LLIST_HEAD(rnc_list); + +static struct osmo_sccp_instance *g_sccp; +static struct osmo_sccp_user *g_scu; + +const struct value_string ranap_iu_event_type_names[] = { + OSMO_VALUE_STRING(RANAP_IU_EVENT_RAB_ASSIGN), + OSMO_VALUE_STRING(RANAP_IU_EVENT_SECURITY_MODE_COMPLETE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_IU_RELEASE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_LINK_INVALIDATED), + { 0, NULL } +}; + +struct ranap_ue_conn_ctx *ranap_ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ranap_ue_conn_ctx); + + ctx->sccp_addr = *addr; + ctx->conn_id = conn_id; + llist_add(&ctx->list, &ue_conn_ctx_list); + + return ctx; +} + +static struct ranap_ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx; + + llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { + if (ctx->conn_id == conn_id) + return ctx; + } + return NULL; +} + +static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, + struct osmo_sccp_addr *addr) +{ + struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); + + rnc->rnc_id = rnc_id; + rnc->lac = lac; + rnc->rac = rac; + rnc->sccp_addr = *addr; + llist_add(&rnc->entry, &rnc_list); + + LOGPIU(LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + + return rnc; +} + +static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, + uint8_t rac, struct osmo_sccp_addr *addr) +{ + struct iu_rnc *rnc; + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->rnc_id != rnc_id) + continue; + + /* We have this RNC Id registered already. Make sure that the + * details match. */ + + /* TODO should a mismatch be an error? */ + if (rnc->lac != lac || rnc->rac != rac) + LOGPIU(LOGL_NOTICE, "RNC %d changes its details:" + " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", + rnc->rnc_id, rnc->lac, rnc->rac, + lac, rac); + rnc->lac = lac; + rnc->rac = rac; + + if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) + LOGPIU(LOGL_NOTICE, "RNC %d on New SCCP Addr %s" + " (LAC=%d RAC=%d)\n", + rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); + rnc->sccp_addr = *addr; + return rnc; + } + + /* Not found, make a new one. */ + return iu_rnc_alloc(rnc_id, lac, rac, addr); +} + +/*********************************************************************** + * RANAP handling + ***********************************************************************/ + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) +{ + struct osmo_scu_prim *prim; + + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ue_ctx->conn_id; + osmo_prim_init(&prim->oph, + SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, + msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id) +{ + /* FIXME */ + return -1; +} + +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key) +{ + struct osmo_scu_prim *prim; + struct msgb *msg; + + /* create RANAP message */ + msg = ranap_new_msg_sec_mod_cmd(vec->ik, send_ck? vec->ck : NULL, + new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg->l2h = msg->data; + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + + return 0; +} + +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_common_id(imsi); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +static int iu_grnc_id_parse(struct iu_grnc_id *dst, + struct RANAP_GlobalRNC_ID *src) +{ + /* The size is coming from arbitrary sender, check it gracefully */ + if (src->pLMNidentity.size != 3) { + LOGPIU(LOGL_ERROR, "Invalid PLMN Identity size:" + " should be 3, is %d\n", src->pLMNidentity.size); + return -1; + } + gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], + &dst->mcc, &dst->mnc); + dst->rnc_id = (uint16_t)src->rNC_ID; + return 0; +} + +#if 0 + -- not used at present -- +static int iu_grnc_id_compose(struct iu_grnc_id *src, + struct RANAP_GlobalRNC_ID *dst) +{ + /* The caller must ensure proper size */ + OSMO_ASSERT(dst->pLMNidentity.size == 3); + gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], + src->mcc, src->mnc); + dst->rNC_ID = src->rnc_id; + return 0; +} +#endif + +static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) +{ + struct ranap_ue_conn_ctx *ue_conn = ctx; + struct gprs_ra_id ra_id; + struct iu_grnc_id grnc_id; + uint16_t sai; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + + if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { + ra_id.rac = asn1str_to_u8(&ies->rac); + } + + if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { + LOGPIU(LOGL_ERROR, + "Failed to parse RANAP Global-RNC-ID IE\n"); + return -1; + } + + sai = asn1str_to_u16(&ies->sai.sAC); + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ + iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &ue_conn->sccp_addr); + ue_conn->ra_id = ra_id; + + /* Feed into the MM layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, &ra_id, &sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) +{ + struct gprs_ra_id _ra_id, *ra_id = NULL; + uint16_t _sai, *sai = NULL; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { + if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + ra_id = &_ra_id; + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { + _ra_id.rac = asn1str_to_u8(&ies->rac); + } + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { + _sai = asn1str_to_u16(&ies->sai.sAC); + sai = &_sai; + } + } + + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Feed into the MM/CC/SMS-CP layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, ra_id, sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +int ranap_iu_tx(struct msgb *msg_nas, uint8_t sapi) +{ + struct ranap_ue_conn_ctx *uectx = msg_nas->dst; + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); + msgb_free(msg_nas); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +/* Send Iu Release for the given UE connection. + * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise + * the provided cause. */ +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + static const struct RANAP_Cause default_cause = { + .present = RANAP_Cause_PR_radioNetwork, + .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, + }; + + if (!cause) + cause = &default_cause; + + msg = ranap_new_msg_iu_rel_cmd(cause); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ctx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +static int ranap_handle_co_iu_rel_req(struct ranap_ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) +{ + LOGPIU(LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); + ranap_iu_tx_release(ctx, &ies->cause); + return 0; +} + +static int ranap_handle_co_rab_ass_resp(struct ranap_ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) +{ + int rc = -1; + + LOGPIU(LOGL_INFO, + "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); + if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { + /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ + RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; + RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; + + rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); + if (rc) { + LOGPIU(LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); + return rc; + } + + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_RAB_ASSIGN, &setup_ies); + + ranap_free_rab_setupormodifieditemies(&setup_ies); + } + /* FIXME: handle RAB Ass failure? */ + + return rc; +} + +/* Entry point for connection-oriented RANAP message */ +static void cn_ranap_handle_co(void *ctx, ranap_message *message) +{ + int rc; + + LOGPIU(LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_InitialUE_Message: + rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); + break; + case RANAP_ProcedureCode_id_DirectTransfer: + rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + case RANAP_ProcedureCode_id_Iu_ReleaseRequest: + /* Iu Release Request */ + rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_SecurityModeControl: + /* Security Mode Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, NULL); + break; + case RANAP_ProcedureCode_id_Iu_Release: + /* Iu Release Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_IU_RELEASE, NULL); + if (rc) { + LOGPIU(LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", + rc); + } + break; + default: + LOGPIU(LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_outcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_RAB_Assignment: + /* RAB Assignment Response */ + rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + default: + LOGPIU(LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", + rc); + /* TODO handling of the error? */ + } +} + +static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) +{ + /* FIXME: send reset response */ + return -1; +} + +static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +/* Entry point for connection-less RANAP message */ +static void cn_ranap_handle_cl(void *ctx, ranap_message *message) +{ + int rc; + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_Reset: + /* received reset.req, send reset.resp */ + rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + default: + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + case RANAP_RANAP_PDU_PR_outcome: + default: + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", + rc); + /* TODO handling of the error? */ + } +} + +/*********************************************************************** + * Paging + ***********************************************************************/ + +struct osmo_sccp_addr local_sccp_addr = { + .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, + .ri = OSMO_SCCP_RI_SSN_PC, + .ssn = OSMO_SCCP_SSN_RANAP, + .pc = 1, +}; + +/* Send a paging command down a given SCCP User. tmsi and paging_cause are + * optional and may be passed NULL and 0, respectively, to disable their use. + * See enum RANAP_PagingCause. + * + * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, + * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ +static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, + const char *imsi, const uint32_t *tmsi, + bool is_ps, uint32_t paging_cause) +{ + struct msgb *msg; + msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); + msg->l2h = msg->data; + osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); + return 0; +} + +static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, + uint16_t lac, uint8_t rac, bool is_ps) +{ + struct iu_rnc *rnc; + int pagings_sent = 0; + + if (tmsi_or_ptimsi) { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use %s %x)\n", + is_ps? "IuPS" : "IuCS", + imsi, + is_ps? "PTMSI" : "TMSI", + *tmsi_or_ptimsi); + } else { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use IMSI)\n", + is_ps? "IuPS" : "IuCS", + imsi + ); + } + + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->lac != lac) + continue; + if (is_ps && rnc->rac != rac) + continue; + + /* Found a match! */ + if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) + == 0) { + LOGPIU(LOGL_DEBUG, + "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", + is_ps? "IuPS" : "IuCS", + imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); + pagings_sent ++; + } + } + + /* Some logging... */ + if (pagings_sent > 0) { + LOGPIU(LOGL_DEBUG, + "%s: %d RNCs were paged for IMSI %s.\n", + is_ps? "IuPS" : "IuCS", + pagings_sent, imsi); + } + else { + if (is_ps) { + LOGPIU(LOGL_ERROR, "IuPS: Found no RNC to page for" + " LAC %d RAC %d (would have paged IMSI %s)\n", + lac, rac, imsi); + } + else { + LOGPIU(LOGL_ERROR, "IuCS: Found no RNC to page for" + " LAC %d (would have paged IMSI %s)\n", + lac, imsi); + } + } + + return pagings_sent; +} + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +{ + return iu_page(imsi, tmsi, lac, 0, false); +} + +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +{ + return iu_page(imsi, ptmsi, lac, rac, true); +} + + +/*********************************************************************** + * + ***********************************************************************/ + +int tx_unitdata(struct osmo_sccp_user *scu); +int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); + +struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); +struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); + +static struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) +{ + struct msgb *msg = msgb_alloc(1024, "conn_resp"); + struct osmo_scu_prim *prim; + + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_CONNECT, + PRIM_OP_RESPONSE, msg); + memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); + return &prim->oph; +} + +static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) +{ + struct osmo_sccp_user *scu = _scu; + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct osmo_prim_hdr *resp = NULL; + int rc; + struct ranap_ue_conn_ctx *ue; + + LOGPIU(LOGL_DEBUG, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + + switch (OSMO_PRIM_HDR(oph)) { + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): + /* confirmation of outbound connection */ + rc = -1; + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): + /* indication of new inbound connection request*/ + LOGPIU(LOGL_DEBUG, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); + if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ + !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { + LOGPIU(LOGL_NOTICE, + "Received invalid N-CONNECT.ind\n"); + return 0; + } + ue = ranap_ue_conn_ctx_alloc(&prim->u.connect.calling_addr, prim->u.connect.conn_id); + /* first ensure the local SCCP socket is ACTIVE */ + resp = make_conn_resp(&prim->u.connect); + osmo_sccp_user_sap_down(scu, resp); + /* then handle the RANAP payload */ + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): + /* indication of disconnect */ + LOGPIU(LOGL_DEBUG, "N-DISCONNECT.ind(%u)\n", + prim->u.disconnect.conn_id); + ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): + /* connection-oriented data received */ + LOGPIU(LOGL_DEBUG, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + /* resolve UE context */ + ue = ue_conn_ctx_find(prim->u.data.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): + /* connection-less data received */ + LOGPIU(LOGL_DEBUG, "N-UNITDATA.ind(%s)\n", + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + rc = ranap_cn_rx_cl(cn_ranap_handle_cl, scu, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + default: + rc = -1; + break; + } + + msgb_free(oph->msg); + return rc; +} + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb) +{ + iu_log_subsystem = log_subsystem; + talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); + talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); + + global_iu_recv_cb = iu_recv_cb; + global_iu_event_cb = iu_event_cb; + g_sccp = sccp; + g_scu = osmo_sccp_user_bind(g_sccp, sccp_user_name, sccp_sap_up, OSMO_SCCP_SSN_RANAP); + + return 0; +} + diff --git a/src/iu_client_vty.c b/src/iu_client_vty.c new file mode 100644 index 0000000..8ada3e1 --- /dev/null +++ b/src/iu_client_vty.c @@ -0,0 +1,130 @@ +/* OpenBSC Iu related interface to quagga VTY */ +/* (C) 2016 by sysmocom s.m.f.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include +#include + +#include + +static enum ranap_nsap_addr_enc *g_rab_assign_addr_enc = NULL; + +DEFUN(logging_asn_debug, + logging_asn_debug_cmd, + "logging asn1-debug (1|0)", + LOGGING_STR + "Log ASN.1 debug messages to stderr\n" + "Log ASN.1 debug messages to stderr\n" + "Do not log ASN.1 debug messages to stderr\n") +{ + asn_debug = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(logging_asn_xer_print, + logging_asn_xer_print_cmd, + "logging asn1-xer-print (1|0)", + LOGGING_STR + "Log human readable representations of all ASN.1 messages to stderr\n" + "Log decoded ASN.1 messages to stderr\n" + "Do not log decoded ASN.1 messages to stderr\n") +{ + asn1_xer_print = atoi(argv[0]); + return CMD_SUCCESS; +} + +#define IU_STR "Iu interface protocol options\n" +DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, + "iu rab-assign-addr-enc (x213|v4raw)", + IU_STR + "Choose RAB Assignment's Transport Layer Address encoding\n" + "ITU-T X.213 compliant address encoding (default)\n" + "32bit length raw IPv4 address (for ip.access nano3G)\n") +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if (strcmp(argv[0], "v4raw") == 0) + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_V4RAW; + else + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_X213; + return CMD_SUCCESS; +} + +extern struct osmo_sccp_addr local_sccp_addr; + +DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, + "iu local-address point-code PC", + IU_STR "Local SCCP Address\n") +{ + local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; + local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; + local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); + + return CMD_SUCCESS; +} + +/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ + +int ranap_iu_vty_config_write(struct vty *vty, const char *indent) +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + switch (*g_rab_assign_addr_enc) { + case RANAP_NSAP_ADDR_ENC_V4RAW: + vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, + VTY_NEWLINE); + break; + case RANAP_NSAP_ADDR_ENC_X213: + /* default value, no need to write anything */ + break; + default: + LOGP(0, LOGL_ERROR, "Invalid value for" + " iu.rab_assign_addr_enc: %d\n", + *g_rab_assign_addr_enc); + return CMD_WARNING; + } + + vty_out(vty, "%siu local-address point-code %s%s", indent, + osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); + + return CMD_SUCCESS; +} + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc) +{ + g_rab_assign_addr_enc = rab_assign_addr_enc; + + install_element(CFG_LOG_NODE, &logging_asn_debug_cmd); + install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd); + install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); + install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); +} -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 13:05:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 13:05:48 +0000 Subject: libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/3130/7/debian/control File debian/control: Line 284: bumpversion, should we also check for this in configure.ac? https://gerrit.osmocom.org/#/c/3130/7/debian/libosmocore-dev.install File debian/libosmocore-dev.install: Line 6: osmo-release.mk usr/include Am I understanding correctly that osmo-release.mk is installed by the debian package, but not by 'make install'? IMHO 'make install' should be our definitive installation, with the debian packaging "merely" providing a convenience adaptation thereof. The debian install should not wander off the 'make install' process on its own. It would mean that in daily development I have to build debian packages to be able to use installed files; and what about non-debian systems. -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 12 13:09:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 12 Jul 2017 13:09:22 +0000 Subject: libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/3130/7/debian/control File debian/control: Line 284: bumpversion, > should we also check for this in configure.ac? No - it's only necessary if you actually use added make target, it's not needed for build, check, install etc. -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 12 14:20:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 14:20:30 +0000 Subject: osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client* In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/3187/1/include/osmocom/ranap/iu_client.h File include/osmocom/ranap/iu_client.h: Line 26: /* TODO: It's not needed to store the full SCCP address for each it would make sense to clean this up now, before we will first make this part of a public library while knowing that we will have to break ABI and API again to fix known issues. https://gerrit.osmocom.org/#/c/3187/1/src/iu_client_vty.c File src/iu_client_vty.c: Line 35: "logging asn1-debug (1|0)", this is a view/enable node command, i.e. not configuration. Any "logging" command with view/enable node by definition configures the logging to the current VTY session. Do we have any code that actually ensures that the ASN1 debug log ends up on that VTY (telnet session)? Also, we are changing a global variable, so semantically it behaves completely different to other commands affecting logging to the current vty. If it's not affecting the current VTY session, it should rather be a configuration statement and also saved to the config file. Same is true for "logging asn1-xer-print" below. Even then, existing logging configuration is per log target, and not global. I think this needs some more thought? Line 80: DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, this should be integrated with the SCCP address book, so that a given Iu user can refer to a named SCCP address book entry to set the local point code. Let's at the very least add a TODO or FIXME comment here. -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh 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 Wed Jul 12 14:21:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 14:21:10 +0000 Subject: osmo-hlr[master]: deb: use python in shebang In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I095e5c273e30a6e124833bf58b231c6367ab48d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr 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 Jul 12 14:21:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 14:21:19 +0000 Subject: [MERGED] osmo-hlr[master]: deb: use python in shebang In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: deb: use python in shebang ...................................................................... deb: use python in shebang This should fix the .deb build on OBS. Change-Id: I095e5c273e30a6e124833bf58b231c6367ab48d6 --- M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 058113c..acc0f7d 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,5 +1,5 @@ -#!/usr/bin/env python - +#!/usr/bin/python +# FIXME: use python3 once buildslaves are updated. # Convert test sets pasted from 3GPP TS 55.205 to C code. # (C) 2016 by sysmocom s.f.m.c. GmbH -- To view, visit https://gerrit.osmocom.org/3186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I095e5c273e30a6e124833bf58b231c6367ab48d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 17:22:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 12 Jul 2017 17:22:42 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#8). Add release target to Makefile Add simple helper target to automate basic release steps: * version bump * prepare release commit * git commit, tag and sign For library projects: * update debian/changelog from TODO-RELEASE * cleanup TODO-RELEASE For non-library projects: * update debian/changelog from git log Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control A osmo-release.mk 4 files changed, 38 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/8 diff --git a/Makefile.am b/Makefile.am index b8de3ca..539b01c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,9 @@ pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \ libosmogb.pc libosmoctrl.pc libosmocoding.pc +relengdir = $(includedir) +releng_DATA = osmo-release.mk + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ @@ -15,6 +18,8 @@ EXTRA_DIST = git-version-gen .version README.md + at RELMAKE@ + if HAVE_DOXYGEN html_DATA = $(top_builddir)/doc/html.tar diff --git a/configure.ac b/configure.ac index 92544b6..641f852 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..4407c86 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,28 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +ISODATE := $(shell date -I) +endif + +release: +ifeq ($(NEW_VERSION),) + @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) +endif + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." +ifeq ($(LIBVERS),) + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge +else + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)." + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Wed Jul 12 17:37:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 17:37:28 +0000 Subject: osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client* In-Reply-To: References: Message-ID: Patch Set 1: (4 comments) https://gerrit.osmocom.org/#/c/3187/1/include/osmocom/ranap/iu_client.h File include/osmocom/ranap/iu_client.h: Line 43: * ranap_ue_conn_ctx should no longer be used, for whatever reason. */ same here. I'll drop the FIXME because there is no need. Whichever user wants to handle the two events in the same way will just combine switch cases. Line 54: /* TODO "gprs_" in generic CS+PS domain ^ */ more appropriate would be struct osmo_routing_area_id, or could replace with expanded mcc, mnc, lac, rac. https://gerrit.osmocom.org/#/c/3187/1/src/iu_client_vty.c File src/iu_client_vty.c: Line 35: "logging asn1-debug (1|0)", > this is a view/enable node command, i.e. not configuration. Any "logging" I think I added these commands back in the days upon you requesting VTY commands for it. At that time I wasn't much aware of separate logging targets. The asn_debug is a global variable causing printf to stderr from libasn1c/include/asn1c/asn_internal.h:56 ASN_DEBUG() macro. asn1_xer_print is put in generated asn1 code from asn1tostruct.py, hence present in our rua and ranap generated code. Same there, it prints only to stderr so far. If we want to make this generically configurable to separate logging targets, I guess we would have to add a logging category and use libosmocore's LOGP() in libasn1c as well as asn1tostruct.py. In that case we would drop these entirely. So might as well drop them now and come back to the logging category later? Line 80: DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, > this should be integrated with the SCCP address book, so that a given Iu us you introduced this in the port-to-new-sigtran commit; the address book came later I guess. Should be fine to use the address book -- to clarify, as in the other AoIP discussion on openbsc@: do we also have to supply an ss7 instance id to lookup the address book entry at? By now I guess it would be useful to have a global namespace for address book entries, so that address names belong to a specific ss7 instance, but are guaranteed to be unique; then the name can imply which instance it belongs to. -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh 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 Wed Jul 12 18:17:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 18:17:42 +0000 Subject: osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client* In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) some more. I'll go about these issues and come back once it has been tested to work with the new osmo-msc.git and osmo-sgsn.git. https://gerrit.osmocom.org/#/c/3187/1/include/osmocom/ranap/iu_client.h File include/osmocom/ranap/iu_client.h: Line 26: /* TODO: It's not needed to store the full SCCP address for each > it would make sense to clean this up now, before we will first make this pa I took a brief look and the causality is as follows: currently we actually use the public ranap_ue_conn_ctx to pass the sccp_addr up from sccp_sap_up() to the point where we associate it with an RNC. - sccp_sap_up() - OSMO_SCU_PRIM_N_CONNECT: we already now allocate a new ranap_ue_conn_ctx and set sccp_addr = prim->u.connect.calling_addr. - we pass this up the RANAP stack, which decodes the IEs. - finally ranap_handle_co_initial_ue() parses ies->globalRNC_ID - Only now do we find-or-create a struct iu_rnc entry in the global list and set iu_rnc->sccp_addr = ue_conn_ctx->sccp_addr. I believe we should instead use a private struct as data pointer to pass it up the RANAP stack and only actually allocate a public ranap_ue_conn_ctx when the RNC_ID has been parsed successfully. (This would also ensure that we create a UE context only when we were able to parse/handle all of the RANAP. It looks like we fail to clean up the ue_conn_ctx on error at the moment.) Line 32: struct gprs_ra_id ra_id; (and here again I guess rather struct osmo_routing_area_id.) -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From admin at opensuse.org Wed Jul 12 20:01:37 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:01:37 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <596680363cfd4_5caec8af78206714@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 120s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 120s] Makefile:671: recipe for target 'check-am' failed [ 120s] make[5]: *** [check-am] Error 2 [ 120s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 120s] Makefile:523: recipe for target 'check-recursive' failed [ 120s] make[4]: *** [check-recursive] Error 1 [ 120s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 120s] Makefile:382: recipe for target 'check-recursive' failed [ 120s] make[3]: *** [check-recursive] Error 1 [ 120s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 120s] Makefile:405: recipe for target 'check-recursive' failed [ 120s] make[2]: *** [check-recursive] Error 1 [ 120s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 120s] Makefile:696: recipe for target 'check' failed [ 120s] make[1]: *** [check] Error 2 [ 120s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 120s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 120s] debian/rules:7: recipe for target 'build' failed [ 120s] make: *** [build] Error 2 [ 120s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 120s] [ 120s] lamb23 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:01:30 UTC 2017. [ 120s] [ 120s] ### VM INTERACTION START ### [ 123s] [ 107.137734] reboot: Power down [ 123s] ### VM INTERACTION END ### [ 123s] [ 123s] lamb23 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:01:33 UTC 2017. [ 123s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jul 12 20:01:55 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:01:55 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <596680377e71e_5caec8af7820673ab@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 76s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 76s] Makefile:671: recipe for target 'check-am' failed [ 76s] make[5]: *** [check-am] Error 2 [ 76s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 76s] Makefile:523: recipe for target 'check-recursive' failed [ 76s] make[4]: *** [check-recursive] Error 1 [ 76s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 76s] Makefile:382: recipe for target 'check-recursive' failed [ 76s] make[3]: *** [check-recursive] Error 1 [ 76s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 76s] Makefile:405: recipe for target 'check-recursive' failed [ 76s] make[2]: *** [check-recursive] Error 1 [ 76s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 76s] Makefile:696: recipe for target 'check' failed [ 76s] make[1]: *** [check] Error 2 [ 76s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 76s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 76s] debian/rules:7: recipe for target 'build' failed [ 76s] make: *** [build] Error 2 [ 76s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 76s] [ 76s] build81 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:01:36 UTC 2017. [ 76s] [ 76s] ### VM INTERACTION START ### [ 80s] [ 69.336029] reboot: Power down [ 80s] ### VM INTERACTION END ### [ 80s] [ 80s] build81 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:01:40 UTC 2017. [ 80s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jul 12 20:03:03 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:03:03 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59668091bf47_5caec8af782067515@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 85s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 85s] Makefile:671: recipe for target 'check-am' failed [ 85s] make[5]: *** [check-am] Error 2 [ 85s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 85s] Makefile:523: recipe for target 'check-recursive' failed [ 85s] make[4]: *** [check-recursive] Error 1 [ 85s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 85s] Makefile:382: recipe for target 'check-recursive' failed [ 85s] make[3]: *** [check-recursive] Error 1 [ 85s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 85s] Makefile:405: recipe for target 'check-recursive' failed [ 85s] make[2]: *** [check-recursive] Error 1 [ 85s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 85s] Makefile:696: recipe for target 'check' failed [ 85s] make[1]: *** [check] Error 2 [ 85s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 85s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 85s] debian/rules:7: recipe for target 'build' failed [ 85s] make: *** [build] Error 2 [ 85s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 85s] [ 85s] lamb09 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:02:52 UTC 2017. [ 85s] [ 85s] ### VM INTERACTION START ### [ 88s] [ 75.478306] reboot: Power down [ 88s] ### VM INTERACTION END ### [ 88s] [ 88s] lamb09 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:02:56 UTC 2017. [ 88s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jul 12 20:03:20 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:03:20 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5966809335630_5caec8af78206761c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 144s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 144s] Makefile:671: recipe for target 'check-am' failed [ 144s] make[5]: *** [check-am] Error 2 [ 144s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 144s] Makefile:523: recipe for target 'check-recursive' failed [ 144s] make[4]: *** [check-recursive] Error 1 [ 144s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 144s] Makefile:382: recipe for target 'check-recursive' failed [ 144s] make[3]: *** [check-recursive] Error 1 [ 144s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 144s] Makefile:405: recipe for target 'check-recursive' failed [ 144s] make[2]: *** [check-recursive] Error 1 [ 144s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 144s] Makefile:696: recipe for target 'check' failed [ 144s] make[1]: *** [check] Error 2 [ 144s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 144s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 144s] debian/rules:7: recipe for target 'build' failed [ 144s] make: *** [build] Error 2 [ 144s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 144s] [ 144s] build35 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:03:10 UTC 2017. [ 144s] [ 144s] ### VM INTERACTION START ### [ 148s] [ 123.977558] reboot: Power down [ 149s] ### VM INTERACTION END ### [ 149s] [ 149s] build35 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:03:16 UTC 2017. [ 149s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jul 12 20:03:37 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:03:37 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <596680ad1bf91_5caec8af7820677d4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 131s] Makefile:660: recipe for target 'check-am' failed [ 131s] make[5]: *** [check-am] Error 2 [ 131s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 131s] Makefile:512: recipe for target 'check-recursive' failed [ 131s] make[4]: *** [check-recursive] Error 1 [ 131s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 131s] Makefile:370: recipe for target 'check-recursive' failed [ 131s] make[3]: *** [check-recursive] Error 1 [ 131s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 131s] Makefile:393: recipe for target 'check-recursive' failed [ 131s] make[2]: *** [check-recursive] Error 1 [ 131s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 131s] Makefile:684: recipe for target 'check' failed [ 131s] make[1]: *** [check] Error 2 [ 131s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 131s] dh_auto_test: make -j1 check returned exit code 2 [ 131s] debian/rules:7: recipe for target 'build' failed [ 131s] make: *** [build] Error 2 [ 131s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 131s] [ 131s] lamb17 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:03:30 UTC 2017. [ 131s] [ 131s] ### VM INTERACTION START ### [ 132s] Powering off. [ 132s] [ 117.642868] reboot: Power down [ 132s] ### VM INTERACTION END ### [ 132s] [ 132s] lamb17 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:03:32 UTC 2017. [ 132s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jul 12 20:03:37 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:03:37 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/i586 In-Reply-To: References: Message-ID: <596680adae540_5caec8af78206788@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 113s] Makefile:660: recipe for target 'check-am' failed [ 113s] make[5]: *** [check-am] Error 2 [ 113s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 113s] Makefile:512: recipe for target 'check-recursive' failed [ 113s] make[4]: *** [check-recursive] Error 1 [ 113s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 113s] Makefile:370: recipe for target 'check-recursive' failed [ 113s] make[3]: *** [check-recursive] Error 1 [ 113s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 113s] Makefile:393: recipe for target 'check-recursive' failed [ 113s] make[2]: *** [check-recursive] Error 1 [ 113s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 113s] Makefile:684: recipe for target 'check' failed [ 113s] make[1]: *** [check] Error 2 [ 113s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 113s] dh_auto_test: make -j1 check returned exit code 2 [ 113s] debian/rules:7: recipe for target 'build' failed [ 113s] make: *** [build] Error 2 [ 113s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 113s] [ 113s] lamb04 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:03:20 UTC 2017. [ 113s] [ 113s] ### VM INTERACTION START ### [ 114s] Powering off. [ 114s] [ 100.957606] reboot: Power down [ 114s] ### VM INTERACTION END ### [ 114s] [ 114s] lamb04 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:03:21 UTC 2017. [ 114s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jul 12 20:06:46 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:06:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59668160d350f_5caec8af7820682c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 216s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 216s] Makefile:671: recipe for target 'check-am' failed [ 216s] make[5]: *** [check-am] Error 2 [ 216s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 216s] Makefile:523: recipe for target 'check-recursive' failed [ 216s] make[4]: *** [check-recursive] Error 1 [ 216s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 216s] Makefile:382: recipe for target 'check-recursive' failed [ 216s] make[3]: *** [check-recursive] Error 1 [ 216s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 216s] Makefile:405: recipe for target 'check-recursive' failed [ 216s] make[2]: *** [check-recursive] Error 1 [ 216s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 216s] Makefile:696: recipe for target 'check' failed [ 216s] make[1]: *** [check] Error 2 [ 216s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 216s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 216s] debian/rules:7: recipe for target 'build' failed [ 216s] make: *** [build] Error 2 [ 216s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 216s] [ 216s] lamb69 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:06:31 UTC 2017. [ 216s] [ 216s] ### VM INTERACTION START ### [ 219s] [ 189.407716] reboot: Power down [ 219s] ### VM INTERACTION END ### [ 219s] [ 219s] lamb69 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:06:34 UTC 2017. [ 219s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jul 12 20:06:46 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:06:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5966816125d52_5caec8af782068313@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 116s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 116s] Makefile:671: recipe for target 'check-am' failed [ 116s] make[5]: *** [check-am] Error 2 [ 116s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 116s] Makefile:523: recipe for target 'check-recursive' failed [ 116s] make[4]: *** [check-recursive] Error 1 [ 116s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 116s] Makefile:382: recipe for target 'check-recursive' failed [ 116s] make[3]: *** [check-recursive] Error 1 [ 116s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 116s] Makefile:405: recipe for target 'check-recursive' failed [ 116s] make[2]: *** [check-recursive] Error 1 [ 116s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 116s] Makefile:696: recipe for target 'check' failed [ 116s] make[1]: *** [check] Error 2 [ 116s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 116s] dh_auto_test: make -j1 check returned exit code 2 [ 116s] debian/rules:7: recipe for target 'build' failed [ 116s] make: *** [build] Error 2 [ 116s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 116s] [ 116s] lamb13 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:06:32 UTC 2017. [ 116s] [ 116s] ### VM INTERACTION START ### [ 120s] [ 106.527160] reboot: Power down [ 120s] ### VM INTERACTION END ### [ 120s] [ 120s] lamb13 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:06:35 UTC 2017. [ 120s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jul 12 20:07:03 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:07:03 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <596681804861f_5caec8af782068525@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 245s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 245s] Makefile:671: recipe for target 'check-am' failed [ 245s] make[5]: *** [check-am] Error 2 [ 245s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 245s] Makefile:523: recipe for target 'check-recursive' failed [ 245s] make[4]: *** [check-recursive] Error 1 [ 245s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 245s] Makefile:382: recipe for target 'check-recursive' failed [ 245s] make[3]: *** [check-recursive] Error 1 [ 245s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 245s] Makefile:405: recipe for target 'check-recursive' failed [ 245s] make[2]: *** [check-recursive] Error 1 [ 245s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 245s] Makefile:696: recipe for target 'check' failed [ 245s] make[1]: *** [check] Error 2 [ 245s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 246s] dh_auto_test: make -j1 check returned exit code 2 [ 246s] debian/rules:7: recipe for target 'build' failed [ 246s] make: *** [build] Error 2 [ 246s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 246s] [ 246s] lamb26 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:06:52 UTC 2017. [ 246s] [ 246s] ### VM INTERACTION START ### [ 249s] [ 230.770574] reboot: Power down [ 249s] ### VM INTERACTION END ### [ 249s] [ 249s] lamb26 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:06:56 UTC 2017. [ 249s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jul 12 20:07:20 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 12 Jul 2017 20:07:20 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59668182b72d_5caec8af782068629@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 157s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 157s] Makefile:671: recipe for target 'check-am' failed [ 157s] make[5]: *** [check-am] Error 2 [ 157s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 157s] Makefile:523: recipe for target 'check-recursive' failed [ 157s] make[4]: *** [check-recursive] Error 1 [ 157s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 157s] Makefile:382: recipe for target 'check-recursive' failed [ 157s] make[3]: *** [check-recursive] Error 1 [ 157s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 157s] Makefile:405: recipe for target 'check-recursive' failed [ 157s] make[2]: *** [check-recursive] Error 1 [ 157s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 157s] Makefile:696: recipe for target 'check' failed [ 157s] make[1]: *** [check] Error 2 [ 157s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 157s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 157s] debian/rules:7: recipe for target 'build' failed [ 157s] make: *** [build] Error 2 [ 157s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 157s] [ 157s] lamb22 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:07:14 UTC 2017. [ 157s] [ 157s] ### VM INTERACTION START ### [ 160s] [ 145.096603] reboot: Power down [ 160s] ### VM INTERACTION END ### [ 161s] [ 161s] lamb22 failed "build osmo-hlr_0.0.1.20170712.dsc" at Wed Jul 12 20:07:18 UTC 2017. [ 161s] -- 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 Jul 12 20:30:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 20:30:07 +0000 Subject: [PATCH] osmo-msc[master]: move openbsc/* to repos root Message-ID: Review at https://gerrit.osmocom.org/3188 move openbsc/* to repos root This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 --- R AUTHORS R COPYING R Makefile.am R README R README.vty-tests R configure.ac R contrib/a-link/sccp-split-by-con.lua R contrib/bsc-test/README R contrib/bsc-test/all_dial R contrib/bsc-test/dial.sh R contrib/bsc-test/drop-oml.sh R contrib/bsc-test/drop.sh R contrib/bsc-test/hangup R contrib/bsc-test/msc.sh R contrib/bsc_control.py R contrib/bt.py R contrib/convert_to_enum.py R contrib/ctrl2sse.py R contrib/gprs/gb-proxy-unblock-bug.py R contrib/gprs/gprs-bssgp-histogram.lua R contrib/gprs/gprs-buffer-count.lua R contrib/gprs/gprs-split-trace-by-tlli.lua R contrib/gprs/gprs-verify-nu.lua R contrib/hlr-remove-old.sql R contrib/hlrsync/hlrsync.py R contrib/ipa.py R contrib/mgcp_server.py R contrib/nat/test_regexp.c R contrib/nat/ussd_example.py R contrib/rtp/gen_rtp_header.erl R contrib/rtp/rtp_replay.st R contrib/rtp/rtp_replay_shared.st R contrib/rtp/rtp_replay_sip.st R contrib/rtp/timestamp_rtp.lua R contrib/sms/fill-hlr.st R contrib/sms/hlr-query.st R contrib/sms/sqlite-probe.tap.d R contrib/soap.py R contrib/systemd/osmo-bsc-mgcp.service R contrib/systemd/osmo-bsc.service R contrib/systemd/osmo-gbproxy.service R contrib/systemd/osmo-nitb.service R contrib/systemd/osmo-sgsn.service R contrib/testconv/Makefile R contrib/testconv/testconv_main.c R contrib/twisted_ipa.py R doc/BS11-OML.txt R doc/Makefile.am R doc/call-routing.txt R doc/channel_release.txt R doc/e1-data-model.txt R doc/examples/Makefile.am R doc/examples/osmo-bsc/osmo-bsc.cfg R doc/examples/osmo-bsc_mgcp/mgcp.cfg R doc/examples/osmo-bsc_nat/black-list.cfg R doc/examples/osmo-bsc_nat/bscs.config R doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg R doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg R doc/examples/osmo-gbproxy/osmo-gbproxy.cfg R doc/examples/osmo-gtphub/gtphub-example.txt R doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg R doc/examples/osmo-gtphub/osmo-gtphub.cfg R doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg R doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg R doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg R doc/examples/osmo-nitb/bs11/openbsc.cfg R doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg R doc/examples/osmo-nitb/nanobts/openbsc.cfg R doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg R doc/examples/osmo-nitb/rbs2308/openbsc.cfg R doc/examples/osmo-nitb/sysmobts/openbsc.cfg R doc/examples/osmo-sgsn/osmo-sgsn.cfg R doc/gsm-hopping.txt R doc/handover.txt R doc/ipa-sccp.txt R doc/oml-interface.txt R doc/osmo-nitb-data_structures.dot R doc/paging.txt R git-version-gen R include/Makefile.am R include/compat_af_isdn.h R include/mISDNif.h R include/openbsc/Makefile.am R include/openbsc/abis_nm.h R include/openbsc/abis_om2000.h R include/openbsc/abis_rsl.h R include/openbsc/arfcn_range_encode.h R include/openbsc/auth.h R include/openbsc/bsc_api.h R include/openbsc/bsc_msc.h R include/openbsc/bsc_msc_data.h R include/openbsc/bsc_msg_filter.h R include/openbsc/bsc_nat.h R include/openbsc/bsc_nat_callstats.h R include/openbsc/bsc_nat_sccp.h R include/openbsc/bsc_rll.h R include/openbsc/bsc_subscriber.h R include/openbsc/bss.h R include/openbsc/bts_ipaccess_nanobts_omlattr.h R include/openbsc/chan_alloc.h R include/openbsc/common_bsc.h R include/openbsc/common_cs.h R include/openbsc/crc24.h R include/openbsc/ctrl.h R include/openbsc/db.h R include/openbsc/debug.h R include/openbsc/e1_config.h R include/openbsc/gb_proxy.h R include/openbsc/gprs_gb_parse.h R include/openbsc/gprs_gmm.h R include/openbsc/gprs_llc.h R include/openbsc/gprs_llc_xid.h R include/openbsc/gprs_sgsn.h R include/openbsc/gprs_sndcp.h R include/openbsc/gprs_sndcp_comp.h R include/openbsc/gprs_sndcp_dcomp.h R include/openbsc/gprs_sndcp_pcomp.h R include/openbsc/gprs_sndcp_xid.h R include/openbsc/gprs_subscriber.h R include/openbsc/gprs_utils.h R include/openbsc/gsm_04_08.h R include/openbsc/gsm_04_11.h R include/openbsc/gsm_04_80.h R include/openbsc/gsm_data.h R include/openbsc/gsm_data_shared.h R include/openbsc/gsm_subscriber.h R include/openbsc/gsup_client.h R include/openbsc/gtphub.h R include/openbsc/handover.h R include/openbsc/handover_decision.h R include/openbsc/ipaccess.h R include/openbsc/iu.h R include/openbsc/meas_feed.h R include/openbsc/meas_rep.h R include/openbsc/mgcp.h R include/openbsc/mgcp_internal.h R include/openbsc/mgcp_transcode.h R include/openbsc/misdn.h R include/openbsc/mncc.h R include/openbsc/mncc_int.h R include/openbsc/nat_rewrite_trie.h R include/openbsc/network_listen.h R include/openbsc/oap_client.h R include/openbsc/openbscdefines.h R include/openbsc/osmo_bsc.h R include/openbsc/osmo_bsc_grace.h R include/openbsc/osmo_bsc_rf.h R include/openbsc/osmo_msc.h R include/openbsc/osmux.h R include/openbsc/paging.h R include/openbsc/pcu_if.h R include/openbsc/pcuif_proto.h R include/openbsc/rest_octets.h R include/openbsc/rrlp.h R include/openbsc/rs232.h R include/openbsc/rtp_proxy.h R include/openbsc/sgsn.h R include/openbsc/signal.h R include/openbsc/silent_call.h R include/openbsc/slhc.h R include/openbsc/smpp.h R include/openbsc/sms_queue.h R include/openbsc/socket.h R include/openbsc/system_information.h R include/openbsc/token_auth.h R include/openbsc/transaction.h R include/openbsc/trau_mux.h R include/openbsc/trau_upqueue.h R include/openbsc/ussd.h R include/openbsc/v42bis.h R include/openbsc/v42bis_private.h R include/openbsc/vty.h R m4/README R m4/ax_check_compile_flag.m4 R openbsc.pc.in R osmoappdesc.py R src/Makefile.am R src/gprs/.gitignore R src/gprs/Makefile.am R src/gprs/crc24.c R src/gprs/gb_proxy.c R src/gprs/gb_proxy_main.c R src/gprs/gb_proxy_patch.c R src/gprs/gb_proxy_peer.c R src/gprs/gb_proxy_tlli.c R src/gprs/gb_proxy_vty.c R src/gprs/gprs_gb_parse.c R src/gprs/gprs_gmm.c R src/gprs/gprs_llc.c R src/gprs/gprs_llc_parse.c R src/gprs/gprs_llc_vty.c R src/gprs/gprs_llc_xid.c R src/gprs/gprs_sgsn.c R src/gprs/gprs_sndcp.c R src/gprs/gprs_sndcp_comp.c R src/gprs/gprs_sndcp_dcomp.c R src/gprs/gprs_sndcp_pcomp.c R src/gprs/gprs_sndcp_vty.c R src/gprs/gprs_sndcp_xid.c R src/gprs/gprs_subscriber.c R src/gprs/gprs_utils.c R src/gprs/gtphub.c R src/gprs/gtphub_ares.c R src/gprs/gtphub_main.c R src/gprs/gtphub_sock.c R src/gprs/gtphub_vty.c R src/gprs/osmo_sgsn.cfg R src/gprs/sgsn_ares.c R src/gprs/sgsn_auth.c R src/gprs/sgsn_cdr.c R src/gprs/sgsn_ctrl.c R src/gprs/sgsn_libgtp.c R src/gprs/sgsn_main.c R src/gprs/sgsn_vty.c R src/gprs/slhc.c R src/gprs/v42bis.c R src/ipaccess/Makefile.am R src/ipaccess/abisip-find.c R src/ipaccess/ipaccess-config.c R src/ipaccess/ipaccess-firmware.c R src/ipaccess/ipaccess-proxy.c R src/ipaccess/network_listen.c R src/libbsc/Makefile.am R src/libbsc/abis_nm.c R src/libbsc/abis_nm_ipaccess.c R src/libbsc/abis_nm_vty.c R src/libbsc/abis_om2000.c R src/libbsc/abis_om2000_vty.c R src/libbsc/abis_rsl.c R src/libbsc/arfcn_range_encode.c R src/libbsc/bsc_api.c R src/libbsc/bsc_ctrl_commands.c R src/libbsc/bsc_ctrl_lookup.c R src/libbsc/bsc_dyn_ts.c R src/libbsc/bsc_init.c R src/libbsc/bsc_msc.c R src/libbsc/bsc_rf_ctrl.c R src/libbsc/bsc_rll.c R src/libbsc/bsc_subscriber.c R src/libbsc/bsc_vty.c R src/libbsc/bts_ericsson_rbs2000.c R src/libbsc/bts_init.c R src/libbsc/bts_ipaccess_nanobts.c R src/libbsc/bts_ipaccess_nanobts_omlattr.c R src/libbsc/bts_nokia_site.c R src/libbsc/bts_siemens_bs11.c R src/libbsc/bts_sysmobts.c R src/libbsc/bts_unknown.c R src/libbsc/chan_alloc.c R src/libbsc/e1_config.c R src/libbsc/gsm_04_08_utils.c R src/libbsc/gsm_04_80_utils.c R src/libbsc/handover_decision.c R src/libbsc/handover_logic.c R src/libbsc/meas_proc.c R src/libbsc/meas_rep.c R src/libbsc/net_init.c R src/libbsc/paging.c R src/libbsc/pcu_sock.c R src/libbsc/rest_octets.c R src/libbsc/system_information.c R src/libcommon-cs/Makefile.am R src/libcommon-cs/common_cs.c R src/libcommon-cs/common_cs_vty.c R src/libcommon/Makefile.am R src/libcommon/bsc_version.c R src/libcommon/common_vty.c R src/libcommon/debug.c R src/libcommon/gsm_data.c R src/libcommon/gsm_data_shared.c R src/libcommon/gsm_subscriber_base.c R src/libcommon/gsup_client.c R src/libcommon/gsup_test_client.c R src/libcommon/oap_client.c R src/libcommon/socket.c R src/libcommon/talloc_ctx.c R src/libfilter/Makefile.am R src/libfilter/bsc_msg_acc.c R src/libfilter/bsc_msg_filter.c R src/libfilter/bsc_msg_vty.c R src/libiu/Makefile.am R src/libiu/iu.c R src/libiu/iu_vty.c R src/libmgcp/Makefile.am R src/libmgcp/g711common.h R src/libmgcp/mgcp_network.c R src/libmgcp/mgcp_osmux.c R src/libmgcp/mgcp_protocol.c R src/libmgcp/mgcp_sdp.c R src/libmgcp/mgcp_transcode.c R src/libmgcp/mgcp_vty.c R src/libmsc/Makefile.am R src/libmsc/auth.c R src/libmsc/ctrl_commands.c R src/libmsc/db.c R src/libmsc/gsm_04_08.c R src/libmsc/gsm_04_11.c R src/libmsc/gsm_04_80.c R src/libmsc/gsm_subscriber.c R src/libmsc/meas_feed.c R src/libmsc/meas_feed.h R src/libmsc/mncc.c R src/libmsc/mncc_builtin.c R src/libmsc/mncc_sock.c R src/libmsc/osmo_msc.c R src/libmsc/rrlp.c R src/libmsc/silent_call.c R src/libmsc/smpp_openbsc.c R src/libmsc/smpp_smsc.c R src/libmsc/smpp_smsc.h R src/libmsc/smpp_utils.c R src/libmsc/smpp_vty.c R src/libmsc/sms_queue.c R src/libmsc/token_auth.c R src/libmsc/transaction.c R src/libmsc/ussd.c R src/libmsc/vty_interface_layer3.c R src/libtrau/Makefile.am R src/libtrau/rtp_proxy.c R src/libtrau/trau_mux.c R src/libtrau/trau_upqueue.c R src/osmo-bsc/Makefile.am R src/osmo-bsc/osmo_bsc_api.c R src/osmo-bsc/osmo_bsc_audio.c R src/osmo-bsc/osmo_bsc_bssap.c R src/osmo-bsc/osmo_bsc_ctrl.c R src/osmo-bsc/osmo_bsc_filter.c R src/osmo-bsc/osmo_bsc_grace.c R src/osmo-bsc/osmo_bsc_main.c R src/osmo-bsc/osmo_bsc_msc.c R src/osmo-bsc/osmo_bsc_sccp.c R src/osmo-bsc/osmo_bsc_vty.c R src/osmo-bsc_mgcp/Makefile.am R src/osmo-bsc_mgcp/mgcp_main.c R src/osmo-bsc_nat/Makefile.am R src/osmo-bsc_nat/bsc_filter.c R src/osmo-bsc_nat/bsc_mgcp_utils.c R src/osmo-bsc_nat/bsc_nat.c R src/osmo-bsc_nat/bsc_nat_ctrl.c R src/osmo-bsc_nat/bsc_nat_filter.c R src/osmo-bsc_nat/bsc_nat_rewrite.c R src/osmo-bsc_nat/bsc_nat_rewrite_trie.c R src/osmo-bsc_nat/bsc_nat_utils.c R src/osmo-bsc_nat/bsc_nat_vty.c R src/osmo-bsc_nat/bsc_sccp.c R src/osmo-bsc_nat/bsc_ussd.c R src/osmo-nitb/Makefile.am R src/osmo-nitb/bsc_hack.c R src/utils/Makefile.am R src/utils/bs11_config.c R src/utils/isdnsync.c R src/utils/meas_db.c R src/utils/meas_db.h R src/utils/meas_json.c R src/utils/meas_pcap2db.c R src/utils/meas_udp2db.c R src/utils/meas_vis.c R src/utils/smpp_mirror.c R tests/Makefile.am R tests/abis/Makefile.am R tests/abis/abis_test.c R tests/abis/abis_test.ok R tests/atlocal.in R tests/bsc-nat-trie/Makefile.am R tests/bsc-nat-trie/bsc_nat_trie_test.c R tests/bsc-nat-trie/bsc_nat_trie_test.ok R tests/bsc-nat-trie/prefixes.csv R tests/bsc-nat/Makefile.am R tests/bsc-nat/barr.cfg R tests/bsc-nat/barr_dup.cfg R tests/bsc-nat/bsc_data.c R tests/bsc-nat/bsc_nat_test.c R tests/bsc-nat/bsc_nat_test.ok R tests/bsc-nat/prefixes.csv R tests/bsc/Makefile.am R tests/bsc/bsc_test.c R tests/bsc/bsc_test.ok R tests/channel/Makefile.am R tests/channel/channel_test.c R tests/channel/channel_test.ok R tests/ctrl_test_runner.py R tests/db/Makefile.am R tests/db/db_test.c R tests/db/db_test.err R tests/db/db_test.ok R tests/db/hlr.sqlite3 R tests/gbproxy/Makefile.am R tests/gbproxy/gbproxy_test.c R tests/gbproxy/gbproxy_test.ok R tests/gprs/Makefile.am R tests/gprs/gprs_test.c R tests/gprs/gprs_test.ok R tests/gsm0408/Makefile.am R tests/gsm0408/gsm0408_test.c R tests/gsm0408/gsm0408_test.ok R tests/gtphub/Makefile.am R tests/gtphub/gtphub_test.c R tests/gtphub/gtphub_test.ok R tests/mgcp/Makefile.am R tests/mgcp/mgcp_test.c R tests/mgcp/mgcp_test.ok R tests/mgcp/mgcp_transcoding_test.c R tests/mgcp/mgcp_transcoding_test.ok R tests/mm_auth/Makefile.am R tests/mm_auth/mm_auth_test.c R tests/mm_auth/mm_auth_test.ok R tests/nanobts_omlattr/Makefile.am R tests/nanobts_omlattr/nanobts_omlattr_test.c R tests/nanobts_omlattr/nanobts_omlattr_test.ok R tests/oap/Makefile.am R tests/oap/oap_client_test.c R tests/oap/oap_client_test.err R tests/oap/oap_client_test.ok R tests/sgsn/Makefile.am R tests/sgsn/sgsn_test.c R tests/sgsn/sgsn_test.ok R tests/slhc/Makefile.am R tests/slhc/slhc_test.c R tests/slhc/slhc_test.ok R tests/smpp/Makefile.am R tests/smpp/smpp_test.c R tests/smpp/smpp_test.err R tests/smpp/smpp_test.ok R tests/smpp_test_runner.py R tests/sndcp_xid/Makefile.am R tests/sndcp_xid/sndcp_xid_test.c R tests/sndcp_xid/sndcp_xid_test.ok R tests/subscr/Makefile.am R tests/subscr/bsc_subscr_test.c R tests/subscr/bsc_subscr_test.err R tests/subscr/bsc_subscr_test.ok R tests/subscr/subscr_test.c R tests/subscr/subscr_test.ok R tests/testsuite.at R tests/trau/Makefile.am R tests/trau/trau_test.c R tests/trau/trau_test.ok R tests/v42bis/Makefile.am R tests/v42bis/v42bis_test.c R tests/v42bis/v42bis_test.ok R tests/vty_test_runner.py R tests/xid/Makefile.am R tests/xid/xid_test.c R tests/xid/xid_test.ok R tools/hlrstat.pl 445 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/88/3188/1 diff --git a/openbsc/AUTHORS b/AUTHORS similarity index 100% rename from openbsc/AUTHORS rename to AUTHORS diff --git a/openbsc/COPYING b/COPYING similarity index 100% rename from openbsc/COPYING rename to COPYING diff --git a/openbsc/Makefile.am b/Makefile.am similarity index 100% rename from openbsc/Makefile.am rename to Makefile.am diff --git a/openbsc/README b/README similarity index 100% rename from openbsc/README rename to README diff --git a/openbsc/README.vty-tests b/README.vty-tests similarity index 100% rename from openbsc/README.vty-tests rename to README.vty-tests diff --git a/openbsc/configure.ac b/configure.ac similarity index 100% rename from openbsc/configure.ac rename to configure.ac diff --git a/openbsc/contrib/a-link/sccp-split-by-con.lua b/contrib/a-link/sccp-split-by-con.lua similarity index 100% rename from openbsc/contrib/a-link/sccp-split-by-con.lua rename to contrib/a-link/sccp-split-by-con.lua diff --git a/openbsc/contrib/bsc-test/README b/contrib/bsc-test/README similarity index 100% rename from openbsc/contrib/bsc-test/README rename to contrib/bsc-test/README diff --git a/openbsc/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial similarity index 100% rename from openbsc/contrib/bsc-test/all_dial rename to contrib/bsc-test/all_dial diff --git a/openbsc/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh similarity index 100% rename from openbsc/contrib/bsc-test/dial.sh rename to contrib/bsc-test/dial.sh diff --git a/openbsc/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh similarity index 100% rename from openbsc/contrib/bsc-test/drop-oml.sh rename to contrib/bsc-test/drop-oml.sh diff --git a/openbsc/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh similarity index 100% rename from openbsc/contrib/bsc-test/drop.sh rename to contrib/bsc-test/drop.sh diff --git a/openbsc/contrib/bsc-test/hangup b/contrib/bsc-test/hangup similarity index 100% rename from openbsc/contrib/bsc-test/hangup rename to contrib/bsc-test/hangup diff --git a/openbsc/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh similarity index 100% rename from openbsc/contrib/bsc-test/msc.sh rename to contrib/bsc-test/msc.sh diff --git a/openbsc/contrib/bsc_control.py b/contrib/bsc_control.py similarity index 100% rename from openbsc/contrib/bsc_control.py rename to contrib/bsc_control.py diff --git a/openbsc/contrib/bt.py b/contrib/bt.py similarity index 100% rename from openbsc/contrib/bt.py rename to contrib/bt.py diff --git a/openbsc/contrib/convert_to_enum.py b/contrib/convert_to_enum.py similarity index 100% rename from openbsc/contrib/convert_to_enum.py rename to contrib/convert_to_enum.py diff --git a/openbsc/contrib/ctrl2sse.py b/contrib/ctrl2sse.py similarity index 100% rename from openbsc/contrib/ctrl2sse.py rename to contrib/ctrl2sse.py diff --git a/openbsc/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py similarity index 100% rename from openbsc/contrib/gprs/gb-proxy-unblock-bug.py rename to contrib/gprs/gb-proxy-unblock-bug.py diff --git a/openbsc/contrib/gprs/gprs-bssgp-histogram.lua b/contrib/gprs/gprs-bssgp-histogram.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-bssgp-histogram.lua rename to contrib/gprs/gprs-bssgp-histogram.lua diff --git a/openbsc/contrib/gprs/gprs-buffer-count.lua b/contrib/gprs/gprs-buffer-count.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-buffer-count.lua rename to contrib/gprs/gprs-buffer-count.lua diff --git a/openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua b/contrib/gprs/gprs-split-trace-by-tlli.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua rename to contrib/gprs/gprs-split-trace-by-tlli.lua diff --git a/openbsc/contrib/gprs/gprs-verify-nu.lua b/contrib/gprs/gprs-verify-nu.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-verify-nu.lua rename to contrib/gprs/gprs-verify-nu.lua diff --git a/openbsc/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql similarity index 100% rename from openbsc/contrib/hlr-remove-old.sql rename to contrib/hlr-remove-old.sql diff --git a/openbsc/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py similarity index 100% rename from openbsc/contrib/hlrsync/hlrsync.py rename to contrib/hlrsync/hlrsync.py diff --git a/openbsc/contrib/ipa.py b/contrib/ipa.py similarity index 100% rename from openbsc/contrib/ipa.py rename to contrib/ipa.py diff --git a/openbsc/contrib/mgcp_server.py b/contrib/mgcp_server.py similarity index 100% rename from openbsc/contrib/mgcp_server.py rename to contrib/mgcp_server.py diff --git a/openbsc/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c similarity index 100% rename from openbsc/contrib/nat/test_regexp.c rename to contrib/nat/test_regexp.c diff --git a/openbsc/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py similarity index 100% rename from openbsc/contrib/nat/ussd_example.py rename to contrib/nat/ussd_example.py diff --git a/openbsc/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl similarity index 100% rename from openbsc/contrib/rtp/gen_rtp_header.erl rename to contrib/rtp/gen_rtp_header.erl diff --git a/openbsc/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay.st rename to contrib/rtp/rtp_replay.st diff --git a/openbsc/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay_shared.st rename to contrib/rtp/rtp_replay_shared.st diff --git a/openbsc/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay_sip.st rename to contrib/rtp/rtp_replay_sip.st diff --git a/openbsc/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua similarity index 100% rename from openbsc/contrib/rtp/timestamp_rtp.lua rename to contrib/rtp/timestamp_rtp.lua diff --git a/openbsc/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st similarity index 100% rename from openbsc/contrib/sms/fill-hlr.st rename to contrib/sms/fill-hlr.st diff --git a/openbsc/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st similarity index 100% rename from openbsc/contrib/sms/hlr-query.st rename to contrib/sms/hlr-query.st diff --git a/openbsc/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d similarity index 100% rename from openbsc/contrib/sms/sqlite-probe.tap.d rename to contrib/sms/sqlite-probe.tap.d diff --git a/openbsc/contrib/soap.py b/contrib/soap.py similarity index 100% rename from openbsc/contrib/soap.py rename to contrib/soap.py diff --git a/openbsc/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service similarity index 100% rename from openbsc/contrib/systemd/osmo-bsc-mgcp.service rename to contrib/systemd/osmo-bsc-mgcp.service diff --git a/openbsc/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service similarity index 100% rename from openbsc/contrib/systemd/osmo-bsc.service rename to contrib/systemd/osmo-bsc.service diff --git a/openbsc/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service similarity index 100% rename from openbsc/contrib/systemd/osmo-gbproxy.service rename to contrib/systemd/osmo-gbproxy.service diff --git a/openbsc/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service similarity index 100% rename from openbsc/contrib/systemd/osmo-nitb.service rename to contrib/systemd/osmo-nitb.service diff --git a/openbsc/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service similarity index 100% rename from openbsc/contrib/systemd/osmo-sgsn.service rename to contrib/systemd/osmo-sgsn.service diff --git a/openbsc/contrib/testconv/Makefile b/contrib/testconv/Makefile similarity index 100% rename from openbsc/contrib/testconv/Makefile rename to contrib/testconv/Makefile diff --git a/openbsc/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c similarity index 100% rename from openbsc/contrib/testconv/testconv_main.c rename to contrib/testconv/testconv_main.c diff --git a/openbsc/contrib/twisted_ipa.py b/contrib/twisted_ipa.py similarity index 100% rename from openbsc/contrib/twisted_ipa.py rename to contrib/twisted_ipa.py diff --git a/openbsc/doc/BS11-OML.txt b/doc/BS11-OML.txt similarity index 100% rename from openbsc/doc/BS11-OML.txt rename to doc/BS11-OML.txt diff --git a/openbsc/doc/Makefile.am b/doc/Makefile.am similarity index 100% rename from openbsc/doc/Makefile.am rename to doc/Makefile.am diff --git a/openbsc/doc/call-routing.txt b/doc/call-routing.txt similarity index 100% rename from openbsc/doc/call-routing.txt rename to doc/call-routing.txt diff --git a/openbsc/doc/channel_release.txt b/doc/channel_release.txt similarity index 100% rename from openbsc/doc/channel_release.txt rename to doc/channel_release.txt diff --git a/openbsc/doc/e1-data-model.txt b/doc/e1-data-model.txt similarity index 100% rename from openbsc/doc/e1-data-model.txt rename to doc/e1-data-model.txt diff --git a/openbsc/doc/examples/Makefile.am b/doc/examples/Makefile.am similarity index 100% rename from openbsc/doc/examples/Makefile.am rename to doc/examples/Makefile.am diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg rename to doc/examples/osmo-bsc/osmo-bsc.cfg diff --git a/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg rename to doc/examples/osmo-bsc_mgcp/mgcp.cfg diff --git a/openbsc/doc/examples/osmo-bsc_nat/black-list.cfg b/doc/examples/osmo-bsc_nat/black-list.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/black-list.cfg rename to doc/examples/osmo-bsc_nat/black-list.cfg diff --git a/openbsc/doc/examples/osmo-bsc_nat/bscs.config b/doc/examples/osmo-bsc_nat/bscs.config similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/bscs.config rename to doc/examples/osmo-bsc_nat/bscs.config diff --git a/openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg rename to doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg diff --git a/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg rename to doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg diff --git a/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg rename to doc/examples/osmo-gbproxy/osmo-gbproxy.cfg diff --git a/openbsc/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/gtphub-example.txt rename to doc/examples/osmo-gtphub/gtphub-example.txt diff --git a/openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg rename to doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg diff --git a/openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg rename to doc/examples/osmo-gtphub/osmo-gtphub.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg b/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg b/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg b/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg b/doc/examples/osmo-nitb/bs11/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg rename to doc/examples/osmo-nitb/bs11/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg b/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg rename to doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg b/doc/examples/osmo-nitb/nanobts/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg rename to doc/examples/osmo-nitb/nanobts/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg b/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg rename to doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg b/doc/examples/osmo-nitb/rbs2308/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg rename to doc/examples/osmo-nitb/rbs2308/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg b/doc/examples/osmo-nitb/sysmobts/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg rename to doc/examples/osmo-nitb/sysmobts/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg similarity index 100% rename from openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg rename to doc/examples/osmo-sgsn/osmo-sgsn.cfg diff --git a/openbsc/doc/gsm-hopping.txt b/doc/gsm-hopping.txt similarity index 100% rename from openbsc/doc/gsm-hopping.txt rename to doc/gsm-hopping.txt diff --git a/openbsc/doc/handover.txt b/doc/handover.txt similarity index 100% rename from openbsc/doc/handover.txt rename to doc/handover.txt diff --git a/openbsc/doc/ipa-sccp.txt b/doc/ipa-sccp.txt similarity index 100% rename from openbsc/doc/ipa-sccp.txt rename to doc/ipa-sccp.txt diff --git a/openbsc/doc/oml-interface.txt b/doc/oml-interface.txt similarity index 100% rename from openbsc/doc/oml-interface.txt rename to doc/oml-interface.txt diff --git a/openbsc/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot similarity index 100% rename from openbsc/doc/osmo-nitb-data_structures.dot rename to doc/osmo-nitb-data_structures.dot diff --git a/openbsc/doc/paging.txt b/doc/paging.txt similarity index 100% rename from openbsc/doc/paging.txt rename to doc/paging.txt diff --git a/openbsc/git-version-gen b/git-version-gen similarity index 100% rename from openbsc/git-version-gen rename to git-version-gen diff --git a/openbsc/include/Makefile.am b/include/Makefile.am similarity index 100% rename from openbsc/include/Makefile.am rename to include/Makefile.am diff --git a/openbsc/include/compat_af_isdn.h b/include/compat_af_isdn.h similarity index 100% rename from openbsc/include/compat_af_isdn.h rename to include/compat_af_isdn.h diff --git a/openbsc/include/mISDNif.h b/include/mISDNif.h similarity index 100% rename from openbsc/include/mISDNif.h rename to include/mISDNif.h diff --git a/openbsc/include/openbsc/Makefile.am b/include/openbsc/Makefile.am similarity index 100% rename from openbsc/include/openbsc/Makefile.am rename to include/openbsc/Makefile.am diff --git a/openbsc/include/openbsc/abis_nm.h b/include/openbsc/abis_nm.h similarity index 100% rename from openbsc/include/openbsc/abis_nm.h rename to include/openbsc/abis_nm.h diff --git a/openbsc/include/openbsc/abis_om2000.h b/include/openbsc/abis_om2000.h similarity index 100% rename from openbsc/include/openbsc/abis_om2000.h rename to include/openbsc/abis_om2000.h diff --git a/openbsc/include/openbsc/abis_rsl.h b/include/openbsc/abis_rsl.h similarity index 100% rename from openbsc/include/openbsc/abis_rsl.h rename to include/openbsc/abis_rsl.h diff --git a/openbsc/include/openbsc/arfcn_range_encode.h b/include/openbsc/arfcn_range_encode.h similarity index 100% rename from openbsc/include/openbsc/arfcn_range_encode.h rename to include/openbsc/arfcn_range_encode.h diff --git a/openbsc/include/openbsc/auth.h b/include/openbsc/auth.h similarity index 100% rename from openbsc/include/openbsc/auth.h rename to include/openbsc/auth.h diff --git a/openbsc/include/openbsc/bsc_api.h b/include/openbsc/bsc_api.h similarity index 100% rename from openbsc/include/openbsc/bsc_api.h rename to include/openbsc/bsc_api.h diff --git a/openbsc/include/openbsc/bsc_msc.h b/include/openbsc/bsc_msc.h similarity index 100% rename from openbsc/include/openbsc/bsc_msc.h rename to include/openbsc/bsc_msc.h diff --git a/openbsc/include/openbsc/bsc_msc_data.h b/include/openbsc/bsc_msc_data.h similarity index 100% rename from openbsc/include/openbsc/bsc_msc_data.h rename to include/openbsc/bsc_msc_data.h diff --git a/openbsc/include/openbsc/bsc_msg_filter.h b/include/openbsc/bsc_msg_filter.h similarity index 100% rename from openbsc/include/openbsc/bsc_msg_filter.h rename to include/openbsc/bsc_msg_filter.h diff --git a/openbsc/include/openbsc/bsc_nat.h b/include/openbsc/bsc_nat.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat.h rename to include/openbsc/bsc_nat.h diff --git a/openbsc/include/openbsc/bsc_nat_callstats.h b/include/openbsc/bsc_nat_callstats.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat_callstats.h rename to include/openbsc/bsc_nat_callstats.h diff --git a/openbsc/include/openbsc/bsc_nat_sccp.h b/include/openbsc/bsc_nat_sccp.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat_sccp.h rename to include/openbsc/bsc_nat_sccp.h diff --git a/openbsc/include/openbsc/bsc_rll.h b/include/openbsc/bsc_rll.h similarity index 100% rename from openbsc/include/openbsc/bsc_rll.h rename to include/openbsc/bsc_rll.h diff --git a/openbsc/include/openbsc/bsc_subscriber.h b/include/openbsc/bsc_subscriber.h similarity index 100% rename from openbsc/include/openbsc/bsc_subscriber.h rename to include/openbsc/bsc_subscriber.h diff --git a/openbsc/include/openbsc/bss.h b/include/openbsc/bss.h similarity index 100% rename from openbsc/include/openbsc/bss.h rename to include/openbsc/bss.h diff --git a/openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/openbsc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/openbsc/bts_ipaccess_nanobts_omlattr.h diff --git a/openbsc/include/openbsc/chan_alloc.h b/include/openbsc/chan_alloc.h similarity index 100% rename from openbsc/include/openbsc/chan_alloc.h rename to include/openbsc/chan_alloc.h diff --git a/openbsc/include/openbsc/common_bsc.h b/include/openbsc/common_bsc.h similarity index 100% rename from openbsc/include/openbsc/common_bsc.h rename to include/openbsc/common_bsc.h diff --git a/openbsc/include/openbsc/common_cs.h b/include/openbsc/common_cs.h similarity index 100% rename from openbsc/include/openbsc/common_cs.h rename to include/openbsc/common_cs.h diff --git a/openbsc/include/openbsc/crc24.h b/include/openbsc/crc24.h similarity index 100% rename from openbsc/include/openbsc/crc24.h rename to include/openbsc/crc24.h diff --git a/openbsc/include/openbsc/ctrl.h b/include/openbsc/ctrl.h similarity index 100% rename from openbsc/include/openbsc/ctrl.h rename to include/openbsc/ctrl.h diff --git a/openbsc/include/openbsc/db.h b/include/openbsc/db.h similarity index 100% rename from openbsc/include/openbsc/db.h rename to include/openbsc/db.h diff --git a/openbsc/include/openbsc/debug.h b/include/openbsc/debug.h similarity index 100% rename from openbsc/include/openbsc/debug.h rename to include/openbsc/debug.h diff --git a/openbsc/include/openbsc/e1_config.h b/include/openbsc/e1_config.h similarity index 100% rename from openbsc/include/openbsc/e1_config.h rename to include/openbsc/e1_config.h diff --git a/openbsc/include/openbsc/gb_proxy.h b/include/openbsc/gb_proxy.h similarity index 100% rename from openbsc/include/openbsc/gb_proxy.h rename to include/openbsc/gb_proxy.h diff --git a/openbsc/include/openbsc/gprs_gb_parse.h b/include/openbsc/gprs_gb_parse.h similarity index 100% rename from openbsc/include/openbsc/gprs_gb_parse.h rename to include/openbsc/gprs_gb_parse.h diff --git a/openbsc/include/openbsc/gprs_gmm.h b/include/openbsc/gprs_gmm.h similarity index 100% rename from openbsc/include/openbsc/gprs_gmm.h rename to include/openbsc/gprs_gmm.h diff --git a/openbsc/include/openbsc/gprs_llc.h b/include/openbsc/gprs_llc.h similarity index 100% rename from openbsc/include/openbsc/gprs_llc.h rename to include/openbsc/gprs_llc.h diff --git a/openbsc/include/openbsc/gprs_llc_xid.h b/include/openbsc/gprs_llc_xid.h similarity index 100% rename from openbsc/include/openbsc/gprs_llc_xid.h rename to include/openbsc/gprs_llc_xid.h diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h similarity index 100% rename from openbsc/include/openbsc/gprs_sgsn.h rename to include/openbsc/gprs_sgsn.h diff --git a/openbsc/include/openbsc/gprs_sndcp.h b/include/openbsc/gprs_sndcp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp.h rename to include/openbsc/gprs_sndcp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_comp.h b/include/openbsc/gprs_sndcp_comp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_comp.h rename to include/openbsc/gprs_sndcp_comp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_dcomp.h b/include/openbsc/gprs_sndcp_dcomp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_dcomp.h rename to include/openbsc/gprs_sndcp_dcomp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_pcomp.h b/include/openbsc/gprs_sndcp_pcomp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_pcomp.h rename to include/openbsc/gprs_sndcp_pcomp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_xid.h b/include/openbsc/gprs_sndcp_xid.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_xid.h rename to include/openbsc/gprs_sndcp_xid.h diff --git a/openbsc/include/openbsc/gprs_subscriber.h b/include/openbsc/gprs_subscriber.h similarity index 100% rename from openbsc/include/openbsc/gprs_subscriber.h rename to include/openbsc/gprs_subscriber.h diff --git a/openbsc/include/openbsc/gprs_utils.h b/include/openbsc/gprs_utils.h similarity index 100% rename from openbsc/include/openbsc/gprs_utils.h rename to include/openbsc/gprs_utils.h diff --git a/openbsc/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_08.h rename to include/openbsc/gsm_04_08.h diff --git a/openbsc/include/openbsc/gsm_04_11.h b/include/openbsc/gsm_04_11.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_11.h rename to include/openbsc/gsm_04_11.h diff --git a/openbsc/include/openbsc/gsm_04_80.h b/include/openbsc/gsm_04_80.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_80.h rename to include/openbsc/gsm_04_80.h diff --git a/openbsc/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h similarity index 100% rename from openbsc/include/openbsc/gsm_data.h rename to include/openbsc/gsm_data.h diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/include/openbsc/gsm_data_shared.h similarity index 100% rename from openbsc/include/openbsc/gsm_data_shared.h rename to include/openbsc/gsm_data_shared.h diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h similarity index 100% rename from openbsc/include/openbsc/gsm_subscriber.h rename to include/openbsc/gsm_subscriber.h diff --git a/openbsc/include/openbsc/gsup_client.h b/include/openbsc/gsup_client.h similarity index 100% rename from openbsc/include/openbsc/gsup_client.h rename to include/openbsc/gsup_client.h diff --git a/openbsc/include/openbsc/gtphub.h b/include/openbsc/gtphub.h similarity index 100% rename from openbsc/include/openbsc/gtphub.h rename to include/openbsc/gtphub.h diff --git a/openbsc/include/openbsc/handover.h b/include/openbsc/handover.h similarity index 100% rename from openbsc/include/openbsc/handover.h rename to include/openbsc/handover.h diff --git a/openbsc/include/openbsc/handover_decision.h b/include/openbsc/handover_decision.h similarity index 100% rename from openbsc/include/openbsc/handover_decision.h rename to include/openbsc/handover_decision.h diff --git a/openbsc/include/openbsc/ipaccess.h b/include/openbsc/ipaccess.h similarity index 100% rename from openbsc/include/openbsc/ipaccess.h rename to include/openbsc/ipaccess.h diff --git a/openbsc/include/openbsc/iu.h b/include/openbsc/iu.h similarity index 100% rename from openbsc/include/openbsc/iu.h rename to include/openbsc/iu.h diff --git a/openbsc/include/openbsc/meas_feed.h b/include/openbsc/meas_feed.h similarity index 100% rename from openbsc/include/openbsc/meas_feed.h rename to include/openbsc/meas_feed.h diff --git a/openbsc/include/openbsc/meas_rep.h b/include/openbsc/meas_rep.h similarity index 100% rename from openbsc/include/openbsc/meas_rep.h rename to include/openbsc/meas_rep.h diff --git a/openbsc/include/openbsc/mgcp.h b/include/openbsc/mgcp.h similarity index 100% rename from openbsc/include/openbsc/mgcp.h rename to include/openbsc/mgcp.h diff --git a/openbsc/include/openbsc/mgcp_internal.h b/include/openbsc/mgcp_internal.h similarity index 100% rename from openbsc/include/openbsc/mgcp_internal.h rename to include/openbsc/mgcp_internal.h diff --git a/openbsc/include/openbsc/mgcp_transcode.h b/include/openbsc/mgcp_transcode.h similarity index 100% rename from openbsc/include/openbsc/mgcp_transcode.h rename to include/openbsc/mgcp_transcode.h diff --git a/openbsc/include/openbsc/misdn.h b/include/openbsc/misdn.h similarity index 100% rename from openbsc/include/openbsc/misdn.h rename to include/openbsc/misdn.h diff --git a/openbsc/include/openbsc/mncc.h b/include/openbsc/mncc.h similarity index 100% rename from openbsc/include/openbsc/mncc.h rename to include/openbsc/mncc.h diff --git a/openbsc/include/openbsc/mncc_int.h b/include/openbsc/mncc_int.h similarity index 100% rename from openbsc/include/openbsc/mncc_int.h rename to include/openbsc/mncc_int.h diff --git a/openbsc/include/openbsc/nat_rewrite_trie.h b/include/openbsc/nat_rewrite_trie.h similarity index 100% rename from openbsc/include/openbsc/nat_rewrite_trie.h rename to include/openbsc/nat_rewrite_trie.h diff --git a/openbsc/include/openbsc/network_listen.h b/include/openbsc/network_listen.h similarity index 100% rename from openbsc/include/openbsc/network_listen.h rename to include/openbsc/network_listen.h diff --git a/openbsc/include/openbsc/oap_client.h b/include/openbsc/oap_client.h similarity index 100% rename from openbsc/include/openbsc/oap_client.h rename to include/openbsc/oap_client.h diff --git a/openbsc/include/openbsc/openbscdefines.h b/include/openbsc/openbscdefines.h similarity index 100% rename from openbsc/include/openbsc/openbscdefines.h rename to include/openbsc/openbscdefines.h diff --git a/openbsc/include/openbsc/osmo_bsc.h b/include/openbsc/osmo_bsc.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc.h rename to include/openbsc/osmo_bsc.h diff --git a/openbsc/include/openbsc/osmo_bsc_grace.h b/include/openbsc/osmo_bsc_grace.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc_grace.h rename to include/openbsc/osmo_bsc_grace.h diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/include/openbsc/osmo_bsc_rf.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc_rf.h rename to include/openbsc/osmo_bsc_rf.h diff --git a/openbsc/include/openbsc/osmo_msc.h b/include/openbsc/osmo_msc.h similarity index 100% rename from openbsc/include/openbsc/osmo_msc.h rename to include/openbsc/osmo_msc.h diff --git a/openbsc/include/openbsc/osmux.h b/include/openbsc/osmux.h similarity index 100% rename from openbsc/include/openbsc/osmux.h rename to include/openbsc/osmux.h diff --git a/openbsc/include/openbsc/paging.h b/include/openbsc/paging.h similarity index 100% rename from openbsc/include/openbsc/paging.h rename to include/openbsc/paging.h diff --git a/openbsc/include/openbsc/pcu_if.h b/include/openbsc/pcu_if.h similarity index 100% rename from openbsc/include/openbsc/pcu_if.h rename to include/openbsc/pcu_if.h diff --git a/openbsc/include/openbsc/pcuif_proto.h b/include/openbsc/pcuif_proto.h similarity index 100% rename from openbsc/include/openbsc/pcuif_proto.h rename to include/openbsc/pcuif_proto.h diff --git a/openbsc/include/openbsc/rest_octets.h b/include/openbsc/rest_octets.h similarity index 100% rename from openbsc/include/openbsc/rest_octets.h rename to include/openbsc/rest_octets.h diff --git a/openbsc/include/openbsc/rrlp.h b/include/openbsc/rrlp.h similarity index 100% rename from openbsc/include/openbsc/rrlp.h rename to include/openbsc/rrlp.h diff --git a/openbsc/include/openbsc/rs232.h b/include/openbsc/rs232.h similarity index 100% rename from openbsc/include/openbsc/rs232.h rename to include/openbsc/rs232.h diff --git a/openbsc/include/openbsc/rtp_proxy.h b/include/openbsc/rtp_proxy.h similarity index 100% rename from openbsc/include/openbsc/rtp_proxy.h rename to include/openbsc/rtp_proxy.h diff --git a/openbsc/include/openbsc/sgsn.h b/include/openbsc/sgsn.h similarity index 100% rename from openbsc/include/openbsc/sgsn.h rename to include/openbsc/sgsn.h diff --git a/openbsc/include/openbsc/signal.h b/include/openbsc/signal.h similarity index 100% rename from openbsc/include/openbsc/signal.h rename to include/openbsc/signal.h diff --git a/openbsc/include/openbsc/silent_call.h b/include/openbsc/silent_call.h similarity index 100% rename from openbsc/include/openbsc/silent_call.h rename to include/openbsc/silent_call.h diff --git a/openbsc/include/openbsc/slhc.h b/include/openbsc/slhc.h similarity index 100% rename from openbsc/include/openbsc/slhc.h rename to include/openbsc/slhc.h diff --git a/openbsc/include/openbsc/smpp.h b/include/openbsc/smpp.h similarity index 100% rename from openbsc/include/openbsc/smpp.h rename to include/openbsc/smpp.h diff --git a/openbsc/include/openbsc/sms_queue.h b/include/openbsc/sms_queue.h similarity index 100% rename from openbsc/include/openbsc/sms_queue.h rename to include/openbsc/sms_queue.h diff --git a/openbsc/include/openbsc/socket.h b/include/openbsc/socket.h similarity index 100% rename from openbsc/include/openbsc/socket.h rename to include/openbsc/socket.h diff --git a/openbsc/include/openbsc/system_information.h b/include/openbsc/system_information.h similarity index 100% rename from openbsc/include/openbsc/system_information.h rename to include/openbsc/system_information.h diff --git a/openbsc/include/openbsc/token_auth.h b/include/openbsc/token_auth.h similarity index 100% rename from openbsc/include/openbsc/token_auth.h rename to include/openbsc/token_auth.h diff --git a/openbsc/include/openbsc/transaction.h b/include/openbsc/transaction.h similarity index 100% rename from openbsc/include/openbsc/transaction.h rename to include/openbsc/transaction.h diff --git a/openbsc/include/openbsc/trau_mux.h b/include/openbsc/trau_mux.h similarity index 100% rename from openbsc/include/openbsc/trau_mux.h rename to include/openbsc/trau_mux.h diff --git a/openbsc/include/openbsc/trau_upqueue.h b/include/openbsc/trau_upqueue.h similarity index 100% rename from openbsc/include/openbsc/trau_upqueue.h rename to include/openbsc/trau_upqueue.h diff --git a/openbsc/include/openbsc/ussd.h b/include/openbsc/ussd.h similarity index 100% rename from openbsc/include/openbsc/ussd.h rename to include/openbsc/ussd.h diff --git a/openbsc/include/openbsc/v42bis.h b/include/openbsc/v42bis.h similarity index 100% rename from openbsc/include/openbsc/v42bis.h rename to include/openbsc/v42bis.h diff --git a/openbsc/include/openbsc/v42bis_private.h b/include/openbsc/v42bis_private.h similarity index 100% rename from openbsc/include/openbsc/v42bis_private.h rename to include/openbsc/v42bis_private.h diff --git a/openbsc/include/openbsc/vty.h b/include/openbsc/vty.h similarity index 100% rename from openbsc/include/openbsc/vty.h rename to include/openbsc/vty.h diff --git a/openbsc/m4/README b/m4/README similarity index 100% rename from openbsc/m4/README rename to m4/README diff --git a/openbsc/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 similarity index 100% rename from openbsc/m4/ax_check_compile_flag.m4 rename to m4/ax_check_compile_flag.m4 diff --git a/openbsc/openbsc.pc.in b/openbsc.pc.in similarity index 100% rename from openbsc/openbsc.pc.in rename to openbsc.pc.in diff --git a/openbsc/osmoappdesc.py b/osmoappdesc.py similarity index 100% rename from openbsc/osmoappdesc.py rename to osmoappdesc.py diff --git a/openbsc/src/Makefile.am b/src/Makefile.am similarity index 100% rename from openbsc/src/Makefile.am rename to src/Makefile.am diff --git a/openbsc/src/gprs/.gitignore b/src/gprs/.gitignore similarity index 100% rename from openbsc/src/gprs/.gitignore rename to src/gprs/.gitignore diff --git a/openbsc/src/gprs/Makefile.am b/src/gprs/Makefile.am similarity index 100% rename from openbsc/src/gprs/Makefile.am rename to src/gprs/Makefile.am diff --git a/openbsc/src/gprs/crc24.c b/src/gprs/crc24.c similarity index 100% rename from openbsc/src/gprs/crc24.c rename to src/gprs/crc24.c diff --git a/openbsc/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c similarity index 100% rename from openbsc/src/gprs/gb_proxy.c rename to src/gprs/gb_proxy.c diff --git a/openbsc/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_main.c rename to src/gprs/gb_proxy_main.c diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_patch.c rename to src/gprs/gb_proxy_patch.c diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_peer.c rename to src/gprs/gb_proxy_peer.c diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/src/gprs/gb_proxy_tlli.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_tlli.c rename to src/gprs/gb_proxy_tlli.c diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_vty.c rename to src/gprs/gb_proxy_vty.c diff --git a/openbsc/src/gprs/gprs_gb_parse.c b/src/gprs/gprs_gb_parse.c similarity index 100% rename from openbsc/src/gprs/gprs_gb_parse.c rename to src/gprs/gprs_gb_parse.c diff --git a/openbsc/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c similarity index 100% rename from openbsc/src/gprs/gprs_gmm.c rename to src/gprs/gprs_gmm.c diff --git a/openbsc/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c similarity index 100% rename from openbsc/src/gprs/gprs_llc.c rename to src/gprs/gprs_llc.c diff --git a/openbsc/src/gprs/gprs_llc_parse.c b/src/gprs/gprs_llc_parse.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_parse.c rename to src/gprs/gprs_llc_parse.c diff --git a/openbsc/src/gprs/gprs_llc_vty.c b/src/gprs/gprs_llc_vty.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_vty.c rename to src/gprs/gprs_llc_vty.c diff --git a/openbsc/src/gprs/gprs_llc_xid.c b/src/gprs/gprs_llc_xid.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_xid.c rename to src/gprs/gprs_llc_xid.c diff --git a/openbsc/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c similarity index 100% rename from openbsc/src/gprs/gprs_sgsn.c rename to src/gprs/gprs_sgsn.c diff --git a/openbsc/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp.c rename to src/gprs/gprs_sndcp.c diff --git a/openbsc/src/gprs/gprs_sndcp_comp.c b/src/gprs/gprs_sndcp_comp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_comp.c rename to src/gprs/gprs_sndcp_comp.c diff --git a/openbsc/src/gprs/gprs_sndcp_dcomp.c b/src/gprs/gprs_sndcp_dcomp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_dcomp.c rename to src/gprs/gprs_sndcp_dcomp.c diff --git a/openbsc/src/gprs/gprs_sndcp_pcomp.c b/src/gprs/gprs_sndcp_pcomp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_pcomp.c rename to src/gprs/gprs_sndcp_pcomp.c diff --git a/openbsc/src/gprs/gprs_sndcp_vty.c b/src/gprs/gprs_sndcp_vty.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_vty.c rename to src/gprs/gprs_sndcp_vty.c diff --git a/openbsc/src/gprs/gprs_sndcp_xid.c b/src/gprs/gprs_sndcp_xid.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_xid.c rename to src/gprs/gprs_sndcp_xid.c diff --git a/openbsc/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c similarity index 100% rename from openbsc/src/gprs/gprs_subscriber.c rename to src/gprs/gprs_subscriber.c diff --git a/openbsc/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c similarity index 100% rename from openbsc/src/gprs/gprs_utils.c rename to src/gprs/gprs_utils.c diff --git a/openbsc/src/gprs/gtphub.c b/src/gprs/gtphub.c similarity index 100% rename from openbsc/src/gprs/gtphub.c rename to src/gprs/gtphub.c diff --git a/openbsc/src/gprs/gtphub_ares.c b/src/gprs/gtphub_ares.c similarity index 100% rename from openbsc/src/gprs/gtphub_ares.c rename to src/gprs/gtphub_ares.c diff --git a/openbsc/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c similarity index 100% rename from openbsc/src/gprs/gtphub_main.c rename to src/gprs/gtphub_main.c diff --git a/openbsc/src/gprs/gtphub_sock.c b/src/gprs/gtphub_sock.c similarity index 100% rename from openbsc/src/gprs/gtphub_sock.c rename to src/gprs/gtphub_sock.c diff --git a/openbsc/src/gprs/gtphub_vty.c b/src/gprs/gtphub_vty.c similarity index 100% rename from openbsc/src/gprs/gtphub_vty.c rename to src/gprs/gtphub_vty.c diff --git a/openbsc/src/gprs/osmo_sgsn.cfg b/src/gprs/osmo_sgsn.cfg similarity index 100% rename from openbsc/src/gprs/osmo_sgsn.cfg rename to src/gprs/osmo_sgsn.cfg diff --git a/openbsc/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c similarity index 100% rename from openbsc/src/gprs/sgsn_ares.c rename to src/gprs/sgsn_ares.c diff --git a/openbsc/src/gprs/sgsn_auth.c b/src/gprs/sgsn_auth.c similarity index 100% rename from openbsc/src/gprs/sgsn_auth.c rename to src/gprs/sgsn_auth.c diff --git a/openbsc/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c similarity index 100% rename from openbsc/src/gprs/sgsn_cdr.c rename to src/gprs/sgsn_cdr.c diff --git a/openbsc/src/gprs/sgsn_ctrl.c b/src/gprs/sgsn_ctrl.c similarity index 100% rename from openbsc/src/gprs/sgsn_ctrl.c rename to src/gprs/sgsn_ctrl.c diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c similarity index 100% rename from openbsc/src/gprs/sgsn_libgtp.c rename to src/gprs/sgsn_libgtp.c diff --git a/openbsc/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c similarity index 100% rename from openbsc/src/gprs/sgsn_main.c rename to src/gprs/sgsn_main.c diff --git a/openbsc/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c similarity index 100% rename from openbsc/src/gprs/sgsn_vty.c rename to src/gprs/sgsn_vty.c diff --git a/openbsc/src/gprs/slhc.c b/src/gprs/slhc.c similarity index 100% rename from openbsc/src/gprs/slhc.c rename to src/gprs/slhc.c diff --git a/openbsc/src/gprs/v42bis.c b/src/gprs/v42bis.c similarity index 100% rename from openbsc/src/gprs/v42bis.c rename to src/gprs/v42bis.c diff --git a/openbsc/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am similarity index 100% rename from openbsc/src/ipaccess/Makefile.am rename to src/ipaccess/Makefile.am diff --git a/openbsc/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c similarity index 100% rename from openbsc/src/ipaccess/abisip-find.c rename to src/ipaccess/abisip-find.c diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-config.c rename to src/ipaccess/ipaccess-config.c diff --git a/openbsc/src/ipaccess/ipaccess-firmware.c b/src/ipaccess/ipaccess-firmware.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-firmware.c rename to src/ipaccess/ipaccess-firmware.c diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-proxy.c rename to src/ipaccess/ipaccess-proxy.c diff --git a/openbsc/src/ipaccess/network_listen.c b/src/ipaccess/network_listen.c similarity index 100% rename from openbsc/src/ipaccess/network_listen.c rename to src/ipaccess/network_listen.c diff --git a/openbsc/src/libbsc/Makefile.am b/src/libbsc/Makefile.am similarity index 100% rename from openbsc/src/libbsc/Makefile.am rename to src/libbsc/Makefile.am diff --git a/openbsc/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c similarity index 100% rename from openbsc/src/libbsc/abis_nm.c rename to src/libbsc/abis_nm.c diff --git a/openbsc/src/libbsc/abis_nm_ipaccess.c b/src/libbsc/abis_nm_ipaccess.c similarity index 100% rename from openbsc/src/libbsc/abis_nm_ipaccess.c rename to src/libbsc/abis_nm_ipaccess.c diff --git a/openbsc/src/libbsc/abis_nm_vty.c b/src/libbsc/abis_nm_vty.c similarity index 100% rename from openbsc/src/libbsc/abis_nm_vty.c rename to src/libbsc/abis_nm_vty.c diff --git a/openbsc/src/libbsc/abis_om2000.c b/src/libbsc/abis_om2000.c similarity index 100% rename from openbsc/src/libbsc/abis_om2000.c rename to src/libbsc/abis_om2000.c diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/src/libbsc/abis_om2000_vty.c similarity index 100% rename from openbsc/src/libbsc/abis_om2000_vty.c rename to src/libbsc/abis_om2000_vty.c diff --git a/openbsc/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c similarity index 100% rename from openbsc/src/libbsc/abis_rsl.c rename to src/libbsc/abis_rsl.c diff --git a/openbsc/src/libbsc/arfcn_range_encode.c b/src/libbsc/arfcn_range_encode.c similarity index 100% rename from openbsc/src/libbsc/arfcn_range_encode.c rename to src/libbsc/arfcn_range_encode.c diff --git a/openbsc/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c similarity index 100% rename from openbsc/src/libbsc/bsc_api.c rename to src/libbsc/bsc_api.c diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c similarity index 100% rename from openbsc/src/libbsc/bsc_ctrl_commands.c rename to src/libbsc/bsc_ctrl_commands.c diff --git a/openbsc/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c similarity index 100% rename from openbsc/src/libbsc/bsc_ctrl_lookup.c rename to src/libbsc/bsc_ctrl_lookup.c diff --git a/openbsc/src/libbsc/bsc_dyn_ts.c b/src/libbsc/bsc_dyn_ts.c similarity index 100% rename from openbsc/src/libbsc/bsc_dyn_ts.c rename to src/libbsc/bsc_dyn_ts.c diff --git a/openbsc/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c similarity index 100% rename from openbsc/src/libbsc/bsc_init.c rename to src/libbsc/bsc_init.c diff --git a/openbsc/src/libbsc/bsc_msc.c b/src/libbsc/bsc_msc.c similarity index 100% rename from openbsc/src/libbsc/bsc_msc.c rename to src/libbsc/bsc_msc.c diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c similarity index 100% rename from openbsc/src/libbsc/bsc_rf_ctrl.c rename to src/libbsc/bsc_rf_ctrl.c diff --git a/openbsc/src/libbsc/bsc_rll.c b/src/libbsc/bsc_rll.c similarity index 100% rename from openbsc/src/libbsc/bsc_rll.c rename to src/libbsc/bsc_rll.c diff --git a/openbsc/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c similarity index 100% rename from openbsc/src/libbsc/bsc_subscriber.c rename to src/libbsc/bsc_subscriber.c diff --git a/openbsc/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c similarity index 100% rename from openbsc/src/libbsc/bsc_vty.c rename to src/libbsc/bsc_vty.c diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/src/libbsc/bts_ericsson_rbs2000.c similarity index 100% rename from openbsc/src/libbsc/bts_ericsson_rbs2000.c rename to src/libbsc/bts_ericsson_rbs2000.c diff --git a/openbsc/src/libbsc/bts_init.c b/src/libbsc/bts_init.c similarity index 100% rename from openbsc/src/libbsc/bts_init.c rename to src/libbsc/bts_init.c diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c similarity index 100% rename from openbsc/src/libbsc/bts_ipaccess_nanobts.c rename to src/libbsc/bts_ipaccess_nanobts.c diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/src/libbsc/bts_ipaccess_nanobts_omlattr.c similarity index 100% rename from openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c rename to src/libbsc/bts_ipaccess_nanobts_omlattr.c diff --git a/openbsc/src/libbsc/bts_nokia_site.c b/src/libbsc/bts_nokia_site.c similarity index 100% rename from openbsc/src/libbsc/bts_nokia_site.c rename to src/libbsc/bts_nokia_site.c diff --git a/openbsc/src/libbsc/bts_siemens_bs11.c b/src/libbsc/bts_siemens_bs11.c similarity index 100% rename from openbsc/src/libbsc/bts_siemens_bs11.c rename to src/libbsc/bts_siemens_bs11.c diff --git a/openbsc/src/libbsc/bts_sysmobts.c b/src/libbsc/bts_sysmobts.c similarity index 100% rename from openbsc/src/libbsc/bts_sysmobts.c rename to src/libbsc/bts_sysmobts.c diff --git a/openbsc/src/libbsc/bts_unknown.c b/src/libbsc/bts_unknown.c similarity index 100% rename from openbsc/src/libbsc/bts_unknown.c rename to src/libbsc/bts_unknown.c diff --git a/openbsc/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c similarity index 100% rename from openbsc/src/libbsc/chan_alloc.c rename to src/libbsc/chan_alloc.c diff --git a/openbsc/src/libbsc/e1_config.c b/src/libbsc/e1_config.c similarity index 100% rename from openbsc/src/libbsc/e1_config.c rename to src/libbsc/e1_config.c diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c similarity index 100% rename from openbsc/src/libbsc/gsm_04_08_utils.c rename to src/libbsc/gsm_04_08_utils.c diff --git a/openbsc/src/libbsc/gsm_04_80_utils.c b/src/libbsc/gsm_04_80_utils.c similarity index 100% rename from openbsc/src/libbsc/gsm_04_80_utils.c rename to src/libbsc/gsm_04_80_utils.c diff --git a/openbsc/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c similarity index 100% rename from openbsc/src/libbsc/handover_decision.c rename to src/libbsc/handover_decision.c diff --git a/openbsc/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c similarity index 100% rename from openbsc/src/libbsc/handover_logic.c rename to src/libbsc/handover_logic.c diff --git a/openbsc/src/libbsc/meas_proc.c b/src/libbsc/meas_proc.c similarity index 100% rename from openbsc/src/libbsc/meas_proc.c rename to src/libbsc/meas_proc.c diff --git a/openbsc/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c similarity index 100% rename from openbsc/src/libbsc/meas_rep.c rename to src/libbsc/meas_rep.c diff --git a/openbsc/src/libbsc/net_init.c b/src/libbsc/net_init.c similarity index 100% rename from openbsc/src/libbsc/net_init.c rename to src/libbsc/net_init.c diff --git a/openbsc/src/libbsc/paging.c b/src/libbsc/paging.c similarity index 100% rename from openbsc/src/libbsc/paging.c rename to src/libbsc/paging.c diff --git a/openbsc/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c similarity index 100% rename from openbsc/src/libbsc/pcu_sock.c rename to src/libbsc/pcu_sock.c diff --git a/openbsc/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c similarity index 100% rename from openbsc/src/libbsc/rest_octets.c rename to src/libbsc/rest_octets.c diff --git a/openbsc/src/libbsc/system_information.c b/src/libbsc/system_information.c similarity index 100% rename from openbsc/src/libbsc/system_information.c rename to src/libbsc/system_information.c diff --git a/openbsc/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am similarity index 100% rename from openbsc/src/libcommon-cs/Makefile.am rename to src/libcommon-cs/Makefile.am diff --git a/openbsc/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c similarity index 100% rename from openbsc/src/libcommon-cs/common_cs.c rename to src/libcommon-cs/common_cs.c diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c similarity index 100% rename from openbsc/src/libcommon-cs/common_cs_vty.c rename to src/libcommon-cs/common_cs_vty.c diff --git a/openbsc/src/libcommon/Makefile.am b/src/libcommon/Makefile.am similarity index 100% rename from openbsc/src/libcommon/Makefile.am rename to src/libcommon/Makefile.am diff --git a/openbsc/src/libcommon/bsc_version.c b/src/libcommon/bsc_version.c similarity index 100% rename from openbsc/src/libcommon/bsc_version.c rename to src/libcommon/bsc_version.c diff --git a/openbsc/src/libcommon/common_vty.c b/src/libcommon/common_vty.c similarity index 100% rename from openbsc/src/libcommon/common_vty.c rename to src/libcommon/common_vty.c diff --git a/openbsc/src/libcommon/debug.c b/src/libcommon/debug.c similarity index 100% rename from openbsc/src/libcommon/debug.c rename to src/libcommon/debug.c diff --git a/openbsc/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c similarity index 100% rename from openbsc/src/libcommon/gsm_data.c rename to src/libcommon/gsm_data.c diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c similarity index 100% rename from openbsc/src/libcommon/gsm_data_shared.c rename to src/libcommon/gsm_data_shared.c diff --git a/openbsc/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c similarity index 100% rename from openbsc/src/libcommon/gsm_subscriber_base.c rename to src/libcommon/gsm_subscriber_base.c diff --git a/openbsc/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c similarity index 100% rename from openbsc/src/libcommon/gsup_client.c rename to src/libcommon/gsup_client.c diff --git a/openbsc/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c similarity index 100% rename from openbsc/src/libcommon/gsup_test_client.c rename to src/libcommon/gsup_test_client.c diff --git a/openbsc/src/libcommon/oap_client.c b/src/libcommon/oap_client.c similarity index 100% rename from openbsc/src/libcommon/oap_client.c rename to src/libcommon/oap_client.c diff --git a/openbsc/src/libcommon/socket.c b/src/libcommon/socket.c similarity index 100% rename from openbsc/src/libcommon/socket.c rename to src/libcommon/socket.c diff --git a/openbsc/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c similarity index 100% rename from openbsc/src/libcommon/talloc_ctx.c rename to src/libcommon/talloc_ctx.c diff --git a/openbsc/src/libfilter/Makefile.am b/src/libfilter/Makefile.am similarity index 100% rename from openbsc/src/libfilter/Makefile.am rename to src/libfilter/Makefile.am diff --git a/openbsc/src/libfilter/bsc_msg_acc.c b/src/libfilter/bsc_msg_acc.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_acc.c rename to src/libfilter/bsc_msg_acc.c diff --git a/openbsc/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_filter.c rename to src/libfilter/bsc_msg_filter.c diff --git a/openbsc/src/libfilter/bsc_msg_vty.c b/src/libfilter/bsc_msg_vty.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_vty.c rename to src/libfilter/bsc_msg_vty.c diff --git a/openbsc/src/libiu/Makefile.am b/src/libiu/Makefile.am similarity index 100% rename from openbsc/src/libiu/Makefile.am rename to src/libiu/Makefile.am diff --git a/openbsc/src/libiu/iu.c b/src/libiu/iu.c similarity index 100% rename from openbsc/src/libiu/iu.c rename to src/libiu/iu.c diff --git a/openbsc/src/libiu/iu_vty.c b/src/libiu/iu_vty.c similarity index 100% rename from openbsc/src/libiu/iu_vty.c rename to src/libiu/iu_vty.c diff --git a/openbsc/src/libmgcp/Makefile.am b/src/libmgcp/Makefile.am similarity index 100% rename from openbsc/src/libmgcp/Makefile.am rename to src/libmgcp/Makefile.am diff --git a/openbsc/src/libmgcp/g711common.h b/src/libmgcp/g711common.h similarity index 100% rename from openbsc/src/libmgcp/g711common.h rename to src/libmgcp/g711common.h diff --git a/openbsc/src/libmgcp/mgcp_network.c b/src/libmgcp/mgcp_network.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_network.c rename to src/libmgcp/mgcp_network.c diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/src/libmgcp/mgcp_osmux.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_osmux.c rename to src/libmgcp/mgcp_osmux.c diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/src/libmgcp/mgcp_protocol.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_protocol.c rename to src/libmgcp/mgcp_protocol.c diff --git a/openbsc/src/libmgcp/mgcp_sdp.c b/src/libmgcp/mgcp_sdp.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_sdp.c rename to src/libmgcp/mgcp_sdp.c diff --git a/openbsc/src/libmgcp/mgcp_transcode.c b/src/libmgcp/mgcp_transcode.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_transcode.c rename to src/libmgcp/mgcp_transcode.c diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/src/libmgcp/mgcp_vty.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_vty.c rename to src/libmgcp/mgcp_vty.c diff --git a/openbsc/src/libmsc/Makefile.am b/src/libmsc/Makefile.am similarity index 100% rename from openbsc/src/libmsc/Makefile.am rename to src/libmsc/Makefile.am diff --git a/openbsc/src/libmsc/auth.c b/src/libmsc/auth.c similarity index 100% rename from openbsc/src/libmsc/auth.c rename to src/libmsc/auth.c diff --git a/openbsc/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c similarity index 100% rename from openbsc/src/libmsc/ctrl_commands.c rename to src/libmsc/ctrl_commands.c diff --git a/openbsc/src/libmsc/db.c b/src/libmsc/db.c similarity index 100% rename from openbsc/src/libmsc/db.c rename to src/libmsc/db.c diff --git a/openbsc/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_08.c rename to src/libmsc/gsm_04_08.c diff --git a/openbsc/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_11.c rename to src/libmsc/gsm_04_11.c diff --git a/openbsc/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_80.c rename to src/libmsc/gsm_04_80.c diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c similarity index 100% rename from openbsc/src/libmsc/gsm_subscriber.c rename to src/libmsc/gsm_subscriber.c diff --git a/openbsc/src/libmsc/meas_feed.c b/src/libmsc/meas_feed.c similarity index 100% rename from openbsc/src/libmsc/meas_feed.c rename to src/libmsc/meas_feed.c diff --git a/openbsc/src/libmsc/meas_feed.h b/src/libmsc/meas_feed.h similarity index 100% rename from openbsc/src/libmsc/meas_feed.h rename to src/libmsc/meas_feed.h diff --git a/openbsc/src/libmsc/mncc.c b/src/libmsc/mncc.c similarity index 100% rename from openbsc/src/libmsc/mncc.c rename to src/libmsc/mncc.c diff --git a/openbsc/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c similarity index 100% rename from openbsc/src/libmsc/mncc_builtin.c rename to src/libmsc/mncc_builtin.c diff --git a/openbsc/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c similarity index 100% rename from openbsc/src/libmsc/mncc_sock.c rename to src/libmsc/mncc_sock.c diff --git a/openbsc/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c similarity index 100% rename from openbsc/src/libmsc/osmo_msc.c rename to src/libmsc/osmo_msc.c diff --git a/openbsc/src/libmsc/rrlp.c b/src/libmsc/rrlp.c similarity index 100% rename from openbsc/src/libmsc/rrlp.c rename to src/libmsc/rrlp.c diff --git a/openbsc/src/libmsc/silent_call.c b/src/libmsc/silent_call.c similarity index 100% rename from openbsc/src/libmsc/silent_call.c rename to src/libmsc/silent_call.c diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c similarity index 100% rename from openbsc/src/libmsc/smpp_openbsc.c rename to src/libmsc/smpp_openbsc.c diff --git a/openbsc/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c similarity index 100% rename from openbsc/src/libmsc/smpp_smsc.c rename to src/libmsc/smpp_smsc.c diff --git a/openbsc/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h similarity index 100% rename from openbsc/src/libmsc/smpp_smsc.h rename to src/libmsc/smpp_smsc.h diff --git a/openbsc/src/libmsc/smpp_utils.c b/src/libmsc/smpp_utils.c similarity index 100% rename from openbsc/src/libmsc/smpp_utils.c rename to src/libmsc/smpp_utils.c diff --git a/openbsc/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c similarity index 100% rename from openbsc/src/libmsc/smpp_vty.c rename to src/libmsc/smpp_vty.c diff --git a/openbsc/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c similarity index 100% rename from openbsc/src/libmsc/sms_queue.c rename to src/libmsc/sms_queue.c diff --git a/openbsc/src/libmsc/token_auth.c b/src/libmsc/token_auth.c similarity index 100% rename from openbsc/src/libmsc/token_auth.c rename to src/libmsc/token_auth.c diff --git a/openbsc/src/libmsc/transaction.c b/src/libmsc/transaction.c similarity index 100% rename from openbsc/src/libmsc/transaction.c rename to src/libmsc/transaction.c diff --git a/openbsc/src/libmsc/ussd.c b/src/libmsc/ussd.c similarity index 100% rename from openbsc/src/libmsc/ussd.c rename to src/libmsc/ussd.c diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c similarity index 100% rename from openbsc/src/libmsc/vty_interface_layer3.c rename to src/libmsc/vty_interface_layer3.c diff --git a/openbsc/src/libtrau/Makefile.am b/src/libtrau/Makefile.am similarity index 100% rename from openbsc/src/libtrau/Makefile.am rename to src/libtrau/Makefile.am diff --git a/openbsc/src/libtrau/rtp_proxy.c b/src/libtrau/rtp_proxy.c similarity index 100% rename from openbsc/src/libtrau/rtp_proxy.c rename to src/libtrau/rtp_proxy.c diff --git a/openbsc/src/libtrau/trau_mux.c b/src/libtrau/trau_mux.c similarity index 100% rename from openbsc/src/libtrau/trau_mux.c rename to src/libtrau/trau_mux.c diff --git a/openbsc/src/libtrau/trau_upqueue.c b/src/libtrau/trau_upqueue.c similarity index 100% rename from openbsc/src/libtrau/trau_upqueue.c rename to src/libtrau/trau_upqueue.c diff --git a/openbsc/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc/Makefile.am rename to src/osmo-bsc/Makefile.am diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_api.c rename to src/osmo-bsc/osmo_bsc_api.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_audio.c rename to src/osmo-bsc/osmo_bsc_audio.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_bssap.c rename to src/osmo-bsc/osmo_bsc_bssap.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_ctrl.c rename to src/osmo-bsc/osmo_bsc_ctrl.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_filter.c rename to src/osmo-bsc/osmo_bsc_filter.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_grace.c rename to src/osmo-bsc/osmo_bsc_grace.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_main.c rename to src/osmo-bsc/osmo_bsc_main.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_msc.c rename to src/osmo-bsc/osmo_bsc_msc.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/src/osmo-bsc/osmo_bsc_sccp.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_sccp.c rename to src/osmo-bsc/osmo_bsc_sccp.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_vty.c rename to src/osmo-bsc/osmo_bsc_vty.c diff --git a/openbsc/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc_mgcp/Makefile.am rename to src/osmo-bsc_mgcp/Makefile.am diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c similarity index 100% rename from openbsc/src/osmo-bsc_mgcp/mgcp_main.c rename to src/osmo-bsc_mgcp/mgcp_main.c diff --git a/openbsc/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc_nat/Makefile.am rename to src/osmo-bsc_nat/Makefile.am diff --git a/openbsc/src/osmo-bsc_nat/bsc_filter.c b/src/osmo-bsc_nat/bsc_filter.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_filter.c rename to src/osmo-bsc_nat/bsc_filter.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c rename to src/osmo-bsc_nat/bsc_mgcp_utils.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat.c rename to src/osmo-bsc_nat/bsc_nat.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/src/osmo-bsc_nat/bsc_nat_ctrl.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c rename to src/osmo-bsc_nat/bsc_nat_ctrl.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c b/src/osmo-bsc_nat/bsc_nat_filter.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_filter.c rename to src/osmo-bsc_nat/bsc_nat_filter.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c b/src/osmo-bsc_nat/bsc_nat_rewrite.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c rename to src/osmo-bsc_nat/bsc_nat_rewrite.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c rename to src/osmo-bsc_nat/bsc_nat_rewrite_trie.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/src/osmo-bsc_nat/bsc_nat_utils.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_utils.c rename to src/osmo-bsc_nat/bsc_nat_utils.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/src/osmo-bsc_nat/bsc_nat_vty.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_vty.c rename to src/osmo-bsc_nat/bsc_nat_vty.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_sccp.c b/src/osmo-bsc_nat/bsc_sccp.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_sccp.c rename to src/osmo-bsc_nat/bsc_sccp.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/src/osmo-bsc_nat/bsc_ussd.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_ussd.c rename to src/osmo-bsc_nat/bsc_ussd.c diff --git a/openbsc/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am similarity index 100% rename from openbsc/src/osmo-nitb/Makefile.am rename to src/osmo-nitb/Makefile.am diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/src/osmo-nitb/bsc_hack.c similarity index 100% rename from openbsc/src/osmo-nitb/bsc_hack.c rename to src/osmo-nitb/bsc_hack.c diff --git a/openbsc/src/utils/Makefile.am b/src/utils/Makefile.am similarity index 100% rename from openbsc/src/utils/Makefile.am rename to src/utils/Makefile.am diff --git a/openbsc/src/utils/bs11_config.c b/src/utils/bs11_config.c similarity index 100% rename from openbsc/src/utils/bs11_config.c rename to src/utils/bs11_config.c diff --git a/openbsc/src/utils/isdnsync.c b/src/utils/isdnsync.c similarity index 100% rename from openbsc/src/utils/isdnsync.c rename to src/utils/isdnsync.c diff --git a/openbsc/src/utils/meas_db.c b/src/utils/meas_db.c similarity index 100% rename from openbsc/src/utils/meas_db.c rename to src/utils/meas_db.c diff --git a/openbsc/src/utils/meas_db.h b/src/utils/meas_db.h similarity index 100% rename from openbsc/src/utils/meas_db.h rename to src/utils/meas_db.h diff --git a/openbsc/src/utils/meas_json.c b/src/utils/meas_json.c similarity index 100% rename from openbsc/src/utils/meas_json.c rename to src/utils/meas_json.c diff --git a/openbsc/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c similarity index 100% rename from openbsc/src/utils/meas_pcap2db.c rename to src/utils/meas_pcap2db.c diff --git a/openbsc/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c similarity index 100% rename from openbsc/src/utils/meas_udp2db.c rename to src/utils/meas_udp2db.c diff --git a/openbsc/src/utils/meas_vis.c b/src/utils/meas_vis.c similarity index 100% rename from openbsc/src/utils/meas_vis.c rename to src/utils/meas_vis.c diff --git a/openbsc/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c similarity index 100% rename from openbsc/src/utils/smpp_mirror.c rename to src/utils/smpp_mirror.c diff --git a/openbsc/tests/Makefile.am b/tests/Makefile.am similarity index 100% rename from openbsc/tests/Makefile.am rename to tests/Makefile.am diff --git a/openbsc/tests/abis/Makefile.am b/tests/abis/Makefile.am similarity index 100% rename from openbsc/tests/abis/Makefile.am rename to tests/abis/Makefile.am diff --git a/openbsc/tests/abis/abis_test.c b/tests/abis/abis_test.c similarity index 100% rename from openbsc/tests/abis/abis_test.c rename to tests/abis/abis_test.c diff --git a/openbsc/tests/abis/abis_test.ok b/tests/abis/abis_test.ok similarity index 100% rename from openbsc/tests/abis/abis_test.ok rename to tests/abis/abis_test.ok diff --git a/openbsc/tests/atlocal.in b/tests/atlocal.in similarity index 100% rename from openbsc/tests/atlocal.in rename to tests/atlocal.in diff --git a/openbsc/tests/bsc-nat-trie/Makefile.am b/tests/bsc-nat-trie/Makefile.am similarity index 100% rename from openbsc/tests/bsc-nat-trie/Makefile.am rename to tests/bsc-nat-trie/Makefile.am diff --git a/openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.c b/tests/bsc-nat-trie/bsc_nat_trie_test.c similarity index 100% rename from openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.c rename to tests/bsc-nat-trie/bsc_nat_trie_test.c diff --git a/openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.ok b/tests/bsc-nat-trie/bsc_nat_trie_test.ok similarity index 100% rename from openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.ok rename to tests/bsc-nat-trie/bsc_nat_trie_test.ok diff --git a/openbsc/tests/bsc-nat-trie/prefixes.csv b/tests/bsc-nat-trie/prefixes.csv similarity index 100% rename from openbsc/tests/bsc-nat-trie/prefixes.csv rename to tests/bsc-nat-trie/prefixes.csv diff --git a/openbsc/tests/bsc-nat/Makefile.am b/tests/bsc-nat/Makefile.am similarity index 100% rename from openbsc/tests/bsc-nat/Makefile.am rename to tests/bsc-nat/Makefile.am diff --git a/openbsc/tests/bsc-nat/barr.cfg b/tests/bsc-nat/barr.cfg similarity index 100% rename from openbsc/tests/bsc-nat/barr.cfg rename to tests/bsc-nat/barr.cfg diff --git a/openbsc/tests/bsc-nat/barr_dup.cfg b/tests/bsc-nat/barr_dup.cfg similarity index 100% rename from openbsc/tests/bsc-nat/barr_dup.cfg rename to tests/bsc-nat/barr_dup.cfg diff --git a/openbsc/tests/bsc-nat/bsc_data.c b/tests/bsc-nat/bsc_data.c similarity index 100% rename from openbsc/tests/bsc-nat/bsc_data.c rename to tests/bsc-nat/bsc_data.c diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/tests/bsc-nat/bsc_nat_test.c similarity index 100% rename from openbsc/tests/bsc-nat/bsc_nat_test.c rename to tests/bsc-nat/bsc_nat_test.c diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.ok b/tests/bsc-nat/bsc_nat_test.ok similarity index 100% rename from openbsc/tests/bsc-nat/bsc_nat_test.ok rename to tests/bsc-nat/bsc_nat_test.ok diff --git a/openbsc/tests/bsc-nat/prefixes.csv b/tests/bsc-nat/prefixes.csv similarity index 100% rename from openbsc/tests/bsc-nat/prefixes.csv rename to tests/bsc-nat/prefixes.csv diff --git a/openbsc/tests/bsc/Makefile.am b/tests/bsc/Makefile.am similarity index 100% rename from openbsc/tests/bsc/Makefile.am rename to tests/bsc/Makefile.am diff --git a/openbsc/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c similarity index 100% rename from openbsc/tests/bsc/bsc_test.c rename to tests/bsc/bsc_test.c diff --git a/openbsc/tests/bsc/bsc_test.ok b/tests/bsc/bsc_test.ok similarity index 100% rename from openbsc/tests/bsc/bsc_test.ok rename to tests/bsc/bsc_test.ok diff --git a/openbsc/tests/channel/Makefile.am b/tests/channel/Makefile.am similarity index 100% rename from openbsc/tests/channel/Makefile.am rename to tests/channel/Makefile.am diff --git a/openbsc/tests/channel/channel_test.c b/tests/channel/channel_test.c similarity index 100% rename from openbsc/tests/channel/channel_test.c rename to tests/channel/channel_test.c diff --git a/openbsc/tests/channel/channel_test.ok b/tests/channel/channel_test.ok similarity index 100% rename from openbsc/tests/channel/channel_test.ok rename to tests/channel/channel_test.ok diff --git a/openbsc/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py similarity index 100% rename from openbsc/tests/ctrl_test_runner.py rename to tests/ctrl_test_runner.py diff --git a/openbsc/tests/db/Makefile.am b/tests/db/Makefile.am similarity index 100% rename from openbsc/tests/db/Makefile.am rename to tests/db/Makefile.am diff --git a/openbsc/tests/db/db_test.c b/tests/db/db_test.c similarity index 100% rename from openbsc/tests/db/db_test.c rename to tests/db/db_test.c diff --git a/openbsc/tests/db/db_test.err b/tests/db/db_test.err similarity index 100% rename from openbsc/tests/db/db_test.err rename to tests/db/db_test.err diff --git a/openbsc/tests/db/db_test.ok b/tests/db/db_test.ok similarity index 100% rename from openbsc/tests/db/db_test.ok rename to tests/db/db_test.ok diff --git a/openbsc/tests/db/hlr.sqlite3 b/tests/db/hlr.sqlite3 similarity index 100% rename from openbsc/tests/db/hlr.sqlite3 rename to tests/db/hlr.sqlite3 Binary files differ diff --git a/openbsc/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am similarity index 100% rename from openbsc/tests/gbproxy/Makefile.am rename to tests/gbproxy/Makefile.am diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c similarity index 100% rename from openbsc/tests/gbproxy/gbproxy_test.c rename to tests/gbproxy/gbproxy_test.c diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/tests/gbproxy/gbproxy_test.ok similarity index 100% rename from openbsc/tests/gbproxy/gbproxy_test.ok rename to tests/gbproxy/gbproxy_test.ok diff --git a/openbsc/tests/gprs/Makefile.am b/tests/gprs/Makefile.am similarity index 100% rename from openbsc/tests/gprs/Makefile.am rename to tests/gprs/Makefile.am diff --git a/openbsc/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c similarity index 100% rename from openbsc/tests/gprs/gprs_test.c rename to tests/gprs/gprs_test.c diff --git a/openbsc/tests/gprs/gprs_test.ok b/tests/gprs/gprs_test.ok similarity index 100% rename from openbsc/tests/gprs/gprs_test.ok rename to tests/gprs/gprs_test.ok diff --git a/openbsc/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am similarity index 100% rename from openbsc/tests/gsm0408/Makefile.am rename to tests/gsm0408/Makefile.am diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c similarity index 100% rename from openbsc/tests/gsm0408/gsm0408_test.c rename to tests/gsm0408/gsm0408_test.c diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok similarity index 100% rename from openbsc/tests/gsm0408/gsm0408_test.ok rename to tests/gsm0408/gsm0408_test.ok diff --git a/openbsc/tests/gtphub/Makefile.am b/tests/gtphub/Makefile.am similarity index 100% rename from openbsc/tests/gtphub/Makefile.am rename to tests/gtphub/Makefile.am diff --git a/openbsc/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c similarity index 100% rename from openbsc/tests/gtphub/gtphub_test.c rename to tests/gtphub/gtphub_test.c diff --git a/openbsc/tests/gtphub/gtphub_test.ok b/tests/gtphub/gtphub_test.ok similarity index 100% rename from openbsc/tests/gtphub/gtphub_test.ok rename to tests/gtphub/gtphub_test.ok diff --git a/openbsc/tests/mgcp/Makefile.am b/tests/mgcp/Makefile.am similarity index 100% rename from openbsc/tests/mgcp/Makefile.am rename to tests/mgcp/Makefile.am diff --git a/openbsc/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c similarity index 100% rename from openbsc/tests/mgcp/mgcp_test.c rename to tests/mgcp/mgcp_test.c diff --git a/openbsc/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok similarity index 100% rename from openbsc/tests/mgcp/mgcp_test.ok rename to tests/mgcp/mgcp_test.ok diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/tests/mgcp/mgcp_transcoding_test.c similarity index 100% rename from openbsc/tests/mgcp/mgcp_transcoding_test.c rename to tests/mgcp/mgcp_transcoding_test.c diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.ok b/tests/mgcp/mgcp_transcoding_test.ok similarity index 100% rename from openbsc/tests/mgcp/mgcp_transcoding_test.ok rename to tests/mgcp/mgcp_transcoding_test.ok diff --git a/openbsc/tests/mm_auth/Makefile.am b/tests/mm_auth/Makefile.am similarity index 100% rename from openbsc/tests/mm_auth/Makefile.am rename to tests/mm_auth/Makefile.am diff --git a/openbsc/tests/mm_auth/mm_auth_test.c b/tests/mm_auth/mm_auth_test.c similarity index 100% rename from openbsc/tests/mm_auth/mm_auth_test.c rename to tests/mm_auth/mm_auth_test.c diff --git a/openbsc/tests/mm_auth/mm_auth_test.ok b/tests/mm_auth/mm_auth_test.ok similarity index 100% rename from openbsc/tests/mm_auth/mm_auth_test.ok rename to tests/mm_auth/mm_auth_test.ok diff --git a/openbsc/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am similarity index 100% rename from openbsc/tests/nanobts_omlattr/Makefile.am rename to tests/nanobts_omlattr/Makefile.am diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c similarity index 100% rename from openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c rename to tests/nanobts_omlattr/nanobts_omlattr_test.c diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/tests/nanobts_omlattr/nanobts_omlattr_test.ok similarity index 100% rename from openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok rename to tests/nanobts_omlattr/nanobts_omlattr_test.ok diff --git a/openbsc/tests/oap/Makefile.am b/tests/oap/Makefile.am similarity index 100% rename from openbsc/tests/oap/Makefile.am rename to tests/oap/Makefile.am diff --git a/openbsc/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c similarity index 100% rename from openbsc/tests/oap/oap_client_test.c rename to tests/oap/oap_client_test.c diff --git a/openbsc/tests/oap/oap_client_test.err b/tests/oap/oap_client_test.err similarity index 100% rename from openbsc/tests/oap/oap_client_test.err rename to tests/oap/oap_client_test.err diff --git a/openbsc/tests/oap/oap_client_test.ok b/tests/oap/oap_client_test.ok similarity index 100% rename from openbsc/tests/oap/oap_client_test.ok rename to tests/oap/oap_client_test.ok diff --git a/openbsc/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am similarity index 100% rename from openbsc/tests/sgsn/Makefile.am rename to tests/sgsn/Makefile.am diff --git a/openbsc/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c similarity index 100% rename from openbsc/tests/sgsn/sgsn_test.c rename to tests/sgsn/sgsn_test.c diff --git a/openbsc/tests/sgsn/sgsn_test.ok b/tests/sgsn/sgsn_test.ok similarity index 100% rename from openbsc/tests/sgsn/sgsn_test.ok rename to tests/sgsn/sgsn_test.ok diff --git a/openbsc/tests/slhc/Makefile.am b/tests/slhc/Makefile.am similarity index 100% rename from openbsc/tests/slhc/Makefile.am rename to tests/slhc/Makefile.am diff --git a/openbsc/tests/slhc/slhc_test.c b/tests/slhc/slhc_test.c similarity index 100% rename from openbsc/tests/slhc/slhc_test.c rename to tests/slhc/slhc_test.c diff --git a/openbsc/tests/slhc/slhc_test.ok b/tests/slhc/slhc_test.ok similarity index 100% rename from openbsc/tests/slhc/slhc_test.ok rename to tests/slhc/slhc_test.ok diff --git a/openbsc/tests/smpp/Makefile.am b/tests/smpp/Makefile.am similarity index 100% rename from openbsc/tests/smpp/Makefile.am rename to tests/smpp/Makefile.am diff --git a/openbsc/tests/smpp/smpp_test.c b/tests/smpp/smpp_test.c similarity index 100% rename from openbsc/tests/smpp/smpp_test.c rename to tests/smpp/smpp_test.c diff --git a/openbsc/tests/smpp/smpp_test.err b/tests/smpp/smpp_test.err similarity index 100% rename from openbsc/tests/smpp/smpp_test.err rename to tests/smpp/smpp_test.err diff --git a/openbsc/tests/smpp/smpp_test.ok b/tests/smpp/smpp_test.ok similarity index 100% rename from openbsc/tests/smpp/smpp_test.ok rename to tests/smpp/smpp_test.ok diff --git a/openbsc/tests/smpp_test_runner.py b/tests/smpp_test_runner.py similarity index 100% rename from openbsc/tests/smpp_test_runner.py rename to tests/smpp_test_runner.py diff --git a/openbsc/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am similarity index 100% rename from openbsc/tests/sndcp_xid/Makefile.am rename to tests/sndcp_xid/Makefile.am diff --git a/openbsc/tests/sndcp_xid/sndcp_xid_test.c b/tests/sndcp_xid/sndcp_xid_test.c similarity index 100% rename from openbsc/tests/sndcp_xid/sndcp_xid_test.c rename to tests/sndcp_xid/sndcp_xid_test.c diff --git a/openbsc/tests/sndcp_xid/sndcp_xid_test.ok b/tests/sndcp_xid/sndcp_xid_test.ok similarity index 100% rename from openbsc/tests/sndcp_xid/sndcp_xid_test.ok rename to tests/sndcp_xid/sndcp_xid_test.ok diff --git a/openbsc/tests/subscr/Makefile.am b/tests/subscr/Makefile.am similarity index 100% rename from openbsc/tests/subscr/Makefile.am rename to tests/subscr/Makefile.am diff --git a/openbsc/tests/subscr/bsc_subscr_test.c b/tests/subscr/bsc_subscr_test.c similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.c rename to tests/subscr/bsc_subscr_test.c diff --git a/openbsc/tests/subscr/bsc_subscr_test.err b/tests/subscr/bsc_subscr_test.err similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.err rename to tests/subscr/bsc_subscr_test.err diff --git a/openbsc/tests/subscr/bsc_subscr_test.ok b/tests/subscr/bsc_subscr_test.ok similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.ok rename to tests/subscr/bsc_subscr_test.ok diff --git a/openbsc/tests/subscr/subscr_test.c b/tests/subscr/subscr_test.c similarity index 100% rename from openbsc/tests/subscr/subscr_test.c rename to tests/subscr/subscr_test.c diff --git a/openbsc/tests/subscr/subscr_test.ok b/tests/subscr/subscr_test.ok similarity index 100% rename from openbsc/tests/subscr/subscr_test.ok rename to tests/subscr/subscr_test.ok diff --git a/openbsc/tests/testsuite.at b/tests/testsuite.at similarity index 100% rename from openbsc/tests/testsuite.at rename to tests/testsuite.at diff --git a/openbsc/tests/trau/Makefile.am b/tests/trau/Makefile.am similarity index 100% rename from openbsc/tests/trau/Makefile.am rename to tests/trau/Makefile.am diff --git a/openbsc/tests/trau/trau_test.c b/tests/trau/trau_test.c similarity index 100% rename from openbsc/tests/trau/trau_test.c rename to tests/trau/trau_test.c diff --git a/openbsc/tests/trau/trau_test.ok b/tests/trau/trau_test.ok similarity index 100% rename from openbsc/tests/trau/trau_test.ok rename to tests/trau/trau_test.ok diff --git a/openbsc/tests/v42bis/Makefile.am b/tests/v42bis/Makefile.am similarity index 100% rename from openbsc/tests/v42bis/Makefile.am rename to tests/v42bis/Makefile.am diff --git a/openbsc/tests/v42bis/v42bis_test.c b/tests/v42bis/v42bis_test.c similarity index 100% rename from openbsc/tests/v42bis/v42bis_test.c rename to tests/v42bis/v42bis_test.c diff --git a/openbsc/tests/v42bis/v42bis_test.ok b/tests/v42bis/v42bis_test.ok similarity index 100% rename from openbsc/tests/v42bis/v42bis_test.ok rename to tests/v42bis/v42bis_test.ok diff --git a/openbsc/tests/vty_test_runner.py b/tests/vty_test_runner.py similarity index 100% rename from openbsc/tests/vty_test_runner.py rename to tests/vty_test_runner.py diff --git a/openbsc/tests/xid/Makefile.am b/tests/xid/Makefile.am similarity index 100% rename from openbsc/tests/xid/Makefile.am rename to tests/xid/Makefile.am diff --git a/openbsc/tests/xid/xid_test.c b/tests/xid/xid_test.c similarity index 100% rename from openbsc/tests/xid/xid_test.c rename to tests/xid/xid_test.c diff --git a/openbsc/tests/xid/xid_test.ok b/tests/xid/xid_test.ok similarity index 100% rename from openbsc/tests/xid/xid_test.ok rename to tests/xid/xid_test.ok diff --git a/openbsc/tools/hlrstat.pl b/tools/hlrstat.pl similarity index 100% rename from openbsc/tools/hlrstat.pl rename to tools/hlrstat.pl -- To view, visit https://gerrit.osmocom.org/3188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 20:30:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 20:30:07 +0000 Subject: [PATCH] osmo-msc[master]: join openbsc/.gitignore with .gitignore Message-ID: Review at https://gerrit.osmocom.org/3189 join openbsc/.gitignore with .gitignore Change-Id: Ib2120592749e85a4d13f6668e198857e3bddcf1e --- M .gitignore D openbsc/.gitignore 2 files changed, 103 insertions(+), 103 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/3189/1 diff --git a/.gitignore b/.gitignore index 89bf7df..8e2c41b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,104 @@ debian/*.log +*.o +*.lo +*.a +.deps +Makefile +Makefile.in +bscconfig.h +bscconfig.h.in +openbsc.pc +src/osmo-nitb/osmo-nitb +src/osmo-bsc_mgcp/osmo-bsc_mgcp +src/osmo-bsc/osmo-bsc +src/utils/meas_vis +src/utils/meas_json +src/utils/osmo-meas-pcap2db +src/utils/osmo-meas-udp2db +src/utils/smpp_mirror +*.*~ +*.sw? +.libs +*.pyc +*.gcda +*.gcno + +#configure +aclocal.m4 +autom4te.cache/ +config.log +config.status +config.guess +config.sub +configure +compile +depcomp +install-sh +missing +stamp-h1 +libtool +ltmain.sh + +# git-version-gen magic +.tarball-version +.version + + +# apps and app data +hlr.sqlite3 +src/utils/bs11_config +src/ipaccess/ipaccess-config +src/ipaccess/abisip-find +src/ipaccess/ipaccess-firmware +src/ipaccess/ipaccess-proxy +src/utils/isdnsync +src/nat/bsc_nat +src/gprs/osmo-sgsn +src/gprs/osmo-gbproxy +src/gprs/osmo-gtphub +src/osmo-bsc_nat/osmo-bsc_nat +src/libcommon/gsup_test_client + +#tests +tests/testsuite.dir +tests/bsc-nat/bsc_nat_test +tests/bsc-nat-trie/bsc_nat_trie_test +tests/channel/channel_test +tests/db/db_test +tests/debug/debug_test +tests/gsm0408/gsm0408_test +tests/mgcp/mgcp_test +tests/sccp/sccp_test +tests/sms/sms_test +tests/timer/timer_test +tests/gprs/gprs_test +tests/gbproxy/gbproxy_test +tests/abis/abis_test +tests/si/si_test +tests/smpp/smpp_test +tests/bsc/bsc_test +tests/trau/trau_test +tests/mgcp/mgcp_transcoding_test +tests/sgsn/sgsn_test +tests/subscr/subscr_test +tests/subscr/bsc_subscr_test +tests/oap/oap_test +tests/gtphub/gtphub_test +tests/mm_auth/mm_auth_test +tests/xid/xid_test +tests/sndcp_xid/sndcp_xid_test +tests/slhc/slhc_test +tests/v42bis/v42bis_test +tests/nanobts_omlattr/nanobts_omlattr_test +tests/oap/oap_client_test + +tests/atconfig +tests/atlocal +tests/package.m4 +tests/testsuite +tests/testsuite.log + +gsn_restart +src/openbsc.cfg* +writtenconfig/ +gtphub_restart_count diff --git a/openbsc/.gitignore b/openbsc/.gitignore deleted file mode 100644 index 3dabea9..0000000 --- a/openbsc/.gitignore +++ /dev/null @@ -1,103 +0,0 @@ -*.o -*.lo -*.a -.deps -Makefile -Makefile.in -bscconfig.h -bscconfig.h.in -openbsc.pc -src/osmo-nitb/osmo-nitb -src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc -src/utils/meas_vis -src/utils/meas_json -src/utils/osmo-meas-pcap2db -src/utils/osmo-meas-udp2db -src/utils/smpp_mirror -*.*~ -*.sw? -.libs -*.pyc -*.gcda -*.gcno - -#configure -aclocal.m4 -autom4te.cache/ -config.log -config.status -config.guess -config.sub -configure -compile -depcomp -install-sh -missing -stamp-h1 -libtool -ltmain.sh - -# git-version-gen magic -.tarball-version -.version - - -# apps and app data -hlr.sqlite3 -src/utils/bs11_config -src/ipaccess/ipaccess-config -src/ipaccess/abisip-find -src/ipaccess/ipaccess-firmware -src/ipaccess/ipaccess-proxy -src/utils/isdnsync -src/nat/bsc_nat -src/gprs/osmo-sgsn -src/gprs/osmo-gbproxy -src/gprs/osmo-gtphub -src/osmo-bsc_nat/osmo-bsc_nat -src/libcommon/gsup_test_client - -#tests -tests/testsuite.dir -tests/bsc-nat/bsc_nat_test -tests/bsc-nat-trie/bsc_nat_trie_test -tests/channel/channel_test -tests/db/db_test -tests/debug/debug_test -tests/gsm0408/gsm0408_test -tests/mgcp/mgcp_test -tests/sccp/sccp_test -tests/sms/sms_test -tests/timer/timer_test -tests/gprs/gprs_test -tests/gbproxy/gbproxy_test -tests/abis/abis_test -tests/si/si_test -tests/smpp/smpp_test -tests/bsc/bsc_test -tests/trau/trau_test -tests/mgcp/mgcp_transcoding_test -tests/sgsn/sgsn_test -tests/subscr/subscr_test -tests/subscr/bsc_subscr_test -tests/oap/oap_test -tests/gtphub/gtphub_test -tests/mm_auth/mm_auth_test -tests/xid/xid_test -tests/sndcp_xid/sndcp_xid_test -tests/slhc/slhc_test -tests/v42bis/v42bis_test -tests/nanobts_omlattr/nanobts_omlattr_test -tests/oap/oap_client_test - -tests/atconfig -tests/atlocal -tests/package.m4 -tests/testsuite -tests/testsuite.log - -gsn_restart -src/openbsc.cfg* -writtenconfig/ -gtphub_restart_count -- To view, visit https://gerrit.osmocom.org/3189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2120592749e85a4d13f6668e198857e3bddcf1e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 20:30:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 20:30:07 +0000 Subject: [PATCH] osmo-msc[master]: git-version-gen: look for .git in ./, not ../ Message-ID: Review at https://gerrit.osmocom.org/3190 git-version-gen: look for .git in ./, not ../ Change-Id: Ic71cfb8dde0a43325b50c75aae1e6ef3c3008501 --- M git-version-gen 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/90/3190/1 diff --git a/git-version-gen b/git-version-gen index f2ad4a7..8e59c5a 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,7 +92,7 @@ if test -n "$v" then : # use $v -elif test -d ./../.git \ +elif test -d ./.git \ && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in -- To view, visit https://gerrit.osmocom.org/3190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic71cfb8dde0a43325b50c75aae1e6ef3c3008501 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 20:30:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 20:30:08 +0000 Subject: [PATCH] osmo-msc[master]: GPRS/IuPS: remove all 3G authentication dev hacks Message-ID: Review at https://gerrit.osmocom.org/3191 GPRS/IuPS: remove all 3G authentication dev hacks UMTS auth works now with the external OsmoHLR. Change-Id: Ie42945bb687b077fd0ee430c2711d19782151610 --- M src/gprs/gprs_gmm.c M src/libiu/iu.c 2 files changed, 2 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/91/3191/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index e6751db..dfec604 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1354,33 +1354,6 @@ ctx->ra = ra_id; if (ctx->ran_type == MM_CTX_T_GERAN_Gb) ctx->gb.cell_id = cid; - else if (ctx->ran_type == MM_CTX_T_UTRAN_Iu) { - /* DEVELOPMENT HACK: Our current HLR does not support 3G - * authentication tokens. A new HLR/VLR implementation is being - * developed. Until it is ready and actual milenage - * authentication is properly supported, we are hardcoding a - * fixed Ki and use 2G auth. */ - unsigned char tmp_rand[16]; - /* Ki 000102030405060708090a0b0c0d0e0f */ - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_GSM, - .algo = OSMO_AUTH_ALG_COMP128v1, - .u.gsm.ki = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, - 0x0e, 0x0f - }, - }; - /* XXX: Hack to make 3G auth work with special SIM card */ - ctx->auth_state = SGSN_AUTH_AUTHENTICATE; - - RAND_bytes(tmp_rand, 16); - - memset(&ctx->auth_triplet.vec, 0, sizeof(ctx->auth_triplet.vec)); - osmo_auth_gen_vec(&ctx->auth_triplet.vec, &auth, tmp_rand); - - ctx->auth_triplet.key_seq = 0; - } /* Update MM Context with other data */ ctx->drx_parms = drx_par; diff --git a/src/libiu/iu.c b/src/libiu/iu.c index 8ba6fa4..932b217 100644 --- a/src/libiu/iu.c +++ b/src/libiu/iu.c @@ -225,25 +225,10 @@ { struct osmo_scu_prim *prim; struct msgb *msg; - uint8_t ik[16]; - uint8_t ck[16]; - unsigned int i; - - /* C5 function to derive IK from Kc */ - for (i = 0; i < 4; i++) - ik[i] = tp->vec.kc[i] ^ tp->vec.kc[i+4]; - memcpy(ik+4, tp->vec.kc, 8); - for (i = 12; i < 16; i++) - ik[i] = ik[i-12]; - - if (send_ck) { - /* C4 function to derive CK from Kc */ - memcpy(ck, tp->vec.kc, 8); - memcpy(ck+8, tp->vec.kc, 8); - } /* create RANAP message */ - msg = ranap_new_msg_sec_mod_cmd(ik, send_ck? ck : NULL, new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg = ranap_new_msg_sec_mod_cmd(tp->vec.ik, send_ck? tp->vec.ck : NULL, + new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); msg->l2h = msg->data; /* wrap RANAP message in SCCP N-DATA.req */ prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); -- To view, visit https://gerrit.osmocom.org/3191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie42945bb687b077fd0ee430c2711d19782151610 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 20:30:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 20:30:08 +0000 Subject: [PATCH] osmo-msc[master]: gsup_client: allow passing a unit id to identify with HLR Message-ID: Review at https://gerrit.osmocom.org/3192 gsup_client: allow passing a unit id to identify with HLR Before, each GSUP client would contact the HLR with an identical unit id, i.e. "SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by the wrong client. Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC" and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages. Todo: also set some values instead of the zeros. Unrelated cosmetic change while editing the arguments: gsup_client_create()'s definition's oap client config arg name mismatched the one used in the declaration. Use oapc_config in both. Change-Id: I0a60681ab4a4d73e26fe8f0637447db4b6fe6eb2 --- M include/openbsc/gsup_client.h M src/gprs/gprs_subscriber.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c 4 files changed, 21 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/92/3192/1 diff --git a/include/openbsc/gsup_client.h b/include/openbsc/gsup_client.h index a113225..4a25490 100644 --- a/include/openbsc/gsup_client.h +++ b/include/openbsc/gsup_client.h @@ -37,6 +37,8 @@ struct msgb *msg); struct gsup_client { + const char *unit_name; + struct ipa_client_conn *link; gsup_client_read_cb_t read_cb; void *data; @@ -49,10 +51,11 @@ int got_ipa_pong; }; -struct gsup_client *gsup_client_create(const char *ip_addr, +struct gsup_client *gsup_client_create(const char *unit_name, + const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oap_config); + struct oap_client_config *oapc_config); void gsup_client_destroy(struct gsup_client *gsupc); int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index 1bb5141..176583b 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -69,6 +69,7 @@ addr_str = inet_ntoa(sgi->cfg.gsup_server_addr.sin_addr); sgi->gsup_client = gsup_client_create( + "SGSN", addr_str, sgi->cfg.gsup_server_port, &gsup_read_cb, &sgi->cfg.oap); diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index de00d8d..46f25bb 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -173,9 +173,12 @@ struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); struct gsup_client *gsupc = (struct gsup_client *)link->data; int rc; - static struct ipaccess_unit ipa_dev = { - .unit_name = "SGSN" + struct ipaccess_unit ipa_dev = { + /* see gsup_client_create() on const vs non-const */ + .unit_name = (char*)gsupc->unit_name, }; + + OSMO_ASSERT(ipa_dev.unit_name); msg->l2h = &hh->data[0]; @@ -262,7 +265,8 @@ gsup_client_send_ping(gsupc); } -struct gsup_client *gsup_client_create(const char *ip_addr, +struct gsup_client *gsup_client_create(const char *unit_name, + const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, struct oap_client_config *oapc_config) @@ -273,6 +277,12 @@ gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client); OSMO_ASSERT(gsupc); + /* struct ipaccess_unit has a non-const unit_name, so let's copy to be + * able to have a non-const unit_name here as well. To not taint the + * public gsup_client API, let's store it in a const char* anyway. */ + gsupc->unit_name = talloc_strdup(gsupc, unit_name); + OSMO_ASSERT(gsupc->unit_name); + /* a NULL oapc_config will mark oap_state disabled. */ rc = oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index 8fc38d6..1b39670 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -275,8 +275,8 @@ osmo_init_logging(&gsup_test_client_log_info); - g_gc = gsup_client_create(server_host, server_port, gsupc_read_cb, - NULL); + g_gc = gsup_client_create("GSUPTEST", server_host, server_port, + gsupc_read_cb, NULL); signal(SIGINT, sig_cb); -- To view, visit https://gerrit.osmocom.org/3192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a60681ab4a4d73e26fe8f0637447db4b6fe6eb2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 20:30:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 20:30:08 +0000 Subject: [PATCH] osmo-msc[master]: logging: auth request: use hexdump without spaces for RAND, ... Message-ID: Review at https://gerrit.osmocom.org/3193 logging: auth request: use hexdump without spaces for RAND, AUTN Change-Id: Ie16bb2c01e770914f411bfb34b523c56ea9fab81 --- 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/93/3193/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 89108e4..fb02de2 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -909,9 +909,9 @@ struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); struct gsm48_auth_req *ar = (struct gsm48_auth_req *) msgb_put(msg, sizeof(*ar)); - DEBUGP(DMM, "-> AUTH REQ (rand = %s)\n", osmo_hexdump(rand, 16)); + DEBUGP(DMM, "-> AUTH REQ (rand = %s)\n", osmo_hexdump_nospc(rand, 16)); if (autn) - DEBUGP(DMM, " AUTH REQ (autn = %s)\n", osmo_hexdump(autn, 16)); + DEBUGP(DMM, " AUTH REQ (autn = %s)\n", osmo_hexdump_nospc(autn, 16)); msg->lchan = conn->lchan; gh->proto_discr = GSM48_PDISC_MM; -- To view, visit https://gerrit.osmocom.org/3193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie16bb2c01e770914f411bfb34b523c56ea9fab81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 20:30:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 20:30:08 +0000 Subject: [PATCH] osmo-msc[master]: Add libvlr implementation Message-ID: Review at https://gerrit.osmocom.org/3194 Add libvlr implementation Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 --- M configure.ac M include/openbsc/Makefile.am A include/openbsc/vlr.h M src/Makefile.am A src/libmsc/subscr_conn.c A src/libvlr/Makefile.am A src/libvlr/vlr.c A src/libvlr/vlr_access_req_fsm.c A src/libvlr/vlr_access_req_fsm.h A src/libvlr/vlr_auth_fsm.c A src/libvlr/vlr_auth_fsm.h A src/libvlr/vlr_core.h A src/libvlr/vlr_lu_fsm.c A src/libvlr/vlr_lu_fsm.h M src/osmo-nitb/Makefile.am A tests/vlr/Makefile.am A tests/vlr/vlr_test.c 17 files changed, 5,440 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/3194/1 diff --git a/configure.ac b/configure.ac index ff51ccf..17139b0 100644 --- a/configure.ac +++ b/configure.ac @@ -225,6 +225,7 @@ src/libtrau/Makefile src/libbsc/Makefile src/libmsc/Makefile + src/libvlr/Makefile src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile @@ -261,6 +262,8 @@ tests/slhc/Makefile tests/v42bis/Makefile tests/nanobts_omlattr/Makefile + tests/vlr/Makefile + tests/subscr_conn/Makefile doc/Makefile doc/examples/Makefile Makefile) diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 2740a5d..532328c 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -84,6 +84,7 @@ trau_mux.h \ trau_upqueue.h \ ussd.h \ + vlr.h \ vty.h \ v42bis.h \ v42bis_private.h \ diff --git a/include/openbsc/vlr.h b/include/openbsc/vlr.h new file mode 100644 index 0000000..d7e8f19 --- /dev/null +++ b/include/openbsc/vlr.h @@ -0,0 +1,409 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +// for GSM_NAME_LENGTH +#include + +/* from 3s to 10s */ +#define GSM_29002_TIMER_S 10 +/* from 15s to 30s */ +#define GSM_29002_TIMER_M 30 +/* from 1min to 10min */ +#define GSM_29002_TIMER_ML (10*60) +/* from 28h to 38h */ +#define GSM_29002_TIMER_L (32*60*60) + + +/* VLR subscriber authentication state */ +enum vlr_subscr_auth_state { + /* subscriber needs to be autenticated */ + VLR_SUB_AS_NEEDS_AUTH, + /* waiting for AuthInfo from HLR/AUC */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + /* waiting for response from subscriber */ + VLR_SUB_AS_WAIT_RESP, + /* successfully authenticated */ + VLR_SUB_AS_AUTHENTICATED, + /* subscriber needs re-sync */ + VLR_SUB_AS_NEEDS_RESYNC, + /* waiting for AuthInfo with ReSync */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + /* waiting for response from subscr, resync case */ + VLR_SUB_AS_WAIT_RESP_RESYNC, + /* waiting for IMSI from subscriber */ + VLR_SUB_AS_WAIT_ID_IMSI, + /* authentication has failed */ + VLR_SUB_AS_AUTH_FAILED, +}; + +enum vlr_lu_event { + VLR_ULA_E_UPDATE_LA, /* Initial trigger (LU from MS) */ + VLR_ULA_E_SEND_ID_ACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_SEND_ID_NACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_AUTH_RES, /* Result of auth procedure */ + VLR_ULA_E_CIPH_RES, /* Result of Ciphering Mode Command */ + VLR_ULA_E_ID_IMSI, /* IMSI recieved from MS */ + VLR_ULA_E_ID_IMEI, /* IMEI received from MS */ + VLR_ULA_E_ID_IMEISV, /* IMEISV received from MS */ + VLR_ULA_E_HLR_LU_RES, /* HLR UpdateLocation result */ + VLR_ULA_E_UPD_HLR_COMPL,/* UpdatE_HLR_VLR result */ + VLR_ULA_E_LU_COMPL_SUCCESS,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_LU_COMPL_FAILURE,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_NEW_TMSI_ACK, /* TMSI Reallocation Complete */ +}; + +enum vlr_ciph_result_cause { + VLR_CIPH_REJECT, /* ? */ + VLR_CIPH_COMPL, +}; + +struct vlr_ciph_result { + enum vlr_ciph_result_cause cause; + const char *imeisv; +}; + +enum vlr_subscr_security_context { + VLR_SEC_CTX_NONE, + VLR_SEC_CTX_GSM, + VLR_SEC_CTX_UMTS, +}; + +enum vlr_lu_type { + VLR_LU_TYPE_PERIODIC, + VLR_LU_TYPE_IMSI_ATTACH, + VLR_LU_TYPE_REGULAR, +}; + +#define OSMO_LBUF_DECL(name, xlen) \ + struct { \ + uint8_t buf[xlen]; \ + size_t len; \ + } name + +struct sgsn_mm_ctx; +struct vlr_instance; + +/* The VLR subscriber is the part of the GSM subscriber state in VLR (CS) or + * SGSN (PS), particularly while interacting with the HLR via GSUP */ +struct vlr_subscr { + struct llist_head list; + struct vlr_instance *vlr; + + /* TODO either populate from HLR or drop this completely? */ + long long unsigned int id; + + /* Data from HLR */ /* 3GPP TS 23.008 */ + /* Always use vlr_subscr_set_imsi() to write to imsi[] */ + char imsi[GSM23003_IMSI_MAX_DIGITS+1]; /* 2.1.1.1 */ + char msisdn[GSM_EXTENSION_LENGTH+1]; /* 2.1.2 */ + char name[GSM_NAME_LENGTH+1]; /* proprietary */ + OSMO_LBUF_DECL(hlr, 16); /* 2.4.7 */ + uint32_t periodic_lu_timer; /* 2.4.24 */ + uint32_t age_indicator; /* 2.17.1 */ + + /* Authentication Data */ + struct gsm_auth_tuple auth_tuples[5]; /* 2.3.1-2.3.4 */ + struct gsm_auth_tuple *last_tuple; + enum vlr_subscr_security_context sec_ctx; + + /* Data local to VLR is below */ + uint32_t tmsi; /* 2.1.4 */ + /* Newly allocated TMSI that was not yet acked by MS */ + uint32_t tmsi_new; + + /* some redundancy in information below? */ + struct osmo_cell_global_id cgi; /* 2.4.16 */ + uint16_t lac; /* 2.4.2 */ + + char imeisv[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.2.3 */ + char imei[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.1.9 */ + bool imsi_detached_flag; /* 2.7.1 */ + bool conf_by_radio_contact_ind; /* 2.7.4.1 */ + bool sub_dataconf_by_hlr_ind; /* 2.7.4.2 */ + bool loc_conf_in_hlr_ind; /* 2.7.4.3 */ + bool dormant_ind; /* 2.7.8 */ + bool cancel_loc_rx; /* 2.7.8A */ + bool ms_not_reachable_flag; /* 2.10.2 (MNRF) */ + bool la_allowed; + + int use_count; + time_t expire_lu; /* FIXME: overlap with periodic_lu_timer/age_indicator */ + + struct osmo_fsm_inst *lu_fsm; + struct osmo_fsm_inst *auth_fsm; + struct osmo_fsm_inst *proc_arq_fsm; + + bool lu_complete; + + void *msc_conn_ref; + + /* PS (SGSN) specific parts */ + struct { + struct llist_head pdp_list; + uint8_t rac; + uint8_t sac; + struct gprs_mm_ctx *mmctx; + } ps; + /* CS (NITB/CSCN) specific parts */ + struct { + /* pending requests */ + bool is_paging; + struct llist_head requests; + } cs; +}; + +enum vlr_proc_arq_result; + +enum vlr_ciph { + VLR_CIPH_NONE, /*< A5/0, no encryption */ + VLR_CIPH_A5_1, /*< A5/1, encryption */ + VLR_CIPH_A5_2, /*< A5/2, deprecated export-grade encryption */ + VLR_CIPH_A5_3, /*< A5/3, 'new secure' encryption */ +}; + +struct vlr_ops { + /* encode + transmit an AUTH REQ towards the MS. + * \param[in] at auth tuple providing rand, key_seq and autn. + * \param[in] send_autn True to send AUTN, for r99 UMTS auth. + */ + int (*tx_auth_req)(void *msc_conn_ref, struct gsm_auth_tuple *at, + bool send_autn); + /* encode + transmit an AUTH REJECT towards the MS */ + int (*tx_auth_rej)(void *msc_conn_ref); + + /* encode + transmit an IDENTITY REQUEST towards the MS */ + int (*tx_id_req)(void *msc_conn_ref, uint8_t mi_type); + + int (*tx_lu_acc)(void *msc_conn_ref, uint32_t send_tmsi); + int (*tx_lu_rej)(void *msc_conn_ref, uint8_t cause); + 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 retrieve_imeisv); + + /* notify MSC/SGSN that the subscriber data in VLR has been updated */ + void (*subscr_update)(struct vlr_subscr *vsub); + /* notify MSC/SGSN that the given subscriber has been associated + * with this msc_conn_ref */ + void (*subscr_assoc)(void *msc_conn_ref, struct vlr_subscr *vsub); +}; + +enum vlr_timer { + VLR_T_3250, + VLR_T_3260, + VLR_T_3270, + _NUM_VLR_TIMERS +}; + +/* An instance of the VLR codebase */ +struct vlr_instance { + struct llist_head subscribers; + struct llist_head operations; + struct gsup_client *gsup_client; + struct vlr_ops ops; + struct { + bool retrieve_imeisv; + bool assign_tmsi; + bool check_imei_rqd; + int auth_tuple_max_use_count; + bool auth_reuse_old_sets_on_error; + bool parq_retrieve_imsi; + bool is_ps; + uint32_t timer[_NUM_VLR_TIMERS]; + } cfg; + /* A free-form pointer for use by the caller */ + void *user_ctx; +}; + +extern const struct value_string vlr_ciph_names[]; +static inline const char *vlr_ciph_name(enum vlr_ciph val) +{ + return get_value_string(vlr_ciph_names, val); +} + +/* Location Updating request */ +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi); + +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi); + +/* tell the VLR that the subscriber connection is gone */ +int vlr_subscr_disconnected(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); +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); +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); +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub); + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops); +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port); + +/* internal use only */ + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event); +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event); + +struct osmo_fsm_inst * +lu_compl_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure); + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +const char *vlr_subscr_msisdn_or_name(struct vlr_subscr *vsub); + +#define vlr_subscr_find_by_imsi(vlr, imsi) \ + _vlr_subscr_find_by_imsi(vlr, imsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_imsi(vlr, imsi, created) \ + _vlr_subscr_find_or_create_by_imsi(vlr, imsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_tmsi(vlr, tmsi) \ + _vlr_subscr_find_by_tmsi(vlr, tmsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created) \ + _vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_msisdn(vlr, msisdn) \ + _vlr_subscr_find_by_msisdn(vlr, msisdn, __BASE_FILE__, __LINE__) + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line); + +#define vlr_subscr_get(sub) _vlr_subscr_get(sub, __BASE_FILE__, __LINE__) +#define vlr_subscr_put(sub) _vlr_subscr_put(sub, __BASE_FILE__, __LINE__) +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line); +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line); + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_free(struct vlr_subscr *vsub); +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub); + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi); +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei); +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv); +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn); + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi); +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi); +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn); +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei); + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer); + +int vlr_subscr_changed(struct vlr_subscr *vsub); +int vlr_subscr_purge(struct vlr_subscr *vsub); +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause); + + +/* Process Acccess Request FSM */ + +enum vlr_proc_arq_result { + VLR_PR_ARQ_RES_NONE, + VLR_PR_ARQ_RES_SYSTEM_FAILURE, + VLR_PR_ARQ_RES_ILLEGAL_SUBSCR, + VLR_PR_ARQ_RES_UNIDENT_SUBSCR, + VLR_PR_ARQ_RES_ROAMING_NOTALLOWED, + VLR_PR_ARQ_RES_ILLEGAL_EQUIP, + VLR_PR_ARQ_RES_UNKNOWN_ERROR, + VLR_PR_ARQ_RES_TIMEOUT, + VLR_PR_ARQ_RES_PASSED, +}; + +extern const struct value_string vlr_proc_arq_result_names[]; +static inline const char *vlr_proc_arq_result_name(enum vlr_proc_arq_result res) +{ + return get_value_string(vlr_proc_arq_result_names, res); +} + +enum proc_arq_vlr_event { + PR_ARQ_E_START, + PR_ARQ_E_ID_IMSI, + PR_ARQ_E_AUTH_RES, + PR_ARQ_E_CIPH_RES, + PR_ARQ_E_UPD_LOC_RES, + PR_ARQ_E_TRACE_RES, + PR_ARQ_E_IMEI_RES, + PR_ARQ_E_PRES_RES, + PR_ARQ_E_TMSI_ACK, +}; + +enum vlr_parq_type { + VLR_PR_ARQ_T_INVALID = 0, /* to guard against unset vars */ + VLR_PR_ARQ_T_CM_SERV_REQ, + VLR_PR_ARQ_T_PAGING_RESP, + /* FIXME: differentiate between services of 24.008 10.5.3.3 */ +}; + +/* Process Access Request (CM SERV REQ / PAGING RESP) */ +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran); + +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi); + +void vlr_parq_fsm_init(void); + +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv); diff --git a/src/Makefile.am b/src/Makefile.am index cfad7df..c66f9e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,7 @@ # Libraries SUBDIRS = \ libcommon \ + libvlr \ libmgcp \ libbsc \ libmsc \ diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c new file mode 100644 index 0000000..91ffe40 --- /dev/null +++ b/src/libmsc/subscr_conn.c @@ -0,0 +1,269 @@ +/* MSC subscriber connection implementation */ + +/* + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +static const struct value_string subscr_conn_fsm_event_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_E_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_E_ACCEPTED), + OSMO_VALUE_STRING(SUBSCR_CONN_E_BUMP), + OSMO_VALUE_STRING(SUBSCR_CONN_E_MO_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CN_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CLOSE_CONF), + { 0, NULL } +}; + +const struct value_string subscr_conn_from_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_LU), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_CM_SERVICE_REQ), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_PAGING_RESP), + { 0, NULL } +}; + +static void paging_resp(struct gsm_subscriber_connection *conn, + enum gsm_paging_event pe) +{ + subscr_paging_dispatch(GSM_HOOK_RR_PAGING, pe, NULL, conn, conn->subscr); +} + +void subscr_conn_fsm_new(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + enum subscr_conn_from from = SUBSCR_CONN_FROM_INVALID; + enum gsm_paging_event pe; + + if (data) { + from = *(enum subscr_conn_from*)data; + LOGPFSM(fi, "%s\n", subscr_conn_from_name(from)); + } + + /* If accepted, transition the state, all other cases mean failure. */ + switch (event) { + case SUBSCR_CONN_E_ACCEPTED: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + break; + + case SUBSCR_CONN_E_MO_CLOSE: + case SUBSCR_CONN_E_CN_CLOSE: + case SUBSCR_CONN_E_CLOSE_CONF: + break; + + default: + LOGPFSM(fi, "Unexpected event: %d %s\n", + event, osmo_fsm_event_name(fi->fsm, event)); + break; + } + + /* if appropriate, signal paging success or failure */ + if (from == SUBSCR_CONN_FROM_PAGING_RESP) { + pe = (fi->state == SUBSCR_CONN_S_ACCEPTED)? + GSM_PAGING_SUCCEEDED : GSM_PAGING_EXPIRED; + paging_resp(conn, pe); + } + + /* On failure, discard the conn */ + if (fi->state != SUBSCR_CONN_S_ACCEPTED) { + /* TODO: on MO_CLOSE or CN_CLOSE, first go to RELEASING and + * await BSC confirmation? */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); + return; + } + + /* On success, handle pending requests and/or close conn */ + + if (from == SUBSCR_CONN_FROM_CM_SERVICE_REQ) { + conn->received_cm_service_request = true; + LOGPFSM(fi, "received_cm_service_request = true\n"); + } + + osmo_fsm_inst_dispatch(fi, SUBSCR_CONN_E_BUMP, data); +} + +#if 0 + case SUBSCR_CONN_E_PARQ_SUCCESS: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + accept_conn = true; + /* fall through */ + case SUBSCR_CONN_E_PARQ_FAILURE: + parq_type = data ? *(enum vlr_parq_type*)data : VLR_PR_ARQ_T_INVALID; + switch (parq_type) { + + case VLR_PR_ARQ_T_CM_SERV_REQ: + accept_conn = handle_cm_serv_result(fi, accept_conn); + break; + + case VLR_PR_ARQ_T_PAGING_RESP: + accept_conn = handle_paging_result(fi, accept_conn); + break; + + default: + LOGPFSML(fi, LOGL_ERROR, + "Invalid VLR Process Access Request type" + " %d\n", parq_type); + accept_conn = false; + break; + } + break; +#endif + +static void subscr_conn_fsm_bump(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + + if (conn->silent_call) + return; + + if (conn->received_cm_service_request) + return; + + /* is this needed? */ + if (conn->subscr && !llist_empty(&conn->subscr->requests)) + return; + + if (trans_has_conn(conn)) + return; + + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_accepted(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case SUBSCR_CONN_E_BUMP: + subscr_conn_fsm_bump(fi, event, data); + return; + + default: + break; + } + /* Whatever unexpected happens in the accepted state, it means release. + * Even if an unexpected event is passed, the safest thing to do is + * discard the conn. We don't expect another SUBSCR_CONN_E_ACCEPTED. */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_release(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = fi->priv; + if (!conn) + return; + + /* temporary hack, see owned_by_msc */ + if (!conn->owned_by_msc) { + DEBUGP(DMM, "%s leaving bsc_subscr_con_free() to bsc_api.c, owned_by_msc = false\n", + subscr_name(conn->subscr)); + return; + } + + DEBUGP(DMM, "%s calling bsc_subscr_con_free(), owned_by_msc = true\n", + subscr_name(conn->subscr)); + gsm0808_clear(conn); + bsc_subscr_con_free(conn); +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state subscr_conn_fsm_states[] = { + [SUBSCR_CONN_S_NEW] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_NEW), + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_ACCEPTED) | + S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_new, + }, + [SUBSCR_CONN_S_ACCEPTED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_ACCEPTED), + /* allow everything to release for any odd behavior */ + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_BUMP) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_accepted, + }, + [SUBSCR_CONN_S_RELEASED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_RELEASED), + .onenter = subscr_conn_fsm_release, + }, +}; + +static struct osmo_fsm subscr_conn_fsm = { + .name = "Subscr_Conn", + .states = subscr_conn_fsm_states, + .num_states = ARRAY_SIZE(subscr_conn_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = subscr_conn_fsm_event_names, +}; + +int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id) +{ + struct osmo_fsm_inst *fi; + OSMO_ASSERT(conn); + + if (conn->conn_fsm) { + LOGP(DMM, LOGL_ERROR, + "%s: Error: connection already in use\n", id); + return -EINVAL; + } + + fi = osmo_fsm_inst_alloc(&subscr_conn_fsm, conn, conn, LOGL_DEBUG, id); + + if (!fi) { + LOGP(DMM, LOGL_ERROR, + "%s: Failed to allocate subscr conn master FSM\n", id); + return -ENOMEM; + } + conn->conn_fsm = fi; + return 0; +} + +bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn) +{ + if (!conn) + return false; + if (!conn->subscr) + return false; + if (!conn->conn_fsm) + return false; + if (conn->conn_fsm->state != SUBSCR_CONN_S_ACCEPTED) + return false; + return true; +} + +void msc_subscr_conn_init(void) +{ + osmo_fsm_register(&subscr_conn_fsm); +} diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am new file mode 100644 index 0000000..17ad411 --- /dev/null +++ b/src/libvlr/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) + +noinst_HEADERS = \ + vlr_access_req_fsm.h \ + vlr_auth_fsm.h \ + vlr_core.h \ + vlr_lu_fsm.h \ + $(NULL) + +noinst_LIBRARIES = libvlr.a + +libvlr_a_SOURCES = \ + vlr.c \ + vlr_access_req_fsm.c \ + vlr_auth_fsm.c \ + vlr_lu_fsm.c \ + $(NULL) diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c new file mode 100644 index 0000000..0e0d31c --- /dev/null +++ b/src/libvlr/vlr.c @@ -0,0 +1,1108 @@ +/* Osmocom Visitor Location Register (VLR) code base */ + +/* (C) 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define SGSN_SUBSCR_MAX_RETRIES 3 +#define SGSN_SUBSCR_RETRY_INTERVAL 10 + +/*********************************************************************** + * Convenience functions + ***********************************************************************/ + +const struct value_string vlr_ciph_names[] = { + OSMO_VALUE_STRING(VLR_CIPH_NONE), + OSMO_VALUE_STRING(VLR_CIPH_A5_1), + OSMO_VALUE_STRING(VLR_CIPH_A5_2), + OSMO_VALUE_STRING(VLR_CIPH_A5_3), + { 0, NULL } +}; + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer) +{ + uint32_t tidx = 0xffffffff; + + switch (timer) { + case 3270: + tidx = VLR_T_3270; + break; + case 3260: + tidx = VLR_T_3260; + break; + case 3250: + tidx = VLR_T_3250; + break; + } + + OSMO_ASSERT(tidx < sizeof(vlr->cfg.timer)); + return vlr->cfg.timer[tidx]; +} + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!imsi || !*imsi) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_imsi(vsub, imsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (tmsi == GSM_RESERVED_TMSI) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_tmsi(vsub, tmsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!msisdn || !*msisdn) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_msisdn(vsub, msisdn)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +/* Transmit GSUP message to HLR */ +static int vlr_tx_gsup_message(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + struct msgb *msg = gsup_client_msgb_alloc(); + + osmo_gsup_encode(msg, gsup_msg); + + if (!vlr->gsup_client) { + LOGP(DVLR, LOGL_NOTICE, "GSUP link is down, cannot " + "send GSUP: %s\n", msgb_hexdump(msg)); + msgb_free(msg); + return -ENOTSUP; + } + + LOGP(DVLR, LOGL_DEBUG, "GSUP tx: %s\n", + osmo_hexdump_nospc(msg->data, msg->len)); + + return gsup_client_send(vlr->gsup_client, msg); +} + +/* Transmit GSUP message for subscriber to HLR, using IMSI from subscriber */ +static int vlr_subscr_tx_gsup_message(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct vlr_instance *vlr = vsub->vlr; + + if (strlen(gsup_msg->imsi) == 0) + osmo_strlcpy(gsup_msg->imsi, vsub->imsi, sizeof(gsup_msg->imsi)); + + return vlr_tx_gsup_message(vlr, gsup_msg); +} + +/* Transmit GSUP error in response to original message */ +static int vlr_tx_gsup_error_reply(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_orig, + enum gsm48_gmm_cause cause) +{ + struct osmo_gsup_message gsup_reply = {0}; + + osmo_strlcpy(gsup_reply.imsi, gsup_orig->imsi, sizeof(gsup_reply.imsi)); + gsup_reply.cause = cause; + gsup_reply.message_type = + OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type); + + return vlr_tx_gsup_message(vlr, &gsup_reply); +} + +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + OSMO_ASSERT(sub->use_count < INT_MAX); + sub->use_count++; + LOGPSRC(DREF, LOGL_DEBUG, file, line, + "VLR subscr %s usage increases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + return sub; +} + +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + sub->use_count--; + LOGPSRC(DREF, sub->use_count >= 0? LOGL_DEBUG : LOGL_ERROR, + file, line, + "VLR subscr %s usage decreases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + if (sub->use_count <= 0) + vlr_subscr_free(sub); + return NULL; +} + +/* Allocate a new subscriber and insert it into list */ +static struct vlr_subscr *_vlr_subscr_alloc(struct vlr_instance *vlr) +{ + struct vlr_subscr *vsub; + int i; + + vsub = talloc_zero(vlr, struct vlr_subscr); + vsub->vlr = vlr; + vsub->tmsi = GSM_RESERVED_TMSI; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + + INIT_LLIST_HEAD(&vsub->cs.requests); + INIT_LLIST_HEAD(&vsub->ps.pdp_list); + + llist_add_tail(&vsub->list, &vlr->subscribers); + return vsub; +} + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr) +{ + return vlr_subscr_get(_vlr_subscr_alloc(vlr)); +} + +/* Send a GSUP Purge MS request. + * TODO: this should be sent to the *previous* VLR when this VLR is "taking" + * this subscriber, not to the HLR? */ +int vlr_subscr_purge(struct vlr_subscr *vsub) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_PURGE_MS_REQUEST; + + /* provide HLR number in case we know it */ + gsup_msg.hlr_enc_len = vsub->hlr.len; + gsup_msg.hlr_enc = vsub->hlr.buf; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause) +{ + if (!vsub) + return; + + if (vsub->lu_fsm) { + if (vsub->lu_fsm->state == VLR_ULA_S_WAIT_HLR_UPD) + osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_HLR_LU_RES, + (void*)&cause); + else + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_ERROR, + 0); + } + + if (vsub->proc_arq_fsm) + osmo_fsm_inst_term(vsub->proc_arq_fsm, OSMO_FSM_TERM_ERROR, 0); +} + +/* Call vlr_subscr_cancel(), then completely drop the entry from the VLR */ +void vlr_subscr_free(struct vlr_subscr *vsub) +{ + llist_del(&vsub->list); + DEBUGP(DREF, "freeing VLR subscr %s\n", vlr_subscr_name(vsub)); + talloc_free(vsub); +} + +/* Generate a new TMSI and store in vsub->tmsi_new. + * Search all known subscribers to ensure that the TMSI is unique. */ +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub) +{ + struct vlr_instance *vlr = vsub->vlr; + uint32_t tmsi; + int tried; + + for (tried = 0; tried < 100; tried++) { + if (RAND_bytes((uint8_t *) &tmsi, sizeof(tmsi)) != 1) { + LOGP(DVLR, LOGL_ERROR, "RAND_bytes failed\n"); + return -1; + } + /* throw the dice again, if the TSMI doesn't fit */ + if (tmsi == GSM_RESERVED_TMSI) + continue; + + /* Section 2.4 of 23.003: MSC has two MSB 00/01/10, SGSN 11 */ + if (vlr->cfg.is_ps) { + /* SGSN */ + tmsi |= 0xC000000; + } else { + /* MSC */ + if ((tmsi & 0xC0000000) == 0xC0000000) + tmsi &= ~0xC0000000; + } + + /* If this TMSI is already in use, try another one. */ + if (vlr_subscr_find_by_tmsi(vlr, tmsi)) + continue; + + vsub->tmsi_new = tmsi; + return 0; + } + + LOGP(DVLR, LOGL_ERROR, "subscr %s: unable to generate valid TMSI" + " after %d tries\n", vlr_subscr_name(vsub), tried); + return -1; +} + +/* Find subscriber by IMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] imsi IMSI string. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_imsi(vlr, imsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vlr_subscr_set_imsi(vsub, imsi); + LOGP(DVLR, LOGL_INFO, "New subscr, IMSI: %s\n", vsub->imsi); + if (created) + *created = true; + return vsub; +} + +/* Find subscriber by TMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] tmsi TMSI. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_tmsi(vlr, tmsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vsub->tmsi = tmsi; + LOGP(DVLR, LOGL_INFO, "New subscr, TMSI: 0x%08x\n", vsub->tmsi); + if (created) + *created = true; + return vsub; +} + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + vsub->id = atoll(vsub->imsi); + DEBUGP(DVLR, "set IMSI on subscriber; IMSI=%s id=%llu\n", + vsub->imsi, vsub->id); +} + +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imei, imei, sizeof(vsub->imei)); + DEBUGP(DVLR, "set IMEI on subscriber; IMSI=%s IMEI=%s\n", + vsub->imsi, vsub->imei); +} + +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imeisv, imeisv, sizeof(vsub->imeisv)); + DEBUGP(DVLR, "set IMEISV on subscriber; IMSI=%s IMEISV=%s\n", + vsub->imsi, vsub->imeisv); +} + +/* Safely copy the given MSISDN string to vsub->msisdn */ +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->msisdn, msisdn, sizeof(vsub->msisdn)); + DEBUGP(DVLR, "set MSISDN on subscriber; IMSI=%s MSISDN=%s\n", + vsub->imsi, vsub->msisdn); +} + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + return vsub && imsi && vsub->imsi[0] && !strcmp(vsub->imsi, imsi); +} + +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi) +{ + return vsub && tmsi != GSM_RESERVED_TMSI + && (vsub->tmsi == tmsi || vsub->tmsi_new == tmsi); +} + +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + return vsub && msisdn && vsub->msisdn[0] + && !strcmp(vsub->msisdn, msisdn); +} + +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei) +{ + return vsub && imei && vsub->imei[0] + && !strcmp(vsub->imei, imei); +} + +/* Send updated subscriber information to HLR */ +int vlr_subscr_changed(struct vlr_subscr *vsub) +{ + /* FIXME */ + LOGP(DVLR, LOGL_ERROR, "Not implemented: %s\n", __func__); + return 0; +} + +/*********************************************************************** + * PDP context data + ***********************************************************************/ + +struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_alloc(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data* pdata; + + pdata = talloc_zero(vsub, struct sgsn_subscriber_pdp_data); + + llist_add_tail(&pdata->list, &vsub->ps.pdp_list); + + return pdata; +} + +static int vlr_subscr_pdp_data_clear(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data *pdp, *pdp2; + int count = 0; + + llist_for_each_entry_safe(pdp, pdp2, &vsub->ps.pdp_list, list) { + llist_del(&pdp->list); + talloc_free(pdp); + count += 1; + } + + return count; +} + +static struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_get_by_id(struct vlr_subscr *vsub, unsigned context_id) +{ + struct sgsn_subscriber_pdp_data *pdp; + + llist_for_each_entry(pdp, &vsub->ps.pdp_list, list) { + if (pdp->context_id == context_id) + return pdp; + } + + return NULL; +} + +/*********************************************************************** + * Actual Implementation + ***********************************************************************/ + +static int vlr_rx_gsup_unknown_imsi(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup_msg->message_type)) { + vlr_tx_gsup_error_reply(vlr, gsup_msg, + GMM_CAUSE_IMSI_UNKNOWN); + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP request " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } else if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP error " + "of type 0x%02x, cause '%s' (%d)\n", + gsup_msg->imsi, gsup_msg->message_type, + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + } else { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP response " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } + + return -GMM_CAUSE_IMSI_UNKNOWN; +} + +static int vlr_rx_gsup_purge_no_subscr(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGGSUPP(LOGL_NOTICE, gsup_msg, + "Purge MS has failed with cause '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + return -gsup_msg->cause; + } + LOGGSUPP(LOGL_INFO, gsup_msg, "Completing purge MS\n"); + return 0; +} + +/* VLR internal call to request UpdateLocation from HLR */ +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps) +{ + struct osmo_gsup_message gsup_msg = {0}; + int rc; + + gsup_msg.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; + rc = vlr_subscr_tx_gsup_message(vsub, &gsup_msg); + + return rc; +} + +/* VLR internal call to request tuples from HLR */ +int vlr_subscr_req_sai(struct vlr_subscr *vsub, + const uint8_t *auts, const uint8_t *auts_rand) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; + gsup_msg.auts = auts; + gsup_msg.rand = auts_rand; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +/* Tell HLR that authentication failure occurred */ +int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub) +{ + 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)); + return vlr_tx_gsup_message(vsub->vlr, &gsup_msg); +} + +/* Update the subscriber with GSUP-received auth tuples */ +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + unsigned int i; + unsigned int got_tuples; + + if (gsup->num_auth_vectors) { + memset(&vsub->auth_tuples, 0, sizeof(vsub->auth_tuples)); + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + } + + got_tuples = 0; + for (i = 0; i < gsup->num_auth_vectors; i++) { + size_t key_seq = i; + + if (key_seq >= ARRAY_SIZE(vsub->auth_tuples)) { + LOGVSUBP(LOGL_NOTICE, vsub, + "Skipping auth tuple wih invalid cksn %zu\n", + key_seq); + continue; + } + vsub->auth_tuples[i].vec = gsup->auth_vectors[i]; + vsub->auth_tuples[i].key_seq = key_seq; + got_tuples ++; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "Received %u auth tuples\n", got_tuples); + + if (!got_tuples) { + /* FIXME what now? */ + // vlr_subscr_cancel(vsub, GMM_CAUSE_GSM_AUTH_UNACCEPT); ? + } + + /* New tuples means last_tuple becomes invalid */ + vsub->last_tuple = NULL; +} + +/* Handle SendAuthInfo Result/Error from HLR */ +static int vlr_subscr_handle_sai_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + void *data = (void *) gsup; + + switch (gsup->message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_ACK, data); + break; + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_NACK, data); + break; + default: + return -1; + } + + return 0; +} + +static int decode_bcd_number_safe(char *output, int output_len, + const uint8_t *bcd_lv, int input_len, + int h_len) +{ + uint8_t len; + OSMO_ASSERT(output_len >= 1); + *output = '\0'; + if (input_len < 1) + return -EIO; + len = bcd_lv[0]; + if (input_len < len) + return -EIO; + return gsm48_decode_bcd_number(output, output_len, bcd_lv, h_len); +} + +static void vlr_subscr_gsup_insert_data(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup_msg) +{ + unsigned idx; + int rc; + + if (gsup_msg->msisdn_enc) { + decode_bcd_number_safe(vsub->msisdn, sizeof(vsub->msisdn), + gsup_msg->msisdn_enc, + gsup_msg->msisdn_enc_len, 0); + LOGP(DVLR, LOGL_DEBUG, "IMSI:%s has MSISDN:%s\n", + vsub->imsi, vsub->msisdn); + } + + if (gsup_msg->hlr_enc) { + if (gsup_msg->hlr_enc_len > sizeof(vsub->hlr.buf)) { + LOGP(DVLR, LOGL_ERROR, "HLR-Number too long (%zu)\n", + gsup_msg->hlr_enc_len); + vsub->hlr.len = 0; + } else { + memcpy(vsub->hlr.buf, gsup_msg->hlr_enc, + gsup_msg->hlr_enc_len); + vsub->hlr.len = gsup_msg->hlr_enc_len; + } + } + + if (gsup_msg->pdp_info_compl) { + rc = vlr_subscr_pdp_data_clear(vsub); + if (rc > 0) + LOGP(DVLR, LOGL_INFO, "Cleared existing PDP info\n"); + } + + for (idx = 0; idx < gsup_msg->num_pdp_infos; idx++) { + const struct osmo_gsup_pdp_info *pdp_info = &gsup_msg->pdp_infos[idx]; + size_t ctx_id = pdp_info->context_id; + struct sgsn_subscriber_pdp_data *pdp_data; + + if (pdp_info->apn_enc_len >= sizeof(pdp_data->apn_str)-1) { + LOGVSUBP(LOGL_ERROR, vsub, + "APN too long, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, + pdp_info->apn_enc_len)); + continue; + } + + if (pdp_info->qos_enc_len > sizeof(pdp_data->qos_subscribed)) { + LOGVSUBP(LOGL_ERROR, vsub, + "QoS info too long (%zu)\n", + pdp_info->qos_enc_len); + continue; + } + + LOGVSUBP(LOGL_INFO, vsub, + "Will set PDP info, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, pdp_info->apn_enc_len)); + + /* Set PDP info [ctx_id] */ + pdp_data = vlr_subscr_pdp_data_get_by_id(vsub, ctx_id); + if (!pdp_data) { + pdp_data = vlr_subscr_pdp_data_alloc(vsub); + pdp_data->context_id = ctx_id; + } + + OSMO_ASSERT(pdp_data != NULL); + pdp_data->pdp_type = pdp_info->pdp_type; + osmo_apn_to_str(pdp_data->apn_str, + pdp_info->apn_enc, pdp_info->apn_enc_len); + memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); + pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + } +} + + +/* Handle InsertSubscrData Result from HLR */ +static int vlr_subscr_handle_isd_req(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_gsup_message gsup_reply = {0}; + + vlr_subscr_gsup_insert_data(vsub, gsup); + vsub->vlr->ops.subscr_update(vsub); + + gsup_reply.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; + return vlr_subscr_tx_gsup_message(vsub, &gsup_reply); +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Result " + "without LU in progress\n"); + return -ENODEV; + } + + /* contrary to MAP, we allow piggy-backing subscriber data onto the + * UPDATE LOCATION RESULT, and don't mandate the use of a separate + * nested INSERT SUBSCRIBER DATA transaction */ + vlr_subscr_gsup_insert_data(vsub, gsup); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, NULL); + + return 0; +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_err(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Error " + "without LU in progress\n"); + return -ENODEV; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "UpdateLocation failed; gmm_cause: %s\n", + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, + (void *)&gsup->cause); + + return 0; +} + +/* Handle LOCATION CANCEL request from HLR */ +static int vlr_subscr_handle_cancel_req(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct osmo_gsup_message gsup_reply = {0}; + int is_update_procedure = !gsup_msg->cancel_type || + gsup_msg->cancel_type == OSMO_GSUP_CANCEL_TYPE_UPDATE; + + LOGVSUBP(LOGL_INFO, vsub, "Cancelling MS subscriber (%s)\n", + is_update_procedure ? + "update procedure" : "subscription withdraw"); + + gsup_reply.message_type = OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT; + vlr_subscr_tx_gsup_message(vsub, &gsup_reply); + + vlr_subscr_cancel(vsub, gsup_msg->cause); + + return 0; +} + +/* Incoming handler for GSUP from HLR. + * Keep this function non-static for direct invocation by unit tests. */ +int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +{ + struct vlr_instance *vlr = (struct vlr_instance *) gsupc->data; + struct vlr_subscr *vsub; + struct osmo_gsup_message gsup; + int rc; + + DEBUGP(DVLR, "GSUP rx %u: %s\n", msgb_l2len(msg), + osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup); + if (rc < 0) { + LOGP(DVLR, LOGL_ERROR, + "decoding GSUP message fails with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return rc; + } + + if (!gsup.imsi[0]) { + LOGP(DVLR, LOGL_ERROR, "Missing IMSI in GSUP message\n"); + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup.message_type)) + vlr_tx_gsup_error_reply(vlr, &gsup, + GMM_CAUSE_INV_MAND_INFO); + return -GMM_CAUSE_INV_MAND_INFO; + } + + vsub = vlr_subscr_find_by_imsi(vlr, gsup.imsi); + if (!vsub) { + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + return vlr_rx_gsup_purge_no_subscr(vlr, &gsup); + default: + return vlr_rx_gsup_unknown_imsi(vlr, &gsup); + } + } + + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + rc = vlr_subscr_handle_sai_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: + rc = vlr_subscr_handle_isd_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST: + rc = vlr_subscr_handle_cancel_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: + rc = vlr_subscr_handle_lu_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: + rc = vlr_subscr_handle_lu_err(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_DELETE_DATA_REQUEST: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not yet implemented\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + default: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not valid at VLR/SGSN side\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + } + + vlr_subscr_put(vsub); + return rc; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_id_resp(struct vlr_subscr *vsub, + const uint8_t *mi, size_t mi_len) +{ + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type = mi[0] & GSM_MI_TYPE_MASK; + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); + + /* update the vlr_subscr with the given identity */ + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else + vlr_subscr_set_imsi(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEI: + vlr_subscr_set_imei(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEISV: + vlr_subscr_set_imeisv(vsub, mi_string); + break; + } + + if (vsub->auth_fsm) { + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + osmo_fsm_inst_dispatch(vsub->auth_fsm, + VLR_AUTH_E_MS_ID_IMSI, mi_string); + break; + } + } + + if (vsub->lu_fsm) { + uint32_t event = 0; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + event = VLR_ULA_E_ID_IMSI; + break; + case GSM_MI_TYPE_IMEI: + event = VLR_ULA_E_ID_IMEI; + break; + case GSM_MI_TYPE_IMEISV: + event = VLR_ULA_E_ID_IMEISV; + break; + default: + OSMO_ASSERT(0); + break; + } + osmo_fsm_inst_dispatch(vsub->lu_fsm, event, mi_string); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, "gratuitous ID RESPONSE?!?\n"); + } + + return 0; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_tmsi_reall_compl(struct vlr_subscr *vsub) +{ + if (vsub->lu_fsm) { + return osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_NEW_TMSI_ACK, NULL); + } else if (vsub->proc_arq_fsm) { + return osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, + PR_ARQ_E_TMSI_ACK, NULL); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, + "gratuitous TMSI REALLOC COMPL"); + return -EINVAL; + } +} + +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); + } + return 0; +} + +/* Tear down any running FSMs due to MSC connection timeout. + * Visit all vsub->*_fsm pointers and give them a queue to send a final reject + * message before the entire connection is torn down. + * \param[in] vsub subscriber to tear down + */ +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub) +{ + if (!vsub) + return; + + vlr_loc_update_conn_timeout(vsub->lu_fsm); + vlr_parq_conn_timeout(vsub->proc_arq_fsm); +} + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops) +{ + struct vlr_instance *vlr = talloc_zero(ctx, struct vlr_instance); + OSMO_ASSERT(vlr); + OSMO_ASSERT(ops->tx_auth_req); + OSMO_ASSERT(ops->tx_auth_rej); + OSMO_ASSERT(ops->tx_id_req); + OSMO_ASSERT(ops->tx_lu_acc); + OSMO_ASSERT(ops->tx_lu_rej); + OSMO_ASSERT(ops->tx_cm_serv_acc); + OSMO_ASSERT(ops->tx_cm_serv_rej); + OSMO_ASSERT(ops->set_ciph_mode); + OSMO_ASSERT(ops->subscr_update); + OSMO_ASSERT(ops->subscr_assoc); + + INIT_LLIST_HEAD(&vlr->subscribers); + INIT_LLIST_HEAD(&vlr->operations); + memcpy(&vlr->ops, ops, sizeof(vlr->ops)); + + /* osmo_auth_fsm.c */ + osmo_fsm_register(&vlr_auth_fsm); + /* osmo_lu_fsm.c */ + vlr_lu_fsm_init(); + /* vlr_access_request_fsm.c */ + vlr_parq_fsm_init(); + + return vlr; +} + +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port) +{ + OSMO_ASSERT(vlr); + + vlr->gsup_client = gsup_client_create(gsup_unit_name, + gsup_server_addr_str, + gsup_server_port, + &vlr_gsupc_read_cb, NULL); + if (!vlr->gsup_client) + return -ENOMEM; + vlr->gsup_client->data = vlr; + + return 0; +} + +/* MSC->VLR: Subscribre has disconnected */ +int vlr_subscr_disconnected(struct vlr_subscr *vsub) +{ + /* This corresponds to a MAP-ABORT from MSC->VLR on a classic B + * interface */ + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_REQUEST, NULL); + osmo_fsm_inst_term(vsub->auth_fsm, OSMO_FSM_TERM_REQUEST, NULL); + vsub->msc_conn_ref = NULL; + + return 0; +} + +/* MSC->VLR: Receive Authentication Failure from Subscriber */ +int vlr_subscr_rx_auth_fail(struct vlr_subscr *vsub, const uint8_t *auts) +{ + struct vlr_auth_resp_par par = {0}; + par.auts = auts; + + osmo_fsm_inst_dispatch(vsub->auth_fsm, VLR_AUTH_E_MS_AUTH_FAIL, &par); + return 0; +} + +/* MSC->VLR: Receive Authentication Response from MS + * \returns 1 in case of success, 0 in case of delay, -1 on auth error */ +int vlr_subscr_rx_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, uint8_t res_len) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + struct vlr_auth_resp_par par; + + par.is_r99 = is_r99; + par.is_utran = is_utran; + par.res = res; + par.res_len = res_len; + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_MS_AUTH_RESP, (void *) &par); + + return 0; +} + +/* MSC->VLR: Receive result of Ciphering Mode Command from MS */ +void vlr_subscr_rx_ciph_res(struct vlr_subscr *vsub, struct vlr_ciph_result *res) +{ + if (vsub->lu_fsm && vsub->lu_fsm->state == VLR_ULA_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_CIPH_RES, res); + if (vsub->proc_arq_fsm + && vsub->proc_arq_fsm->state == PR_ARQ_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, PR_ARQ_E_CIPH_RES, + res); +} + +/* Internal evaluation of requested ciphering mode. + * Send set_ciph_mode() to MSC depending on the ciph_mode argument. + * \param[in] vlr VLR instance. + * \param[in] fi Calling FSM instance, for logging. + * \param[in] msc_conn_ref MSC conn to send to. + * \param[in] ciph_mode Ciphering config, to decide whether to do ciphering. + * \returns 0 if no ciphering is needed or message was sent successfully, + * or a negative value if ciph_mode is invalid or sending failed. + */ +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv) +{ + switch (ciph_mode) { + case VLR_CIPH_NONE: + return 0; + + case VLR_CIPH_A5_1: + case VLR_CIPH_A5_3: + return vlr->ops.set_ciph_mode(msc_conn_ref, + ciph_mode, + 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; + } +} + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr) +{ + struct vlr_subscr **fsub = (void*)&target->filter_data[LOG_FLT_VLR_SUBSCR]; + + /* free the old data */ + if (*fsub) { + vlr_subscr_put(*fsub); + *fsub = NULL; + } + + if (vlr_subscr) { + target->filter_map |= (1 << LOG_FLT_VLR_SUBSCR); + *fsub = vlr_subscr_get(vlr_subscr); + } else + target->filter_map &= ~(1 << LOG_FLT_VLR_SUBSCR); +} diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c new file mode 100644 index 0000000..241478f --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.c @@ -0,0 +1,776 @@ +/* Osmocom Visitor Location Register (VLR): Access Request FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define S(x) (1 << (x)) + +/*********************************************************************** + * Process_Access_Request_VLR, TS 29.002 Chapter 25.4.2 + ***********************************************************************/ + +const struct value_string vlr_proc_arq_result_names[] = { + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_NONE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_SYSTEM_FAILURE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNIDENT_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ROAMING_NOTALLOWED), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_EQUIP), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNKNOWN_ERROR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_TIMEOUT), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_PASSED), + { 0, NULL } +}; + +static const struct value_string proc_arq_vlr_event_names[] = { + OSMO_VALUE_STRING(PR_ARQ_E_START), + OSMO_VALUE_STRING(PR_ARQ_E_ID_IMSI), + OSMO_VALUE_STRING(PR_ARQ_E_AUTH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_CIPH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_UPD_LOC_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TRACE_RES), + OSMO_VALUE_STRING(PR_ARQ_E_IMEI_RES), + OSMO_VALUE_STRING(PR_ARQ_E_PRES_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TMSI_ACK), + { 0, NULL } +}; + +struct proc_arq_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *ul_child_fsm; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + + enum vlr_parq_type type; + enum vlr_proc_arq_result result; + bool by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool implicitly_accepted_parq_by_ciphering_cmd; +}; + +static void assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + + vsub->msc_conn_ref = par->msc_conn_ref; + par->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(par->msc_conn_ref, par->vsub); +} + +#define proc_arq_fsm_done(fi, res) _proc_arq_fsm_done(fi, res, __FILE__, __LINE__) +static void _proc_arq_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_proc_arq_result res, + const char *file, int line) +{ + struct proc_arq_priv *par = fi->priv; + LOGPFSMSRC(fi, file, line, "proc_arq_fsm_done(%s)\n", + vlr_proc_arq_result_name(res)); + par->result = res; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_DONE, 0, 0); +} + +static void proc_arq_vlr_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct proc_arq_priv *par = fi->priv; + bool success; + int rc; + LOGPFSM(fi, "Process Access Request result: %s\n", + vlr_proc_arq_result_name(par->result)); + + success = (par->result == VLR_PR_ARQ_RES_PASSED); + + /* It would be logical to first dispatch the success event to the + * parent FSM, but that could start actions that send messages to the + * MS. Rather send the CM Service Accept message first and then signal + * success. Since messages are handled synchronously, the success event + * will be processed before we handle new incoming data from the MS. */ + + if (par->type == VLR_PR_ARQ_T_CM_SERV_REQ) { + if (success + && !par->implicitly_accepted_parq_by_ciphering_cmd) { + rc = par->vlr->ops.tx_cm_serv_acc(par->msc_conn_ref); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Accept\n"); + success = false; + } + } + if (!success) { + rc = par->vlr->ops.tx_cm_serv_rej(par->msc_conn_ref, + par->result); + if (rc) + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Reject\n"); + } + } + + /* For VLR_PR_ARQ_T_PAGING_RESP, there is nothing to send. The conn_fsm + * will start handling pending paging transactions. */ + + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + success ? par->parent_event_success + : par->parent_event_failure, + par->parent_event_data); +} + +void proc_arq_vlr_cleanup(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause) +{ + struct proc_arq_priv *par = fi->priv; + if (par->vsub && par->vsub->proc_arq_fsm == fi) + par->vsub->proc_arq_fsm = NULL; +} + +static void _proc_arq_vlr_post_imei(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + /* TODO: Identity := IMSI */ + if (0 /* TODO: TMSI reallocation at access: vlr->cfg.alloc_tmsi_arq */) { + vlr_subscr_alloc_tmsi(vsub); + /* TODO: forward TMSI to MS, wait for TMSI + * REALLOC COMPLETE */ + /* TODO: Freeze old TMSI */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TMSI_ACK, 0, 0); + return; + } + + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static void _proc_arq_vlr_post_trace(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + /* Node 3 */ + if (0 /* IMEI check required */) { + /* Chck_IMEI_VLR */ + vlr->ops.tx_id_req(par->msc_conn_ref, GSM_MI_TYPE_IMEI); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CHECK_IMEI, + vlr_timer(vlr, 3270), 3270); + } else + _proc_arq_vlr_post_imei(fi); +} + +/* After Subscriber_Present_VLR */ +static void _proc_arq_vlr_post_pres(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + if (0 /* TODO: tracing required */) { + /* TODO: Trace_Subscriber_Activity_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TRACE_SUB, 0, 0); + } + _proc_arq_vlr_post_trace(fi); +} + +/* After Update_Location_Child_VLR */ +static void _proc_arq_vlr_node2_post_vlr(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!vsub->sub_dataconf_by_hlr_ind) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + if (0 /* roaming not allowed in LA */) { + /* Set User Error: Roaming not allowed in this LA */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ROAMING_NOTALLOWED); + return; + } + vsub->imsi_detached_flag = false; + if (vsub->ms_not_reachable_flag) { + /* Start Subscriber_Present_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_SUB_PRES, 0, 0); + par->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + PR_ARQ_E_PRES_RES); + return; + } + _proc_arq_vlr_post_pres(fi); +} + +static void _proc_arq_vlr_node2_post_ciph(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + vsub->conf_by_radio_contact_ind = true; + if (vsub->loc_conf_in_hlr_ind == false) { + /* start Update_Location_Child_VLR. WE use + * Update_HLR_VLR instead, the differences appear + * insignificant for now. */ + par->ul_child_fsm = upd_hlr_vlr_proc_start(fi, vsub, + PR_ARQ_E_UPD_LOC_RES); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_UPD_LOC_CHILD, 0, 0); + return; + } + _proc_arq_vlr_node2_post_vlr(fi); +} + +static bool is_ciph_required(struct proc_arq_priv *par) +{ + return par->ciphering_required != VLR_CIPH_NONE; +} + +static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!is_ciph_required(par)) { + _proc_arq_vlr_node2_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, par->msc_conn_ref, + par->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_SYSTEM_FAILURE); + return; + } + + par->implicitly_accepted_parq_by_ciphering_cmd = true; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CIPH, 0, 0); +} + +static bool is_auth_required(struct proc_arq_priv *par) +{ + /* 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); +} + +/* after the IMSI is known */ +static void proc_arq_vlr_fn_post_imsi(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + /* TODO: Identity IMEI -> System Failure */ + if (is_auth_required(par)) { + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_AUTH, + 0, 0); + vsub->auth_fsm = auth_fsm_start(vsub, fi->log_level, fi, + PR_ARQ_E_AUTH_RES, + par->is_r99, + par->is_utran); + } else { + _proc_arq_vlr_node2(fi); + } +} + +static void proc_arq_vlr_fn_init(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub = NULL; + + OSMO_ASSERT(event == PR_ARQ_E_START); + + /* Obtain_Identity_VLR */ + if (!par->by_tmsi) { + /* IMSI was included */ + vsub = vlr_subscr_find_by_imsi(par->vlr, par->imsi); + } else { + /* TMSI was included */ + vsub = vlr_subscr_find_by_tmsi(par->vlr, par->tmsi); + } + if (vsub) { + if (vsub->proc_arq_fsm && fi != vsub->proc_arq_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "Another proc_arq_fsm is already" + " associated with subscr %s," + " terminating the other FSM.\n", + vlr_subscr_name(vsub)); + proc_arq_fsm_done(vsub->proc_arq_fsm, + VLR_PR_ARQ_RES_SYSTEM_FAILURE); + } + vsub->proc_arq_fsm = fi; + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); + return; + } + /* No VSUB could be resolved. What now? */ + + if (!par->by_tmsi) { + /* We couldn't find a subscriber even by IMSI, + * Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } else { + /* TMSI was included, are we permitted to use it? */ + if (vlr->cfg.parq_retrieve_imsi) { + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_OBTAIN_IMSI, + vlr_timer(vlr, 3270), 3270); + return; + } else { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + } +} + +/* ID REQ(IMSI) has returned */ +static void proc_arq_vlr_fn_w_obt_imsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub; + + OSMO_ASSERT(event == PR_ARQ_E_ID_IMSI); + + vsub = vlr_subscr_find_by_imsi(vlr, par->imsi); + if (!vsub) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); +} + +/* Authenticate_VLR has completed */ +static void proc_arq_vlr_fn_w_auth(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + enum vlr_auth_fsm_result *res = data; + enum vlr_proc_arq_result ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + + OSMO_ASSERT(res); + LOGPFSM(fi, "got %s\n", vlr_auth_fsm_result_name(*res)); + + OSMO_ASSERT(event == PR_ARQ_E_AUTH_RES); + + if (res) { + switch (*res) { + case VLR_AUTH_RES_PASSED: + /* Node 2 */ + _proc_arq_vlr_node2(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* Error */ + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* Set User Error: Unidentified Subscriber */ + ret = VLR_PR_ARQ_RES_UNIDENT_SUBSCR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* Set User Error: Illegal Subscriber */ + ret = VLR_PR_ARQ_RES_ILLEGAL_SUBSCR; + break; + case VLR_AUTH_RES_PROC_ERR: + /* Set User Error: System failure */ + ret = VLR_PR_ARQ_RES_SYSTEM_FAILURE; + break; + } + } + /* send process_access_req response to caller */ + /* enter error state */ + proc_arq_fsm_done(fi, ret); +} + +static void proc_arq_vlr_fn_w_ciph(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == PR_ARQ_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + } + + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + _proc_arq_vlr_node2_post_ciph(fi); +} + +/* Update_Location_Child_VLR has completed */ +static void proc_arq_vlr_fn_w_upd_loc(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_UPD_LOC_RES); + + _proc_arq_vlr_node2_post_vlr(fi); +} + +/* Subscriber_Present_VLR has completed */ +static void proc_arq_vlr_fn_w_pres(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_PRES_RES); + + _proc_arq_vlr_post_pres(fi); +} + +static void proc_arq_vlr_fn_w_trace(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TRACE_RES); + + _proc_arq_vlr_post_trace(fi); +} + +/* we have received the ID RESPONSE (IMEI) */ +static void proc_arq_vlr_fn_w_imei(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_IMEI_RES); + + _proc_arq_vlr_post_imei(fi); +} + +/* MSC tells us that MS has acknowleded TMSI re-allocation */ +static void proc_arq_vlr_fn_w_tmsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TMSI_ACK); + + /* FIXME: check confirmation? unfreeze? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static const struct osmo_fsm_state proc_arq_vlr_states[] = { + [PR_ARQ_S_INIT] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_INIT), + .in_event_mask = S(PR_ARQ_E_START), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_OBTAIN_IMSI) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_init, + }, + [PR_ARQ_S_WAIT_OBTAIN_IMSI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_OBTAIN_IMSI), + .in_event_mask = S(PR_ARQ_E_ID_IMSI), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_obt_imsi, + }, + [PR_ARQ_S_WAIT_AUTH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_AUTH), + .in_event_mask = S(PR_ARQ_E_AUTH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CIPH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_auth, + }, + [PR_ARQ_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CIPH), + .in_event_mask = S(PR_ARQ_E_CIPH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_ciph, + }, + [PR_ARQ_S_WAIT_UPD_LOC_CHILD] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_UPD_LOC_CHILD), + .in_event_mask = S(PR_ARQ_E_UPD_LOC_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_upd_loc, + }, + [PR_ARQ_S_WAIT_SUB_PRES] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_SUB_PRES), + .in_event_mask = S(PR_ARQ_E_PRES_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_pres, + }, + [PR_ARQ_S_WAIT_TRACE_SUB] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TRACE_SUB), + .in_event_mask = S(PR_ARQ_E_TRACE_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_trace, + }, + [PR_ARQ_S_WAIT_CHECK_IMEI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CHECK_IMEI), + .in_event_mask = S(PR_ARQ_E_IMEI_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_imei, + }, + [PR_ARQ_S_WAIT_TMSI_ACK] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TMSI_ACK), + .in_event_mask = S(PR_ARQ_E_TMSI_ACK), + .out_state_mask = S(PR_ARQ_S_DONE), + .action = proc_arq_vlr_fn_w_tmsi, + }, + [PR_ARQ_S_DONE] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_DONE), + .onenter = proc_arq_vlr_dispatch_result, + }, +}; + +static struct osmo_fsm proc_arq_vlr_fsm = { + .name = "Process_Access_Request_VLR", + .states = proc_arq_vlr_states, + .num_states = ARRAY_SIZE(proc_arq_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = proc_arq_vlr_event_names, + .cleanup = proc_arq_vlr_cleanup, +}; + +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct proc_arq_priv *par; + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type; + + fi = osmo_fsm_inst_alloc_child(&proc_arq_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return; + + par = talloc_zero(fi, struct proc_arq_priv); + fi->priv = par; + par->vlr = vlr; + par->msc_conn_ref = msc_conn_ref; + par->type = type; + par->lai = *lai; + par->parent_event_success = parent_event_success; + par->parent_event_failure = parent_event_failure; + par->parent_event_data = parent_event_data; + par->authentication_required = authentication_required; + par->ciphering_required = ciphering_required; + par->is_r99 = is_r99; + par->is_utran = is_utran; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi_lv+1, mi_lv[0]); + mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); + par->imsi[sizeof(par->imsi)-1] = '\0'; + par->by_tmsi = false; + break; + case GSM_MI_TYPE_TMSI: + par->by_tmsi = true; + par->tmsi = osmo_load32be(mi_lv+2); + break; + case GSM_MI_TYPE_IMEI: + /* TODO: IMEI (emergency call) */ + default: + /* FIXME: directly send reject? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + + osmo_fsm_inst_dispatch(fi, PR_ARQ_E_START, NULL); +} + +/* Gracefully terminate an FSM created by vlr_proc_acc_req() in case of + * external timeout (i.e. from MSC). */ +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == PR_ARQ_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_TIMEOUT); +} + + +#if 0 +/*********************************************************************** + * Update_Location_Child_VLR, TS 29.002 Chapter 25.4.4 + ***********************************************************************/ + +enum upd_loc_child_vlr_state { + ULC_S_IDLE, + ULC_S_WAIT_HLR_RESP, + ULC_S_DONE, +}; + +enum upd_loc_child_vlr_event { + ULC_E_START, +}; + +static const struct value_string upd_loc_child_vlr_event_names[] = { + { ULC_E_START, "START" }, + { 0, NULL } +}; + +static void upd_loc_child_f_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + OSMO_ASSERT(event == ULC_E_START); + + /* send update location */ +} + +static void upd_loc_child_f_w_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ +} + +static const struct osmo_fsm_state upd_loc_child_vlr_states[] = { + [ULC_S_IDLE] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_WAIT_HLR_RESP) | + S(ULC_S_DONE), + .name = "IDLE", + .action = upd_loc_child_f_idle, + }, + [ULC_S_WAIT_HLR_RESP] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_DONE), + .name = "WAIT-HLR-RESP", + .action = upd_loc_child_f_w_hlr, + }, + [ULC_S_DONE] = { + .name = "DONE", + }, +}; + +static struct osmo_fsm upd_loc_child_vlr_fsm = { + .name = "Update_Location_Child_VLR", + .states = upd_loc_child_vlr_states, + .num_states = ARRAY_SIZE(upd_loc_child_vlr_states), + .log_subsys = DVLR, + .event_names = upd_loc_child_vlr_event_names, +}; +#endif + +void vlr_parq_fsm_init(void) +{ + //osmo_fsm_register(&upd_loc_child_vlr_fsm); + osmo_fsm_register(&proc_arq_vlr_fsm); +} diff --git a/src/libvlr/vlr_access_req_fsm.h b/src/libvlr/vlr_access_req_fsm.h new file mode 100644 index 0000000..8386da6 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.h @@ -0,0 +1,17 @@ +#pragma once + +enum proc_arq_vlr_state { + PR_ARQ_S_INIT, + /* Waiting for Obtain_Identity_VLR (IMSI) result */ + PR_ARQ_S_WAIT_OBTAIN_IMSI, + /* Waiting for Authenticate_VLR result */ + PR_ARQ_S_WAIT_AUTH, + PR_ARQ_S_WAIT_CIPH, + PR_ARQ_S_WAIT_UPD_LOC_CHILD, + PR_ARQ_S_WAIT_SUB_PRES, + PR_ARQ_S_WAIT_TRACE_SUB, + PR_ARQ_S_WAIT_CHECK_IMEI, + PR_ARQ_S_WAIT_TMSI_ACK, + PR_ARQ_S_WAIT_CECK_CONF, + PR_ARQ_S_DONE, +}; diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c new file mode 100644 index 0000000..0eb86e7 --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.c @@ -0,0 +1,605 @@ +/* Osmocom Visitor Location Register (VLR) Autentication FSM */ + +/* (C) 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 +#include +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" + +#define S(x) (1 << (x)) + +static const struct value_string fsm_auth_event_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_E_START), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_NACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ABORT), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_RESP), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_FAIL), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_ID_IMSI), + { 0, NULL } +}; + +const struct value_string vlr_auth_fsm_result_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_RES_ABORTED), + OSMO_VALUE_STRING(VLR_AUTH_RES_UNKNOWN_SUBSCR), + OSMO_VALUE_STRING(VLR_AUTH_RES_PROC_ERR), + OSMO_VALUE_STRING(VLR_AUTH_RES_AUTH_FAILED), + OSMO_VALUE_STRING(VLR_AUTH_RES_PASSED), + {0, NULL} +}; + +/* private state of the auth_fsm_instance */ +struct auth_fsm_priv { + struct vlr_subscr *vsub; + bool by_imsi; + bool is_r99; + bool is_utran; + bool auth_requested; + + int auth_tuple_max_use_count; /* see vlr->cfg instead */ +}; + +/*********************************************************************** + * Utility functions + ***********************************************************************/ + +/* Always use either vlr_subscr_get_auth_tuple() or vlr_subscr_has_auth_tuple() + * instead, to ensure proper use count. + * Return an auth tuple with the lowest use_count among the auth tuples. If + * max_use_count >= 0, return NULL if all available auth tuples have a use + * count > max_use_count. If max_use_count is negative, return a currently + * least used auth tuple without enforcing a maximum use count. If there are + * no auth tuples, return NULL. + */ +static struct gsm_auth_tuple * +_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + unsigned int count; + unsigned int idx; + struct gsm_auth_tuple *at = NULL; + unsigned int key_seq = GSM_KEY_SEQ_INVAL; + + if (!vsub) + return NULL; + + if (vsub->last_tuple) + key_seq = vsub->last_tuple->key_seq; + + if (key_seq == GSM_KEY_SEQ_INVAL) + /* Start with 0 after increment modulo array size */ + idx = ARRAY_SIZE(vsub->auth_tuples) - 1; + else + idx = key_seq; + + for (count = ARRAY_SIZE(vsub->auth_tuples); count > 0; count--) { + idx = (idx + 1) % ARRAY_SIZE(vsub->auth_tuples); + + if (vsub->auth_tuples[idx].key_seq == GSM_KEY_SEQ_INVAL) + continue; + + if (!at || vsub->auth_tuples[idx].use_count < at->use_count) + at = &vsub->auth_tuples[idx]; + } + + if (!at || (max_use_count >= 0 && at->use_count > max_use_count)) + return NULL; + + return at; +} + +/* Return an auth tuple and increment its use count. */ +static struct gsm_auth_tuple * +vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + struct gsm_auth_tuple *at = _vlr_subscr_next_auth_tuple(vsub, + max_use_count); + if (!at) + return NULL; + at->use_count++; + return at; +} + +/* Return whether an auth tuple with the given max_use_count is available. */ +static bool vlr_subscr_has_auth_tuple(struct vlr_subscr *vsub, + int max_use_count) +{ + return _vlr_subscr_next_auth_tuple(vsub, max_use_count) != NULL; +} + +static bool check_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, + uint8_t res_len) +{ + struct gsm_auth_tuple *at = vsub->last_tuple; + struct osmo_auth_vector *vec = &at->vec; + bool check_umts; + OSMO_ASSERT(at); + + LOGVSUBP(LOGL_DEBUG, vsub, "received res: %s\n", + osmo_hexdump(res, res_len)); + + /* RES must be present and at least 32bit */ + if (!res || res_len < sizeof(vec->sres)) { + LOGVSUBP(LOGL_NOTICE, vsub, "AUTH RES missing or too short " + "(%u)\n", res_len); + goto out_false; + } + + check_umts = false; + if (is_r99 && (vec->auth_types & OSMO_AUTH_TYPE_UMTS)) { + check_umts = true; + /* We have a R99 capable UE and have a UMTS AKA capable USIM. + * However, the ME may still choose to only perform GSM AKA, as + * long as the bearer is GERAN */ + if (res_len != vec->res_len) { + if (is_utran) { + LOGVSUBP(LOGL_NOTICE, vsub, + "AUTH via UTRAN but " + "res_len(%u) != vec->res_len(%u)\n", + res_len, vec->res_len); + goto out_false; + } + check_umts = false; + } + } + + if (check_umts) { + if (res_len != vec->res_len + || memcmp(res, vec->res, res_len)) { + LOGVSUBP(LOGL_INFO, vsub, "UMTS AUTH failure:" + " mismatching res (expected res=%s)\n", + osmo_hexdump(vec->res, vec->res_len)); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established UMTS security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_UMTS; + return true; + } else { + if (res_len != sizeof(vec->sres) + || memcmp(res, vec->sres, sizeof(vec->sres))) { + LOGVSUBP(LOGL_INFO, vsub, "GSM AUTH failure:" + " mismatching sres (expected sres=%s)\n", + osmo_hexdump(vec->sres, sizeof(vec->sres))); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established GSM security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_GSM; + return true; + } + +out_false: + vsub->sec_ctx = VLR_SEC_CTX_NONE; + return false; +} + +static void auth_fsm_onenter_failed(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + /* If authentication hasn't even started, e.g. the HLR sent no auth + * info, then we also don't need to tell the HLR about an auth failure. + */ + if (afp->auth_requested) + vlr_subscr_tx_auth_fail_rep(vsub); +} + +static bool is_umts_auth(struct auth_fsm_priv *afp, + uint32_t auth_types) +{ + if (!afp->is_r99) + return false; + if (!(auth_types & OSMO_AUTH_TYPE_UMTS)) + return false; + return true; +} + +/* Terminate the Auth FSM Instance and notify parent */ +static void auth_fsm_term(struct osmo_fsm_inst *fi, enum vlr_auth_fsm_result res) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + LOGPFSM(fi, "Authentication terminating with result %s\n", + vlr_auth_fsm_result_name(res)); + + /* Do one final state transition (mostly for logging purpose) */ + if (res == VLR_AUTH_RES_PASSED) + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTHENTICATED, 0, 0); + else + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTH_FAILED, 0, 0); + + /* return the result to the parent FSM */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, &res); + vsub->auth_fsm = NULL; +} + +/* back-end function transmitting authentication. Caller ensures we have valid + * tuple */ +static int _vlr_subscr_authenticate(struct osmo_fsm_inst *fi) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct gsm_auth_tuple *at; + + /* Caller ensures we have vectors available */ + at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_use_count); + if (!at) { + LOGPFSML(fi, LOGL_ERROR, "A previous check ensured that an" + " auth tuple was available, but now there is in fact" + " none.\n"); + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return -1; + } + + LOGPFSM(fi, "got auth tuple: use_count=%d key_seq=%d\n", + at->use_count, at->key_seq); + + OSMO_ASSERT(at); + + /* Transmit auth req to subscriber */ + afp->auth_requested = true; + vsub->last_tuple = at; + vsub->vlr->ops.tx_auth_req(vsub->msc_conn_ref, at, + is_umts_auth(afp, at->vec.auth_types)); + return 0; +} + +/*********************************************************************** + * FSM State Action functions + ***********************************************************************/ + +/* Initial State of TS 23.018 AUT_VLR */ +static void auth_fsm_needs_auth(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + OSMO_ASSERT(event == VLR_AUTH_E_START); + + /* Start off with the default max_use_count, possibly change that if we + * need to re-use an old tuple. */ + afp->auth_tuple_max_use_count = vsub->vlr->cfg.auth_tuple_max_use_count; + + /* Check if we have vectors available */ + if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_use_count)) { + /* Obtain_Authentication_Sets_VLR */ + vlr_subscr_req_sai(vsub, NULL, NULL); + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + GSM_29002_TIMER_M, 0); + } else { + /* go straight ahead with sending auth request */ + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); + } +} + +/* Waiting for Authentication Info from HLR */ +static void auth_fsm_wait_ai(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + if (event == VLR_AUTH_E_HLR_SAI_NACK) + LOGPFSM(fi, "GSUP: rx Auth Info Error cause: %d: %s\n", + gsup->cause, + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) + || (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) + || (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + if (vsub->vlr->cfg.auth_reuse_old_sets_on_error + && vlr_subscr_has_auth_tuple(vsub, -1)) { + /* To re-use an old tuple, disable the max_use_count + * constraint. */ + afp->auth_tuple_max_use_count = -1; + goto pass; + } + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return; + } + + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for Authentication Response from MS */ +static void auth_fsm_wait_auth_resp(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_instance *vlr = vsub->vlr; + struct vlr_auth_resp_par *par = data; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + } + } else { + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + if (par->auts) { + /* First failure, start re-sync attempt */ + vlr_subscr_req_sai(vsub, par->auts, + vsub->last_tuple->vec.rand); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + GSM_29002_TIMER_M, 0); + } else + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* Waiting for Authentication Info from HLR (resync case) */ +static void auth_fsm_wait_ai_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) || + (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) || + (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + } + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP_RESYNC, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for AUTH RESP from MS (re-sync case) */ +static void auth_fsm_wait_auth_resp_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_auth_resp_par *par = data; + struct vlr_instance *vlr = vsub->vlr; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + /* Result = Aborted */ + auth_fsm_term(fi, VLR_AUTH_RES_ABORTED); + } + } else { + /* Result = Pass */ + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + /* Second failure: Result = Fail */ + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* AUT_VLR waiting for Obtain_IMSI_VLR result */ +static void auth_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + const char *mi_string = data; + + switch (event) { + case VLR_AUTH_E_MS_ID_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else { + strncpy(vsub->imsi, mi_string, sizeof(vsub->imsi)); + vsub->imsi[sizeof(vsub->imsi)-1] = '\0'; + } + /* retry with identity=IMSI */ + afp->by_imsi = true; + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH, 0, 0); + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + break; + } +} + +static const struct osmo_fsm_state auth_fsm_states[] = { + [VLR_SUB_AS_NEEDS_AUTH] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH), + .in_event_mask = S(VLR_AUTH_E_START), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_needs_auth, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_AI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_wait_ai, + }, + [VLR_SUB_AS_WAIT_RESP] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_WAIT_ID_IMSI) | + S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED) | + S(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .action = auth_fsm_wait_auth_resp, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP_RESYNC), + .action = auth_fsm_wait_ai_resync, + }, + [VLR_SUB_AS_WAIT_RESP_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP_RESYNC), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED), + .action = auth_fsm_wait_auth_resp_resync, + }, + [VLR_SUB_AS_WAIT_ID_IMSI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_ID_IMSI), + .in_event_mask = S(VLR_AUTH_E_MS_ID_IMSI), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH), + .action = auth_fsm_wait_imsi, + }, + [VLR_SUB_AS_AUTHENTICATED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTHENTICATED), + .in_event_mask = 0, + .out_state_mask = 0, + }, + [VLR_SUB_AS_AUTH_FAILED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTH_FAILED), + .in_event_mask = 0, + .out_state_mask = 0, + .onenter = auth_fsm_onenter_failed, + }, +}; + +struct osmo_fsm vlr_auth_fsm = { + .name = "VLR_Authenticate", + .states = auth_fsm_states, + .num_states = ARRAY_SIZE(auth_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_auth_event_names, +}; + +/*********************************************************************** + * User API (for SGSN/MSC code) + ***********************************************************************/ + +/* MSC->VLR: Start Procedure Authenticate_VLR (TS 23.012 Ch. 4.1.2.2) */ +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct auth_fsm_priv *afp; + + fi = osmo_fsm_inst_alloc_child(&vlr_auth_fsm, parent, + parent_term_event); + + + afp = talloc_zero(fi, struct auth_fsm_priv); + if (!afp) { + osmo_fsm_inst_dispatch(parent, parent_term_event, 0); + return NULL; + } + + afp->vsub = vsub; + if (vsub->imsi[0]) + afp->by_imsi = true; + afp->is_r99 = is_r99; + afp->is_utran = is_utran; + fi->priv = afp; + vsub->auth_fsm = fi; + + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + + return fi; +} diff --git a/src/libvlr/vlr_auth_fsm.h b/src/libvlr/vlr_auth_fsm.h new file mode 100644 index 0000000..226435f --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.h @@ -0,0 +1,52 @@ +#pragma once + +#include + +/* Parameters to VLR_AUTH_E_MS_AUTH_RESP */ +struct vlr_auth_resp_par { + bool is_r99; + bool is_utran; + const uint8_t *res; + unsigned int res_len; + const uint8_t *auts; +}; + +/* Result communicated back to parent FMS */ +enum vlr_auth_fsm_result { + VLR_AUTH_RES_ABORTED, + VLR_AUTH_RES_UNKNOWN_SUBSCR, + VLR_AUTH_RES_PROC_ERR, + VLR_AUTH_RES_AUTH_FAILED, + VLR_AUTH_RES_PASSED, +}; + +extern const struct value_string vlr_auth_fsm_result_names[]; +static inline const char *vlr_auth_fsm_result_name(enum vlr_auth_fsm_result val) +{ + return get_value_string(vlr_auth_fsm_result_names, val); +} + +enum vlr_fsm_auth_event { + VLR_AUTH_E_START, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo ACK from HLR */ + VLR_AUTH_E_HLR_SAI_ACK, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo NACK from HLR */ + VLR_AUTH_E_HLR_SAI_NACK, + /* FIXME: merge with NACK? */ + VLR_AUTH_E_HLR_SAI_ABORT, + /* Authentication Response from MS */ + VLR_AUTH_E_MS_AUTH_RESP, + /* Authentication Failure from MS */ + VLR_AUTH_E_MS_AUTH_FAIL, + /* Identity Response (IMSI) from MS */ + VLR_AUTH_E_MS_ID_IMSI, +}; + +struct osmo_fsm vlr_auth_fsm; + +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran); diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h new file mode 100644 index 0000000..0e63c7e --- /dev/null +++ b/src/libvlr/vlr_core.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#define LOGGSUPP(level, gsup, fmt, args...) \ + LOGP(DVLR, level, "GSUP(%s) " fmt, \ + (gsup)->imsi, \ + ## args) + +#define LOGVSUBP(level, vsub, fmt, args...) \ + LOGP(DVLR, level, "SUBSCR(%s) " fmt, \ + vlr_subscr_name(vsub), ## args) + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps); +int vlr_subscr_req_sai(struct vlr_subscr *vsub, const uint8_t *auts, + const uint8_t *auts_rand); +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c new file mode 100644 index 0000000..d32659f --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.c @@ -0,0 +1,1424 @@ +/* Osmocom Visitor Location Register (VLR): Location Update FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" + +#define S(x) (1 << (x)) + +#define LU_TIMEOUT_LONG 30 + +enum vlr_fsm_result { + VLR_FSM_RESULT_NONE, + VLR_FSM_RESULT_SUCCESS, + VLR_FSM_RESULT_FAILURE, +}; + + +/*********************************************************************** + * Update_HLR_VLR, TS 23.012 Chapter 4.1.2.4 + ***********************************************************************/ + +enum upd_hlr_vlr_state { + UPD_HLR_VLR_S_INIT, + UPD_HLR_VLR_S_WAIT_FOR_DATA, + UPD_HLR_VLR_S_DONE, +}; + +enum upd_hlr_vlr_evt { + UPD_HLR_VLR_E_START, + UPD_HLR_VLR_E_INS_SUB_DATA, + UPD_HLR_VLR_E_ACT_TRACE_MODE, + UPD_HLR_VLR_E_FW_CHECK_SS_IND, + UPD_HLR_VLR_E_UPD_LOC_ACK, + UPD_HLR_VLR_E_UPD_LOC_NACK, +}; + +static const struct value_string upd_hlr_vlr_event_names[] = { + OSMO_VALUE_STRING(UPD_HLR_VLR_E_START), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_INS_SUB_DATA), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_ACT_TRACE_MODE), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_FW_CHECK_SS_IND), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_ACK), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_NACK), + { 0, NULL } +}; + +static void upd_hlr_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + OSMO_ASSERT(event == UPD_HLR_VLR_E_START); + + /* Send UpdateLocation to HLR */ + vlr_subscr_req_lu(vsub, vsub->vlr->cfg.is_ps); + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_WAIT_FOR_DATA, + LU_TIMEOUT_LONG, 0); +} + +static void upd_hlr_vlr_fsm_wait_data(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case UPD_HLR_VLR_E_INS_SUB_DATA: + /* FIXME: Insert_Subscr_Data_VLR */ + break; + case UPD_HLR_VLR_E_ACT_TRACE_MODE: + /* TODO: Activate_Tracing_VLR */ + break; + case UPD_HLR_VLR_E_FW_CHECK_SS_IND: + /* TODO: Forward Check SS Ind to MSC */ + break; + case UPD_HLR_VLR_E_UPD_LOC_ACK: + /* Inside Update_HLR_VLR after UpdateLocationAck */ + vsub->sub_dataconf_by_hlr_ind = true; + vsub->loc_conf_in_hlr_ind = true; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + case UPD_HLR_VLR_E_UPD_LOC_NACK: + /* Inside Update_HLR_VLR after UpdateLocationNack */ + /* TODO: Check_User_Error_In_Serving_Network_Entity */ + vsub->sub_dataconf_by_hlr_ind = false; + vsub->loc_conf_in_hlr_ind = false; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + /* Data is a pointer to a gsm48_gmm_cause which we + * simply pass through */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, data); + break; + } +} + +static const struct osmo_fsm_state upd_hlr_vlr_states[] = { + [UPD_HLR_VLR_S_INIT] = { + .in_event_mask = S(UPD_HLR_VLR_E_START), + .out_state_mask = S(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_INIT), + .action = upd_hlr_vlr_fsm_init, + }, + [UPD_HLR_VLR_S_WAIT_FOR_DATA] = { + .in_event_mask = S(UPD_HLR_VLR_E_INS_SUB_DATA) | + S(UPD_HLR_VLR_E_ACT_TRACE_MODE) | + S(UPD_HLR_VLR_E_FW_CHECK_SS_IND) | + S(UPD_HLR_VLR_E_UPD_LOC_ACK) | + S(UPD_HLR_VLR_E_UPD_LOC_NACK), + .out_state_mask = S(UPD_HLR_VLR_S_DONE), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .action = upd_hlr_vlr_fsm_wait_data, + }, + [UPD_HLR_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_DONE), + }, +}; + +static struct osmo_fsm upd_hlr_vlr_fsm = { + .name = "upd_hlr_vlr_fsm", + .states = upd_hlr_vlr_states, + .num_states = ARRAY_SIZE(upd_hlr_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = upd_hlr_vlr_event_names, +}; + +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&upd_hlr_vlr_fsm, parent, + parent_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, UPD_HLR_VLR_E_START, NULL); + + return fi; +} + + +/*********************************************************************** + * Subscriber_Present_VLR, TS 29.002 Chapter 25.10.1 + ***********************************************************************/ + +enum sub_pres_vlr_state { + SUB_PRES_VLR_S_INIT, + SUB_PRES_VLR_S_WAIT_FOR_HLR, + SUB_PRES_VLR_S_DONE, +}; + +enum sub_pres_vlr_event { + SUB_PRES_VLR_E_START, + SUB_PRES_VLR_E_READY_SM_CNF, + SUB_PRES_VLR_E_READY_SM_ERR, +}; + +static const struct value_string sub_pres_vlr_event_names[] = { + OSMO_VALUE_STRING(SUB_PRES_VLR_E_START), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_CNF), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_ERR), + { 0, NULL } +}; + +static void sub_pres_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + OSMO_ASSERT(event == SUB_PRES_VLR_E_START); + + if (!vsub->ms_not_reachable_flag) { + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + return; + } + /* FIXME: Send READY_FOR_SM via GSUP */ + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_WAIT_FOR_HLR, + LU_TIMEOUT_LONG, 0); +} + +static void sub_pres_vlr_fsm_wait_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case SUB_PRES_VLR_E_READY_SM_CNF: + vsub->ms_not_reachable_flag = false; + break; + case SUB_PRES_VLR_E_READY_SM_ERR: + break; + } + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +static const struct osmo_fsm_state sub_pres_vlr_states[] = { + [SUB_PRES_VLR_S_INIT] = { + .in_event_mask = S(SUB_PRES_VLR_E_START), + .out_state_mask = S(SUB_PRES_VLR_S_WAIT_FOR_HLR) | + S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_INIT), + .action = sub_pres_vlr_fsm_init, + }, + [SUB_PRES_VLR_S_WAIT_FOR_HLR] = { + .in_event_mask = S(SUB_PRES_VLR_E_READY_SM_CNF) | + S(SUB_PRES_VLR_E_READY_SM_ERR), + .out_state_mask = S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_WAIT_FOR_HLR), + .action = sub_pres_vlr_fsm_wait_hlr, + }, + [SUB_PRES_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_DONE), + }, +}; + +static struct osmo_fsm sub_pres_vlr_fsm = { + .name = "sub_pres_vlr_fsm", + .states = sub_pres_vlr_states, + .num_states = ARRAY_SIZE(sub_pres_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = sub_pres_vlr_event_names, +}; + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&sub_pres_vlr_fsm, parent, + term_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, SUB_PRES_VLR_E_START, NULL); + + return fi; +} + +/*********************************************************************** + * Location_Update_Completion_VLR, TS 23.012 Chapter 4.1.2.3 + ***********************************************************************/ + +enum lu_compl_vlr_state { + LU_COMPL_VLR_S_INIT, + LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_COMPL_VLR_S_WAIT_IMEI, + LU_COMPL_VLR_S_WAIT_IMEI_TMSI, + LU_COMPL_VLR_S_WAIT_TMSI_CNF, + LU_COMPL_VLR_S_DONE, +}; + +enum lu_compl_vlr_event { + LU_COMPL_VLR_E_START, + LU_COMPL_VLR_E_SUB_PRES_COMPL, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, + LU_COMPL_VLR_E_IMEI_CHECK_NACK, + LU_COMPL_VLR_E_NEW_TMSI_ACK, +}; + +static const struct value_string lu_compl_vlr_event_names[] = { + OSMO_VALUE_STRING(LU_COMPL_VLR_E_START), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_SUB_PRES_COMPL), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_ACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_compl_vlr_priv { + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t cause; + bool assign_tmsi; +}; + +static void _vlr_lu_compl_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result, + uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->result = result; + lcvp->cause = cause; + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_DONE, 0, 0); +} + +static void vlr_lu_compl_fsm_success(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + if (!vsub->lu_complete) { + vsub->lu_complete = true; + /* Balanced by vlr_subscr_rx_imsi_detach() */ + vlr_subscr_get(vsub); + } + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_SUCCESS, 0); +} + +static void vlr_lu_compl_fsm_failure(struct osmo_fsm_inst *fi, uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->vsub->vlr->ops.tx_lu_rej(lcvp->msc_conn_ref, cause); + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_FAILURE, cause); +} + +static void vlr_lu_compl_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lcvp->result == VLR_FSM_RESULT_SUCCESS) + ? lcvp->parent_event_success + : lcvp->parent_event_failure, + &lcvp->cause); +} + +static void lu_compl_vlr_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr; + OSMO_ASSERT(vsub); + vlr = vsub->vlr; + OSMO_ASSERT(vlr); + + OSMO_ASSERT(event == LU_COMPL_VLR_E_START); + + /* TODO: National Roaming restrictions? */ + /* TODO: Roaming restriction due to unsupported feature in subscriber + * data? */ + /* TODO: Regional subscription restriction? */ + /* TODO: Administrative restriction of subscribres' access feature? */ + /* TODO: AccessRestrictuionData parameter available? */ + /* TODO: AccessRestrictionData permits RAT? */ + /* Node 1 */ + /* TODO: Autonomous CSG supported in VPLMN and allowed by HPLMN? */ + /* TODO: Hybrid Cel / CSG Cell */ + /* Node 2 */ + vsub->la_allowed = true; + vsub->imsi_detached_flag = false; + /* Start Subscriber_Present_VLR Procedure */ + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_TIMEOUT_LONG, 0); + + lcvp->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + LU_COMPL_VLR_E_SUB_PRES_COMPL); + +} + +static void lu_compl_vlr_new_tmsi(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + if (vlr_subscr_alloc_tmsi(vsub)) { + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_TMSI_CNF, + vlr_timer(vlr, 3250), 3250); + + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, vsub->tmsi_new); +} + +/* After completion of Subscriber_Present_VLR */ +static void lu_compl_vlr_wait_subscr_pres(struct osmo_fsm_inst *fi, + uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_SUB_PRES_COMPL); + + lcvp->sub_pres_vlr_fsm = NULL; + + /* TODO: Trace_Subscriber_Activity_VLR */ + + if (vlr->cfg.check_imei_rqd) { + /* Check IMEI VLR */ + osmo_fsm_inst_state_chg(fi, + lcvp->assign_tmsi ? + LU_COMPL_VLR_S_WAIT_IMEI_TMSI + : LU_COMPL_VLR_S_WAIT_IMEI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lcvp->msc_conn_ref, GSM_MI_TYPE_IMEI); + return; + } + + /* Do we need to allocate a TMSI? */ + if (lcvp->assign_tmsi) { + lu_compl_vlr_new_tmsi(fi); + return; + } + + /* Location Updating Accept */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for completion of CHECK_IMEI_VLR */ +static void lu_compl_vlr_wait_imei(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + switch (event) { + case LU_COMPL_VLR_E_IMEI_CHECK_ACK: + if (!vsub->imei[0]) { + /* Abort: Do nothing */ + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_PROTOCOL_ERROR); + return; + } + /* Pass */ + break; + + case LU_COMPL_VLR_E_IMEI_CHECK_NACK: + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_ILLEGAL_ME); + /* FIXME: IMEI Check Fail to VLR Application (Detach IMSI VLR) */ + return; + } + + /* IMEI is available. Allocate TMSI if needed. */ + if (lcvp->assign_tmsi) { + if (fi->state != LU_COMPL_VLR_S_WAIT_IMEI_TMSI) + LOGPFSML(fi, LOGL_ERROR, + "TMSI required, expected to be in state" + " LU_COMPL_VLR_S_WAIT_IMEI_TMSI," + " am in %s instead\n", + osmo_fsm_state_name(fi->fsm, fi->state)); + /* Logged an error, continue anyway. */ + + lu_compl_vlr_new_tmsi(fi); + + /* Wait for TMSI ack */ + return; + } + + /* No TMSI needed, accept now. */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for TMSI confirmation */ +static void lu_compl_vlr_wait_tmsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_NEW_TMSI_ACK); + + if (!vsub || vsub->tmsi_new == GSM_RESERVED_TMSI) { + LOGPFSML(fi, LOGL_ERROR, "TMSI Realloc Compl implies that" + " the subscriber has a new TMSI allocated, but" + " the new TMSI is unset.\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + vsub->tmsi = vsub->tmsi_new; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + vlr_lu_compl_fsm_success(fi); +} + +static const struct osmo_fsm_state lu_compl_vlr_states[] = { + [LU_COMPL_VLR_S_INIT] = { + .in_event_mask = S(LU_COMPL_VLR_E_START), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_SUB_PRES) | + S(LU_COMPL_VLR_S_WAIT_IMEI), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_INIT), + .action = lu_compl_vlr_init, + }, + [LU_COMPL_VLR_S_WAIT_SUB_PRES] = { + .in_event_mask = S(LU_COMPL_VLR_E_SUB_PRES_COMPL), + .out_state_mask = S(LU_COMPL_VLR_S_WAIT_IMEI) | + S(LU_COMPL_VLR_S_WAIT_IMEI_TMSI) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF) | + S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_SUB_PRES), + .action = lu_compl_vlr_wait_subscr_pres, + }, + [LU_COMPL_VLR_S_WAIT_IMEI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_IMEI_TMSI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI_TMSI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_TMSI_CNF] = { + .in_event_mask = S(LU_COMPL_VLR_E_NEW_TMSI_ACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .action = lu_compl_vlr_wait_tmsi, + }, + [LU_COMPL_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_DONE), + .onenter = vlr_lu_compl_fsm_dispatch_result, + }, +}; + +static struct osmo_fsm lu_compl_vlr_fsm = { + .name = "lu_compl_vlr_fsm", + .states = lu_compl_vlr_states, + .num_states = ARRAY_SIZE(lu_compl_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = lu_compl_vlr_event_names, +}; + +struct osmo_fsm_inst * +lu_compl_vlr_proc_alloc(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_compl_vlr_priv *lcvp; + + fi = osmo_fsm_inst_alloc_child(&lu_compl_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return NULL; + + lcvp = talloc_zero(fi, struct lu_compl_vlr_priv); + lcvp->vsub = vsub; + lcvp->msc_conn_ref = msc_conn_ref; + lcvp->parent_event_success = parent_event_success; + lcvp->parent_event_failure = parent_event_failure; + lcvp->assign_tmsi = assign_tmsi; + fi->priv = lcvp; + + return fi; +} + + +/*********************************************************************** + * Update_Location_Area_VLR, TS 23.012 Chapter 4.1.2.1 + ***********************************************************************/ + +static const struct value_string fsm_lu_event_names[] = { + OSMO_VALUE_STRING(VLR_ULA_E_UPDATE_LA), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_ACK), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_NACK), + OSMO_VALUE_STRING(VLR_ULA_E_AUTH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_CIPH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMSI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEISV), + OSMO_VALUE_STRING(VLR_ULA_E_HLR_LU_RES), + OSMO_VALUE_STRING(VLR_ULA_E_UPD_HLR_COMPL), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_SUCCESS), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_FAILURE), + OSMO_VALUE_STRING(VLR_ULA_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_fsm_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *upd_hlr_vlr_fsm; + struct osmo_fsm_inst *lu_compl_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t rej_cause; + + enum vlr_lu_type type; + bool lu_by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id old_lai; + struct osmo_location_area_id new_lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool assign_tmsi; +}; + + +/* Determine if given location area is served by this VLR */ +static bool lai_in_this_vlr(struct vlr_instance *vlr, + const struct osmo_location_area_id *lai) +{ + /* TODO: VLR needs to keep a locally configued list of LAIs */ + return true; +} + +/* Determine if authentication is required */ +static bool is_auth_required(struct lu_fsm_priv *lfp) +{ + /* 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); +} + +/* Determine if ciphering is required */ +static bool is_ciph_required(struct lu_fsm_priv *lfp) +{ + return lfp->ciphering_required != VLR_CIPH_NONE; +} + +/* Determine if a HLR Update is required */ +static bool hlr_update_needed(struct vlr_subscr *vsub) +{ + /* TODO: properly decide this, rather than always assuming we + * need to update the HLR. */ + return true; +} + +static void lu_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lfp->result == VLR_FSM_RESULT_SUCCESS) + ? lfp->parent_event_success + : lfp->parent_event_failure, + lfp->parent_event_data); +} + +static void _lu_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->result = result; + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_DONE, 0, 0); +} + +static void lu_fsm_success(struct osmo_fsm_inst *fi) +{ + _lu_fsm_done(fi, VLR_FSM_RESULT_SUCCESS); +} + +static void lu_fsm_failure(struct osmo_fsm_inst *fi, uint8_t rej_cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (rej_cause) + lfp->vlr->ops.tx_lu_rej(lfp->msc_conn_ref, rej_cause); + _lu_fsm_done(fi, VLR_FSM_RESULT_FAILURE); +} + +static void vlr_loc_upd_start_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->lu_compl_vlr_fsm = + lu_compl_vlr_proc_alloc(fi, lfp->vsub, lfp->msc_conn_ref, + VLR_ULA_E_LU_COMPL_SUCCESS, + VLR_ULA_E_LU_COMPL_FAILURE, + lfp->assign_tmsi); + + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, LU_COMPL_VLR_E_START, NULL); +} + +static void lu_fsm_discard_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!lfp->lu_compl_vlr_fsm) + return; + osmo_fsm_inst_term(lfp->lu_compl_vlr_fsm, OSMO_FSM_TERM_PARENT, NULL); +} + +/* 4.1.2.1 Node 4 */ +static void vlr_loc_upd_node_4(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + bool hlr_unknown = false; + + LOGPFSM(fi, "%s()\n", __func__); + + if (hlr_unknown) { + /* FIXME: Delete subscriber record */ + /* LU REJ: Roaming not allowed */ + lu_fsm_failure(fi, GSM48_REJECT_ROAMING_NOT_ALLOWED); + } else { + /* Update_HLR_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_HLR_UPD, + LU_TIMEOUT_LONG, 0); + lfp->upd_hlr_vlr_fsm = + upd_hlr_vlr_proc_start(fi, vsub, VLR_ULA_E_UPD_HLR_COMPL); + } +} + +/* 4.1.2.1 Node B */ +static void vlr_loc_upd_node_b(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + + /* FIXME */ + if (0) { /* IMEISV or PgA to send */ + vlr_loc_upd_node_4(fi); + } else { + /* Location_Update_Completion */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } +} + +/* Non-standard: after Ciphering Mode Complete (or no ciph required) */ +static void vlr_loc_upd_post_ciph(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + vsub->conf_by_radio_contact_ind = true; + /* Update LAI */ + vsub->cgi.lai = lfp->new_lai; + vsub->dormant_ind = false; + vsub->cancel_loc_rx = false; + if (hlr_update_needed(vsub)) { + vlr_loc_upd_node_4(fi); + } else { + /* TODO: ADD Support */ + /* TODO: Node A: PgA Support */ + vlr_loc_upd_node_b(fi); + } +} + +/* 4.1.2.1 after Authentication successful (or no auth rqd) */ +static void vlr_loc_upd_post_auth(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (!is_ciph_required(lfp)) { + vlr_loc_upd_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, lfp->msc_conn_ref, + lfp->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_CIPH, LU_TIMEOUT_LONG, 0); +} + +static void vlr_loc_upd_node1(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (is_auth_required(lfp)) { + /* Authenticate_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_AUTH, + LU_TIMEOUT_LONG, 0); + vsub->auth_fsm = auth_fsm_start(lfp->vsub, fi->log_level, + fi, VLR_ULA_E_AUTH_RES, + lfp->is_r99, + lfp->is_utran); + } else { + /* no need for authentication */ + vlr_loc_upd_post_auth(fi); + } +} + +static void vlr_loc_upd_want_imsi(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(lfp->vsub); + + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMSI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMSI); + /* will continue at vlr_loc_upd_node1() once IMSI arrives */ +} + +static int assoc_lfp_with_sub(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + if (vsub->lu_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "A Location Updating process is already pending for" + " this subscriber. Aborting.\n"); + /* Also get rid of the other pending LU attempt? */ + /*lu_fsm_failure(vsub->lu_fsm, GSM48_REJECT_CONGESTION);*/ + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); + return -EINVAL; + } + vsub->lu_fsm = fi; + vsub->msc_conn_ref = lfp->msc_conn_ref; + /* FIXME: send new LAC to HLR? */ + vsub->lac = lfp->new_lai.lac; + lfp->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(lfp->msc_conn_ref, lfp->vsub); + return 0; +} + +static const char *lai_name(struct osmo_location_area_id *lai) +{ + static char buf[64]; + snprintf(buf, sizeof(buf),"MCC:%u, MNC:%u, LAC:%u", + lai->plmn.mcc, lai->plmn.mnc, lai->lac); + return buf; +} + +/* 4.1.2.1: Subscriber (via MSC/SGSN) requests location update */ +static void _start_lu_main(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + struct vlr_subscr *vsub = NULL; + bool created; + + /* TODO: PUESBINE related handling */ + + /* Is previous LAI in this VLR? */ + if (!lai_in_this_vlr(vlr, &lfp->old_lai)) { +#if 0 + /* FIXME: check previous VLR, (3) */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_PVLR, + LU_TIMEOUT_LONG, 0); + return; +#endif + LOGPFSML(fi, LOGL_NOTICE, "LAI change from %s," + " but checking previous VLR not implemented\n", + lai_name(&lfp->old_lai)); + } + + if (!lfp->imsi[0]) { + /* TMSI was used */ + lfp->lu_by_tmsi = true; + /* TMSI clash: if a different subscriber already has this TMSI, + * we will find that other subscriber in the VLR. So the IMSIs + * would mismatch, but we don't know about it. Theoretically, + * an authentication process would thwart any attempt to use + * someone else's TMSI. + * TODO: Otherwise we can ask for the IMSI and verify that it + * matches the IMSI on record. */ + vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, + &created); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + + if (created) + vlr_loc_upd_want_imsi(fi); + else + vlr_loc_upd_node1(fi); + /* We cannot have MSC area change, as the VLR + * serves only one MSC */ + vlr_subscr_put(vsub); + } else { + /* IMSI was used */ + vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + vlr_subscr_put(vsub); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + vlr_loc_upd_node1(fi); + vlr_subscr_put(vsub); + } +} + + +static void lu_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + OSMO_ASSERT(event == VLR_ULA_E_UPDATE_LA); + + if (1) { // FIXME + //if (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0]) + /* R_IMEISV_IR1 passed */ + _start_lu_main(fi); + } else { + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMEISV); + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMEISV, + vlr_timer(vlr, 3270), 3270); + } +} + +static void lu_fsm_wait_imeisv(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_ID_IMEISV: + /* FIXME: copy IMEISV */ + _start_lu_main(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for response from Send_Identification to PVLR */ +static void lu_fsm_wait_pvlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_SEND_ID_ACK: + vlr_loc_upd_node1(fi); + break; + case VLR_ULA_E_SEND_ID_NACK: + vlr_loc_upd_want_imsi(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for result of Authenticate_VLR procedure */ +static void lu_fsm_wait_auth(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + enum vlr_auth_fsm_result *res = data; + uint8_t rej_cause = 0; + + OSMO_ASSERT(event == VLR_ULA_E_AUTH_RES); + + lfp->upd_hlr_vlr_fsm = NULL; + + if (res) { + switch (*res) { + case VLR_AUTH_RES_PASSED: + /* Result == Pass */ + vlr_loc_upd_post_auth(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* go to Idle with no response */ + rej_cause = 0; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* FIXME: delete subscribe record */ + rej_cause = GSM48_REJECT_IMSI_UNKNOWN_IN_HLR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* cause = illegal subscriber */ + rej_cause = GSM48_REJECT_ILLEGAL_MS; + break; + case VLR_AUTH_RES_PROC_ERR: + /* cause = system failure */ + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } + } else + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + + lu_fsm_failure(fi, rej_cause); +} + +static void lu_fsm_wait_ciph(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == VLR_ULA_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + } + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + vlr_loc_upd_post_ciph(fi); +} + +static void lu_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + char *mi_string = data; + + switch (event) { + case VLR_ULA_E_ID_IMSI: + vlr_subscr_set_imsi(vsub, mi_string); + vlr_loc_upd_node1(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* At the end of Update_HLR_VLR */ +static void lu_fsm_wait_hlr_ul_res(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + + switch (event) { + case VLR_ULA_E_HLR_LU_RES: + /* pass-through this event to Update_HLR_VLR */ + if (data == NULL) + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_ACK, NULL); + else + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_NACK, data); + break; + case VLR_ULA_E_UPD_HLR_COMPL: + if (data == NULL) { + /* successful case */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + /* continue in MSC ?!? */ + } else { + /* unsuccessful case */ + enum gsm48_gmm_cause cause = + *(enum gsm48_gmm_cause *)data; + if (0 /* procedure_error && vlr->cfg.standalone_mode */) { + osmo_fsm_inst_state_chg(fi, + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } else { + lu_fsm_failure(fi, cause); + } + } + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR */ +static void lu_fsm_wait_lu_compl(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_ID_IMEI: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + + /* Update Register */ + /* TODO: Set_Notification_Type 23.078 */ + /* TODO: Notify_gsmSCF 23.078 */ + /* TODO: Authenticated Radio Contact Established -> ARC */ + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR (standalone case) */ +static void lu_fsm_wait_lu_compl_standalone(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + vsub->sub_dataconf_by_hlr_ind = false; + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + vsub->sub_dataconf_by_hlr_ind = false; + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +static const struct osmo_fsm_state vlr_lu_fsm_states[] = { + [VLR_ULA_S_IDLE] = { + .in_event_mask = S(VLR_ULA_E_UPDATE_LA), + .out_state_mask = S(VLR_ULA_S_WAIT_IMEISV) | + S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_IDLE), + .action = lu_fsm_idle, + }, + [VLR_ULA_S_WAIT_IMEISV] = { + .in_event_mask = S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMEISV), + .action = lu_fsm_wait_imeisv, + }, + [VLR_ULA_S_WAIT_PVLR] = { + .in_event_mask = S(VLR_ULA_E_SEND_ID_ACK) | + S(VLR_ULA_E_SEND_ID_NACK), + .out_state_mask = S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_PVLR), + .action = lu_fsm_wait_pvlr, + }, + [VLR_ULA_S_WAIT_AUTH] = { + .in_event_mask = S(VLR_ULA_E_AUTH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_CIPH) | + S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_AUTH), + .action = lu_fsm_wait_auth, + }, + [VLR_ULA_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_CIPH), + .in_event_mask = S(VLR_ULA_E_CIPH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .action = lu_fsm_wait_ciph, + }, + [VLR_ULA_S_WAIT_IMSI] = { + .in_event_mask = S(VLR_ULA_E_ID_IMSI), + .out_state_mask = S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMSI), + .action = lu_fsm_wait_imsi, + }, + [VLR_ULA_S_WAIT_HLR_UPD] = { + .in_event_mask = S(VLR_ULA_E_HLR_LU_RES) | + S(VLR_ULA_E_UPD_HLR_COMPL), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_HLR_UPD), + .action = lu_fsm_wait_hlr_ul_res, + }, + [VLR_ULA_S_WAIT_LU_COMPL] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK) | + S(VLR_ULA_E_ID_IMEI) | + S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL), + .action = lu_fsm_wait_lu_compl, + }, + [VLR_ULA_S_WAIT_LU_COMPL_STANDALONE] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE), + .action = lu_fsm_wait_lu_compl_standalone, + }, + [VLR_ULA_S_DONE] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_DONE), + .onenter = lu_fsm_dispatch_result, + }, +}; + +static void fsm_lu_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "fsm_lu_cleanup called with cause %s\n", + osmo_fsm_term_cause_name(cause)); + if (vsub && vsub->lu_fsm == fi) + vsub->lu_fsm = NULL; +} + +static struct osmo_fsm vlr_lu_fsm = { + .name = "vlr_lu_fsm", + .states = vlr_lu_fsm_states, + .num_states = ARRAY_SIZE(vlr_lu_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_lu_event_names, + .cleanup = fsm_lu_cleanup, +}; + +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_fsm_priv *lfp; + + fi = osmo_fsm_inst_alloc_child(&vlr_lu_fsm, parent, parent_event_failure); + if (!fi) + return NULL; + + lfp = talloc_zero(fi, struct lu_fsm_priv); + lfp->vlr = vlr; + lfp->msc_conn_ref = msc_conn_ref; + lfp->tmsi = tmsi; + lfp->type = type; + lfp->old_lai = *old_lai; + lfp->new_lai = *new_lai; + lfp->lu_by_tmsi = true; + lfp->parent_event_success = parent_event_success; + lfp->parent_event_failure = parent_event_failure; + lfp->parent_event_data = parent_event_data; + lfp->authentication_required = authentication_required; + lfp->ciphering_required = ciphering_required; + lfp->is_r99 = is_r99; + lfp->is_utran = is_utran; + lfp->assign_tmsi = assign_tmsi; + if (imsi) { + strncpy(lfp->imsi, imsi, sizeof(lfp->imsi)-1); + lfp->imsi[sizeof(lfp->imsi)-1] = '\0'; + lfp->lu_by_tmsi = false; + } + fi->priv = lfp; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + osmo_fsm_inst_dispatch(fi, VLR_ULA_E_UPDATE_LA, NULL); + + return fi; +} + +/* Gracefully terminate an FSM created by vlr_loc_update() in case of external + * timeout (i.e. from MSC). */ +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == VLR_ULA_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); +} + +void vlr_lu_fsm_init(void) +{ + osmo_fsm_register(&vlr_lu_fsm); + osmo_fsm_register(&upd_hlr_vlr_fsm); + osmo_fsm_register(&sub_pres_vlr_fsm); + osmo_fsm_register(&lu_compl_vlr_fsm); +} diff --git a/src/libvlr/vlr_lu_fsm.h b/src/libvlr/vlr_lu_fsm.h new file mode 100644 index 0000000..5cf13c7 --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +enum vlr_lu_state { + VLR_ULA_S_IDLE, + VLR_ULA_S_WAIT_IMEISV, + VLR_ULA_S_WAIT_PVLR, /* Waiting for ID from PVLR */ + VLR_ULA_S_WAIT_AUTH, /* Waiting for Authentication */ + VLR_ULA_S_WAIT_CIPH, /* Waiting for Ciphering Complete */ + VLR_ULA_S_WAIT_IMSI, /* Waiting for IMSI from MS */ + VLR_ULA_S_WAIT_HLR_UPD, /* Waiting for end of HLR update */ + VLR_ULA_S_WAIT_LU_COMPL,/* Waiting for LU complete */ + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, /* Standalone VLR */ + VLR_ULA_S_DONE +}; + +void vlr_lu_fsm_init(void); diff --git a/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am index f4ef487..a99334d 100644 --- a/src/osmo-nitb/Makefile.am +++ b/src/osmo-nitb/Makefile.am @@ -32,6 +32,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libvlr/libvlr.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOGSM_LIBS) \ diff --git a/tests/vlr/Makefile.am b/tests/vlr/Makefile.am new file mode 100644 index 0000000..2208a6f --- /dev/null +++ b/tests/vlr/Makefile.am @@ -0,0 +1,22 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS = -Wall -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(NULL) +AM_LDFLAGS = $(COVERAGE_LDFLAGS) + +noinst_PROGRAMS = vlr_test + +vlr_test_SOURCES = vlr_test.c +vlr_test_LDADD = \ + $(top_builddir)/src/libvlr/libvlr.a \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(LIBRARY_DL) \ + $(LIBCRYPTO_LIBS) \ + $(NULL) diff --git a/tests/vlr/vlr_test.c b/tests/vlr/vlr_test.c new file mode 100644 index 0000000..19beb69 --- /dev/null +++ b/tests/vlr/vlr_test.c @@ -0,0 +1,694 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#define S(x) (1 << (x)) + +/* + * TODO: + * * test FSM for all testvlr_mode (and more) + * * test also the time-outs in the vlr code + * * test for memory leaks + * * how to get the HLR running? Or test against stub? + * * test disappearing MS connection + * * test absence of HLR + */ + +void *tall_bsc_ctx; +static struct vlr_instance *g_vlr; + +/*********************************************************************** + * Finite State Machine simulating MS and MSC towards VLR + ***********************************************************************/ + +static int timer_error_cb(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "timer expired waiting for completion\n"); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return 1; +} + +enum testvlr_mode { + MODE_SUCCESS, + MODE_SUCCESS_TMSI, + MODE_AUTH_FAIL, + MODE_AUTH_RESYNC, +}; + +struct testvlr_priv { + enum testvlr_mode mode; + uint32_t tmsi; + char imsi[16]; + char imei[16]; + struct osmo_location_area_id old_lai; + struct osmo_location_area_id new_lai; + + struct vlr_subscr *subscr; + + struct osmo_fsm_inst *lu_fsm; +}; + +#define fsi_priv(x) (struct testvlr_priv *)(x)->priv + +enum f_state { + /*! initial state */ + ST_NULL, + /*! LU was sent by MS */ + ST_LU_SENT, + /*! waiting for auth re-sync */ + ST_RESYNC_SENT, + /* Waiting for LU ACK */ + ST_WAIT_LU_ACK, + ST_DONE, + ST_FAILED, +}; + +enum f_event { + /* events from MS */ + EVT_MS_TX_LU, /* transmit LU REQ to network */ + EVT_MS_TX_ID_RESP, /* tranmit ID RSP to network */ + EVT_MS_TX_AUTH_RESP, /* transmit AUTH RESP to network */ + EVT_MS_TX_AUTH_FAIL, /* transmit AUTH FAIL to network */ + EVT_MS_CONN_LOST, /* connection to MS was lost */ + + /* events from VLR */ + EVT_VLR_AUTH_REQ, /* transmit AUTH REQ to MS */ + EVT_VLR_ID_REQ_IMSI, /* transmit ID REQ(IMSI) to MS */ + EVT_VLR_ID_REQ_IMEI, /* tramsmit ID REQ(IMEI) to MS */ + EVT_VLR_ID_REQ_IMEISV, /* trasnmit ID REQ(IMEISV) to MS */ + EVT_VLR_AUTH_REJ, /* transmit AUTH REJ to MS */ + EVT_VLR_SET_CIPH, /* transmit SET CIPH to MS */ + EVT_VLR_LU_ACK, /* transmit LU ACK to MS */ + EVT_VLR_LU_REJ, /* transmit LU REJ to MS */ +}; + +static struct value_string f_event_names[] = { + { EVT_MS_TX_LU, "MS-TX-LU" }, + { EVT_MS_TX_ID_RESP, "MS-TX-ID-RESP" }, + { EVT_MS_TX_AUTH_RESP, "MS-TX-AUTH-RESP" }, + { EVT_MS_TX_AUTH_FAIL, "MS-TX-AUTH-FAIL" }, + { EVT_MS_CONN_LOST, "MS-CONN-LOST" }, + + { EVT_VLR_AUTH_REQ, "VLR-AUTH-REQ" }, + { EVT_VLR_ID_REQ_IMSI, "VLR-ID-REQ-IMSI" }, + { EVT_VLR_ID_REQ_IMEI, "VLR-ID-REQ-IMEI" }, + { EVT_VLR_ID_REQ_IMEISV,"VLR-ID-REQ-IMEISV" }, + { EVT_VLR_AUTH_REJ, "VLR-AUTH-REJ" }, + { EVT_VLR_SET_CIPH, "VLR-SET-CIPH" }, + { EVT_VLR_LU_ACK, "VLR-LU-ACK" }, + { EVT_VLR_LU_REJ, "VLR-LU-REJ" }, + { 0, NULL } +}; + +static void fsm_f_allstate(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + uint8_t mi[16]; + unsigned int mi_len; + + switch (event) { + case EVT_VLR_ID_REQ_IMSI: + if (priv->mode != MODE_SUCCESS_TMSI) { + LOGP(DGPRS, LOGL_NOTICE, "Unexpected ID REQ " + "(IMSI)\n"); + } + mi_len = gsm48_generate_mid_from_imsi(mi, priv->imsi); + vlr_subscr_rx_id_resp(priv->subscr, mi+2, mi_len-2); + break; + case EVT_VLR_ID_REQ_IMEI: + mi_len = gsm48_generate_mid_from_imsi(mi, priv->imei); + mi[0] = (mi[0] & 0xf8) | GSM_MI_TYPE_IMEI; + vlr_subscr_rx_id_resp(priv->subscr+2, mi, mi_len-2); + break; + case EVT_VLR_ID_REQ_IMEISV: + mi_len = gsm48_generate_mid_from_imsi(mi, priv->imei); + mi[0] = (mi[0] & 0xf8) | GSM_MI_TYPE_IMEISV; + vlr_subscr_rx_id_resp(priv->subscr, mi+2, mi_len-2); + break; + case EVT_MS_CONN_LOST: + vlr_subscr_disconnected(priv->subscr); + /* IDEA: not release but keep around in extra state to + * see if VLR still sends us anything? */ + osmo_fsm_inst_free(fi); + break; + } +} + +static void fsm_f_null(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + uint32_t tmsi = 0; + const char *imsi = NULL; + + switch (event) { + case EVT_MS_TX_LU: + /* send LU to VLR */ + if (priv->mode == MODE_SUCCESS) + imsi = priv->imsi; + else + tmsi = priv->tmsi; + priv->lu_fsm = vlr_loc_update(fi, + EVT_VLR_LU_ACK, + EVT_VLR_LU_REJ, + NULL, + g_vlr, NULL, + VLR_LU_TYPE_IMSI_ATTACH, tmsi, + imsi, &priv->old_lai, + &priv->new_lai, + true, + true, + false, + false, + true); + OSMO_ASSERT(priv->subscr); + osmo_fsm_inst_state_chg(fi, ST_LU_SENT, 0, 0); + break; + default: + break; + } +} + +static void fsm_f_lu_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct gsm_auth_tuple *at = NULL; + struct testvlr_priv *priv = fsi_priv(fi); + uint8_t res_fail[4]; + uint8_t auts[14]; + + switch (event) { + case EVT_VLR_AUTH_REQ: + at = data; + OSMO_ASSERT(at); + DEBUGP(DGPRS, "%s: at->res=%s\n", __func__, osmo_hexdump(at->vec.res, at->vec.res_len)); + switch (priv->mode) { + case MODE_SUCCESS: + case MODE_SUCCESS_TMSI: + /* return matching SRES/AUTS */ + vlr_subscr_rx_auth_resp(priv->subscr, true, false, + at->vec.res, at->vec.res_len); + break; + case MODE_AUTH_FAIL: + /* return not matching SRES/AUTS */ + vlr_subscr_rx_auth_resp(priv->subscr, true, false, + res_fail, sizeof(res_fail)); + /* FIXME: state transition? */ + break; + case MODE_AUTH_RESYNC: + /* return SRES/AUTS requesting re-sync */ + /* FIXME: generate a proper authenticating + * re-sync request */ + vlr_subscr_rx_auth_fail(priv->subscr, auts); + /* FIXME: state transition? */ + osmo_fsm_inst_state_chg(fi, ST_RESYNC_SENT, 0, 0); + break; + } + osmo_fsm_inst_state_chg(fi, ST_WAIT_LU_ACK, 0, 0); + break; + case EVT_VLR_LU_REJ: + { + uint8_t cause = *(uint8_t *)data; + LOGP(DGPRS, LOGL_NOTICE, "LU(%s): Rejected; cause=0x%02x\n", + priv->imsi, cause); + + } + break; + default: + break; + } +} + +#if 0 +static void fsm_f_resync_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + struct gsm_auth_tuple *at = NULL; + + /* second auth request is supposed to succed after the + * re-sync procedure before */ + switch (event) { + case EVT_VLR_AUTH_REQ: + at = data; + /* return matching SRES/AUTS now */ + vlr_subscr_rx_auth_resp(priv->subscr, true, false, + at->vec.res, at->vec.res_len); + osmo_fsm_inst_state_chg(fi, ST_WAIT_LU_ACK, 0, 0); + break; + } +} +#endif + +static void fsm_f_wait_lu_ack(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + + switch (event) { + case EVT_VLR_LU_ACK: + if (priv->subscr->tmsi != GSM_RESERVED_TMSI) { + /* we need to send an TMSI REALLOC COMPL */ + vlr_subscr_rx_tmsi_reall_compl(priv->subscr); + } + osmo_fsm_inst_state_chg(fi, ST_DONE, 0, 0); + break; + case EVT_VLR_LU_REJ: + osmo_fsm_inst_state_chg(fi, ST_FAILED, 0, 0); + break; + } +} + +static void fsm_f_imsi_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case EVT_MS_TX_ID_RESP: + break; + } +} + +#if 0 +static void fsm_f_areq_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case EVT_MS_TX_AUTH_RESP: + break; + case EVT_MS_TX_AUTH_FAIL: + break; + } +} +#endif + +static struct osmo_fsm_state fsm_success_states[] = { + [ST_NULL] = { + .in_event_mask = S(EVT_MS_TX_LU), + .out_state_mask = S(ST_LU_SENT), + .name = "NULL", + .action = fsm_f_null, + }, + [ST_LU_SENT] = { + .in_event_mask = S(EVT_VLR_AUTH_REQ) | + S(EVT_VLR_LU_REJ), + //.out_state_mask = S(ST_IDREQ_IMSI_SENT) | S(ST_AUTH_REQ_SENT), + .out_state_mask = S(ST_WAIT_LU_ACK), + .name = "LU Sent", + .action = fsm_f_lu_sent, + }, + [ST_RESYNC_SENT] = { + .in_event_mask = S(EVT_VLR_AUTH_REQ), + .out_state_mask = S(ST_WAIT_LU_ACK), + .name = "AUTH-RESYNC sent", + .action = fsm_f_imsi_sent, + }, + [ST_WAIT_LU_ACK] = { + .in_event_mask = S(EVT_VLR_LU_ACK) | + S(EVT_VLR_SET_CIPH) | + S(EVT_VLR_LU_REJ), + .out_state_mask = S(ST_DONE), + .name = "WAIT-LU-ACK", + .action = fsm_f_wait_lu_ack, + }, + [ST_DONE] = { + .name = "DONE" + }, +}; + +static struct osmo_fsm vlr_test_fsm = { + .name = "VLR Test FSM", + .states = fsm_success_states, + .num_states = ARRAY_SIZE(fsm_success_states), + .log_subsys = DGPRS, + .event_names = f_event_names, + .allstate_event_mask = S(EVT_MS_CONN_LOST) | + S(EVT_VLR_ID_REQ_IMSI) | + S(EVT_VLR_ID_REQ_IMEI) | + S(EVT_VLR_ID_REQ_IMEISV), + .allstate_action = fsm_f_allstate, +}; + +/* Testing of Subscriber_Present_VLR */ + +enum test_sub_pres_state { + TSPV_S_INIT, + TSPV_S_RUNNING, +}; + +enum test_sub_pres_evt { + TSPV_E_START, + TSPV_E_COMPL, +}; + +static void tspv_f_running(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case TSPV_E_COMPL: + OSMO_ASSERT(vsub); + OSMO_ASSERT(vsub->ms_not_reachable_flag == false); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + } +} + +static void tspv_f_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_fsm_inst *spv; + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case TSPV_E_START: + OSMO_ASSERT(vsub); + vsub->ms_not_reachable_flag = true; + spv = sub_pres_vlr_fsm_start(fi, vsub, TSPV_E_COMPL); + OSMO_ASSERT(spv); + osmo_fsm_inst_state_chg(fi, TSPV_S_RUNNING, 4, 0); + break; + } +} + +static const struct osmo_fsm_state test_sub_pres_vlr_states[] = { + [TSPV_S_INIT] = { + .in_event_mask = S(TSPV_E_START), + .out_state_mask = S(TSPV_S_RUNNING), + .name = "INIT", + .action = tspv_f_init, + }, + [TSPV_S_RUNNING] = { + .in_event_mask = S(TSPV_E_COMPL), + .out_state_mask = 0, + .name = "RUNNING", + .action = tspv_f_running, + }, +}; + +static struct osmo_fsm test_sub_pres_vlr_fsm = { + .name = "Test Subscriber_Present_VLR", + .states = test_sub_pres_vlr_states, + .num_states = ARRAY_SIZE(test_sub_pres_vlr_states), + .log_subsys = DGPRS, + .event_names = f_event_names, + .timer_cb = timer_error_cb, +}; + +#if 0 +static void start_sub_pres_vlr(void *ctx, uint32_t tmsi, const char *imsi) +{ + struct osmo_fsm_inst *fi; + struct vlr_subscr *vsub = vlr_subscr_alloc(g_vlr); + + vsub->tmsi = tmsi; + strncpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + fi = osmo_fsm_inst_alloc(&test_sub_pres_vlr_fsm, ctx, vsub, LOGL_DEBUG, vsub->imsi); + osmo_fsm_inst_dispatch(fi, TSPV_E_START, NULL); +} +#endif + +/* Testing of Update_HLR_VLR */ + +enum test_update_hlr_vlr_state { + TUHV_S_INIT, + TUHV_S_RUNNING, +}; + +enum test_update_hlr_vlr_event { + TUHV_E_START, + TUHV_E_COMPL, +}; + +static void tuhv_f_running(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + enum gsm48_gmm_cause *res = data; + + switch (event) { + case TUHV_E_COMPL: + if (!res) { + /* Success */ + LOGPFSM(fi, "success\n"); + } else { + /* error */ + LOGPFSM(fi, "errror cause=0x%u\n", *res); + } + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + } +} + +static void tuhv_f_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_fsm_inst *child; + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case TUHV_E_START: + child = upd_hlr_vlr_proc_start(fi, vsub, TUHV_E_COMPL); + OSMO_ASSERT(child); + osmo_fsm_inst_state_chg(fi, TUHV_S_RUNNING, 4, 0); + break; + } +} + +static const struct osmo_fsm_state test_upd_hlr_vlr_states[] = { + [TUHV_S_INIT] = { + .in_event_mask = S(TUHV_E_START), + .out_state_mask = S(TUHV_S_RUNNING), + .name = "INIT", + .action = tuhv_f_init, + }, + [TUHV_S_RUNNING] = { + .in_event_mask = S(TUHV_E_COMPL), + .out_state_mask = 0, + .name = "RUNNING", + .action = tuhv_f_running, + }, +}; + +static struct osmo_fsm test_upd_hlr_vlr_fsm = { + .name = "Test Update_HLR_VLR", + .states = test_upd_hlr_vlr_states, + .num_states = ARRAY_SIZE(test_upd_hlr_vlr_states), + .log_subsys = DGPRS, + .event_names = f_event_names, + .timer_cb = timer_error_cb, +}; + +#if 0 +static void start_upd_hlr_vlr(void *ctx, uint32_t tmsi, const char *imsi) +{ + struct osmo_fsm_inst *fi; + struct vlr_subscr *vsub = vlr_subscr_alloc(g_vlr); + + vsub->tmsi = tmsi; + strncpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + + + fi = osmo_fsm_inst_alloc(&test_upd_hlr_vlr_fsm, ctx, vsub, LOGL_DEBUG, + vsub->imsi); + /* we need to set this to fool vlr.c in an ongoing LU */ + vsub->lu_fsm = fi; + osmo_fsm_inst_dispatch(fi, TUHV_E_START, NULL); +} +#endif + +/*********************************************************************** + * Integration with VLR code + ***********************************************************************/ + +static struct vlr_instance *g_vlr; + +/* VLR asks us to send an authentication request */ +static int msc_vlr_tx_auth_req(void *msc_conn_ref, struct gsm_auth_tuple *at, + bool send_autn) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + OSMO_ASSERT(at); + DEBUGP(DGPRS, "%s: RES=%s\n", __func__, + osmo_hexdump_nospc(at->vec.res, at->vec.res_len)); + osmo_fsm_inst_dispatch(fi, EVT_VLR_AUTH_REQ, at); + return 0; +} + +/* VLR asks us to send an authentication reject */ +static int msc_vlr_tx_auth_rej(void *msc_conn_ref) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_AUTH_REJ, NULL); + return 0; +} + +/* VLR asks us to transmit an Identity Request of given type */ +static int msc_vlr_tx_id_req(void *msc_conn_ref, uint8_t mi_type) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + uint32_t event; + + DEBUGP(DGPRS, "%s (%u)\n", __func__, mi_type); + + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + event = EVT_VLR_ID_REQ_IMSI; + break; + case GSM_MI_TYPE_IMEI: + event = EVT_VLR_ID_REQ_IMEI; + break; + case GSM_MI_TYPE_IMEISV: + event = EVT_VLR_ID_REQ_IMEISV; + break; + default: + LOGP(DGPRS, LOGL_ERROR, "Unknown identity 0x%02x\n", + mi_type); + return -1; + } + osmo_fsm_inst_dispatch(fi, event, NULL); + return 0; +} + +/* VLR asks us to transmit a Location Update Accept */ +static int msc_vlr_tx_lu_ack(void *msc_conn_ref, uint32_t send_tmsi) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_LU_ACK, NULL); + return 0; +} + +/* VLR asks us to transmit a Location Update Reject */ +static int msc_vlr_tx_lu_rej(void *msc_conn_ref, uint8_t cause) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_LU_REJ, (void *) &cause); + return 0; +} + +static int msc_vlr_set_ciph_mode(void *msc_conn_ref, enum vlr_ciph mode, + bool retrieve_imeisv) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_SET_CIPH, NULL); + return 0; +} + +/* VLR informs us that the subscriber data has somehow been modified */ +static void msc_vlr_subscr_update(struct vlr_subscr *subscr) +{ + DEBUGP(DGPRS, "%s\n", __func__); + /* FIXME */ +} + +static void msc_vlr_subscr_assoc(void *msc_conn_ref, struct vlr_subscr *vsub) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + struct testvlr_priv *priv = fsi_priv(fi); + DEBUGP(DGPRS, "%s(%p, %s)\n", __func__, msc_conn_ref, vlr_subscr_name(vsub)); + priv->subscr = vsub; +} + +/* operations that we need to implement for libvlr */ +static const struct vlr_ops test_vlr_ops = { + .tx_auth_req = msc_vlr_tx_auth_req, + .tx_auth_rej = msc_vlr_tx_auth_rej, + .tx_id_req = msc_vlr_tx_id_req, + .tx_lu_acc = msc_vlr_tx_lu_ack, + .tx_lu_rej = msc_vlr_tx_lu_rej, + .set_ciph_mode = msc_vlr_set_ciph_mode, + .subscr_update = msc_vlr_subscr_update, + .subscr_assoc = msc_vlr_subscr_assoc, +}; + +/*********************************************************************** + * Actual test cases + ***********************************************************************/ + + +static struct osmo_fsm_inst * +start_lu(enum testvlr_mode mode, uint32_t tmsi, + const char *imsi, const char *imei) +{ + struct testvlr_priv *vp; + struct osmo_fsm_inst *fi; + + vp = talloc_zero(tall_bsc_ctx, struct testvlr_priv); + vp->mode = mode; + vp->tmsi = tmsi; + strncpy(vp->imsi, imsi, sizeof(vp->imsi)); + strncpy(vp->imei, imei, sizeof(vp->imei)); + + fi = osmo_fsm_inst_alloc(&vlr_test_fsm, vp, vp, LOGL_DEBUG, vp->imsi); + osmo_fsm_inst_dispatch(fi, EVT_MS_TX_LU, NULL); + return fi; +} + +/*********************************************************************** + * Main / Misc + ***********************************************************************/ + +static struct osmo_timer_list tmr; + +static void timer_cb(void *data) +{ + uint32_t tmsi = rand() % 1000000; + uint64_t imsi = 901790000000000 + tmsi; + char imsi_str[32]; + + snprintf(imsi_str, sizeof(imsi_str), "%lu", imsi); + //start_lu(MODE_AUTH_FAIL, tmsi, imsi_str, "23422342"); + start_lu(MODE_SUCCESS_TMSI, tmsi, imsi_str, "23422342"); + //start_lu(MODE_SUCCESS, tmsi, imsi_str, "23422342"); + //start_upd_hlr_vlr(tall_bsc_ctx, tmsi, imsi_str); + //start_sub_pres_vlr(tall_bsc_ctx); + osmo_timer_schedule(&tmr, 8, 0); +} + +static void sighdlr(int sig) +{ + switch (sig) { + case SIGUSR1: + talloc_report_full(tall_bsc_ctx, stderr); + break; + } +} + +int main(int argc, char **argv) +{ + tall_bsc_ctx = talloc_named_const(NULL, 1, "tall_bsc_ctx"); + + signal(SIGUSR1, sighdlr); + + osmo_init_logging(&log_info); + + g_vlr = vlr_alloc(NULL, &test_vlr_ops); + vlr_start("VLRTEST", g_vlr, "localhost", 2222); + OSMO_ASSERT(g_vlr); + osmo_fsm_register(&vlr_test_fsm); + osmo_fsm_register(&test_sub_pres_vlr_fsm); + osmo_fsm_register(&test_upd_hlr_vlr_fsm); + + g_vlr->cfg.assign_tmsi = true; + + tmr.cb = timer_cb; + timer_cb(NULL); + + while (1) { + osmo_select_main(0); + } + + exit(0); +} + +struct gsm_subscriber_connection; +int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn) { return 0; } -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 20:30:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 20:30:08 +0000 Subject: [PATCH] osmo-msc[master]: Use libvlr in libmsc (large refactoring) Message-ID: Review at https://gerrit.osmocom.org/3195 Use libvlr in libmsc (large refactoring) Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Related: OS#1592 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 --- M configure.ac M include/openbsc/abis_rsl.h M include/openbsc/auth.h M include/openbsc/bsc_api.h M include/openbsc/chan_alloc.h M include/openbsc/db.h M include/openbsc/debug.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/gsm_subscriber.h M include/openbsc/osmo_msc.h M include/openbsc/signal.h M include/openbsc/silent_call.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/paging.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/meas_feed.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c M src/libmsc/token_auth.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr_access_req_fsm.c M src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/db/db_test.c M tests/mm_auth/mm_auth_test.c M tests/mm_auth/mm_auth_test.ok A tests/sms_queue/Makefile.am A tests/sms_queue/sms_queue_test.c A tests/sms_queue/sms_queue_test.err A tests/sms_queue/sms_queue_test.ok M tests/subscr/Makefile.am D tests/subscr/subscr_test.c D tests/subscr/subscr_test.ok M tests/testsuite.at M tests/vty_test_runner.py 67 files changed, 2,179 insertions(+), 3,863 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3195/1 -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 20:30:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 20:30:09 +0000 Subject: [PATCH] osmo-msc[master]: Add msc_vlr test suite for MSC+VLR end-to-end tests Message-ID: Review at https://gerrit.osmocom.org/3196 Add msc_vlr test suite for MSC+VLR end-to-end tests Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd --- M .gitignore M configure.ac M tests/Makefile.am A tests/msc_vlr/Makefile.am A tests/msc_vlr/msc_vlr_test_gsm_authen.c A tests/msc_vlr/msc_vlr_test_gsm_authen.err A tests/msc_vlr/msc_vlr_test_gsm_authen.ok A tests/msc_vlr/msc_vlr_test_gsm_ciph.c A tests/msc_vlr/msc_vlr_test_gsm_ciph.err A tests/msc_vlr/msc_vlr_test_gsm_ciph.ok A tests/msc_vlr/msc_vlr_test_hlr_reject.c A tests/msc_vlr/msc_vlr_test_hlr_reject.err A tests/msc_vlr/msc_vlr_test_hlr_reject.ok A tests/msc_vlr/msc_vlr_test_hlr_timeout.c A tests/msc_vlr/msc_vlr_test_hlr_timeout.err A tests/msc_vlr/msc_vlr_test_hlr_timeout.ok A tests/msc_vlr/msc_vlr_test_ms_timeout.c A tests/msc_vlr/msc_vlr_test_ms_timeout.err A tests/msc_vlr/msc_vlr_test_ms_timeout.ok A tests/msc_vlr/msc_vlr_test_no_authen.c A tests/msc_vlr/msc_vlr_test_no_authen.err A tests/msc_vlr/msc_vlr_test_no_authen.ok A tests/msc_vlr/msc_vlr_test_reject_concurrency.c A tests/msc_vlr/msc_vlr_test_reject_concurrency.err A tests/msc_vlr/msc_vlr_test_reject_concurrency.ok A tests/msc_vlr/msc_vlr_test_rest.c A tests/msc_vlr/msc_vlr_test_rest.err A tests/msc_vlr/msc_vlr_test_rest.ok A tests/msc_vlr/msc_vlr_test_umts_authen.c A tests/msc_vlr/msc_vlr_test_umts_authen.err A tests/msc_vlr/msc_vlr_test_umts_authen.ok A tests/msc_vlr/msc_vlr_tests.c A tests/msc_vlr/msc_vlr_tests.h M tests/testsuite.at 34 files changed, 15,306 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/3196/1 -- To view, visit https://gerrit.osmocom.org/3196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:44 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Initial commit of virt-phy to work with osmo-bts v... Message-ID: Review at https://gerrit.osmocom.org/3197 VIRT-PHY: Initial commit of virt-phy to work with osmo-bts virt-phy. This patch implements a virtual physical layer replacing the air interface. The purpose is to get rid of the hardware requirements and be able to start testing and implementing layer 2 communication functionality on one machine. Multicast sockets are used to enable bidirectional communication between the BTS and the MS process. The GSMTAP protocol designed for wireshark capturing is used to encapsulate the payload on the virtual physical layer. The virtual physical layer on the osmocom-bb side implements the L1CTL interface to the layer23 apps like mobile. * Working mcast socket communication and extraction of its functionality. * Basic handlers for file descriptor callbacks from incoming L1CTL messages and extraction of that functionality to a l1ctl socket class. * Multiplexing to different routines depending on incoming L1CTL message type. * Uses virt_um and osmocom_mcast_sock implementation from osmo-bts virt-phy. * Ecapsulation and parsing methods to and from GSMTAP messages. * Basic handlers for file descriptor callbacks from incoming mcast messages on the virtual um. * Multiplexing to different channel routines based on GSMTAP header channel type. * Example configuration for l23 app mobile using virtual test sim. Change-Id: I203c8ec58326e52a09603a37232fce7ae3641415 --- A .gitignore M src/Makefile A src/host/virt_phy/.gitignore A src/host/virt_phy/Makefile.am A src/host/virt_phy/README A src/host/virt_phy/configure.ac A src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg A src/host/virt_phy/include/layer1/mframe_sched.h A src/host/virt_phy/include/layer1/sync.h A src/host/virt_phy/include/layer1/tdma_sched.h A src/host/virt_phy/src/Makefile.am A src/host/virt_phy/src/gsmtapl1_if.c A src/host/virt_phy/src/gsmtapl1_if.h A src/host/virt_phy/src/l1ctl_sap.c A src/host/virt_phy/src/l1ctl_sap.h A src/host/virt_phy/src/l1ctl_sock.c A src/host/virt_phy/src/l1ctl_sock.h A src/host/virt_phy/src/logging.c A src/host/virt_phy/src/logging.h A src/host/virt_phy/src/osmo_mcast_sock.c A src/host/virt_phy/src/osmo_mcast_sock.h A src/host/virt_phy/src/virt_l1_model.c A src/host/virt_phy/src/virt_l1_model.h A src/host/virt_phy/src/virtphy.c A src/host/virt_phy/src/virtual_um.c A src/host/virt_phy/src/virtual_um.h 26 files changed, 2,515 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/97/3197/1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..363f656 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +*.o +*.a +Makefile.in +Makefile +.deps + +build-target +aclocal.m4 +autom4te.cache +config.log +config.status +config.guess +config.sub +configure +compile +depcomp +install-sh +missing +stamp-h1 +core +core.* + +# Backups, vi, merges +*~ +*.sw? +*.orig +*.sav + +# development environment +/.autotools +/.cproject +/.project +/.settings/ + diff --git a/src/Makefile b/src/Makefile index a145880..44f91b1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,7 +12,8 @@ TOPDIR=$(shell pwd) all: libosmocore-target nofirmware firmware mtk-firmware -nofirmware: layer23 osmocon gsmmap + +nofirmware: layer23 osmocon gsmmap virtphy libosmocore-target: shared/libosmocore/build-target/src/.libs/libosmocore.a @@ -45,6 +46,15 @@ host/osmocon/osmocon: host/osmocon/Makefile make -C host/osmocon +.PHONY: virtphy +virtphy: host/virt_phy/Makefile + cd host/virt_phy && make + +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) .PHONY: gsmmap gsmmap: host/gsmmap/gsmmap @@ -85,6 +95,7 @@ make -C shared/libosmocore/build-target $@ make -C host/layer23 $@ make -C host/osmocon $@ + make -C host/virt_phy $@ make -C target/firmware $@ make -C target/firmware -f Makefile.mtk $@ @@ -92,5 +103,6 @@ rm -rf shared/libosmocore/build-target make -C host/layer23 $@ make -C host/osmocon $@ + make -C host/virt_phy $@ # 'firmware' also handles 'mtk-firmware' make -C target/firmware $@ diff --git a/src/host/virt_phy/.gitignore b/src/host/virt_phy/.gitignore new file mode 100644 index 0000000..1e19c7f --- /dev/null +++ b/src/host/virt_phy/.gitignore @@ -0,0 +1,3 @@ +config.h +config.h.in +src/virtphy \ No newline at end of file diff --git a/src/host/virt_phy/Makefile.am b/src/host/virt_phy/Makefile.am new file mode 100644 index 0000000..515d51b --- /dev/null +++ b/src/host/virt_phy/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src +dist_doc_DATA = README \ No newline at end of file diff --git a/src/host/virt_phy/README b/src/host/virt_phy/README new file mode 100644 index 0000000..a780664 --- /dev/null +++ b/src/host/virt_phy/README @@ -0,0 +1,2 @@ +This is the package for the Osmocom virtual physical layer. +A layer 1 implementation satisfying the L1CTL interface towards the l23 application (e.g. mobile). \ No newline at end of file diff --git a/src/host/virt_phy/configure.ac b/src/host/virt_phy/configure.ac new file mode 100644 index 0000000..bcdbf91 --- /dev/null +++ b/src/host/virt_phy/configure.ac @@ -0,0 +1,27 @@ +dnl Process this file with autoconf to produce a configure script +AC_INIT([virtphy], 0.0.0) +AM_CONFIG_HEADER([config.h]) +AM_INIT_AUTOMAKE([foreign dist-bzip2]) + +dnl kernel style compile messages +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +dnl checks for programs +AC_PROG_MAKE_SET +AC_PROG_CC +AC_PROG_INSTALL + +dnl checks for libraries +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm) + +dnl checks for header files +AC_HEADER_STDC + +dnl Checks for typedefs, structures and compiler characteristics + +AC_CONFIG_FILES([ + Makefile + src/Makefile +]) +AC_OUTPUT diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg new file mode 100644 index 0000000..382a09d --- /dev/null +++ b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg @@ -0,0 +1,67 @@ +! +! OsmocomBB (0.0.0) configuration saved from vty +!! +! +line vty + no login +! +gps device /dev/ttyACM0 +gps baudrate default +no gps enable +! +no hide-default +! +ms 1 + layer2-socket /tmp/osmocom_l2 + sap-socket /tmp/osmocom_sap + sim test + network-selection-mode auto + imei 123456789012345 0 + imei-fixed + no emergency-imsi + no sms-service-center + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + no gsm-850 + dcs + no pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + exit + test-sim + imsi 901700000000403 + ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + no barred-access + no rplmn + hplmn-search foreign-country + exit + no shutdown +exit +! diff --git a/src/host/virt_phy/include/layer1/mframe_sched.h b/src/host/virt_phy/include/layer1/mframe_sched.h new file mode 100644 index 0000000..ecdb1ec --- /dev/null +++ b/src/host/virt_phy/include/layer1/mframe_sched.h @@ -0,0 +1,68 @@ +#ifndef _L1_MFRAME_SCHED_H +#define _L1_MFRAME_SCHED_H + +#include + +enum mframe_task { + MF_TASK_BCCH_NORM, + MF_TASK_BCCH_EXT, + MF_TASK_CCCH, + MF_TASK_CCCH_COMB, + + MF_TASK_SDCCH4_0, + MF_TASK_SDCCH4_1, + MF_TASK_SDCCH4_2, + MF_TASK_SDCCH4_3, + + MF_TASK_SDCCH8_0, + MF_TASK_SDCCH8_1, + MF_TASK_SDCCH8_2, + MF_TASK_SDCCH8_3, + MF_TASK_SDCCH8_4, + MF_TASK_SDCCH8_5, + MF_TASK_SDCCH8_6, + MF_TASK_SDCCH8_7, + + MF_TASK_TCH_F_EVEN, + MF_TASK_TCH_F_ODD, + MF_TASK_TCH_H_0, + MF_TASK_TCH_H_1, + + MF_TASK_NEIGH_PM51_C0T0, + MF_TASK_NEIGH_PM51, + MF_TASK_NEIGH_PM26E, + MF_TASK_NEIGH_PM26O, + + /* Test task: send Normal Burst in all timeslots */ + MF_TASK_UL_ALL_NB, +}; + +enum mf_sched_item_flag { + MF_F_SACCH = (1 << 0), +}; + +/* The scheduler itself */ +struct mframe_scheduler { + uint32_t tasks; + uint32_t tasks_tgt; + uint32_t safe_fn; +}; + +uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t ts); + +/* Enable a specific task */ +void mframe_enable(enum mframe_task task_id); + +/* Disable a specific task */ +void mframe_disable(enum mframe_task task_id); + +/* Replace the current active set by the new one */ +void mframe_set(uint32_t tasks); + +/* Schedule mframe_sched_items according to current MF TASK list */ +void mframe_schedule(void); + +/* reset the scheduler, disabling all tasks */ +void mframe_reset(void); + +#endif /* _MFRAME_SCHED_H */ diff --git a/src/host/virt_phy/include/layer1/sync.h b/src/host/virt_phy/include/layer1/sync.h new file mode 100644 index 0000000..dae85a1 --- /dev/null +++ b/src/host/virt_phy/include/layer1/sync.h @@ -0,0 +1,204 @@ +#ifndef _L1_SYNC_H +#define _L1_SYNC_H + +#include +#include +#include +#include +#include + +/* structure representing L1 sync information about a cell */ +struct l1_cell_info { + /* on which ARFCN (+band) is the cell? */ + uint16_t arfcn; + /* what's the BSIC of the cell (from SCH burst decoding) */ + uint8_t bsic; + /* Combined or non-combined CCCH */ + uint8_t ccch_mode; /* enum ccch_mode */ + /* whats the delta of the cells current GSM frame number + * compared to our current local frame number */ + int32_t fn_offset; + /* how much does the TPU need adjustment (delta) to synchronize + * with the cells burst */ + uint32_t time_alignment; + /* FIXME: should we also store the AFC value? */ +}; + +enum l1s_chan { + L1S_CHAN_MAIN, + L1S_CHAN_SACCH, + L1S_CHAN_TRAFFIC, + _NUM_L1S_CHAN +}; + +enum l1_compl { + L1_COMPL_FB, + L1_COMPL_RACH, + L1_COMPL_TX_NB, + L1_COMPL_TX_TCH, +}; + +typedef void l1_compl_cb(enum l1_compl c); + +#define L1S_NUM_COMPL 32 +#define L1S_NUM_NEIGH_CELL 6 + +struct l1s_h0 { + uint16_t arfcn; +}; + +struct l1s_h1 { + uint8_t hsn; + uint8_t maio; + uint8_t n; + uint16_t ma[64]; +}; + +struct l1s_state { + struct gsm_time current_time; /* current GSM time */ + struct gsm_time next_time; /* GSM time at next TMDMA irq */ + + /* the cell on which we are camping right now */ + struct l1_cell_info serving_cell; + + /* neighbor cell sync info */ + struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; + + /* TDMA scheduler */ + struct tdma_scheduler tdma_sched; + + /* Multiframe scheduler */ + struct mframe_scheduler mframe_sched; + + /* The current TPU offset register */ + uint32_t tpu_offset; + int32_t tpu_offset_correction; + + /* TX parameters */ + int8_t ta; + uint8_t tx_power; + + /* TCH */ + uint8_t tch_mode; + uint8_t tch_sync; + uint8_t audio_mode; + + /* Transmit queues of pending packets for main DCCH and ACCH */ + struct llist_head tx_queue[_NUM_L1S_CHAN]; + struct msgb *tx_meas; + + /* Which L1A completions are scheduled right now */ + uint32_t scheduled_compl; + /* callbacks for each of the completions */ + l1_compl_cb *completion[L1S_NUM_COMPL]; + + /* Structures below are for L1-task specific parameters, used + * to communicate between l1-sync and l1-async (l23_api) */ + struct { + uint8_t mode; /* FB_MODE 0/1 */ + } fb; + + struct { + /* power measurement l1 task */ + unsigned int mode; + union { + struct { + uint16_t arfcn_start; + uint16_t arfcn_next; + uint16_t arfcn_end; + } range; + }; + struct msgb *msg; + } pm; + + struct { + uint8_t ra; + } rach; + + struct { + enum { + GSM_DCHAN_NONE = 0, + GSM_DCHAN_SDCCH_4, + GSM_DCHAN_SDCCH_8, + GSM_DCHAN_TCH_H, + GSM_DCHAN_TCH_F, + GSM_DCHAN_UNKNOWN, + } type; + + uint8_t scn; + uint8_t tsc; + uint8_t tn; + uint8_t h; + + union { + struct l1s_h0 h0; + struct l1s_h1 h1; + }; + + uint8_t st_tsc; + uint8_t st_tn; + uint8_t st_h; + + union { + struct l1s_h0 st_h0; + struct l1s_h1 st_h1; + }; + } dedicated; + + /* neighbour cell power measurement process */ + struct { + uint8_t n, second; + uint8_t pos; + uint8_t running; + uint16_t band_arfcn[64]; + uint8_t tn[64]; + uint8_t level[64]; + } neigh_pm; +}; + +extern struct l1s_state l1s; + +struct l1s_meas_hdr { + uint16_t snr; /* signal/noise ratio */ + int16_t toa_qbit; /* time of arrival (qbits) */ + int16_t pm_dbm8; /* power level in dbm/8 */ + int16_t freq_err; /* Frequency error in Hz */ +}; + +int16_t l1s_snr_int(uint16_t snr); +uint16_t l1s_snr_fract(uint16_t snr); + +void l1s_dsp_abort(void); + +void l1s_tx_apc_helper(uint16_t arfcn); + +/* schedule a completion */ +void l1s_compl_sched(enum l1_compl c); + +void l1s_init(void); + +/* reset the layer1 as part of synchronizing to a new cell */ +void l1s_reset(void); + +/* init.c */ +void layer1_init(void); + +/* A debug macro to print every TDMA frame */ +#ifdef DEBUG_EVERY_TDMA +#define putchart(x) putchar(x) +#else +#define putchart(x) +#endif + +/* Convert an angle in fx1.15 notatinon into Hz */ +#define BITFREQ_DIV_2PI 43104 /* 270kHz / 2 * pi */ +#define BITFREQ_DIV_PI 86208 /* 270kHz / pi */ +#define ANG2FREQ_SCALING (2<<15) /* 2^15 scaling factor for fx1.15 */ +#define ANGLE_TO_FREQ(angle) ((int16_t)angle * BITFREQ_DIV_PI / ANG2FREQ_SCALING) + +void l1s_reset_hw(void); +void synchronize_tdma(struct l1_cell_info *cinfo); +void l1s_time_inc(struct gsm_time *time, uint32_t delta_fn); +void l1s_time_dump(const struct gsm_time *time); + +#endif /* _L1_SYNC_H */ diff --git a/src/host/virt_phy/include/layer1/tdma_sched.h b/src/host/virt_phy/include/layer1/tdma_sched.h new file mode 100644 index 0000000..f58d59b --- /dev/null +++ b/src/host/virt_phy/include/layer1/tdma_sched.h @@ -0,0 +1,73 @@ +#ifndef _L1_TDMA_SCHED_H +#define _L1_TDMA_SCHED_H + +#include + +/* TDMA scheduler */ + +/* The idea of this scheduler is that we have a circular buffer of buckets, + * where each bucket corresponds to one future TDMA frame [interrupt]. Each + * bucket contains of a list of callbacks which are executed when the bucket + * index reaches that particular bucket. */ + +#define TDMASCHED_NUM_FRAMES 25 +#define TDMASCHED_NUM_CB 8 + +#define TDMA_IFLG_TPU (1<<0) +#define TDMA_IFLG_DSP (1<<1) + +typedef int tdma_sched_cb(uint8_t p1, uint8_t p2, uint16_t p3); + +/* A single item in a TDMA scheduler bucket */ +struct tdma_sched_item { + tdma_sched_cb *cb; + uint8_t p1; + uint8_t p2; + uint16_t p3; + int16_t prio; + uint16_t flags; /* TDMA_IFLG_xxx */ +}; + +/* A bucket inside the TDMA scheduler */ +struct tdma_sched_bucket { + struct tdma_sched_item item[TDMASCHED_NUM_CB]; + uint8_t num_items; +}; + +/* The scheduler itself, consisting of buckets and a current index */ +struct tdma_scheduler { + struct tdma_sched_bucket bucket[TDMASCHED_NUM_FRAMES]; + uint8_t cur_bucket; +}; + +/* Schedule an item at 'frame_offset' TDMA frames in the future */ +int tdma_schedule(uint8_t frame_offset, tdma_sched_cb *cb, + uint8_t p1, uint8_t p2, uint16_t p3, int16_t prio); + +/* Schedule a set of items starting from 'frame_offset' TDMA frames in the future */ +int tdma_schedule_set(uint8_t frame_offset, const struct tdma_sched_item *item_set, uint16_t p3); + +/* Scan current frame scheduled items for flags */ +uint16_t tdma_sched_flag_scan(void); + +/* Execute pre-scheduled events for current frame */ +int tdma_sched_execute(void); + +/* Advance TDMA scheduler to the next bucket */ +void tdma_sched_advance(void); + +/* reset the scheduler; erase all scheduled items */ +void tdma_sched_reset(void); + +/* debug function: print number of entries of all TDMA buckets */ +void tdma_sched_dump(void); + + +extern int tdma_end_set(uint8_t p1, uint8_t p2, uint16_t p3); +#define SCHED_ITEM(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, .flags = 0 } +#define SCHED_ITEM_DT(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, \ + .flags = TDMA_IFLG_TPU | TDMA_IFLG_DSP } +#define SCHED_END_FRAME() { .cb = NULL, .p1 = 0, .p2 = 0 } +#define SCHED_END_SET() { .cb = &tdma_end_set, .p1 = 0, .p2 = 0 } + +#endif /* _L1_TDMA_SCHED_H */ diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am new file mode 100644 index 0000000..a110435 --- /dev/null +++ b/src/host/virt_phy/src/Makefile.am @@ -0,0 +1,19 @@ +OSMOCOM_DIR = /home/basti/Osmocom +OSMO_BB_DIR = $(OSMOCOM_DIR)/osmocom-bb +OSMO_BTS_DIR = $(OSMOCOM_DIR)/osmo-bts +OPENBSC_DIR = $(OSMOCOM_DIR)/openbsc + +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OSMO_BB_DIR)/include -I$(OSMO_BTS_DIR)/include -I$(OPENBSC_DIR)/openbsc/include -I$(OSMO_BB_DIR)/src/host/layer23/include +# TODO: somehow this include path causes errors, thus the needed files are copied into $(top_srcdir)/include. Would be better to include directly from $(OSMO_BB_DIR)/src/target/firmware/include to avoid redundancy. +# -I$(OSMO_BB_DIR)/src/target/firmware/include + +CFLAGS = -g -O0 + +sbin_PROGRAMS = virtphy +virtphy_SOURCES = virtphy.c l1ctl_sock.c l1ctl_sap.c gsmtapl1_if.c logging.c virt_l1_model.c virtual_um.c osmo_mcast_sock.c +virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +# debug output +all: + $(info $$AM_CPPFLAGS is [${AM_CPPFLAGS}]) diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c new file mode 100644 index 0000000..11214cf --- /dev/null +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -0,0 +1,282 @@ +/* GSMTAP layer1 is transmits gsmtap messages over a virtual layer 1.*/ + +/* (C) 2016 Sebastian Stumpf + * + * 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 "virtual_um.h" +#include "l1ctl_sock.h" +#include "virt_l1_model.h" +#include "l1ctl_sap.h" +#include "gsmtapl1_if.h" +#include "logging.h" + +static struct l1_model_ms *l1_model_ms = NULL; + +// for debugging +static const struct value_string gsmtap_channels [22] = { + { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, + { GSMTAP_CHANNEL_BCCH, "BCCH" }, + { GSMTAP_CHANNEL_CCCH, "CCCH" }, + { GSMTAP_CHANNEL_RACH, "RACH" }, + { GSMTAP_CHANNEL_AGCH, "AGCH" }, + { GSMTAP_CHANNEL_PCH, "PCH" }, + { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, + { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, + { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, + { GSMTAP_CHANNEL_TCH_F, "FACCH/F" }, + { GSMTAP_CHANNEL_TCH_H, "FACCH/H" }, + { GSMTAP_CHANNEL_PACCH, "PACCH" }, + { GSMTAP_CHANNEL_CBCH52, "CBCH" }, + { GSMTAP_CHANNEL_PDCH, "PDCH" }, + { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, + { GSMTAP_CHANNEL_CBCH51, "CBCH" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_SDCCH, "LSACCH" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, + { 0, NULL }, +}; +// for debugging +static const struct value_string gsmtap_types [10] = { + { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, + { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, + { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, + { GSMTAP_TYPE_SIM, "SIM" }, + { GSMTAP_TYPE_TETRA_I1, "TETRA V+D"}, + { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, + { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)" }, + { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, + { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, + { 0, NULL }, +}; + +void gsmtapl1_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} + +/** + * Append a gsmtap header to msg and send it over the virt um. + */ +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg) +{ + struct l1ctl_hdr *l1hdr = (struct l1ctl_hdr *)msg->l1h; + struct l1ctl_info_dl *l1dl = (struct l1ctl_info_dl *)msg->data; + uint8_t ss = 0; + uint8_t gsmtap_chan; + struct msgb *outmsg; + + switch (l1hdr->msg_type) { + case L1CTL_DATA_REQ: + // TODO: check what data request and set gsmtap_chan depending on that + gsmtap_chan = 0; + break; + } + outmsg = gsmtap_makemsg(l1dl->band_arfcn, l1dl->chan_nr, gsmtap_chan, + ss, l1dl->frame_nr, 0, 0, msgb_l2(msg), + msgb_l2len(msg)); + if (outmsg) { + struct gsmtap_hdr *gh = (struct gsmtap_hdr *)outmsg->l1h; + virt_um_write_msg(vui, outmsg); + DEBUGP(DVIRPHY, + "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, gh->timeslot, + gh->sub_slot); + } else { + LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); + } + + /* free message */ + msgb_free(msg); +} + +/** + * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, struct msgb *msg). + */ +void gsmtapl1_tx_to_virt_um(struct msgb *msg) +{ + gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, msg); +} + +/* This is the header as it is used by gsmtap peer virtual layer 1. +struct gsmtap_hdr { + guint8 version; // version, set to 0x01 currently + guint8 hdr_len; // length in number of 32bit words + guint8 type; // see GSMTAP_TYPE_* + guint8 timeslot; // timeslot (0..7 on Um) + guint16 arfcn; // ARFCN (frequency) + gint8 signal_dbm; // signal level in dBm + gint8 snr_db; // signal/noise ratio in dB + guint32 frame_number; // GSM Frame Number (FN) + guint8 sub_type; // Type of burst/channel, see above + guint8 antenna_nr; // Antenna Number + guint8 sub_slot; // sub-slot within timeslot + guint8 res; // reserved for future use (RFU) +} + */ + +/** + * Receive a gsmtap message from the virt um. + */ +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, + struct msgb *msg) +{ + if (msg) { + struct gsmtap_hdr *gh; + struct l1ctl_info_dl *l1dl; + struct msgb *l1ctl_msg = NULL; + struct l1ctl_data_ind * l1di; + + msg->l1h = msgb_data(msg); + msg->l2h = msgb_pull(msg, sizeof(*gh)); + gh = msgb_l1(msg); + + DEBUGP(DVIRPHY, + "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u)\n", + ntohs(gh->arfcn), ntohl(gh->frame_number), get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gh->sub_type), gh->timeslot, + gh->sub_slot); + + // compose the l1ctl message for layer 2 + switch (gh->sub_type) { + case GSMTAP_CHANNEL_RACH: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + break; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + // TODO: implement channel handling + break; + case GSMTAP_CHANNEL_TCH_F: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); + // TODO: implement channel handling + break; + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); + l1di = (struct l1ctl_data_ind *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_data_ind)); + + l1dl->band_arfcn = htons(ntohs(gh->arfcn)); + l1dl->link_id = gh->timeslot; + // see GSM 8.58 -> 9.3.1 for channel number encoding + l1dl->chan_nr = rsl_enc_chan_nr(chantype_gsmtap2rsl(gh->sub_type), gh->sub_slot, gh->timeslot); + l1dl->frame_nr = htonl(ntohl(gh->frame_number)); + l1dl->snr = gh->snr_db; + l1dl->rx_level = gh->signal_dbm; + l1dl->num_biterr = 0; + l1dl->fire_crc = 0; + + memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); + + break; + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_TCH_H: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + break; + default: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + break; + } + + /* forward l1ctl message to l2 */ + if(l1ctl_msg) { + l1ctl_sap_tx_to_l23(l1ctl_msg); + } + + // handle memory deallocation + talloc_free(msg); + } +} + +/** + * @see void gsmtapl1_rx_from_virt_um_cb(struct virt_um_inst *vui, struct msgb msg). + */ +void gsmtapl1_rx_from_virt_um(struct msgb *msg) +{ + gsmtapl1_rx_from_virt_um_inst_cb(l1_model_ms->vui, msg); +} + +/*! \brief convert GSMTAP channel type to RSL channel number + * \param[in] rsl_chantype RSL channel type + * \param[in] link_id RSL link identifier + * \returns GSMTAP channel type + */ +uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype) +{ + // TODO: proper retval for unknown channel + uint8_t ret = 0; + + switch (gsmtap_chantype) { + case GSMTAP_CHANNEL_TCH_F: + ret = RSL_CHAN_Bm_ACCHs; + break; + case GSMTAP_CHANNEL_TCH_H: + ret = RSL_CHAN_Lm_ACCHs; + break; + case GSMTAP_CHANNEL_SDCCH4: + ret = RSL_CHAN_SDCCH4_ACCH; + break; + case GSMTAP_CHANNEL_SDCCH8: + ret = RSL_CHAN_SDCCH8_ACCH; + break; + case GSMTAP_CHANNEL_BCCH: + ret = RSL_CHAN_BCCH; + break; + case GSMTAP_CHANNEL_RACH: + ret = RSL_CHAN_RACH; + break; + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_AGCH: + ret = RSL_CHAN_PCH_AGCH; + break; + } + + // TODO: check how to handle this... +// if (link_id & 0x40) +// ret |= GSMTAP_CHANNEL_ACCH; + + return ret; +} diff --git a/src/host/virt_phy/src/gsmtapl1_if.h b/src/host/virt_phy/src/gsmtapl1_if.h new file mode 100644 index 0000000..8c7491c --- /dev/null +++ b/src/host/virt_phy/src/gsmtapl1_if.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +#include "l1ctl_sock.h" +#include "virtual_um.h" +#include "virt_l1_model.h" + +void gsmtapl1_init(struct l1_model_ms *model); + +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_rx_from_virt_um(struct msgb *msg); + +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_tx_to_virt_um(struct msgb *msg); + +uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c new file mode 100644 index 0000000..46121ed --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -0,0 +1,833 @@ +/* L1CTL SAP implementation. */ + +#include +#include +#include +#include +#include +#include + +#include "virtual_um.h" +#include "l1ctl_sock.h" +#include "virt_l1_model.h" +#include "l1ctl_sap.h" +#include "logging.h" + +static struct l1_model_ms *l1_model_ms = NULL; + +/** + * @brief Init the SAP. + */ +void l1ctl_sap_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} + +/** + * @brief L1CTL handler called for received messages from L23. + * + * Enqueues the message into the rx queue. + */ +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) +{ + if (msg) { + DEBUGP(DL1C, "Message incoming from layer 2: %s\n", + osmo_hexdump(msg->data, msg->len)); + l1ctl_sap_handler(msg); + } +} +/** + * @see l1ctl_sap_rx_from_l23_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg). + */ +void l1ctl_sap_rx_from_l23(struct msgb *msg) +{ + l1ctl_sap_rx_from_l23_inst_cb(l1_model_ms->lsi, msg); +} + +/** + * @brief Send a l1ctl message to layer 23. + * + * This will forward the message as it is to the upper layer. + */ +void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg) +{ + uint16_t *len; + /* prepend 16bit length before sending */ + len = (uint16_t *) msgb_push(msg, sizeof(*len)); + *len = htons(msg->len - sizeof(*len)); + + if(l1ctl_sock_write_msg(lsi, msg) == -1 ) { + //DEBUGP(DL1C, "Error writing to layer2 socket"); + } +} + +/** + * @see void l1ctl_sap_tx_to_l23(struct l1ctl_sock_inst *lsi, struct msgb *msg). + */ +void l1ctl_sap_tx_to_l23(struct msgb *msg) +{ + l1ctl_sap_tx_to_l23_inst(l1_model_ms->lsi, msg); +} + +/** + * @brief Allocates a msgb with set l1ctl header and room for a l3 header. + * + * @param [in] msg_type L1CTL primitive message type set to l1ctl_hdr. + * @return the allocated message. + * + * The message looks as follows: + * # headers + * [l1ctl_hdr] : initialized. msgb->l1h points here + * [spare-bytes] : L3_MSG_HEAD bytes reserved for l3 header + * # data + * [spare-bytes] : L3_MSG_DATA bytes reserved for data. msgb->tail points here. msgb->data points here. + */ +struct msgb *l1ctl_msgb_alloc(uint8_t msg_type) +{ + struct msgb *msg; + struct l1ctl_hdr *l1h; + msg = msgb_alloc_headroom(L3_MSG_SIZE, L3_MSG_HEAD, "l1ctl"); + if (!msg) { + while (1) { + puts("OOPS. Out of buffers...\n"); + } + + return NULL; + } + l1h = (struct l1ctl_hdr *)msgb_put(msg, sizeof(*l1h)); + l1h->msg_type = msg_type; + l1h->flags = 0; + + msg->l1h = (uint8_t *)l1h; + + return msg; +} + +/** + * @brief Allocates a msgb with set l1ctl header and room for a l3 header and puts l1ctl_info_dl to the msgb data. + * + * @param [in] msg_type L1CTL primitive message type set to l1ctl_hdr. + * @param [in] fn framenumber put into l1ctl_info_dl. + * @param [in] snr time slot number put into l1ctl_info_dl. + * @param [in] arfcn arfcn put into l1ctl_info_dl. + * @return the allocated message. + * + * The message looks as follows: + * # headers + * [l1ctl_hdr] : initialized. msgb->l1h points here + * [spare-bytes] : L3_MSG_HEAD bytes reserved for l3 header + * # data + * [l1ctl_info_dl] : initialized with params. msgb->data points here. + * [spare-bytes] : L3_MSG_DATA bytes reserved for data. msgb->tail points here. + */ +struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, + uint16_t arfcn) +{ + struct l1ctl_info_dl *dl; + struct msgb *msg = l1ctl_msgb_alloc(msg_type); + + dl = (struct l1ctl_info_dl *)msgb_put(msg, sizeof(*dl)); + dl->frame_nr = htonl(fn); + dl->snr = snr; + dl->band_arfcn = htons(arfcn); + + return msg; +} + +/** + * @brief General handler for incoming L1CTL messages from layer 2/3. + * + * This handler will dequeue the rx queue (if !empty) and call the specific routine for the dequeued l1ctl message. + * + */ +void l1ctl_sap_handler(struct msgb *msg) +{ +// struct msgb *msg; + struct l1ctl_hdr *l1h; + unsigned long flags; + + if (!msg) + return; + + l1h = (struct l1ctl_hdr *)msg->data; + + if (sizeof(*l1h) > msg->len) { + LOGP(DL1C, LOGL_NOTICE, "Short message. %u\n", msg->len); + goto exit_msgbfree; + } + + switch (l1h->msg_type) { + case L1CTL_FBSB_REQ: + l1ctl_rx_fbsb_req(msg); + break; + case L1CTL_DM_EST_REQ: + l1ctl_rx_dm_est_req(msg); + break; + case L1CTL_DM_REL_REQ: + l1ctl_rx_dm_rel_req(msg); + break; + case L1CTL_PARAM_REQ: + l1ctl_rx_param_req(msg); + break; + case L1CTL_DM_FREQ_REQ: + l1ctl_rx_dm_freq_req(msg); + break; + case L1CTL_CRYPTO_REQ: + l1ctl_rx_crypto_req(msg); + break; + case L1CTL_RACH_REQ: + l1ctl_rx_rach_req(msg); + break; + case L1CTL_DATA_REQ: + l1ctl_rx_data_req(msg); + /* we have to keep the msgb, not free it! */ + goto exit_nofree; + case L1CTL_PM_REQ: + l1ctl_rx_pm_req(msg); + break; + case L1CTL_RESET_REQ: + l1ctl_rx_reset_req(msg); + break; + case L1CTL_CCCH_MODE_REQ: + l1ctl_rx_ccch_mode_req(msg); + break; + case L1CTL_TCH_MODE_REQ: + l1ctl_rx_tch_mode_req(msg); + break; + case L1CTL_NEIGH_PM_REQ: + l1ctl_rx_neigh_pm_req(msg); + break; + case L1CTL_TRAFFIC_REQ: + l1ctl_rx_traffic_req(msg); + /* we have to keep the msgb, not free it! */ + goto exit_nofree; + case L1CTL_SIM_REQ: + l1ctl_rx_sim_req(msg); + break; + } + + exit_msgbfree: msgb_free(msg); + exit_nofree: return; +} + +/*************************************************************** + * L1CTL RX ROUTINES ******************************************* + ***************************************************************/ + +/** + * @brief Handler for received L1CTL_FBSB_REQ from L23. + * + * -- frequency burst synchronisation burst request -- + * + * @param [in] msg the received message. + * + * Transmit frequency control and synchronisation bursts on FCCH and SCH to calibrate transceiver and search for base stations. + * Sync to a given arfcn. + * + * Note: Not needed for virtual physical layer. + * TODO: Could be used to bind/connect to different virtual_bts sockets with a arfcn-socket mapping. + */ +void l1ctl_rx_fbsb_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + ntohs(sync_req->band_arfcn), sync_req->flags); + + l1ctl_tx_fbsb_conf(0, ntohs(sync_req->band_arfcn)); +} + +/** + * @brief Handler for received L1CTL_DM_EST_REQ from L23. + * + * -- dedicated mode established request -- + * + * @param [in] msg the received message. + * + * Handle state change from idle to dedicated mode. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_dm_est_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_dm_est_req *est_req = + (struct l1ctl_dm_est_req *)ul->payload; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_DM_EST_REQ (arfcn=%u, chan_nr=0x%02x, tsc=%u)\n", + ntohs(est_req->h0.band_arfcn), ul->chan_nr, + est_req->tsc); + +// /* disable neighbour cell measurement of C0 TS 0 */ +// mframe_disable(MF_TASK_NEIGH_PM51_C0T0); +// +// /* configure dedicated channel state */ +// l1s.dedicated.type = chan_nr2dchan_type(ul->chan_nr); +// l1s.dedicated.tsc = est_req->tsc; +// l1s.dedicated.tn = ul->chan_nr & 0x7; +// l1s.dedicated.h = est_req->h; +// +// if (est_req->h) { +// int i; +// l1s.dedicated.h1.hsn = est_req->h1.hsn; +// l1s.dedicated.h1.maio = est_req->h1.maio; +// l1s.dedicated.h1.n = est_req->h1.n; +// for (i=0; ih1.n; i++) +// l1s.dedicated.h1.ma[i] = ntohs(est_req->h1.ma[i]); +// } else { +// l1s.dedicated.h0.arfcn = ntohs(est_req->h0.band_arfcn); +// } +// +// /* TCH config */ +// if (chan_nr_is_tch(ul->chan_nr)) { +// /* Mode */ +// l1a_tch_mode_set(est_req->tch_mode); +// l1a_audio_mode_set(est_req->audio_mode); +// +// /* Sync */ +// l1s.tch_sync = 1; /* can be set without locking */ +// +// /* Audio path */ +// audio_set_enabled(est_req->tch_mode, est_req->audio_mode); +// } +// +// /* figure out which MF tasks to enable */ +// l1a_mftask_set(chan_nr2mf_task_mask(ul->chan_nr, NEIGH_MODE_PM)); +} + +/** + * @brief Handler for received L1CTL_DM_FREQ_REQ from L23. + * + * -- dedicated mode frequency request -- + * + * @param [in] msg the received message. + * + * Handle frequency change in dedicated mode. E.g. used for frequency hopping. + * + * Note: Not needed for virtual physical layer. + */ +void l1ctl_rx_dm_freq_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_dm_freq_req *freq_req = + (struct l1ctl_dm_freq_req *)ul->payload; + + DEBUGP(DL1C, + "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn=%u, tsc=%u)\n", + ntohs(freq_req->h0.band_arfcn), freq_req->tsc); +} + +/** + * @brief Handler for received L1CTL_CRYPTO_REQ from L23. + * + * -- cryptographic request -- + * + * @param [in] msg the received message. + * + * Configure the key and algorithm used for cryptographic operations in the DSP (Digital Signal Processor). + * + * Note: in the virtual physical layer the cryptographic operations are not handled in the DSP. + * + * TODO: Implement cryptographic operations for virtual um! + * TODO: Implement this handler routine! + */ +void l1ctl_rx_crypto_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *)ul->payload; + uint8_t key_len = msg->len - sizeof(*l1h) - sizeof(*ul) - sizeof(*cr); + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", + cr->algo, key_len); + +// if (cr->algo && key_len != 8) { +// DEBUGP(DL1C, "L1CTL_CRYPTO_REQ -> Invalid key\n"); +// return; +// } +// +// dsp_load_ciph_param(cr->algo, cr->key); +} + +/** + * @brief Handler for received L1CTL_DM_REL_REQ from L23. + * + * -- dedicated mode release request -- + * + * @param [in] msg the received message. + * + * Handle state change from dedicated to idle mode. Flush message buffers of dedicated channel. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_dm_rel_req(struct msgb *msg) +{ +// struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + + DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_DM_REL_REQ\n"); +// l1a_mftask_set(0); +// l1s.dedicated.type = GSM_DCHAN_NONE; +// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_MAIN]); +// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_SACCH]); +// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); +// l1a_meas_msgb_set(NULL); +// dsp_load_ciph_param(0, NULL); +// l1a_tch_mode_set(GSM48_CMODE_SIGN); +// audio_set_enabled(GSM48_CMODE_SIGN, 0); +// l1s.neigh_pm.n = 0; +} + +/** + * @brief Handler for received L1CTL_PARAM_REQ from L23. + * + * -- parameter request -- + * + * @param [in] msg the received message. + * + * Configure transceiver parameters timing advance value and sending power. + * + * Note: Not needed for virtual physical layer. + */ +void l1ctl_rx_param_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_par_req *par_req = (struct l1ctl_par_req *)ul->payload; + + DEBUGP(DL1C, + "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", + par_req->ta, par_req->tx_power); +} + +/** + * @brief Handler for received L1CTL_RACH_REQ from L23. + * + * -- random access channel request -- + * + * @param [in] msg the received message. + * + * Transmit RACH request on RACH. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_rach_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + rach_req->ra, ntohs(rach_req->offset), + rach_req->combined); + +// l1a_rach_req(ntohs(rach_req->offset), rach_req->combined, +// rach_req->ra); +} + +/** + * @brief Handler for received L1CTL_DATA_REQ from L23. + * + * -- data request -- + * + * @param [in] msg the received message. + * + * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_data_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; + struct llist_head *tx_queue; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x)\n", + ul->link_id); + +// msg->l3h = data_ind->data; +// if (ul->link_id & 0x40) { +// struct gsm48_hdr *gh = (struct gsm48_hdr *)(data_ind->data + 5); +// if (gh->proto_discr == GSM48_PDISC_RR +// && gh->msg_type == GSM48_MT_RR_MEAS_REP) { +// DEBUGP(DL1C, "updating measurement report\n"); +// l1a_meas_msgb_set(msg); +// return; +// } +// tx_queue = &l1s.tx_queue[L1S_CHAN_SACCH]; +// } else +// tx_queue = &l1s.tx_queue[L1S_CHAN_MAIN]; +// +// DEBUGP(DL1C, "ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p\n", +// ul, ul->payload, data_ind, data_ind->data, msg->l3h); +// +// l1a_txq_msgb_enq(tx_queue, msg); +} + +/** + * @brief Handler for received L1CTL_PM_REQ from L23. + * + * -- power measurement request -- + * + * @param [in] msg the received message. + * + * Process power measurement for a given range of arfcns to calculate signal power and connection quality. + * + * Note: We do not need to calculate that for the virtual physical layer, but l23 apps can expect a response. So this response is mocked here. + */ +void l1ctl_rx_pm_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *)l1h->data; + struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + uint16_t arfcn_next; + // convert to host order + pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); + pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); + + DEBUGP(DL1C, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); + + for(arfcn_next = pm_req->range.band_arfcn_from; arfcn_next <= pm_req->range.band_arfcn_to; ++arfcn_next) { + struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *)msgb_put(resp_msg, sizeof(*pm_conf)); + pm_conf->band_arfcn = htons(arfcn_next); + // rxlev 63 is great, 0 is bad the two values are probably min and max + pm_conf->pm[0] = 63; + pm_conf->pm[1] = 63; + if(arfcn_next == pm_req->range.band_arfcn_to) { + struct l1ctl_hdr *resp_l1h = resp_msg->l1h; + resp_l1h->flags |= L1CTL_F_DONE; + } + // no more space in msgb, flush to l2 + if(msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { + l1ctl_sap_tx_to_l23(resp_msg); + resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + } + } + if(resp_msg) { + l1ctl_sap_tx_to_l23(resp_msg); + } +} + +/** + * @brief Handler for received L1CTL_RESET_REQ from L23. + * + * -- reset request -- + * + * @param [in] msg the received message. + * + * Reset layer 1 (state machine, scheduler, transceiver) depending on the reset type. + * + */ +void l1ctl_rx_reset_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_reset *reset_req = (struct l1ctl_reset *)l1h->data; + + switch (reset_req->type) { + case L1CTL_RES_T_FULL: + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); +// l1s_reset(); +// l1s_reset_hw(); +// audio_set_enabled(GSM48_CMODE_SIGN, 0); + l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + break; + case L1CTL_RES_T_SCHED: + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); +// sched_gsmtime_reset(); + l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + break; + default: + LOGP(DL1C, LOGL_ERROR, + "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + break; + } +} + +/** + * @brief Handler for received L1CTL_CCCH_MODE_REQ from L23. + * + * -- common control channel mode request -- + * + * @param [in] msg the received message. + * + * Configure CCCH combined / non-combined mode. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_ccch_mode_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_ccch_mode_req *ccch_mode_req = + (struct l1ctl_ccch_mode_req *)l1h->data; + uint8_t ccch_mode = ccch_mode_req->ccch_mode; + + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); + + l1_model_ms->state->serving_cell.ccch_mode = ccch_mode; + + // check if more has to be done here + + l1ctl_tx_ccch_mode_conf(ccch_mode); + +// /* pre-set the CCCH mode */ +// l1s.serving_cell.ccch_mode = ccch_mode; +// +// /* Update task */ +// mframe_disable(MF_TASK_CCCH_COMB); +// mframe_disable(MF_TASK_CCCH); +// +// if (ccch_mode == CCCH_MODE_COMBINED) +// mframe_enable(MF_TASK_CCCH_COMB); +// else if (ccch_mode == CCCH_MODE_NON_COMBINED) +// mframe_enable(MF_TASK_CCCH); +// +// l1ctl_tx_ccch_mode_conf(ccch_mode); +} + +/** + * @brief Handler for received L1CTL_TCH_MODE_REQ from L23. + * + * -- traffic channel mode request -- + * + * @param [in] msg the received message. + * + * Configure TCH mode and audio mode. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_tch_mode_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_tch_mode_req *tch_mode_req = + (struct l1ctl_tch_mode_req *)l1h->data; + uint8_t tch_mode = tch_mode_req->tch_mode; + uint8_t audio_mode = tch_mode_req->audio_mode; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", + tch_mode, audio_mode); +// tch_mode = l1a_tch_mode_set(tch_mode); +// audio_mode = l1a_audio_mode_set(audio_mode); +// +// audio_set_enabled(tch_mode, audio_mode); +// +// l1s.tch_sync = 1; /* Needed for audio to work */ +// +// l1ctl_tx_tch_mode_conf(tch_mode, audio_mode); +} + +/** + * @brief Handler for received L1CTL_NEIGH_PM_REQ from L23. + * + * -- neighbor power measurement request -- + * + * @param [in] msg the received message. + * + * Update the maintained list of neighbor cells used in neighbor cell power measurement. + * The neighbor cell description is one of the info messages sent by the BTS on BCCH. + * This method will also enable neighbor measurement in the multiframe scheduler. + * + * Note: Not needed for virtual physical layer. + */ +void l1ctl_rx_neigh_pm_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_neigh_pm_req *pm_req = + (struct l1ctl_neigh_pm_req *)l1h->data; + + DEBUGP(DL1C, + "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", + pm_req->n); +} + +/** + * @brief Handler for received L1CTL_TRAFFIC_REQ from L23. + * + * -- traffic request -- + * + * @param [in] msg the received message. + * + * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. + * Will drop the traffic frame at queue sizes >= 4. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_traffic_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; + int num = 0; + + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + +// msg->l2h = tr->data; + +// num = l1a_txq_msgb_count(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); +// if (num >= 4) { +// DEBUGP(DL1C, "dropping traffic frame\n"); +// msgb_free(msg); +// return; +// } +// +// l1a_txq_msgb_enq(&l1s.tx_queue[L1S_CHAN_TRAFFIC], msg); +} + +/** + * @brief Handler for received L1CTL_SIM_REQ from L23. + * + * -- sim request -- + * + * @param [in] msg the received message. + * + * Forward and a sim request to the SIM APDU. + * + * Note: Not needed for virtual layer. Please configure layer23 application to use test-sim implementation. + * ms + * -------- + * sim test + * test-sim + * imsi + * ki comp128 + * -------- + */ +void l1ctl_rx_sim_req(struct msgb *msg) +{ + uint16_t len = msg->len - sizeof(struct l1ctl_hdr); + uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); + + DEBUGP(DL1C, + "Received and ignored from l23 - SIM Request length: %u, data: %s: ", + len, osmo_hexdump(data, sizeof(data))); + +} + +/*************************************************************** + * L1CTL TX ROUTINES ******************************************* + ***************************************************************/ + +/** + * @brief Transmit L1CTL_RESET_IND or L1CTL_RESET_CONF to layer 23. + * + * -- reset indication / confirm -- + * + * @param [in] msg_type L1CTL primitive message type. + * @param [in] reset_type reset type (full, boot or just scheduler reset). + */ +void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type) +{ + struct msgb *msg = l1ctl_msgb_alloc(msg_type); + struct l1ctl_reset *reset_resp; + reset_resp = (struct l1ctl_reset *)msgb_put(msg, sizeof(*reset_resp)); + reset_resp->type = reset_type; + + DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", + getL1ctlPrimName(msg_type), reset_type); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL msg of a given type to layer 23. + * + * @param [in] msg_type L1CTL primitive message type. + */ +void l1ctl_tx_msg(uint8_t msg_type) +{ + struct msgb *msg = l1ctl_msgb_alloc(msg_type); + DEBUGP(DL1C, "Sending to l23 - %s\n", getL1ctlPrimName(msg_type)); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL_FBSB_CONF to l23. + * + * -- frequency burst synchronisation burst confirm -- + * + * @param [in] res 0 -> success, 255 -> error. + * @param [in] arfcn the arfcn we are synced to. + * + * No calculation needed for virtual pyh -> uses default values for a good link quality. + */ +void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) +{ + struct msgb *msg; + struct l1ctl_fbsb_conf *resp; + uint32_t fn = 0; // 0 should be okay here + uint16_t snr = 40; // signal noise ratio > 40db is best signal. + int16_t initial_freq_err = 0; // 0 means no error. + uint8_t bsic = 0; + + msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, + snr, + arfcn); + + resp = (struct l1ctl_fbsb_conf *) msgb_put(msg, sizeof(*resp)); + resp->initial_freq_err = htons(initial_freq_err); + resp->result = res; + resp->bsic = bsic; + + DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", + getL1ctlPrimName(L1CTL_FBSB_CONF), res); + + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL_CCCH_MODE_CONF to layer 23. + * + * -- common control channel mode confirm -- + * + * @param [in] ccch_mode the new configured ccch mode. Combined or non-combined, see l1ctl_proto. + * + * Called by layer 1 to inform layer 2 that the ccch mode was successfully changed. + */ +void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode) +{ + struct msgb *msg = l1ctl_msgb_alloc(L1CTL_CCCH_MODE_CONF); + struct l1ctl_ccch_mode_conf *mode_conf; + mode_conf = (struct l1ctl_ccch_mode_conf *)msgb_put(msg, + sizeof(*mode_conf)); + mode_conf->ccch_mode = ccch_mode; + + DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", + ccch_mode); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL_TCH_MODE_CONF to layer 23. + * + * -- traffic channel mode confirm -- + * + * @param [in] tch_mode the new configured traffic channel mode, see gsm48_chan_mode in gsm_04_08.h. + * @param [in] audio_mode the new configured audio mode(s), see l1ctl_tch_mode_req in l1ctl_proto.h. + * + * Called by layer 1 to inform layer 23 that the traffic channel mode was successfully changed. + */ +void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode) +{ + struct msgb *msg = l1ctl_msgb_alloc(L1CTL_TCH_MODE_CONF); + struct l1ctl_tch_mode_conf *mode_conf; + mode_conf = (struct l1ctl_tch_mode_conf *)msgb_put(msg, + sizeof(*mode_conf)); + mode_conf->tch_mode = tch_mode; + mode_conf->audio_mode = audio_mode; + + DEBUGP(DL1C, + "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, + audio_mode); + l1ctl_sap_tx_to_l23(msg); +} + + diff --git a/src/host/virt_phy/src/l1ctl_sap.h b/src/host/virt_phy/src/l1ctl_sap.h new file mode 100644 index 0000000..2d67128 --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sap.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include + +#include "l1ctl_sock.h" +#include "virtual_um.h" +#include "virt_l1_model.h" + +/* following sizes are used for message allocation */ +/* size of layer 3 header */ +#define L3_MSG_HEAD 4 +/* size of layer 3 payload */ +#define L3_MSG_DATA 200 +#define L3_MSG_SIZE (sizeof(struct l1ctl_hdr) + L3_MSG_HEAD + L3_MSG_DATA) + +void l1ctl_sap_init(struct l1_model_ms *model); +void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); +void l1ctl_sap_tx_to_l23(struct msgb *msg); +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg); +void l1ctl_sap_rx_from_l23(struct msgb *msg); +void l1ctl_sap_handler(struct msgb *msg); + +/* utility methods */ +struct msgb *l1ctl_msgb_alloc(uint8_t msg_type); +struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, + uint16_t arfcn); + +/* receive routines */ +void l1ctl_rx_fbsb_req(struct msgb *msg); +void l1ctl_rx_dm_est_req(struct msgb *msg); +void l1ctl_rx_dm_rel_req(struct msgb *msg); +void l1ctl_rx_param_req(struct msgb *msg); +void l1ctl_rx_dm_freq_req(struct msgb *msg); +void l1ctl_rx_crypto_req(struct msgb *msg); +void l1ctl_rx_rach_req(struct msgb *msg); +void l1ctl_rx_data_req(struct msgb *msg); +void l1ctl_rx_pm_req(struct msgb *msg); +void l1ctl_rx_reset_req(struct msgb *msg); +void l1ctl_rx_ccch_mode_req(struct msgb *msg); +void l1ctl_rx_tch_mode_req(struct msgb *msg); +void l1ctl_rx_neigh_pm_req(struct msgb *msg); +void l1ctl_rx_traffic_req(struct msgb *msg); +void l1ctl_rx_sim_req(struct msgb *msg); + +/* transmit routines */ +void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type); +void l1ctl_tx_pm_conf(struct l1ctl_pm_req *pm_req); +void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn); +void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); +void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode); +void l1ctl_tx_msg(uint8_t msg_type); diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c new file mode 100644 index 0000000..e52b731 --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -0,0 +1,197 @@ +/* Socket based Layer1 <-> Layer23 communication over L1CTL primitives. */ + +/* (C) 2016 Sebastian Stumpf + * + * 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 + +#include + +#include "l1ctl_sock.h" +#include "virtual_um.h" +#include "logging.h" + +#define L1CTL_SOCK_MSGB_SIZE 256 + +/** + * @brief L1CTL socket file descriptor callback function. + * + * @param ofd The osmocom file descriptor. + * @param what Indicates if the fd has a read, write or exception request. See select.h. + * + * Will be called by osmo_select_main() if data on fd is pending. + */ +static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct l1ctl_sock_inst *lsi = ofd->data; + int cnt = 0; + // Check if request is really read request + if (what & BSC_FD_READ) { + struct msgb *msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, + "L1CTL sock rx"); + int rc; + uint16_t len; + + // read length of the message first and convert to host byte order + rc = read(ofd->fd, &len, sizeof(len)); + if (rc < sizeof(len)) { + goto ERR; + } + // convert to host byte order + len = ntohs(len); + if (len <= 0 || len > L1CTL_SOCK_MSGB_SIZE) { + goto ERR; + } + rc = read(ofd->fd, msgb_data(msg), len); + + if (rc == len) { + msgb_put(msg, rc); + msg->l1h = msgb_data(msg); + lsi->recv_cb(lsi, msg); + return 0; + } +ERR: + perror("Failed to receive msg from l2. Connection will be closed.\n"); + l1ctl_sock_disconnect(lsi); + } + return 0; + +} + +static int l1ctl_sock_accept_cb(struct osmo_fd *ofd, unsigned int what) +{ + + struct l1ctl_sock_inst *lsi = ofd->data; + struct sockaddr_un local_addr; + socklen_t addr_len = sizeof(struct sockaddr_in); + int fd; + + fd = accept(ofd->fd, (struct sockaddr *)&local_addr, &addr_len); + if (fd < 0) { + fprintf(stderr, "Failed to accept connection to l2.\n"); + return -1; + } + + lsi->connection.fd = fd; + lsi->connection.when = BSC_FD_READ; + lsi->connection.cb = l1ctl_sock_data_cb; + lsi->connection.data = lsi; + + if (osmo_fd_register(&lsi->connection) != 0) { + fprintf(stderr, "Failed to register the l2 connection fd.\n"); + return -1; + } + return 0; +} + +struct l1ctl_sock_inst *l1ctl_sock_init( + void *ctx, + void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + char *path) +{ + struct l1ctl_sock_inst *lsi; + struct sockaddr_un local_addr; + int fd, rc; + + if (!path) + path = L1CTL_SOCK_PATH; + + if ((fd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) { + fprintf(stderr, "Failed to create Unix Domain Socket.\n"); + return NULL; + } + + local_addr.sun_family = AF_LOCAL; + strcpy(local_addr.sun_path, path); + unlink(local_addr.sun_path); + + if ((rc = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) + != 0) { + fprintf(stderr, "Failed to bind the unix domain socket. '%s'\n", + local_addr.sun_path); + return NULL; + } + + if (listen(fd, 0) != 0) { + fprintf(stderr, "Failed to listen.\n"); + return NULL; + } + + lsi = talloc_zero(ctx, struct l1ctl_sock_inst); + lsi->priv = NULL; + lsi->recv_cb = recv_cb; + lsi->ofd.data = lsi; + lsi->ofd.fd = fd; + lsi->ofd.when = BSC_FD_READ; + lsi->ofd.cb = l1ctl_sock_accept_cb; + // no connection -> invalid filedescriptor and not 0 (==std_in) + lsi->connection.fd = -1; + + osmo_fd_register(&lsi->ofd); + + return lsi; +} + +void l1ctl_sock_destroy(struct l1ctl_sock_inst *lsi) +{ + struct osmo_fd *ofd = &lsi->ofd; + + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; + + talloc_free(lsi); +} + +void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi) +{ + struct osmo_fd *ofd = &lsi->connection; + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; +} + +int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg) +{ + int rc; + rc = write(lsi->connection.fd, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + return rc; +} diff --git a/src/host/virt_phy/src/l1ctl_sock.h b/src/host/virt_phy/src/l1ctl_sock.h new file mode 100644 index 0000000..ef9799c --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sock.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include + +#define L1CTL_SOCK_PATH "/tmp/osmocom_l2" + +/* L1CTL socket instance contains socket data. */ +struct l1ctl_sock_inst { + void *priv; /* Will be appended after osmo-fd's data pointer. */ + struct osmo_fd connection; /* L1CTL connection to l2 app */ + struct osmo_fd ofd; /* Osmocom file descriptor to accept L1CTL connections. */ + void (*recv_cb)(struct l1ctl_sock_inst *vui, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ +}; + +/** + * @brief Initialise the l1ctl socket for communication with l2 apps. + */ +struct l1ctl_sock_inst *l1ctl_sock_init( + void *ctx, + void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + char *path); + +/** + * @brief Transmit message to l2. + */ +int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg); + +/** + * @brief Destroy instance. + */ +void l1ctl_sock_destroy(); + +/** + * @brief Disconnect current connection. + */ +void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi); diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c new file mode 100644 index 0000000..a017a52 --- /dev/null +++ b/src/host/virt_phy/src/logging.c @@ -0,0 +1,113 @@ +/* Logging/Debug support of the virtual physical layer */ + +/* (C) 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 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 "logging.h" + +const char* l1ctlPrimNames[] = { + "_L1CTL_NONE", + "L1CTL_FBSB_REQ", + "L1CTL_FBSB_CONF", + "L1CTL_DATA_IND", + "L1CTL_RACH_REQ", + "L1CTL_DM_EST_REQ", + "L1CTL_DATA_REQ", + "L1CTL_RESET_IND", + "L1CTL_PM_REQ", + "L1CTL_PM_CONF", + "L1CTL_ECHO_REQ", + "L1CTL_ECHO_CONF", + "L1CTL_RACH_CONF", + "L1CTL_RESET_REQ", + "L1CTL_RESET_CONF", + "L1CTL_DATA_CONF", + "L1CTL_CCCH_MODE_REQ", + "L1CTL_CCCH_MODE_CONF", + "L1CTL_DM_REL_REQ", + "L1CTL_PARAM_REQ", + "L1CTL_DM_FREQ_REQ", + "L1CTL_CRYPTO_REQ", + "L1CTL_SIM_REQ", + "L1CTL_SIM_CONF", + "L1CTL_TCH_MODE_REQ", + "L1CTL_TCH_MODE_CONF", + "L1CTL_NEIGH_PM_REQ", + "L1CTL_NEIGH_PM_IND", + "L1CTL_TRAFFIC_REQ", + "L1CTL_TRAFFIC_CONF", + "L1CTL_TRAFFIC_IND" +}; + +static const struct log_info_cat default_categories[] = { + [DL1C] = { + .name = "DL1C", + .description = "Layer 1 Control", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + }, + [DVIRPHY] = { + .name = "DVIRPHY", + .description = "Virtual Layer 1 Interface", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + } +}; + +const struct log_info ms_log_info = { + .filter_fn = NULL, + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +/** + * Initialize the logging system for the virtual physical layer. + */ +int ms_log_init(char *cat_mask) { + struct log_target *stderr_target; + + log_init(&ms_log_info, NULL); + stderr_target = log_target_create_stderr(); + if(!stderr) { + return -1; + } + log_add_target(stderr_target); + log_set_all_filter(stderr_target, 1); + //log_set_log_level(stderr_target, 1); + log_set_print_filename(stderr_target, 0); + log_set_use_color(stderr_target, 0); + log_set_print_timestamp(stderr_target, 1); + log_set_print_category(stderr_target, 1); + if(cat_mask) { + log_parse_category_mask(stderr_target, cat_mask); + } + return 0; +} + +char *getL1ctlPrimName(uint8_t type) +{ + return l1ctlPrimNames[type]; +} diff --git a/src/host/virt_phy/src/logging.h b/src/host/virt_phy/src/logging.h new file mode 100644 index 0000000..87f12f7 --- /dev/null +++ b/src/host/virt_phy/src/logging.h @@ -0,0 +1,11 @@ +#pragma once + +#include + +#define DL1C 0 +#define DVIRPHY 1 + +extern const struct log_info ms_log_info; + +int ms_log_init(char *cat_mask); +char *getL1ctlPrimName(uint8_t type); diff --git a/src/host/virt_phy/src/osmo_mcast_sock.c b/src/host/virt_phy/src/osmo_mcast_sock.c new file mode 100644 index 0000000..c177734 --- /dev/null +++ b/src/host/virt_phy/src/osmo_mcast_sock.c @@ -0,0 +1,192 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "osmo_mcast_sock.h" + +struct mcast_server_sock *mcast_server_sock_setup(void *ctx, + char* tx_mcast_group, + int tx_mcast_port, + int loopback) +{ + struct mcast_server_sock *serv_sock = talloc_zero(ctx, + struct mcast_server_sock); + + serv_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); + serv_sock->sock_conf = talloc_zero(ctx, struct sockaddr_in); + + // setup mcast server socket + serv_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (serv_sock->osmo_fd->fd == -1) { + perror("Failed to create Multicast Server Socket"); + return NULL; + } + + serv_sock->sock_conf->sin_family = AF_INET; + serv_sock->sock_conf->sin_addr.s_addr = inet_addr(tx_mcast_group); + serv_sock->sock_conf->sin_port = htons(tx_mcast_port); + + // determines whether sent mcast packets should be looped back to the local sockets. + // loopback must be enabled if the mcast client is on the same machine + if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, + IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0) { + perror("Failed to disable loopback.\n"); + return NULL; + } + + return serv_sock; +} + +struct mcast_client_sock *mcast_client_sock_setup( + void *ctx, char* mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_client_sock *client_sock = talloc_zero(ctx, + struct mcast_client_sock); + struct sockaddr_in *rx_sock_conf = talloc_zero(NULL, + struct sockaddr_in); + int rc, reuseaddr = 1, loopback = 1; + + client_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); + client_sock->mcast_group = talloc_zero(ctx, struct ip_mreq); + + // Create mcast client socket + client_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (client_sock->osmo_fd->fd == -1) { + perror("Could not create mcast client socket"); + return NULL; + } + + // Enable SO_REUSEADDR to allow multiple instances of this application to receive copies of the multicast datagrams. + rc = setsockopt(client_sock->osmo_fd->fd, + SOL_SOCKET, + SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr)); + if (rc < 0) { + perror("Failed to configure REUSEADDR option"); + return NULL; + } + + // Bind to the proper port number with the IP address specified as INADDR_ANY. + rx_sock_conf->sin_family = AF_INET; + rx_sock_conf->sin_addr.s_addr = htonl(INADDR_ANY); + rx_sock_conf->sin_port = htons(mcast_port); + rc = bind(client_sock->osmo_fd->fd, (struct sockaddr *)rx_sock_conf, + sizeof(*rx_sock_conf)); + talloc_free(rx_sock_conf); + if (rc < 0) { + perror("Could not bind mcast client socket"); + return NULL; + } + + // Enable loopback of msgs to the host. + // Loopback must be enabled for the client, so multiple processes are able to recevie a mcast package. + rc = setsockopt(client_sock->osmo_fd->fd, + IPPROTO_IP, + IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); + if (rc < 0) { + perror("Failed to enable IP_MULTICAST_LOOP"); + return NULL; + } + + // Configure and join the multicast group + client_sock->mcast_group->imr_multiaddr.s_addr = inet_addr(mcast_group); + client_sock->mcast_group->imr_interface.s_addr = htonl(INADDR_ANY); + rc = setsockopt(client_sock->osmo_fd->fd, + IPPROTO_IP, + IP_ADD_MEMBERSHIP, client_sock->mcast_group, + sizeof(*client_sock->mcast_group)); + if (rc < 0) { + perror("Failed to join to mcast goup"); + return NULL; + } + + // configure and register the osmocom filedescriptor + client_sock->osmo_fd->cb = fd_rx_cb; + client_sock->osmo_fd->when = BSC_FD_READ; + client_sock->osmo_fd->data = osmo_fd_data; + + osmo_fd_register(client_sock->osmo_fd); + + return client_sock; +} + +struct mcast_bidir_sock *mcast_bidir_sock_setup( + void *ctx, char* tx_mcast_group, int tx_mcast_port, + char* rx_mcast_group, int rx_mcast_port, int loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_bidir_sock *bidir_sock = talloc(ctx, + struct mcast_bidir_sock); + bidir_sock->rx_sock = mcast_client_sock_setup(ctx, rx_mcast_group, + rx_mcast_port, fd_rx_cb, osmo_fd_data); + bidir_sock->tx_sock = mcast_server_sock_setup(ctx, tx_mcast_group, + tx_mcast_port, loopback); + if (!bidir_sock->rx_sock || !bidir_sock->tx_sock) { + return NULL; + } + return bidir_sock; + +} + +int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, + int buf_len) +{ + return recv(client_sock->osmo_fd->fd, buf, buf_len, 0); +} + +int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, + int data_len) +{ + return sendto(serv_sock->osmo_fd->fd, data, data_len, 0, + (struct sockaddr *)serv_sock->sock_conf, + sizeof(*serv_sock->sock_conf)); +} + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, + int data_len) +{ + return mcast_server_sock_tx(bidir_sock->tx_sock, data, data_len); +} +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, + int buf_len) +{ + return mcast_client_sock_rx(bidir_sock->rx_sock, buf, buf_len); +} + +void mcast_client_sock_close(struct mcast_client_sock *client_sock) +{ + setsockopt(client_sock->osmo_fd->fd, + IPPROTO_IP, + IP_DROP_MEMBERSHIP, client_sock->mcast_group, + sizeof(*client_sock->mcast_group)); + osmo_fd_unregister(client_sock->osmo_fd); + client_sock->osmo_fd->fd = -1; + client_sock->osmo_fd->when = 0; + close(client_sock->osmo_fd->fd); + talloc_free(client_sock->mcast_group); + talloc_free(client_sock->osmo_fd); + talloc_free(client_sock); + +} +void mcast_server_sock_close(struct mcast_server_sock *serv_sock) +{ + close(serv_sock->osmo_fd->fd); + talloc_free(serv_sock->sock_conf); + talloc_free(serv_sock); +} + +void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) +{ + mcast_client_sock_close(bidir_sock->rx_sock); + mcast_server_sock_close(bidir_sock->tx_sock); + talloc_free(bidir_sock); +} diff --git a/src/host/virt_phy/src/osmo_mcast_sock.h b/src/host/virt_phy/src/osmo_mcast_sock.h new file mode 100644 index 0000000..f318ffe --- /dev/null +++ b/src/host/virt_phy/src/osmo_mcast_sock.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include + +struct mcast_server_sock { + struct osmo_fd *osmo_fd; + struct sockaddr_in *sock_conf; +}; + +struct mcast_client_sock { + struct osmo_fd *osmo_fd; + struct ip_mreq *mcast_group; +}; + +struct mcast_bidir_sock { + struct mcast_server_sock *tx_sock; + struct mcast_client_sock *rx_sock; +}; + +struct mcast_bidir_sock *mcast_bidir_sock_setup( + void *ctx, char* tx_mcast_group, int tx_mcast_port, + char* rx_mcast_group, int rx_mcast_port, int loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +struct mcast_server_sock *mcast_server_sock_setup(void *ctx, + char* tx_mcast_group, + int tx_mcast_port, + int loopback); +struct mcast_client_sock *mcast_client_sock_setup( + void *ctx, char* mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); +int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, + int buf_len); +int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, + int data_len); +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, + int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, + int buf_len); +void mcast_client_sock_close(struct mcast_client_sock* client_sock); +void mcast_server_sock_close(struct mcast_server_sock* server_sock); +void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); + diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c new file mode 100644 index 0000000..f2e1690 --- /dev/null +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -0,0 +1,16 @@ +#include "virt_l1_model.h" + +struct l1_model_ms* l1_model_ms_init(void *ctx) { + + struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); + model->state = talloc_zero(ctx, struct l1_state_ms); + + return model; +} + +void l1_model_ms_destroy(struct l1_model_ms *model) { + virt_um_destroy(model->vui); + l1ctl_sock_destroy(model->lsi); + talloc_free(model->state); + talloc_free(model); +} diff --git a/src/host/virt_phy/src/virt_l1_model.h b/src/host/virt_phy/src/virt_l1_model.h new file mode 100644 index 0000000..55a1e3a --- /dev/null +++ b/src/host/virt_phy/src/virt_l1_model.h @@ -0,0 +1,31 @@ +#pragma once + +#include +#include "l1ctl_sock.h" +#include "virtual_um.h" + +struct l1_model_ms { + struct l1ctl_sock_inst *lsi; + struct virt_um_inst *vui; + struct l1_state_ms *state; +}; + +//TODO: must contain logical channel information (fram number, ciphering mode, ...) +struct l1_state_ms { + + /* the cell on which we are camping right now */ + struct l1_cell_info serving_cell; + + /* neighbor cell sync info */ + struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; + + /* TCH */ + uint8_t tch_mode; + uint8_t tch_sync; + uint8_t audio_mode; +}; + +struct l1_model_ms *l1_model_ms_init(void *ctx); + +void l1_model_ms_destroy(struct l1_model_ms *model); + diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c new file mode 100644 index 0000000..94f6fa5 --- /dev/null +++ b/src/host/virt_phy/src/virtphy.c @@ -0,0 +1,50 @@ +/* osmocom includes */ + +#include "logging.h" +#include +#include +#include +#include +#include +#include +#include + +#include "virtual_um.h" +#include "l1ctl_sock.h" +#include "virt_l1_model.h" +#include "gsmtapl1_if.h" +#include "l1ctl_sap.h" + +int main(void) +{ + + // init loginfo + static struct l1_model_ms *model; + ms_log_init("DL1C,1:DVIRPHY,1"); + //ms_log_init("DL1C,8:DVIRPHY,8"); + + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); + + model = l1_model_ms_init(NULL); + + // TODO: make this configurable + model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); + model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, NULL); + + gsmtapl1_init(model); + l1ctl_sap_init(model); + + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n"); + + while (1) { + // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) + osmo_select_main(0); + // handle outgoing l1ctl primitives to l2 + // TODO implement scheduler for uplink messages + } + + l1_model_ms_destroy(model); + + // not reached + return EXIT_FAILURE; +} diff --git a/src/host/virt_phy/src/virtual_um.c b/src/host/virt_phy/src/virtual_um.c new file mode 100644 index 0000000..2b15509 --- /dev/null +++ b/src/host/virt_phy/src/virtual_um.c @@ -0,0 +1,100 @@ +/* Routines for a Virtual Um interface over GSMTAP/UDP */ + +/* (C) 2015 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 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 "virtual_um.h" +#include "osmo_mcast_sock.h" + +/** + * Virtual UM interface file descriptor callback. + * Should be called by select.c when the fd is ready for reading. + */ +static int virt_um_fd_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct virt_um_inst *vui = ofd->data; + + // check if the read flag is set + if (what & BSC_FD_READ) { + // allocate message buffer of specified size + struct msgb *msg = msgb_alloc(VIRT_UM_MSGB_SIZE, + "Virtual UM Rx"); + int rc; + + // read message from fd in message buffer + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + // rc is number of bytes actually read + if (rc > 0) { + msgb_put(msg, rc); + // call the l1 callback function for a received msg + vui->recv_cb(vui, msg); + } else { + // TODO: this kind of error handling might be a bit harsh + vui->recv_cb(vui, NULL); + // Unregister fd from select loop + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; + } + } + + return 0; +} + +struct virt_um_inst *virt_um_init( + void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) +{ + + struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, + rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->recv_cb = recv_cb; + + return vui; + +} + +void virt_um_destroy(struct virt_um_inst *vui) +{ + mcast_bidir_sock_close(vui->mcast_sock); + talloc_free(vui); +} + +/** + * Write msg to to multicast socket and free msg afterwards + */ +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg) +{ + int rc; + + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + + return rc; +} diff --git a/src/host/virt_phy/src/virtual_um.h b/src/host/virt_phy/src/virtual_um.h new file mode 100644 index 0000000..eafb994 --- /dev/null +++ b/src/host/virt_phy/src/virtual_um.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include "osmo_mcast_sock.h" + +#define VIRT_UM_MSGB_SIZE 256 +#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_PORT 6666 +#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_PORT 6667 + +struct virt_um_inst { + void *priv; + struct mcast_bidir_sock *mcast_sock; + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); +}; + +struct virt_um_inst *virt_um_init(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, const char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); + +void virt_um_destroy(struct virt_um_inst *vui); + +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg); -- To view, visit https://gerrit.osmocom.org/3197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I203c8ec58326e52a09603a37232fce7ae3641415 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:45 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Implemented RACH on uplink. Message-ID: Review at https://gerrit.osmocom.org/3198 VIRT-PHY: Implemented RACH on uplink. RACH will now be transmitted over GSMTAP virtual UM interface if L1CTL command is received. Minor further changes: - Incoming messages are now only then forwarded if ms is synced to a cell (fbsb cmd from l1ctl received). - SDCCH/4/8 are forwarded to l23 for now as we don't use encoding/ciphering (yet) this should not be a problem. Change-Id: Ic15188c5c0bba96c223d689be733324a9778a2e8 --- M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/gsmtapl1_if.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sap.h M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/virt_l1_model.h 7 files changed, 160 insertions(+), 111 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/98/3198/1 diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index a110435..2dac297 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -8,6 +8,7 @@ # TODO: somehow this include path causes errors, thus the needed files are copied into $(top_srcdir)/include. Would be better to include directly from $(OSMO_BB_DIR)/src/target/firmware/include to avoid redundancy. # -I$(OSMO_BB_DIR)/src/target/firmware/include +# disable optimization and enable debugging CFLAGS = -g -O0 sbin_PROGRAMS = virtphy diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 11214cf..53cc952 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -89,28 +89,23 @@ } /** - * Append a gsmtap header to msg and send it over the virt um. + * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg) { - struct l1ctl_hdr *l1hdr = (struct l1ctl_hdr *)msg->l1h; - struct l1ctl_info_dl *l1dl = (struct l1ctl_info_dl *)msg->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; uint8_t ss = 0; - uint8_t gsmtap_chan; + uint8_t *data = msgb_l2(msg); // data bits to transmit (whole message without l1 header) + uint8_t data_len = msgb_l2len(msg); struct msgb *outmsg; - switch (l1hdr->msg_type) { - case L1CTL_DATA_REQ: - // TODO: check what data request and set gsmtap_chan depending on that - gsmtap_chan = 0; - break; - } - outmsg = gsmtap_makemsg(l1dl->band_arfcn, l1dl->chan_nr, gsmtap_chan, - ss, l1dl->frame_nr, 0, 0, msgb_l2(msg), - msgb_l2len(msg)); + outmsg = gsmtap_makemsg(l1_model_ms->state->serving_cell.arfcn, ul->chan_nr, gsmtap_chan, + ss, fn, 0, 0, data, + data_len); if (outmsg) { - struct gsmtap_hdr *gh = (struct gsmtap_hdr *)outmsg->l1h; - virt_um_write_msg(vui, outmsg); + struct gsmtap_hdr *gh = msgb_data(msg); + virt_um_write_msg(l1_model_ms->vui, outmsg); DEBUGP(DVIRPHY, "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, @@ -124,11 +119,11 @@ } /** - * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, struct msgb *msg). + * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg). */ -void gsmtapl1_tx_to_virt_um(struct msgb *msg) +void gsmtapl1_tx_to_virt_um(uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, msg); + gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, tn, fn, gsmtap_chan, msg); } /* This is the header as it is used by gsmtap peer virtual layer 1. @@ -155,77 +150,77 @@ struct msgb *msg) { if (msg) { - struct gsmtap_hdr *gh; - struct l1ctl_info_dl *l1dl; - struct msgb *l1ctl_msg = NULL; - struct l1ctl_data_ind * l1di; + // we assume we only receive msgs if we actually camp on a cell + if (l1_model_ms->state->camping) { + struct gsmtap_hdr *gh; + struct l1ctl_info_dl *l1dl; + struct msgb *l1ctl_msg = NULL; + struct l1ctl_data_ind * l1di; - msg->l1h = msgb_data(msg); - msg->l2h = msgb_pull(msg, sizeof(*gh)); - gh = msgb_l1(msg); + msg->l1h = msgb_data(msg); + msg->l2h = msgb_pull(msg, sizeof(*gh)); + gh = msgb_l1(msg); - DEBUGP(DVIRPHY, - "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u)\n", - ntohs(gh->arfcn), ntohl(gh->frame_number), get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gh->sub_type), gh->timeslot, - gh->sub_slot); + DEBUGP(DVIRPHY, + "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u)\n", + ntohs(gh->arfcn), ntohl(gh->frame_number), get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gh->sub_type), gh->timeslot, + gh->sub_slot); - // compose the l1ctl message for layer 2 - switch (gh->sub_type) { - case GSMTAP_CHANNEL_RACH: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); - break; - case GSMTAP_CHANNEL_SDCCH: - case GSMTAP_CHANNEL_SDCCH4: - case GSMTAP_CHANNEL_SDCCH8: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); - // TODO: implement channel handling - break; - case GSMTAP_CHANNEL_TCH_F: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); - // TODO: implement channel handling - break; - case GSMTAP_CHANNEL_AGCH: - case GSMTAP_CHANNEL_PCH: - case GSMTAP_CHANNEL_BCCH: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); - l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); - l1di = (struct l1ctl_data_ind *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_data_ind)); + // compose the l1ctl message for layer 2 + switch (gh->sub_type) { + case GSMTAP_CHANNEL_RACH: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + break; + case GSMTAP_CHANNEL_TCH_F: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); + // TODO: implement channel handling + break; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + // TODO: we might need to implement own channel handling for standalone dedicated channels + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); + l1di = (struct l1ctl_data_ind *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_data_ind)); - l1dl->band_arfcn = htons(ntohs(gh->arfcn)); - l1dl->link_id = gh->timeslot; - // see GSM 8.58 -> 9.3.1 for channel number encoding - l1dl->chan_nr = rsl_enc_chan_nr(chantype_gsmtap2rsl(gh->sub_type), gh->sub_slot, gh->timeslot); - l1dl->frame_nr = htonl(ntohl(gh->frame_number)); - l1dl->snr = gh->snr_db; - l1dl->rx_level = gh->signal_dbm; - l1dl->num_biterr = 0; - l1dl->fire_crc = 0; + l1dl->band_arfcn = htons(ntohs(gh->arfcn)); + l1dl->link_id = gh->timeslot; + // see GSM 8.58 -> 9.3.1 for channel number encoding + l1dl->chan_nr = rsl_enc_chan_nr(chantype_gsmtap2rsl(gh->sub_type), gh->sub_slot, gh->timeslot); + l1dl->frame_nr = htonl(ntohl(gh->frame_number)); + l1dl->snr = gh->snr_db; + l1dl->rx_level = gh->signal_dbm; + l1dl->num_biterr = 0; + l1dl->fire_crc = 0; - memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); + memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - break; - case GSMTAP_CHANNEL_CCCH: - case GSMTAP_CHANNEL_TCH_H: - case GSMTAP_CHANNEL_PACCH: - case GSMTAP_CHANNEL_PDCH: - case GSMTAP_CHANNEL_PTCCH: - case GSMTAP_CHANNEL_CBCH51: - case GSMTAP_CHANNEL_CBCH52: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type not supported!\n"); - break; - default: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type unknown.\n"); - break; + break; + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_TCH_H: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + break; + default: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + break; + } + + /* forward l1ctl message to l2 */ + if(l1ctl_msg) { + l1ctl_sap_tx_to_l23(l1ctl_msg); + } } - - /* forward l1ctl message to l2 */ - if(l1ctl_msg) { - l1ctl_sap_tx_to_l23(l1ctl_msg); - } - // handle memory deallocation talloc_free(msg); } @@ -240,9 +235,8 @@ } /*! \brief convert GSMTAP channel type to RSL channel number - * \param[in] rsl_chantype RSL channel type - * \param[in] link_id RSL link identifier - * \returns GSMTAP channel type + * \param[in] gsmtap_chantype GSMTAP channel type + * \returns RSL channel type */ uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype) { diff --git a/src/host/virt_phy/src/gsmtapl1_if.h b/src/host/virt_phy/src/gsmtapl1_if.h index 8c7491c..09d34f4 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.h +++ b/src/host/virt_phy/src/gsmtapl1_if.h @@ -12,7 +12,7 @@ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); void gsmtapl1_rx_from_virt_um(struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_tx_to_virt_um(struct msgb *msg); +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg); +void gsmtapl1_tx_to_virt_um(uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg); uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 46121ed..b5fb0f0 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -12,6 +13,7 @@ #include "virt_l1_model.h" #include "l1ctl_sap.h" #include "logging.h" +#include "gsmtapl1_if.h" static struct l1_model_ms *l1_model_ms = NULL; @@ -30,6 +32,7 @@ */ void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) { + // check if the received msg is not empty if (msg) { DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); @@ -177,6 +180,8 @@ break; case L1CTL_RACH_REQ: l1ctl_rx_rach_req(msg); + // msg is freed by rx routine + goto exit_nofree; break; case L1CTL_DATA_REQ: l1ctl_rx_data_req(msg); @@ -232,11 +237,18 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); - l1ctl_tx_fbsb_conf(0, ntohs(sync_req->band_arfcn)); + l1_model_ms->state->camping = 1; + l1_model_ms->state->serving_cell.arfcn = ntohs(sync_req->band_arfcn); + l1_model_ms->state->serving_cell.ccch_mode = sync_req->ccch_mode; + l1_model_ms->state->serving_cell.fn_offset = 0; + l1_model_ms->state->serving_cell.bsic = 0; + l1_model_ms->state->serving_cell.time_alignment = 0; + // TODO: reset and synchronize the ms uplink schedulers with bts multiframe structure. + + l1ctl_tx_fbsb_conf(0, l1_model_ms->state->serving_cell.arfcn); } /** @@ -418,16 +430,37 @@ */ void l1ctl_rx_rach_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; + + uint32_t fn_sched; + uint8_t ts; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", rach_req->ra, ntohs(rach_req->offset), rach_req->combined); -// l1a_rach_req(ntohs(rach_req->offset), rach_req->combined, + // TODO: calculate correct fn/ts for a RACH (if needed by bts) + // TODO: implement scheduler for uplink! + fn_sched = 42; + ts = 0; + // for the rach channel request, there is no layer2 header, but only the one bit ra content to submit + // see 4.18-9.1.8 CHannel Request + // that means we have to set l2h of msgb to the ra content + msg->l2h = &rach_req->ra; + // avoid all data after ra to also be submitted + msgb_trim(msg, sizeof(rach_req->ra)); + // TODO: check if we need to submit more data than the ra content to the bts + + // send rach over virt um + gsmtapl1_tx_to_virt_um(ts, fn_sched, GSMTAP_CHANNEL_RACH, msg); + + // send confirm to layer23 + l1ctl_tx_rach_conf(fn_sched, l1_model_ms->state->serving_cell.arfcn); + +// l1a_rach_req(ntohs(rach_req->offset), rach_req->combined, // rach_req->ra); } @@ -481,7 +514,9 @@ * * Process power measurement for a given range of arfcns to calculate signal power and connection quality. * - * Note: We do not need to calculate that for the virtual physical layer, but l23 apps can expect a response. So this response is mocked here. + * Note: We do not need to calculate that for the virtual physical layer, + * but l23 apps can expect a response. So this response is mocked here. + * TODO: Might be possible to sync to different virtual BTS. Mapping from arfcn to mcast address would be needed. Configurable rx_lev for each mcast address. */ void l1ctl_rx_pm_req(struct msgb *msg) { @@ -499,11 +534,11 @@ for(arfcn_next = pm_req->range.band_arfcn_from; arfcn_next <= pm_req->range.band_arfcn_to; ++arfcn_next) { struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *)msgb_put(resp_msg, sizeof(*pm_conf)); pm_conf->band_arfcn = htons(arfcn_next); - // rxlev 63 is great, 0 is bad the two values are probably min and max + // rxlev 63 is great, 0 is bad the two values are min and max pm_conf->pm[0] = 63; pm_conf->pm[1] = 63; if(arfcn_next == pm_req->range.band_arfcn_to) { - struct l1ctl_hdr *resp_l1h = resp_msg->l1h; + struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; } // no more space in msgb, flush to l2 @@ -526,6 +561,10 @@ * * Reset layer 1 (state machine, scheduler, transceiver) depending on the reset type. * + * Note: Currently we do not perform anything else than response with a reset confirm + * to just tell l2 that we are rdy. + * TODO: Validate if an action has to be done here. + * */ void l1ctl_rx_reset_req(struct msgb *msg) { @@ -534,22 +573,16 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); -// l1s_reset(); -// l1s_reset_hw(); -// audio_set_enabled(GSM48_CMODE_SIGN, 0); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + l1_model_ms->state->camping = 0; l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); -// sched_gsmtime_reset(); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; default: - LOGP(DL1C, LOGL_ERROR, - "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); break; } } @@ -738,6 +771,23 @@ } /** + * @brief Transmit L1CTL_RESET_IND or L1CTL_RESET_CONF to layer 23. + * + * -- reset indication / confirm -- + * + * @param [in] msg_type L1CTL primitive message type. + * @param [in] reset_type reset type (full, boot or just scheduler reset). + */ +void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn) +{ + struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); + + DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", + getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); + l1ctl_sap_tx_to_l23(msg); +} + +/** * @brief Transmit L1CTL msg of a given type to layer 23. * * @param [in] msg_type L1CTL primitive message type. diff --git a/src/host/virt_phy/src/l1ctl_sap.h b/src/host/virt_phy/src/l1ctl_sap.h index 2d67128..f540197 100644 --- a/src/host/virt_phy/src/l1ctl_sap.h +++ b/src/host/virt_phy/src/l1ctl_sap.h @@ -46,6 +46,7 @@ /* transmit routines */ void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type); +void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn); void l1ctl_tx_pm_conf(struct l1ctl_pm_req *pm_req); void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn); void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index e52b731..b507369 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -42,6 +42,8 @@ #include +#include + #include "l1ctl_sock.h" #include "virtual_um.h" #include "logging.h" @@ -59,14 +61,13 @@ static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what) { struct l1ctl_sock_inst *lsi = ofd->data; - int cnt = 0; // Check if request is really read request if (what & BSC_FD_READ) { struct msgb *msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, "L1CTL sock rx"); int rc; uint16_t len; - + struct l1ctl_hdr *l1h; // read length of the message first and convert to host byte order rc = read(ofd->fd, &len, sizeof(len)); if (rc < sizeof(len)) { @@ -81,7 +82,8 @@ if (rc == len) { msgb_put(msg, rc); - msg->l1h = msgb_data(msg); + l1h = msgb_data(msg); + msg->l1h = l1h; lsi->recv_cb(lsi, msg); return 0; } diff --git a/src/host/virt_phy/src/virt_l1_model.h b/src/host/virt_phy/src/virt_l1_model.h index 55a1e3a..f0619ab 100644 --- a/src/host/virt_phy/src/virt_l1_model.h +++ b/src/host/virt_phy/src/virt_l1_model.h @@ -13,6 +13,7 @@ //TODO: must contain logical channel information (fram number, ciphering mode, ...) struct l1_state_ms { + uint8_t camping; /* the cell on which we are camping right now */ struct l1_cell_info serving_cell; -- To view, visit https://gerrit.osmocom.org/3198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic15188c5c0bba96c223d689be733324a9778a2e8 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:45 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT_PHY: Improved l1ctl-to-l23 interface + gsmtap header pa... Message-ID: Review at https://gerrit.osmocom.org/3199 VIRT_PHY: Improved l1ctl-to-l23 interface + gsmtap header parsing. Fixed mapping from gsmtap msg type to rsl msg type and vice versa. Proper chan_nr decoding instead of usage of dummy values for timeslot / link_id / subslot. Implemented missing l23 rx handler routines. Change-Id: Ibad741d112643c55091b8ba00164b05d728ae1a1 --- M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/gsmtapl1_if.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sap.h M src/host/virt_phy/src/virt_l1_model.h M src/host/virt_phy/src/virtphy.c M src/host/virt_phy/src/virtual_um.c 7 files changed, 433 insertions(+), 342 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/99/3199/1 diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 53cc952..d46bb2f 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -91,25 +91,43 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint32_t fn, + struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - uint8_t ss = 0; - uint8_t *data = msgb_l2(msg); // data bits to transmit (whole message without l1 header) - uint8_t data_len = msgb_l2len(msg); - struct msgb *outmsg; + struct gsmtap_hdr *gh; + struct msgb *outmsg; // msg to send with gsmtap header prepended + uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; // arfcn of the cell we currently camp on + uint8_t signal_dbm = 63; // signal strength, 63 is best + uint8_t snr = 63; // signal noise ratio, 63 is best + uint8_t *data = msgb_l2(msg); // data to transmit (whole message without l1 header) + uint8_t data_len = msgb_l2len(msg); // length of data - outmsg = gsmtap_makemsg(l1_model_ms->state->serving_cell.arfcn, ul->chan_nr, gsmtap_chan, - ss, fn, 0, 0, data, - data_len); + uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) + uint8_t subslot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) + uint8_t timeslot; // tdma timeslot to send in (0-7) + uint8_t gsmtap_chan; // the gsmtap channel + + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); + + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chan, subslot, fn, + signal_dbm, snr, data, data_len); if (outmsg) { - struct gsmtap_hdr *gh = msgb_data(msg); - virt_um_write_msg(l1_model_ms->vui, outmsg); - DEBUGP(DVIRPHY, - "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, gh->timeslot, - gh->sub_slot); + outmsg->l1h = msgb_data(outmsg); + gh = msgb_l1(outmsg); + if (virt_um_write_msg(l1_model_ms->vui, outmsg) == -1) { + LOGP(DVIRPHY, LOGL_ERROR, + "Gsmtap msg could not send to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, + gh->timeslot, gh->sub_slot); + } else { + DEBUGP(DVIRPHY, + "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, + gh->timeslot, gh->sub_slot); + } } else { LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); } @@ -119,29 +137,12 @@ } /** - * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg). + * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint32_t fn, struct msgb *msg). */ -void gsmtapl1_tx_to_virt_um(uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg) +void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, tn, fn, gsmtap_chan, msg); + gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, fn, msg); } - -/* This is the header as it is used by gsmtap peer virtual layer 1. -struct gsmtap_hdr { - guint8 version; // version, set to 0x01 currently - guint8 hdr_len; // length in number of 32bit words - guint8 type; // see GSMTAP_TYPE_* - guint8 timeslot; // timeslot (0..7 on Um) - guint16 arfcn; // ARFCN (frequency) - gint8 signal_dbm; // signal level in dBm - gint8 snr_db; // signal/noise ratio in dB - guint32 frame_number; // GSM Frame Number (FN) - guint8 sub_type; // Type of burst/channel, see above - guint8 antenna_nr; // Antenna Number - guint8 sub_slot; // sub-slot within timeslot - guint8 res; // reserved for future use (RFU) -} - */ /** * Receive a gsmtap message from the virt um. @@ -149,81 +150,117 @@ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg) { - if (msg) { - // we assume we only receive msgs if we actually camp on a cell - if (l1_model_ms->state->camping) { - struct gsmtap_hdr *gh; - struct l1ctl_info_dl *l1dl; - struct msgb *l1ctl_msg = NULL; - struct l1ctl_data_ind * l1di; - - msg->l1h = msgb_data(msg); - msg->l2h = msgb_pull(msg, sizeof(*gh)); - gh = msgb_l1(msg); - - DEBUGP(DVIRPHY, - "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u)\n", - ntohs(gh->arfcn), ntohl(gh->frame_number), get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gh->sub_type), gh->timeslot, - gh->sub_slot); - - // compose the l1ctl message for layer 2 - switch (gh->sub_type) { - case GSMTAP_CHANNEL_RACH: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); - break; - case GSMTAP_CHANNEL_TCH_F: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); - // TODO: implement channel handling - break; - case GSMTAP_CHANNEL_SDCCH: - case GSMTAP_CHANNEL_SDCCH4: - case GSMTAP_CHANNEL_SDCCH8: - // TODO: we might need to implement own channel handling for standalone dedicated channels - case GSMTAP_CHANNEL_AGCH: - case GSMTAP_CHANNEL_PCH: - case GSMTAP_CHANNEL_BCCH: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); - l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); - l1di = (struct l1ctl_data_ind *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_data_ind)); - - l1dl->band_arfcn = htons(ntohs(gh->arfcn)); - l1dl->link_id = gh->timeslot; - // see GSM 8.58 -> 9.3.1 for channel number encoding - l1dl->chan_nr = rsl_enc_chan_nr(chantype_gsmtap2rsl(gh->sub_type), gh->sub_slot, gh->timeslot); - l1dl->frame_nr = htonl(ntohl(gh->frame_number)); - l1dl->snr = gh->snr_db; - l1dl->rx_level = gh->signal_dbm; - l1dl->num_biterr = 0; - l1dl->fire_crc = 0; - - memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - - break; - case GSMTAP_CHANNEL_CCCH: - case GSMTAP_CHANNEL_TCH_H: - case GSMTAP_CHANNEL_PACCH: - case GSMTAP_CHANNEL_PDCH: - case GSMTAP_CHANNEL_PTCCH: - case GSMTAP_CHANNEL_CBCH51: - case GSMTAP_CHANNEL_CBCH52: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type not supported!\n"); - break; - default: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type unknown.\n"); - break; - } - - /* forward l1ctl message to l2 */ - if(l1ctl_msg) { - l1ctl_sap_tx_to_l23(l1ctl_msg); - } - } - // handle memory deallocation - talloc_free(msg); + if (!msg) { + return; } + // we assume we only receive msgs if we actually camp on a cell + if (!l1_model_ms->state->camping) { + talloc_free(msg); + return; + } + + struct gsmtap_hdr *gh = msgb_l1(msg); + struct msgb *l1ctl_msg = NULL; + struct l1ctl_info_dl *l1dl; + uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg + uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the cell we currently camp on + uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type + uint8_t signal_dbm = gh->signal_dbm; // signal strength, 63 is best + uint8_t snr = gh->snr_db; // signal noise ratio, 63 is best + uint8_t subslot = gh->sub_slot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) + uint8_t timeslot = gh->timeslot; // tdma timeslot to send in (0-7) + uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) + uint8_t link_id; // rsl link id tells if this is an ssociated or dedicated link + uint8_t chan_nr; // encoded rsl channel type, timeslot and mf subslot + + msg->l2h = msgb_pull(msg, sizeof(*gh)); + chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); + // see GSM 8.58 -> 9.3.1 for channel number encoding + chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + + DEBUGP(DVIRPHY, + "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", + arfcn, fn, get_value_string(gsmtap_types, gh->type), + get_value_string(gsmtap_channels, gsmtap_chantype), + timeslot, subslot, rsl_chantype, link_id, chan_nr); + + // switch case with removed acch flag + switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { + case GSMTAP_CHANNEL_TCH_H: + case GSMTAP_CHANNEL_TCH_F: + struct l1ctl_traffic_ind * l1ti; + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); + l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_info_dl)); + l1ti = (struct l1ctl_traffic_ind *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_traffic_ind)); + + l1dl->band_arfcn = htons(arfcn); + l1dl->link_id = link_id; + l1dl->chan_nr = chan_nr; + l1dl->frame_nr = htonl(fn); + l1dl->snr = snr; + l1dl->rx_level = signal_dbm; + l1dl->num_biterr = 0; // no biterrors + l1dl->fire_crc = 0; + + // TODO: traffic decoding and decryption + + memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); + break; + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + // TODO: we might need to implement own channel handling for standalone dedicated channels + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + struct l1ctl_data_ind * l1di; + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_info_dl)); + l1di = (struct l1ctl_data_ind *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_data_ind)); + + l1dl->band_arfcn = htons(arfcn); + l1dl->link_id = link_id; + l1dl->chan_nr = chan_nr; + l1dl->frame_nr = htonl(fn); + l1dl->snr = snr; + l1dl->rx_level = signal_dbm; + l1dl->num_biterr = 0; // no biterrors + l1dl->fire_crc = 0; // TODO: check if this means fire crc is not used or crc produced no error + + // TODO: data decoding and decryption + + memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); + + break; + case GSMTAP_CHANNEL_RACH: + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + break; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + break; + default: + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + break; + } + + /* forward l1ctl message to l2 */ + if (l1ctl_msg) { + l1ctl_sap_tx_to_l23(l1ctl_msg); + } + // handle memory deallocation + talloc_free(msg); } /** @@ -236,41 +273,77 @@ /*! \brief convert GSMTAP channel type to RSL channel number * \param[in] gsmtap_chantype GSMTAP channel type - * \returns RSL channel type + * \param[out] rsl_chantype rsl channel type + * \param[out] rsl_chantype rsl link id + * + * Mapping from gsmtap channel: + * GSMTAP_CHANNEL_UNKNOWN * 0x00 + * GSMTAP_CHANNEL_BCCH * 0x01 + * GSMTAP_CHANNEL_CCCH * 0x02 + * GSMTAP_CHANNEL_RACH * 0x03 + * GSMTAP_CHANNEL_AGCH * 0x04 + * GSMTAP_CHANNEL_PCH * 0x05 + * GSMTAP_CHANNEL_SDCCH * 0x06 + * GSMTAP_CHANNEL_SDCCH4 * 0x07 + * GSMTAP_CHANNEL_SDCCH8 * 0x08 + * GSMTAP_CHANNEL_TCH_F * 0x09 + * GSMTAP_CHANNEL_TCH_H * 0x0a + * GSMTAP_CHANNEL_PACCH * 0x0b + * GSMTAP_CHANNEL_CBCH52 * 0x0c + * GSMTAP_CHANNEL_PDCH * 0x0d + * GSMTAP_CHANNEL_PTCCH * 0x0e + * GSMTAP_CHANNEL_CBCH51 * 0x0f + * to rsl channel type: + * RSL_CHAN_NR_MASK * 0xf8 + * RSL_CHAN_NR_1 * * 0x08 + * RSL_CHAN_Bm_ACCHs * 0x08 + * RSL_CHAN_Lm_ACCHs * 0x10 + * RSL_CHAN_SDCCH4_ACCH * 0x20 + * RSL_CHAN_SDCCH8_ACCH * 0x40 + * RSL_CHAN_BCCH * * 0x80 + * RSL_CHAN_RACH * * 0x88 + * RSL_CHAN_PCH_AGCH * 0x90 + * RSL_CHAN_OSMO_PDCH * 0xc0 + * and logical channel link id: + * LID_SACCH * * 0x40 + * LID_DEDIC * * 0x00 + * + * TODO: move this to a library used by both ms and bts virt um */ -uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype) +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id) { - // TODO: proper retval for unknown channel - uint8_t ret = 0; - - switch (gsmtap_chantype) { - case GSMTAP_CHANNEL_TCH_F: - ret = RSL_CHAN_Bm_ACCHs; + // switch case with removed acch flag + switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { + case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F + *rsl_chantype = RSL_CHAN_Bm_ACCHs; break; - case GSMTAP_CHANNEL_TCH_H: - ret = RSL_CHAN_Lm_ACCHs; + case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H + *rsl_chantype = RSL_CHAN_Lm_ACCHs; break; - case GSMTAP_CHANNEL_SDCCH4: - ret = RSL_CHAN_SDCCH4_ACCH; + case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 + *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; break; - case GSMTAP_CHANNEL_SDCCH8: - ret = RSL_CHAN_SDCCH8_ACCH; + case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 + *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; break; - case GSMTAP_CHANNEL_BCCH: - ret = RSL_CHAN_BCCH; + case GSMTAP_CHANNEL_BCCH: // BCCH + *rsl_chantype = RSL_CHAN_BCCH; break; - case GSMTAP_CHANNEL_RACH: - ret = RSL_CHAN_RACH; + case GSMTAP_CHANNEL_RACH: // RACH + *rsl_chantype = RSL_CHAN_RACH; break; - case GSMTAP_CHANNEL_PCH: - case GSMTAP_CHANNEL_AGCH: - ret = RSL_CHAN_PCH_AGCH; + case GSMTAP_CHANNEL_PCH: // PCH + case GSMTAP_CHANNEL_AGCH: // AGCH + *rsl_chantype = RSL_CHAN_PCH_AGCH; + break; + case GSMTAP_CHANNEL_PDCH: + *rsl_chantype = GSMTAP_CHANNEL_PDCH; break; } - // TODO: check how to handle this... -// if (link_id & 0x40) -// ret |= GSMTAP_CHANNEL_ACCH; + *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? + LID_SACCH : + LID_DEDIC; - return ret; } diff --git a/src/host/virt_phy/src/gsmtapl1_if.h b/src/host/virt_phy/src/gsmtapl1_if.h index 09d34f4..6311e07 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.h +++ b/src/host/virt_phy/src/gsmtapl1_if.h @@ -8,11 +8,11 @@ #include "virt_l1_model.h" void gsmtapl1_init(struct l1_model_ms *model); - -void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, + struct msgb *msg); void gsmtapl1_rx_from_virt_um(struct msgb *msg); - -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg); -void gsmtapl1_tx_to_virt_um(uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg); - -uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype); +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint32_t fn, + struct msgb *msg); +void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg); +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index b5fb0f0..91f1d10 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -4,9 +4,13 @@ #include #include #include +#include +#include +#include #include #include #include +#include #include "virtual_um.h" #include "l1ctl_sock.h" @@ -16,6 +20,18 @@ #include "gsmtapl1_if.h" static struct l1_model_ms *l1_model_ms = NULL; + +static void l1_model_tch_mode_set(uint8_t tch_mode) +{ + if (tch_mode == GSM48_CMODE_SPEECH_V1 + || tch_mode == GSM48_CMODE_SPEECH_EFR) { + l1_model_ms->state->tch_mode = tch_mode; + + } else { + // set default value if no proper mode was assigned by l23 + l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; + } +} /** * @brief Init the SAP. @@ -30,7 +46,8 @@ * * Enqueues the message into the rx queue. */ -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, + struct msgb *msg) { // check if the received msg is not empty if (msg) { @@ -56,11 +73,11 @@ { uint16_t *len; /* prepend 16bit length before sending */ - len = (uint16_t *) msgb_push(msg, sizeof(*len)); + len = (uint16_t *)msgb_push(msg, sizeof(*len)); *len = htons(msg->len - sizeof(*len)); - if(l1ctl_sock_write_msg(lsi, msg) == -1 ) { - //DEBUGP(DL1C, "Error writing to layer2 socket"); + if (l1ctl_sock_write_msg(lsi, msg) == -1) { + DEBUGP(DL1C, "Error writing to layer2 socket"); } } @@ -140,22 +157,22 @@ /** * @brief General handler for incoming L1CTL messages from layer 2/3. * - * This handler will dequeue the rx queue (if !empty) and call the specific routine for the dequeued l1ctl message. + * This handler will call the specific routine dependent on the L1CTL message type. * */ void l1ctl_sap_handler(struct msgb *msg) { -// struct msgb *msg; struct l1ctl_hdr *l1h; - unsigned long flags; - if (!msg) + if (!msg) { return; + } l1h = (struct l1ctl_hdr *)msg->data; if (sizeof(*l1h) > msg->len) { - LOGP(DL1C, LOGL_NOTICE, "Short message. %u\n", msg->len); + LOGP(DL1C, LOGL_NOTICE, "Malformed message: too short. %u\n", + msg->len); goto exit_msgbfree; } @@ -182,7 +199,6 @@ l1ctl_rx_rach_req(msg); // msg is freed by rx routine goto exit_nofree; - break; case L1CTL_DATA_REQ: l1ctl_rx_data_req(msg); /* we have to keep the msgb, not free it! */ @@ -229,24 +245,29 @@ * Transmit frequency control and synchronisation bursts on FCCH and SCH to calibrate transceiver and search for base stations. * Sync to a given arfcn. * - * Note: Not needed for virtual physical layer. + * Note: ms will start receiving msgs on virtual um only after this req was received. + * Note: virt bts does not broadcast freq and sync bursts. + * * TODO: Could be used to bind/connect to different virtual_bts sockets with a arfcn-socket mapping. + * TODO: Check flags if this is a sync or freq request and handle it accordingly. */ void l1ctl_rx_fbsb_req(struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); l1_model_ms->state->camping = 1; - l1_model_ms->state->serving_cell.arfcn = ntohs(sync_req->band_arfcn); - l1_model_ms->state->serving_cell.ccch_mode = sync_req->ccch_mode; - l1_model_ms->state->serving_cell.fn_offset = 0; - l1_model_ms->state->serving_cell.bsic = 0; - l1_model_ms->state->serving_cell.time_alignment = 0; - // TODO: reset and synchronize the ms uplink schedulers with bts multiframe structure. + l1_model_ms->state->serving_cell.arfcn = ntohs(sync_req->band_arfcn); // freq req + + // not needed in virt um + l1_model_ms->state->serving_cell.ccch_mode = sync_req->ccch_mode; // sync req + l1_model_ms->state->serving_cell.fn_offset = 0; // sync req + l1_model_ms->state->serving_cell.bsic = 0; // sync req + l1_model_ms->state->serving_cell.time_alignment = 0; // sync req l1ctl_tx_fbsb_conf(0, l1_model_ms->state->serving_cell.arfcn); } @@ -268,47 +289,25 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_dm_est_req *est_req = (struct l1ctl_dm_est_req *)ul->payload; + uint8_t rsl_chantype, subslot, timeslot; + + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DM_EST_REQ (arfcn=%u, chan_nr=0x%02x, tsc=%u)\n", - ntohs(est_req->h0.band_arfcn), ul->chan_nr, - est_req->tsc); + "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u)\n", + ul->chan_nr, timeslot); -// /* disable neighbour cell measurement of C0 TS 0 */ -// mframe_disable(MF_TASK_NEIGH_PM51_C0T0); -// -// /* configure dedicated channel state */ -// l1s.dedicated.type = chan_nr2dchan_type(ul->chan_nr); -// l1s.dedicated.tsc = est_req->tsc; -// l1s.dedicated.tn = ul->chan_nr & 0x7; -// l1s.dedicated.h = est_req->h; -// -// if (est_req->h) { -// int i; -// l1s.dedicated.h1.hsn = est_req->h1.hsn; -// l1s.dedicated.h1.maio = est_req->h1.maio; -// l1s.dedicated.h1.n = est_req->h1.n; -// for (i=0; ih1.n; i++) -// l1s.dedicated.h1.ma[i] = ntohs(est_req->h1.ma[i]); -// } else { -// l1s.dedicated.h0.arfcn = ntohs(est_req->h0.band_arfcn); -// } -// -// /* TCH config */ -// if (chan_nr_is_tch(ul->chan_nr)) { -// /* Mode */ -// l1a_tch_mode_set(est_req->tch_mode); -// l1a_audio_mode_set(est_req->audio_mode); -// -// /* Sync */ -// l1s.tch_sync = 1; /* can be set without locking */ -// -// /* Audio path */ -// audio_set_enabled(est_req->tch_mode, est_req->audio_mode); -// } -// -// /* figure out which MF tasks to enable */ -// l1a_mftask_set(chan_nr2mf_task_mask(ul->chan_nr, NEIGH_MODE_PM)); + l1_model_ms->state->dedicated.chan_type = rsl_chantype; + l1_model_ms->state->dedicated.tn = timeslot; + + /* TCH config */ + if (rsl_chantype == RSL_CHAN_Bm_ACCHs + || rsl_chantype == RSL_CHAN_Lm_ACCHs) { + l1_model_ms->state->tch_mode = est_req->tch_mode; + l1_model_tch_mode_set(est_req->tch_mode); + l1_model_ms->state->audio_mode = est_req->audio_mode; + // TODO: configure audio hardware for encoding / decoding / recording / playing voice + } } /** @@ -320,7 +319,7 @@ * * Handle frequency change in dedicated mode. E.g. used for frequency hopping. * - * Note: Not needed for virtual physical layer. + * Note: Not needed for virtual physical layer as freqency hopping is generally disabled. */ void l1ctl_rx_dm_freq_req(struct msgb *msg) { @@ -330,8 +329,9 @@ (struct l1ctl_dm_freq_req *)ul->payload; DEBUGP(DL1C, - "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn=%u, tsc=%u)\n", - ntohs(freq_req->h0.band_arfcn), freq_req->tsc); + "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", + ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, + freq_req->h1.maio); } /** @@ -359,12 +359,14 @@ "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", cr->algo, key_len); -// if (cr->algo && key_len != 8) { -// DEBUGP(DL1C, "L1CTL_CRYPTO_REQ -> Invalid key\n"); -// return; -// } -// -// dsp_load_ciph_param(cr->algo, cr->key); + if (cr->algo && key_len != A5_KEY_LEN) { + DEBUGP(DL1C, "L1CTL_CRYPTO_REQ -> Invalid key\n"); + return; + } + + l1_model_ms->crypto_inf->algo = cr->algo; + memcpy(l1_model_ms->crypto_inf->key, cr->key, + sizeof(uint8_t) * A5_KEY_LEN); } /** @@ -380,19 +382,13 @@ */ void l1ctl_rx_dm_rel_req(struct msgb *msg) { -// struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); - DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_DM_REL_REQ\n"); -// l1a_mftask_set(0); -// l1s.dedicated.type = GSM_DCHAN_NONE; -// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_MAIN]); -// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_SACCH]); -// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); -// l1a_meas_msgb_set(NULL); -// dsp_load_ciph_param(0, NULL); -// l1a_tch_mode_set(GSM48_CMODE_SIGN); -// audio_set_enabled(GSM48_CMODE_SIGN, 0); -// l1s.neigh_pm.n = 0; + l1_model_ms->state->dedicated.chan_type = 0; + l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; + + // TODO: disable ciphering + // TODO: disable audio recording / playing } /** @@ -424,44 +420,38 @@ * * @param [in] msg the received message. * - * Transmit RACH request on RACH. + * Transmit RACH request on RACH. Refer to 04.08 - 9.1.8 - Channel request. * - * TODO: Implement this handler routine! */ void l1ctl_rx_rach_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; - struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; - - uint32_t fn_sched; - uint8_t ts; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + // FIXME: proper frame number + uint32_t fn_sched = 42; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", rach_req->ra, ntohs(rach_req->offset), rach_req->combined); - // TODO: calculate correct fn/ts for a RACH (if needed by bts) - // TODO: implement scheduler for uplink! - fn_sched = 42; - ts = 0; // for the rach channel request, there is no layer2 header, but only the one bit ra content to submit - // see 4.18-9.1.8 CHannel Request - // that means we have to set l2h of msgb to the ra content - msg->l2h = &rach_req->ra; - // avoid all data after ra to also be submitted - msgb_trim(msg, sizeof(rach_req->ra)); - // TODO: check if we need to submit more data than the ra content to the bts + // replace l1ctl_rach_req with ra data that rly shall be submitted + // ra on peer side is decoded as uint16_t, but we do not use the 11bit option and thus 8bits must be sufficient + msg->l2h = msgb_put(msg, sizeof(uint8_t)); + *msg->l2h = rach_req->ra; + + // chan_nr is not specified in info_ul for rach request coming from l23, but needed in gsmtapl1_tx_to_virt_um() + ul->chan_nr = rsl_enc_chan_nr(RSL_CHAN_RACH, 0, 0); + ul->link_id = LID_DEDIC; // send rach over virt um - gsmtapl1_tx_to_virt_um(ts, fn_sched, GSMTAP_CHANNEL_RACH, msg); + gsmtapl1_tx_to_virt_um(fn_sched, msg); // send confirm to layer23 l1ctl_tx_rach_conf(fn_sched, l1_model_ms->state->serving_cell.arfcn); -// l1a_rach_req(ntohs(rach_req->offset), rach_req->combined, -// rach_req->ra); } /** @@ -473,36 +463,29 @@ * * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). * - * TODO: Implement this handler routine! + * TODO: Check if a msg on FACCH is coming in here and needs special handling. */ void l1ctl_rx_data_req(struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; - struct llist_head *tx_queue; + // FIXME: proper frame number + uint32_t fn_sched = 42; DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x)\n", - ul->link_id); + "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", + ul->link_id, ul, ul->payload, data_ind, data_ind->data, + msg->l3h); -// msg->l3h = data_ind->data; -// if (ul->link_id & 0x40) { -// struct gsm48_hdr *gh = (struct gsm48_hdr *)(data_ind->data + 5); -// if (gh->proto_discr == GSM48_PDISC_RR -// && gh->msg_type == GSM48_MT_RR_MEAS_REP) { -// DEBUGP(DL1C, "updating measurement report\n"); -// l1a_meas_msgb_set(msg); -// return; -// } -// tx_queue = &l1s.tx_queue[L1S_CHAN_SACCH]; -// } else -// tx_queue = &l1s.tx_queue[L1S_CHAN_MAIN]; -// -// DEBUGP(DL1C, "ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p\n", -// ul, ul->payload, data_ind, data_ind->data, msg->l3h); -// -// l1a_txq_msgb_enq(tx_queue, msg); + msg->l2h = data_ind->data; + + // send msg over virt um + gsmtapl1_tx_to_virt_um(fn_sched, msg); + + // send confirm to layer23 + msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn_sched, 0, 0); + l1ctl_sap_tx_to_l23(msg); } /** @@ -528,26 +511,33 @@ pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - DEBUGP(DL1C, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", - pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); + DEBUGP(DL1C, + "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + pm_req->type, pm_req->range.band_arfcn_from, + pm_req->range.band_arfcn_to); - for(arfcn_next = pm_req->range.band_arfcn_from; arfcn_next <= pm_req->range.band_arfcn_to; ++arfcn_next) { - struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *)msgb_put(resp_msg, sizeof(*pm_conf)); + for (arfcn_next = pm_req->range.band_arfcn_from; + arfcn_next <= pm_req->range.band_arfcn_to; + ++arfcn_next) { + struct l1ctl_pm_conf *pm_conf = + (struct l1ctl_pm_conf *)msgb_put(resp_msg, + sizeof(*pm_conf)); pm_conf->band_arfcn = htons(arfcn_next); // rxlev 63 is great, 0 is bad the two values are min and max pm_conf->pm[0] = 63; pm_conf->pm[1] = 63; - if(arfcn_next == pm_req->range.band_arfcn_to) { + if (arfcn_next == pm_req->range.band_arfcn_to) { struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; } - // no more space in msgb, flush to l2 - if(msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { + // no more space to hold mor pm info in msgb, flush to l23 + if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { l1ctl_sap_tx_to_l23(resp_msg); resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); } } - if(resp_msg) { + // transmit the remaining part of pm response to l23 + if (resp_msg) { l1ctl_sap_tx_to_l23(resp_msg); } } @@ -563,7 +553,6 @@ * * Note: Currently we do not perform anything else than response with a reset confirm * to just tell l2 that we are rdy. - * TODO: Validate if an action has to be done here. * */ void l1ctl_rx_reset_req(struct msgb *msg) @@ -573,16 +562,20 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); l1_model_ms->state->camping = 0; + // TODO: check if we also need to reset the dedicated channel state l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; default: - LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGP(DL1C, LOGL_ERROR, + "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); break; } } @@ -595,6 +588,8 @@ * @param [in] msg the received message. * * Configure CCCH combined / non-combined mode. + * + * @see l1ctl_proto.h -- enum ccch_mode * * TODO: Implement this handler routine! */ @@ -610,22 +605,7 @@ l1_model_ms->state->serving_cell.ccch_mode = ccch_mode; // check if more has to be done here - l1ctl_tx_ccch_mode_conf(ccch_mode); - -// /* pre-set the CCCH mode */ -// l1s.serving_cell.ccch_mode = ccch_mode; -// -// /* Update task */ -// mframe_disable(MF_TASK_CCCH_COMB); -// mframe_disable(MF_TASK_CCCH); -// -// if (ccch_mode == CCCH_MODE_COMBINED) -// mframe_enable(MF_TASK_CCCH_COMB); -// else if (ccch_mode == CCCH_MODE_NON_COMBINED) -// mframe_enable(MF_TASK_CCCH); -// -// l1ctl_tx_ccch_mode_conf(ccch_mode); } /** @@ -644,20 +624,18 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_tch_mode_req *tch_mode_req = (struct l1ctl_tch_mode_req *)l1h->data; - uint8_t tch_mode = tch_mode_req->tch_mode; - uint8_t audio_mode = tch_mode_req->audio_mode; + + l1_model_tch_mode_set(tch_mode_req->tch_mode); + l1_model_ms->state->audio_mode = tch_mode_req->audio_mode; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", - tch_mode, audio_mode); -// tch_mode = l1a_tch_mode_set(tch_mode); -// audio_mode = l1a_audio_mode_set(audio_mode); -// -// audio_set_enabled(tch_mode, audio_mode); -// -// l1s.tch_sync = 1; /* Needed for audio to work */ -// -// l1ctl_tx_tch_mode_conf(tch_mode, audio_mode); + tch_mode_req->tch_mode, tch_mode_req->audio_mode); + + // TODO: configure audio hardware for encoding / decoding / recording / playing voice + + l1ctl_tx_tch_mode_conf(l1_model_ms->state->tch_mode, + l1_model_ms->state->audio_mode); } /** @@ -671,7 +649,7 @@ * The neighbor cell description is one of the info messages sent by the BTS on BCCH. * This method will also enable neighbor measurement in the multiframe scheduler. * - * Note: Not needed for virtual physical layer. + * Note: Not needed for virtual physical layer as we dont maintain neigbors. */ void l1ctl_rx_neigh_pm_req(struct msgb *msg) { @@ -691,30 +669,26 @@ * * @param [in] msg the received message. * - * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. - * Will drop the traffic frame at queue sizes >= 4. + * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. In virtual layer1 just submit it to the virt um. * - * TODO: Implement this handler routine! */ void l1ctl_rx_traffic_req(struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; - int num = 0; + uint32_t fn_sched = 42; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); -// msg->l2h = tr->data; + msg->l2h = tr->data; -// num = l1a_txq_msgb_count(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); -// if (num >= 4) { -// DEBUGP(DL1C, "dropping traffic frame\n"); -// msgb_free(msg); -// return; -// } -// -// l1a_txq_msgb_enq(&l1s.tx_queue[L1S_CHAN_TRAFFIC], msg); + // send msg over virt um + gsmtapl1_tx_to_virt_um(fn_sched, msg); + + // send confirm to layer23 + msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn_sched, 0, 0); + l1ctl_sap_tx_to_l23(msg); } /** @@ -727,6 +701,7 @@ * Forward and a sim request to the SIM APDU. * * Note: Not needed for virtual layer. Please configure layer23 application to use test-sim implementation. + * In this case layer1 wont need to handle sim logic. * ms * -------- * sim test @@ -766,7 +741,7 @@ reset_resp->type = reset_type; DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", - getL1ctlPrimName(msg_type), reset_type); + getL1ctlPrimName(msg_type), reset_type); l1ctl_sap_tx_to_l23(msg); } @@ -783,7 +758,7 @@ struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", - getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); + getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); l1ctl_sap_tx_to_l23(msg); } @@ -807,22 +782,20 @@ * @param [in] res 0 -> success, 255 -> error. * @param [in] arfcn the arfcn we are synced to. * - * No calculation needed for virtual pyh -> uses default values for a good link quality. + * No calculation needed for virtual pyh -> uses dummy values for a good link quality. */ void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) { struct msgb *msg; struct l1ctl_fbsb_conf *resp; uint32_t fn = 0; // 0 should be okay here - uint16_t snr = 40; // signal noise ratio > 40db is best signal. - int16_t initial_freq_err = 0; // 0 means no error. - uint8_t bsic = 0; + uint16_t snr = 40; // signal noise ratio > 40db is best signal (unused in virt) + int16_t initial_freq_err = 0; // 0 means no error (unused in virt) + uint8_t bsic = 0; // bsci can be read from sync burst (unused in virt) - msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, - snr, - arfcn); + msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, snr, arfcn); - resp = (struct l1ctl_fbsb_conf *) msgb_put(msg, sizeof(*resp)); + resp = (struct l1ctl_fbsb_conf *)msgb_put(msg, sizeof(*resp)); resp->initial_freq_err = htons(initial_freq_err); resp->result = res; resp->bsic = bsic; @@ -875,9 +848,8 @@ mode_conf->audio_mode = audio_mode; DEBUGP(DL1C, - "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, - audio_mode); + "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", + tch_mode, audio_mode); l1ctl_sap_tx_to_l23(msg); } - diff --git a/src/host/virt_phy/src/l1ctl_sap.h b/src/host/virt_phy/src/l1ctl_sap.h index f540197..9472013 100644 --- a/src/host/virt_phy/src/l1ctl_sap.h +++ b/src/host/virt_phy/src/l1ctl_sap.h @@ -15,6 +15,10 @@ #define L3_MSG_DATA 200 #define L3_MSG_SIZE (sizeof(struct l1ctl_hdr) + L3_MSG_HEAD + L3_MSG_DATA) +/* lchan link ID */ +#define LID_SACCH 0x40 +#define LID_DEDIC 0x00 + void l1ctl_sap_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); diff --git a/src/host/virt_phy/src/virt_l1_model.h b/src/host/virt_phy/src/virt_l1_model.h index f0619ab..38d9efe 100644 --- a/src/host/virt_phy/src/virt_l1_model.h +++ b/src/host/virt_phy/src/virt_l1_model.h @@ -1,29 +1,65 @@ #pragma once -#include #include "l1ctl_sock.h" #include "virtual_um.h" + +#define L1S_NUM_NEIGH_CELL 6 +#define A5_KEY_LEN 8 struct l1_model_ms { struct l1ctl_sock_inst *lsi; struct virt_um_inst *vui; struct l1_state_ms *state; + struct crypto_info_ms *crypto_inf; }; -//TODO: must contain logical channel information (fram number, ciphering mode, ...) +/* structure representing L1 sync information about a cell */ +struct l1_cell_info { + /* on which ARFCN (+band) is the cell? */ + uint16_t arfcn; + /* what's the BSIC of the cell (from SCH burst decoding) */ + uint8_t bsic; + /* Combined or non-combined CCCH */ + uint8_t ccch_mode; /* enum ccch_mode */ + /* whats the delta of the cells current GSM frame number + * compared to our current local frame number */ + int32_t fn_offset; + /* how much does the TPU need adjustment (delta) to synchronize + * with the cells burst */ + uint32_t time_alignment; +}; + +struct crypto_info_ms { + /* key is expected in the same format as in RSL + * Encryption information IE. */ + uint8_t key[A5_KEY_LEN]; + uint8_t algo; +}; + struct l1_state_ms { - uint8_t camping; + uint8_t camping; // are we currently camping on a cell + /* the cell on which we are camping right now */ struct l1_cell_info serving_cell; - /* neighbor cell sync info */ struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; - /* TCH */ - uint8_t tch_mode; - uint8_t tch_sync; - uint8_t audio_mode; + /* TCH info */ + uint8_t tch_mode; // see enum gsm48_chan_mode in gsm_04_08.h + uint8_t tch_sync; // needed for audio synchronization + uint8_t audio_mode; // see l1ctl_proto.h, e.g. AUDIO_TX_MICROPHONE + + /* dedicated channel info */ + struct { + uint8_t chan_type; // like rsl chantype 08.58 -> Chapter 9.3.1 */ + + uint8_t tn; // timeslot number 1-7 + + uint8_t scn; // single-hop cellular network? (ununsed in virtual um) + uint8_t tsc; // training sequence code (ununsed in virtual um) + uint8_t h; // hopping enabled flag (ununsed in virtual um) + } dedicated; }; struct l1_model_ms *l1_model_ms_init(void *ctx); diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 94f6fa5..b2a2d4f 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -17,10 +17,10 @@ int main(void) { - // init loginfo static struct l1_model_ms *model; - ms_log_init("DL1C,1:DVIRPHY,1"); + //ms_log_init("DL1C,1:DVIRPHY,1"); + ms_log_init("DL1C,1"); //ms_log_init("DL1C,8:DVIRPHY,8"); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); @@ -28,7 +28,10 @@ model = l1_model_ms_init(NULL); // TODO: make this configurable - model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); + model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, + DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, + DEFAULT_MS_MCAST_PORT, + gsmtapl1_rx_from_virt_um_inst_cb); model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, NULL); gsmtapl1_init(model); diff --git a/src/host/virt_phy/src/virtual_um.c b/src/host/virt_phy/src/virtual_um.c index 2b15509..e2e86e4 100644 --- a/src/host/virt_phy/src/virtual_um.c +++ b/src/host/virt_phy/src/virtual_um.c @@ -19,7 +19,6 @@ * */ -#include #include #include #include @@ -46,10 +45,12 @@ int rc; // read message from fd in message buffer - rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), + msgb_tailroom(msg)); // rc is number of bytes actually read if (rc > 0) { msgb_put(msg, rc); + msg->l1h = msgb_data(msg); // call the l1 callback function for a received msg vui->recv_cb(vui, msg); } else { @@ -68,12 +69,13 @@ struct virt_um_inst *virt_um_init( void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, - const char *rx_mcast_group, uint16_t rx_mcast_port, void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) + const char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) { - struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); - vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, - rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, + tx_mcast_port, rx_mcast_group, rx_mcast_port, 1, + virt_um_fd_cb, vui); vui->recv_cb = recv_cb; return vui; @@ -93,7 +95,8 @@ { int rc; - rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), msgb_length(msg)); + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), + msgb_length(msg)); msgb_free(msg); return rc; -- To view, visit https://gerrit.osmocom.org/3199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibad741d112643c55091b8ba00164b05d728ae1a1 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:45 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Cleanup dirs, makefile, dependencies and formattin... Message-ID: Review at https://gerrit.osmocom.org/3200 VIRT-PHY: Cleanup dirs, makefile, dependencies and formatting code. Change-Id: Ibd68a03bcc439c262ba513782936c6b62937eaaa --- M src/Makefile M src/host/virt_phy/configure.ac R src/host/virt_phy/include/virtphy/gsmtapl1_if.h R src/host/virt_phy/include/virtphy/l1ctl_sap.h R src/host/virt_phy/include/virtphy/l1ctl_sock.h R src/host/virt_phy/include/virtphy/logging.h R src/host/virt_phy/include/virtphy/osmo_mcast_sock.h R src/host/virt_phy/include/virtphy/virt_l1_model.h R src/host/virt_phy/include/virtphy/virtual_um.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/logging.c R src/host/virt_phy/src/shared/osmo_mcast_sock.c R src/host/virt_phy/src/shared/virtual_um.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virtphy.c 18 files changed, 85 insertions(+), 107 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/00/3200/1 diff --git a/src/Makefile b/src/Makefile index 44f91b1..9f37bdf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -47,8 +47,7 @@ make -C host/osmocon .PHONY: virtphy -virtphy: host/virt_phy/Makefile - cd host/virt_phy && make +virtphy: host/virt_phy/virtphy host/virt_phy/configure: host/virt_phy/configure.ac cd host/virt_phy && autoreconf -i @@ -56,6 +55,9 @@ host/virt_phy/Makefile: host/virt_phy/configure cd host/virt_phy && ./configure $(HOST_CONFARGS) +host/virt_phy/virtphy: host/virt_phy/Makefile + make -C host/virt_phy + .PHONY: gsmmap gsmmap: host/gsmmap/gsmmap diff --git a/src/host/virt_phy/configure.ac b/src/host/virt_phy/configure.ac index bcdbf91..860082e 100644 --- a/src/host/virt_phy/configure.ac +++ b/src/host/virt_phy/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script AC_INIT([virtphy], 0.0.0) AM_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects]) dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) diff --git a/src/host/virt_phy/src/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h similarity index 85% rename from src/host/virt_phy/src/gsmtapl1_if.h rename to src/host/virt_phy/include/virtphy/gsmtapl1_if.h index 6311e07..c511560 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -2,10 +2,9 @@ #include #include - -#include "l1ctl_sock.h" -#include "virtual_um.h" -#include "virt_l1_model.h" +#include +#include +#include void gsmtapl1_init(struct l1_model_ms *model); void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, diff --git a/src/host/virt_phy/src/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h similarity index 89% rename from src/host/virt_phy/src/l1ctl_sap.h rename to src/host/virt_phy/include/virtphy/l1ctl_sap.h index 9472013..902eb17 100644 --- a/src/host/virt_phy/src/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -3,10 +3,9 @@ #include #include #include - -#include "l1ctl_sock.h" -#include "virtual_um.h" -#include "virt_l1_model.h" +#include +#include +#include /* following sizes are used for message allocation */ /* size of layer 3 header */ @@ -22,7 +21,8 @@ void l1ctl_sap_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg); +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, + struct msgb *msg); void l1ctl_sap_rx_from_l23(struct msgb *msg); void l1ctl_sap_handler(struct msgb *msg); diff --git a/src/host/virt_phy/src/l1ctl_sock.h b/src/host/virt_phy/include/virtphy/l1ctl_sock.h similarity index 100% rename from src/host/virt_phy/src/l1ctl_sock.h rename to src/host/virt_phy/include/virtphy/l1ctl_sock.h diff --git a/src/host/virt_phy/src/logging.h b/src/host/virt_phy/include/virtphy/logging.h similarity index 100% rename from src/host/virt_phy/src/logging.h rename to src/host/virt_phy/include/virtphy/logging.h diff --git a/src/host/virt_phy/src/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h similarity index 100% rename from src/host/virt_phy/src/osmo_mcast_sock.h rename to src/host/virt_phy/include/virtphy/osmo_mcast_sock.h diff --git a/src/host/virt_phy/src/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h similarity index 90% rename from src/host/virt_phy/src/virt_l1_model.h rename to src/host/virt_phy/include/virtphy/virt_l1_model.h index 38d9efe..561025e 100644 --- a/src/host/virt_phy/src/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -1,7 +1,7 @@ #pragma once -#include "l1ctl_sock.h" -#include "virtual_um.h" +#include +#include #define L1S_NUM_NEIGH_CELL 6 #define A5_KEY_LEN 8 @@ -16,17 +16,17 @@ /* structure representing L1 sync information about a cell */ struct l1_cell_info { /* on which ARFCN (+band) is the cell? */ - uint16_t arfcn; + uint16_t arfcn; /* what's the BSIC of the cell (from SCH burst decoding) */ - uint8_t bsic; + uint8_t bsic; /* Combined or non-combined CCCH */ - uint8_t ccch_mode; /* enum ccch_mode */ + uint8_t ccch_mode; /* enum ccch_mode */ /* whats the delta of the cells current GSM frame number * compared to our current local frame number */ - int32_t fn_offset; + int32_t fn_offset; /* how much does the TPU need adjustment (delta) to synchronize * with the cells burst */ - uint32_t time_alignment; + uint32_t time_alignment; }; struct crypto_info_ms { diff --git a/src/host/virt_phy/src/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h similarity index 68% rename from src/host/virt_phy/src/virtual_um.h rename to src/host/virt_phy/include/virtphy/virtual_um.h index eafb994..5c883de 100644 --- a/src/host/virt_phy/src/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -16,8 +16,10 @@ void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); }; -struct virt_um_inst *virt_um_init(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, const char *rx_mcast_group, uint16_t rx_mcast_port, - void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); +struct virt_um_inst *virt_um_init( + void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); void virt_um_destroy(struct virt_um_inst *vui); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index 2dac297..8508509 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -1,18 +1,8 @@ -OSMOCOM_DIR = /home/basti/Osmocom -OSMO_BB_DIR = $(OSMOCOM_DIR)/osmocom-bb -OSMO_BTS_DIR = $(OSMOCOM_DIR)/osmo-bts -OPENBSC_DIR = $(OSMOCOM_DIR)/openbsc - AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OSMO_BB_DIR)/include -I$(OSMO_BTS_DIR)/include -I$(OPENBSC_DIR)/openbsc/include -I$(OSMO_BB_DIR)/src/host/layer23/include -# TODO: somehow this include path causes errors, thus the needed files are copied into $(top_srcdir)/include. Would be better to include directly from $(OSMO_BB_DIR)/src/target/firmware/include to avoid redundancy. -# -I$(OSMO_BB_DIR)/src/target/firmware/include - -# disable optimization and enable debugging -CFLAGS = -g -O0 +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/../layer23/include sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c l1ctl_sap.c gsmtapl1_if.c logging.c virt_l1_model.c virtual_um.c osmo_mcast_sock.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c l1ctl_sap.c gsmtapl1_if.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) # debug output diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index d46bb2f..338f99c 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -29,13 +29,12 @@ #include #include #include - -#include "virtual_um.h" -#include "l1ctl_sock.h" -#include "virt_l1_model.h" -#include "l1ctl_sap.h" -#include "gsmtapl1_if.h" -#include "logging.h" +#include +#include +#include +#include +#include +#include static struct l1_model_ms *l1_model_ms = NULL; @@ -162,6 +161,8 @@ struct gsmtap_hdr *gh = msgb_l1(msg); struct msgb *l1ctl_msg = NULL; struct l1ctl_info_dl *l1dl; + struct l1ctl_traffic_ind * l1ti; + struct l1ctl_data_ind * l1di; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the cell we currently camp on uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type @@ -188,7 +189,6 @@ switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { case GSMTAP_CHANNEL_TCH_H: case GSMTAP_CHANNEL_TCH_F: - struct l1ctl_traffic_ind * l1ti; l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); @@ -214,7 +214,6 @@ case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: - struct l1ctl_data_ind * l1di; l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 91f1d10..3be6b9d 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -11,13 +11,12 @@ #include #include #include - -#include "virtual_um.h" -#include "l1ctl_sock.h" -#include "virt_l1_model.h" -#include "l1ctl_sap.h" -#include "logging.h" -#include "gsmtapl1_if.h" +#include +#include +#include +#include +#include +#include static struct l1_model_ms *l1_model_ms = NULL; diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index b507369..5e0ba43 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -44,9 +44,9 @@ #include -#include "l1ctl_sock.h" -#include "virtual_um.h" -#include "logging.h" +#include +#include +#include #define L1CTL_SOCK_MSGB_SIZE 256 @@ -87,8 +87,8 @@ lsi->recv_cb(lsi, msg); return 0; } -ERR: - perror("Failed to receive msg from l2. Connection will be closed.\n"); + ERR: perror( + "Failed to receive msg from l2. Connection will be closed.\n"); l1ctl_sock_disconnect(lsi); } return 0; diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index a017a52..1cfb40f 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -20,11 +20,9 @@ * */ - #include #include - -#include "logging.h" +#include const char* l1ctlPrimNames[] = { "_L1CTL_NONE", @@ -57,41 +55,33 @@ "L1CTL_NEIGH_PM_IND", "L1CTL_TRAFFIC_REQ", "L1CTL_TRAFFIC_CONF", - "L1CTL_TRAFFIC_IND" -}; + "L1CTL_TRAFFIC_IND"}; -static const struct log_info_cat default_categories[] = { - [DL1C] = { - .name = "DL1C", - .description = "Layer 1 Control", - .color = "\033[1;31m", - .enabled = 1, - .loglevel = LOGL_DEBUG, - }, - [DVIRPHY] = { - .name = "DVIRPHY", - .description = "Virtual Layer 1 Interface", - .color = "\033[1;31m", - .enabled = 1, - .loglevel = LOGL_DEBUG, - } -}; +static const struct log_info_cat default_categories[] = {[DL1C] = { + .name = "DL1C", + .description = "Layer 1 Control", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, }, [DVIRPHY] = { + .name = "DVIRPHY", + .description = "Virtual Layer 1 Interface", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, }}; -const struct log_info ms_log_info = { - .filter_fn = NULL, - .cat = default_categories, - .num_cat = ARRAY_SIZE(default_categories), -}; +const struct log_info ms_log_info = {.filter_fn = NULL, .cat = + default_categories, .num_cat = ARRAY_SIZE(default_categories), }; /** * Initialize the logging system for the virtual physical layer. */ -int ms_log_init(char *cat_mask) { +int ms_log_init(char *cat_mask) +{ struct log_target *stderr_target; log_init(&ms_log_info, NULL); stderr_target = log_target_create_stderr(); - if(!stderr) { + if (!stderr) { return -1; } log_add_target(stderr_target); @@ -101,7 +91,7 @@ log_set_use_color(stderr_target, 0); log_set_print_timestamp(stderr_target, 1); log_set_print_category(stderr_target, 1); - if(cat_mask) { + if (cat_mask) { log_parse_category_mask(stderr_target, cat_mask); } return 0; diff --git a/src/host/virt_phy/src/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c similarity index 99% rename from src/host/virt_phy/src/osmo_mcast_sock.c rename to src/host/virt_phy/src/shared/osmo_mcast_sock.c index c177734..acc6bcb 100644 --- a/src/host/virt_phy/src/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -8,8 +8,7 @@ #include #include #include - -#include "osmo_mcast_sock.h" +#include struct mcast_server_sock *mcast_server_sock_setup(void *ctx, char* tx_mcast_group, diff --git a/src/host/virt_phy/src/virtual_um.c b/src/host/virt_phy/src/shared/virtual_um.c similarity index 92% rename from src/host/virt_phy/src/virtual_um.c rename to src/host/virt_phy/src/shared/virtual_um.c index e2e86e4..9415bfb 100644 --- a/src/host/virt_phy/src/virtual_um.c +++ b/src/host/virt_phy/src/shared/virtual_um.c @@ -25,9 +25,9 @@ #include #include #include - -#include "virtual_um.h" -#include "osmo_mcast_sock.h" +#include +#include +#include /** * Virtual UM interface file descriptor callback. @@ -68,8 +68,8 @@ } struct virt_um_inst *virt_um_init( - void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, - const char *rx_mcast_group, uint16_t rx_mcast_port, + void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) { struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index f2e1690..1b1d0df 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -1,14 +1,16 @@ -#include "virt_l1_model.h" +#include +#include -struct l1_model_ms* l1_model_ms_init(void *ctx) { - +struct l1_model_ms* l1_model_ms_init(void *ctx) +{ struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); model->state = talloc_zero(ctx, struct l1_state_ms); - return model; + } -void l1_model_ms_destroy(struct l1_model_ms *model) { +void l1_model_ms_destroy(struct l1_model_ms *model) +{ virt_um_destroy(model->vui); l1ctl_sock_destroy(model->lsi); talloc_free(model->state); diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index b2a2d4f..5007146 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -1,19 +1,16 @@ /* osmocom includes */ -#include "logging.h" #include #include -#include #include #include #include -#include - -#include "virtual_um.h" -#include "l1ctl_sock.h" -#include "virt_l1_model.h" -#include "gsmtapl1_if.h" -#include "l1ctl_sap.h" +#include +#include +#include +#include +#include +#include int main(void) { @@ -29,9 +26,8 @@ // TODO: make this configurable model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, - DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, - DEFAULT_MS_MCAST_PORT, - gsmtapl1_rx_from_virt_um_inst_cb); + DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, + DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, NULL); gsmtapl1_init(model); -- To view, visit https://gerrit.osmocom.org/3200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd68a03bcc439c262ba513782936c6b62937eaaa Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:45 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Enable multiple phy-instances by configurable l1ct... Message-ID: Review at https://gerrit.osmocom.org/3201 VIRT-PHY: Enable multiple phy-instances by configurable l1ctl-sock-path. Change-Id: Ief22eedacd1929450ff68f553068b95a778df80f --- M src/host/virt_phy/include/virtphy/l1ctl_sock.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/virtphy.c 4 files changed, 15 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/01/3201/1 diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sock.h b/src/host/virt_phy/include/virtphy/l1ctl_sock.h index ef9799c..8c96dc8 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sock.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sock.h @@ -9,6 +9,7 @@ struct l1ctl_sock_inst { void *priv; /* Will be appended after osmo-fd's data pointer. */ struct osmo_fd connection; /* L1CTL connection to l2 app */ + char* l1ctl_sock_path; /* Socket path used to connect to l23 */ struct osmo_fd ofd; /* Osmocom file descriptor to accept L1CTL connections. */ void (*recv_cb)(struct l1ctl_sock_inst *vui, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ }; diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 3be6b9d..b89d963 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -74,10 +74,7 @@ /* prepend 16bit length before sending */ len = (uint16_t *)msgb_push(msg, sizeof(*len)); *len = htons(msg->len - sizeof(*len)); - - if (l1ctl_sock_write_msg(lsi, msg) == -1) { - DEBUGP(DL1C, "Error writing to layer2 socket"); - } + l1ctl_sock_write_msg(lsi, msg); } /** diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index 5e0ba43..c28da60 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -163,6 +163,7 @@ lsi->ofd.cb = l1ctl_sock_accept_cb; // no connection -> invalid filedescriptor and not 0 (==std_in) lsi->connection.fd = -1; + lsi->l1ctl_sock_path = path; osmo_fd_register(&lsi->ofd); diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 5007146..977a358 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -12,10 +12,18 @@ #include #include -int main(void) +int main( int argc, char *argv[] ) { // init loginfo static struct l1_model_ms *model; + char * l1ctl_sock_path = NULL; + + // get path from commandline argument + if( argc > 1 ) { + l1ctl_sock_path = argv[1]; + } + + //ms_log_init("DL1C,1:DVIRPHY,1"); ms_log_init("DL1C,1"); //ms_log_init("DL1C,8:DVIRPHY,8"); @@ -28,12 +36,13 @@ model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); - model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, NULL); + model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, l1ctl_sock_path); gsmtapl1_init(model); l1ctl_sap_init(model); - LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n"); + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ + Waiting for l23 app on", l1ctl_sock_path); while (1) { // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) -- To view, visit https://gerrit.osmocom.org/3201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief22eedacd1929450ff68f553068b95a778df80f Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:46 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Added example config for 2 mobile instances. Message-ID: Review at https://gerrit.osmocom.org/3202 VIRT-PHY: Added example config for 2 mobile instances. Change-Id: Iecfed3933ca88aa7a027e6247a8b71e28ee1883e --- M src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg A src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg 2 files changed, 125 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/02/3202/1 diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg index 382a09d..1aeb3f5 100644 --- a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg +++ b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg @@ -19,7 +19,7 @@ imei 123456789012345 0 imei-fixed no emergency-imsi - no sms-service-center + sms-service-center 123123123 no call-waiting no auto-answer no force-rekey @@ -40,9 +40,9 @@ p-gsm e-gsm r-gsm - no gsm-850 + gsm-850 dcs - no pcs + pcs class-900 4 class-850 4 class-dcs 1 @@ -59,8 +59,8 @@ imsi 901700000000403 ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef no barred-access - no rplmn - hplmn-search foreign-country + rplmn 262 42 0x0001 + hplmn-search everywhere exit no shutdown exit diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg b/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg new file mode 100644 index 0000000..0c9ada4 --- /dev/null +++ b/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg @@ -0,0 +1,120 @@ +! +! OsmocomBB (0.0.0) configuration saved from vty +!! +! +line vty + no login +! +gps device /dev/ttyACM0 +gps baudrate default +no gps enable +! +no hide-default +! +ms 1 + layer2-socket /tmp/osmocom_l2 + sap-socket /tmp/osmocom_sap + sim test + network-selection-mode auto + imei 123456789012345 0 + imei-fixed + no emergency-imsi + sms-service-center 123123123 + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + gsm-850 + dcs + pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + exit + test-sim + imsi 901700000000403 + ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + barred-access + rplmn 262 42 0x0001 + hplmn-search everywhere + exit + no shutdown +exit +ms 2 + layer2-socket /tmp/osmocom_l2_NR2 + sap-socket /tmp/osmocom_sap_NR2 + sim test + network-selection-mode auto + imei 123456789012346 0 + imei-fixed + no emergency-imsi + sms-service-center 123123123 + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + gsm-850 + dcs + pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + exit + test-sim + imsi 901700000000404 + ki comp128 11 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + barred-access + rplmn 262 42 0x0001 + hplmn-search everywhere + exit + no shutdown +exit +! -- To view, visit https://gerrit.osmocom.org/3202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iecfed3933ca88aa7a027e6247a8b71e28ee1883e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:46 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Uplink flag and arfcn check. Message-ID: Review at https://gerrit.osmocom.org/3203 VIRT-PHY: Uplink flag and arfcn check. Incoming messages with the uplinks flag set in the arfcn or another arfcn than the cell's we are camping on are ignored. Change-Id: Ibb78ac68172fceaa04acca81271940632e52d857 --- M src/host/virt_phy/src/gsmtapl1_if.c 1 file changed, 57 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/03/3203/1 diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 338f99c..ebfb5b6 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -39,48 +39,46 @@ static struct l1_model_ms *l1_model_ms = NULL; // for debugging -static const struct value_string gsmtap_channels [22] = { - { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, - { GSMTAP_CHANNEL_BCCH, "BCCH" }, - { GSMTAP_CHANNEL_CCCH, "CCCH" }, - { GSMTAP_CHANNEL_RACH, "RACH" }, - { GSMTAP_CHANNEL_AGCH, "AGCH" }, - { GSMTAP_CHANNEL_PCH, "PCH" }, - { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, - { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, - { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, - { GSMTAP_CHANNEL_TCH_F, "FACCH/F" }, - { GSMTAP_CHANNEL_TCH_H, "FACCH/H" }, - { GSMTAP_CHANNEL_PACCH, "PACCH" }, - { GSMTAP_CHANNEL_CBCH52, "CBCH" }, - { GSMTAP_CHANNEL_PDCH, "PDCH" }, - { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, - { GSMTAP_CHANNEL_CBCH51, "CBCH" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_SDCCH, "LSACCH" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, - { 0, NULL }, -}; +static const struct value_string gsmtap_channels[22] = { + {GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN"}, + {GSMTAP_CHANNEL_BCCH, "BCCH"}, + {GSMTAP_CHANNEL_CCCH, "CCCH"}, + {GSMTAP_CHANNEL_RACH, "RACH"}, + {GSMTAP_CHANNEL_AGCH, "AGCH"}, + {GSMTAP_CHANNEL_PCH, "PCH"}, + {GSMTAP_CHANNEL_SDCCH, "SDCCH"}, + {GSMTAP_CHANNEL_SDCCH4, "SDCCH/4"}, + {GSMTAP_CHANNEL_SDCCH8, "SDCCH/8"}, + {GSMTAP_CHANNEL_TCH_F, "FACCH/F"}, + {GSMTAP_CHANNEL_TCH_H, "FACCH/H"}, + {GSMTAP_CHANNEL_PACCH, "PACCH"}, + {GSMTAP_CHANNEL_CBCH52, "CBCH"}, + {GSMTAP_CHANNEL_PDCH, "PDCH"}, + {GSMTAP_CHANNEL_PTCCH, "PTTCH"}, + {GSMTAP_CHANNEL_CBCH51, "CBCH"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_SDCCH, "LSACCH"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_SDCCH4, "SACCH/4"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_SDCCH8, "SACCH/8"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_TCH_F, "SACCH/F"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_TCH_H, "SACCH/H"}, + {0, NULL}, }; // for debugging -static const struct value_string gsmtap_types [10] = { - { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, - { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, - { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, - { GSMTAP_TYPE_SIM, "SIM" }, - { GSMTAP_TYPE_TETRA_I1, "TETRA V+D"}, - { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, - { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)" }, - { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, - { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, - { 0, NULL }, -}; +static const struct value_string gsmtap_types[10] = {{ + GSMTAP_TYPE_UM, + "GSM Um (MS<->BTS)"}, {GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)"}, { + GSMTAP_TYPE_UM_BURST, + "GSM Um burst (MS<->BTS)"}, {GSMTAP_TYPE_SIM, "SIM"}, { + GSMTAP_TYPE_TETRA_I1, + "TETRA V+D"}, {GSMTAP_TYPE_WMX_BURST, "WiMAX burst"}, { + GSMTAP_TYPE_GMR1_UM, + "GMR-1 air interfeace (MES-MS<->GTS)"}, { + GSMTAP_TYPE_UMTS_RLC_MAC, + "UMTS RLC/MAC"}, {GSMTAP_TYPE_UMTS_RRC, "UMTS RRC"}, {0, NULL}, }; void gsmtapl1_init(struct l1_model_ms *model) { @@ -111,8 +109,10 @@ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); - outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chan, subslot, fn, - signal_dbm, snr, data, data_len); + // arfcn needs to be flagged to be able to distinguish between uplink and downlink + outmsg = gsmtap_makemsg(arfcn | GSMTAP_ARFCN_F_UPLINK, timeslot, + gsmtap_chan, subslot, fn, signal_dbm, snr, data, + data_len); if (outmsg) { outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); @@ -184,6 +184,19 @@ arfcn, fn, get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); + + // generally ignore all messages coming from another arfcn than the synced one + if (l1_model_ms->state->serving_cell.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn & GSMTAP_ARFCN_MASK, l1_model_ms->state->serving_cell.arfcn); + goto nomessage; + } + // generally ignore all uplink messages received + if (arfcn & GSMTAP_ARFCN_F_UPLINK) { + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + goto nomessage; + } // switch case with removed acch flag switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { @@ -258,6 +271,7 @@ if (l1ctl_msg) { l1ctl_sap_tx_to_l23(l1ctl_msg); } +nomessage: // handle memory deallocation talloc_free(msg); } -- To view, visit https://gerrit.osmocom.org/3203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb78ac68172fceaa04acca81271940632e52d857 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:46 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Uplink scheduler implementation. Message-ID: Review at https://gerrit.osmocom.org/3204 VIRT-PHY: Uplink scheduler implementation. Implemented simple scheduler depending on frame number in downlink. It will be executed each time we receive a msg on downlink and send out all scheduled uplink msgs with a sched_fn smaller than the one of this received downlink msg. Further refactored l1ctl_sap by extracting rach and fbsb logic and putting it to own files virt_prim_fbsb.c and virt_prim_rach.c Added simple states to the ms layer 1 model, indicating if the ms is currently searching for bts, syncing to or camping on a bts. Downlink will be handled differently dependent of the state. Change-Id: I8937b1d6568f5d3750bbdc5d77fa283074d5365e --- M src/host/virt_phy/Makefile.am M src/host/virt_phy/include/virtphy/gsmtapl1_if.h M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/virt_l1_model.h A src/host/virt_phy/include/virtphy/virt_l1_sched.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c A src/host/virt_phy/src/virt_l1_sched_simple.c A src/host/virt_phy/src/virt_prim_fbsb.c A src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virtphy.c 12 files changed, 492 insertions(+), 155 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/04/3204/1 diff --git a/src/host/virt_phy/Makefile.am b/src/host/virt_phy/Makefile.am index 515d51b..57b4571 100644 --- a/src/host/virt_phy/Makefile.am +++ b/src/host/virt_phy/Makefile.am @@ -1,2 +1,4 @@ SUBDIRS = src -dist_doc_DATA = README \ No newline at end of file +dist_doc_DATA = README + +CFLAGS = "-g -O0" \ No newline at end of file diff --git a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h index c511560..34cd9c8 100644 --- a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -10,8 +10,7 @@ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); void gsmtapl1_rx_from_virt_um(struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint32_t fn, - struct msgb *msg); -void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg); +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_tx_to_virt_um(struct msgb *msg); void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, uint8_t *link_id); diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index 902eb17..c11c5fe 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -19,6 +19,8 @@ #define LID_DEDIC 0x00 void l1ctl_sap_init(struct l1_model_ms *model); +void prim_rach_init(struct l1_model_ms *model); +void prim_fbsb_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 561025e..69115f2 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -2,9 +2,18 @@ #include #include +#include #define L1S_NUM_NEIGH_CELL 6 #define A5_KEY_LEN 8 + +enum ms_state { + MS_STATE_IDLE_SEARCHING = 0, + MS_STATE_IDLE_SYNCING, + MS_STATE_IDLE_CAMPING, + MS_STATE_DEDICATED, +}; + struct l1_model_ms { struct l1ctl_sock_inst *lsi; @@ -38,7 +47,10 @@ struct l1_state_ms { - uint8_t camping; // are we currently camping on a cell + struct gsm_time downlink_time; /* current GSM time received on downlink */ + struct gsm_time current_time; /* GSM time used internally for scheduling */ + + uint8_t state; // the ms state like in ms_state /* the cell on which we are camping right now */ struct l1_cell_info serving_cell; @@ -60,6 +72,11 @@ uint8_t tsc; // training sequence code (ununsed in virtual um) uint8_t h; // hopping enabled flag (ununsed in virtual um) } dedicated; + + /* fbsb state */ + struct { + uint32_t arfcn; + } fbsb; }; struct l1_model_ms *l1_model_ms_init(void *ctx); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_sched.h b/src/host/virt_phy/include/virtphy/virt_l1_sched.h new file mode 100644 index 0000000..a68c58d --- /dev/null +++ b/src/host/virt_phy/include/virtphy/virt_l1_sched.h @@ -0,0 +1,32 @@ +#pragma once +#include +#include +#include +#include +#include + +typedef void virt_l1_sched_cb(struct msgb * msg); + +/* bucket containing items to be executed for a specific mframe number */ +struct virt_l1_sched_mframe_item { + struct llist_head mframe_item_entry; + struct llist_head tdma_item_list; /* list of tdma sched items */ + uint32_t fn; /* frame number of execution */ +}; + +/* item to be be executed for a specific tdma timeslot of a framenumber */ +struct virt_l1_sched_tdma_item { + struct llist_head tdma_item_entry; + struct msgb * msg; /* the msg to be handled */ + uint8_t ts; /* tdma timeslot of execution */ + virt_l1_sched_cb * handler_cb; /* handler callback */ +}; + +void virt_l1_sched_init(struct l1_model_ms * model); +int virt_l1_sched_start(struct gsm_time time); +int virt_l1_sched_restart(struct gsm_time time); +void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset); +void virt_l1_sched_stop(); +void virt_l1_sched_execute(uint32_t fn); +void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, + virt_l1_sched_cb * handler_cb); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index 8508509..fd8d5d9 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -1,9 +1,12 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/../layer23/include +CFLAGS = "-g -O0" + sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c l1ctl_sap.c gsmtapl1_if.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c -virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_fbsb.c virt_prim_rach.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c +virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) +virtphy_LDFLAGS = -pthread # debug output all: diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index ebfb5b6..3762cdc 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#include static struct l1_model_ms *l1_model_ms = NULL; @@ -88,13 +90,13 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint32_t fn, - struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; struct msgb *outmsg; // msg to send with gsmtap header prepended + uint32_t fn = gsm_gsmtime2fn(&l1_model_ms->state->downlink_time); uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; // arfcn of the cell we currently camp on uint8_t signal_dbm = 63; // signal strength, 63 is best uint8_t snr = 63; // signal noise ratio, 63 is best @@ -138,9 +140,9 @@ /** * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint32_t fn, struct msgb *msg). */ -void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg) +void gsmtapl1_tx_to_virt_um(struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, fn, msg); + gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, msg); } /** @@ -152,9 +154,15 @@ if (!msg) { return; } - // we assume we only receive msgs if we actually camp on a cell - if (!l1_model_ms->state->camping) { + // we do not forward messages to l23 if we are in network search state + if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { talloc_free(msg); + return; + } + + // forward msg to fbsb sync routine if we are in sync state + if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { + prim_fbsb_sync(msg); return; } @@ -164,7 +172,7 @@ struct l1ctl_traffic_ind * l1ti; struct l1ctl_data_ind * l1di; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg - uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the cell we currently camp on + uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type uint8_t signal_dbm = gh->signal_dbm; // signal strength, 63 is best uint8_t snr = gh->snr_db; // signal noise ratio, 63 is best @@ -179,18 +187,23 @@ // see GSM 8.58 -> 9.3.1 for channel number encoding chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); + virt_l1_sched_sync_time(l1_model_ms->state->downlink_time, 0); + virt_l1_sched_execute(fn); + DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", arfcn, fn, get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); - // generally ignore all messages coming from another arfcn than the synced one + // generally ignore all messages coming from another arfcn than the camped one if (l1_model_ms->state->serving_cell.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn & GSMTAP_ARFCN_MASK, l1_model_ms->state->serving_cell.arfcn); goto nomessage; } + // generally ignore all uplink messages received if (arfcn & GSMTAP_ARFCN_F_UPLINK) { LOGP(DVIRPHY, LOGL_NOTICE, diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index b89d963..6e42e5d 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -17,6 +17,7 @@ #include #include #include +#include static struct l1_model_ms *l1_model_ms = NULL; @@ -38,6 +39,8 @@ void l1ctl_sap_init(struct l1_model_ms *model) { l1_model_ms = model; + prim_rach_init(model); + prim_fbsb_init(model); } /** @@ -193,11 +196,9 @@ break; case L1CTL_RACH_REQ: l1ctl_rx_rach_req(msg); - // msg is freed by rx routine goto exit_nofree; case L1CTL_DATA_REQ: l1ctl_rx_data_req(msg); - /* we have to keep the msgb, not free it! */ goto exit_nofree; case L1CTL_PM_REQ: l1ctl_rx_pm_req(msg); @@ -216,7 +217,6 @@ break; case L1CTL_TRAFFIC_REQ: l1ctl_rx_traffic_req(msg); - /* we have to keep the msgb, not free it! */ goto exit_nofree; case L1CTL_SIM_REQ: l1ctl_rx_sim_req(msg); @@ -224,49 +224,14 @@ } exit_msgbfree: msgb_free(msg); - exit_nofree: return; + exit_nofree: return; /* msg is scheduled for uplink and mustn't be freed here */ } /*************************************************************** * L1CTL RX ROUTINES ******************************************* + * For more routines check the respective handler classes ****** + * like virt_prim_rach.c *************************************** ***************************************************************/ - -/** - * @brief Handler for received L1CTL_FBSB_REQ from L23. - * - * -- frequency burst synchronisation burst request -- - * - * @param [in] msg the received message. - * - * Transmit frequency control and synchronisation bursts on FCCH and SCH to calibrate transceiver and search for base stations. - * Sync to a given arfcn. - * - * Note: ms will start receiving msgs on virtual um only after this req was received. - * Note: virt bts does not broadcast freq and sync bursts. - * - * TODO: Could be used to bind/connect to different virtual_bts sockets with a arfcn-socket mapping. - * TODO: Check flags if this is a sync or freq request and handle it accordingly. - */ -void l1ctl_rx_fbsb_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; - - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", - ntohs(sync_req->band_arfcn), sync_req->flags); - - l1_model_ms->state->camping = 1; - l1_model_ms->state->serving_cell.arfcn = ntohs(sync_req->band_arfcn); // freq req - - // not needed in virt um - l1_model_ms->state->serving_cell.ccch_mode = sync_req->ccch_mode; // sync req - l1_model_ms->state->serving_cell.fn_offset = 0; // sync req - l1_model_ms->state->serving_cell.bsic = 0; // sync req - l1_model_ms->state->serving_cell.time_alignment = 0; // sync req - - l1ctl_tx_fbsb_conf(0, l1_model_ms->state->serving_cell.arfcn); -} /** * @brief Handler for received L1CTL_DM_EST_REQ from L23. @@ -410,47 +375,6 @@ } /** - * @brief Handler for received L1CTL_RACH_REQ from L23. - * - * -- random access channel request -- - * - * @param [in] msg the received message. - * - * Transmit RACH request on RACH. Refer to 04.08 - 9.1.8 - Channel request. - * - */ -void l1ctl_rx_rach_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; - // FIXME: proper frame number - uint32_t fn_sched = 42; - - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", - rach_req->ra, ntohs(rach_req->offset), - rach_req->combined); - - // for the rach channel request, there is no layer2 header, but only the one bit ra content to submit - // replace l1ctl_rach_req with ra data that rly shall be submitted - // ra on peer side is decoded as uint16_t, but we do not use the 11bit option and thus 8bits must be sufficient - msg->l2h = msgb_put(msg, sizeof(uint8_t)); - *msg->l2h = rach_req->ra; - - // chan_nr is not specified in info_ul for rach request coming from l23, but needed in gsmtapl1_tx_to_virt_um() - ul->chan_nr = rsl_enc_chan_nr(RSL_CHAN_RACH, 0, 0); - ul->link_id = LID_DEDIC; - - // send rach over virt um - gsmtapl1_tx_to_virt_um(fn_sched, msg); - - // send confirm to layer23 - l1ctl_tx_rach_conf(fn_sched, l1_model_ms->state->serving_cell.arfcn); - -} - -/** * @brief Handler for received L1CTL_DATA_REQ from L23. * * -- data request -- @@ -466,8 +390,8 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; - // FIXME: proper frame number - uint32_t fn_sched = 42; + // TODO: calc the scheduled fn + uint32_t fn_sched = l1_model_ms->state->downlink_time.fn; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", @@ -476,8 +400,8 @@ msg->l2h = data_ind->data; - // send msg over virt um - gsmtapl1_tx_to_virt_um(fn_sched, msg); + // TODO: append to scheduler queue instead of sending here directly + gsmtapl1_tx_to_virt_um(msg); // send confirm to layer23 msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn_sched, 0, 0); @@ -560,11 +484,12 @@ case L1CTL_RES_T_FULL: DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); - l1_model_ms->state->camping = 0; - // TODO: check if we also need to reset the dedicated channel state + l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; + virt_l1_sched_stop(); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: + virt_l1_sched_restart(l1_model_ms->state->downlink_time); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); @@ -673,14 +598,15 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; - uint32_t fn_sched = 42; + // TODO: calc the scheduled fn + uint32_t fn_sched = l1_model_ms->state->downlink_time.fn; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; - // send msg over virt um - gsmtapl1_tx_to_virt_um(fn_sched, msg); + // TODO: append to scheduler queue instead of sending here directly + gsmtapl1_tx_to_virt_um(msg); // send confirm to layer23 msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn_sched, 0, 0); @@ -719,6 +645,8 @@ /*************************************************************** * L1CTL TX ROUTINES ******************************************* + * For more routines check the respective handler classes ****** + * like virt_prim_rach.c *************************************** ***************************************************************/ /** @@ -742,23 +670,6 @@ } /** - * @brief Transmit L1CTL_RESET_IND or L1CTL_RESET_CONF to layer 23. - * - * -- reset indication / confirm -- - * - * @param [in] msg_type L1CTL primitive message type. - * @param [in] reset_type reset type (full, boot or just scheduler reset). - */ -void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn) -{ - struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); - - DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", - getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); - l1ctl_sap_tx_to_l23(msg); -} - -/** * @brief Transmit L1CTL msg of a given type to layer 23. * * @param [in] msg_type L1CTL primitive message type. @@ -767,38 +678,6 @@ { struct msgb *msg = l1ctl_msgb_alloc(msg_type); DEBUGP(DL1C, "Sending to l23 - %s\n", getL1ctlPrimName(msg_type)); - l1ctl_sap_tx_to_l23(msg); -} - -/** - * @brief Transmit L1CTL_FBSB_CONF to l23. - * - * -- frequency burst synchronisation burst confirm -- - * - * @param [in] res 0 -> success, 255 -> error. - * @param [in] arfcn the arfcn we are synced to. - * - * No calculation needed for virtual pyh -> uses dummy values for a good link quality. - */ -void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) -{ - struct msgb *msg; - struct l1ctl_fbsb_conf *resp; - uint32_t fn = 0; // 0 should be okay here - uint16_t snr = 40; // signal noise ratio > 40db is best signal (unused in virt) - int16_t initial_freq_err = 0; // 0 means no error (unused in virt) - uint8_t bsic = 0; // bsci can be read from sync burst (unused in virt) - - msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, snr, arfcn); - - resp = (struct l1ctl_fbsb_conf *)msgb_put(msg, sizeof(*resp)); - resp->initial_freq_err = htons(initial_freq_err); - resp->result = res; - resp->bsic = bsic; - - DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", - getL1ctlPrimName(L1CTL_FBSB_CONF), res); - l1ctl_sap_tx_to_l23(msg); } diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c new file mode 100644 index 0000000..8df88ec --- /dev/null +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -0,0 +1,135 @@ +#include +#include +#include +#include +#include +#include + +static struct l1_model_ms *l1_model_ms = NULL; + +static LLIST_HEAD(mframe_item_list); + +/** + * @brief Initialize schedulers data structures. + */ +void virt_l1_sched_init(struct l1_model_ms * model) +{ + l1_model_ms = model; +} + +/** + * @brief Clear scheduler queue and completely restart scheduler. + */ +int virt_l1_sched_restart(struct gsm_time time) +{ + virt_l1_sched_stop(); + return virt_l1_sched_start(time); +} + +/** + * @brief Start scheduler thread based on current gsm time from model + */ +int virt_l1_sched_start(struct gsm_time time) +{ + virt_l1_sched_sync_time(time, 1); + return 0; +} + +/** + * @brief Sync scheduler with given time. + */ +void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset) +{ + l1_model_ms->state->current_time = time; +} + +/** + * @brief Stop the scheduler thread and cleanup mframe items queue + */ +void virt_l1_sched_stop() +{ + struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; + + /* Empty tdma and mframe sched items lists */ + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) + { + struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; + llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) + { + talloc_free(ti_next->msg); + llist_del(&ti_next->tdma_item_entry); + } + llist_del(&mi_next->mframe_item_entry); + talloc_free(mi_next); + } +} + +/** + * @brief Handle all pending scheduled items for the current frame number. + */ +void virt_l1_sched_execute(uint32_t fn) +{ + struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; + // FIXME: change of hyperframe and thus restarting fn at 0 may cause messages in the queue that are never handled + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) + { + if (mi_next->fn <= fn) { + struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; + // run through all scheduled tdma sched items for that frame number + llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) + { + // exec tdma sched item's handler callback + // TODO: we do not have a tdma scheduler currently and execute alle scheduled tdma items here at once + ti_next->handler_cb(ti_next->msg); + // remove handled tdma sched item + llist_del(&ti_next->tdma_item_entry); + } + // remove handled mframe sched item + llist_del(&mi_next->mframe_item_entry); + talloc_free(mi_next); + } else if (mi_next->fn > fn) { + /* break the loop as our list is ordered */ + break; + } + } +} + +/** + * @brief Schedule a msg to the given framenumber and timeslot. + */ +void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, + virt_l1_sched_cb * handler_cb) +{ + struct virt_l1_sched_mframe_item *mi_next = NULL, *mi_tmp = NULL, + *mi_fn = NULL; + struct virt_l1_sched_tdma_item *ti_new = NULL; + + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) + { + if (mi_next->fn == fn) { + mi_fn = mi_next; + break; + } else if (mi_next->fn > fn) { + break; + } + } + if (!mi_fn) { + // list did not contain mframe item with needed fn + mi_fn = talloc_zero(NULL, struct virt_l1_sched_mframe_item); + mi_fn->fn = fn; + // need to manually init the struct content.... no so happy + mi_fn->tdma_item_list.prev = &mi_fn->tdma_item_list; + mi_fn->tdma_item_list.next = &mi_fn->tdma_item_list; + + // TODO: check if we get an error if list is empty... + llist_add(&mi_fn->mframe_item_entry, + mi_next->mframe_item_entry.prev); + + } + ti_new = talloc_zero(mi_fn, struct virt_l1_sched_tdma_item); + ti_new->msg = msg; + ti_new->handler_cb = handler_cb; + ti_new->ts = ts; + // simply add at end, no ordering for tdma sched items currently + llist_add_tail(&ti_new->tdma_item_entry, &mi_fn->tdma_item_list); // TODO: ordered insert needed if tdma scheduler should be implemented +} diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c new file mode 100644 index 0000000..6a678d0 --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -0,0 +1,113 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static struct l1_model_ms *l1_model_ms = NULL; + +/** + * @brief Handler for received L1CTL_FBSB_REQ from L23. + * + * -- frequency burst synchronisation burst request -- + * + * @param [in] msg the received message. + * + * Transmit frequency control and synchronisation bursts on FCCH and SCH to calibrate transceiver and search for base stations. + * Sync to a given arfcn. + * + * Note: ms will start receiving msgs on virtual um only after this req was received. + * Note: virt bts does not broadcast freq and sync bursts. + * + */ +void l1ctl_rx_fbsb_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + ntohs(sync_req->band_arfcn), sync_req->flags); + + l1_model_ms->state->state = MS_STATE_IDLE_SYNCING; + l1_model_ms->state->fbsb.arfcn = ntohs(sync_req->band_arfcn); +} + +/** + * @brief A msg was received on l1 that can be used for synchronization. + * + * Note: for virtual layer 1 this can be a random downlink message, as we can parse the fn from the gsmtap header. + */ +void prim_fbsb_sync(struct msgb *msg) +{ + struct gsmtap_hdr *gh = msgb_l1(msg); + uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg + uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg + + // ignore messages from other arfcns as the one requested to sync to by l23 + if (l1_model_ms->state->fbsb.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { + talloc_free(msg); + return; + } + l1_model_ms->state->serving_cell.arfcn = (arfcn & GSMTAP_ARFCN_MASK); + l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; + /* Not needed in virtual phy */ + l1_model_ms->state->serving_cell.fn_offset = 0; + l1_model_ms->state->serving_cell.time_alignment = 0; + l1_model_ms->state->serving_cell.bsic = 0; + /* Update current gsm time each time we receive a message on the virt um */ + gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); + /* Restart scheduler */ + virt_l1_sched_restart(l1_model_ms->state->downlink_time); + talloc_free(msg); + l1ctl_tx_fbsb_conf(0, (arfcn & GSMTAP_ARFCN_MASK)); +} + +/** + * @brief Transmit L1CTL_FBSB_CONF to l23. + * + * -- frequency burst synchronisation burst confirm -- + * + * @param [in] res 0 -> success, 255 -> error. + * @param [in] arfcn the arfcn we are synced to. + * + * No calculation needed for virtual pyh -> uses dummy values for a good link quality. + */ +void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) +{ + struct msgb *msg; + struct l1ctl_fbsb_conf *resp; + uint32_t fn = 0; // 0 should be okay here + uint16_t snr = 40; // signal noise ratio > 40db is best signal (unused in virt) + int16_t initial_freq_err = 0; // 0 means no error (unused in virt) + uint8_t bsic = 0; // bsci can be read from sync burst (unused in virt) + + msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, snr, arfcn); + + resp = (struct l1ctl_fbsb_conf *)msgb_put(msg, sizeof(*resp)); + resp->initial_freq_err = htons(initial_freq_err); + resp->result = res; + resp->bsic = bsic; + + DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", + getL1ctlPrimName(L1CTL_FBSB_CONF), res); + + l1ctl_sap_tx_to_l23(msg); +} +/** + * @brief Initialize virtual prim rach. + * + * @param [in] model the l1 model instance + */ +void prim_fbsb_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c new file mode 100644 index 0000000..c558034 --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -0,0 +1,140 @@ +/* Layer 1 Random Access Channel Burst */ + +/* (C) 2010 by Dieter Spaar + * (C) 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 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 +#include +#include +#include + +#include + +static struct l1_model_ms *l1_model_ms = NULL; +static void virt_l1_sched_handler_cb(struct msgb * msg); + +// use if we have a combined uplink (RACH, SDCCH, ...) (see http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) +// if we have no combined channel config, uplink consists of only RACH +static uint8_t t3_to_rach_comb[51] = { + 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 26, 27, 27, 27, 27}; +static uint8_t rach_to_t3_comb[27] = { + 4, 5, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 45, 46}; + +/** + * @brief Handler callback function for RACH request. + * + * @param [in] msg the msg to sent over virtual um. + */ +static void virt_l1_sched_handler_cb(struct msgb * msg) +{ + gsmtapl1_tx_to_virt_um(msg); + l1ctl_tx_rach_conf(l1_model_ms->state->current_time.fn, + l1_model_ms->state->serving_cell.arfcn); +} + +/** + * @brief Handler for received L1CTL_RACH_REQ from L23. + * + * -- random access channel request -- + * + * @param [in] msg the received message. + * + * Transmit RACH request on RACH. Refer to 04.08 - 9.1.8 - Channel request. + * + */ +void l1ctl_rx_rach_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + uint32_t fn_sched; + uint8_t ts = 1; //FIXME mostly, ts 1 is used for rach, where can i get that info? System info? + uint16_t offset = ntohs(rach_req->offset); + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + rach_req->ra, offset, rach_req->combined); + + if (rach_req->ra == 0x03) { + fn_sched = 42; + } + + // set ra data to msg (8bits, the 11bit option is not used) + msg->l2h = msgb_put(msg, sizeof(uint8_t)); + *msg->l2h = rach_req->ra; + + // chan_nr need to be encoded here, as it is not set by l23 for the rach request, but needed by virt um + ul->chan_nr = rsl_enc_chan_nr(RSL_CHAN_RACH, 0, ts); + ul->link_id = LID_DEDIC; + + // sched fn calculation if we have a combined ccch channel configuration + if (rach_req->combined) { + /* add elapsed RACH slots to offset */ + offset += t3_to_rach_comb[l1_model_ms->state->current_time.t3]; + /* offset is the number of RACH slots in the future */ + fn_sched = l1_model_ms->state->current_time.fn - l1_model_ms->state->current_time.t3; + fn_sched += offset / 27 * 51; + fn_sched += rach_to_t3_comb[offset % 27]; + } else { + fn_sched = l1_model_ms->state->current_time.fn + offset; + } + + virt_l1_sched_schedule(msg, fn_sched, ts, &virt_l1_sched_handler_cb); + +} + +/** + * @brief Transmit L1CTL_RACH_CONF to layer 23. + * + * -- rach confirm -- + * + * @param [in] fn the fn on which the rach was sent + * @param [in] arfcn arfcn on which the rach was sent + */ +void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn) +{ + struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); + + DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", + getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Initialize virtual prim rach. + * + * @param [in] model the l1 model instance + */ +void prim_rach_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 977a358..c9e7bdd 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -11,6 +11,7 @@ #include #include #include +#include int main( int argc, char *argv[] ) { @@ -40,6 +41,7 @@ gsmtapl1_init(model); l1ctl_sap_init(model); + virt_l1_sched_init(model); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ Waiting for l23 app on", l1ctl_sock_path); -- To view, visit https://gerrit.osmocom.org/3204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8937b1d6568f5d3750bbdc5d77fa283074d5365e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:46 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Using IANA-registered port 4729 for GSMTAP for vir... Message-ID: Review at https://gerrit.osmocom.org/3205 VIRT-PHY: Using IANA-registered port 4729 for GSMTAP for virt um. Change-Id: Id8e262c9a9a6260353bfb98e774b9d0b6eecae53 --- M src/host/virt_phy/include/virtphy/virtual_um.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/05/3205/1 diff --git a/src/host/virt_phy/include/virtphy/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h index 5c883de..6e7c384 100644 --- a/src/host/virt_phy/include/virtphy/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -6,9 +6,9 @@ #define VIRT_UM_MSGB_SIZE 256 #define DEFAULT_MS_MCAST_GROUP "224.0.0.1" -#define DEFAULT_MS_MCAST_PORT 6666 +#define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ #define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" -#define DEFAULT_BTS_MCAST_PORT 6667 +#define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ struct virt_um_inst { void *priv; -- To view, visit https://gerrit.osmocom.org/3205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8e262c9a9a6260353bfb98e774b9d0b6eecae53 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:47 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Data and traffic req from l23 now use scheduler. Message-ID: Review at https://gerrit.osmocom.org/3206 VIRT-PHY: Data and traffic req from l23 now use scheduler. Msgs are not put on virt um directly in the handler like before, but are scheduled. FN they are scheduled with not yet properly calculated. Also, code was extracted from lactl_sap.c into own files. Change-Id: Ibe57abebadf294f1407d82cef3fd0b51e7c1b23e --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c A src/host/virt_phy/src/virt_prim_data.c A src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 8 files changed, 202 insertions(+), 67 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/06/3206/1 diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index c11c5fe..b82745c 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -20,6 +20,8 @@ void l1ctl_sap_init(struct l1_model_ms *model); void prim_rach_init(struct l1_model_ms *model); +void prim_data_init(struct l1_model_ms *model); +void prim_traffic_init(struct l1_model_ms *model); void prim_fbsb_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index fd8d5d9..ae14ef6 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -4,7 +4,7 @@ CFLAGS = "-g -O0" sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_fbsb.c virt_prim_rach.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) virtphy_LDFLAGS = -pthread diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 3762cdc..6ab9edc 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -146,6 +146,11 @@ } /** + * @see virt_prim_fbsb.c + */ +extern void prim_fbsb_sync(struct msgb *msg); + +/** * Receive a gsmtap message from the virt um. */ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 6e42e5d..1fb4a42 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -41,6 +41,8 @@ l1_model_ms = model; prim_rach_init(model); prim_fbsb_init(model); + prim_data_init(model); + prim_traffic_init(model); } /** @@ -375,40 +377,6 @@ } /** - * @brief Handler for received L1CTL_DATA_REQ from L23. - * - * -- data request -- - * - * @param [in] msg the received message. - * - * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). - * - * TODO: Check if a msg on FACCH is coming in here and needs special handling. - */ -void l1ctl_rx_data_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; - // TODO: calc the scheduled fn - uint32_t fn_sched = l1_model_ms->state->downlink_time.fn; - - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", - ul->link_id, ul, ul->payload, data_ind, data_ind->data, - msg->l3h); - - msg->l2h = data_ind->data; - - // TODO: append to scheduler queue instead of sending here directly - gsmtapl1_tx_to_virt_um(msg); - - // send confirm to layer23 - msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn_sched, 0, 0); - l1ctl_sap_tx_to_l23(msg); -} - -/** * @brief Handler for received L1CTL_PM_REQ from L23. * * -- power measurement request -- @@ -581,36 +549,6 @@ DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", pm_req->n); -} - -/** - * @brief Handler for received L1CTL_TRAFFIC_REQ from L23. - * - * -- traffic request -- - * - * @param [in] msg the received message. - * - * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. In virtual layer1 just submit it to the virt um. - * - */ -void l1ctl_rx_traffic_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; - // TODO: calc the scheduled fn - uint32_t fn_sched = l1_model_ms->state->downlink_time.fn; - - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); - - msg->l2h = tr->data; - - // TODO: append to scheduler queue instead of sending here directly - gsmtapl1_tx_to_virt_um(msg); - - // send confirm to layer23 - msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn_sched, 0, 0); - l1ctl_sap_tx_to_l23(msg); } /** diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index c28da60..ada251c 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -82,7 +82,7 @@ if (rc == len) { msgb_put(msg, rc); - l1h = msgb_data(msg); + l1h = (void *) msgb_data(msg); msg->l1h = l1h; lsi->recv_cb(lsi, msg); return 0; diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c new file mode 100644 index 0000000..25036cc --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -0,0 +1,98 @@ +/* Layer 1 normal data burst tx handling */ + +/* (C) 2010 by Dieter Spaar + * (C) 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 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 +#include +#include +#include + +#include + +static struct l1_model_ms *l1_model_ms = NULL; +static void virt_l1_sched_handler_cb(struct msgb * msg); + +/** + * @brief Handler callback function for DATA request. + * + * @param [in] msg the msg to sent over virtual um. + */ +static void virt_l1_sched_handler_cb(struct msgb * msg) +{ + gsmtapl1_tx_to_virt_um(msg); + // send confirm to layer23 + // FIXME: as we might send multiple burst, the base fn may be another one than the current + msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, l1_model_ms->state->current_time.fn, 0, 0); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Handler for received L1CTL_DATA_REQ from L23. + * + * -- data request -- + * + * @param [in] msg the received message. + * + * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). + * + * TODO: Check if a msg on FACCH is coming in here and needs special handling. + * TODO: Check if msg contains data of a burst or data of 4 bursts! + */ +void l1ctl_rx_data_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; + // TODO: calc the scheduled fn + uint32_t fn_sched = l1_model_ms->state->current_time.fn; + uint8_t rsl_chantype, subslot, timeslot; + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", + ul->link_id, ul, ul->payload, data_ind, data_ind->data, + msg->l3h); + + msg->l2h = data_ind->data; + + virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); + +} + +/** + * @brief Initialize virtual prim data. + * + * @param [in] model the l1 model instance + */ +void prim_data_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c new file mode 100644 index 0000000..5660945 --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -0,0 +1,92 @@ +/* Layer 1 normal data burst tx handling */ + +/* (C) 2010 by Dieter Spaar + * (C) 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 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 +#include +#include +#include + +#include + +static struct l1_model_ms *l1_model_ms = NULL; +static void virt_l1_sched_handler_cb(struct msgb * msg); + +/** + * @brief Handler callback function for TRAFFIC request. + * + * @param [in] msg the msg to sent over virtual um. + */ +static void virt_l1_sched_handler_cb(struct msgb * msg) +{ + gsmtapl1_tx_to_virt_um(msg); + // send confirm to layer23 + msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, + l1_model_ms->state->current_time.fn, 0, 0); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Handler for received L1CTL_TRAFFIC_REQ from L23. + * + * -- traffic request -- + * + * @param [in] msg the received message. + * + * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. In virtual layer1 just submit it to the virt um. + * + */ +void l1ctl_rx_traffic_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; + // TODO: calc the scheduled fn + uint32_t fn_sched = l1_model_ms->state->current_time.fn; + uint8_t rsl_chantype, subslot, timeslot; + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + + msg->l2h = tr->data; + + virt_l1_sched_schedule(msg, fn_sched, timeslot, + &virt_l1_sched_handler_cb); +} + +/** + * @brief Initialize virtual prim traffic. + * + * @param [in] model the l1 model instance + */ +void prim_traffic_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index c9e7bdd..70265a0 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -44,7 +44,7 @@ virt_l1_sched_init(model); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ - Waiting for l23 app on", l1ctl_sock_path); + Waiting for l23 app on %s", l1ctl_sock_path); while (1) { // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) -- To view, visit https://gerrit.osmocom.org/3206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe57abebadf294f1407d82cef3fd0b51e7c1b23e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:47 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Fixed error causing send msgs to be received on sa... Message-ID: Review at https://gerrit.osmocom.org/3207 VIRT-PHY: Fixed error causing send msgs to be received on same sock. This could be disabled setting socket option IP_MULTICAST_ALL = 0. Change-Id: Ia2838c4cd39bfac04c014b4c8512466b301d8875 --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/07/3207/1 diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index acc6bcb..ff81063 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -52,7 +52,7 @@ struct mcast_client_sock); struct sockaddr_in *rx_sock_conf = talloc_zero(NULL, struct sockaddr_in); - int rc, reuseaddr = 1, loopback = 1; + int rc, reuseaddr = 1, loopback = 1, all = 0; client_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); client_sock->mcast_group = talloc_zero(ctx, struct ip_mreq); @@ -107,6 +107,14 @@ return NULL; } + // this option will set the delivery option so that only packages are received + // from sockets we are bound to via IP_ADD_MEMBERSHIP + if (setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, + IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { + perror("Failed to modify delivery policy to explicitly joined.\n"); + return NULL; + } + // configure and register the osmocom filedescriptor client_sock->osmo_fd->cb = fd_rx_cb; client_sock->osmo_fd->when = BSC_FD_READ; -- To view, visit https://gerrit.osmocom.org/3207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2838c4cd39bfac04c014b4c8512466b301d8875 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:47 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Calculate correct scheduler fn for data- and tch-m... Message-ID: Review at https://gerrit.osmocom.org/3208 VIRT-PHY: Calculate correct scheduler fn for data- and tch-msgs on ul. Proper calculation of the scheduled frame number and appending the jobs with that fn to the scheduler. Thus uplink msgs are scheduled at the (approx.) correct fn and with this fn set in the gsmtap hdr. Change-Id: I0f44d0b5b9208755e671c619d1f851a043aefb54 --- M src/host/virt_phy/.gitignore M src/host/virt_phy/include/virtphy/gsmtapl1_if.h M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/virt_l1_sched.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c 10 files changed, 385 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/08/3208/1 diff --git a/src/host/virt_phy/.gitignore b/src/host/virt_phy/.gitignore index 1e19c7f..0d2eba0 100644 --- a/src/host/virt_phy/.gitignore +++ b/src/host/virt_phy/.gitignore @@ -1,3 +1,4 @@ config.h config.h.in -src/virtphy \ No newline at end of file +src/virtphy +.dirstamp diff --git a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h index 34cd9c8..d8a4367 100644 --- a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -10,7 +10,7 @@ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); void gsmtapl1_rx_from_virt_um(struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_tx_to_virt_um(struct msgb *msg); +void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg); void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, uint8_t *link_id); diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index b82745c..acf8f98 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -60,3 +60,7 @@ void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode); void l1ctl_tx_msg(uint8_t msg_type); + +/* scheduler functions */ +uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, + uint8_t link_id); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_sched.h b/src/host/virt_phy/include/virtphy/virt_l1_sched.h index a68c58d..de08550 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_sched.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_sched.h @@ -5,7 +5,7 @@ #include #include -typedef void virt_l1_sched_cb(struct msgb * msg); +typedef void virt_l1_sched_cb(uint32_t fn, struct msgb * msg); /* bucket containing items to be executed for a specific mframe number */ struct virt_l1_sched_mframe_item { diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 6ab9edc..76941cd 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -90,13 +90,12 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; struct msgb *outmsg; // msg to send with gsmtap header prepended - uint32_t fn = gsm_gsmtime2fn(&l1_model_ms->state->downlink_time); uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; // arfcn of the cell we currently camp on uint8_t signal_dbm = 63; // signal strength, 63 is best uint8_t snr = 63; // signal noise ratio, 63 is best @@ -140,9 +139,9 @@ /** * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint32_t fn, struct msgb *msg). */ -void gsmtapl1_tx_to_virt_um(struct msgb *msg) +void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, msg); + gsmtapl1_tx_to_virt_um_inst(fn, l1_model_ms->vui, msg); } /** diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 1fb4a42..71bb554 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -666,3 +666,351 @@ l1ctl_sap_tx_to_l23(msg); } +/** + * @brief Get the scheduled fn for a msg depending on its chan_nr and link_id. + */ +uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, + uint8_t link_id) +{ + uint8_t chan_type, chan_ss, chan_ts; + rsl_dec_chan_nr(chan_nr, &chan_type, &chan_ss, &chan_ts); + + uint32_t sched_fn = cur_time.fn; + uint16_t mod_102 = cur_time.fn % 2 * 51; + switch (chan_type) { + case RSL_CHAN_Bm_ACCHs: + switch (link_id) { + case LID_DEDIC: + // dl=[0...11,13...24] ul=[0...11,13...24] + // skip idle frames and frames reserved for TCH_ACCH + if(cur_time.t2 == 12 || cur_time.t2 == 25) { + sched_fn++; + } + break; + // dl=42, ul=42+15 + case LID_SACCH: + if((chan_ts & 1)) { + // Odd traffic channel timeslot -> dl=[25] ul=[25] + // TCH_ACCH always at the end of tch multiframe (mod 26) + sched_fn -= cur_time.t2; + sched_fn += 25; + } + else { + // Even traffic channel timeslot -> dl=[12] ul=[12] + if(cur_time.t2 <= 12) { + sched_fn -= cur_time.t2; + sched_fn += 12; + } else { + sched_fn -= cur_time.t2; + sched_fn += 26 + 12; + } + + } + break; + } + break; + case RSL_CHAN_Lm_ACCHs: + break; /* TCH/H not supported */ + case RSL_CHAN_SDCCH4_ACCH: + switch (chan_ss) { + case 0: + switch (link_id) { + // dl=22, ul=22+15 + case LID_DEDIC: + if(cur_time.t3 <= 22 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 22 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 22 + 15; + } + break; + // dl=42, ul=42+15 + case LID_SACCH: + if(mod_102 <= 42 + 15) { + sched_fn -= mod_102; + sched_fn += 42 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 42 + 15; + } + break; + } + break; + case 1: + switch (link_id) { + // dl=26, ul=26+15 + case LID_DEDIC: + if(cur_time.t3 <= 26 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 26 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 26 + 15; + } + break; + // dl=46, ul=46+15 + case LID_SACCH: + if(mod_102 <= 46 + 15) { + sched_fn -= mod_102; + sched_fn += 46 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 46 + 15; + } + break; + } + break; + case 2: + switch (link_id) { + // dl=32, ul=32+15 + case LID_DEDIC: + if(cur_time.t3 <= 32 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 32 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 32 + 15; + } + break; + // dl=51+42, ul=51+42+15 + case LID_SACCH: + if(mod_102 <= 51 + 42 + 15) { + sched_fn -= mod_102; + sched_fn += 51 + 42 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 51 + 42 + 15; + } + break; + } + break; + case 3: + switch (link_id) { + // dl=36, ul=36+15 + case LID_DEDIC: + if(cur_time.t3 <= 36 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 36 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 36 + 15; + } + break; + // dl=51+46, ul=51+46+15 + case LID_SACCH: + if(mod_102 <= 51 + 46 + 15) { + sched_fn -= mod_102; + sched_fn += 51 + 46 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 51 + 46 + 15; + } + break; + } + break; + } + break; + case RSL_CHAN_SDCCH8_ACCH: + switch (chan_ss) { + case 0: + switch (link_id) { + // dl=0, ul=0+15 + case LID_DEDIC: + if(cur_time.t3 <= 0 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 0 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 0 + 15; + } + break; + // dl=32, ul=32+15 + case LID_SACCH: + if(mod_102 <= 32 + 15) { + sched_fn -= mod_102; + sched_fn += 32 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 32 + 15; + } + break; + } + break; + case 1: + switch (link_id) { + // dl=4, ul=4+15 + case LID_DEDIC: + if(cur_time.t3 <= 4 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 4 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 4 + 15; + } + break; + // dl=36, ul=36+15 + case LID_SACCH: + if(mod_102 <= 36 + 15) { + sched_fn -= mod_102; + sched_fn += 36 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 36 + 15; + } + break; + } + break; + case 2: + switch (link_id) { + // dl=8, ul=8+15 + case LID_DEDIC: + if(cur_time.t3 <= 8 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 8 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 8 + 15; + } + break; + // dl=40, ul=40+15 + case LID_SACCH: + if(mod_102 <= 40 + 15) { + sched_fn -= mod_102; + sched_fn += 40 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 40 + 15; + } + break; + } + break; + case 3: + switch (link_id) { + // dl=12, ul=12+15 + case LID_DEDIC: + if(cur_time.t3 <= 12 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 12 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 12 + 15; + } + break; + // dl=44, ul=44+15 + case LID_SACCH: + if(mod_102 <= 44 + 15) { + sched_fn -= mod_102; + sched_fn += 44 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 44 + 15; + } + break; + } + break; + case 4: + switch (link_id) { + // dl=16, ul=16+15 + case LID_DEDIC: + if(cur_time.t3 <= 16 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 16 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 16 + 15; + } + break; + // dl=51+32, ul=51+32+15 + case LID_SACCH: + if(mod_102 <= 51 + 32 + 15) { + sched_fn -= mod_102; + sched_fn += 51 + 32 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 51 + 32 + 15; + } + break; + } + break; + case 5: + switch (link_id) { + // dl=20, ul=36+15 + case LID_DEDIC: + if(cur_time.t3 <= 20 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 20 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 20 + 15; + } + break; + // dl=51+36, ul=51+36+15 ==> 0 + case LID_SACCH: + if(mod_102 <= 0) { + sched_fn -= mod_102; + sched_fn += 0; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 0; + } + break; + } + break; + case 6: + switch (link_id) { + // dl=24, ul=24+15 + case LID_DEDIC: + if(cur_time.t3 <= 24 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 24 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 24 + 15; + } + break; + // dl=51+40, ul=51+40+15 ==> 4 + case LID_SACCH: + if(mod_102 <= 4) { + sched_fn -= mod_102; + sched_fn += 4; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 4; + } + break; + } + break; + case 7: + switch (link_id) { + // dl=28, ul=28+15 + case LID_DEDIC: + if(cur_time.t3 <= 28 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 28 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 28 + 15; + } + break; + // dl=51+44, ul=51+44+15 ==> 8 + case LID_SACCH: + if(mod_102 <= 8) { + sched_fn -= mod_102; + sched_fn += 8; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 8; + } + break; + } + break; + } + break; + case RSL_CHAN_RACH: + break; /* Use virt_prim_rach.c for calculation of sched fn for rach */ + default: + break; /* Use current fn as default */ + } + return sched_fn; +} diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index 8df88ec..fbb5423 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -80,7 +80,7 @@ { // exec tdma sched item's handler callback // TODO: we do not have a tdma scheduler currently and execute alle scheduled tdma items here at once - ti_next->handler_cb(ti_next->msg); + ti_next->handler_cb(mi_next->fn, ti_next->msg); // remove handled tdma sched item llist_del(&ti_next->tdma_item_entry); } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 25036cc..932683c 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -1,4 +1,4 @@ -/* Layer 1 normal data burst tx handling */ +/* Layer 1 normal data burst uplink handling and scheduling */ /* (C) 2010 by Dieter Spaar * (C) 2010 by Harald Welte @@ -37,19 +37,19 @@ #include static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(struct msgb * msg); +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); /** * @brief Handler callback function for DATA request. * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct msgb * msg) +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(msg); + gsmtapl1_tx_to_virt_um(fn, msg); // send confirm to layer23 - // FIXME: as we might send multiple burst, the base fn may be another one than the current - msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, l1_model_ms->state->current_time.fn, 0, 0); + msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, + fn, 0, 0); l1ctl_sap_tx_to_l23(msg); } @@ -62,28 +62,26 @@ * * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). * - * TODO: Check if a msg on FACCH is coming in here and needs special handling. - * TODO: Check if msg contains data of a burst or data of 4 bursts! + * TODO: Check if a msg on FACCH needs special handling. */ void l1ctl_rx_data_req(struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; - // TODO: calc the scheduled fn - uint32_t fn_sched = l1_model_ms->state->current_time.fn; uint8_t rsl_chantype, subslot, timeslot; + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", - ul->link_id, ul, ul->payload, data_ind, data_ind->data, - msg->l3h); + "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", + ul->link_id, ul, ul->payload, data_ind, data_ind->data, + msg->l3h); msg->l2h = data_ind->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(msg, fn_sched, timeslot, + &virt_l1_sched_handler_cb); } diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index c558034..e455e06 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -37,7 +37,7 @@ #include static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(struct msgb * msg); +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); // use if we have a combined uplink (RACH, SDCCH, ...) (see http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) // if we have no combined channel config, uplink consists of only RACH @@ -54,10 +54,10 @@ * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct msgb * msg) +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(msg); - l1ctl_tx_rach_conf(l1_model_ms->state->current_time.fn, + gsmtapl1_tx_to_virt_um(fn, msg); + l1ctl_tx_rach_conf(fn, l1_model_ms->state->serving_cell.arfcn); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 5660945..0175b8d 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -37,19 +37,19 @@ #include static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(struct msgb * msg); +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); /** * @brief Handler callback function for TRAFFIC request. * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct msgb * msg) +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(msg); + gsmtapl1_tx_to_virt_um(fn, msg); // send confirm to layer23 msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, - l1_model_ms->state->current_time.fn, 0, 0); + fn, 0, 0); l1ctl_sap_tx_to_l23(msg); } @@ -68,11 +68,10 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; - // TODO: calc the scheduled fn - uint32_t fn_sched = l1_model_ms->state->current_time.fn; uint8_t rsl_chantype, subslot, timeslot; - rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; -- To view, visit https://gerrit.osmocom.org/3208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0f44d0b5b9208755e671c619d1f851a043aefb54 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:47 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Scheduler - correct handling over hyperframe repeat. Message-ID: Review at https://gerrit.osmocom.org/3209 VIRT-PHY: Scheduler - correct handling over hyperframe repeat. Scheduler will no longer skip tasks that are scheduler for a framenumber greater than the current fn because of a hyperframe repetition. Change-Id: I683ba18b5dee308d58f9a95a0ee10e22da207eda --- M src/host/virt_phy/src/virt_l1_sched_simple.c 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/09/3209/1 diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index fbb5423..d3975ee 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -9,6 +9,8 @@ static LLIST_HEAD(mframe_item_list); +static uint32_t last_exec_fn = 0; + /** * @brief Initialize schedulers data structures. */ @@ -70,10 +72,16 @@ void virt_l1_sched_execute(uint32_t fn) { struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; - // FIXME: change of hyperframe and thus restarting fn at 0 may cause messages in the queue that are never handled + uint8_t hyperframe_restart = fn < last_exec_fn; + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { - if (mi_next->fn <= fn) { + /* execute all registered handler for current mf sched item */ + uint8_t exec_now = mi_next->fn <= fn || (hyperframe_restart && mi_next->fn > last_exec_fn); + /* break loop, as we have an ordered list in case the hyperframe had not been reset */ + uint8_t break_now = mi_next->fn > fn && !hyperframe_restart; + + if(exec_now) { struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; // run through all scheduled tdma sched items for that frame number llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) @@ -87,11 +95,13 @@ // remove handled mframe sched item llist_del(&mi_next->mframe_item_entry); talloc_free(mi_next); - } else if (mi_next->fn > fn) { - /* break the loop as our list is ordered */ + } + + if(break_now) { break; } } + last_exec_fn = fn; } /** -- To view, visit https://gerrit.osmocom.org/3209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I683ba18b5dee308d58f9a95a0ee10e22da207eda Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:48 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Fixed FACCH processing on TCH. Message-ID: Review at https://gerrit.osmocom.org/3210 VIRT-PHY: Fixed FACCH processing on TCH. As TCH is not supported in GSMTAP yet, all incoming frames on the virt-phy are forwarded as FACCH to the l23 for now. Cleanup code in virt_prim_data and virt_prim_traffic. Change-Id: I6b41f21b6984e62ad98edfe4398bd678d5b2dad5 --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_traffic.c 6 files changed, 160 insertions(+), 94 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/10/3210/1 diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index acf8f98..71d4765 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -55,12 +55,21 @@ /* transmit routines */ void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type); void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn); +void l1ctl_tx_data_conf(uint32_t fn, uint16_t snr, uint16_t arfcn); +void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, + uint8_t signal_dbm, uint8_t num_biterr, + uint8_t fire_crc); +void l1ctl_tx_traffic_conf(uint32_t fn, uint16_t snr, uint16_t arfcn); +void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, + uint8_t signal_dbm, uint8_t num_biterr, + uint8_t fire_crc); void l1ctl_tx_pm_conf(struct l1ctl_pm_req *pm_req); void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn); void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode); -void l1ctl_tx_msg(uint8_t msg_type); /* scheduler functions */ uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, - uint8_t link_id); + uint8_t link_id); diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 76941cd..3cb0df9 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -51,8 +51,8 @@ {GSMTAP_CHANNEL_SDCCH, "SDCCH"}, {GSMTAP_CHANNEL_SDCCH4, "SDCCH/4"}, {GSMTAP_CHANNEL_SDCCH8, "SDCCH/8"}, - {GSMTAP_CHANNEL_TCH_F, "FACCH/F"}, - {GSMTAP_CHANNEL_TCH_H, "FACCH/H"}, + {GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F"}, + {GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H"}, {GSMTAP_CHANNEL_PACCH, "PACCH"}, {GSMTAP_CHANNEL_CBCH52, "CBCH"}, {GSMTAP_CHANNEL_PDCH, "PDCH"}, @@ -90,7 +90,8 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, + struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; @@ -112,21 +113,22 @@ // arfcn needs to be flagged to be able to distinguish between uplink and downlink outmsg = gsmtap_makemsg(arfcn | GSMTAP_ARFCN_F_UPLINK, timeslot, - gsmtap_chan, subslot, fn, signal_dbm, snr, data, - data_len); + gsmtap_chan, subslot, fn, signal_dbm, snr, data, + data_len); if (outmsg) { outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); if (virt_um_write_msg(l1_model_ms->vui, outmsg) == -1) { - LOGP(DVIRPHY, LOGL_ERROR, - "Gsmtap msg could not send to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, - gh->timeslot, gh->sub_slot); + LOGP(DVIRPHY, + LOGL_ERROR, + "Gsmtap msg could not send to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, gh->timeslot, + gh->sub_slot); } else { DEBUGP(DVIRPHY, - "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, - gh->timeslot, gh->sub_slot); + "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, gh->timeslot, + gh->sub_slot); } } else { LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); @@ -172,9 +174,6 @@ struct gsmtap_hdr *gh = msgb_l1(msg); struct msgb *l1ctl_msg = NULL; - struct l1ctl_info_dl *l1dl; - struct l1ctl_traffic_ind * l1ti; - struct l1ctl_data_ind * l1di; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type @@ -196,22 +195,25 @@ virt_l1_sched_execute(fn); DEBUGP(DVIRPHY, - "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", - arfcn, fn, get_value_string(gsmtap_types, gh->type), - get_value_string(gsmtap_channels, gsmtap_chantype), - timeslot, subslot, rsl_chantype, link_id, chan_nr); + "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", + arfcn, fn, get_value_string(gsmtap_types, gh->type), + get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, + subslot, rsl_chantype, link_id, chan_nr); // generally ignore all messages coming from another arfcn than the camped one if (l1_model_ms->state->serving_cell.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn & GSMTAP_ARFCN_MASK, l1_model_ms->state->serving_cell.arfcn); + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", + arfcn & GSMTAP_ARFCN_MASK, + l1_model_ms->state->serving_cell.arfcn); goto nomessage; } // generally ignore all uplink messages received if (arfcn & GSMTAP_ARFCN_F_UPLINK) { LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + "Ignoring gsmtap msg from virt um - uplink flag set!\n"); goto nomessage; } @@ -219,54 +221,25 @@ switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { case GSMTAP_CHANNEL_TCH_H: case GSMTAP_CHANNEL_TCH_F: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); - l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_info_dl)); - l1ti = (struct l1ctl_traffic_ind *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_traffic_ind)); - - l1dl->band_arfcn = htons(arfcn); - l1dl->link_id = link_id; - l1dl->chan_nr = chan_nr; - l1dl->frame_nr = htonl(fn); - l1dl->snr = snr; - l1dl->rx_level = signal_dbm; - l1dl->num_biterr = 0; // no biterrors - l1dl->fire_crc = 0; - - // TODO: traffic decoding and decryption - - memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); - break; +#if(0) + // TODO: handle msgs on TCH that are neither FACCH nor TCH/ACCH + if(!facch && ! tch_acch) { + l1ctl_tx_traffic_ind(msg, arfcn, link_id, chan_nr, fn, + snr, signal_dbm, 0, 0); + } +#endif case GSMTAP_CHANNEL_SDCCH4: case GSMTAP_CHANNEL_SDCCH8: - // TODO: we might need to implement own channel handling for standalone dedicated channels case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); - l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_info_dl)); - l1di = (struct l1ctl_data_ind *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_data_ind)); - - l1dl->band_arfcn = htons(arfcn); - l1dl->link_id = link_id; - l1dl->chan_nr = chan_nr; - l1dl->frame_nr = htonl(fn); - l1dl->snr = snr; - l1dl->rx_level = signal_dbm; - l1dl->num_biterr = 0; // no biterrors - l1dl->fire_crc = 0; // TODO: check if this means fire crc is not used or crc produced no error - - // TODO: data decoding and decryption - - memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - + l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, + signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); break; case GSMTAP_CHANNEL_SDCCH: case GSMTAP_CHANNEL_CCCH: @@ -275,12 +248,14 @@ case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type not supported!\n"); break; default: - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type unknown.\n"); break; } @@ -288,7 +263,7 @@ if (l1ctl_msg) { l1ctl_sap_tx_to_l23(l1ctl_msg); } -nomessage: + nomessage: // handle memory deallocation talloc_free(msg); } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 71bb554..c03da3b 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -149,7 +149,7 @@ dl = (struct l1ctl_info_dl *)msgb_put(msg, sizeof(*dl)); dl->frame_nr = htonl(fn); - dl->snr = snr; + dl->snr = htons(snr); dl->band_arfcn = htons(arfcn); return msg; @@ -604,18 +604,6 @@ DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); - l1ctl_sap_tx_to_l23(msg); -} - -/** - * @brief Transmit L1CTL msg of a given type to layer 23. - * - * @param [in] msg_type L1CTL primitive message type. - */ -void l1ctl_tx_msg(uint8_t msg_type) -{ - struct msgb *msg = l1ctl_msgb_alloc(msg_type); - DEBUGP(DL1C, "Sending to l23 - %s\n", getL1ctlPrimName(msg_type)); l1ctl_sap_tx_to_l23(msg); } diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 1cfb40f..88ffd22 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -87,7 +87,7 @@ log_add_target(stderr_target); log_set_all_filter(stderr_target, 1); //log_set_log_level(stderr_target, 1); - log_set_print_filename(stderr_target, 0); + log_set_print_filename(stderr_target, 1); log_set_use_color(stderr_target, 0); log_set_print_timestamp(stderr_target, 1); log_set_print_category(stderr_target, 1); diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 932683c..5d62afd 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -42,15 +42,13 @@ /** * @brief Handler callback function for DATA request. * + * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { gsmtapl1_tx_to_virt_um(fn, msg); - // send confirm to layer23 - msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, - fn, 0, 0); - l1ctl_sap_tx_to_l23(msg); + l1ctl_tx_data_conf(fn, 0, l1_model_ms->state->serving_cell.arfcn); } /** @@ -70,7 +68,8 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, + ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, @@ -85,6 +84,53 @@ } +void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, + uint8_t signal_dbm, uint8_t num_biterr, uint8_t fire_crc) +{ + struct msgb *l1ctl_msg = NULL; + struct l1ctl_data_ind * l1di; + struct l1ctl_info_dl * l1dl; + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_info_dl)); + l1di = (struct l1ctl_data_ind *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_data_ind)); + + l1dl->band_arfcn = htons(arfcn); + l1dl->link_id = link_id; + l1dl->chan_nr = chan_nr; + l1dl->frame_nr = htonl(fn); + l1dl->snr = snr; + l1dl->rx_level = signal_dbm; + l1dl->num_biterr = 0; // no biterrors + l1dl->fire_crc = 0; + + // TODO: data decoding and decryption + + memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); + + DEBUGP(DL1C, "Sending signaling-data to l23.\n"); + l1ctl_sap_tx_to_l23(l1ctl_msg); + +} + +/** + * @brief Send a L1CTL_DATA_CONF to L23. + * + * @param [in] fn frame number + * @param [in] snr signal noise ratio + * @param [in] arfcn arfcn of the cell the message was send on + * + */ +void l1ctl_tx_data_conf(uint32_t fn, uint16_t snr, uint16_t arfcn) +{ + struct msgb * l1ctl_msg; + l1ctl_msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn, snr, arfcn); + // send confirm to layer23 + l1ctl_sap_tx_to_l23(l1ctl_msg); +} + /** * @brief Initialize virtual prim data. * diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 0175b8d..dbdcac3 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -42,15 +42,13 @@ /** * @brief Handler callback function for TRAFFIC request. * + * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { gsmtapl1_tx_to_virt_um(fn, msg); - // send confirm to layer23 - msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, - fn, 0, 0); - l1ctl_sap_tx_to_l23(msg); + l1ctl_tx_traffic_conf(fn, 0, l1_model_ms->state->serving_cell.arfcn); } /** @@ -69,7 +67,8 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, + ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); @@ -80,6 +79,55 @@ &virt_l1_sched_handler_cb); } +void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, + uint8_t signal_dbm, uint8_t num_biterr, + uint8_t fire_crc) +{ + struct msgb *l1ctl_msg = NULL; + struct l1ctl_traffic_ind * l1ti; + struct l1ctl_info_dl * l1dl; + uint8_t rsl_chan_type, subchan, timeslot; + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); + l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_info_dl)); + l1ti = (struct l1ctl_traffic_ind *)msgb_put( + l1ctl_msg, sizeof(struct l1ctl_traffic_ind)); + + rsl_dec_chan_nr(chan_nr, &rsl_chan_type, &subchan, ×lot); + + l1dl->band_arfcn = htons(arfcn); + l1dl->link_id = link_id; + l1dl->chan_nr = chan_nr; + l1dl->frame_nr = htonl(fn); + l1dl->snr = snr; + l1dl->rx_level = signal_dbm; + l1dl->num_biterr = 0; // no biterrors + l1dl->fire_crc = 0; + + // TODO: traffic decoding and decryption + + memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); + DEBUGP(DL1C, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); + l1ctl_sap_tx_to_l23(l1ctl_msg); +} + +/** + * @brief Send a L1CTL_TRAFFIC_CONF to L23. + * + * @param [in] fn frame number + * @param [in] snr signal noise ratio + * @param [in] arfcn arfcn of the cell the message was send on + * + */ +void l1ctl_tx_traffic_conf(uint32_t fn, uint16_t snr, uint16_t arfcn) +{ + struct msgb * l1ctl_msg; + l1ctl_msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn, snr, arfcn); + // send confirm to layer23 + l1ctl_sap_tx_to_l23(l1ctl_msg); +} + /** * @brief Initialize virtual prim traffic. * -- To view, visit https://gerrit.osmocom.org/3210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6b41f21b6984e62ad98edfe4398bd678d5b2dad5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:48 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Fixed power management and PCS sync. Message-ID: Review at https://gerrit.osmocom.org/3211 VIRT-PHY: Fixed power management and PCS sync. PCS flag was ignored in fbsb. Power management returned a perfect link for all possible arfcns causing the mobile trying to sync to all these afterwards. This took too long and PM now only returnes a good link quality for arfcns configured as available. Power management was also extracted to an own file. Change-Id: Ia1b79aa47c9df3b1e316122455ceccb4a66724e0 --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_prim_fbsb.c A src/host/virt_phy/src/virt_prim_pm.c 6 files changed, 127 insertions(+), 82 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/11/3211/1 diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index 71d4765..a126128 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -23,6 +23,7 @@ void prim_data_init(struct l1_model_ms *model); void prim_traffic_init(struct l1_model_ms *model); void prim_fbsb_init(struct l1_model_ms *model); +void prim_pm_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index ae14ef6..d34b8ad 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -4,7 +4,7 @@ CFLAGS = "-g -O0" sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) virtphy_LDFLAGS = -pthread diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 3cb0df9..155b4dc 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -166,12 +166,6 @@ return; } - // forward msg to fbsb sync routine if we are in sync state - if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { - prim_fbsb_sync(msg); - return; - } - struct gsmtap_hdr *gh = msgb_l1(msg); struct msgb *l1ctl_msg = NULL; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg @@ -184,6 +178,29 @@ uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) uint8_t link_id; // rsl link id tells if this is an ssociated or dedicated link uint8_t chan_nr; // encoded rsl channel type, timeslot and mf subslot + + // generally ignore all uplink messages received + if (arfcn & GSMTAP_ARFCN_F_UPLINK) { + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + goto nomessage; + } + + // forward downlink msg to fbsb sync routine if we are in sync state + if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { + prim_fbsb_sync(msg); + return; + } + + // generally ignore all messages coming from another arfcn than the camped one + if (l1_model_ms->state->serving_cell.arfcn != arfcn) { + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", + arfcn, + l1_model_ms->state->serving_cell.arfcn); + goto nomessage; + } msg->l2h = msgb_pull(msg, sizeof(*gh)); chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); @@ -199,23 +216,6 @@ arfcn, fn, get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); - - // generally ignore all messages coming from another arfcn than the camped one - if (l1_model_ms->state->serving_cell.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { - LOGP(DVIRPHY, - LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn & GSMTAP_ARFCN_MASK, - l1_model_ms->state->serving_cell.arfcn); - goto nomessage; - } - - // generally ignore all uplink messages received - if (arfcn & GSMTAP_ARFCN_F_UPLINK) { - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - uplink flag set!\n"); - goto nomessage; - } // switch case with removed acch flag switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index c03da3b..bd6051b 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -377,60 +377,6 @@ } /** - * @brief Handler for received L1CTL_PM_REQ from L23. - * - * -- power measurement request -- - * - * @param [in] msg the received message. - * - * Process power measurement for a given range of arfcns to calculate signal power and connection quality. - * - * Note: We do not need to calculate that for the virtual physical layer, - * but l23 apps can expect a response. So this response is mocked here. - * TODO: Might be possible to sync to different virtual BTS. Mapping from arfcn to mcast address would be needed. Configurable rx_lev for each mcast address. - */ -void l1ctl_rx_pm_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *)l1h->data; - struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); - uint16_t arfcn_next; - // convert to host order - pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); - pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - - DEBUGP(DL1C, - "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", - pm_req->type, pm_req->range.band_arfcn_from, - pm_req->range.band_arfcn_to); - - for (arfcn_next = pm_req->range.band_arfcn_from; - arfcn_next <= pm_req->range.band_arfcn_to; - ++arfcn_next) { - struct l1ctl_pm_conf *pm_conf = - (struct l1ctl_pm_conf *)msgb_put(resp_msg, - sizeof(*pm_conf)); - pm_conf->band_arfcn = htons(arfcn_next); - // rxlev 63 is great, 0 is bad the two values are min and max - pm_conf->pm[0] = 63; - pm_conf->pm[1] = 63; - if (arfcn_next == pm_req->range.band_arfcn_to) { - struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); - resp_l1h->flags |= L1CTL_F_DONE; - } - // no more space to hold mor pm info in msgb, flush to l23 - if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { - l1ctl_sap_tx_to_l23(resp_msg); - resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); - } - } - // transmit the remaining part of pm response to l23 - if (resp_msg) { - l1ctl_sap_tx_to_l23(resp_msg); - } -} - -/** * @brief Handler for received L1CTL_RESET_REQ from L23. * * -- reset request -- diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 6a678d0..f0c7f52 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -13,6 +13,7 @@ #include static struct l1_model_ms *l1_model_ms = NULL; +static uint16_t sync_count = 0; /** * @brief Handler for received L1CTL_FBSB_REQ from L23. @@ -53,11 +54,17 @@ uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg // ignore messages from other arfcns as the one requested to sync to by l23 - if (l1_model_ms->state->fbsb.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { + if (l1_model_ms->state->fbsb.arfcn != arfcn) { talloc_free(msg); + // cancel sync if we did not receive a msg on dl from the requested arfcn that we can sync to + if(sync_count++ > 100) { + sync_count = 0; + l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; + l1ctl_tx_fbsb_conf(1, (l1_model_ms->state->fbsb.arfcn)); + } return; } - l1_model_ms->state->serving_cell.arfcn = (arfcn & GSMTAP_ARFCN_MASK); + l1_model_ms->state->serving_cell.arfcn = arfcn; l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; /* Not needed in virtual phy */ l1_model_ms->state->serving_cell.fn_offset = 0; @@ -68,7 +75,7 @@ /* Restart scheduler */ virt_l1_sched_restart(l1_model_ms->state->downlink_time); talloc_free(msg); - l1ctl_tx_fbsb_conf(0, (arfcn & GSMTAP_ARFCN_MASK)); + l1ctl_tx_fbsb_conf(0, arfcn); } /** @@ -103,7 +110,7 @@ l1ctl_sap_tx_to_l23(msg); } /** - * @brief Initialize virtual prim rach. + * @brief Initialize virtual prim pm. * * @param [in] model the l1 model instance */ diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c new file mode 100644 index 0000000..c08ce03 --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -0,0 +1,91 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static struct l1_model_ms *l1_model_ms = NULL; +// FIXME: ugly to configure that in code. Either make a config file or change power selection to automatically check which arfcns can be received. +static uint16_t available_arfcns[] = {666}; + +/** + * @brief Handler for received L1CTL_PM_REQ from L23. + * + * -- power measurement request -- + * + * @param [in] msg the received message. + * + * Process power measurement for a given range of arfcns to calculate signal power and connection quality. + * + * Note: We do not need to calculate that for the virtual physical layer, + * but l23 apps can expect a response. So this response is mocked here. + * For available arfcns we always return a perfect link quality, for all other the worst. + * + * TODO: Change PM so that we check the downlink first for for some time to get the arfcns we receive. Then return a good link for that and a bad for all others. + */ +void l1ctl_rx_pm_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *)l1h->data; + struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + uint16_t arfcn_next; + // convert to host order + pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); + pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); + + DEBUGP(DL1C, + "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + pm_req->type, pm_req->range.band_arfcn_from, + pm_req->range.band_arfcn_to); + + for (arfcn_next = pm_req->range.band_arfcn_from; + arfcn_next <= pm_req->range.band_arfcn_to; + ++arfcn_next) { + struct l1ctl_pm_conf *pm_conf = + (struct l1ctl_pm_conf *)msgb_put(resp_msg, + sizeof(*pm_conf)); + int cnt, available = 0; + pm_conf->band_arfcn = htons(arfcn_next); + // check if arfcn is available + for(cnt = 0; cnt < sizeof(available_arfcns) / sizeof(uint16_t); cnt++) { + if(arfcn_next == available_arfcns[cnt]) { + available = 1; + break; + } + } + // rxlev 63 is great, 0 is bad the two values are min and max + pm_conf->pm[0] = available ? 63 : 0; + pm_conf->pm[1] = available ? 63 : 0; + if (arfcn_next == pm_req->range.band_arfcn_to) { + struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); + resp_l1h->flags |= L1CTL_F_DONE; + } + // no more space to hold mor pm info in msgb, flush to l23 + if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { + l1ctl_sap_tx_to_l23(resp_msg); + resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + } + } + // transmit the remaining part of pm response to l23 + if (resp_msg) { + l1ctl_sap_tx_to_l23(resp_msg); + } +} + +/** + * @brief Initialize virtual prim pm. + * + * @param [in] model the l1 model instance + */ +void prim_pm_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} -- To view, visit https://gerrit.osmocom.org/3211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1b79aa47c9df3b1e316122455ceccb4a66724e0 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:48 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Add downlink filter for msg on dedicated channels. Message-ID: Review at https://gerrit.osmocom.org/3212 VIRT-PHY: Add downlink filter for msg on dedicated channels. Messages incoming on dedicated channel (SDCCH/8, SDCCH/4) are no longer forwarded to l23 if their timeslot/subchannel is not fitting the ones configured by l23 via L1CTL_DM_EST_REQ. Change-Id: I6112b20e31c25636e53d3a6cda6f7443a94ff9c3 --- M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virtphy.c 4 files changed, 18 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/12/3212/1 diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 69115f2..d4969eb 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -67,6 +67,7 @@ uint8_t chan_type; // like rsl chantype 08.58 -> Chapter 9.3.1 */ uint8_t tn; // timeslot number 1-7 + uint8_t subslot; // subslot of the dedicated channel, SDCCH/4:[0-3], SDCCH/8:[0-7] uint8_t scn; // single-hop cellular network? (ununsed in virtual um) uint8_t tsc; // training sequence code (ununsed in virtual um) diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 155b4dc..b84186a 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -162,12 +162,10 @@ } // we do not forward messages to l23 if we are in network search state if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { - talloc_free(msg); - return; + goto freemsg; } struct gsmtap_hdr *gh = msgb_l1(msg); - struct msgb *l1ctl_msg = NULL; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type @@ -183,7 +181,7 @@ if (arfcn & GSMTAP_ARFCN_F_UPLINK) { LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); - goto nomessage; + goto freemsg; } // forward downlink msg to fbsb sync routine if we are in sync state @@ -199,7 +197,7 @@ "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn, l1_model_ms->state->serving_cell.arfcn); - goto nomessage; + goto freemsg; } msg->l2h = msgb_pull(msg, sizeof(*gh)); @@ -230,11 +228,17 @@ #endif case GSMTAP_CHANNEL_SDCCH4: case GSMTAP_CHANNEL_SDCCH8: + // only forward messages on dedicated channels to l2, if the timeslot and subslot is fitting + if(l1_model_ms->state->dedicated.tn == timeslot && l1_model_ms->state->dedicated.subslot == subslot) { + l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, + signal_dbm, 0, 0); + } + break; case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, - signal_dbm, 0, 0); + signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: LOGP(DVIRPHY, @@ -259,11 +263,7 @@ break; } - /* forward l1ctl message to l2 */ - if (l1ctl_msg) { - l1ctl_sap_tx_to_l23(l1ctl_msg); - } - nomessage: + freemsg: // handle memory deallocation talloc_free(msg); } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index bd6051b..b6c4508 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -244,7 +244,6 @@ * * Handle state change from idle to dedicated mode. * - * TODO: Implement this handler routine! */ void l1ctl_rx_dm_est_req(struct msgb *msg) { @@ -257,12 +256,12 @@ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u)\n", - ul->chan_nr, timeslot); + "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", + ul->chan_nr, timeslot, subslot); l1_model_ms->state->dedicated.chan_type = rsl_chantype; l1_model_ms->state->dedicated.tn = timeslot; - + l1_model_ms->state->dedicated.subslot = subslot; /* TCH config */ if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { @@ -348,6 +347,8 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); l1_model_ms->state->dedicated.chan_type = 0; + l1_model_ms->state->dedicated.tn = 0; + l1_model_ms->state->dedicated.subslot = 0; l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; // TODO: disable ciphering diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 70265a0..1454c4e 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -44,7 +44,7 @@ virt_l1_sched_init(model); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ - Waiting for l23 app on %s", l1ctl_sock_path); + Waiting for l23 app on %s", l1ctl_sock_path ? l1ctl_sock_path : L1CTL_SOCK_PATH); while (1) { // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) -- To view, visit https://gerrit.osmocom.org/3212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6112b20e31c25636e53d3a6cda6f7443a94ff9c3 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:48 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Added option parsing. Message-ID: Review at https://gerrit.osmocom.org/3213 VIRT-PHY: Added option parsing. Available options: dl-rx-grp: mcast group messages on downlink are received from ul-tx-grp: mcast group messages on uplink are sent to port: port used for mcast sockets log-mask: logging mask l1ctl-sock: l1ctl socket path to connect to l23 Change-Id: Id939e5d7b90b592c85ad19f3ad6f459351e2d8f6 --- M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virtphy.c 3 files changed, 70 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/13/3213/1 diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index b84186a..401df9e 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -153,6 +153,12 @@ /** * Receive a gsmtap message from the virt um. + * + * As we do not have a downlink scheduler, but not all dl messages must be processed and thus forwarded to l2, this function also implements some message filtering. + * E.g. we do not forward: + * - uplink messages + * - messages with a wrong arfcn + * - if in MS_STATE_IDLE_SEARCHING */ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg) @@ -237,6 +243,7 @@ case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: + // save to just forward here, as upper layer ignores messages that do not fit the current state (e.g. gsm48_rr.c:2159) l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); break; diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index b6c4508..f0f3f68 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -262,6 +262,8 @@ l1_model_ms->state->dedicated.chan_type = rsl_chantype; l1_model_ms->state->dedicated.tn = timeslot; l1_model_ms->state->dedicated.subslot = subslot; + l1_model_ms->state->state = MS_STATE_DEDICATED; + /* TCH config */ if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { @@ -340,7 +342,6 @@ * * Handle state change from dedicated to idle mode. Flush message buffers of dedicated channel. * - * TODO: Implement this handler routine! */ void l1ctl_rx_dm_rel_req(struct msgb *msg) { @@ -350,6 +351,7 @@ l1_model_ms->state->dedicated.tn = 0; l1_model_ms->state->dedicated.subslot = 0; l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; + l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; // TODO: disable ciphering // TODO: disable audio recording / playing diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 1454c4e..dd11c67 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -13,44 +14,84 @@ #include #include -int main( int argc, char *argv[] ) +#define DEFAULT_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ +#define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" + +static char* dl_rx_grp = DEFAULT_MS_MCAST_GROUP; +static char* ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; +static int port = DEFAULT_MCAST_PORT; +static char* log_mask = DEFAULT_LOG_MASK; +static char * l1ctl_sock_path = L1CTL_SOCK_PATH; + +static void handle_options(int argc, char **argv) +{ + while (1) { + int option_index = 0, c; + static struct option long_options[] = { + {"dl-rx-grp", required_argument, 0, 'z'}, + {"ul-tx-grp", required_argument, 0, 'y'}, + {"port", required_argument, 0, 'x'}, + {"log-mask", required_argument, 0, 'd'}, + {"l1ctl-sock", required_argument, 0, 's'}, + {0, 0, 0, 0}, + }; + c = getopt_long(argc, argv, "z:y:x:d:s:", long_options, + &option_index); + if (c == -1) + break; + + switch (c) { + case 'z': + dl_rx_grp = optarg; + break; + case 'y': + ul_tx_grp = optarg; + break; + case 'x': + port = atoi(optarg); + break; + case 'd': + log_mask = optarg; + break; + case 's': + l1ctl_sock_path = optarg; + break; + default: + break; + } + } +} + +int main(int argc, char *argv[]) { // init loginfo static struct l1_model_ms *model; - char * l1ctl_sock_path = NULL; - // get path from commandline argument - if( argc > 1 ) { - l1ctl_sock_path = argv[1]; - } + handle_options(argc, argv); - - //ms_log_init("DL1C,1:DVIRPHY,1"); - ms_log_init("DL1C,1"); - //ms_log_init("DL1C,8:DVIRPHY,8"); + ms_log_init(log_mask); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); model = l1_model_ms_init(NULL); - // TODO: make this configurable - model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, - DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, - DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); - model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, l1ctl_sock_path); + model->vui = virt_um_init(NULL, ul_tx_grp, port, dl_rx_grp, port, + gsmtapl1_rx_from_virt_um_inst_cb); + model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, + l1ctl_sock_path); gsmtapl1_init(model); l1ctl_sap_init(model); virt_l1_sched_init(model); - LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ - Waiting for l23 app on %s", l1ctl_sock_path ? l1ctl_sock_path : L1CTL_SOCK_PATH); + LOGP(DVIRPHY, LOGL_INFO, + "Virtual physical layer ready...\n \ + Waiting for l23 app on %s", + l1ctl_sock_path); while (1) { // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) osmo_select_main(0); - // handle outgoing l1ctl primitives to l2 - // TODO implement scheduler for uplink messages } l1_model_ms_destroy(model); -- To view, visit https://gerrit.osmocom.org/3213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id939e5d7b90b592c85ad19f3ad6f459351e2d8f6 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:48 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Extracted common virtphy utils. Message-ID: Review at https://gerrit.osmocom.org/3214 VIRT-PHY: Extracted common virtphy utils. Change-Id: I759c6e9805ab012f9553bcba9b5d379193462955 --- A src/host/virt_phy/include/virtphy/common_util.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c A src/host/virt_phy/src/shared/common_util.c 4 files changed, 96 insertions(+), 78 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/14/3214/1 diff --git a/src/host/virt_phy/include/virtphy/common_util.h b/src/host/virt_phy/include/virtphy/common_util.h new file mode 100644 index 0000000..672ff93 --- /dev/null +++ b/src/host/virt_phy/include/virtphy/common_util.h @@ -0,0 +1,51 @@ +/* + * Utility function used both in osmo bts virt and osmocom bb virt. + */ + +#pragma once + +#include +#include + +#define LID_SACCH 0x40 +#define LID_DEDIC 0x00 + +/*! \brief convert GSMTAP channel type to RSL channel number + * \param[in] gsmtap_chantype GSMTAP channel type + * \param[out] rsl_chantype rsl channel type + * \param[out] rsl_chantype rsl link id + * + * Mapping from gsmtap channel: + * GSMTAP_CHANNEL_UNKNOWN * 0x00 + * GSMTAP_CHANNEL_BCCH * 0x01 + * GSMTAP_CHANNEL_CCCH * 0x02 + * GSMTAP_CHANNEL_RACH * 0x03 + * GSMTAP_CHANNEL_AGCH * 0x04 + * GSMTAP_CHANNEL_PCH * 0x05 + * GSMTAP_CHANNEL_SDCCH * 0x06 + * GSMTAP_CHANNEL_SDCCH4 * 0x07 + * GSMTAP_CHANNEL_SDCCH8 * 0x08 + * GSMTAP_CHANNEL_TCH_F * 0x09 + * GSMTAP_CHANNEL_TCH_H * 0x0a + * GSMTAP_CHANNEL_PACCH * 0x0b + * GSMTAP_CHANNEL_CBCH52 * 0x0c + * GSMTAP_CHANNEL_PDCH * 0x0d + * GSMTAP_CHANNEL_PTCCH * 0x0e + * GSMTAP_CHANNEL_CBCH51 * 0x0f + * to rsl channel type: + * RSL_CHAN_NR_MASK * 0xf8 + * RSL_CHAN_NR_1 * * 0x08 + * RSL_CHAN_Bm_ACCHs * 0x08 + * RSL_CHAN_Lm_ACCHs * 0x10 + * RSL_CHAN_SDCCH4_ACCH * 0x20 + * RSL_CHAN_SDCCH8_ACCH * 0x40 + * RSL_CHAN_BCCH * * 0x80 + * RSL_CHAN_RACH * * 0x88 + * RSL_CHAN_PCH_AGCH * 0x90 + * RSL_CHAN_OSMO_PDCH * 0xc0 + * and logical channel link id: + * LID_SACCH * * 0x40 + * LID_DEDIC * * 0x00 + */ +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index d34b8ad..6628bce 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -4,7 +4,7 @@ CFLAGS = "-g -O0" sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c shared/common_util.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) virtphy_LDFLAGS = -pthread diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 401df9e..1a2c085 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -282,80 +282,3 @@ { gsmtapl1_rx_from_virt_um_inst_cb(l1_model_ms->vui, msg); } - -/*! \brief convert GSMTAP channel type to RSL channel number - * \param[in] gsmtap_chantype GSMTAP channel type - * \param[out] rsl_chantype rsl channel type - * \param[out] rsl_chantype rsl link id - * - * Mapping from gsmtap channel: - * GSMTAP_CHANNEL_UNKNOWN * 0x00 - * GSMTAP_CHANNEL_BCCH * 0x01 - * GSMTAP_CHANNEL_CCCH * 0x02 - * GSMTAP_CHANNEL_RACH * 0x03 - * GSMTAP_CHANNEL_AGCH * 0x04 - * GSMTAP_CHANNEL_PCH * 0x05 - * GSMTAP_CHANNEL_SDCCH * 0x06 - * GSMTAP_CHANNEL_SDCCH4 * 0x07 - * GSMTAP_CHANNEL_SDCCH8 * 0x08 - * GSMTAP_CHANNEL_TCH_F * 0x09 - * GSMTAP_CHANNEL_TCH_H * 0x0a - * GSMTAP_CHANNEL_PACCH * 0x0b - * GSMTAP_CHANNEL_CBCH52 * 0x0c - * GSMTAP_CHANNEL_PDCH * 0x0d - * GSMTAP_CHANNEL_PTCCH * 0x0e - * GSMTAP_CHANNEL_CBCH51 * 0x0f - * to rsl channel type: - * RSL_CHAN_NR_MASK * 0xf8 - * RSL_CHAN_NR_1 * * 0x08 - * RSL_CHAN_Bm_ACCHs * 0x08 - * RSL_CHAN_Lm_ACCHs * 0x10 - * RSL_CHAN_SDCCH4_ACCH * 0x20 - * RSL_CHAN_SDCCH8_ACCH * 0x40 - * RSL_CHAN_BCCH * * 0x80 - * RSL_CHAN_RACH * * 0x88 - * RSL_CHAN_PCH_AGCH * 0x90 - * RSL_CHAN_OSMO_PDCH * 0xc0 - * and logical channel link id: - * LID_SACCH * * 0x40 - * LID_DEDIC * * 0x00 - * - * TODO: move this to a library used by both ms and bts virt um - */ -void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, - uint8_t *link_id) -{ - // switch case with removed acch flag - switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { - case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F - *rsl_chantype = RSL_CHAN_Bm_ACCHs; - break; - case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H - *rsl_chantype = RSL_CHAN_Lm_ACCHs; - break; - case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 - *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; - break; - case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 - *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; - break; - case GSMTAP_CHANNEL_BCCH: // BCCH - *rsl_chantype = RSL_CHAN_BCCH; - break; - case GSMTAP_CHANNEL_RACH: // RACH - *rsl_chantype = RSL_CHAN_RACH; - break; - case GSMTAP_CHANNEL_PCH: // PCH - case GSMTAP_CHANNEL_AGCH: // AGCH - *rsl_chantype = RSL_CHAN_PCH_AGCH; - break; - case GSMTAP_CHANNEL_PDCH: - *rsl_chantype = GSMTAP_CHANNEL_PDCH; - break; - } - - *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? - LID_SACCH : - LID_DEDIC; - -} diff --git a/src/host/virt_phy/src/shared/common_util.c b/src/host/virt_phy/src/shared/common_util.c new file mode 100644 index 0000000..49dea18 --- /dev/null +++ b/src/host/virt_phy/src/shared/common_util.c @@ -0,0 +1,44 @@ +/* + * Utility function used both in osmo bts virt and osmocom bb virt. + */ + +#include +#include +#include + +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id) +{ + // switch case with removed acch flag + switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { + case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F + *rsl_chantype = RSL_CHAN_Bm_ACCHs; + break; + case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H + *rsl_chantype = RSL_CHAN_Lm_ACCHs; + break; + case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 + *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; + break; + case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 + *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; + break; + case GSMTAP_CHANNEL_BCCH: // BCCH + *rsl_chantype = RSL_CHAN_BCCH; + break; + case GSMTAP_CHANNEL_RACH: // RACH + *rsl_chantype = RSL_CHAN_RACH; + break; + case GSMTAP_CHANNEL_PCH: // PCH + case GSMTAP_CHANNEL_AGCH: // AGCH + *rsl_chantype = RSL_CHAN_PCH_AGCH; + break; + case GSMTAP_CHANNEL_PDCH: + *rsl_chantype = GSMTAP_CHANNEL_PDCH; + break; + } + + *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? LID_SACCH : + LID_DEDIC; + +} -- To view, visit https://gerrit.osmocom.org/3214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I759c6e9805ab012f9553bcba9b5d379193462955 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:49 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Configurable signal power reductions for multiple ... Message-ID: Review at https://gerrit.osmocom.org/3215 VIRT-PHY: Configurable signal power reductions for multiple arfcns. Model was expanded and holds now power management information consisting of an array of received power levels for all arfcns and one for the reduction of this signal in dbm. The reduction is configurable by commandline by --arfcn-sig-lev-red 666,12:888,13. The signal level is assumed to be max level (-63) if a packet from that arfcn is received within a timeframe (also configurable via cmd -- timeout-pm 5:800 == :). After that timeout it will be reduced to min level (-110). Change-Id: I369ca26703f14bba4e9334b8f417deef640462f9 --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virtphy.c 8 files changed, 126 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/15/3215/1 diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index a126128..b84c3e9 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -18,6 +18,14 @@ #define LID_SACCH 0x40 #define LID_DEDIC 0x00 +/* signature strengths for the ms */ +#define MIN_SIG_LEV_DBM -110 +#define MAX_SIG_LEV_DBM -63 + +/* Ignore all flags of the arfcn */ +#define ARFCN_NO_FLAGS_MASK 0x0fff + + void l1ctl_sap_init(struct l1_model_ms *model); void prim_rach_init(struct l1_model_ms *model); void prim_data_init(struct l1_model_ms *model); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index d4969eb..296931a 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -3,6 +3,7 @@ #include #include #include +#include #define L1S_NUM_NEIGH_CELL 6 #define A5_KEY_LEN 8 @@ -78,6 +79,17 @@ struct { uint32_t arfcn; } fbsb; + + /* power management state */ + struct { + uint32_t timeout_us; + uint32_t timeout_s; + struct { + int16_t arfcn_sig_lev_dbm[1024]; + uint8_t arfcn_sig_lev_red_dbm[1024]; + struct osmo_timer_list arfcn_sig_lev_timers[1024]; + } meas; + } pm; }; struct l1_model_ms *l1_model_ms_init(void *ctx); diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 1a2c085..2e1a207 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -152,6 +152,11 @@ extern void prim_fbsb_sync(struct msgb *msg); /** + * @see virt_prim_pm.c + */ +extern uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev); + +/** * Receive a gsmtap message from the virt um. * * As we do not have a downlink scheduler, but not all dl messages must be processed and thus forwarded to l2, this function also implements some message filtering. @@ -166,16 +171,12 @@ if (!msg) { return; } - // we do not forward messages to l23 if we are in network search state - if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { - goto freemsg; - } struct gsmtap_hdr *gh = msgb_l1(msg); uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type - uint8_t signal_dbm = gh->signal_dbm; // signal strength, 63 is best + uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); // Power measurement with each received massage uint8_t snr = gh->snr_db; // signal noise ratio, 63 is best uint8_t subslot = gh->sub_slot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) uint8_t timeslot = gh->timeslot; // tdma timeslot to send in (0-7) @@ -190,6 +191,11 @@ goto freemsg; } + // we do not forward messages to l23 if we are in network search state + if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { + goto freemsg; + } + // forward downlink msg to fbsb sync routine if we are in sync state if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { prim_fbsb_sync(msg); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index f0f3f68..9957bf3 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -43,6 +43,7 @@ prim_fbsb_init(model); prim_data_init(model); prim_traffic_init(model); + prim_pm_init(model); } /** diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index 1b1d0df..bcd6735 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -6,7 +6,6 @@ struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); model->state = talloc_zero(ctx, struct l1_state_ms); return model; - } void l1_model_ms_destroy(struct l1_model_ms *model) diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index f0c7f52..2c0f10c 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -57,7 +57,7 @@ if (l1_model_ms->state->fbsb.arfcn != arfcn) { talloc_free(msg); // cancel sync if we did not receive a msg on dl from the requested arfcn that we can sync to - if(sync_count++ > 100) { + if(sync_count++ > 20) { sync_count = 0; l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; l1ctl_tx_fbsb_conf(1, (l1_model_ms->state->fbsb.arfcn)); diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index c08ce03..312461c 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -13,8 +13,30 @@ #include static struct l1_model_ms *l1_model_ms = NULL; -// FIXME: ugly to configure that in code. Either make a config file or change power selection to automatically check which arfcns can be received. -static uint16_t available_arfcns[] = {666}; + +/** + * @brief Change the signal strength for a given arfcn. + * + * Should be called if a msg is received on the virtual layer. The configured signal level reduction is applied. + * + * @param [in] arfcn to change sig str for. + * @param [in] sig_lev the measured signal level value. + */ +uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) { + if(l1_model_ms->state->pm.timeout_s > 0 || l1_model_ms->state->pm.timeout_us > 0) { + osmo_timer_schedule(&l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[arfcn], l1_model_ms->state->pm.timeout_s, l1_model_ms->state->pm.timeout_us); + } + l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn] = sig_lev - l1_model_ms->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; + DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", arfcn, l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn], dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn])); + return l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn]; +} + +void prim_pm_timer_cb(void *data) { + // reset the signal level to bad value if no messages have been received from that rfcn for a given time + DEBUGP(DL1C, + "Timeout occurred for arfcn, signal level reset to worst value.\n"); + *((int16_t*)data) = MIN_SIG_LEV_DBM; +} /** * @brief Handler for received L1CTL_PM_REQ from L23. @@ -25,11 +47,8 @@ * * Process power measurement for a given range of arfcns to calculate signal power and connection quality. * - * Note: We do not need to calculate that for the virtual physical layer, - * but l23 apps can expect a response. So this response is mocked here. - * For available arfcns we always return a perfect link quality, for all other the worst. + * Note: This should only be called after a certain time so some messages have already been received. * - * TODO: Change PM so that we check the downlink first for for some time to get the arfcns we receive. Then return a good link for that and a bad for all others. */ void l1ctl_rx_pm_req(struct msgb *msg) { @@ -52,18 +71,10 @@ struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *)msgb_put(resp_msg, sizeof(*pm_conf)); - int cnt, available = 0; pm_conf->band_arfcn = htons(arfcn_next); - // check if arfcn is available - for(cnt = 0; cnt < sizeof(available_arfcns) / sizeof(uint16_t); cnt++) { - if(arfcn_next == available_arfcns[cnt]) { - available = 1; - break; - } - } - // rxlev 63 is great, 0 is bad the two values are min and max - pm_conf->pm[0] = available ? 63 : 0; - pm_conf->pm[1] = available ? 63 : 0; + // set min and max to the value calculated for that arfcn (IGNORE UPLINKK AND PCS AND OTHER FLAGS) + pm_conf->pm[0] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); + pm_conf->pm[1] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); if (arfcn_next == pm_req->range.band_arfcn_to) { struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; @@ -87,5 +98,13 @@ */ void prim_pm_init(struct l1_model_ms *model) { + int i; l1_model_ms = model; + // init the signal level of all arfcns with the lowest value possible + memset (model->state->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); + // init timers + for(i = 0; i < 1024; ++i) { + l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].cb = prim_pm_timer_cb; + l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].data = &l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[i]; + } } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index dd11c67..aaa9311 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -22,6 +23,8 @@ static int port = DEFAULT_MCAST_PORT; static char* log_mask = DEFAULT_LOG_MASK; static char * l1ctl_sock_path = L1CTL_SOCK_PATH; +static char * arfcn_sig_lev_red_mask = NULL; +static char * pm_timeout = NULL; static void handle_options(int argc, char **argv) { @@ -33,9 +36,11 @@ {"port", required_argument, 0, 'x'}, {"log-mask", required_argument, 0, 'd'}, {"l1ctl-sock", required_argument, 0, 's'}, + {"arfcn-sig-lev-red", required_argument, 0, 'r'}, + {"pm-timeout", required_argument, 0, 't'}, {0, 0, 0, 0}, }; - c = getopt_long(argc, argv, "z:y:x:d:s:", long_options, + c = getopt_long(argc, argv, "z:y:x:d:s:r:t:", long_options, &option_index); if (c == -1) break; @@ -56,10 +61,57 @@ case 's': l1ctl_sock_path = optarg; break; + case 'r': + arfcn_sig_lev_red_mask = optarg; + break; + case 't': + pm_timeout = optarg; + break; default: break; } } +} + +void parse_pm_timeout(struct l1_model_ms *model, char *pm_timeout) { + + if(!pm_timeout || (strcmp(pm_timeout, "") == 0)) { + return; + } + // seconds + char *buf = strtok(pm_timeout, ":"); + model->state->pm.timeout_s = atoi(buf); + // microseconds + buf = strtok(NULL, ":"); + if(buf) { + model->state->pm.timeout_us = atoi(buf); + } +} + +/** + * arfcn_sig_lev_red_mask has to be formatted like 666,12:888,43:176,22 + */ +void parse_arfcn_sig_lev_red(struct l1_model_ms *model, char * arfcn_sig_lev_red_mask) { + + if(!arfcn_sig_lev_red_mask || (strcmp(arfcn_sig_lev_red_mask, "") == 0)) { + return; + } + char *token = strtok(arfcn_sig_lev_red_mask, ":"); + do { + char* colon = strstr(token, ","); + uint16_t arfcn; + uint8_t red; + if(!colon) { + continue; + } + colon[0] = '\0'; + + arfcn = atoi(token); + red = atoi(colon + 1); + + //TODO: this may go wild if the token string is not properly formatted + model->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn] = red; + } while ((token = strtok(NULL, ":"))); } int main(int argc, char *argv[]) @@ -84,6 +136,10 @@ l1ctl_sap_init(model); virt_l1_sched_init(model); + // apply timeout and arfcn reduction value config to model + parse_pm_timeout(model, pm_timeout); + parse_arfcn_sig_lev_red(model, arfcn_sig_lev_red_mask); + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ Waiting for l23 app on %s", -- To view, visit https://gerrit.osmocom.org/3215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I369ca26703f14bba4e9334b8f417deef640462f9 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:49 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Remove non-overridable CFLAGS "-g -O0" Message-ID: Review at https://gerrit.osmocom.org/3216 VIRT-PHY: Remove non-overridable CFLAGS "-g -O0" If the user wants debugging / no optimziation, they can always pass the related CFLAGS at ./configure time, there's no nee to have them hard-coded in the actual Makefiles. Change-Id: I6a2b30f946579bbd49bf66c4f59d160a975a1b56 --- M src/host/virt_phy/Makefile.am M src/host/virt_phy/src/Makefile.am 2 files changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/16/3216/1 diff --git a/src/host/virt_phy/Makefile.am b/src/host/virt_phy/Makefile.am index 57b4571..38bdf12 100644 --- a/src/host/virt_phy/Makefile.am +++ b/src/host/virt_phy/Makefile.am @@ -1,4 +1,2 @@ SUBDIRS = src dist_doc_DATA = README - -CFLAGS = "-g -O0" \ No newline at end of file diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index 6628bce..caaec04 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -1,8 +1,6 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/../layer23/include -CFLAGS = "-g -O0" - sbin_PROGRAMS = virtphy virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c shared/common_util.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) -- To view, visit https://gerrit.osmocom.org/3216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6a2b30f946579bbd49bf66c4f59d160a975a1b56 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:50 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: coding style / API usage cleanup Message-ID: Review at https://gerrit.osmocom.org/3217 VIRT-PHY: coding style / API usage cleanup This is the result of my manual clean-up of the many coding style issues found in the stumpf/virt-phy branch of OsmocomBB. Some may remain, but it's much closer to what we're used to in the Osmocom world now. Change-Id: I3aa95dbef75d7749d490aad0237d074528527e8b --- M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 12 files changed, 564 insertions(+), 486 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/17/3217/1 diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 2e1a207..ae9cd32 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -1,12 +1,12 @@ /* GSMTAP layer1 is transmits gsmtap messages over a virtual layer 1.*/ -/* (C) 2016 Sebastian Stumpf +/* (C) 2016 by Sebastian Stumpf * * 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 + * 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, @@ -14,7 +14,7 @@ * 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 + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ @@ -40,47 +40,45 @@ static struct l1_model_ms *l1_model_ms = NULL; -// for debugging -static const struct value_string gsmtap_channels[22] = { - {GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN"}, - {GSMTAP_CHANNEL_BCCH, "BCCH"}, - {GSMTAP_CHANNEL_CCCH, "CCCH"}, - {GSMTAP_CHANNEL_RACH, "RACH"}, - {GSMTAP_CHANNEL_AGCH, "AGCH"}, - {GSMTAP_CHANNEL_PCH, "PCH"}, - {GSMTAP_CHANNEL_SDCCH, "SDCCH"}, - {GSMTAP_CHANNEL_SDCCH4, "SDCCH/4"}, - {GSMTAP_CHANNEL_SDCCH8, "SDCCH/8"}, - {GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F"}, - {GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H"}, - {GSMTAP_CHANNEL_PACCH, "PACCH"}, - {GSMTAP_CHANNEL_CBCH52, "CBCH"}, - {GSMTAP_CHANNEL_PDCH, "PDCH"}, - {GSMTAP_CHANNEL_PTCCH, "PTTCH"}, - {GSMTAP_CHANNEL_CBCH51, "CBCH"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_SDCCH, "LSACCH"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_SDCCH4, "SACCH/4"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_SDCCH8, "SACCH/8"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_TCH_F, "SACCH/F"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_TCH_H, "SACCH/H"}, - {0, NULL}, }; -// for debugging -static const struct value_string gsmtap_types[10] = {{ - GSMTAP_TYPE_UM, - "GSM Um (MS<->BTS)"}, {GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)"}, { - GSMTAP_TYPE_UM_BURST, - "GSM Um burst (MS<->BTS)"}, {GSMTAP_TYPE_SIM, "SIM"}, { - GSMTAP_TYPE_TETRA_I1, - "TETRA V+D"}, {GSMTAP_TYPE_WMX_BURST, "WiMAX burst"}, { - GSMTAP_TYPE_GMR1_UM, - "GMR-1 air interfeace (MES-MS<->GTS)"}, { - GSMTAP_TYPE_UMTS_RLC_MAC, - "UMTS RLC/MAC"}, {GSMTAP_TYPE_UMTS_RRC, "UMTS RRC"}, {0, NULL}, }; +/* for debugging */ +static const struct value_string gsmtap_channels[] = { + { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, + { GSMTAP_CHANNEL_BCCH, "BCCH" }, + { GSMTAP_CHANNEL_CCCH, "CCCH" }, + { GSMTAP_CHANNEL_RACH, "RACH" }, + { GSMTAP_CHANNEL_AGCH, "AGCH" }, + { GSMTAP_CHANNEL_PCH, "PCH" }, + { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, + { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, + { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, + { GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F" }, + { GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H" }, + { GSMTAP_CHANNEL_PACCH, "PACCH" }, + { GSMTAP_CHANNEL_CBCH52, "CBCH" }, + { GSMTAP_CHANNEL_PDCH, "PDCH" } , + { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, + { GSMTAP_CHANNEL_CBCH51, "CBCH" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH, "LSACCH" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, + { 0, NULL } +}; + +/* for debugging */ +static const struct value_string gsmtap_types[10] = { + { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, + { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, + { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, + { GSMTAP_TYPE_SIM, "SIM Card" }, + { GSMTAP_TYPE_TETRA_I1, "TETRA V+D" }, + { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, + { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)"}, + { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, + { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, + { 0, NULL } +}; void gsmtapl1_init(struct l1_model_ms *model) { @@ -91,48 +89,46 @@ * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, - struct msgb *msg) + struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; - struct msgb *outmsg; // msg to send with gsmtap header prepended - uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; // arfcn of the cell we currently camp on - uint8_t signal_dbm = 63; // signal strength, 63 is best - uint8_t snr = 63; // signal noise ratio, 63 is best - uint8_t *data = msgb_l2(msg); // data to transmit (whole message without l1 header) - uint8_t data_len = msgb_l2len(msg); // length of data + struct msgb *outmsg; /* msg to send with gsmtap header prepended */ + uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; /* arfcn of the cell we currently camp on */ + uint8_t signal_dbm = 63; /* signal strength */ + uint8_t snr = 63; /* signal noise ratio, 63 is best */ + uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ + uint8_t data_len = msgb_l2len(msg); /* length of data */ - uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) - uint8_t subslot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) - uint8_t timeslot; // tdma timeslot to send in (0-7) - uint8_t gsmtap_chan; // the gsmtap channel + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t subslot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t gsmtap_chan; /* the gsmtap channel */ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); - // arfcn needs to be flagged to be able to distinguish between uplink and downlink + /* arfcn needs to be flagged to be able to distinguish between uplink and downlink */ outmsg = gsmtap_makemsg(arfcn | GSMTAP_ARFCN_F_UPLINK, timeslot, - gsmtap_chan, subslot, fn, signal_dbm, snr, data, - data_len); + gsmtap_chan, subslot, fn, signal_dbm, snr, data, + data_len); if (outmsg) { outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); if (virt_um_write_msg(l1_model_ms->vui, outmsg) == -1) { - LOGP(DVIRPHY, - LOGL_ERROR, - "Gsmtap msg could not send to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not send to virt um - " + "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, gh->sub_slot); } else { - DEBUGP(DVIRPHY, - "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + DEBUGP(DVIRPHY, "Sending gsmtap msg to virt um - " + "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, gh->sub_slot); } - } else { + } else LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); - } /* free message */ msgb_free(msg); @@ -166,96 +162,89 @@ * - if in MS_STATE_IDLE_SEARCHING */ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, - struct msgb *msg) + struct msgb *msg) { - if (!msg) { + if (!msg) return; - } struct gsmtap_hdr *gh = msgb_l1(msg); - uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg - uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg - uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type - uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); // Power measurement with each received massage - uint8_t snr = gh->snr_db; // signal noise ratio, 63 is best - uint8_t subslot = gh->sub_slot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) - uint8_t timeslot = gh->timeslot; // tdma timeslot to send in (0-7) - uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) - uint8_t link_id; // rsl link id tells if this is an ssociated or dedicated link - uint8_t chan_nr; // encoded rsl channel type, timeslot and mf subslot + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ + uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ + uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); /* Power measurement with each received massage */ + uint8_t snr = gh->snr_db; /* signal noise ratio */ + uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ + uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ - // generally ignore all uplink messages received + /* generally ignore all uplink messages received */ if (arfcn & GSMTAP_ARFCN_F_UPLINK) { - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); goto freemsg; } - - // we do not forward messages to l23 if we are in network search state - if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { + /* we do not forward messages to l23 if we are in network search state */ + if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) goto freemsg; - } - // forward downlink msg to fbsb sync routine if we are in sync state + /* forward downlink msg to fbsb sync routine if we are in sync state */ if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { prim_fbsb_sync(msg); return; } - - // generally ignore all messages coming from another arfcn than the camped one + /* generally ignore all messages coming from another arfcn than the camped one */ if (l1_model_ms->state->serving_cell.arfcn != arfcn) { - LOGP(DVIRPHY, - LOGL_NOTICE, + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn, - l1_model_ms->state->serving_cell.arfcn); + arfcn, l1_model_ms->state->serving_cell.arfcn); goto freemsg; } msg->l2h = msgb_pull(msg, sizeof(*gh)); chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); - // see GSM 8.58 -> 9.3.1 for channel number encoding + /* see TS 08.58 -> 9.3.1 for channel number encoding */ chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); virt_l1_sched_sync_time(l1_model_ms->state->downlink_time, 0); virt_l1_sched_execute(fn); - DEBUGP(DVIRPHY, - "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", + DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " + "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", arfcn, fn, get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); - // switch case with removed acch flag + /* switch case with removed ACCH flag */ switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { case GSMTAP_CHANNEL_TCH_H: case GSMTAP_CHANNEL_TCH_F: -#if(0) - // TODO: handle msgs on TCH that are neither FACCH nor TCH/ACCH - if(!facch && ! tch_acch) { +#if 0 + /* TODO: handle voice */ + if (!facch && !tch_acch) { l1ctl_tx_traffic_ind(msg, arfcn, link_id, chan_nr, fn, - snr, signal_dbm, 0, 0); + snr, signal_dbm, 0, 0); } #endif case GSMTAP_CHANNEL_SDCCH4: case GSMTAP_CHANNEL_SDCCH8: - // only forward messages on dedicated channels to l2, if the timeslot and subslot is fitting - if(l1_model_ms->state->dedicated.tn == timeslot && l1_model_ms->state->dedicated.subslot == subslot) { - l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, - signal_dbm, 0, 0); + /* only forward messages on dedicated channels to l2, if + * the timeslot and subslot is fitting */ + if (l1_model_ms->state->dedicated.tn == timeslot + && l1_model_ms->state->dedicated.subslot == subslot) { + l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); } break; case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: - // save to just forward here, as upper layer ignores messages that do not fit the current state (e.g. gsm48_rr.c:2159) - l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, - signal_dbm, 0, 0); + /* save to just forward here, as upper layer ignores messages that + * do not fit the current state (e.g. gsm48_rr.c:2159) */ + l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: - LOGP(DVIRPHY, - LOGL_NOTICE, + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); break; case GSMTAP_CHANNEL_SDCCH: @@ -265,19 +254,16 @@ case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: - LOGP(DVIRPHY, - LOGL_NOTICE, + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - channel type not supported!\n"); break; default: - LOGP(DVIRPHY, - LOGL_NOTICE, + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - channel type unknown.\n"); break; } - freemsg: - // handle memory deallocation +freemsg: talloc_free(msg); } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 9957bf3..0871f1f 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -1,5 +1,25 @@ /* L1CTL SAP implementation. */ +/* (C) 2016 by Sebastian Stumpf + * + * 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, see . + * + */ + + #include #include #include @@ -23,12 +43,10 @@ static void l1_model_tch_mode_set(uint8_t tch_mode) { - if (tch_mode == GSM48_CMODE_SPEECH_V1 - || tch_mode == GSM48_CMODE_SPEECH_EFR) { + if (tch_mode == GSM48_CMODE_SPEECH_V1 || tch_mode == GSM48_CMODE_SPEECH_EFR) l1_model_ms->state->tch_mode = tch_mode; - - } else { - // set default value if no proper mode was assigned by l23 + else { + /* set default value if no proper mode was assigned by l23 */ l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; } } @@ -51,13 +69,11 @@ * * Enqueues the message into the rx queue. */ -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, - struct msgb *msg) +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) { - // check if the received msg is not empty + /* check if the received msg is not empty */ if (msg) { - DEBUGP(DL1C, "Message incoming from layer 2: %s\n", - osmo_hexdump(msg->data, msg->len)); + DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); l1ctl_sap_handler(msg); } } @@ -76,10 +92,8 @@ */ void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg) { - uint16_t *len; /* prepend 16bit length before sending */ - len = (uint16_t *)msgb_push(msg, sizeof(*len)); - *len = htons(msg->len - sizeof(*len)); + msgb_push_u16(msg, msg->len); l1ctl_sock_write_msg(lsi, msg); } @@ -108,15 +122,11 @@ { struct msgb *msg; struct l1ctl_hdr *l1h; - msg = msgb_alloc_headroom(L3_MSG_SIZE, L3_MSG_HEAD, "l1ctl"); - if (!msg) { - while (1) { - puts("OOPS. Out of buffers...\n"); - } - return NULL; - } - l1h = (struct l1ctl_hdr *)msgb_put(msg, sizeof(*l1h)); + msg = msgb_alloc_headroom(L3_MSG_SIZE, L3_MSG_HEAD, "l1ctl"); + OSMO_ASSERT(msg); + + l1h = (struct l1ctl_hdr *) msgb_put(msg, sizeof(*l1h)); l1h->msg_type = msg_type; l1h->flags = 0; @@ -142,13 +152,12 @@ * [l1ctl_info_dl] : initialized with params. msgb->data points here. * [spare-bytes] : L3_MSG_DATA bytes reserved for data. msgb->tail points here. */ -struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, - uint16_t arfcn) +struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, uint16_t arfcn) { struct l1ctl_info_dl *dl; struct msgb *msg = l1ctl_msgb_alloc(msg_type); - dl = (struct l1ctl_info_dl *)msgb_put(msg, sizeof(*dl)); + dl = (struct l1ctl_info_dl *) msgb_put(msg, sizeof(*dl)); dl->frame_nr = htonl(fn); dl->snr = htons(snr); dl->band_arfcn = htons(arfcn); @@ -160,21 +169,18 @@ * @brief General handler for incoming L1CTL messages from layer 2/3. * * This handler will call the specific routine dependent on the L1CTL message type. - * */ void l1ctl_sap_handler(struct msgb *msg) { struct l1ctl_hdr *l1h; - if (!msg) { + if (!msg) return; - } - l1h = (struct l1ctl_hdr *)msg->data; + l1h = (struct l1ctl_hdr *) msg->data; if (sizeof(*l1h) > msg->len) { - LOGP(DL1C, LOGL_NOTICE, "Malformed message: too short. %u\n", - msg->len); + LOGP(DL1C, LOGL_NOTICE, "Malformed message: too short. %u\n", msg->len); goto exit_msgbfree; } @@ -226,8 +232,11 @@ break; } - exit_msgbfree: msgb_free(msg); - exit_nofree: return; /* msg is scheduled for uplink and mustn't be freed here */ +exit_msgbfree: + msgb_free(msg); + +exit_nofree: + return; /* msg is scheduled for uplink and mustn't be freed here */ } /*************************************************************** @@ -248,17 +257,15 @@ */ void l1ctl_rx_dm_est_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_dm_est_req *est_req = - (struct l1ctl_dm_est_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_dm_est_req *est_req = (struct l1ctl_dm_est_req *) ul->payload; uint8_t rsl_chantype, subslot, timeslot; rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", - ul->chan_nr, timeslot, subslot); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", + ul->chan_nr, timeslot, subslot); l1_model_ms->state->dedicated.chan_type = rsl_chantype; l1_model_ms->state->dedicated.tn = timeslot; @@ -266,12 +273,12 @@ l1_model_ms->state->state = MS_STATE_DEDICATED; /* TCH config */ - if (rsl_chantype == RSL_CHAN_Bm_ACCHs - || rsl_chantype == RSL_CHAN_Lm_ACCHs) { + if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { l1_model_ms->state->tch_mode = est_req->tch_mode; l1_model_tch_mode_set(est_req->tch_mode); l1_model_ms->state->audio_mode = est_req->audio_mode; - // TODO: configure audio hardware for encoding / decoding / recording / playing voice + /* TODO: configure audio hardware for encoding / + * decoding / recording / playing voice */ } } @@ -288,15 +295,12 @@ */ void l1ctl_rx_dm_freq_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_dm_freq_req *freq_req = - (struct l1ctl_dm_freq_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_dm_freq_req *freq_req = (struct l1ctl_dm_freq_req *) ul->payload; - DEBUGP(DL1C, - "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", - ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, - freq_req->h1.maio); + DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", + ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, freq_req->h1.maio); } /** @@ -315,23 +319,21 @@ */ void l1ctl_rx_crypto_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *) ul->payload; uint8_t key_len = msg->len - sizeof(*l1h) - sizeof(*ul) - sizeof(*cr); - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", - cr->algo, key_len); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", + cr->algo, key_len); if (cr->algo && key_len != A5_KEY_LEN) { - DEBUGP(DL1C, "L1CTL_CRYPTO_REQ -> Invalid key\n"); + LOGP(DL1C, LOGL_ERROR, "L1CTL_CRYPTO_REQ -> Invalid key\n"); return; } l1_model_ms->crypto_inf->algo = cr->algo; - memcpy(l1_model_ms->crypto_inf->key, cr->key, - sizeof(uint8_t) * A5_KEY_LEN); + memcpy(l1_model_ms->crypto_inf->key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); } /** @@ -354,8 +356,8 @@ l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; - // TODO: disable ciphering - // TODO: disable audio recording / playing + /* TODO: disable ciphering */ + /* TODO: disable audio recording / playing */ } /** @@ -375,9 +377,8 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_par_req *par_req = (struct l1ctl_par_req *)ul->payload; - DEBUGP(DL1C, - "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", - par_req->ta, par_req->tx_power); + DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", + par_req->ta, par_req->tx_power); } /** @@ -395,26 +396,23 @@ */ void l1ctl_rx_reset_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_reset *reset_req = (struct l1ctl_reset *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_reset *reset_req = (struct l1ctl_reset *) l1h->data; switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; virt_l1_sched_stop(); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: virt_l1_sched_restart(l1_model_ms->state->downlink_time); - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; default: - LOGP(DL1C, LOGL_ERROR, - "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); break; } } @@ -434,16 +432,15 @@ */ void l1ctl_rx_ccch_mode_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_ccch_mode_req *ccch_mode_req = - (struct l1ctl_ccch_mode_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_ccch_mode_req *ccch_mode_req = (struct l1ctl_ccch_mode_req *) l1h->data; uint8_t ccch_mode = ccch_mode_req->ccch_mode; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); l1_model_ms->state->serving_cell.ccch_mode = ccch_mode; - // check if more has to be done here + /* check if more has to be done here */ l1ctl_tx_ccch_mode_conf(ccch_mode); } @@ -460,21 +457,18 @@ */ void l1ctl_rx_tch_mode_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_tch_mode_req *tch_mode_req = - (struct l1ctl_tch_mode_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_tch_mode_req *tch_mode_req = (struct l1ctl_tch_mode_req *) l1h->data; l1_model_tch_mode_set(tch_mode_req->tch_mode); l1_model_ms->state->audio_mode = tch_mode_req->audio_mode; - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", - tch_mode_req->tch_mode, tch_mode_req->audio_mode); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", + tch_mode_req->tch_mode, tch_mode_req->audio_mode); - // TODO: configure audio hardware for encoding / decoding / recording / playing voice + /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ - l1ctl_tx_tch_mode_conf(l1_model_ms->state->tch_mode, - l1_model_ms->state->audio_mode); + l1ctl_tx_tch_mode_conf(l1_model_ms->state->tch_mode, l1_model_ms->state->audio_mode); } /** @@ -492,13 +486,11 @@ */ void l1ctl_rx_neigh_pm_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_neigh_pm_req *pm_req = - (struct l1ctl_neigh_pm_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_neigh_pm_req *pm_req = (struct l1ctl_neigh_pm_req *) l1h->data; - DEBUGP(DL1C, - "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", - pm_req->n); + DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", + pm_req->n); } /** @@ -525,9 +517,8 @@ uint16_t len = msg->len - sizeof(struct l1ctl_hdr); uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); - DEBUGP(DL1C, - "Received and ignored from l23 - SIM Request length: %u, data: %s: ", - len, osmo_hexdump(data, sizeof(data))); + LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - SIM Request length: %u, data: %s\n", + len, osmo_hexdump(data, sizeof(data))); } @@ -548,12 +539,11 @@ void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type) { struct msgb *msg = l1ctl_msgb_alloc(msg_type); - struct l1ctl_reset *reset_resp; - reset_resp = (struct l1ctl_reset *)msgb_put(msg, sizeof(*reset_resp)); - reset_resp->type = reset_type; + struct l1ctl_reset *reset_resp = (struct l1ctl_reset *) msgb_put(msg, sizeof(*reset_resp)); - DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", - getL1ctlPrimName(msg_type), reset_type); + reset_resp->type = reset_type; + DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); + l1ctl_sap_tx_to_l23(msg); } @@ -570,12 +560,11 @@ { struct msgb *msg = l1ctl_msgb_alloc(L1CTL_CCCH_MODE_CONF); struct l1ctl_ccch_mode_conf *mode_conf; - mode_conf = (struct l1ctl_ccch_mode_conf *)msgb_put(msg, - sizeof(*mode_conf)); + + mode_conf = (struct l1ctl_ccch_mode_conf *) msgb_put(msg, sizeof(*mode_conf)); mode_conf->ccch_mode = ccch_mode; - DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", - ccch_mode); + DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); l1ctl_sap_tx_to_l23(msg); } @@ -593,56 +582,53 @@ { struct msgb *msg = l1ctl_msgb_alloc(L1CTL_TCH_MODE_CONF); struct l1ctl_tch_mode_conf *mode_conf; - mode_conf = (struct l1ctl_tch_mode_conf *)msgb_put(msg, - sizeof(*mode_conf)); + + mode_conf = (struct l1ctl_tch_mode_conf *) msgb_put(msg, sizeof(*mode_conf)); mode_conf->tch_mode = tch_mode; mode_conf->audio_mode = audio_mode; - DEBUGP(DL1C, - "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", - tch_mode, audio_mode); + DEBUGP(DL1C, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", + tch_mode, audio_mode); l1ctl_sap_tx_to_l23(msg); } /** * @brief Get the scheduled fn for a msg depending on its chan_nr and link_id. */ -uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, - uint8_t link_id) +uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, uint8_t link_id) { uint8_t chan_type, chan_ss, chan_ts; - rsl_dec_chan_nr(chan_nr, &chan_type, &chan_ss, &chan_ts); - uint32_t sched_fn = cur_time.fn; uint16_t mod_102 = cur_time.fn % 2 * 51; + + rsl_dec_chan_nr(chan_nr, &chan_type, &chan_ss, &chan_ts); + + /* TODO: Replace this spaghetti monster with some lookup table */ switch (chan_type) { case RSL_CHAN_Bm_ACCHs: switch (link_id) { case LID_DEDIC: - // dl=[0...11,13...24] ul=[0...11,13...24] - // skip idle frames and frames reserved for TCH_ACCH - if(cur_time.t2 == 12 || cur_time.t2 == 25) { + /* dl=[0...11,13...24] ul=[0...11,13...24] + * skip idle frames and frames reserved for TCH_ACCH */ + if (cur_time.t2 == 12 || cur_time.t2 == 25) sched_fn++; - } break; - // dl=42, ul=42+15 + /* dl=42, ul=42+15 */ case LID_SACCH: - if((chan_ts & 1)) { - // Odd traffic channel timeslot -> dl=[25] ul=[25] - // TCH_ACCH always at the end of tch multiframe (mod 26) + if ((chan_ts & 1)) { + /* Odd traffic channel timeslot -> dl=[25] ul=[25] + * TCH_ACCH always at the end of tch multiframe (mod 26) */ sched_fn -= cur_time.t2; sched_fn += 25; - } - else { - // Even traffic channel timeslot -> dl=[12] ul=[12] - if(cur_time.t2 <= 12) { + } else { + /* Even traffic channel timeslot -> dl=[12] ul=[12] */ + if (cur_time.t2 <= 12) { sched_fn -= cur_time.t2; sched_fn += 12; } else { sched_fn -= cur_time.t2; sched_fn += 26 + 12; } - } break; } @@ -653,9 +639,9 @@ switch (chan_ss) { case 0: switch (link_id) { - // dl=22, ul=22+15 + /* dl=22, ul=22+15 */ case LID_DEDIC: - if(cur_time.t3 <= 22 + 15) { + if (cur_time.t3 <= 22 + 15) { sched_fn -= cur_time.t3; sched_fn += 22 + 15; } else { @@ -663,9 +649,9 @@ sched_fn += 51 + 22 + 15; } break; - // dl=42, ul=42+15 + /* dl=42, ul=42+15 */ case LID_SACCH: - if(mod_102 <= 42 + 15) { + if (mod_102 <= 42 + 15) { sched_fn -= mod_102; sched_fn += 42 + 15; } else { @@ -677,9 +663,9 @@ break; case 1: switch (link_id) { - // dl=26, ul=26+15 + /* dl=26, ul=26+15 */ case LID_DEDIC: - if(cur_time.t3 <= 26 + 15) { + if (cur_time.t3 <= 26 + 15) { sched_fn -= cur_time.t3; sched_fn += 26 + 15; } else { @@ -687,9 +673,9 @@ sched_fn += 51 + 26 + 15; } break; - // dl=46, ul=46+15 + /* dl=46, ul=46+15 */ case LID_SACCH: - if(mod_102 <= 46 + 15) { + if (mod_102 <= 46 + 15) { sched_fn -= mod_102; sched_fn += 46 + 15; } else { @@ -701,9 +687,9 @@ break; case 2: switch (link_id) { - // dl=32, ul=32+15 + /* dl=32, ul=32+15 */ case LID_DEDIC: - if(cur_time.t3 <= 32 + 15) { + if (cur_time.t3 <= 32 + 15) { sched_fn -= cur_time.t3; sched_fn += 32 + 15; } else { @@ -711,9 +697,9 @@ sched_fn += 51 + 32 + 15; } break; - // dl=51+42, ul=51+42+15 + /* dl=51+42, ul=51+42+15 */ case LID_SACCH: - if(mod_102 <= 51 + 42 + 15) { + if (mod_102 <= 51 + 42 + 15) { sched_fn -= mod_102; sched_fn += 51 + 42 + 15; } else { @@ -725,9 +711,9 @@ break; case 3: switch (link_id) { - // dl=36, ul=36+15 + /* dl=36, ul=36+15 */ case LID_DEDIC: - if(cur_time.t3 <= 36 + 15) { + if (cur_time.t3 <= 36 + 15) { sched_fn -= cur_time.t3; sched_fn += 36 + 15; } else { @@ -735,9 +721,9 @@ sched_fn += 51 + 36 + 15; } break; - // dl=51+46, ul=51+46+15 + /* dl=51+46, ul=51+46+15 */ case LID_SACCH: - if(mod_102 <= 51 + 46 + 15) { + if (mod_102 <= 51 + 46 + 15) { sched_fn -= mod_102; sched_fn += 51 + 46 + 15; } else { @@ -753,9 +739,9 @@ switch (chan_ss) { case 0: switch (link_id) { - // dl=0, ul=0+15 + /* dl=0, ul=0+15 */ case LID_DEDIC: - if(cur_time.t3 <= 0 + 15) { + if (cur_time.t3 <= 0 + 15) { sched_fn -= cur_time.t3; sched_fn += 0 + 15; } else { @@ -763,9 +749,9 @@ sched_fn += 51 + 0 + 15; } break; - // dl=32, ul=32+15 + /* dl=32, ul=32+15 */ case LID_SACCH: - if(mod_102 <= 32 + 15) { + if (mod_102 <= 32 + 15) { sched_fn -= mod_102; sched_fn += 32 + 15; } else { @@ -777,9 +763,9 @@ break; case 1: switch (link_id) { - // dl=4, ul=4+15 + /* dl=4, ul=4+15 */ case LID_DEDIC: - if(cur_time.t3 <= 4 + 15) { + if (cur_time.t3 <= 4 + 15) { sched_fn -= cur_time.t3; sched_fn += 4 + 15; } else { @@ -787,9 +773,9 @@ sched_fn += 51 + 4 + 15; } break; - // dl=36, ul=36+15 + /* dl=36, ul=36+15 */ case LID_SACCH: - if(mod_102 <= 36 + 15) { + if (mod_102 <= 36 + 15) { sched_fn -= mod_102; sched_fn += 36 + 15; } else { @@ -801,9 +787,9 @@ break; case 2: switch (link_id) { - // dl=8, ul=8+15 + /* dl=8, ul=8+15 */ case LID_DEDIC: - if(cur_time.t3 <= 8 + 15) { + if (cur_time.t3 <= 8 + 15) { sched_fn -= cur_time.t3; sched_fn += 8 + 15; } else { @@ -811,9 +797,9 @@ sched_fn += 51 + 8 + 15; } break; - // dl=40, ul=40+15 + /* dl=40, ul=40+15 */ case LID_SACCH: - if(mod_102 <= 40 + 15) { + if (mod_102 <= 40 + 15) { sched_fn -= mod_102; sched_fn += 40 + 15; } else { @@ -825,9 +811,9 @@ break; case 3: switch (link_id) { - // dl=12, ul=12+15 + /* dl=12, ul=12+15 */ case LID_DEDIC: - if(cur_time.t3 <= 12 + 15) { + if (cur_time.t3 <= 12 + 15) { sched_fn -= cur_time.t3; sched_fn += 12 + 15; } else { @@ -835,9 +821,9 @@ sched_fn += 51 + 12 + 15; } break; - // dl=44, ul=44+15 + /* dl=44, ul=44+15 */ case LID_SACCH: - if(mod_102 <= 44 + 15) { + if (mod_102 <= 44 + 15) { sched_fn -= mod_102; sched_fn += 44 + 15; } else { @@ -849,9 +835,9 @@ break; case 4: switch (link_id) { - // dl=16, ul=16+15 + /* dl=16, ul=16+15 */ case LID_DEDIC: - if(cur_time.t3 <= 16 + 15) { + if (cur_time.t3 <= 16 + 15) { sched_fn -= cur_time.t3; sched_fn += 16 + 15; } else { @@ -859,9 +845,9 @@ sched_fn += 51 + 16 + 15; } break; - // dl=51+32, ul=51+32+15 + /* dl=51+32, ul=51+32+15 */ case LID_SACCH: - if(mod_102 <= 51 + 32 + 15) { + if (mod_102 <= 51 + 32 + 15) { sched_fn -= mod_102; sched_fn += 51 + 32 + 15; } else { @@ -873,9 +859,9 @@ break; case 5: switch (link_id) { - // dl=20, ul=36+15 + /* dl=20, ul=36+15 */ case LID_DEDIC: - if(cur_time.t3 <= 20 + 15) { + if (cur_time.t3 <= 20 + 15) { sched_fn -= cur_time.t3; sched_fn += 20 + 15; } else { @@ -883,9 +869,9 @@ sched_fn += 51 + 20 + 15; } break; - // dl=51+36, ul=51+36+15 ==> 0 + /* dl=51+36, ul=51+36+15 ==> 0 */ case LID_SACCH: - if(mod_102 <= 0) { + if (mod_102 <= 0) { sched_fn -= mod_102; sched_fn += 0; } else { @@ -897,9 +883,9 @@ break; case 6: switch (link_id) { - // dl=24, ul=24+15 + /* dl=24, ul=24+15 */ case LID_DEDIC: - if(cur_time.t3 <= 24 + 15) { + if (cur_time.t3 <= 24 + 15) { sched_fn -= cur_time.t3; sched_fn += 24 + 15; } else { @@ -907,9 +893,9 @@ sched_fn += 51 + 24 + 15; } break; - // dl=51+40, ul=51+40+15 ==> 4 + /* dl=51+40, ul=51+40+15 ==> 4 */ case LID_SACCH: - if(mod_102 <= 4) { + if (mod_102 <= 4) { sched_fn -= mod_102; sched_fn += 4; } else { @@ -921,9 +907,9 @@ break; case 7: switch (link_id) { - // dl=28, ul=28+15 + /* dl=28, ul=28+15 */ case LID_DEDIC: - if(cur_time.t3 <= 28 + 15) { + if (cur_time.t3 <= 28 + 15) { sched_fn -= cur_time.t3; sched_fn += 28 + 15; } else { @@ -931,9 +917,9 @@ sched_fn += 51 + 28 + 15; } break; - // dl=51+44, ul=51+44+15 ==> 8 + /* dl=51+44, ul=51+44+15 ==> 8 */ case LID_SACCH: - if(mod_102 <= 8) { + if (mod_102 <= 8) { sched_fn -= mod_102; sched_fn += 8; } else { diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index ada251c..e136aa8 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -1,12 +1,12 @@ /* Socket based Layer1 <-> Layer23 communication over L1CTL primitives. */ -/* (C) 2016 Sebastian Stumpf +/* (C) 2016 by Sebastian Stumpf * * 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 + * 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, @@ -14,7 +14,7 @@ * 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 + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ @@ -61,36 +61,39 @@ static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what) { struct l1ctl_sock_inst *lsi = ofd->data; - // Check if request is really read request - if (what & BSC_FD_READ) { - struct msgb *msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, - "L1CTL sock rx"); - int rc; - uint16_t len; - struct l1ctl_hdr *l1h; - // read length of the message first and convert to host byte order - rc = read(ofd->fd, &len, sizeof(len)); - if (rc < sizeof(len)) { - goto ERR; - } - // convert to host byte order - len = ntohs(len); - if (len <= 0 || len > L1CTL_SOCK_MSGB_SIZE) { - goto ERR; - } - rc = read(ofd->fd, msgb_data(msg), len); + struct l1ctl_hdr *l1h; + struct msgb *msg; + uint16_t len; + int rc; - if (rc == len) { - msgb_put(msg, rc); - l1h = (void *) msgb_data(msg); - msg->l1h = l1h; - lsi->recv_cb(lsi, msg); - return 0; - } - ERR: perror( - "Failed to receive msg from l2. Connection will be closed.\n"); - l1ctl_sock_disconnect(lsi); + /* Check if request is really read request */ + if (!(what & BSC_FD_READ)) + return 0; + + msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, "L1CTL sock rx"); + + /* read length of the message first and convert to host byte order */ + rc = read(ofd->fd, &len, sizeof(len)); + if (rc < sizeof(len)) + goto err_close; + + /* convert to host byte order */ + len = ntohs(len); + if (len <= 0 || len > L1CTL_SOCK_MSGB_SIZE) + goto err_close; + + rc = read(ofd->fd, msgb_data(msg), len); + if (rc == len) { + msgb_put(msg, rc); + l1h = (void *) msgb_data(msg); + msg->l1h = l1h; + lsi->recv_cb(lsi, msg); + return 0; } +err_close: + perror("Failed to receive msg from l2. Connection will be closed.\n"); + l1ctl_sock_disconnect(lsi); + return 0; } @@ -142,8 +145,7 @@ strcpy(local_addr.sun_path, path); unlink(local_addr.sun_path); - if ((rc = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) - != 0) { + if ((rc = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) != 0) { fprintf(stderr, "Failed to bind the unix domain socket. '%s'\n", local_addr.sun_path); return NULL; @@ -161,7 +163,7 @@ lsi->ofd.fd = fd; lsi->ofd.when = BSC_FD_READ; lsi->ofd.cb = l1ctl_sock_accept_cb; - // no connection -> invalid filedescriptor and not 0 (==std_in) + /* no connection -> invalid filedescriptor and not 0 (==std_in) */ lsi->connection.fd = -1; lsi->l1ctl_sock_path = path; diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 88ffd22..097bf35 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -1,6 +1,7 @@ /* Logging/Debug support of the virtual physical layer */ /* (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf * * All Rights Reserved * @@ -57,20 +58,27 @@ "L1CTL_TRAFFIC_CONF", "L1CTL_TRAFFIC_IND"}; -static const struct log_info_cat default_categories[] = {[DL1C] = { - .name = "DL1C", - .description = "Layer 1 Control", - .color = "\033[1;31m", - .enabled = 1, - .loglevel = LOGL_DEBUG, }, [DVIRPHY] = { - .name = "DVIRPHY", - .description = "Virtual Layer 1 Interface", - .color = "\033[1;31m", - .enabled = 1, - .loglevel = LOGL_DEBUG, }}; +static const struct log_info_cat default_categories[] = { + [DL1C] = { + .name = "DL1C", + .description = "Layer 1 Control", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, }, + [DVIRPHY] = { + .name = "DVIRPHY", + .description = "Virtual Layer 1 Interface", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + } +}; -const struct log_info ms_log_info = {.filter_fn = NULL, .cat = - default_categories, .num_cat = ARRAY_SIZE(default_categories), }; +const struct log_info ms_log_info = { + .filter_fn = NULL, + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; /** * Initialize the logging system for the virtual physical layer. @@ -81,9 +89,9 @@ log_init(&ms_log_info, NULL); stderr_target = log_target_create_stderr(); - if (!stderr) { + if (!stderr) return -1; - } + log_add_target(stderr_target); log_set_all_filter(stderr_target, 1); //log_set_log_level(stderr_target, 1); @@ -91,9 +99,9 @@ log_set_use_color(stderr_target, 0); log_set_print_timestamp(stderr_target, 1); log_set_print_category(stderr_target, 1); - if (cat_mask) { + if (cat_mask) log_parse_category_mask(stderr_target, cat_mask); - } + return 0; } diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index bcd6735..65e8068 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -1,3 +1,23 @@ + +/* (C) 2016 by Sebastian Stumpf + * + * 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, see . + * + */ + #include #include diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index d3975ee..40bc57a 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -1,3 +1,22 @@ +/* (C) 2016 by Sebastian Stumpf + * + * 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, see . + * + */ + #include #include #include @@ -14,7 +33,7 @@ /** * @brief Initialize schedulers data structures. */ -void virt_l1_sched_init(struct l1_model_ms * model) +void virt_l1_sched_init(struct l1_model_ms *model) { l1_model_ms = model; } @@ -53,11 +72,10 @@ struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; /* Empty tdma and mframe sched items lists */ - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) - { + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; - llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) - { + + llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) { talloc_free(ti_next->msg); llist_del(&ti_next->tdma_item_entry); } @@ -74,32 +92,31 @@ struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; uint8_t hyperframe_restart = fn < last_exec_fn; - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) - { + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { /* execute all registered handler for current mf sched item */ uint8_t exec_now = mi_next->fn <= fn || (hyperframe_restart && mi_next->fn > last_exec_fn); /* break loop, as we have an ordered list in case the hyperframe had not been reset */ uint8_t break_now = mi_next->fn > fn && !hyperframe_restart; - if(exec_now) { + if (exec_now) { struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; - // run through all scheduled tdma sched items for that frame number - llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) - { - // exec tdma sched item's handler callback - // TODO: we do not have a tdma scheduler currently and execute alle scheduled tdma items here at once + /* run through all scheduled tdma sched items for that frame number */ + llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, + tdma_item_entry) { + /* exec tdma sched item's handler callback */ + /* TODO: we do not have a TDMA scheduler currently and execute + * all scheduled tdma items here at once */ ti_next->handler_cb(mi_next->fn, ti_next->msg); - // remove handled tdma sched item + /* remove handled tdma sched item */ llist_del(&ti_next->tdma_item_entry); } - // remove handled mframe sched item + /* remove handled mframe sched item */ llist_del(&mi_next->mframe_item_entry); talloc_free(mi_next); } - if(break_now) { + if (break_now) break; - } } last_exec_fn = fn; } @@ -110,36 +127,33 @@ void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, virt_l1_sched_cb * handler_cb) { - struct virt_l1_sched_mframe_item *mi_next = NULL, *mi_tmp = NULL, - *mi_fn = NULL; + struct virt_l1_sched_mframe_item *mi_next = NULL, *mi_tmp = NULL, *mi_fn = NULL; struct virt_l1_sched_tdma_item *ti_new = NULL; - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) - { + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { if (mi_next->fn == fn) { mi_fn = mi_next; break; - } else if (mi_next->fn > fn) { + } else if (mi_next->fn > fn) break; - } } if (!mi_fn) { - // list did not contain mframe item with needed fn + /* list did not contain mframe item with needed fn */ mi_fn = talloc_zero(NULL, struct virt_l1_sched_mframe_item); mi_fn->fn = fn; - // need to manually init the struct content.... no so happy + /* need to manually init the struct content.... no so happy */ mi_fn->tdma_item_list.prev = &mi_fn->tdma_item_list; mi_fn->tdma_item_list.next = &mi_fn->tdma_item_list; - // TODO: check if we get an error if list is empty... - llist_add(&mi_fn->mframe_item_entry, - mi_next->mframe_item_entry.prev); - + /* TODO: check if we get an error if list is empty... */ + llist_add(&mi_fn->mframe_item_entry, mi_next->mframe_item_entry.prev); } + ti_new = talloc_zero(mi_fn, struct virt_l1_sched_tdma_item); ti_new->msg = msg; ti_new->handler_cb = handler_cb; ti_new->ts = ts; - // simply add at end, no ordering for tdma sched items currently - llist_add_tail(&ti_new->tdma_item_entry, &mi_fn->tdma_item_list); // TODO: ordered insert needed if tdma scheduler should be implemented + /* simply add at end, no ordering for tdma sched items currently */ + llist_add_tail(&ti_new->tdma_item_entry, &mi_fn->tdma_item_list); + /* TODO: ordered insert needed if tdma scheduler should be implemented */ } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 5d62afd..226078c 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -2,6 +2,7 @@ /* (C) 2010 by Dieter Spaar * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf * * All Rights Reserved * @@ -79,9 +80,7 @@ msg->l2h = data_ind->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, - &virt_l1_sched_handler_cb); - + virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, @@ -103,16 +102,15 @@ l1dl->frame_nr = htonl(fn); l1dl->snr = snr; l1dl->rx_level = signal_dbm; - l1dl->num_biterr = 0; // no biterrors + l1dl->num_biterr = 0; /* no biterrors */ l1dl->fire_crc = 0; - // TODO: data decoding and decryption + /* TODO: data decoding and decryption */ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); DEBUGP(DL1C, "Sending signaling-data to l23.\n"); l1ctl_sap_tx_to_l23(l1ctl_msg); - } /** @@ -127,7 +125,7 @@ { struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn, snr, arfcn); - // send confirm to layer23 + /* send confirm to layer23 */ l1ctl_sap_tx_to_l23(l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 2c0f10c..4f6306e 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -1,3 +1,26 @@ + +/* (C) 2010 by Dieter Spaar + * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf + * + * 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 @@ -31,11 +54,10 @@ */ void l1ctl_rx_fbsb_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); l1_model_ms->state->state = MS_STATE_IDLE_SYNCING; @@ -50,14 +72,15 @@ void prim_fbsb_sync(struct msgb *msg) { struct gsmtap_hdr *gh = msgb_l1(msg); - uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg - uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ - // ignore messages from other arfcns as the one requested to sync to by l23 + /* ignore messages from other arfcns as the one requested to sync to by l23 */ if (l1_model_ms->state->fbsb.arfcn != arfcn) { talloc_free(msg); - // cancel sync if we did not receive a msg on dl from the requested arfcn that we can sync to - if(sync_count++ > 20) { + /* cancel sync if we did not receive a msg on dl from + * the requested arfcn that we can sync to */ + if (sync_count++ > 20) { sync_count = 0; l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; l1ctl_tx_fbsb_conf(1, (l1_model_ms->state->fbsb.arfcn)); @@ -92,10 +115,10 @@ { struct msgb *msg; struct l1ctl_fbsb_conf *resp; - uint32_t fn = 0; // 0 should be okay here - uint16_t snr = 40; // signal noise ratio > 40db is best signal (unused in virt) - int16_t initial_freq_err = 0; // 0 means no error (unused in virt) - uint8_t bsic = 0; // bsci can be read from sync burst (unused in virt) + uint32_t fn = 0; /* 0 should be okay here */ + uint16_t snr = 40; /* signal noise ratio > 40db is best signal (unused in virt)*/ + int16_t initial_freq_err = 0; /* 0 means no error (unused in virt) */ + uint8_t bsic = 0; /* BSIC can be read from sync burst (unused in virt) */ msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, snr, arfcn); @@ -104,8 +127,7 @@ resp->result = res; resp->bsic = bsic; - DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", - getL1ctlPrimName(L1CTL_FBSB_CONF), res); + DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); l1ctl_sap_tx_to_l23(msg); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 312461c..9afee0c 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -1,3 +1,26 @@ + +/* (C) 2010 by Dieter Spaar + * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf + * + * 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 @@ -22,19 +45,26 @@ * @param [in] arfcn to change sig str for. * @param [in] sig_lev the measured signal level value. */ -uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) { - if(l1_model_ms->state->pm.timeout_s > 0 || l1_model_ms->state->pm.timeout_us > 0) { - osmo_timer_schedule(&l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[arfcn], l1_model_ms->state->pm.timeout_s, l1_model_ms->state->pm.timeout_us); +uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) +{ + if (l1_model_ms->state->pm.timeout_s > 0 || l1_model_ms->state->pm.timeout_us > 0) { + osmo_timer_schedule(&l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[arfcn], + l1_model_ms->state->pm.timeout_s, + l1_model_ms->state->pm.timeout_us); } - l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn] = sig_lev - l1_model_ms->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; - DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", arfcn, l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn], dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn])); + l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn] = + sig_lev - l1_model_ms->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; + DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", + arfcn, l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn], + dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn])); return l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn]; } -void prim_pm_timer_cb(void *data) { - // reset the signal level to bad value if no messages have been received from that rfcn for a given time - DEBUGP(DL1C, - "Timeout occurred for arfcn, signal level reset to worst value.\n"); +void prim_pm_timer_cb(void *data) +{ + /* reset the signal level to bad value if no messages have been + * received from that rfcn for a given time */ + DEBUGP(DL1C, "Timeout occurred for arfcn, signal level reset to worst value.\n"); *((int16_t*)data) = MIN_SIG_LEV_DBM; } @@ -45,50 +75,47 @@ * * @param [in] msg the received message. * - * Process power measurement for a given range of arfcns to calculate signal power and connection quality. + * Process power measurement for a given range of arfcns to calculate + * signal power and connection quality. * - * Note: This should only be called after a certain time so some messages have already been received. - * + * Note: This should only be called after a certain time so some + * messages have already been received. */ void l1ctl_rx_pm_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *) l1h->data; struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); uint16_t arfcn_next; - // convert to host order + + /* convert to host order */ pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - DEBUGP(DL1C, - "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", - pm_req->type, pm_req->range.band_arfcn_from, - pm_req->range.band_arfcn_to); + DEBUGP(DL1C, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); for (arfcn_next = pm_req->range.band_arfcn_from; - arfcn_next <= pm_req->range.band_arfcn_to; - ++arfcn_next) { - struct l1ctl_pm_conf *pm_conf = - (struct l1ctl_pm_conf *)msgb_put(resp_msg, - sizeof(*pm_conf)); + arfcn_next <= pm_req->range.band_arfcn_to; ++arfcn_next) { + struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *) msgb_put(resp_msg, sizeof(*pm_conf)); pm_conf->band_arfcn = htons(arfcn_next); - // set min and max to the value calculated for that arfcn (IGNORE UPLINKK AND PCS AND OTHER FLAGS) + /* set min and max to the value calculated for that + * arfcn (IGNORE UPLINKK AND PCS AND OTHER FLAGS) */ pm_conf->pm[0] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); pm_conf->pm[1] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); if (arfcn_next == pm_req->range.band_arfcn_to) { struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; } - // no more space to hold mor pm info in msgb, flush to l23 + /* no more space to hold mor pm info in msgb, flush to l23 */ if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { l1ctl_sap_tx_to_l23(resp_msg); resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); } } - // transmit the remaining part of pm response to l23 - if (resp_msg) { + /* transmit the remaining part of pm response to l23 */ + if (resp_msg) l1ctl_sap_tx_to_l23(resp_msg); - } } /** @@ -100,10 +127,10 @@ { int i; l1_model_ms = model; - // init the signal level of all arfcns with the lowest value possible - memset (model->state->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); - // init timers - for(i = 0; i < 1024; ++i) { + /* init the signal level of all arfcns with the lowest value possible */ + memset(model->state->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); + /* init timers */ + for (i = 0; i < 1024; ++i) { l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].cb = prim_pm_timer_cb; l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].data = &l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[i]; } diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index e455e06..0bda7e9 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -2,6 +2,7 @@ /* (C) 2010 by Dieter Spaar * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf * * All Rights Reserved * @@ -39,26 +40,28 @@ static struct l1_model_ms *l1_model_ms = NULL; static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); -// use if we have a combined uplink (RACH, SDCCH, ...) (see http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) -// if we have no combined channel config, uplink consists of only RACH -static uint8_t t3_to_rach_comb[51] = { +/* use if we have a combined uplink (RACH, SDCCH, ...) (see + * http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) + * if we have no combined channel config, uplink consists of only RACH * */ +static const uint8_t t3_to_rach_comb[51] = { 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 26, 27, 27, 27, 27}; -static uint8_t rach_to_t3_comb[27] = { + 25, 25, 25, 25, 25, 26, 27, 27, 27, 27 +}; +static const uint8_t rach_to_t3_comb[27] = { 4, 5, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 45, 46}; + 30, 31, 32, 33, 34, 35, 36, 45, 46 +}; /** * @brief Handler callback function for RACH request. * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb *msg) { gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_rach_conf(fn, - l1_model_ms->state->serving_cell.arfcn); + l1ctl_tx_rach_conf(fn, l1_model_ms->state->serving_cell.arfcn); } /** @@ -73,30 +76,29 @@ */ void l1ctl_rx_rach_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; uint32_t fn_sched; - uint8_t ts = 1; //FIXME mostly, ts 1 is used for rach, where can i get that info? System info? + uint8_t ts = 1; /* FIXME mostly, ts 1 is used for rach, where can i get that info? System info? */ uint16_t offset = ntohs(rach_req->offset); - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", - rach_req->ra, offset, rach_req->combined); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + rach_req->ra, offset, rach_req->combined); - if (rach_req->ra == 0x03) { + if (rach_req->ra == 0x03) fn_sched = 42; - } - // set ra data to msg (8bits, the 11bit option is not used) + /* set ra data to msg (8bits, the 11bit option is not used for GSM) */ msg->l2h = msgb_put(msg, sizeof(uint8_t)); *msg->l2h = rach_req->ra; - // chan_nr need to be encoded here, as it is not set by l23 for the rach request, but needed by virt um + /* chan_nr need to be encoded here, as it is not set by l23 for + * the rach request, but needed by virt um */ ul->chan_nr = rsl_enc_chan_nr(RSL_CHAN_RACH, 0, ts); ul->link_id = LID_DEDIC; - // sched fn calculation if we have a combined ccch channel configuration + /* sched fn calculation if we have a combined ccch channel configuration */ if (rach_req->combined) { /* add elapsed RACH slots to offset */ offset += t3_to_rach_comb[l1_model_ms->state->current_time.t3]; @@ -104,12 +106,10 @@ fn_sched = l1_model_ms->state->current_time.fn - l1_model_ms->state->current_time.t3; fn_sched += offset / 27 * 51; fn_sched += rach_to_t3_comb[offset % 27]; - } else { + } else fn_sched = l1_model_ms->state->current_time.fn + offset; - } virt_l1_sched_schedule(msg, fn_sched, ts, &virt_l1_sched_handler_cb); - } /** diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index dbdcac3..0e02153 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -2,6 +2,7 @@ /* (C) 2010 by Dieter Spaar * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf * * All Rights Reserved * @@ -63,20 +64,18 @@ */ void l1ctl_rx_traffic_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *) ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, - ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, - &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, @@ -89,10 +88,8 @@ struct l1ctl_info_dl * l1dl; uint8_t rsl_chan_type, subchan, timeslot; l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); - l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_info_dl)); - l1ti = (struct l1ctl_traffic_ind *)msgb_put( - l1ctl_msg, sizeof(struct l1ctl_traffic_ind)); + l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(*l1dl)); + l1ti = (struct l1ctl_traffic_ind *) msgb_put(l1ctl_msg, sizeof(*l1ti)); rsl_dec_chan_nr(chan_nr, &rsl_chan_type, &subchan, ×lot); @@ -102,10 +99,10 @@ l1dl->frame_nr = htonl(fn); l1dl->snr = snr; l1dl->rx_level = signal_dbm; - l1dl->num_biterr = 0; // no biterrors + l1dl->num_biterr = 0; /* no biterrors */ l1dl->fire_crc = 0; - // TODO: traffic decoding and decryption + /* TODO: traffic decoding and decryption */ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); DEBUGP(DL1C, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); @@ -124,7 +121,7 @@ { struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn, snr, arfcn); - // send confirm to layer23 + /* send confirm to layer23 */ l1ctl_sap_tx_to_l23(l1ctl_msg); } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index aaa9311..e4f5fd2 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -1,5 +1,24 @@ /* osmocom includes */ +/* (C) 2016 by Sebastian Stumpf + * + * 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, see . + * + */ + #include #include #include @@ -18,13 +37,13 @@ #define DEFAULT_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ #define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" -static char* dl_rx_grp = DEFAULT_MS_MCAST_GROUP; -static char* ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; +static char *dl_rx_grp = DEFAULT_MS_MCAST_GROUP; +static char *ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; static int port = DEFAULT_MCAST_PORT; -static char* log_mask = DEFAULT_LOG_MASK; -static char * l1ctl_sock_path = L1CTL_SOCK_PATH; -static char * arfcn_sig_lev_red_mask = NULL; -static char * pm_timeout = NULL; +static char *log_mask = DEFAULT_LOG_MASK; +static char *l1ctl_sock_path = L1CTL_SOCK_PATH; +static char *arfcn_sig_lev_red_mask = NULL; +static char *pm_timeout = NULL; static void handle_options(int argc, char **argv) { @@ -75,17 +94,16 @@ void parse_pm_timeout(struct l1_model_ms *model, char *pm_timeout) { - if(!pm_timeout || (strcmp(pm_timeout, "") == 0)) { + if (!pm_timeout || (strcmp(pm_timeout, "") == 0)) return; - } - // seconds + + /* seconds */ char *buf = strtok(pm_timeout, ":"); model->state->pm.timeout_s = atoi(buf); - // microseconds + /* microseconds */ buf = strtok(NULL, ":"); - if(buf) { + if (buf) model->state->pm.timeout_us = atoi(buf); - } } /** @@ -93,30 +111,30 @@ */ void parse_arfcn_sig_lev_red(struct l1_model_ms *model, char * arfcn_sig_lev_red_mask) { - if(!arfcn_sig_lev_red_mask || (strcmp(arfcn_sig_lev_red_mask, "") == 0)) { + if (!arfcn_sig_lev_red_mask || (strcmp(arfcn_sig_lev_red_mask, "") == 0)) return; - } + char *token = strtok(arfcn_sig_lev_red_mask, ":"); do { char* colon = strstr(token, ","); uint16_t arfcn; uint8_t red; - if(!colon) { + if (!colon) continue; - } + colon[0] = '\0'; arfcn = atoi(token); red = atoi(colon + 1); - //TODO: this may go wild if the token string is not properly formatted + /* TODO: this may go wild if the token string is not properly formatted */ model->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn] = red; } while ((token = strtok(NULL, ":"))); } int main(int argc, char *argv[]) { - // init loginfo + /* init loginfo */ static struct l1_model_ms *model; handle_options(argc, argv); @@ -136,7 +154,7 @@ l1ctl_sap_init(model); virt_l1_sched_init(model); - // apply timeout and arfcn reduction value config to model + /* apply timeout and arfcn reduction value config to model */ parse_pm_timeout(model, pm_timeout); parse_arfcn_sig_lev_red(model, arfcn_sig_lev_red_mask); @@ -146,12 +164,12 @@ l1ctl_sock_path); while (1) { - // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) + /* handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) */ osmo_select_main(0); } l1_model_ms_destroy(model); - // not reached + /* not reached */ return EXIT_FAILURE; } -- To view, visit https://gerrit.osmocom.org/3217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3aa95dbef75d7749d490aad0237d074528527e8b Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:50 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Make sure heaer files are part of 'make dist' Message-ID: Review at https://gerrit.osmocom.org/3218 VIRT-PHY: Make sure heaer files are part of 'make dist' Change-Id: Ib4cd0463da1cf22e04a1debfed55a33f7b6542d4 --- M src/host/virt_phy/Makefile.am M src/host/virt_phy/configure.ac A src/host/virt_phy/include/Makefile.am D src/host/virt_phy/include/layer1/mframe_sched.h D src/host/virt_phy/include/layer1/sync.h D src/host/virt_phy/include/layer1/tdma_sched.h 6 files changed, 12 insertions(+), 346 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/18/3218/1 diff --git a/src/host/virt_phy/Makefile.am b/src/host/virt_phy/Makefile.am index 38bdf12..629ce0f 100644 --- a/src/host/virt_phy/Makefile.am +++ b/src/host/virt_phy/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = src +SUBDIRS = include src dist_doc_DATA = README diff --git a/src/host/virt_phy/configure.ac b/src/host/virt_phy/configure.ac index 860082e..c8012c9 100644 --- a/src/host/virt_phy/configure.ac +++ b/src/host/virt_phy/configure.ac @@ -22,6 +22,7 @@ AC_CONFIG_FILES([ Makefile + include/Makefile src/Makefile ]) AC_OUTPUT diff --git a/src/host/virt_phy/include/Makefile.am b/src/host/virt_phy/include/Makefile.am new file mode 100644 index 0000000..6048a4b --- /dev/null +++ b/src/host/virt_phy/include/Makefile.am @@ -0,0 +1,10 @@ +noinst_HEADERS = \ + virtphy/logging.h \ + virtphy/osmo_mcast_sock.h \ + virtphy/l1ctl_sock.h \ + virtphy/virtual_um.h \ + virtphy/gsmtapl1_if.h \ + virtphy/virt_l1_sched.h \ + virtphy/common_util.h \ + virtphy/l1ctl_sap.h \ + virtphy/virt_l1_model.h diff --git a/src/host/virt_phy/include/layer1/mframe_sched.h b/src/host/virt_phy/include/layer1/mframe_sched.h deleted file mode 100644 index ecdb1ec..0000000 --- a/src/host/virt_phy/include/layer1/mframe_sched.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef _L1_MFRAME_SCHED_H -#define _L1_MFRAME_SCHED_H - -#include - -enum mframe_task { - MF_TASK_BCCH_NORM, - MF_TASK_BCCH_EXT, - MF_TASK_CCCH, - MF_TASK_CCCH_COMB, - - MF_TASK_SDCCH4_0, - MF_TASK_SDCCH4_1, - MF_TASK_SDCCH4_2, - MF_TASK_SDCCH4_3, - - MF_TASK_SDCCH8_0, - MF_TASK_SDCCH8_1, - MF_TASK_SDCCH8_2, - MF_TASK_SDCCH8_3, - MF_TASK_SDCCH8_4, - MF_TASK_SDCCH8_5, - MF_TASK_SDCCH8_6, - MF_TASK_SDCCH8_7, - - MF_TASK_TCH_F_EVEN, - MF_TASK_TCH_F_ODD, - MF_TASK_TCH_H_0, - MF_TASK_TCH_H_1, - - MF_TASK_NEIGH_PM51_C0T0, - MF_TASK_NEIGH_PM51, - MF_TASK_NEIGH_PM26E, - MF_TASK_NEIGH_PM26O, - - /* Test task: send Normal Burst in all timeslots */ - MF_TASK_UL_ALL_NB, -}; - -enum mf_sched_item_flag { - MF_F_SACCH = (1 << 0), -}; - -/* The scheduler itself */ -struct mframe_scheduler { - uint32_t tasks; - uint32_t tasks_tgt; - uint32_t safe_fn; -}; - -uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t ts); - -/* Enable a specific task */ -void mframe_enable(enum mframe_task task_id); - -/* Disable a specific task */ -void mframe_disable(enum mframe_task task_id); - -/* Replace the current active set by the new one */ -void mframe_set(uint32_t tasks); - -/* Schedule mframe_sched_items according to current MF TASK list */ -void mframe_schedule(void); - -/* reset the scheduler, disabling all tasks */ -void mframe_reset(void); - -#endif /* _MFRAME_SCHED_H */ diff --git a/src/host/virt_phy/include/layer1/sync.h b/src/host/virt_phy/include/layer1/sync.h deleted file mode 100644 index dae85a1..0000000 --- a/src/host/virt_phy/include/layer1/sync.h +++ /dev/null @@ -1,204 +0,0 @@ -#ifndef _L1_SYNC_H -#define _L1_SYNC_H - -#include -#include -#include -#include -#include - -/* structure representing L1 sync information about a cell */ -struct l1_cell_info { - /* on which ARFCN (+band) is the cell? */ - uint16_t arfcn; - /* what's the BSIC of the cell (from SCH burst decoding) */ - uint8_t bsic; - /* Combined or non-combined CCCH */ - uint8_t ccch_mode; /* enum ccch_mode */ - /* whats the delta of the cells current GSM frame number - * compared to our current local frame number */ - int32_t fn_offset; - /* how much does the TPU need adjustment (delta) to synchronize - * with the cells burst */ - uint32_t time_alignment; - /* FIXME: should we also store the AFC value? */ -}; - -enum l1s_chan { - L1S_CHAN_MAIN, - L1S_CHAN_SACCH, - L1S_CHAN_TRAFFIC, - _NUM_L1S_CHAN -}; - -enum l1_compl { - L1_COMPL_FB, - L1_COMPL_RACH, - L1_COMPL_TX_NB, - L1_COMPL_TX_TCH, -}; - -typedef void l1_compl_cb(enum l1_compl c); - -#define L1S_NUM_COMPL 32 -#define L1S_NUM_NEIGH_CELL 6 - -struct l1s_h0 { - uint16_t arfcn; -}; - -struct l1s_h1 { - uint8_t hsn; - uint8_t maio; - uint8_t n; - uint16_t ma[64]; -}; - -struct l1s_state { - struct gsm_time current_time; /* current GSM time */ - struct gsm_time next_time; /* GSM time at next TMDMA irq */ - - /* the cell on which we are camping right now */ - struct l1_cell_info serving_cell; - - /* neighbor cell sync info */ - struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; - - /* TDMA scheduler */ - struct tdma_scheduler tdma_sched; - - /* Multiframe scheduler */ - struct mframe_scheduler mframe_sched; - - /* The current TPU offset register */ - uint32_t tpu_offset; - int32_t tpu_offset_correction; - - /* TX parameters */ - int8_t ta; - uint8_t tx_power; - - /* TCH */ - uint8_t tch_mode; - uint8_t tch_sync; - uint8_t audio_mode; - - /* Transmit queues of pending packets for main DCCH and ACCH */ - struct llist_head tx_queue[_NUM_L1S_CHAN]; - struct msgb *tx_meas; - - /* Which L1A completions are scheduled right now */ - uint32_t scheduled_compl; - /* callbacks for each of the completions */ - l1_compl_cb *completion[L1S_NUM_COMPL]; - - /* Structures below are for L1-task specific parameters, used - * to communicate between l1-sync and l1-async (l23_api) */ - struct { - uint8_t mode; /* FB_MODE 0/1 */ - } fb; - - struct { - /* power measurement l1 task */ - unsigned int mode; - union { - struct { - uint16_t arfcn_start; - uint16_t arfcn_next; - uint16_t arfcn_end; - } range; - }; - struct msgb *msg; - } pm; - - struct { - uint8_t ra; - } rach; - - struct { - enum { - GSM_DCHAN_NONE = 0, - GSM_DCHAN_SDCCH_4, - GSM_DCHAN_SDCCH_8, - GSM_DCHAN_TCH_H, - GSM_DCHAN_TCH_F, - GSM_DCHAN_UNKNOWN, - } type; - - uint8_t scn; - uint8_t tsc; - uint8_t tn; - uint8_t h; - - union { - struct l1s_h0 h0; - struct l1s_h1 h1; - }; - - uint8_t st_tsc; - uint8_t st_tn; - uint8_t st_h; - - union { - struct l1s_h0 st_h0; - struct l1s_h1 st_h1; - }; - } dedicated; - - /* neighbour cell power measurement process */ - struct { - uint8_t n, second; - uint8_t pos; - uint8_t running; - uint16_t band_arfcn[64]; - uint8_t tn[64]; - uint8_t level[64]; - } neigh_pm; -}; - -extern struct l1s_state l1s; - -struct l1s_meas_hdr { - uint16_t snr; /* signal/noise ratio */ - int16_t toa_qbit; /* time of arrival (qbits) */ - int16_t pm_dbm8; /* power level in dbm/8 */ - int16_t freq_err; /* Frequency error in Hz */ -}; - -int16_t l1s_snr_int(uint16_t snr); -uint16_t l1s_snr_fract(uint16_t snr); - -void l1s_dsp_abort(void); - -void l1s_tx_apc_helper(uint16_t arfcn); - -/* schedule a completion */ -void l1s_compl_sched(enum l1_compl c); - -void l1s_init(void); - -/* reset the layer1 as part of synchronizing to a new cell */ -void l1s_reset(void); - -/* init.c */ -void layer1_init(void); - -/* A debug macro to print every TDMA frame */ -#ifdef DEBUG_EVERY_TDMA -#define putchart(x) putchar(x) -#else -#define putchart(x) -#endif - -/* Convert an angle in fx1.15 notatinon into Hz */ -#define BITFREQ_DIV_2PI 43104 /* 270kHz / 2 * pi */ -#define BITFREQ_DIV_PI 86208 /* 270kHz / pi */ -#define ANG2FREQ_SCALING (2<<15) /* 2^15 scaling factor for fx1.15 */ -#define ANGLE_TO_FREQ(angle) ((int16_t)angle * BITFREQ_DIV_PI / ANG2FREQ_SCALING) - -void l1s_reset_hw(void); -void synchronize_tdma(struct l1_cell_info *cinfo); -void l1s_time_inc(struct gsm_time *time, uint32_t delta_fn); -void l1s_time_dump(const struct gsm_time *time); - -#endif /* _L1_SYNC_H */ diff --git a/src/host/virt_phy/include/layer1/tdma_sched.h b/src/host/virt_phy/include/layer1/tdma_sched.h deleted file mode 100644 index f58d59b..0000000 --- a/src/host/virt_phy/include/layer1/tdma_sched.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef _L1_TDMA_SCHED_H -#define _L1_TDMA_SCHED_H - -#include - -/* TDMA scheduler */ - -/* The idea of this scheduler is that we have a circular buffer of buckets, - * where each bucket corresponds to one future TDMA frame [interrupt]. Each - * bucket contains of a list of callbacks which are executed when the bucket - * index reaches that particular bucket. */ - -#define TDMASCHED_NUM_FRAMES 25 -#define TDMASCHED_NUM_CB 8 - -#define TDMA_IFLG_TPU (1<<0) -#define TDMA_IFLG_DSP (1<<1) - -typedef int tdma_sched_cb(uint8_t p1, uint8_t p2, uint16_t p3); - -/* A single item in a TDMA scheduler bucket */ -struct tdma_sched_item { - tdma_sched_cb *cb; - uint8_t p1; - uint8_t p2; - uint16_t p3; - int16_t prio; - uint16_t flags; /* TDMA_IFLG_xxx */ -}; - -/* A bucket inside the TDMA scheduler */ -struct tdma_sched_bucket { - struct tdma_sched_item item[TDMASCHED_NUM_CB]; - uint8_t num_items; -}; - -/* The scheduler itself, consisting of buckets and a current index */ -struct tdma_scheduler { - struct tdma_sched_bucket bucket[TDMASCHED_NUM_FRAMES]; - uint8_t cur_bucket; -}; - -/* Schedule an item at 'frame_offset' TDMA frames in the future */ -int tdma_schedule(uint8_t frame_offset, tdma_sched_cb *cb, - uint8_t p1, uint8_t p2, uint16_t p3, int16_t prio); - -/* Schedule a set of items starting from 'frame_offset' TDMA frames in the future */ -int tdma_schedule_set(uint8_t frame_offset, const struct tdma_sched_item *item_set, uint16_t p3); - -/* Scan current frame scheduled items for flags */ -uint16_t tdma_sched_flag_scan(void); - -/* Execute pre-scheduled events for current frame */ -int tdma_sched_execute(void); - -/* Advance TDMA scheduler to the next bucket */ -void tdma_sched_advance(void); - -/* reset the scheduler; erase all scheduled items */ -void tdma_sched_reset(void); - -/* debug function: print number of entries of all TDMA buckets */ -void tdma_sched_dump(void); - - -extern int tdma_end_set(uint8_t p1, uint8_t p2, uint16_t p3); -#define SCHED_ITEM(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, .flags = 0 } -#define SCHED_ITEM_DT(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, \ - .flags = TDMA_IFLG_TPU | TDMA_IFLG_DSP } -#define SCHED_END_FRAME() { .cb = NULL, .p1 = 0, .p2 = 0 } -#define SCHED_END_SET() { .cb = &tdma_end_set, .p1 = 0, .p2 = 0 } - -#endif /* _L1_TDMA_SCHED_H */ -- To view, visit https://gerrit.osmocom.org/3218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib4cd0463da1cf22e04a1debfed55a33f7b6542d4 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:50 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Fix all compiler warnings on gcc-6.3.0 Message-ID: Review at https://gerrit.osmocom.org/3219 VIRT-PHY: Fix all compiler warnings on gcc-6.3.0 Change-Id: I95b93ec907fbfd180a0f2ac681dd63791ede24db --- M src/host/virt_phy/include/virtphy/logging.h M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c 6 files changed, 7 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/19/3219/1 diff --git a/src/host/virt_phy/include/virtphy/logging.h b/src/host/virt_phy/include/virtphy/logging.h index 87f12f7..6ca2525 100644 --- a/src/host/virt_phy/include/virtphy/logging.h +++ b/src/host/virt_phy/include/virtphy/logging.h @@ -8,4 +8,4 @@ extern const struct log_info ms_log_info; int ms_log_init(char *cat_mask); -char *getL1ctlPrimName(uint8_t type); +const char *getL1ctlPrimName(uint8_t type); diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index e136aa8..2e16bfa 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -86,7 +86,7 @@ if (rc == len) { msgb_put(msg, rc); l1h = (void *) msgb_data(msg); - msg->l1h = l1h; + msg->l1h = (void *) l1h; lsi->recv_cb(lsi, msg); return 0; } diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 097bf35..7801bec 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -25,7 +25,7 @@ #include #include -const char* l1ctlPrimNames[] = { +static const char* l1ctlPrimNames[] = { "_L1CTL_NONE", "L1CTL_FBSB_REQ", "L1CTL_FBSB_CONF", @@ -105,7 +105,7 @@ return 0; } -char *getL1ctlPrimName(uint8_t type) +const char *getL1ctlPrimName(uint8_t type) { return l1ctlPrimNames[type]; } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 226078c..8b65d6d 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index 0bda7e9..1642ac6 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 0e02153..50e6857 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95b93ec907fbfd180a0f2ac681dd63791ede24db Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:20:50 +0000 Subject: [PATCH] osmocom-bb[master]: Merge branch 'laforge/virt-phy' Message-ID: Review at https://gerrit.osmocom.org/3220 Merge branch 'laforge/virt-phy' This imports all the great work that Sebastian Stumpf has done on the virtual L1 that can talk GSMTAP to osmo-bts-virtual on the network side. I've done various clean-ups on top of his code, primarily coding style related. There's still quite a bit of FIXME's and TODO's, but thre's no reason to keep this code out of master, given that it has zero modifications on the existing code and thus cannot introduce any regressions. Change-Id: I2e6ff403320420e72b89930325c8307f0e6a395f --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/20/3220/1 -- To view, visit https://gerrit.osmocom.org/3220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e6ff403320420e72b89930325c8307f0e6a395f Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:26:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:26:37 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Initial commit of virt-phy to work with osmo-bts v... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3197 to look at the new patch set (#2). VIRT-PHY: Initial commit of virt-phy to work with osmo-bts virt-phy. This patch implements a virtual physical layer replacing the air interface. The purpose is to get rid of the hardware requirements and be able to start testing and implementing layer 2 communication functionality on one machine. Multicast sockets are used to enable bidirectional communication between the BTS and the MS process. The GSMTAP protocol designed for wireshark capturing is used to encapsulate the payload on the virtual physical layer. The virtual physical layer on the osmocom-bb side implements the L1CTL interface to the layer23 apps like mobile. * Working mcast socket communication and extraction of its functionality. * Basic handlers for file descriptor callbacks from incoming L1CTL messages and extraction of that functionality to a l1ctl socket class. * Multiplexing to different routines depending on incoming L1CTL message type. * Uses virt_um and osmocom_mcast_sock implementation from osmo-bts virt-phy. * Ecapsulation and parsing methods to and from GSMTAP messages. * Basic handlers for file descriptor callbacks from incoming mcast messages on the virtual um. * Multiplexing to different channel routines based on GSMTAP header channel type. * Example configuration for l23 app mobile using virtual test sim. Change-Id: I203c8ec58326e52a09603a37232fce7ae3641415 --- A .gitignore M src/Makefile A src/host/virt_phy/.gitignore A src/host/virt_phy/Makefile.am A src/host/virt_phy/README A src/host/virt_phy/configure.ac A src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg A src/host/virt_phy/include/layer1/mframe_sched.h A src/host/virt_phy/include/layer1/sync.h A src/host/virt_phy/include/layer1/tdma_sched.h A src/host/virt_phy/src/Makefile.am A src/host/virt_phy/src/gsmtapl1_if.c A src/host/virt_phy/src/gsmtapl1_if.h A src/host/virt_phy/src/l1ctl_sap.c A src/host/virt_phy/src/l1ctl_sap.h A src/host/virt_phy/src/l1ctl_sock.c A src/host/virt_phy/src/l1ctl_sock.h A src/host/virt_phy/src/logging.c A src/host/virt_phy/src/logging.h A src/host/virt_phy/src/osmo_mcast_sock.c A src/host/virt_phy/src/osmo_mcast_sock.h A src/host/virt_phy/src/virt_l1_model.c A src/host/virt_phy/src/virt_l1_model.h A src/host/virt_phy/src/virtphy.c A src/host/virt_phy/src/virtual_um.c A src/host/virt_phy/src/virtual_um.h 26 files changed, 2,515 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/97/3197/2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..363f656 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +*.o +*.a +Makefile.in +Makefile +.deps + +build-target +aclocal.m4 +autom4te.cache +config.log +config.status +config.guess +config.sub +configure +compile +depcomp +install-sh +missing +stamp-h1 +core +core.* + +# Backups, vi, merges +*~ +*.sw? +*.orig +*.sav + +# development environment +/.autotools +/.cproject +/.project +/.settings/ + diff --git a/src/Makefile b/src/Makefile index 00231a6..e83175c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,7 +12,8 @@ TOPDIR=$(shell pwd) all: libosmocore-target nofirmware firmware mtk-firmware -nofirmware: layer23 osmocon gsmmap + +nofirmware: layer23 osmocon gsmmap virtphy libosmocore-target: shared/libosmocore/build-target/src/.libs/libosmocore.a @@ -45,6 +46,15 @@ host/osmocon/osmocon: host/osmocon/Makefile make -C host/osmocon +.PHONY: virtphy +virtphy: host/virt_phy/Makefile + cd host/virt_phy && make + +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) .PHONY: gsmmap gsmmap: host/gsmmap/gsmmap @@ -86,6 +96,7 @@ make -C host/layer23 $@ make -C host/osmocon $@ make -C host/gsmmap $@ + make -C host/virt_phy $@ make -C target/firmware $@ make -C target/firmware -f Makefile.mtk $@ @@ -94,5 +105,6 @@ make -C host/layer23 $@ make -C host/osmocon $@ make -C host/gsmmap $@ + make -C host/virt_phy $@ # 'firmware' also handles 'mtk-firmware' make -C target/firmware $@ diff --git a/src/host/virt_phy/.gitignore b/src/host/virt_phy/.gitignore new file mode 100644 index 0000000..1e19c7f --- /dev/null +++ b/src/host/virt_phy/.gitignore @@ -0,0 +1,3 @@ +config.h +config.h.in +src/virtphy \ No newline at end of file diff --git a/src/host/virt_phy/Makefile.am b/src/host/virt_phy/Makefile.am new file mode 100644 index 0000000..515d51b --- /dev/null +++ b/src/host/virt_phy/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src +dist_doc_DATA = README \ No newline at end of file diff --git a/src/host/virt_phy/README b/src/host/virt_phy/README new file mode 100644 index 0000000..a780664 --- /dev/null +++ b/src/host/virt_phy/README @@ -0,0 +1,2 @@ +This is the package for the Osmocom virtual physical layer. +A layer 1 implementation satisfying the L1CTL interface towards the l23 application (e.g. mobile). \ No newline at end of file diff --git a/src/host/virt_phy/configure.ac b/src/host/virt_phy/configure.ac new file mode 100644 index 0000000..bcdbf91 --- /dev/null +++ b/src/host/virt_phy/configure.ac @@ -0,0 +1,27 @@ +dnl Process this file with autoconf to produce a configure script +AC_INIT([virtphy], 0.0.0) +AM_CONFIG_HEADER([config.h]) +AM_INIT_AUTOMAKE([foreign dist-bzip2]) + +dnl kernel style compile messages +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +dnl checks for programs +AC_PROG_MAKE_SET +AC_PROG_CC +AC_PROG_INSTALL + +dnl checks for libraries +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm) + +dnl checks for header files +AC_HEADER_STDC + +dnl Checks for typedefs, structures and compiler characteristics + +AC_CONFIG_FILES([ + Makefile + src/Makefile +]) +AC_OUTPUT diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg new file mode 100644 index 0000000..382a09d --- /dev/null +++ b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg @@ -0,0 +1,67 @@ +! +! OsmocomBB (0.0.0) configuration saved from vty +!! +! +line vty + no login +! +gps device /dev/ttyACM0 +gps baudrate default +no gps enable +! +no hide-default +! +ms 1 + layer2-socket /tmp/osmocom_l2 + sap-socket /tmp/osmocom_sap + sim test + network-selection-mode auto + imei 123456789012345 0 + imei-fixed + no emergency-imsi + no sms-service-center + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + no gsm-850 + dcs + no pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + exit + test-sim + imsi 901700000000403 + ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + no barred-access + no rplmn + hplmn-search foreign-country + exit + no shutdown +exit +! diff --git a/src/host/virt_phy/include/layer1/mframe_sched.h b/src/host/virt_phy/include/layer1/mframe_sched.h new file mode 100644 index 0000000..ecdb1ec --- /dev/null +++ b/src/host/virt_phy/include/layer1/mframe_sched.h @@ -0,0 +1,68 @@ +#ifndef _L1_MFRAME_SCHED_H +#define _L1_MFRAME_SCHED_H + +#include + +enum mframe_task { + MF_TASK_BCCH_NORM, + MF_TASK_BCCH_EXT, + MF_TASK_CCCH, + MF_TASK_CCCH_COMB, + + MF_TASK_SDCCH4_0, + MF_TASK_SDCCH4_1, + MF_TASK_SDCCH4_2, + MF_TASK_SDCCH4_3, + + MF_TASK_SDCCH8_0, + MF_TASK_SDCCH8_1, + MF_TASK_SDCCH8_2, + MF_TASK_SDCCH8_3, + MF_TASK_SDCCH8_4, + MF_TASK_SDCCH8_5, + MF_TASK_SDCCH8_6, + MF_TASK_SDCCH8_7, + + MF_TASK_TCH_F_EVEN, + MF_TASK_TCH_F_ODD, + MF_TASK_TCH_H_0, + MF_TASK_TCH_H_1, + + MF_TASK_NEIGH_PM51_C0T0, + MF_TASK_NEIGH_PM51, + MF_TASK_NEIGH_PM26E, + MF_TASK_NEIGH_PM26O, + + /* Test task: send Normal Burst in all timeslots */ + MF_TASK_UL_ALL_NB, +}; + +enum mf_sched_item_flag { + MF_F_SACCH = (1 << 0), +}; + +/* The scheduler itself */ +struct mframe_scheduler { + uint32_t tasks; + uint32_t tasks_tgt; + uint32_t safe_fn; +}; + +uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t ts); + +/* Enable a specific task */ +void mframe_enable(enum mframe_task task_id); + +/* Disable a specific task */ +void mframe_disable(enum mframe_task task_id); + +/* Replace the current active set by the new one */ +void mframe_set(uint32_t tasks); + +/* Schedule mframe_sched_items according to current MF TASK list */ +void mframe_schedule(void); + +/* reset the scheduler, disabling all tasks */ +void mframe_reset(void); + +#endif /* _MFRAME_SCHED_H */ diff --git a/src/host/virt_phy/include/layer1/sync.h b/src/host/virt_phy/include/layer1/sync.h new file mode 100644 index 0000000..dae85a1 --- /dev/null +++ b/src/host/virt_phy/include/layer1/sync.h @@ -0,0 +1,204 @@ +#ifndef _L1_SYNC_H +#define _L1_SYNC_H + +#include +#include +#include +#include +#include + +/* structure representing L1 sync information about a cell */ +struct l1_cell_info { + /* on which ARFCN (+band) is the cell? */ + uint16_t arfcn; + /* what's the BSIC of the cell (from SCH burst decoding) */ + uint8_t bsic; + /* Combined or non-combined CCCH */ + uint8_t ccch_mode; /* enum ccch_mode */ + /* whats the delta of the cells current GSM frame number + * compared to our current local frame number */ + int32_t fn_offset; + /* how much does the TPU need adjustment (delta) to synchronize + * with the cells burst */ + uint32_t time_alignment; + /* FIXME: should we also store the AFC value? */ +}; + +enum l1s_chan { + L1S_CHAN_MAIN, + L1S_CHAN_SACCH, + L1S_CHAN_TRAFFIC, + _NUM_L1S_CHAN +}; + +enum l1_compl { + L1_COMPL_FB, + L1_COMPL_RACH, + L1_COMPL_TX_NB, + L1_COMPL_TX_TCH, +}; + +typedef void l1_compl_cb(enum l1_compl c); + +#define L1S_NUM_COMPL 32 +#define L1S_NUM_NEIGH_CELL 6 + +struct l1s_h0 { + uint16_t arfcn; +}; + +struct l1s_h1 { + uint8_t hsn; + uint8_t maio; + uint8_t n; + uint16_t ma[64]; +}; + +struct l1s_state { + struct gsm_time current_time; /* current GSM time */ + struct gsm_time next_time; /* GSM time at next TMDMA irq */ + + /* the cell on which we are camping right now */ + struct l1_cell_info serving_cell; + + /* neighbor cell sync info */ + struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; + + /* TDMA scheduler */ + struct tdma_scheduler tdma_sched; + + /* Multiframe scheduler */ + struct mframe_scheduler mframe_sched; + + /* The current TPU offset register */ + uint32_t tpu_offset; + int32_t tpu_offset_correction; + + /* TX parameters */ + int8_t ta; + uint8_t tx_power; + + /* TCH */ + uint8_t tch_mode; + uint8_t tch_sync; + uint8_t audio_mode; + + /* Transmit queues of pending packets for main DCCH and ACCH */ + struct llist_head tx_queue[_NUM_L1S_CHAN]; + struct msgb *tx_meas; + + /* Which L1A completions are scheduled right now */ + uint32_t scheduled_compl; + /* callbacks for each of the completions */ + l1_compl_cb *completion[L1S_NUM_COMPL]; + + /* Structures below are for L1-task specific parameters, used + * to communicate between l1-sync and l1-async (l23_api) */ + struct { + uint8_t mode; /* FB_MODE 0/1 */ + } fb; + + struct { + /* power measurement l1 task */ + unsigned int mode; + union { + struct { + uint16_t arfcn_start; + uint16_t arfcn_next; + uint16_t arfcn_end; + } range; + }; + struct msgb *msg; + } pm; + + struct { + uint8_t ra; + } rach; + + struct { + enum { + GSM_DCHAN_NONE = 0, + GSM_DCHAN_SDCCH_4, + GSM_DCHAN_SDCCH_8, + GSM_DCHAN_TCH_H, + GSM_DCHAN_TCH_F, + GSM_DCHAN_UNKNOWN, + } type; + + uint8_t scn; + uint8_t tsc; + uint8_t tn; + uint8_t h; + + union { + struct l1s_h0 h0; + struct l1s_h1 h1; + }; + + uint8_t st_tsc; + uint8_t st_tn; + uint8_t st_h; + + union { + struct l1s_h0 st_h0; + struct l1s_h1 st_h1; + }; + } dedicated; + + /* neighbour cell power measurement process */ + struct { + uint8_t n, second; + uint8_t pos; + uint8_t running; + uint16_t band_arfcn[64]; + uint8_t tn[64]; + uint8_t level[64]; + } neigh_pm; +}; + +extern struct l1s_state l1s; + +struct l1s_meas_hdr { + uint16_t snr; /* signal/noise ratio */ + int16_t toa_qbit; /* time of arrival (qbits) */ + int16_t pm_dbm8; /* power level in dbm/8 */ + int16_t freq_err; /* Frequency error in Hz */ +}; + +int16_t l1s_snr_int(uint16_t snr); +uint16_t l1s_snr_fract(uint16_t snr); + +void l1s_dsp_abort(void); + +void l1s_tx_apc_helper(uint16_t arfcn); + +/* schedule a completion */ +void l1s_compl_sched(enum l1_compl c); + +void l1s_init(void); + +/* reset the layer1 as part of synchronizing to a new cell */ +void l1s_reset(void); + +/* init.c */ +void layer1_init(void); + +/* A debug macro to print every TDMA frame */ +#ifdef DEBUG_EVERY_TDMA +#define putchart(x) putchar(x) +#else +#define putchart(x) +#endif + +/* Convert an angle in fx1.15 notatinon into Hz */ +#define BITFREQ_DIV_2PI 43104 /* 270kHz / 2 * pi */ +#define BITFREQ_DIV_PI 86208 /* 270kHz / pi */ +#define ANG2FREQ_SCALING (2<<15) /* 2^15 scaling factor for fx1.15 */ +#define ANGLE_TO_FREQ(angle) ((int16_t)angle * BITFREQ_DIV_PI / ANG2FREQ_SCALING) + +void l1s_reset_hw(void); +void synchronize_tdma(struct l1_cell_info *cinfo); +void l1s_time_inc(struct gsm_time *time, uint32_t delta_fn); +void l1s_time_dump(const struct gsm_time *time); + +#endif /* _L1_SYNC_H */ diff --git a/src/host/virt_phy/include/layer1/tdma_sched.h b/src/host/virt_phy/include/layer1/tdma_sched.h new file mode 100644 index 0000000..f58d59b --- /dev/null +++ b/src/host/virt_phy/include/layer1/tdma_sched.h @@ -0,0 +1,73 @@ +#ifndef _L1_TDMA_SCHED_H +#define _L1_TDMA_SCHED_H + +#include + +/* TDMA scheduler */ + +/* The idea of this scheduler is that we have a circular buffer of buckets, + * where each bucket corresponds to one future TDMA frame [interrupt]. Each + * bucket contains of a list of callbacks which are executed when the bucket + * index reaches that particular bucket. */ + +#define TDMASCHED_NUM_FRAMES 25 +#define TDMASCHED_NUM_CB 8 + +#define TDMA_IFLG_TPU (1<<0) +#define TDMA_IFLG_DSP (1<<1) + +typedef int tdma_sched_cb(uint8_t p1, uint8_t p2, uint16_t p3); + +/* A single item in a TDMA scheduler bucket */ +struct tdma_sched_item { + tdma_sched_cb *cb; + uint8_t p1; + uint8_t p2; + uint16_t p3; + int16_t prio; + uint16_t flags; /* TDMA_IFLG_xxx */ +}; + +/* A bucket inside the TDMA scheduler */ +struct tdma_sched_bucket { + struct tdma_sched_item item[TDMASCHED_NUM_CB]; + uint8_t num_items; +}; + +/* The scheduler itself, consisting of buckets and a current index */ +struct tdma_scheduler { + struct tdma_sched_bucket bucket[TDMASCHED_NUM_FRAMES]; + uint8_t cur_bucket; +}; + +/* Schedule an item at 'frame_offset' TDMA frames in the future */ +int tdma_schedule(uint8_t frame_offset, tdma_sched_cb *cb, + uint8_t p1, uint8_t p2, uint16_t p3, int16_t prio); + +/* Schedule a set of items starting from 'frame_offset' TDMA frames in the future */ +int tdma_schedule_set(uint8_t frame_offset, const struct tdma_sched_item *item_set, uint16_t p3); + +/* Scan current frame scheduled items for flags */ +uint16_t tdma_sched_flag_scan(void); + +/* Execute pre-scheduled events for current frame */ +int tdma_sched_execute(void); + +/* Advance TDMA scheduler to the next bucket */ +void tdma_sched_advance(void); + +/* reset the scheduler; erase all scheduled items */ +void tdma_sched_reset(void); + +/* debug function: print number of entries of all TDMA buckets */ +void tdma_sched_dump(void); + + +extern int tdma_end_set(uint8_t p1, uint8_t p2, uint16_t p3); +#define SCHED_ITEM(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, .flags = 0 } +#define SCHED_ITEM_DT(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, \ + .flags = TDMA_IFLG_TPU | TDMA_IFLG_DSP } +#define SCHED_END_FRAME() { .cb = NULL, .p1 = 0, .p2 = 0 } +#define SCHED_END_SET() { .cb = &tdma_end_set, .p1 = 0, .p2 = 0 } + +#endif /* _L1_TDMA_SCHED_H */ diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am new file mode 100644 index 0000000..a110435 --- /dev/null +++ b/src/host/virt_phy/src/Makefile.am @@ -0,0 +1,19 @@ +OSMOCOM_DIR = /home/basti/Osmocom +OSMO_BB_DIR = $(OSMOCOM_DIR)/osmocom-bb +OSMO_BTS_DIR = $(OSMOCOM_DIR)/osmo-bts +OPENBSC_DIR = $(OSMOCOM_DIR)/openbsc + +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OSMO_BB_DIR)/include -I$(OSMO_BTS_DIR)/include -I$(OPENBSC_DIR)/openbsc/include -I$(OSMO_BB_DIR)/src/host/layer23/include +# TODO: somehow this include path causes errors, thus the needed files are copied into $(top_srcdir)/include. Would be better to include directly from $(OSMO_BB_DIR)/src/target/firmware/include to avoid redundancy. +# -I$(OSMO_BB_DIR)/src/target/firmware/include + +CFLAGS = -g -O0 + +sbin_PROGRAMS = virtphy +virtphy_SOURCES = virtphy.c l1ctl_sock.c l1ctl_sap.c gsmtapl1_if.c logging.c virt_l1_model.c virtual_um.c osmo_mcast_sock.c +virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +# debug output +all: + $(info $$AM_CPPFLAGS is [${AM_CPPFLAGS}]) diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c new file mode 100644 index 0000000..11214cf --- /dev/null +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -0,0 +1,282 @@ +/* GSMTAP layer1 is transmits gsmtap messages over a virtual layer 1.*/ + +/* (C) 2016 Sebastian Stumpf + * + * 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 "virtual_um.h" +#include "l1ctl_sock.h" +#include "virt_l1_model.h" +#include "l1ctl_sap.h" +#include "gsmtapl1_if.h" +#include "logging.h" + +static struct l1_model_ms *l1_model_ms = NULL; + +// for debugging +static const struct value_string gsmtap_channels [22] = { + { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, + { GSMTAP_CHANNEL_BCCH, "BCCH" }, + { GSMTAP_CHANNEL_CCCH, "CCCH" }, + { GSMTAP_CHANNEL_RACH, "RACH" }, + { GSMTAP_CHANNEL_AGCH, "AGCH" }, + { GSMTAP_CHANNEL_PCH, "PCH" }, + { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, + { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, + { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, + { GSMTAP_CHANNEL_TCH_F, "FACCH/F" }, + { GSMTAP_CHANNEL_TCH_H, "FACCH/H" }, + { GSMTAP_CHANNEL_PACCH, "PACCH" }, + { GSMTAP_CHANNEL_CBCH52, "CBCH" }, + { GSMTAP_CHANNEL_PDCH, "PDCH" }, + { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, + { GSMTAP_CHANNEL_CBCH51, "CBCH" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_SDCCH, "LSACCH" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, + { 0, NULL }, +}; +// for debugging +static const struct value_string gsmtap_types [10] = { + { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, + { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, + { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, + { GSMTAP_TYPE_SIM, "SIM" }, + { GSMTAP_TYPE_TETRA_I1, "TETRA V+D"}, + { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, + { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)" }, + { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, + { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, + { 0, NULL }, +}; + +void gsmtapl1_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} + +/** + * Append a gsmtap header to msg and send it over the virt um. + */ +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg) +{ + struct l1ctl_hdr *l1hdr = (struct l1ctl_hdr *)msg->l1h; + struct l1ctl_info_dl *l1dl = (struct l1ctl_info_dl *)msg->data; + uint8_t ss = 0; + uint8_t gsmtap_chan; + struct msgb *outmsg; + + switch (l1hdr->msg_type) { + case L1CTL_DATA_REQ: + // TODO: check what data request and set gsmtap_chan depending on that + gsmtap_chan = 0; + break; + } + outmsg = gsmtap_makemsg(l1dl->band_arfcn, l1dl->chan_nr, gsmtap_chan, + ss, l1dl->frame_nr, 0, 0, msgb_l2(msg), + msgb_l2len(msg)); + if (outmsg) { + struct gsmtap_hdr *gh = (struct gsmtap_hdr *)outmsg->l1h; + virt_um_write_msg(vui, outmsg); + DEBUGP(DVIRPHY, + "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, gh->timeslot, + gh->sub_slot); + } else { + LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); + } + + /* free message */ + msgb_free(msg); +} + +/** + * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, struct msgb *msg). + */ +void gsmtapl1_tx_to_virt_um(struct msgb *msg) +{ + gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, msg); +} + +/* This is the header as it is used by gsmtap peer virtual layer 1. +struct gsmtap_hdr { + guint8 version; // version, set to 0x01 currently + guint8 hdr_len; // length in number of 32bit words + guint8 type; // see GSMTAP_TYPE_* + guint8 timeslot; // timeslot (0..7 on Um) + guint16 arfcn; // ARFCN (frequency) + gint8 signal_dbm; // signal level in dBm + gint8 snr_db; // signal/noise ratio in dB + guint32 frame_number; // GSM Frame Number (FN) + guint8 sub_type; // Type of burst/channel, see above + guint8 antenna_nr; // Antenna Number + guint8 sub_slot; // sub-slot within timeslot + guint8 res; // reserved for future use (RFU) +} + */ + +/** + * Receive a gsmtap message from the virt um. + */ +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, + struct msgb *msg) +{ + if (msg) { + struct gsmtap_hdr *gh; + struct l1ctl_info_dl *l1dl; + struct msgb *l1ctl_msg = NULL; + struct l1ctl_data_ind * l1di; + + msg->l1h = msgb_data(msg); + msg->l2h = msgb_pull(msg, sizeof(*gh)); + gh = msgb_l1(msg); + + DEBUGP(DVIRPHY, + "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u)\n", + ntohs(gh->arfcn), ntohl(gh->frame_number), get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gh->sub_type), gh->timeslot, + gh->sub_slot); + + // compose the l1ctl message for layer 2 + switch (gh->sub_type) { + case GSMTAP_CHANNEL_RACH: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + break; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + // TODO: implement channel handling + break; + case GSMTAP_CHANNEL_TCH_F: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); + // TODO: implement channel handling + break; + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); + l1di = (struct l1ctl_data_ind *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_data_ind)); + + l1dl->band_arfcn = htons(ntohs(gh->arfcn)); + l1dl->link_id = gh->timeslot; + // see GSM 8.58 -> 9.3.1 for channel number encoding + l1dl->chan_nr = rsl_enc_chan_nr(chantype_gsmtap2rsl(gh->sub_type), gh->sub_slot, gh->timeslot); + l1dl->frame_nr = htonl(ntohl(gh->frame_number)); + l1dl->snr = gh->snr_db; + l1dl->rx_level = gh->signal_dbm; + l1dl->num_biterr = 0; + l1dl->fire_crc = 0; + + memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); + + break; + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_TCH_H: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + break; + default: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + break; + } + + /* forward l1ctl message to l2 */ + if(l1ctl_msg) { + l1ctl_sap_tx_to_l23(l1ctl_msg); + } + + // handle memory deallocation + talloc_free(msg); + } +} + +/** + * @see void gsmtapl1_rx_from_virt_um_cb(struct virt_um_inst *vui, struct msgb msg). + */ +void gsmtapl1_rx_from_virt_um(struct msgb *msg) +{ + gsmtapl1_rx_from_virt_um_inst_cb(l1_model_ms->vui, msg); +} + +/*! \brief convert GSMTAP channel type to RSL channel number + * \param[in] rsl_chantype RSL channel type + * \param[in] link_id RSL link identifier + * \returns GSMTAP channel type + */ +uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype) +{ + // TODO: proper retval for unknown channel + uint8_t ret = 0; + + switch (gsmtap_chantype) { + case GSMTAP_CHANNEL_TCH_F: + ret = RSL_CHAN_Bm_ACCHs; + break; + case GSMTAP_CHANNEL_TCH_H: + ret = RSL_CHAN_Lm_ACCHs; + break; + case GSMTAP_CHANNEL_SDCCH4: + ret = RSL_CHAN_SDCCH4_ACCH; + break; + case GSMTAP_CHANNEL_SDCCH8: + ret = RSL_CHAN_SDCCH8_ACCH; + break; + case GSMTAP_CHANNEL_BCCH: + ret = RSL_CHAN_BCCH; + break; + case GSMTAP_CHANNEL_RACH: + ret = RSL_CHAN_RACH; + break; + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_AGCH: + ret = RSL_CHAN_PCH_AGCH; + break; + } + + // TODO: check how to handle this... +// if (link_id & 0x40) +// ret |= GSMTAP_CHANNEL_ACCH; + + return ret; +} diff --git a/src/host/virt_phy/src/gsmtapl1_if.h b/src/host/virt_phy/src/gsmtapl1_if.h new file mode 100644 index 0000000..8c7491c --- /dev/null +++ b/src/host/virt_phy/src/gsmtapl1_if.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +#include "l1ctl_sock.h" +#include "virtual_um.h" +#include "virt_l1_model.h" + +void gsmtapl1_init(struct l1_model_ms *model); + +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_rx_from_virt_um(struct msgb *msg); + +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_tx_to_virt_um(struct msgb *msg); + +uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c new file mode 100644 index 0000000..46121ed --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -0,0 +1,833 @@ +/* L1CTL SAP implementation. */ + +#include +#include +#include +#include +#include +#include + +#include "virtual_um.h" +#include "l1ctl_sock.h" +#include "virt_l1_model.h" +#include "l1ctl_sap.h" +#include "logging.h" + +static struct l1_model_ms *l1_model_ms = NULL; + +/** + * @brief Init the SAP. + */ +void l1ctl_sap_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} + +/** + * @brief L1CTL handler called for received messages from L23. + * + * Enqueues the message into the rx queue. + */ +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) +{ + if (msg) { + DEBUGP(DL1C, "Message incoming from layer 2: %s\n", + osmo_hexdump(msg->data, msg->len)); + l1ctl_sap_handler(msg); + } +} +/** + * @see l1ctl_sap_rx_from_l23_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg). + */ +void l1ctl_sap_rx_from_l23(struct msgb *msg) +{ + l1ctl_sap_rx_from_l23_inst_cb(l1_model_ms->lsi, msg); +} + +/** + * @brief Send a l1ctl message to layer 23. + * + * This will forward the message as it is to the upper layer. + */ +void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg) +{ + uint16_t *len; + /* prepend 16bit length before sending */ + len = (uint16_t *) msgb_push(msg, sizeof(*len)); + *len = htons(msg->len - sizeof(*len)); + + if(l1ctl_sock_write_msg(lsi, msg) == -1 ) { + //DEBUGP(DL1C, "Error writing to layer2 socket"); + } +} + +/** + * @see void l1ctl_sap_tx_to_l23(struct l1ctl_sock_inst *lsi, struct msgb *msg). + */ +void l1ctl_sap_tx_to_l23(struct msgb *msg) +{ + l1ctl_sap_tx_to_l23_inst(l1_model_ms->lsi, msg); +} + +/** + * @brief Allocates a msgb with set l1ctl header and room for a l3 header. + * + * @param [in] msg_type L1CTL primitive message type set to l1ctl_hdr. + * @return the allocated message. + * + * The message looks as follows: + * # headers + * [l1ctl_hdr] : initialized. msgb->l1h points here + * [spare-bytes] : L3_MSG_HEAD bytes reserved for l3 header + * # data + * [spare-bytes] : L3_MSG_DATA bytes reserved for data. msgb->tail points here. msgb->data points here. + */ +struct msgb *l1ctl_msgb_alloc(uint8_t msg_type) +{ + struct msgb *msg; + struct l1ctl_hdr *l1h; + msg = msgb_alloc_headroom(L3_MSG_SIZE, L3_MSG_HEAD, "l1ctl"); + if (!msg) { + while (1) { + puts("OOPS. Out of buffers...\n"); + } + + return NULL; + } + l1h = (struct l1ctl_hdr *)msgb_put(msg, sizeof(*l1h)); + l1h->msg_type = msg_type; + l1h->flags = 0; + + msg->l1h = (uint8_t *)l1h; + + return msg; +} + +/** + * @brief Allocates a msgb with set l1ctl header and room for a l3 header and puts l1ctl_info_dl to the msgb data. + * + * @param [in] msg_type L1CTL primitive message type set to l1ctl_hdr. + * @param [in] fn framenumber put into l1ctl_info_dl. + * @param [in] snr time slot number put into l1ctl_info_dl. + * @param [in] arfcn arfcn put into l1ctl_info_dl. + * @return the allocated message. + * + * The message looks as follows: + * # headers + * [l1ctl_hdr] : initialized. msgb->l1h points here + * [spare-bytes] : L3_MSG_HEAD bytes reserved for l3 header + * # data + * [l1ctl_info_dl] : initialized with params. msgb->data points here. + * [spare-bytes] : L3_MSG_DATA bytes reserved for data. msgb->tail points here. + */ +struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, + uint16_t arfcn) +{ + struct l1ctl_info_dl *dl; + struct msgb *msg = l1ctl_msgb_alloc(msg_type); + + dl = (struct l1ctl_info_dl *)msgb_put(msg, sizeof(*dl)); + dl->frame_nr = htonl(fn); + dl->snr = snr; + dl->band_arfcn = htons(arfcn); + + return msg; +} + +/** + * @brief General handler for incoming L1CTL messages from layer 2/3. + * + * This handler will dequeue the rx queue (if !empty) and call the specific routine for the dequeued l1ctl message. + * + */ +void l1ctl_sap_handler(struct msgb *msg) +{ +// struct msgb *msg; + struct l1ctl_hdr *l1h; + unsigned long flags; + + if (!msg) + return; + + l1h = (struct l1ctl_hdr *)msg->data; + + if (sizeof(*l1h) > msg->len) { + LOGP(DL1C, LOGL_NOTICE, "Short message. %u\n", msg->len); + goto exit_msgbfree; + } + + switch (l1h->msg_type) { + case L1CTL_FBSB_REQ: + l1ctl_rx_fbsb_req(msg); + break; + case L1CTL_DM_EST_REQ: + l1ctl_rx_dm_est_req(msg); + break; + case L1CTL_DM_REL_REQ: + l1ctl_rx_dm_rel_req(msg); + break; + case L1CTL_PARAM_REQ: + l1ctl_rx_param_req(msg); + break; + case L1CTL_DM_FREQ_REQ: + l1ctl_rx_dm_freq_req(msg); + break; + case L1CTL_CRYPTO_REQ: + l1ctl_rx_crypto_req(msg); + break; + case L1CTL_RACH_REQ: + l1ctl_rx_rach_req(msg); + break; + case L1CTL_DATA_REQ: + l1ctl_rx_data_req(msg); + /* we have to keep the msgb, not free it! */ + goto exit_nofree; + case L1CTL_PM_REQ: + l1ctl_rx_pm_req(msg); + break; + case L1CTL_RESET_REQ: + l1ctl_rx_reset_req(msg); + break; + case L1CTL_CCCH_MODE_REQ: + l1ctl_rx_ccch_mode_req(msg); + break; + case L1CTL_TCH_MODE_REQ: + l1ctl_rx_tch_mode_req(msg); + break; + case L1CTL_NEIGH_PM_REQ: + l1ctl_rx_neigh_pm_req(msg); + break; + case L1CTL_TRAFFIC_REQ: + l1ctl_rx_traffic_req(msg); + /* we have to keep the msgb, not free it! */ + goto exit_nofree; + case L1CTL_SIM_REQ: + l1ctl_rx_sim_req(msg); + break; + } + + exit_msgbfree: msgb_free(msg); + exit_nofree: return; +} + +/*************************************************************** + * L1CTL RX ROUTINES ******************************************* + ***************************************************************/ + +/** + * @brief Handler for received L1CTL_FBSB_REQ from L23. + * + * -- frequency burst synchronisation burst request -- + * + * @param [in] msg the received message. + * + * Transmit frequency control and synchronisation bursts on FCCH and SCH to calibrate transceiver and search for base stations. + * Sync to a given arfcn. + * + * Note: Not needed for virtual physical layer. + * TODO: Could be used to bind/connect to different virtual_bts sockets with a arfcn-socket mapping. + */ +void l1ctl_rx_fbsb_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + ntohs(sync_req->band_arfcn), sync_req->flags); + + l1ctl_tx_fbsb_conf(0, ntohs(sync_req->band_arfcn)); +} + +/** + * @brief Handler for received L1CTL_DM_EST_REQ from L23. + * + * -- dedicated mode established request -- + * + * @param [in] msg the received message. + * + * Handle state change from idle to dedicated mode. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_dm_est_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_dm_est_req *est_req = + (struct l1ctl_dm_est_req *)ul->payload; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_DM_EST_REQ (arfcn=%u, chan_nr=0x%02x, tsc=%u)\n", + ntohs(est_req->h0.band_arfcn), ul->chan_nr, + est_req->tsc); + +// /* disable neighbour cell measurement of C0 TS 0 */ +// mframe_disable(MF_TASK_NEIGH_PM51_C0T0); +// +// /* configure dedicated channel state */ +// l1s.dedicated.type = chan_nr2dchan_type(ul->chan_nr); +// l1s.dedicated.tsc = est_req->tsc; +// l1s.dedicated.tn = ul->chan_nr & 0x7; +// l1s.dedicated.h = est_req->h; +// +// if (est_req->h) { +// int i; +// l1s.dedicated.h1.hsn = est_req->h1.hsn; +// l1s.dedicated.h1.maio = est_req->h1.maio; +// l1s.dedicated.h1.n = est_req->h1.n; +// for (i=0; ih1.n; i++) +// l1s.dedicated.h1.ma[i] = ntohs(est_req->h1.ma[i]); +// } else { +// l1s.dedicated.h0.arfcn = ntohs(est_req->h0.band_arfcn); +// } +// +// /* TCH config */ +// if (chan_nr_is_tch(ul->chan_nr)) { +// /* Mode */ +// l1a_tch_mode_set(est_req->tch_mode); +// l1a_audio_mode_set(est_req->audio_mode); +// +// /* Sync */ +// l1s.tch_sync = 1; /* can be set without locking */ +// +// /* Audio path */ +// audio_set_enabled(est_req->tch_mode, est_req->audio_mode); +// } +// +// /* figure out which MF tasks to enable */ +// l1a_mftask_set(chan_nr2mf_task_mask(ul->chan_nr, NEIGH_MODE_PM)); +} + +/** + * @brief Handler for received L1CTL_DM_FREQ_REQ from L23. + * + * -- dedicated mode frequency request -- + * + * @param [in] msg the received message. + * + * Handle frequency change in dedicated mode. E.g. used for frequency hopping. + * + * Note: Not needed for virtual physical layer. + */ +void l1ctl_rx_dm_freq_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_dm_freq_req *freq_req = + (struct l1ctl_dm_freq_req *)ul->payload; + + DEBUGP(DL1C, + "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn=%u, tsc=%u)\n", + ntohs(freq_req->h0.band_arfcn), freq_req->tsc); +} + +/** + * @brief Handler for received L1CTL_CRYPTO_REQ from L23. + * + * -- cryptographic request -- + * + * @param [in] msg the received message. + * + * Configure the key and algorithm used for cryptographic operations in the DSP (Digital Signal Processor). + * + * Note: in the virtual physical layer the cryptographic operations are not handled in the DSP. + * + * TODO: Implement cryptographic operations for virtual um! + * TODO: Implement this handler routine! + */ +void l1ctl_rx_crypto_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *)ul->payload; + uint8_t key_len = msg->len - sizeof(*l1h) - sizeof(*ul) - sizeof(*cr); + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", + cr->algo, key_len); + +// if (cr->algo && key_len != 8) { +// DEBUGP(DL1C, "L1CTL_CRYPTO_REQ -> Invalid key\n"); +// return; +// } +// +// dsp_load_ciph_param(cr->algo, cr->key); +} + +/** + * @brief Handler for received L1CTL_DM_REL_REQ from L23. + * + * -- dedicated mode release request -- + * + * @param [in] msg the received message. + * + * Handle state change from dedicated to idle mode. Flush message buffers of dedicated channel. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_dm_rel_req(struct msgb *msg) +{ +// struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + + DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_DM_REL_REQ\n"); +// l1a_mftask_set(0); +// l1s.dedicated.type = GSM_DCHAN_NONE; +// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_MAIN]); +// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_SACCH]); +// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); +// l1a_meas_msgb_set(NULL); +// dsp_load_ciph_param(0, NULL); +// l1a_tch_mode_set(GSM48_CMODE_SIGN); +// audio_set_enabled(GSM48_CMODE_SIGN, 0); +// l1s.neigh_pm.n = 0; +} + +/** + * @brief Handler for received L1CTL_PARAM_REQ from L23. + * + * -- parameter request -- + * + * @param [in] msg the received message. + * + * Configure transceiver parameters timing advance value and sending power. + * + * Note: Not needed for virtual physical layer. + */ +void l1ctl_rx_param_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_par_req *par_req = (struct l1ctl_par_req *)ul->payload; + + DEBUGP(DL1C, + "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", + par_req->ta, par_req->tx_power); +} + +/** + * @brief Handler for received L1CTL_RACH_REQ from L23. + * + * -- random access channel request -- + * + * @param [in] msg the received message. + * + * Transmit RACH request on RACH. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_rach_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + rach_req->ra, ntohs(rach_req->offset), + rach_req->combined); + +// l1a_rach_req(ntohs(rach_req->offset), rach_req->combined, +// rach_req->ra); +} + +/** + * @brief Handler for received L1CTL_DATA_REQ from L23. + * + * -- data request -- + * + * @param [in] msg the received message. + * + * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_data_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; + struct llist_head *tx_queue; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x)\n", + ul->link_id); + +// msg->l3h = data_ind->data; +// if (ul->link_id & 0x40) { +// struct gsm48_hdr *gh = (struct gsm48_hdr *)(data_ind->data + 5); +// if (gh->proto_discr == GSM48_PDISC_RR +// && gh->msg_type == GSM48_MT_RR_MEAS_REP) { +// DEBUGP(DL1C, "updating measurement report\n"); +// l1a_meas_msgb_set(msg); +// return; +// } +// tx_queue = &l1s.tx_queue[L1S_CHAN_SACCH]; +// } else +// tx_queue = &l1s.tx_queue[L1S_CHAN_MAIN]; +// +// DEBUGP(DL1C, "ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p\n", +// ul, ul->payload, data_ind, data_ind->data, msg->l3h); +// +// l1a_txq_msgb_enq(tx_queue, msg); +} + +/** + * @brief Handler for received L1CTL_PM_REQ from L23. + * + * -- power measurement request -- + * + * @param [in] msg the received message. + * + * Process power measurement for a given range of arfcns to calculate signal power and connection quality. + * + * Note: We do not need to calculate that for the virtual physical layer, but l23 apps can expect a response. So this response is mocked here. + */ +void l1ctl_rx_pm_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *)l1h->data; + struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + uint16_t arfcn_next; + // convert to host order + pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); + pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); + + DEBUGP(DL1C, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); + + for(arfcn_next = pm_req->range.band_arfcn_from; arfcn_next <= pm_req->range.band_arfcn_to; ++arfcn_next) { + struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *)msgb_put(resp_msg, sizeof(*pm_conf)); + pm_conf->band_arfcn = htons(arfcn_next); + // rxlev 63 is great, 0 is bad the two values are probably min and max + pm_conf->pm[0] = 63; + pm_conf->pm[1] = 63; + if(arfcn_next == pm_req->range.band_arfcn_to) { + struct l1ctl_hdr *resp_l1h = resp_msg->l1h; + resp_l1h->flags |= L1CTL_F_DONE; + } + // no more space in msgb, flush to l2 + if(msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { + l1ctl_sap_tx_to_l23(resp_msg); + resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + } + } + if(resp_msg) { + l1ctl_sap_tx_to_l23(resp_msg); + } +} + +/** + * @brief Handler for received L1CTL_RESET_REQ from L23. + * + * -- reset request -- + * + * @param [in] msg the received message. + * + * Reset layer 1 (state machine, scheduler, transceiver) depending on the reset type. + * + */ +void l1ctl_rx_reset_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_reset *reset_req = (struct l1ctl_reset *)l1h->data; + + switch (reset_req->type) { + case L1CTL_RES_T_FULL: + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); +// l1s_reset(); +// l1s_reset_hw(); +// audio_set_enabled(GSM48_CMODE_SIGN, 0); + l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + break; + case L1CTL_RES_T_SCHED: + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); +// sched_gsmtime_reset(); + l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + break; + default: + LOGP(DL1C, LOGL_ERROR, + "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + break; + } +} + +/** + * @brief Handler for received L1CTL_CCCH_MODE_REQ from L23. + * + * -- common control channel mode request -- + * + * @param [in] msg the received message. + * + * Configure CCCH combined / non-combined mode. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_ccch_mode_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_ccch_mode_req *ccch_mode_req = + (struct l1ctl_ccch_mode_req *)l1h->data; + uint8_t ccch_mode = ccch_mode_req->ccch_mode; + + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); + + l1_model_ms->state->serving_cell.ccch_mode = ccch_mode; + + // check if more has to be done here + + l1ctl_tx_ccch_mode_conf(ccch_mode); + +// /* pre-set the CCCH mode */ +// l1s.serving_cell.ccch_mode = ccch_mode; +// +// /* Update task */ +// mframe_disable(MF_TASK_CCCH_COMB); +// mframe_disable(MF_TASK_CCCH); +// +// if (ccch_mode == CCCH_MODE_COMBINED) +// mframe_enable(MF_TASK_CCCH_COMB); +// else if (ccch_mode == CCCH_MODE_NON_COMBINED) +// mframe_enable(MF_TASK_CCCH); +// +// l1ctl_tx_ccch_mode_conf(ccch_mode); +} + +/** + * @brief Handler for received L1CTL_TCH_MODE_REQ from L23. + * + * -- traffic channel mode request -- + * + * @param [in] msg the received message. + * + * Configure TCH mode and audio mode. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_tch_mode_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_tch_mode_req *tch_mode_req = + (struct l1ctl_tch_mode_req *)l1h->data; + uint8_t tch_mode = tch_mode_req->tch_mode; + uint8_t audio_mode = tch_mode_req->audio_mode; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", + tch_mode, audio_mode); +// tch_mode = l1a_tch_mode_set(tch_mode); +// audio_mode = l1a_audio_mode_set(audio_mode); +// +// audio_set_enabled(tch_mode, audio_mode); +// +// l1s.tch_sync = 1; /* Needed for audio to work */ +// +// l1ctl_tx_tch_mode_conf(tch_mode, audio_mode); +} + +/** + * @brief Handler for received L1CTL_NEIGH_PM_REQ from L23. + * + * -- neighbor power measurement request -- + * + * @param [in] msg the received message. + * + * Update the maintained list of neighbor cells used in neighbor cell power measurement. + * The neighbor cell description is one of the info messages sent by the BTS on BCCH. + * This method will also enable neighbor measurement in the multiframe scheduler. + * + * Note: Not needed for virtual physical layer. + */ +void l1ctl_rx_neigh_pm_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_neigh_pm_req *pm_req = + (struct l1ctl_neigh_pm_req *)l1h->data; + + DEBUGP(DL1C, + "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", + pm_req->n); +} + +/** + * @brief Handler for received L1CTL_TRAFFIC_REQ from L23. + * + * -- traffic request -- + * + * @param [in] msg the received message. + * + * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. + * Will drop the traffic frame at queue sizes >= 4. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_traffic_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; + int num = 0; + + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + +// msg->l2h = tr->data; + +// num = l1a_txq_msgb_count(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); +// if (num >= 4) { +// DEBUGP(DL1C, "dropping traffic frame\n"); +// msgb_free(msg); +// return; +// } +// +// l1a_txq_msgb_enq(&l1s.tx_queue[L1S_CHAN_TRAFFIC], msg); +} + +/** + * @brief Handler for received L1CTL_SIM_REQ from L23. + * + * -- sim request -- + * + * @param [in] msg the received message. + * + * Forward and a sim request to the SIM APDU. + * + * Note: Not needed for virtual layer. Please configure layer23 application to use test-sim implementation. + * ms + * -------- + * sim test + * test-sim + * imsi + * ki comp128 + * -------- + */ +void l1ctl_rx_sim_req(struct msgb *msg) +{ + uint16_t len = msg->len - sizeof(struct l1ctl_hdr); + uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); + + DEBUGP(DL1C, + "Received and ignored from l23 - SIM Request length: %u, data: %s: ", + len, osmo_hexdump(data, sizeof(data))); + +} + +/*************************************************************** + * L1CTL TX ROUTINES ******************************************* + ***************************************************************/ + +/** + * @brief Transmit L1CTL_RESET_IND or L1CTL_RESET_CONF to layer 23. + * + * -- reset indication / confirm -- + * + * @param [in] msg_type L1CTL primitive message type. + * @param [in] reset_type reset type (full, boot or just scheduler reset). + */ +void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type) +{ + struct msgb *msg = l1ctl_msgb_alloc(msg_type); + struct l1ctl_reset *reset_resp; + reset_resp = (struct l1ctl_reset *)msgb_put(msg, sizeof(*reset_resp)); + reset_resp->type = reset_type; + + DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", + getL1ctlPrimName(msg_type), reset_type); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL msg of a given type to layer 23. + * + * @param [in] msg_type L1CTL primitive message type. + */ +void l1ctl_tx_msg(uint8_t msg_type) +{ + struct msgb *msg = l1ctl_msgb_alloc(msg_type); + DEBUGP(DL1C, "Sending to l23 - %s\n", getL1ctlPrimName(msg_type)); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL_FBSB_CONF to l23. + * + * -- frequency burst synchronisation burst confirm -- + * + * @param [in] res 0 -> success, 255 -> error. + * @param [in] arfcn the arfcn we are synced to. + * + * No calculation needed for virtual pyh -> uses default values for a good link quality. + */ +void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) +{ + struct msgb *msg; + struct l1ctl_fbsb_conf *resp; + uint32_t fn = 0; // 0 should be okay here + uint16_t snr = 40; // signal noise ratio > 40db is best signal. + int16_t initial_freq_err = 0; // 0 means no error. + uint8_t bsic = 0; + + msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, + snr, + arfcn); + + resp = (struct l1ctl_fbsb_conf *) msgb_put(msg, sizeof(*resp)); + resp->initial_freq_err = htons(initial_freq_err); + resp->result = res; + resp->bsic = bsic; + + DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", + getL1ctlPrimName(L1CTL_FBSB_CONF), res); + + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL_CCCH_MODE_CONF to layer 23. + * + * -- common control channel mode confirm -- + * + * @param [in] ccch_mode the new configured ccch mode. Combined or non-combined, see l1ctl_proto. + * + * Called by layer 1 to inform layer 2 that the ccch mode was successfully changed. + */ +void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode) +{ + struct msgb *msg = l1ctl_msgb_alloc(L1CTL_CCCH_MODE_CONF); + struct l1ctl_ccch_mode_conf *mode_conf; + mode_conf = (struct l1ctl_ccch_mode_conf *)msgb_put(msg, + sizeof(*mode_conf)); + mode_conf->ccch_mode = ccch_mode; + + DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", + ccch_mode); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL_TCH_MODE_CONF to layer 23. + * + * -- traffic channel mode confirm -- + * + * @param [in] tch_mode the new configured traffic channel mode, see gsm48_chan_mode in gsm_04_08.h. + * @param [in] audio_mode the new configured audio mode(s), see l1ctl_tch_mode_req in l1ctl_proto.h. + * + * Called by layer 1 to inform layer 23 that the traffic channel mode was successfully changed. + */ +void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode) +{ + struct msgb *msg = l1ctl_msgb_alloc(L1CTL_TCH_MODE_CONF); + struct l1ctl_tch_mode_conf *mode_conf; + mode_conf = (struct l1ctl_tch_mode_conf *)msgb_put(msg, + sizeof(*mode_conf)); + mode_conf->tch_mode = tch_mode; + mode_conf->audio_mode = audio_mode; + + DEBUGP(DL1C, + "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, + audio_mode); + l1ctl_sap_tx_to_l23(msg); +} + + diff --git a/src/host/virt_phy/src/l1ctl_sap.h b/src/host/virt_phy/src/l1ctl_sap.h new file mode 100644 index 0000000..2d67128 --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sap.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include + +#include "l1ctl_sock.h" +#include "virtual_um.h" +#include "virt_l1_model.h" + +/* following sizes are used for message allocation */ +/* size of layer 3 header */ +#define L3_MSG_HEAD 4 +/* size of layer 3 payload */ +#define L3_MSG_DATA 200 +#define L3_MSG_SIZE (sizeof(struct l1ctl_hdr) + L3_MSG_HEAD + L3_MSG_DATA) + +void l1ctl_sap_init(struct l1_model_ms *model); +void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); +void l1ctl_sap_tx_to_l23(struct msgb *msg); +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg); +void l1ctl_sap_rx_from_l23(struct msgb *msg); +void l1ctl_sap_handler(struct msgb *msg); + +/* utility methods */ +struct msgb *l1ctl_msgb_alloc(uint8_t msg_type); +struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, + uint16_t arfcn); + +/* receive routines */ +void l1ctl_rx_fbsb_req(struct msgb *msg); +void l1ctl_rx_dm_est_req(struct msgb *msg); +void l1ctl_rx_dm_rel_req(struct msgb *msg); +void l1ctl_rx_param_req(struct msgb *msg); +void l1ctl_rx_dm_freq_req(struct msgb *msg); +void l1ctl_rx_crypto_req(struct msgb *msg); +void l1ctl_rx_rach_req(struct msgb *msg); +void l1ctl_rx_data_req(struct msgb *msg); +void l1ctl_rx_pm_req(struct msgb *msg); +void l1ctl_rx_reset_req(struct msgb *msg); +void l1ctl_rx_ccch_mode_req(struct msgb *msg); +void l1ctl_rx_tch_mode_req(struct msgb *msg); +void l1ctl_rx_neigh_pm_req(struct msgb *msg); +void l1ctl_rx_traffic_req(struct msgb *msg); +void l1ctl_rx_sim_req(struct msgb *msg); + +/* transmit routines */ +void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type); +void l1ctl_tx_pm_conf(struct l1ctl_pm_req *pm_req); +void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn); +void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); +void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode); +void l1ctl_tx_msg(uint8_t msg_type); diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c new file mode 100644 index 0000000..e52b731 --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -0,0 +1,197 @@ +/* Socket based Layer1 <-> Layer23 communication over L1CTL primitives. */ + +/* (C) 2016 Sebastian Stumpf + * + * 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 + +#include + +#include "l1ctl_sock.h" +#include "virtual_um.h" +#include "logging.h" + +#define L1CTL_SOCK_MSGB_SIZE 256 + +/** + * @brief L1CTL socket file descriptor callback function. + * + * @param ofd The osmocom file descriptor. + * @param what Indicates if the fd has a read, write or exception request. See select.h. + * + * Will be called by osmo_select_main() if data on fd is pending. + */ +static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct l1ctl_sock_inst *lsi = ofd->data; + int cnt = 0; + // Check if request is really read request + if (what & BSC_FD_READ) { + struct msgb *msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, + "L1CTL sock rx"); + int rc; + uint16_t len; + + // read length of the message first and convert to host byte order + rc = read(ofd->fd, &len, sizeof(len)); + if (rc < sizeof(len)) { + goto ERR; + } + // convert to host byte order + len = ntohs(len); + if (len <= 0 || len > L1CTL_SOCK_MSGB_SIZE) { + goto ERR; + } + rc = read(ofd->fd, msgb_data(msg), len); + + if (rc == len) { + msgb_put(msg, rc); + msg->l1h = msgb_data(msg); + lsi->recv_cb(lsi, msg); + return 0; + } +ERR: + perror("Failed to receive msg from l2. Connection will be closed.\n"); + l1ctl_sock_disconnect(lsi); + } + return 0; + +} + +static int l1ctl_sock_accept_cb(struct osmo_fd *ofd, unsigned int what) +{ + + struct l1ctl_sock_inst *lsi = ofd->data; + struct sockaddr_un local_addr; + socklen_t addr_len = sizeof(struct sockaddr_in); + int fd; + + fd = accept(ofd->fd, (struct sockaddr *)&local_addr, &addr_len); + if (fd < 0) { + fprintf(stderr, "Failed to accept connection to l2.\n"); + return -1; + } + + lsi->connection.fd = fd; + lsi->connection.when = BSC_FD_READ; + lsi->connection.cb = l1ctl_sock_data_cb; + lsi->connection.data = lsi; + + if (osmo_fd_register(&lsi->connection) != 0) { + fprintf(stderr, "Failed to register the l2 connection fd.\n"); + return -1; + } + return 0; +} + +struct l1ctl_sock_inst *l1ctl_sock_init( + void *ctx, + void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + char *path) +{ + struct l1ctl_sock_inst *lsi; + struct sockaddr_un local_addr; + int fd, rc; + + if (!path) + path = L1CTL_SOCK_PATH; + + if ((fd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) { + fprintf(stderr, "Failed to create Unix Domain Socket.\n"); + return NULL; + } + + local_addr.sun_family = AF_LOCAL; + strcpy(local_addr.sun_path, path); + unlink(local_addr.sun_path); + + if ((rc = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) + != 0) { + fprintf(stderr, "Failed to bind the unix domain socket. '%s'\n", + local_addr.sun_path); + return NULL; + } + + if (listen(fd, 0) != 0) { + fprintf(stderr, "Failed to listen.\n"); + return NULL; + } + + lsi = talloc_zero(ctx, struct l1ctl_sock_inst); + lsi->priv = NULL; + lsi->recv_cb = recv_cb; + lsi->ofd.data = lsi; + lsi->ofd.fd = fd; + lsi->ofd.when = BSC_FD_READ; + lsi->ofd.cb = l1ctl_sock_accept_cb; + // no connection -> invalid filedescriptor and not 0 (==std_in) + lsi->connection.fd = -1; + + osmo_fd_register(&lsi->ofd); + + return lsi; +} + +void l1ctl_sock_destroy(struct l1ctl_sock_inst *lsi) +{ + struct osmo_fd *ofd = &lsi->ofd; + + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; + + talloc_free(lsi); +} + +void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi) +{ + struct osmo_fd *ofd = &lsi->connection; + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; +} + +int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg) +{ + int rc; + rc = write(lsi->connection.fd, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + return rc; +} diff --git a/src/host/virt_phy/src/l1ctl_sock.h b/src/host/virt_phy/src/l1ctl_sock.h new file mode 100644 index 0000000..ef9799c --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sock.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include + +#define L1CTL_SOCK_PATH "/tmp/osmocom_l2" + +/* L1CTL socket instance contains socket data. */ +struct l1ctl_sock_inst { + void *priv; /* Will be appended after osmo-fd's data pointer. */ + struct osmo_fd connection; /* L1CTL connection to l2 app */ + struct osmo_fd ofd; /* Osmocom file descriptor to accept L1CTL connections. */ + void (*recv_cb)(struct l1ctl_sock_inst *vui, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ +}; + +/** + * @brief Initialise the l1ctl socket for communication with l2 apps. + */ +struct l1ctl_sock_inst *l1ctl_sock_init( + void *ctx, + void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + char *path); + +/** + * @brief Transmit message to l2. + */ +int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg); + +/** + * @brief Destroy instance. + */ +void l1ctl_sock_destroy(); + +/** + * @brief Disconnect current connection. + */ +void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi); diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c new file mode 100644 index 0000000..a017a52 --- /dev/null +++ b/src/host/virt_phy/src/logging.c @@ -0,0 +1,113 @@ +/* Logging/Debug support of the virtual physical layer */ + +/* (C) 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 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 "logging.h" + +const char* l1ctlPrimNames[] = { + "_L1CTL_NONE", + "L1CTL_FBSB_REQ", + "L1CTL_FBSB_CONF", + "L1CTL_DATA_IND", + "L1CTL_RACH_REQ", + "L1CTL_DM_EST_REQ", + "L1CTL_DATA_REQ", + "L1CTL_RESET_IND", + "L1CTL_PM_REQ", + "L1CTL_PM_CONF", + "L1CTL_ECHO_REQ", + "L1CTL_ECHO_CONF", + "L1CTL_RACH_CONF", + "L1CTL_RESET_REQ", + "L1CTL_RESET_CONF", + "L1CTL_DATA_CONF", + "L1CTL_CCCH_MODE_REQ", + "L1CTL_CCCH_MODE_CONF", + "L1CTL_DM_REL_REQ", + "L1CTL_PARAM_REQ", + "L1CTL_DM_FREQ_REQ", + "L1CTL_CRYPTO_REQ", + "L1CTL_SIM_REQ", + "L1CTL_SIM_CONF", + "L1CTL_TCH_MODE_REQ", + "L1CTL_TCH_MODE_CONF", + "L1CTL_NEIGH_PM_REQ", + "L1CTL_NEIGH_PM_IND", + "L1CTL_TRAFFIC_REQ", + "L1CTL_TRAFFIC_CONF", + "L1CTL_TRAFFIC_IND" +}; + +static const struct log_info_cat default_categories[] = { + [DL1C] = { + .name = "DL1C", + .description = "Layer 1 Control", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + }, + [DVIRPHY] = { + .name = "DVIRPHY", + .description = "Virtual Layer 1 Interface", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + } +}; + +const struct log_info ms_log_info = { + .filter_fn = NULL, + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +/** + * Initialize the logging system for the virtual physical layer. + */ +int ms_log_init(char *cat_mask) { + struct log_target *stderr_target; + + log_init(&ms_log_info, NULL); + stderr_target = log_target_create_stderr(); + if(!stderr) { + return -1; + } + log_add_target(stderr_target); + log_set_all_filter(stderr_target, 1); + //log_set_log_level(stderr_target, 1); + log_set_print_filename(stderr_target, 0); + log_set_use_color(stderr_target, 0); + log_set_print_timestamp(stderr_target, 1); + log_set_print_category(stderr_target, 1); + if(cat_mask) { + log_parse_category_mask(stderr_target, cat_mask); + } + return 0; +} + +char *getL1ctlPrimName(uint8_t type) +{ + return l1ctlPrimNames[type]; +} diff --git a/src/host/virt_phy/src/logging.h b/src/host/virt_phy/src/logging.h new file mode 100644 index 0000000..87f12f7 --- /dev/null +++ b/src/host/virt_phy/src/logging.h @@ -0,0 +1,11 @@ +#pragma once + +#include + +#define DL1C 0 +#define DVIRPHY 1 + +extern const struct log_info ms_log_info; + +int ms_log_init(char *cat_mask); +char *getL1ctlPrimName(uint8_t type); diff --git a/src/host/virt_phy/src/osmo_mcast_sock.c b/src/host/virt_phy/src/osmo_mcast_sock.c new file mode 100644 index 0000000..c177734 --- /dev/null +++ b/src/host/virt_phy/src/osmo_mcast_sock.c @@ -0,0 +1,192 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "osmo_mcast_sock.h" + +struct mcast_server_sock *mcast_server_sock_setup(void *ctx, + char* tx_mcast_group, + int tx_mcast_port, + int loopback) +{ + struct mcast_server_sock *serv_sock = talloc_zero(ctx, + struct mcast_server_sock); + + serv_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); + serv_sock->sock_conf = talloc_zero(ctx, struct sockaddr_in); + + // setup mcast server socket + serv_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (serv_sock->osmo_fd->fd == -1) { + perror("Failed to create Multicast Server Socket"); + return NULL; + } + + serv_sock->sock_conf->sin_family = AF_INET; + serv_sock->sock_conf->sin_addr.s_addr = inet_addr(tx_mcast_group); + serv_sock->sock_conf->sin_port = htons(tx_mcast_port); + + // determines whether sent mcast packets should be looped back to the local sockets. + // loopback must be enabled if the mcast client is on the same machine + if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, + IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0) { + perror("Failed to disable loopback.\n"); + return NULL; + } + + return serv_sock; +} + +struct mcast_client_sock *mcast_client_sock_setup( + void *ctx, char* mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_client_sock *client_sock = talloc_zero(ctx, + struct mcast_client_sock); + struct sockaddr_in *rx_sock_conf = talloc_zero(NULL, + struct sockaddr_in); + int rc, reuseaddr = 1, loopback = 1; + + client_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); + client_sock->mcast_group = talloc_zero(ctx, struct ip_mreq); + + // Create mcast client socket + client_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (client_sock->osmo_fd->fd == -1) { + perror("Could not create mcast client socket"); + return NULL; + } + + // Enable SO_REUSEADDR to allow multiple instances of this application to receive copies of the multicast datagrams. + rc = setsockopt(client_sock->osmo_fd->fd, + SOL_SOCKET, + SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr)); + if (rc < 0) { + perror("Failed to configure REUSEADDR option"); + return NULL; + } + + // Bind to the proper port number with the IP address specified as INADDR_ANY. + rx_sock_conf->sin_family = AF_INET; + rx_sock_conf->sin_addr.s_addr = htonl(INADDR_ANY); + rx_sock_conf->sin_port = htons(mcast_port); + rc = bind(client_sock->osmo_fd->fd, (struct sockaddr *)rx_sock_conf, + sizeof(*rx_sock_conf)); + talloc_free(rx_sock_conf); + if (rc < 0) { + perror("Could not bind mcast client socket"); + return NULL; + } + + // Enable loopback of msgs to the host. + // Loopback must be enabled for the client, so multiple processes are able to recevie a mcast package. + rc = setsockopt(client_sock->osmo_fd->fd, + IPPROTO_IP, + IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); + if (rc < 0) { + perror("Failed to enable IP_MULTICAST_LOOP"); + return NULL; + } + + // Configure and join the multicast group + client_sock->mcast_group->imr_multiaddr.s_addr = inet_addr(mcast_group); + client_sock->mcast_group->imr_interface.s_addr = htonl(INADDR_ANY); + rc = setsockopt(client_sock->osmo_fd->fd, + IPPROTO_IP, + IP_ADD_MEMBERSHIP, client_sock->mcast_group, + sizeof(*client_sock->mcast_group)); + if (rc < 0) { + perror("Failed to join to mcast goup"); + return NULL; + } + + // configure and register the osmocom filedescriptor + client_sock->osmo_fd->cb = fd_rx_cb; + client_sock->osmo_fd->when = BSC_FD_READ; + client_sock->osmo_fd->data = osmo_fd_data; + + osmo_fd_register(client_sock->osmo_fd); + + return client_sock; +} + +struct mcast_bidir_sock *mcast_bidir_sock_setup( + void *ctx, char* tx_mcast_group, int tx_mcast_port, + char* rx_mcast_group, int rx_mcast_port, int loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_bidir_sock *bidir_sock = talloc(ctx, + struct mcast_bidir_sock); + bidir_sock->rx_sock = mcast_client_sock_setup(ctx, rx_mcast_group, + rx_mcast_port, fd_rx_cb, osmo_fd_data); + bidir_sock->tx_sock = mcast_server_sock_setup(ctx, tx_mcast_group, + tx_mcast_port, loopback); + if (!bidir_sock->rx_sock || !bidir_sock->tx_sock) { + return NULL; + } + return bidir_sock; + +} + +int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, + int buf_len) +{ + return recv(client_sock->osmo_fd->fd, buf, buf_len, 0); +} + +int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, + int data_len) +{ + return sendto(serv_sock->osmo_fd->fd, data, data_len, 0, + (struct sockaddr *)serv_sock->sock_conf, + sizeof(*serv_sock->sock_conf)); +} + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, + int data_len) +{ + return mcast_server_sock_tx(bidir_sock->tx_sock, data, data_len); +} +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, + int buf_len) +{ + return mcast_client_sock_rx(bidir_sock->rx_sock, buf, buf_len); +} + +void mcast_client_sock_close(struct mcast_client_sock *client_sock) +{ + setsockopt(client_sock->osmo_fd->fd, + IPPROTO_IP, + IP_DROP_MEMBERSHIP, client_sock->mcast_group, + sizeof(*client_sock->mcast_group)); + osmo_fd_unregister(client_sock->osmo_fd); + client_sock->osmo_fd->fd = -1; + client_sock->osmo_fd->when = 0; + close(client_sock->osmo_fd->fd); + talloc_free(client_sock->mcast_group); + talloc_free(client_sock->osmo_fd); + talloc_free(client_sock); + +} +void mcast_server_sock_close(struct mcast_server_sock *serv_sock) +{ + close(serv_sock->osmo_fd->fd); + talloc_free(serv_sock->sock_conf); + talloc_free(serv_sock); +} + +void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) +{ + mcast_client_sock_close(bidir_sock->rx_sock); + mcast_server_sock_close(bidir_sock->tx_sock); + talloc_free(bidir_sock); +} diff --git a/src/host/virt_phy/src/osmo_mcast_sock.h b/src/host/virt_phy/src/osmo_mcast_sock.h new file mode 100644 index 0000000..f318ffe --- /dev/null +++ b/src/host/virt_phy/src/osmo_mcast_sock.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include + +struct mcast_server_sock { + struct osmo_fd *osmo_fd; + struct sockaddr_in *sock_conf; +}; + +struct mcast_client_sock { + struct osmo_fd *osmo_fd; + struct ip_mreq *mcast_group; +}; + +struct mcast_bidir_sock { + struct mcast_server_sock *tx_sock; + struct mcast_client_sock *rx_sock; +}; + +struct mcast_bidir_sock *mcast_bidir_sock_setup( + void *ctx, char* tx_mcast_group, int tx_mcast_port, + char* rx_mcast_group, int rx_mcast_port, int loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +struct mcast_server_sock *mcast_server_sock_setup(void *ctx, + char* tx_mcast_group, + int tx_mcast_port, + int loopback); +struct mcast_client_sock *mcast_client_sock_setup( + void *ctx, char* mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); +int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, + int buf_len); +int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, + int data_len); +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, + int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, + int buf_len); +void mcast_client_sock_close(struct mcast_client_sock* client_sock); +void mcast_server_sock_close(struct mcast_server_sock* server_sock); +void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); + diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c new file mode 100644 index 0000000..f2e1690 --- /dev/null +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -0,0 +1,16 @@ +#include "virt_l1_model.h" + +struct l1_model_ms* l1_model_ms_init(void *ctx) { + + struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); + model->state = talloc_zero(ctx, struct l1_state_ms); + + return model; +} + +void l1_model_ms_destroy(struct l1_model_ms *model) { + virt_um_destroy(model->vui); + l1ctl_sock_destroy(model->lsi); + talloc_free(model->state); + talloc_free(model); +} diff --git a/src/host/virt_phy/src/virt_l1_model.h b/src/host/virt_phy/src/virt_l1_model.h new file mode 100644 index 0000000..55a1e3a --- /dev/null +++ b/src/host/virt_phy/src/virt_l1_model.h @@ -0,0 +1,31 @@ +#pragma once + +#include +#include "l1ctl_sock.h" +#include "virtual_um.h" + +struct l1_model_ms { + struct l1ctl_sock_inst *lsi; + struct virt_um_inst *vui; + struct l1_state_ms *state; +}; + +//TODO: must contain logical channel information (fram number, ciphering mode, ...) +struct l1_state_ms { + + /* the cell on which we are camping right now */ + struct l1_cell_info serving_cell; + + /* neighbor cell sync info */ + struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; + + /* TCH */ + uint8_t tch_mode; + uint8_t tch_sync; + uint8_t audio_mode; +}; + +struct l1_model_ms *l1_model_ms_init(void *ctx); + +void l1_model_ms_destroy(struct l1_model_ms *model); + diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c new file mode 100644 index 0000000..94f6fa5 --- /dev/null +++ b/src/host/virt_phy/src/virtphy.c @@ -0,0 +1,50 @@ +/* osmocom includes */ + +#include "logging.h" +#include +#include +#include +#include +#include +#include +#include + +#include "virtual_um.h" +#include "l1ctl_sock.h" +#include "virt_l1_model.h" +#include "gsmtapl1_if.h" +#include "l1ctl_sap.h" + +int main(void) +{ + + // init loginfo + static struct l1_model_ms *model; + ms_log_init("DL1C,1:DVIRPHY,1"); + //ms_log_init("DL1C,8:DVIRPHY,8"); + + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); + + model = l1_model_ms_init(NULL); + + // TODO: make this configurable + model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); + model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, NULL); + + gsmtapl1_init(model); + l1ctl_sap_init(model); + + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n"); + + while (1) { + // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) + osmo_select_main(0); + // handle outgoing l1ctl primitives to l2 + // TODO implement scheduler for uplink messages + } + + l1_model_ms_destroy(model); + + // not reached + return EXIT_FAILURE; +} diff --git a/src/host/virt_phy/src/virtual_um.c b/src/host/virt_phy/src/virtual_um.c new file mode 100644 index 0000000..2b15509 --- /dev/null +++ b/src/host/virt_phy/src/virtual_um.c @@ -0,0 +1,100 @@ +/* Routines for a Virtual Um interface over GSMTAP/UDP */ + +/* (C) 2015 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 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 "virtual_um.h" +#include "osmo_mcast_sock.h" + +/** + * Virtual UM interface file descriptor callback. + * Should be called by select.c when the fd is ready for reading. + */ +static int virt_um_fd_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct virt_um_inst *vui = ofd->data; + + // check if the read flag is set + if (what & BSC_FD_READ) { + // allocate message buffer of specified size + struct msgb *msg = msgb_alloc(VIRT_UM_MSGB_SIZE, + "Virtual UM Rx"); + int rc; + + // read message from fd in message buffer + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + // rc is number of bytes actually read + if (rc > 0) { + msgb_put(msg, rc); + // call the l1 callback function for a received msg + vui->recv_cb(vui, msg); + } else { + // TODO: this kind of error handling might be a bit harsh + vui->recv_cb(vui, NULL); + // Unregister fd from select loop + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; + } + } + + return 0; +} + +struct virt_um_inst *virt_um_init( + void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) +{ + + struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, + rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->recv_cb = recv_cb; + + return vui; + +} + +void virt_um_destroy(struct virt_um_inst *vui) +{ + mcast_bidir_sock_close(vui->mcast_sock); + talloc_free(vui); +} + +/** + * Write msg to to multicast socket and free msg afterwards + */ +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg) +{ + int rc; + + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + + return rc; +} diff --git a/src/host/virt_phy/src/virtual_um.h b/src/host/virt_phy/src/virtual_um.h new file mode 100644 index 0000000..eafb994 --- /dev/null +++ b/src/host/virt_phy/src/virtual_um.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include "osmo_mcast_sock.h" + +#define VIRT_UM_MSGB_SIZE 256 +#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_PORT 6666 +#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_PORT 6667 + +struct virt_um_inst { + void *priv; + struct mcast_bidir_sock *mcast_sock; + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); +}; + +struct virt_um_inst *virt_um_init(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, const char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); + +void virt_um_destroy(struct virt_um_inst *vui); + +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg); -- To view, visit https://gerrit.osmocom.org/3197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I203c8ec58326e52a09603a37232fce7ae3641415 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:27:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:27:07 +0000 Subject: [ABANDON] osmocom-bb[master]: Merge branch 'laforge/virt-phy' In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Merge branch 'laforge/virt-phy' ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2e6ff403320420e72b89930325c8307f0e6a395f Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:29:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:29:56 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Uplink scheduler implementation. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8937b1d6568f5d3750bbdc5d77fa283074d5365e Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:30:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:04 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Fix all compiler warnings on gcc-6.3.0 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I95b93ec907fbfd180a0f2ac681dd63791ede24db Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 12 21:30:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:07 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Make sure heaer files are part of 'make dist' In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib4cd0463da1cf22e04a1debfed55a33f7b6542d4 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 12 21:30:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:13 +0000 Subject: osmocom-bb[master]: VIRT-PHY: coding style / API usage cleanup In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3aa95dbef75d7749d490aad0237d074528527e8b Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 12 21:30:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:16 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Remove non-overridable CFLAGS "-g -O0" In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a2b30f946579bbd49bf66c4f59d160a975a1b56 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 12 21:30:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:21 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Configurable signal power reductions for multiple ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I369ca26703f14bba4e9334b8f417deef640462f9 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:30:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:26 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Extracted common virtphy utils. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I759c6e9805ab012f9553bcba9b5d379193462955 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:30:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:30 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Added option parsing. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id939e5d7b90b592c85ad19f3ad6f459351e2d8f6 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:30:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:34 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Add downlink filter for msg on dedicated channels. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6112b20e31c25636e53d3a6cda6f7443a94ff9c3 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:30:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:38 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Fixed power management and PCS sync. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia1b79aa47c9df3b1e316122455ceccb4a66724e0 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:30:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:43 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Fixed FACCH processing on TCH. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6b41f21b6984e62ad98edfe4398bd678d5b2dad5 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:30:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:48 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Scheduler - correct handling over hyperframe repeat. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I683ba18b5dee308d58f9a95a0ee10e22da207eda Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:30:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:52 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Calculate correct scheduler fn for data- and tch-m... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f44d0b5b9208755e671c619d1f851a043aefb54 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:30:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:30:57 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Fixed error causing send msgs to be received on sa... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2838c4cd39bfac04c014b4c8512466b301d8875 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:31:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:31:02 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Data and traffic req from l23 now use scheduler. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibe57abebadf294f1407d82cef3fd0b51e7c1b23e Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:31:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:31:11 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Using IANA-registered port 4729 for GSMTAP for vir... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8e262c9a9a6260353bfb98e774b9d0b6eecae53 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:31:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:31:29 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Enable multiple phy-instances by configurable l1ct... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief22eedacd1929450ff68f553068b95a778df80f Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:31:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:31:32 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Cleanup dirs, makefile, dependencies and formattin... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd68a03bcc439c262ba513782936c6b62937eaaa Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:31:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:31:45 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Uplink flag and arfcn check. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibb78ac68172fceaa04acca81271940632e52d857 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:31:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:31:57 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Added example config for 2 mobile instances. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecfed3933ca88aa7a027e6247a8b71e28ee1883e Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:32:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:32:04 +0000 Subject: osmocom-bb[master]: VIRT_PHY: Improved l1ctl-to-l23 interface + gsmtap header pa... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibad741d112643c55091b8ba00164b05d728ae1a1 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:32:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:32:12 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Implemented RACH on uplink. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic15188c5c0bba96c223d689be733324a9778a2e8 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:32:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:32:26 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Initial commit of virt-phy to work with osmo-bts v... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I203c8ec58326e52a09603a37232fce7ae3641415 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:43:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 21:43:51 +0000 Subject: [PATCH] osmo-msc[master]: move openbsc/* to repos root In-Reply-To: References: Message-ID: move openbsc/* to repos root This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 --- R AUTHORS R COPYING R Makefile.am R README R README.vty-tests R configure.ac R contrib/a-link/sccp-split-by-con.lua R contrib/bsc-test/README R contrib/bsc-test/all_dial R contrib/bsc-test/dial.sh R contrib/bsc-test/drop-oml.sh R contrib/bsc-test/drop.sh R contrib/bsc-test/hangup R contrib/bsc-test/msc.sh R contrib/bsc_control.py R contrib/bt.py R contrib/convert_to_enum.py R contrib/ctrl2sse.py R contrib/gprs/gb-proxy-unblock-bug.py R contrib/gprs/gprs-bssgp-histogram.lua R contrib/gprs/gprs-buffer-count.lua R contrib/gprs/gprs-split-trace-by-tlli.lua R contrib/gprs/gprs-verify-nu.lua R contrib/hlr-remove-old.sql R contrib/hlrsync/hlrsync.py R contrib/ipa.py M contrib/jenkins.sh R contrib/mgcp_server.py R contrib/nat/test_regexp.c R contrib/nat/ussd_example.py R contrib/rtp/gen_rtp_header.erl R contrib/rtp/rtp_replay.st R contrib/rtp/rtp_replay_shared.st R contrib/rtp/rtp_replay_sip.st R contrib/rtp/timestamp_rtp.lua R contrib/sms/fill-hlr.st R contrib/sms/hlr-query.st R contrib/sms/sqlite-probe.tap.d R contrib/soap.py R contrib/systemd/osmo-bsc-mgcp.service R contrib/systemd/osmo-bsc.service R contrib/systemd/osmo-gbproxy.service R contrib/systemd/osmo-nitb.service R contrib/systemd/osmo-sgsn.service R contrib/testconv/Makefile R contrib/testconv/testconv_main.c R contrib/twisted_ipa.py R doc/BS11-OML.txt R doc/Makefile.am R doc/call-routing.txt R doc/channel_release.txt R doc/e1-data-model.txt R doc/examples/Makefile.am R doc/examples/osmo-bsc/osmo-bsc.cfg R doc/examples/osmo-bsc_mgcp/mgcp.cfg R doc/examples/osmo-bsc_nat/black-list.cfg R doc/examples/osmo-bsc_nat/bscs.config R doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg R doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg R doc/examples/osmo-gbproxy/osmo-gbproxy.cfg R doc/examples/osmo-gtphub/gtphub-example.txt R doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg R doc/examples/osmo-gtphub/osmo-gtphub.cfg R doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg R doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg R doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg R doc/examples/osmo-nitb/bs11/openbsc.cfg R doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg R doc/examples/osmo-nitb/nanobts/openbsc.cfg R doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg R doc/examples/osmo-nitb/rbs2308/openbsc.cfg R doc/examples/osmo-nitb/sysmobts/openbsc.cfg R doc/examples/osmo-sgsn/osmo-sgsn.cfg R doc/gsm-hopping.txt R doc/handover.txt R doc/ipa-sccp.txt R doc/oml-interface.txt R doc/osmo-nitb-data_structures.dot R doc/paging.txt R git-version-gen R include/Makefile.am R include/compat_af_isdn.h R include/mISDNif.h R include/openbsc/Makefile.am R include/openbsc/abis_nm.h R include/openbsc/abis_om2000.h R include/openbsc/abis_rsl.h R include/openbsc/arfcn_range_encode.h R include/openbsc/auth.h R include/openbsc/bsc_api.h R include/openbsc/bsc_msc.h R include/openbsc/bsc_msc_data.h R include/openbsc/bsc_msg_filter.h R include/openbsc/bsc_nat.h R include/openbsc/bsc_nat_callstats.h R include/openbsc/bsc_nat_sccp.h R include/openbsc/bsc_rll.h R include/openbsc/bsc_subscriber.h R include/openbsc/bss.h R include/openbsc/bts_ipaccess_nanobts_omlattr.h R include/openbsc/chan_alloc.h R include/openbsc/common_bsc.h R include/openbsc/common_cs.h R include/openbsc/crc24.h R include/openbsc/ctrl.h R include/openbsc/db.h R include/openbsc/debug.h R include/openbsc/e1_config.h R include/openbsc/gb_proxy.h R include/openbsc/gprs_gb_parse.h R include/openbsc/gprs_gmm.h R include/openbsc/gprs_llc.h R include/openbsc/gprs_llc_xid.h R include/openbsc/gprs_sgsn.h R include/openbsc/gprs_sndcp.h R include/openbsc/gprs_sndcp_comp.h R include/openbsc/gprs_sndcp_dcomp.h R include/openbsc/gprs_sndcp_pcomp.h R include/openbsc/gprs_sndcp_xid.h R include/openbsc/gprs_subscriber.h R include/openbsc/gprs_utils.h R include/openbsc/gsm_04_08.h R include/openbsc/gsm_04_11.h R include/openbsc/gsm_04_80.h R include/openbsc/gsm_data.h R include/openbsc/gsm_data_shared.h R include/openbsc/gsm_subscriber.h R include/openbsc/gsup_client.h R include/openbsc/gtphub.h R include/openbsc/handover.h R include/openbsc/handover_decision.h R include/openbsc/ipaccess.h R include/openbsc/iu.h R include/openbsc/meas_feed.h R include/openbsc/meas_rep.h R include/openbsc/mgcp.h R include/openbsc/mgcp_internal.h R include/openbsc/mgcp_transcode.h R include/openbsc/misdn.h R include/openbsc/mncc.h R include/openbsc/mncc_int.h R include/openbsc/nat_rewrite_trie.h R include/openbsc/network_listen.h R include/openbsc/oap_client.h R include/openbsc/openbscdefines.h R include/openbsc/osmo_bsc.h R include/openbsc/osmo_bsc_grace.h R include/openbsc/osmo_bsc_rf.h R include/openbsc/osmo_msc.h R include/openbsc/osmux.h R include/openbsc/paging.h R include/openbsc/pcu_if.h R include/openbsc/pcuif_proto.h R include/openbsc/rest_octets.h R include/openbsc/rrlp.h R include/openbsc/rs232.h R include/openbsc/rtp_proxy.h R include/openbsc/sgsn.h R include/openbsc/signal.h R include/openbsc/silent_call.h R include/openbsc/slhc.h R include/openbsc/smpp.h R include/openbsc/sms_queue.h R include/openbsc/socket.h R include/openbsc/system_information.h R include/openbsc/token_auth.h R include/openbsc/transaction.h R include/openbsc/trau_mux.h R include/openbsc/trau_upqueue.h R include/openbsc/ussd.h R include/openbsc/v42bis.h R include/openbsc/v42bis_private.h R include/openbsc/vty.h R m4/README R m4/ax_check_compile_flag.m4 R openbsc.pc.in R osmoappdesc.py R src/Makefile.am R src/gprs/.gitignore R src/gprs/Makefile.am R src/gprs/crc24.c R src/gprs/gb_proxy.c R src/gprs/gb_proxy_main.c R src/gprs/gb_proxy_patch.c R src/gprs/gb_proxy_peer.c R src/gprs/gb_proxy_tlli.c R src/gprs/gb_proxy_vty.c R src/gprs/gprs_gb_parse.c R src/gprs/gprs_gmm.c R src/gprs/gprs_llc.c R src/gprs/gprs_llc_parse.c R src/gprs/gprs_llc_vty.c R src/gprs/gprs_llc_xid.c R src/gprs/gprs_sgsn.c R src/gprs/gprs_sndcp.c R src/gprs/gprs_sndcp_comp.c R src/gprs/gprs_sndcp_dcomp.c R src/gprs/gprs_sndcp_pcomp.c R src/gprs/gprs_sndcp_vty.c R src/gprs/gprs_sndcp_xid.c R src/gprs/gprs_subscriber.c R src/gprs/gprs_utils.c R src/gprs/gtphub.c R src/gprs/gtphub_ares.c R src/gprs/gtphub_main.c R src/gprs/gtphub_sock.c R src/gprs/gtphub_vty.c R src/gprs/osmo_sgsn.cfg R src/gprs/sgsn_ares.c R src/gprs/sgsn_auth.c R src/gprs/sgsn_cdr.c R src/gprs/sgsn_ctrl.c R src/gprs/sgsn_libgtp.c R src/gprs/sgsn_main.c R src/gprs/sgsn_vty.c R src/gprs/slhc.c R src/gprs/v42bis.c R src/ipaccess/Makefile.am R src/ipaccess/abisip-find.c R src/ipaccess/ipaccess-config.c R src/ipaccess/ipaccess-firmware.c R src/ipaccess/ipaccess-proxy.c R src/ipaccess/network_listen.c R src/libbsc/Makefile.am R src/libbsc/abis_nm.c R src/libbsc/abis_nm_ipaccess.c R src/libbsc/abis_nm_vty.c R src/libbsc/abis_om2000.c R src/libbsc/abis_om2000_vty.c R src/libbsc/abis_rsl.c R src/libbsc/arfcn_range_encode.c R src/libbsc/bsc_api.c R src/libbsc/bsc_ctrl_commands.c R src/libbsc/bsc_ctrl_lookup.c R src/libbsc/bsc_dyn_ts.c R src/libbsc/bsc_init.c R src/libbsc/bsc_msc.c R src/libbsc/bsc_rf_ctrl.c R src/libbsc/bsc_rll.c R src/libbsc/bsc_subscriber.c R src/libbsc/bsc_vty.c R src/libbsc/bts_ericsson_rbs2000.c R src/libbsc/bts_init.c R src/libbsc/bts_ipaccess_nanobts.c R src/libbsc/bts_ipaccess_nanobts_omlattr.c R src/libbsc/bts_nokia_site.c R src/libbsc/bts_siemens_bs11.c R src/libbsc/bts_sysmobts.c R src/libbsc/bts_unknown.c R src/libbsc/chan_alloc.c R src/libbsc/e1_config.c R src/libbsc/gsm_04_08_utils.c R src/libbsc/gsm_04_80_utils.c R src/libbsc/handover_decision.c R src/libbsc/handover_logic.c R src/libbsc/meas_proc.c R src/libbsc/meas_rep.c R src/libbsc/net_init.c R src/libbsc/paging.c R src/libbsc/pcu_sock.c R src/libbsc/rest_octets.c R src/libbsc/system_information.c R src/libcommon-cs/Makefile.am R src/libcommon-cs/common_cs.c R src/libcommon-cs/common_cs_vty.c R src/libcommon/Makefile.am R src/libcommon/bsc_version.c R src/libcommon/common_vty.c R src/libcommon/debug.c R src/libcommon/gsm_data.c R src/libcommon/gsm_data_shared.c R src/libcommon/gsm_subscriber_base.c R src/libcommon/gsup_client.c R src/libcommon/gsup_test_client.c R src/libcommon/oap_client.c R src/libcommon/socket.c R src/libcommon/talloc_ctx.c R src/libfilter/Makefile.am R src/libfilter/bsc_msg_acc.c R src/libfilter/bsc_msg_filter.c R src/libfilter/bsc_msg_vty.c R src/libiu/Makefile.am R src/libiu/iu.c R src/libiu/iu_vty.c R src/libmgcp/Makefile.am R src/libmgcp/g711common.h R src/libmgcp/mgcp_network.c R src/libmgcp/mgcp_osmux.c R src/libmgcp/mgcp_protocol.c R src/libmgcp/mgcp_sdp.c R src/libmgcp/mgcp_transcode.c R src/libmgcp/mgcp_vty.c R src/libmsc/Makefile.am R src/libmsc/auth.c R src/libmsc/ctrl_commands.c R src/libmsc/db.c R src/libmsc/gsm_04_08.c R src/libmsc/gsm_04_11.c R src/libmsc/gsm_04_80.c R src/libmsc/gsm_subscriber.c R src/libmsc/meas_feed.c R src/libmsc/meas_feed.h R src/libmsc/mncc.c R src/libmsc/mncc_builtin.c R src/libmsc/mncc_sock.c R src/libmsc/osmo_msc.c R src/libmsc/rrlp.c R src/libmsc/silent_call.c R src/libmsc/smpp_openbsc.c R src/libmsc/smpp_smsc.c R src/libmsc/smpp_smsc.h R src/libmsc/smpp_utils.c R src/libmsc/smpp_vty.c R src/libmsc/sms_queue.c R src/libmsc/token_auth.c R src/libmsc/transaction.c R src/libmsc/ussd.c R src/libmsc/vty_interface_layer3.c R src/libtrau/Makefile.am R src/libtrau/rtp_proxy.c R src/libtrau/trau_mux.c R src/libtrau/trau_upqueue.c R src/osmo-bsc/Makefile.am R src/osmo-bsc/osmo_bsc_api.c R src/osmo-bsc/osmo_bsc_audio.c R src/osmo-bsc/osmo_bsc_bssap.c R src/osmo-bsc/osmo_bsc_ctrl.c R src/osmo-bsc/osmo_bsc_filter.c R src/osmo-bsc/osmo_bsc_grace.c R src/osmo-bsc/osmo_bsc_main.c R src/osmo-bsc/osmo_bsc_msc.c R src/osmo-bsc/osmo_bsc_sccp.c R src/osmo-bsc/osmo_bsc_vty.c R src/osmo-bsc_mgcp/Makefile.am R src/osmo-bsc_mgcp/mgcp_main.c R src/osmo-bsc_nat/Makefile.am R src/osmo-bsc_nat/bsc_filter.c R src/osmo-bsc_nat/bsc_mgcp_utils.c R src/osmo-bsc_nat/bsc_nat.c R src/osmo-bsc_nat/bsc_nat_ctrl.c R src/osmo-bsc_nat/bsc_nat_filter.c R src/osmo-bsc_nat/bsc_nat_rewrite.c R src/osmo-bsc_nat/bsc_nat_rewrite_trie.c R src/osmo-bsc_nat/bsc_nat_utils.c R src/osmo-bsc_nat/bsc_nat_vty.c R src/osmo-bsc_nat/bsc_sccp.c R src/osmo-bsc_nat/bsc_ussd.c R src/osmo-nitb/Makefile.am R src/osmo-nitb/bsc_hack.c R src/utils/Makefile.am R src/utils/bs11_config.c R src/utils/isdnsync.c R src/utils/meas_db.c R src/utils/meas_db.h R src/utils/meas_json.c R src/utils/meas_pcap2db.c R src/utils/meas_udp2db.c R src/utils/meas_vis.c R src/utils/smpp_mirror.c R tests/Makefile.am R tests/abis/Makefile.am R tests/abis/abis_test.c R tests/abis/abis_test.ok R tests/atlocal.in R tests/bsc-nat-trie/Makefile.am R tests/bsc-nat-trie/bsc_nat_trie_test.c R tests/bsc-nat-trie/bsc_nat_trie_test.ok R tests/bsc-nat-trie/prefixes.csv R tests/bsc-nat/Makefile.am R tests/bsc-nat/barr.cfg R tests/bsc-nat/barr_dup.cfg R tests/bsc-nat/bsc_data.c R tests/bsc-nat/bsc_nat_test.c R tests/bsc-nat/bsc_nat_test.ok R tests/bsc-nat/prefixes.csv R tests/bsc/Makefile.am R tests/bsc/bsc_test.c R tests/bsc/bsc_test.ok R tests/channel/Makefile.am R tests/channel/channel_test.c R tests/channel/channel_test.ok R tests/ctrl_test_runner.py R tests/db/Makefile.am R tests/db/db_test.c R tests/db/db_test.err R tests/db/db_test.ok R tests/db/hlr.sqlite3 R tests/gbproxy/Makefile.am R tests/gbproxy/gbproxy_test.c R tests/gbproxy/gbproxy_test.ok R tests/gprs/Makefile.am R tests/gprs/gprs_test.c R tests/gprs/gprs_test.ok R tests/gsm0408/Makefile.am R tests/gsm0408/gsm0408_test.c R tests/gsm0408/gsm0408_test.ok R tests/gtphub/Makefile.am R tests/gtphub/gtphub_test.c R tests/gtphub/gtphub_test.ok R tests/mgcp/Makefile.am R tests/mgcp/mgcp_test.c R tests/mgcp/mgcp_test.ok R tests/mgcp/mgcp_transcoding_test.c R tests/mgcp/mgcp_transcoding_test.ok R tests/mm_auth/Makefile.am R tests/mm_auth/mm_auth_test.c R tests/mm_auth/mm_auth_test.ok R tests/nanobts_omlattr/Makefile.am R tests/nanobts_omlattr/nanobts_omlattr_test.c R tests/nanobts_omlattr/nanobts_omlattr_test.ok R tests/oap/Makefile.am R tests/oap/oap_client_test.c R tests/oap/oap_client_test.err R tests/oap/oap_client_test.ok R tests/sgsn/Makefile.am R tests/sgsn/sgsn_test.c R tests/sgsn/sgsn_test.ok R tests/slhc/Makefile.am R tests/slhc/slhc_test.c R tests/slhc/slhc_test.ok R tests/smpp/Makefile.am R tests/smpp/smpp_test.c R tests/smpp/smpp_test.err R tests/smpp/smpp_test.ok R tests/smpp_test_runner.py R tests/sndcp_xid/Makefile.am R tests/sndcp_xid/sndcp_xid_test.c R tests/sndcp_xid/sndcp_xid_test.ok R tests/subscr/Makefile.am R tests/subscr/bsc_subscr_test.c R tests/subscr/bsc_subscr_test.err R tests/subscr/bsc_subscr_test.ok R tests/subscr/subscr_test.c R tests/subscr/subscr_test.ok R tests/testsuite.at R tests/trau/Makefile.am R tests/trau/trau_test.c R tests/trau/trau_test.ok R tests/v42bis/Makefile.am R tests/v42bis/v42bis_test.c R tests/v42bis/v42bis_test.ok R tests/vty_test_runner.py R tests/xid/Makefile.am R tests/xid/xid_test.c R tests/xid/xid_test.ok R tools/hlrstat.pl 446 files changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/88/3188/2 diff --git a/openbsc/AUTHORS b/AUTHORS similarity index 100% rename from openbsc/AUTHORS rename to AUTHORS diff --git a/openbsc/COPYING b/COPYING similarity index 100% rename from openbsc/COPYING rename to COPYING diff --git a/openbsc/Makefile.am b/Makefile.am similarity index 100% rename from openbsc/Makefile.am rename to Makefile.am diff --git a/openbsc/README b/README similarity index 100% rename from openbsc/README rename to README diff --git a/openbsc/README.vty-tests b/README.vty-tests similarity index 100% rename from openbsc/README.vty-tests rename to README.vty-tests diff --git a/openbsc/configure.ac b/configure.ac similarity index 100% rename from openbsc/configure.ac rename to configure.ac diff --git a/openbsc/contrib/a-link/sccp-split-by-con.lua b/contrib/a-link/sccp-split-by-con.lua similarity index 100% rename from openbsc/contrib/a-link/sccp-split-by-con.lua rename to contrib/a-link/sccp-split-by-con.lua diff --git a/openbsc/contrib/bsc-test/README b/contrib/bsc-test/README similarity index 100% rename from openbsc/contrib/bsc-test/README rename to contrib/bsc-test/README diff --git a/openbsc/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial similarity index 100% rename from openbsc/contrib/bsc-test/all_dial rename to contrib/bsc-test/all_dial diff --git a/openbsc/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh similarity index 100% rename from openbsc/contrib/bsc-test/dial.sh rename to contrib/bsc-test/dial.sh diff --git a/openbsc/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh similarity index 100% rename from openbsc/contrib/bsc-test/drop-oml.sh rename to contrib/bsc-test/drop-oml.sh diff --git a/openbsc/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh similarity index 100% rename from openbsc/contrib/bsc-test/drop.sh rename to contrib/bsc-test/drop.sh diff --git a/openbsc/contrib/bsc-test/hangup b/contrib/bsc-test/hangup similarity index 100% rename from openbsc/contrib/bsc-test/hangup rename to contrib/bsc-test/hangup diff --git a/openbsc/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh similarity index 100% rename from openbsc/contrib/bsc-test/msc.sh rename to contrib/bsc-test/msc.sh diff --git a/openbsc/contrib/bsc_control.py b/contrib/bsc_control.py similarity index 100% rename from openbsc/contrib/bsc_control.py rename to contrib/bsc_control.py diff --git a/openbsc/contrib/bt.py b/contrib/bt.py similarity index 100% rename from openbsc/contrib/bt.py rename to contrib/bt.py diff --git a/openbsc/contrib/convert_to_enum.py b/contrib/convert_to_enum.py similarity index 100% rename from openbsc/contrib/convert_to_enum.py rename to contrib/convert_to_enum.py diff --git a/openbsc/contrib/ctrl2sse.py b/contrib/ctrl2sse.py similarity index 100% rename from openbsc/contrib/ctrl2sse.py rename to contrib/ctrl2sse.py diff --git a/openbsc/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py similarity index 100% rename from openbsc/contrib/gprs/gb-proxy-unblock-bug.py rename to contrib/gprs/gb-proxy-unblock-bug.py diff --git a/openbsc/contrib/gprs/gprs-bssgp-histogram.lua b/contrib/gprs/gprs-bssgp-histogram.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-bssgp-histogram.lua rename to contrib/gprs/gprs-bssgp-histogram.lua diff --git a/openbsc/contrib/gprs/gprs-buffer-count.lua b/contrib/gprs/gprs-buffer-count.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-buffer-count.lua rename to contrib/gprs/gprs-buffer-count.lua diff --git a/openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua b/contrib/gprs/gprs-split-trace-by-tlli.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua rename to contrib/gprs/gprs-split-trace-by-tlli.lua diff --git a/openbsc/contrib/gprs/gprs-verify-nu.lua b/contrib/gprs/gprs-verify-nu.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-verify-nu.lua rename to contrib/gprs/gprs-verify-nu.lua diff --git a/openbsc/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql similarity index 100% rename from openbsc/contrib/hlr-remove-old.sql rename to contrib/hlr-remove-old.sql diff --git a/openbsc/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py similarity index 100% rename from openbsc/contrib/hlrsync/hlrsync.py rename to contrib/hlrsync/hlrsync.py diff --git a/openbsc/contrib/ipa.py b/contrib/ipa.py similarity index 100% rename from openbsc/contrib/ipa.py rename to contrib/ipa.py diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 068ee34..b315b97 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -43,7 +43,6 @@ set -x cd "$base" -cd openbsc autoreconf --install --force ./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE diff --git a/openbsc/contrib/mgcp_server.py b/contrib/mgcp_server.py similarity index 100% rename from openbsc/contrib/mgcp_server.py rename to contrib/mgcp_server.py diff --git a/openbsc/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c similarity index 100% rename from openbsc/contrib/nat/test_regexp.c rename to contrib/nat/test_regexp.c diff --git a/openbsc/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py similarity index 100% rename from openbsc/contrib/nat/ussd_example.py rename to contrib/nat/ussd_example.py diff --git a/openbsc/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl similarity index 100% rename from openbsc/contrib/rtp/gen_rtp_header.erl rename to contrib/rtp/gen_rtp_header.erl diff --git a/openbsc/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay.st rename to contrib/rtp/rtp_replay.st diff --git a/openbsc/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay_shared.st rename to contrib/rtp/rtp_replay_shared.st diff --git a/openbsc/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay_sip.st rename to contrib/rtp/rtp_replay_sip.st diff --git a/openbsc/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua similarity index 100% rename from openbsc/contrib/rtp/timestamp_rtp.lua rename to contrib/rtp/timestamp_rtp.lua diff --git a/openbsc/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st similarity index 100% rename from openbsc/contrib/sms/fill-hlr.st rename to contrib/sms/fill-hlr.st diff --git a/openbsc/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st similarity index 100% rename from openbsc/contrib/sms/hlr-query.st rename to contrib/sms/hlr-query.st diff --git a/openbsc/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d similarity index 100% rename from openbsc/contrib/sms/sqlite-probe.tap.d rename to contrib/sms/sqlite-probe.tap.d diff --git a/openbsc/contrib/soap.py b/contrib/soap.py similarity index 100% rename from openbsc/contrib/soap.py rename to contrib/soap.py diff --git a/openbsc/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service similarity index 100% rename from openbsc/contrib/systemd/osmo-bsc-mgcp.service rename to contrib/systemd/osmo-bsc-mgcp.service diff --git a/openbsc/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service similarity index 100% rename from openbsc/contrib/systemd/osmo-bsc.service rename to contrib/systemd/osmo-bsc.service diff --git a/openbsc/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service similarity index 100% rename from openbsc/contrib/systemd/osmo-gbproxy.service rename to contrib/systemd/osmo-gbproxy.service diff --git a/openbsc/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service similarity index 100% rename from openbsc/contrib/systemd/osmo-nitb.service rename to contrib/systemd/osmo-nitb.service diff --git a/openbsc/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service similarity index 100% rename from openbsc/contrib/systemd/osmo-sgsn.service rename to contrib/systemd/osmo-sgsn.service diff --git a/openbsc/contrib/testconv/Makefile b/contrib/testconv/Makefile similarity index 100% rename from openbsc/contrib/testconv/Makefile rename to contrib/testconv/Makefile diff --git a/openbsc/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c similarity index 100% rename from openbsc/contrib/testconv/testconv_main.c rename to contrib/testconv/testconv_main.c diff --git a/openbsc/contrib/twisted_ipa.py b/contrib/twisted_ipa.py similarity index 100% rename from openbsc/contrib/twisted_ipa.py rename to contrib/twisted_ipa.py diff --git a/openbsc/doc/BS11-OML.txt b/doc/BS11-OML.txt similarity index 100% rename from openbsc/doc/BS11-OML.txt rename to doc/BS11-OML.txt diff --git a/openbsc/doc/Makefile.am b/doc/Makefile.am similarity index 100% rename from openbsc/doc/Makefile.am rename to doc/Makefile.am diff --git a/openbsc/doc/call-routing.txt b/doc/call-routing.txt similarity index 100% rename from openbsc/doc/call-routing.txt rename to doc/call-routing.txt diff --git a/openbsc/doc/channel_release.txt b/doc/channel_release.txt similarity index 100% rename from openbsc/doc/channel_release.txt rename to doc/channel_release.txt diff --git a/openbsc/doc/e1-data-model.txt b/doc/e1-data-model.txt similarity index 100% rename from openbsc/doc/e1-data-model.txt rename to doc/e1-data-model.txt diff --git a/openbsc/doc/examples/Makefile.am b/doc/examples/Makefile.am similarity index 100% rename from openbsc/doc/examples/Makefile.am rename to doc/examples/Makefile.am diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg rename to doc/examples/osmo-bsc/osmo-bsc.cfg diff --git a/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg rename to doc/examples/osmo-bsc_mgcp/mgcp.cfg diff --git a/openbsc/doc/examples/osmo-bsc_nat/black-list.cfg b/doc/examples/osmo-bsc_nat/black-list.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/black-list.cfg rename to doc/examples/osmo-bsc_nat/black-list.cfg diff --git a/openbsc/doc/examples/osmo-bsc_nat/bscs.config b/doc/examples/osmo-bsc_nat/bscs.config similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/bscs.config rename to doc/examples/osmo-bsc_nat/bscs.config diff --git a/openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg rename to doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg diff --git a/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg rename to doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg diff --git a/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg rename to doc/examples/osmo-gbproxy/osmo-gbproxy.cfg diff --git a/openbsc/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/gtphub-example.txt rename to doc/examples/osmo-gtphub/gtphub-example.txt diff --git a/openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg rename to doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg diff --git a/openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg rename to doc/examples/osmo-gtphub/osmo-gtphub.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg b/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg b/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg b/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg b/doc/examples/osmo-nitb/bs11/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg rename to doc/examples/osmo-nitb/bs11/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg b/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg rename to doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg b/doc/examples/osmo-nitb/nanobts/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg rename to doc/examples/osmo-nitb/nanobts/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg b/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg rename to doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg b/doc/examples/osmo-nitb/rbs2308/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg rename to doc/examples/osmo-nitb/rbs2308/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg b/doc/examples/osmo-nitb/sysmobts/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg rename to doc/examples/osmo-nitb/sysmobts/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg similarity index 100% rename from openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg rename to doc/examples/osmo-sgsn/osmo-sgsn.cfg diff --git a/openbsc/doc/gsm-hopping.txt b/doc/gsm-hopping.txt similarity index 100% rename from openbsc/doc/gsm-hopping.txt rename to doc/gsm-hopping.txt diff --git a/openbsc/doc/handover.txt b/doc/handover.txt similarity index 100% rename from openbsc/doc/handover.txt rename to doc/handover.txt diff --git a/openbsc/doc/ipa-sccp.txt b/doc/ipa-sccp.txt similarity index 100% rename from openbsc/doc/ipa-sccp.txt rename to doc/ipa-sccp.txt diff --git a/openbsc/doc/oml-interface.txt b/doc/oml-interface.txt similarity index 100% rename from openbsc/doc/oml-interface.txt rename to doc/oml-interface.txt diff --git a/openbsc/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot similarity index 100% rename from openbsc/doc/osmo-nitb-data_structures.dot rename to doc/osmo-nitb-data_structures.dot diff --git a/openbsc/doc/paging.txt b/doc/paging.txt similarity index 100% rename from openbsc/doc/paging.txt rename to doc/paging.txt diff --git a/openbsc/git-version-gen b/git-version-gen similarity index 100% rename from openbsc/git-version-gen rename to git-version-gen diff --git a/openbsc/include/Makefile.am b/include/Makefile.am similarity index 100% rename from openbsc/include/Makefile.am rename to include/Makefile.am diff --git a/openbsc/include/compat_af_isdn.h b/include/compat_af_isdn.h similarity index 100% rename from openbsc/include/compat_af_isdn.h rename to include/compat_af_isdn.h diff --git a/openbsc/include/mISDNif.h b/include/mISDNif.h similarity index 100% rename from openbsc/include/mISDNif.h rename to include/mISDNif.h diff --git a/openbsc/include/openbsc/Makefile.am b/include/openbsc/Makefile.am similarity index 100% rename from openbsc/include/openbsc/Makefile.am rename to include/openbsc/Makefile.am diff --git a/openbsc/include/openbsc/abis_nm.h b/include/openbsc/abis_nm.h similarity index 100% rename from openbsc/include/openbsc/abis_nm.h rename to include/openbsc/abis_nm.h diff --git a/openbsc/include/openbsc/abis_om2000.h b/include/openbsc/abis_om2000.h similarity index 100% rename from openbsc/include/openbsc/abis_om2000.h rename to include/openbsc/abis_om2000.h diff --git a/openbsc/include/openbsc/abis_rsl.h b/include/openbsc/abis_rsl.h similarity index 100% rename from openbsc/include/openbsc/abis_rsl.h rename to include/openbsc/abis_rsl.h diff --git a/openbsc/include/openbsc/arfcn_range_encode.h b/include/openbsc/arfcn_range_encode.h similarity index 100% rename from openbsc/include/openbsc/arfcn_range_encode.h rename to include/openbsc/arfcn_range_encode.h diff --git a/openbsc/include/openbsc/auth.h b/include/openbsc/auth.h similarity index 100% rename from openbsc/include/openbsc/auth.h rename to include/openbsc/auth.h diff --git a/openbsc/include/openbsc/bsc_api.h b/include/openbsc/bsc_api.h similarity index 100% rename from openbsc/include/openbsc/bsc_api.h rename to include/openbsc/bsc_api.h diff --git a/openbsc/include/openbsc/bsc_msc.h b/include/openbsc/bsc_msc.h similarity index 100% rename from openbsc/include/openbsc/bsc_msc.h rename to include/openbsc/bsc_msc.h diff --git a/openbsc/include/openbsc/bsc_msc_data.h b/include/openbsc/bsc_msc_data.h similarity index 100% rename from openbsc/include/openbsc/bsc_msc_data.h rename to include/openbsc/bsc_msc_data.h diff --git a/openbsc/include/openbsc/bsc_msg_filter.h b/include/openbsc/bsc_msg_filter.h similarity index 100% rename from openbsc/include/openbsc/bsc_msg_filter.h rename to include/openbsc/bsc_msg_filter.h diff --git a/openbsc/include/openbsc/bsc_nat.h b/include/openbsc/bsc_nat.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat.h rename to include/openbsc/bsc_nat.h diff --git a/openbsc/include/openbsc/bsc_nat_callstats.h b/include/openbsc/bsc_nat_callstats.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat_callstats.h rename to include/openbsc/bsc_nat_callstats.h diff --git a/openbsc/include/openbsc/bsc_nat_sccp.h b/include/openbsc/bsc_nat_sccp.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat_sccp.h rename to include/openbsc/bsc_nat_sccp.h diff --git a/openbsc/include/openbsc/bsc_rll.h b/include/openbsc/bsc_rll.h similarity index 100% rename from openbsc/include/openbsc/bsc_rll.h rename to include/openbsc/bsc_rll.h diff --git a/openbsc/include/openbsc/bsc_subscriber.h b/include/openbsc/bsc_subscriber.h similarity index 100% rename from openbsc/include/openbsc/bsc_subscriber.h rename to include/openbsc/bsc_subscriber.h diff --git a/openbsc/include/openbsc/bss.h b/include/openbsc/bss.h similarity index 100% rename from openbsc/include/openbsc/bss.h rename to include/openbsc/bss.h diff --git a/openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/openbsc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/openbsc/bts_ipaccess_nanobts_omlattr.h diff --git a/openbsc/include/openbsc/chan_alloc.h b/include/openbsc/chan_alloc.h similarity index 100% rename from openbsc/include/openbsc/chan_alloc.h rename to include/openbsc/chan_alloc.h diff --git a/openbsc/include/openbsc/common_bsc.h b/include/openbsc/common_bsc.h similarity index 100% rename from openbsc/include/openbsc/common_bsc.h rename to include/openbsc/common_bsc.h diff --git a/openbsc/include/openbsc/common_cs.h b/include/openbsc/common_cs.h similarity index 100% rename from openbsc/include/openbsc/common_cs.h rename to include/openbsc/common_cs.h diff --git a/openbsc/include/openbsc/crc24.h b/include/openbsc/crc24.h similarity index 100% rename from openbsc/include/openbsc/crc24.h rename to include/openbsc/crc24.h diff --git a/openbsc/include/openbsc/ctrl.h b/include/openbsc/ctrl.h similarity index 100% rename from openbsc/include/openbsc/ctrl.h rename to include/openbsc/ctrl.h diff --git a/openbsc/include/openbsc/db.h b/include/openbsc/db.h similarity index 100% rename from openbsc/include/openbsc/db.h rename to include/openbsc/db.h diff --git a/openbsc/include/openbsc/debug.h b/include/openbsc/debug.h similarity index 100% rename from openbsc/include/openbsc/debug.h rename to include/openbsc/debug.h diff --git a/openbsc/include/openbsc/e1_config.h b/include/openbsc/e1_config.h similarity index 100% rename from openbsc/include/openbsc/e1_config.h rename to include/openbsc/e1_config.h diff --git a/openbsc/include/openbsc/gb_proxy.h b/include/openbsc/gb_proxy.h similarity index 100% rename from openbsc/include/openbsc/gb_proxy.h rename to include/openbsc/gb_proxy.h diff --git a/openbsc/include/openbsc/gprs_gb_parse.h b/include/openbsc/gprs_gb_parse.h similarity index 100% rename from openbsc/include/openbsc/gprs_gb_parse.h rename to include/openbsc/gprs_gb_parse.h diff --git a/openbsc/include/openbsc/gprs_gmm.h b/include/openbsc/gprs_gmm.h similarity index 100% rename from openbsc/include/openbsc/gprs_gmm.h rename to include/openbsc/gprs_gmm.h diff --git a/openbsc/include/openbsc/gprs_llc.h b/include/openbsc/gprs_llc.h similarity index 100% rename from openbsc/include/openbsc/gprs_llc.h rename to include/openbsc/gprs_llc.h diff --git a/openbsc/include/openbsc/gprs_llc_xid.h b/include/openbsc/gprs_llc_xid.h similarity index 100% rename from openbsc/include/openbsc/gprs_llc_xid.h rename to include/openbsc/gprs_llc_xid.h diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h similarity index 100% rename from openbsc/include/openbsc/gprs_sgsn.h rename to include/openbsc/gprs_sgsn.h diff --git a/openbsc/include/openbsc/gprs_sndcp.h b/include/openbsc/gprs_sndcp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp.h rename to include/openbsc/gprs_sndcp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_comp.h b/include/openbsc/gprs_sndcp_comp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_comp.h rename to include/openbsc/gprs_sndcp_comp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_dcomp.h b/include/openbsc/gprs_sndcp_dcomp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_dcomp.h rename to include/openbsc/gprs_sndcp_dcomp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_pcomp.h b/include/openbsc/gprs_sndcp_pcomp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_pcomp.h rename to include/openbsc/gprs_sndcp_pcomp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_xid.h b/include/openbsc/gprs_sndcp_xid.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_xid.h rename to include/openbsc/gprs_sndcp_xid.h diff --git a/openbsc/include/openbsc/gprs_subscriber.h b/include/openbsc/gprs_subscriber.h similarity index 100% rename from openbsc/include/openbsc/gprs_subscriber.h rename to include/openbsc/gprs_subscriber.h diff --git a/openbsc/include/openbsc/gprs_utils.h b/include/openbsc/gprs_utils.h similarity index 100% rename from openbsc/include/openbsc/gprs_utils.h rename to include/openbsc/gprs_utils.h diff --git a/openbsc/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_08.h rename to include/openbsc/gsm_04_08.h diff --git a/openbsc/include/openbsc/gsm_04_11.h b/include/openbsc/gsm_04_11.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_11.h rename to include/openbsc/gsm_04_11.h diff --git a/openbsc/include/openbsc/gsm_04_80.h b/include/openbsc/gsm_04_80.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_80.h rename to include/openbsc/gsm_04_80.h diff --git a/openbsc/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h similarity index 100% rename from openbsc/include/openbsc/gsm_data.h rename to include/openbsc/gsm_data.h diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/include/openbsc/gsm_data_shared.h similarity index 100% rename from openbsc/include/openbsc/gsm_data_shared.h rename to include/openbsc/gsm_data_shared.h diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h similarity index 100% rename from openbsc/include/openbsc/gsm_subscriber.h rename to include/openbsc/gsm_subscriber.h diff --git a/openbsc/include/openbsc/gsup_client.h b/include/openbsc/gsup_client.h similarity index 100% rename from openbsc/include/openbsc/gsup_client.h rename to include/openbsc/gsup_client.h diff --git a/openbsc/include/openbsc/gtphub.h b/include/openbsc/gtphub.h similarity index 100% rename from openbsc/include/openbsc/gtphub.h rename to include/openbsc/gtphub.h diff --git a/openbsc/include/openbsc/handover.h b/include/openbsc/handover.h similarity index 100% rename from openbsc/include/openbsc/handover.h rename to include/openbsc/handover.h diff --git a/openbsc/include/openbsc/handover_decision.h b/include/openbsc/handover_decision.h similarity index 100% rename from openbsc/include/openbsc/handover_decision.h rename to include/openbsc/handover_decision.h diff --git a/openbsc/include/openbsc/ipaccess.h b/include/openbsc/ipaccess.h similarity index 100% rename from openbsc/include/openbsc/ipaccess.h rename to include/openbsc/ipaccess.h diff --git a/openbsc/include/openbsc/iu.h b/include/openbsc/iu.h similarity index 100% rename from openbsc/include/openbsc/iu.h rename to include/openbsc/iu.h diff --git a/openbsc/include/openbsc/meas_feed.h b/include/openbsc/meas_feed.h similarity index 100% rename from openbsc/include/openbsc/meas_feed.h rename to include/openbsc/meas_feed.h diff --git a/openbsc/include/openbsc/meas_rep.h b/include/openbsc/meas_rep.h similarity index 100% rename from openbsc/include/openbsc/meas_rep.h rename to include/openbsc/meas_rep.h diff --git a/openbsc/include/openbsc/mgcp.h b/include/openbsc/mgcp.h similarity index 100% rename from openbsc/include/openbsc/mgcp.h rename to include/openbsc/mgcp.h diff --git a/openbsc/include/openbsc/mgcp_internal.h b/include/openbsc/mgcp_internal.h similarity index 100% rename from openbsc/include/openbsc/mgcp_internal.h rename to include/openbsc/mgcp_internal.h diff --git a/openbsc/include/openbsc/mgcp_transcode.h b/include/openbsc/mgcp_transcode.h similarity index 100% rename from openbsc/include/openbsc/mgcp_transcode.h rename to include/openbsc/mgcp_transcode.h diff --git a/openbsc/include/openbsc/misdn.h b/include/openbsc/misdn.h similarity index 100% rename from openbsc/include/openbsc/misdn.h rename to include/openbsc/misdn.h diff --git a/openbsc/include/openbsc/mncc.h b/include/openbsc/mncc.h similarity index 100% rename from openbsc/include/openbsc/mncc.h rename to include/openbsc/mncc.h diff --git a/openbsc/include/openbsc/mncc_int.h b/include/openbsc/mncc_int.h similarity index 100% rename from openbsc/include/openbsc/mncc_int.h rename to include/openbsc/mncc_int.h diff --git a/openbsc/include/openbsc/nat_rewrite_trie.h b/include/openbsc/nat_rewrite_trie.h similarity index 100% rename from openbsc/include/openbsc/nat_rewrite_trie.h rename to include/openbsc/nat_rewrite_trie.h diff --git a/openbsc/include/openbsc/network_listen.h b/include/openbsc/network_listen.h similarity index 100% rename from openbsc/include/openbsc/network_listen.h rename to include/openbsc/network_listen.h diff --git a/openbsc/include/openbsc/oap_client.h b/include/openbsc/oap_client.h similarity index 100% rename from openbsc/include/openbsc/oap_client.h rename to include/openbsc/oap_client.h diff --git a/openbsc/include/openbsc/openbscdefines.h b/include/openbsc/openbscdefines.h similarity index 100% rename from openbsc/include/openbsc/openbscdefines.h rename to include/openbsc/openbscdefines.h diff --git a/openbsc/include/openbsc/osmo_bsc.h b/include/openbsc/osmo_bsc.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc.h rename to include/openbsc/osmo_bsc.h diff --git a/openbsc/include/openbsc/osmo_bsc_grace.h b/include/openbsc/osmo_bsc_grace.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc_grace.h rename to include/openbsc/osmo_bsc_grace.h diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/include/openbsc/osmo_bsc_rf.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc_rf.h rename to include/openbsc/osmo_bsc_rf.h diff --git a/openbsc/include/openbsc/osmo_msc.h b/include/openbsc/osmo_msc.h similarity index 100% rename from openbsc/include/openbsc/osmo_msc.h rename to include/openbsc/osmo_msc.h diff --git a/openbsc/include/openbsc/osmux.h b/include/openbsc/osmux.h similarity index 100% rename from openbsc/include/openbsc/osmux.h rename to include/openbsc/osmux.h diff --git a/openbsc/include/openbsc/paging.h b/include/openbsc/paging.h similarity index 100% rename from openbsc/include/openbsc/paging.h rename to include/openbsc/paging.h diff --git a/openbsc/include/openbsc/pcu_if.h b/include/openbsc/pcu_if.h similarity index 100% rename from openbsc/include/openbsc/pcu_if.h rename to include/openbsc/pcu_if.h diff --git a/openbsc/include/openbsc/pcuif_proto.h b/include/openbsc/pcuif_proto.h similarity index 100% rename from openbsc/include/openbsc/pcuif_proto.h rename to include/openbsc/pcuif_proto.h diff --git a/openbsc/include/openbsc/rest_octets.h b/include/openbsc/rest_octets.h similarity index 100% rename from openbsc/include/openbsc/rest_octets.h rename to include/openbsc/rest_octets.h diff --git a/openbsc/include/openbsc/rrlp.h b/include/openbsc/rrlp.h similarity index 100% rename from openbsc/include/openbsc/rrlp.h rename to include/openbsc/rrlp.h diff --git a/openbsc/include/openbsc/rs232.h b/include/openbsc/rs232.h similarity index 100% rename from openbsc/include/openbsc/rs232.h rename to include/openbsc/rs232.h diff --git a/openbsc/include/openbsc/rtp_proxy.h b/include/openbsc/rtp_proxy.h similarity index 100% rename from openbsc/include/openbsc/rtp_proxy.h rename to include/openbsc/rtp_proxy.h diff --git a/openbsc/include/openbsc/sgsn.h b/include/openbsc/sgsn.h similarity index 100% rename from openbsc/include/openbsc/sgsn.h rename to include/openbsc/sgsn.h diff --git a/openbsc/include/openbsc/signal.h b/include/openbsc/signal.h similarity index 100% rename from openbsc/include/openbsc/signal.h rename to include/openbsc/signal.h diff --git a/openbsc/include/openbsc/silent_call.h b/include/openbsc/silent_call.h similarity index 100% rename from openbsc/include/openbsc/silent_call.h rename to include/openbsc/silent_call.h diff --git a/openbsc/include/openbsc/slhc.h b/include/openbsc/slhc.h similarity index 100% rename from openbsc/include/openbsc/slhc.h rename to include/openbsc/slhc.h diff --git a/openbsc/include/openbsc/smpp.h b/include/openbsc/smpp.h similarity index 100% rename from openbsc/include/openbsc/smpp.h rename to include/openbsc/smpp.h diff --git a/openbsc/include/openbsc/sms_queue.h b/include/openbsc/sms_queue.h similarity index 100% rename from openbsc/include/openbsc/sms_queue.h rename to include/openbsc/sms_queue.h diff --git a/openbsc/include/openbsc/socket.h b/include/openbsc/socket.h similarity index 100% rename from openbsc/include/openbsc/socket.h rename to include/openbsc/socket.h diff --git a/openbsc/include/openbsc/system_information.h b/include/openbsc/system_information.h similarity index 100% rename from openbsc/include/openbsc/system_information.h rename to include/openbsc/system_information.h diff --git a/openbsc/include/openbsc/token_auth.h b/include/openbsc/token_auth.h similarity index 100% rename from openbsc/include/openbsc/token_auth.h rename to include/openbsc/token_auth.h diff --git a/openbsc/include/openbsc/transaction.h b/include/openbsc/transaction.h similarity index 100% rename from openbsc/include/openbsc/transaction.h rename to include/openbsc/transaction.h diff --git a/openbsc/include/openbsc/trau_mux.h b/include/openbsc/trau_mux.h similarity index 100% rename from openbsc/include/openbsc/trau_mux.h rename to include/openbsc/trau_mux.h diff --git a/openbsc/include/openbsc/trau_upqueue.h b/include/openbsc/trau_upqueue.h similarity index 100% rename from openbsc/include/openbsc/trau_upqueue.h rename to include/openbsc/trau_upqueue.h diff --git a/openbsc/include/openbsc/ussd.h b/include/openbsc/ussd.h similarity index 100% rename from openbsc/include/openbsc/ussd.h rename to include/openbsc/ussd.h diff --git a/openbsc/include/openbsc/v42bis.h b/include/openbsc/v42bis.h similarity index 100% rename from openbsc/include/openbsc/v42bis.h rename to include/openbsc/v42bis.h diff --git a/openbsc/include/openbsc/v42bis_private.h b/include/openbsc/v42bis_private.h similarity index 100% rename from openbsc/include/openbsc/v42bis_private.h rename to include/openbsc/v42bis_private.h diff --git a/openbsc/include/openbsc/vty.h b/include/openbsc/vty.h similarity index 100% rename from openbsc/include/openbsc/vty.h rename to include/openbsc/vty.h diff --git a/openbsc/m4/README b/m4/README similarity index 100% rename from openbsc/m4/README rename to m4/README diff --git a/openbsc/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 similarity index 100% rename from openbsc/m4/ax_check_compile_flag.m4 rename to m4/ax_check_compile_flag.m4 diff --git a/openbsc/openbsc.pc.in b/openbsc.pc.in similarity index 100% rename from openbsc/openbsc.pc.in rename to openbsc.pc.in diff --git a/openbsc/osmoappdesc.py b/osmoappdesc.py similarity index 100% rename from openbsc/osmoappdesc.py rename to osmoappdesc.py diff --git a/openbsc/src/Makefile.am b/src/Makefile.am similarity index 100% rename from openbsc/src/Makefile.am rename to src/Makefile.am diff --git a/openbsc/src/gprs/.gitignore b/src/gprs/.gitignore similarity index 100% rename from openbsc/src/gprs/.gitignore rename to src/gprs/.gitignore diff --git a/openbsc/src/gprs/Makefile.am b/src/gprs/Makefile.am similarity index 100% rename from openbsc/src/gprs/Makefile.am rename to src/gprs/Makefile.am diff --git a/openbsc/src/gprs/crc24.c b/src/gprs/crc24.c similarity index 100% rename from openbsc/src/gprs/crc24.c rename to src/gprs/crc24.c diff --git a/openbsc/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c similarity index 100% rename from openbsc/src/gprs/gb_proxy.c rename to src/gprs/gb_proxy.c diff --git a/openbsc/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_main.c rename to src/gprs/gb_proxy_main.c diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_patch.c rename to src/gprs/gb_proxy_patch.c diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_peer.c rename to src/gprs/gb_proxy_peer.c diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/src/gprs/gb_proxy_tlli.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_tlli.c rename to src/gprs/gb_proxy_tlli.c diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_vty.c rename to src/gprs/gb_proxy_vty.c diff --git a/openbsc/src/gprs/gprs_gb_parse.c b/src/gprs/gprs_gb_parse.c similarity index 100% rename from openbsc/src/gprs/gprs_gb_parse.c rename to src/gprs/gprs_gb_parse.c diff --git a/openbsc/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c similarity index 100% rename from openbsc/src/gprs/gprs_gmm.c rename to src/gprs/gprs_gmm.c diff --git a/openbsc/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c similarity index 100% rename from openbsc/src/gprs/gprs_llc.c rename to src/gprs/gprs_llc.c diff --git a/openbsc/src/gprs/gprs_llc_parse.c b/src/gprs/gprs_llc_parse.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_parse.c rename to src/gprs/gprs_llc_parse.c diff --git a/openbsc/src/gprs/gprs_llc_vty.c b/src/gprs/gprs_llc_vty.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_vty.c rename to src/gprs/gprs_llc_vty.c diff --git a/openbsc/src/gprs/gprs_llc_xid.c b/src/gprs/gprs_llc_xid.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_xid.c rename to src/gprs/gprs_llc_xid.c diff --git a/openbsc/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c similarity index 100% rename from openbsc/src/gprs/gprs_sgsn.c rename to src/gprs/gprs_sgsn.c diff --git a/openbsc/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp.c rename to src/gprs/gprs_sndcp.c diff --git a/openbsc/src/gprs/gprs_sndcp_comp.c b/src/gprs/gprs_sndcp_comp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_comp.c rename to src/gprs/gprs_sndcp_comp.c diff --git a/openbsc/src/gprs/gprs_sndcp_dcomp.c b/src/gprs/gprs_sndcp_dcomp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_dcomp.c rename to src/gprs/gprs_sndcp_dcomp.c diff --git a/openbsc/src/gprs/gprs_sndcp_pcomp.c b/src/gprs/gprs_sndcp_pcomp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_pcomp.c rename to src/gprs/gprs_sndcp_pcomp.c diff --git a/openbsc/src/gprs/gprs_sndcp_vty.c b/src/gprs/gprs_sndcp_vty.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_vty.c rename to src/gprs/gprs_sndcp_vty.c diff --git a/openbsc/src/gprs/gprs_sndcp_xid.c b/src/gprs/gprs_sndcp_xid.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_xid.c rename to src/gprs/gprs_sndcp_xid.c diff --git a/openbsc/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c similarity index 100% rename from openbsc/src/gprs/gprs_subscriber.c rename to src/gprs/gprs_subscriber.c diff --git a/openbsc/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c similarity index 100% rename from openbsc/src/gprs/gprs_utils.c rename to src/gprs/gprs_utils.c diff --git a/openbsc/src/gprs/gtphub.c b/src/gprs/gtphub.c similarity index 100% rename from openbsc/src/gprs/gtphub.c rename to src/gprs/gtphub.c diff --git a/openbsc/src/gprs/gtphub_ares.c b/src/gprs/gtphub_ares.c similarity index 100% rename from openbsc/src/gprs/gtphub_ares.c rename to src/gprs/gtphub_ares.c diff --git a/openbsc/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c similarity index 100% rename from openbsc/src/gprs/gtphub_main.c rename to src/gprs/gtphub_main.c diff --git a/openbsc/src/gprs/gtphub_sock.c b/src/gprs/gtphub_sock.c similarity index 100% rename from openbsc/src/gprs/gtphub_sock.c rename to src/gprs/gtphub_sock.c diff --git a/openbsc/src/gprs/gtphub_vty.c b/src/gprs/gtphub_vty.c similarity index 100% rename from openbsc/src/gprs/gtphub_vty.c rename to src/gprs/gtphub_vty.c diff --git a/openbsc/src/gprs/osmo_sgsn.cfg b/src/gprs/osmo_sgsn.cfg similarity index 100% rename from openbsc/src/gprs/osmo_sgsn.cfg rename to src/gprs/osmo_sgsn.cfg diff --git a/openbsc/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c similarity index 100% rename from openbsc/src/gprs/sgsn_ares.c rename to src/gprs/sgsn_ares.c diff --git a/openbsc/src/gprs/sgsn_auth.c b/src/gprs/sgsn_auth.c similarity index 100% rename from openbsc/src/gprs/sgsn_auth.c rename to src/gprs/sgsn_auth.c diff --git a/openbsc/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c similarity index 100% rename from openbsc/src/gprs/sgsn_cdr.c rename to src/gprs/sgsn_cdr.c diff --git a/openbsc/src/gprs/sgsn_ctrl.c b/src/gprs/sgsn_ctrl.c similarity index 100% rename from openbsc/src/gprs/sgsn_ctrl.c rename to src/gprs/sgsn_ctrl.c diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c similarity index 100% rename from openbsc/src/gprs/sgsn_libgtp.c rename to src/gprs/sgsn_libgtp.c diff --git a/openbsc/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c similarity index 100% rename from openbsc/src/gprs/sgsn_main.c rename to src/gprs/sgsn_main.c diff --git a/openbsc/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c similarity index 100% rename from openbsc/src/gprs/sgsn_vty.c rename to src/gprs/sgsn_vty.c diff --git a/openbsc/src/gprs/slhc.c b/src/gprs/slhc.c similarity index 100% rename from openbsc/src/gprs/slhc.c rename to src/gprs/slhc.c diff --git a/openbsc/src/gprs/v42bis.c b/src/gprs/v42bis.c similarity index 100% rename from openbsc/src/gprs/v42bis.c rename to src/gprs/v42bis.c diff --git a/openbsc/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am similarity index 100% rename from openbsc/src/ipaccess/Makefile.am rename to src/ipaccess/Makefile.am diff --git a/openbsc/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c similarity index 100% rename from openbsc/src/ipaccess/abisip-find.c rename to src/ipaccess/abisip-find.c diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-config.c rename to src/ipaccess/ipaccess-config.c diff --git a/openbsc/src/ipaccess/ipaccess-firmware.c b/src/ipaccess/ipaccess-firmware.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-firmware.c rename to src/ipaccess/ipaccess-firmware.c diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-proxy.c rename to src/ipaccess/ipaccess-proxy.c diff --git a/openbsc/src/ipaccess/network_listen.c b/src/ipaccess/network_listen.c similarity index 100% rename from openbsc/src/ipaccess/network_listen.c rename to src/ipaccess/network_listen.c diff --git a/openbsc/src/libbsc/Makefile.am b/src/libbsc/Makefile.am similarity index 100% rename from openbsc/src/libbsc/Makefile.am rename to src/libbsc/Makefile.am diff --git a/openbsc/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c similarity index 100% rename from openbsc/src/libbsc/abis_nm.c rename to src/libbsc/abis_nm.c diff --git a/openbsc/src/libbsc/abis_nm_ipaccess.c b/src/libbsc/abis_nm_ipaccess.c similarity index 100% rename from openbsc/src/libbsc/abis_nm_ipaccess.c rename to src/libbsc/abis_nm_ipaccess.c diff --git a/openbsc/src/libbsc/abis_nm_vty.c b/src/libbsc/abis_nm_vty.c similarity index 100% rename from openbsc/src/libbsc/abis_nm_vty.c rename to src/libbsc/abis_nm_vty.c diff --git a/openbsc/src/libbsc/abis_om2000.c b/src/libbsc/abis_om2000.c similarity index 100% rename from openbsc/src/libbsc/abis_om2000.c rename to src/libbsc/abis_om2000.c diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/src/libbsc/abis_om2000_vty.c similarity index 100% rename from openbsc/src/libbsc/abis_om2000_vty.c rename to src/libbsc/abis_om2000_vty.c diff --git a/openbsc/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c similarity index 100% rename from openbsc/src/libbsc/abis_rsl.c rename to src/libbsc/abis_rsl.c diff --git a/openbsc/src/libbsc/arfcn_range_encode.c b/src/libbsc/arfcn_range_encode.c similarity index 100% rename from openbsc/src/libbsc/arfcn_range_encode.c rename to src/libbsc/arfcn_range_encode.c diff --git a/openbsc/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c similarity index 100% rename from openbsc/src/libbsc/bsc_api.c rename to src/libbsc/bsc_api.c diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c similarity index 100% rename from openbsc/src/libbsc/bsc_ctrl_commands.c rename to src/libbsc/bsc_ctrl_commands.c diff --git a/openbsc/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c similarity index 100% rename from openbsc/src/libbsc/bsc_ctrl_lookup.c rename to src/libbsc/bsc_ctrl_lookup.c diff --git a/openbsc/src/libbsc/bsc_dyn_ts.c b/src/libbsc/bsc_dyn_ts.c similarity index 100% rename from openbsc/src/libbsc/bsc_dyn_ts.c rename to src/libbsc/bsc_dyn_ts.c diff --git a/openbsc/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c similarity index 100% rename from openbsc/src/libbsc/bsc_init.c rename to src/libbsc/bsc_init.c diff --git a/openbsc/src/libbsc/bsc_msc.c b/src/libbsc/bsc_msc.c similarity index 100% rename from openbsc/src/libbsc/bsc_msc.c rename to src/libbsc/bsc_msc.c diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c similarity index 100% rename from openbsc/src/libbsc/bsc_rf_ctrl.c rename to src/libbsc/bsc_rf_ctrl.c diff --git a/openbsc/src/libbsc/bsc_rll.c b/src/libbsc/bsc_rll.c similarity index 100% rename from openbsc/src/libbsc/bsc_rll.c rename to src/libbsc/bsc_rll.c diff --git a/openbsc/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c similarity index 100% rename from openbsc/src/libbsc/bsc_subscriber.c rename to src/libbsc/bsc_subscriber.c diff --git a/openbsc/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c similarity index 100% rename from openbsc/src/libbsc/bsc_vty.c rename to src/libbsc/bsc_vty.c diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/src/libbsc/bts_ericsson_rbs2000.c similarity index 100% rename from openbsc/src/libbsc/bts_ericsson_rbs2000.c rename to src/libbsc/bts_ericsson_rbs2000.c diff --git a/openbsc/src/libbsc/bts_init.c b/src/libbsc/bts_init.c similarity index 100% rename from openbsc/src/libbsc/bts_init.c rename to src/libbsc/bts_init.c diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c similarity index 100% rename from openbsc/src/libbsc/bts_ipaccess_nanobts.c rename to src/libbsc/bts_ipaccess_nanobts.c diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/src/libbsc/bts_ipaccess_nanobts_omlattr.c similarity index 100% rename from openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c rename to src/libbsc/bts_ipaccess_nanobts_omlattr.c diff --git a/openbsc/src/libbsc/bts_nokia_site.c b/src/libbsc/bts_nokia_site.c similarity index 100% rename from openbsc/src/libbsc/bts_nokia_site.c rename to src/libbsc/bts_nokia_site.c diff --git a/openbsc/src/libbsc/bts_siemens_bs11.c b/src/libbsc/bts_siemens_bs11.c similarity index 100% rename from openbsc/src/libbsc/bts_siemens_bs11.c rename to src/libbsc/bts_siemens_bs11.c diff --git a/openbsc/src/libbsc/bts_sysmobts.c b/src/libbsc/bts_sysmobts.c similarity index 100% rename from openbsc/src/libbsc/bts_sysmobts.c rename to src/libbsc/bts_sysmobts.c diff --git a/openbsc/src/libbsc/bts_unknown.c b/src/libbsc/bts_unknown.c similarity index 100% rename from openbsc/src/libbsc/bts_unknown.c rename to src/libbsc/bts_unknown.c diff --git a/openbsc/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c similarity index 100% rename from openbsc/src/libbsc/chan_alloc.c rename to src/libbsc/chan_alloc.c diff --git a/openbsc/src/libbsc/e1_config.c b/src/libbsc/e1_config.c similarity index 100% rename from openbsc/src/libbsc/e1_config.c rename to src/libbsc/e1_config.c diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c similarity index 100% rename from openbsc/src/libbsc/gsm_04_08_utils.c rename to src/libbsc/gsm_04_08_utils.c diff --git a/openbsc/src/libbsc/gsm_04_80_utils.c b/src/libbsc/gsm_04_80_utils.c similarity index 100% rename from openbsc/src/libbsc/gsm_04_80_utils.c rename to src/libbsc/gsm_04_80_utils.c diff --git a/openbsc/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c similarity index 100% rename from openbsc/src/libbsc/handover_decision.c rename to src/libbsc/handover_decision.c diff --git a/openbsc/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c similarity index 100% rename from openbsc/src/libbsc/handover_logic.c rename to src/libbsc/handover_logic.c diff --git a/openbsc/src/libbsc/meas_proc.c b/src/libbsc/meas_proc.c similarity index 100% rename from openbsc/src/libbsc/meas_proc.c rename to src/libbsc/meas_proc.c diff --git a/openbsc/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c similarity index 100% rename from openbsc/src/libbsc/meas_rep.c rename to src/libbsc/meas_rep.c diff --git a/openbsc/src/libbsc/net_init.c b/src/libbsc/net_init.c similarity index 100% rename from openbsc/src/libbsc/net_init.c rename to src/libbsc/net_init.c diff --git a/openbsc/src/libbsc/paging.c b/src/libbsc/paging.c similarity index 100% rename from openbsc/src/libbsc/paging.c rename to src/libbsc/paging.c diff --git a/openbsc/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c similarity index 100% rename from openbsc/src/libbsc/pcu_sock.c rename to src/libbsc/pcu_sock.c diff --git a/openbsc/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c similarity index 100% rename from openbsc/src/libbsc/rest_octets.c rename to src/libbsc/rest_octets.c diff --git a/openbsc/src/libbsc/system_information.c b/src/libbsc/system_information.c similarity index 100% rename from openbsc/src/libbsc/system_information.c rename to src/libbsc/system_information.c diff --git a/openbsc/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am similarity index 100% rename from openbsc/src/libcommon-cs/Makefile.am rename to src/libcommon-cs/Makefile.am diff --git a/openbsc/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c similarity index 100% rename from openbsc/src/libcommon-cs/common_cs.c rename to src/libcommon-cs/common_cs.c diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c similarity index 100% rename from openbsc/src/libcommon-cs/common_cs_vty.c rename to src/libcommon-cs/common_cs_vty.c diff --git a/openbsc/src/libcommon/Makefile.am b/src/libcommon/Makefile.am similarity index 100% rename from openbsc/src/libcommon/Makefile.am rename to src/libcommon/Makefile.am diff --git a/openbsc/src/libcommon/bsc_version.c b/src/libcommon/bsc_version.c similarity index 100% rename from openbsc/src/libcommon/bsc_version.c rename to src/libcommon/bsc_version.c diff --git a/openbsc/src/libcommon/common_vty.c b/src/libcommon/common_vty.c similarity index 100% rename from openbsc/src/libcommon/common_vty.c rename to src/libcommon/common_vty.c diff --git a/openbsc/src/libcommon/debug.c b/src/libcommon/debug.c similarity index 100% rename from openbsc/src/libcommon/debug.c rename to src/libcommon/debug.c diff --git a/openbsc/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c similarity index 100% rename from openbsc/src/libcommon/gsm_data.c rename to src/libcommon/gsm_data.c diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c similarity index 100% rename from openbsc/src/libcommon/gsm_data_shared.c rename to src/libcommon/gsm_data_shared.c diff --git a/openbsc/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c similarity index 100% rename from openbsc/src/libcommon/gsm_subscriber_base.c rename to src/libcommon/gsm_subscriber_base.c diff --git a/openbsc/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c similarity index 100% rename from openbsc/src/libcommon/gsup_client.c rename to src/libcommon/gsup_client.c diff --git a/openbsc/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c similarity index 100% rename from openbsc/src/libcommon/gsup_test_client.c rename to src/libcommon/gsup_test_client.c diff --git a/openbsc/src/libcommon/oap_client.c b/src/libcommon/oap_client.c similarity index 100% rename from openbsc/src/libcommon/oap_client.c rename to src/libcommon/oap_client.c diff --git a/openbsc/src/libcommon/socket.c b/src/libcommon/socket.c similarity index 100% rename from openbsc/src/libcommon/socket.c rename to src/libcommon/socket.c diff --git a/openbsc/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c similarity index 100% rename from openbsc/src/libcommon/talloc_ctx.c rename to src/libcommon/talloc_ctx.c diff --git a/openbsc/src/libfilter/Makefile.am b/src/libfilter/Makefile.am similarity index 100% rename from openbsc/src/libfilter/Makefile.am rename to src/libfilter/Makefile.am diff --git a/openbsc/src/libfilter/bsc_msg_acc.c b/src/libfilter/bsc_msg_acc.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_acc.c rename to src/libfilter/bsc_msg_acc.c diff --git a/openbsc/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_filter.c rename to src/libfilter/bsc_msg_filter.c diff --git a/openbsc/src/libfilter/bsc_msg_vty.c b/src/libfilter/bsc_msg_vty.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_vty.c rename to src/libfilter/bsc_msg_vty.c diff --git a/openbsc/src/libiu/Makefile.am b/src/libiu/Makefile.am similarity index 100% rename from openbsc/src/libiu/Makefile.am rename to src/libiu/Makefile.am diff --git a/openbsc/src/libiu/iu.c b/src/libiu/iu.c similarity index 100% rename from openbsc/src/libiu/iu.c rename to src/libiu/iu.c diff --git a/openbsc/src/libiu/iu_vty.c b/src/libiu/iu_vty.c similarity index 100% rename from openbsc/src/libiu/iu_vty.c rename to src/libiu/iu_vty.c diff --git a/openbsc/src/libmgcp/Makefile.am b/src/libmgcp/Makefile.am similarity index 100% rename from openbsc/src/libmgcp/Makefile.am rename to src/libmgcp/Makefile.am diff --git a/openbsc/src/libmgcp/g711common.h b/src/libmgcp/g711common.h similarity index 100% rename from openbsc/src/libmgcp/g711common.h rename to src/libmgcp/g711common.h diff --git a/openbsc/src/libmgcp/mgcp_network.c b/src/libmgcp/mgcp_network.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_network.c rename to src/libmgcp/mgcp_network.c diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/src/libmgcp/mgcp_osmux.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_osmux.c rename to src/libmgcp/mgcp_osmux.c diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/src/libmgcp/mgcp_protocol.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_protocol.c rename to src/libmgcp/mgcp_protocol.c diff --git a/openbsc/src/libmgcp/mgcp_sdp.c b/src/libmgcp/mgcp_sdp.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_sdp.c rename to src/libmgcp/mgcp_sdp.c diff --git a/openbsc/src/libmgcp/mgcp_transcode.c b/src/libmgcp/mgcp_transcode.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_transcode.c rename to src/libmgcp/mgcp_transcode.c diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/src/libmgcp/mgcp_vty.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_vty.c rename to src/libmgcp/mgcp_vty.c diff --git a/openbsc/src/libmsc/Makefile.am b/src/libmsc/Makefile.am similarity index 100% rename from openbsc/src/libmsc/Makefile.am rename to src/libmsc/Makefile.am diff --git a/openbsc/src/libmsc/auth.c b/src/libmsc/auth.c similarity index 100% rename from openbsc/src/libmsc/auth.c rename to src/libmsc/auth.c diff --git a/openbsc/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c similarity index 100% rename from openbsc/src/libmsc/ctrl_commands.c rename to src/libmsc/ctrl_commands.c diff --git a/openbsc/src/libmsc/db.c b/src/libmsc/db.c similarity index 100% rename from openbsc/src/libmsc/db.c rename to src/libmsc/db.c diff --git a/openbsc/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_08.c rename to src/libmsc/gsm_04_08.c diff --git a/openbsc/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_11.c rename to src/libmsc/gsm_04_11.c diff --git a/openbsc/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_80.c rename to src/libmsc/gsm_04_80.c diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c similarity index 100% rename from openbsc/src/libmsc/gsm_subscriber.c rename to src/libmsc/gsm_subscriber.c diff --git a/openbsc/src/libmsc/meas_feed.c b/src/libmsc/meas_feed.c similarity index 100% rename from openbsc/src/libmsc/meas_feed.c rename to src/libmsc/meas_feed.c diff --git a/openbsc/src/libmsc/meas_feed.h b/src/libmsc/meas_feed.h similarity index 100% rename from openbsc/src/libmsc/meas_feed.h rename to src/libmsc/meas_feed.h diff --git a/openbsc/src/libmsc/mncc.c b/src/libmsc/mncc.c similarity index 100% rename from openbsc/src/libmsc/mncc.c rename to src/libmsc/mncc.c diff --git a/openbsc/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c similarity index 100% rename from openbsc/src/libmsc/mncc_builtin.c rename to src/libmsc/mncc_builtin.c diff --git a/openbsc/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c similarity index 100% rename from openbsc/src/libmsc/mncc_sock.c rename to src/libmsc/mncc_sock.c diff --git a/openbsc/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c similarity index 100% rename from openbsc/src/libmsc/osmo_msc.c rename to src/libmsc/osmo_msc.c diff --git a/openbsc/src/libmsc/rrlp.c b/src/libmsc/rrlp.c similarity index 100% rename from openbsc/src/libmsc/rrlp.c rename to src/libmsc/rrlp.c diff --git a/openbsc/src/libmsc/silent_call.c b/src/libmsc/silent_call.c similarity index 100% rename from openbsc/src/libmsc/silent_call.c rename to src/libmsc/silent_call.c diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c similarity index 100% rename from openbsc/src/libmsc/smpp_openbsc.c rename to src/libmsc/smpp_openbsc.c diff --git a/openbsc/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c similarity index 100% rename from openbsc/src/libmsc/smpp_smsc.c rename to src/libmsc/smpp_smsc.c diff --git a/openbsc/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h similarity index 100% rename from openbsc/src/libmsc/smpp_smsc.h rename to src/libmsc/smpp_smsc.h diff --git a/openbsc/src/libmsc/smpp_utils.c b/src/libmsc/smpp_utils.c similarity index 100% rename from openbsc/src/libmsc/smpp_utils.c rename to src/libmsc/smpp_utils.c diff --git a/openbsc/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c similarity index 100% rename from openbsc/src/libmsc/smpp_vty.c rename to src/libmsc/smpp_vty.c diff --git a/openbsc/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c similarity index 100% rename from openbsc/src/libmsc/sms_queue.c rename to src/libmsc/sms_queue.c diff --git a/openbsc/src/libmsc/token_auth.c b/src/libmsc/token_auth.c similarity index 100% rename from openbsc/src/libmsc/token_auth.c rename to src/libmsc/token_auth.c diff --git a/openbsc/src/libmsc/transaction.c b/src/libmsc/transaction.c similarity index 100% rename from openbsc/src/libmsc/transaction.c rename to src/libmsc/transaction.c diff --git a/openbsc/src/libmsc/ussd.c b/src/libmsc/ussd.c similarity index 100% rename from openbsc/src/libmsc/ussd.c rename to src/libmsc/ussd.c diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c similarity index 100% rename from openbsc/src/libmsc/vty_interface_layer3.c rename to src/libmsc/vty_interface_layer3.c diff --git a/openbsc/src/libtrau/Makefile.am b/src/libtrau/Makefile.am similarity index 100% rename from openbsc/src/libtrau/Makefile.am rename to src/libtrau/Makefile.am diff --git a/openbsc/src/libtrau/rtp_proxy.c b/src/libtrau/rtp_proxy.c similarity index 100% rename from openbsc/src/libtrau/rtp_proxy.c rename to src/libtrau/rtp_proxy.c diff --git a/openbsc/src/libtrau/trau_mux.c b/src/libtrau/trau_mux.c similarity index 100% rename from openbsc/src/libtrau/trau_mux.c rename to src/libtrau/trau_mux.c diff --git a/openbsc/src/libtrau/trau_upqueue.c b/src/libtrau/trau_upqueue.c similarity index 100% rename from openbsc/src/libtrau/trau_upqueue.c rename to src/libtrau/trau_upqueue.c diff --git a/openbsc/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc/Makefile.am rename to src/osmo-bsc/Makefile.am diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_api.c rename to src/osmo-bsc/osmo_bsc_api.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_audio.c rename to src/osmo-bsc/osmo_bsc_audio.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_bssap.c rename to src/osmo-bsc/osmo_bsc_bssap.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_ctrl.c rename to src/osmo-bsc/osmo_bsc_ctrl.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_filter.c rename to src/osmo-bsc/osmo_bsc_filter.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_grace.c rename to src/osmo-bsc/osmo_bsc_grace.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_main.c rename to src/osmo-bsc/osmo_bsc_main.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_msc.c rename to src/osmo-bsc/osmo_bsc_msc.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/src/osmo-bsc/osmo_bsc_sccp.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_sccp.c rename to src/osmo-bsc/osmo_bsc_sccp.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_vty.c rename to src/osmo-bsc/osmo_bsc_vty.c diff --git a/openbsc/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc_mgcp/Makefile.am rename to src/osmo-bsc_mgcp/Makefile.am diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c similarity index 100% rename from openbsc/src/osmo-bsc_mgcp/mgcp_main.c rename to src/osmo-bsc_mgcp/mgcp_main.c diff --git a/openbsc/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc_nat/Makefile.am rename to src/osmo-bsc_nat/Makefile.am diff --git a/openbsc/src/osmo-bsc_nat/bsc_filter.c b/src/osmo-bsc_nat/bsc_filter.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_filter.c rename to src/osmo-bsc_nat/bsc_filter.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c rename to src/osmo-bsc_nat/bsc_mgcp_utils.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat.c rename to src/osmo-bsc_nat/bsc_nat.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/src/osmo-bsc_nat/bsc_nat_ctrl.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c rename to src/osmo-bsc_nat/bsc_nat_ctrl.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c b/src/osmo-bsc_nat/bsc_nat_filter.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_filter.c rename to src/osmo-bsc_nat/bsc_nat_filter.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c b/src/osmo-bsc_nat/bsc_nat_rewrite.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c rename to src/osmo-bsc_nat/bsc_nat_rewrite.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c rename to src/osmo-bsc_nat/bsc_nat_rewrite_trie.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/src/osmo-bsc_nat/bsc_nat_utils.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_utils.c rename to src/osmo-bsc_nat/bsc_nat_utils.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/src/osmo-bsc_nat/bsc_nat_vty.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_vty.c rename to src/osmo-bsc_nat/bsc_nat_vty.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_sccp.c b/src/osmo-bsc_nat/bsc_sccp.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_sccp.c rename to src/osmo-bsc_nat/bsc_sccp.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/src/osmo-bsc_nat/bsc_ussd.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_ussd.c rename to src/osmo-bsc_nat/bsc_ussd.c diff --git a/openbsc/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am similarity index 100% rename from openbsc/src/osmo-nitb/Makefile.am rename to src/osmo-nitb/Makefile.am diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/src/osmo-nitb/bsc_hack.c similarity index 100% rename from openbsc/src/osmo-nitb/bsc_hack.c rename to src/osmo-nitb/bsc_hack.c diff --git a/openbsc/src/utils/Makefile.am b/src/utils/Makefile.am similarity index 100% rename from openbsc/src/utils/Makefile.am rename to src/utils/Makefile.am diff --git a/openbsc/src/utils/bs11_config.c b/src/utils/bs11_config.c similarity index 100% rename from openbsc/src/utils/bs11_config.c rename to src/utils/bs11_config.c diff --git a/openbsc/src/utils/isdnsync.c b/src/utils/isdnsync.c similarity index 100% rename from openbsc/src/utils/isdnsync.c rename to src/utils/isdnsync.c diff --git a/openbsc/src/utils/meas_db.c b/src/utils/meas_db.c similarity index 100% rename from openbsc/src/utils/meas_db.c rename to src/utils/meas_db.c diff --git a/openbsc/src/utils/meas_db.h b/src/utils/meas_db.h similarity index 100% rename from openbsc/src/utils/meas_db.h rename to src/utils/meas_db.h diff --git a/openbsc/src/utils/meas_json.c b/src/utils/meas_json.c similarity index 100% rename from openbsc/src/utils/meas_json.c rename to src/utils/meas_json.c diff --git a/openbsc/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c similarity index 100% rename from openbsc/src/utils/meas_pcap2db.c rename to src/utils/meas_pcap2db.c diff --git a/openbsc/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c similarity index 100% rename from openbsc/src/utils/meas_udp2db.c rename to src/utils/meas_udp2db.c diff --git a/openbsc/src/utils/meas_vis.c b/src/utils/meas_vis.c similarity index 100% rename from openbsc/src/utils/meas_vis.c rename to src/utils/meas_vis.c diff --git a/openbsc/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c similarity index 100% rename from openbsc/src/utils/smpp_mirror.c rename to src/utils/smpp_mirror.c diff --git a/openbsc/tests/Makefile.am b/tests/Makefile.am similarity index 100% rename from openbsc/tests/Makefile.am rename to tests/Makefile.am diff --git a/openbsc/tests/abis/Makefile.am b/tests/abis/Makefile.am similarity index 100% rename from openbsc/tests/abis/Makefile.am rename to tests/abis/Makefile.am diff --git a/openbsc/tests/abis/abis_test.c b/tests/abis/abis_test.c similarity index 100% rename from openbsc/tests/abis/abis_test.c rename to tests/abis/abis_test.c diff --git a/openbsc/tests/abis/abis_test.ok b/tests/abis/abis_test.ok similarity index 100% rename from openbsc/tests/abis/abis_test.ok rename to tests/abis/abis_test.ok diff --git a/openbsc/tests/atlocal.in b/tests/atlocal.in similarity index 100% rename from openbsc/tests/atlocal.in rename to tests/atlocal.in diff --git a/openbsc/tests/bsc-nat-trie/Makefile.am b/tests/bsc-nat-trie/Makefile.am similarity index 100% rename from openbsc/tests/bsc-nat-trie/Makefile.am rename to tests/bsc-nat-trie/Makefile.am diff --git a/openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.c b/tests/bsc-nat-trie/bsc_nat_trie_test.c similarity index 100% rename from openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.c rename to tests/bsc-nat-trie/bsc_nat_trie_test.c diff --git a/openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.ok b/tests/bsc-nat-trie/bsc_nat_trie_test.ok similarity index 100% rename from openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.ok rename to tests/bsc-nat-trie/bsc_nat_trie_test.ok diff --git a/openbsc/tests/bsc-nat-trie/prefixes.csv b/tests/bsc-nat-trie/prefixes.csv similarity index 100% rename from openbsc/tests/bsc-nat-trie/prefixes.csv rename to tests/bsc-nat-trie/prefixes.csv diff --git a/openbsc/tests/bsc-nat/Makefile.am b/tests/bsc-nat/Makefile.am similarity index 100% rename from openbsc/tests/bsc-nat/Makefile.am rename to tests/bsc-nat/Makefile.am diff --git a/openbsc/tests/bsc-nat/barr.cfg b/tests/bsc-nat/barr.cfg similarity index 100% rename from openbsc/tests/bsc-nat/barr.cfg rename to tests/bsc-nat/barr.cfg diff --git a/openbsc/tests/bsc-nat/barr_dup.cfg b/tests/bsc-nat/barr_dup.cfg similarity index 100% rename from openbsc/tests/bsc-nat/barr_dup.cfg rename to tests/bsc-nat/barr_dup.cfg diff --git a/openbsc/tests/bsc-nat/bsc_data.c b/tests/bsc-nat/bsc_data.c similarity index 100% rename from openbsc/tests/bsc-nat/bsc_data.c rename to tests/bsc-nat/bsc_data.c diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/tests/bsc-nat/bsc_nat_test.c similarity index 100% rename from openbsc/tests/bsc-nat/bsc_nat_test.c rename to tests/bsc-nat/bsc_nat_test.c diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.ok b/tests/bsc-nat/bsc_nat_test.ok similarity index 100% rename from openbsc/tests/bsc-nat/bsc_nat_test.ok rename to tests/bsc-nat/bsc_nat_test.ok diff --git a/openbsc/tests/bsc-nat/prefixes.csv b/tests/bsc-nat/prefixes.csv similarity index 100% rename from openbsc/tests/bsc-nat/prefixes.csv rename to tests/bsc-nat/prefixes.csv diff --git a/openbsc/tests/bsc/Makefile.am b/tests/bsc/Makefile.am similarity index 100% rename from openbsc/tests/bsc/Makefile.am rename to tests/bsc/Makefile.am diff --git a/openbsc/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c similarity index 100% rename from openbsc/tests/bsc/bsc_test.c rename to tests/bsc/bsc_test.c diff --git a/openbsc/tests/bsc/bsc_test.ok b/tests/bsc/bsc_test.ok similarity index 100% rename from openbsc/tests/bsc/bsc_test.ok rename to tests/bsc/bsc_test.ok diff --git a/openbsc/tests/channel/Makefile.am b/tests/channel/Makefile.am similarity index 100% rename from openbsc/tests/channel/Makefile.am rename to tests/channel/Makefile.am diff --git a/openbsc/tests/channel/channel_test.c b/tests/channel/channel_test.c similarity index 100% rename from openbsc/tests/channel/channel_test.c rename to tests/channel/channel_test.c diff --git a/openbsc/tests/channel/channel_test.ok b/tests/channel/channel_test.ok similarity index 100% rename from openbsc/tests/channel/channel_test.ok rename to tests/channel/channel_test.ok diff --git a/openbsc/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py similarity index 100% rename from openbsc/tests/ctrl_test_runner.py rename to tests/ctrl_test_runner.py diff --git a/openbsc/tests/db/Makefile.am b/tests/db/Makefile.am similarity index 100% rename from openbsc/tests/db/Makefile.am rename to tests/db/Makefile.am diff --git a/openbsc/tests/db/db_test.c b/tests/db/db_test.c similarity index 100% rename from openbsc/tests/db/db_test.c rename to tests/db/db_test.c diff --git a/openbsc/tests/db/db_test.err b/tests/db/db_test.err similarity index 100% rename from openbsc/tests/db/db_test.err rename to tests/db/db_test.err diff --git a/openbsc/tests/db/db_test.ok b/tests/db/db_test.ok similarity index 100% rename from openbsc/tests/db/db_test.ok rename to tests/db/db_test.ok diff --git a/openbsc/tests/db/hlr.sqlite3 b/tests/db/hlr.sqlite3 similarity index 100% rename from openbsc/tests/db/hlr.sqlite3 rename to tests/db/hlr.sqlite3 Binary files differ diff --git a/openbsc/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am similarity index 100% rename from openbsc/tests/gbproxy/Makefile.am rename to tests/gbproxy/Makefile.am diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c similarity index 100% rename from openbsc/tests/gbproxy/gbproxy_test.c rename to tests/gbproxy/gbproxy_test.c diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/tests/gbproxy/gbproxy_test.ok similarity index 100% rename from openbsc/tests/gbproxy/gbproxy_test.ok rename to tests/gbproxy/gbproxy_test.ok diff --git a/openbsc/tests/gprs/Makefile.am b/tests/gprs/Makefile.am similarity index 100% rename from openbsc/tests/gprs/Makefile.am rename to tests/gprs/Makefile.am diff --git a/openbsc/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c similarity index 100% rename from openbsc/tests/gprs/gprs_test.c rename to tests/gprs/gprs_test.c diff --git a/openbsc/tests/gprs/gprs_test.ok b/tests/gprs/gprs_test.ok similarity index 100% rename from openbsc/tests/gprs/gprs_test.ok rename to tests/gprs/gprs_test.ok diff --git a/openbsc/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am similarity index 100% rename from openbsc/tests/gsm0408/Makefile.am rename to tests/gsm0408/Makefile.am diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c similarity index 100% rename from openbsc/tests/gsm0408/gsm0408_test.c rename to tests/gsm0408/gsm0408_test.c diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok similarity index 100% rename from openbsc/tests/gsm0408/gsm0408_test.ok rename to tests/gsm0408/gsm0408_test.ok diff --git a/openbsc/tests/gtphub/Makefile.am b/tests/gtphub/Makefile.am similarity index 100% rename from openbsc/tests/gtphub/Makefile.am rename to tests/gtphub/Makefile.am diff --git a/openbsc/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c similarity index 100% rename from openbsc/tests/gtphub/gtphub_test.c rename to tests/gtphub/gtphub_test.c diff --git a/openbsc/tests/gtphub/gtphub_test.ok b/tests/gtphub/gtphub_test.ok similarity index 100% rename from openbsc/tests/gtphub/gtphub_test.ok rename to tests/gtphub/gtphub_test.ok diff --git a/openbsc/tests/mgcp/Makefile.am b/tests/mgcp/Makefile.am similarity index 100% rename from openbsc/tests/mgcp/Makefile.am rename to tests/mgcp/Makefile.am diff --git a/openbsc/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c similarity index 100% rename from openbsc/tests/mgcp/mgcp_test.c rename to tests/mgcp/mgcp_test.c diff --git a/openbsc/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok similarity index 100% rename from openbsc/tests/mgcp/mgcp_test.ok rename to tests/mgcp/mgcp_test.ok diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/tests/mgcp/mgcp_transcoding_test.c similarity index 100% rename from openbsc/tests/mgcp/mgcp_transcoding_test.c rename to tests/mgcp/mgcp_transcoding_test.c diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.ok b/tests/mgcp/mgcp_transcoding_test.ok similarity index 100% rename from openbsc/tests/mgcp/mgcp_transcoding_test.ok rename to tests/mgcp/mgcp_transcoding_test.ok diff --git a/openbsc/tests/mm_auth/Makefile.am b/tests/mm_auth/Makefile.am similarity index 100% rename from openbsc/tests/mm_auth/Makefile.am rename to tests/mm_auth/Makefile.am diff --git a/openbsc/tests/mm_auth/mm_auth_test.c b/tests/mm_auth/mm_auth_test.c similarity index 100% rename from openbsc/tests/mm_auth/mm_auth_test.c rename to tests/mm_auth/mm_auth_test.c diff --git a/openbsc/tests/mm_auth/mm_auth_test.ok b/tests/mm_auth/mm_auth_test.ok similarity index 100% rename from openbsc/tests/mm_auth/mm_auth_test.ok rename to tests/mm_auth/mm_auth_test.ok diff --git a/openbsc/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am similarity index 100% rename from openbsc/tests/nanobts_omlattr/Makefile.am rename to tests/nanobts_omlattr/Makefile.am diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c similarity index 100% rename from openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c rename to tests/nanobts_omlattr/nanobts_omlattr_test.c diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/tests/nanobts_omlattr/nanobts_omlattr_test.ok similarity index 100% rename from openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok rename to tests/nanobts_omlattr/nanobts_omlattr_test.ok diff --git a/openbsc/tests/oap/Makefile.am b/tests/oap/Makefile.am similarity index 100% rename from openbsc/tests/oap/Makefile.am rename to tests/oap/Makefile.am diff --git a/openbsc/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c similarity index 100% rename from openbsc/tests/oap/oap_client_test.c rename to tests/oap/oap_client_test.c diff --git a/openbsc/tests/oap/oap_client_test.err b/tests/oap/oap_client_test.err similarity index 100% rename from openbsc/tests/oap/oap_client_test.err rename to tests/oap/oap_client_test.err diff --git a/openbsc/tests/oap/oap_client_test.ok b/tests/oap/oap_client_test.ok similarity index 100% rename from openbsc/tests/oap/oap_client_test.ok rename to tests/oap/oap_client_test.ok diff --git a/openbsc/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am similarity index 100% rename from openbsc/tests/sgsn/Makefile.am rename to tests/sgsn/Makefile.am diff --git a/openbsc/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c similarity index 100% rename from openbsc/tests/sgsn/sgsn_test.c rename to tests/sgsn/sgsn_test.c diff --git a/openbsc/tests/sgsn/sgsn_test.ok b/tests/sgsn/sgsn_test.ok similarity index 100% rename from openbsc/tests/sgsn/sgsn_test.ok rename to tests/sgsn/sgsn_test.ok diff --git a/openbsc/tests/slhc/Makefile.am b/tests/slhc/Makefile.am similarity index 100% rename from openbsc/tests/slhc/Makefile.am rename to tests/slhc/Makefile.am diff --git a/openbsc/tests/slhc/slhc_test.c b/tests/slhc/slhc_test.c similarity index 100% rename from openbsc/tests/slhc/slhc_test.c rename to tests/slhc/slhc_test.c diff --git a/openbsc/tests/slhc/slhc_test.ok b/tests/slhc/slhc_test.ok similarity index 100% rename from openbsc/tests/slhc/slhc_test.ok rename to tests/slhc/slhc_test.ok diff --git a/openbsc/tests/smpp/Makefile.am b/tests/smpp/Makefile.am similarity index 100% rename from openbsc/tests/smpp/Makefile.am rename to tests/smpp/Makefile.am diff --git a/openbsc/tests/smpp/smpp_test.c b/tests/smpp/smpp_test.c similarity index 100% rename from openbsc/tests/smpp/smpp_test.c rename to tests/smpp/smpp_test.c diff --git a/openbsc/tests/smpp/smpp_test.err b/tests/smpp/smpp_test.err similarity index 100% rename from openbsc/tests/smpp/smpp_test.err rename to tests/smpp/smpp_test.err diff --git a/openbsc/tests/smpp/smpp_test.ok b/tests/smpp/smpp_test.ok similarity index 100% rename from openbsc/tests/smpp/smpp_test.ok rename to tests/smpp/smpp_test.ok diff --git a/openbsc/tests/smpp_test_runner.py b/tests/smpp_test_runner.py similarity index 100% rename from openbsc/tests/smpp_test_runner.py rename to tests/smpp_test_runner.py diff --git a/openbsc/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am similarity index 100% rename from openbsc/tests/sndcp_xid/Makefile.am rename to tests/sndcp_xid/Makefile.am diff --git a/openbsc/tests/sndcp_xid/sndcp_xid_test.c b/tests/sndcp_xid/sndcp_xid_test.c similarity index 100% rename from openbsc/tests/sndcp_xid/sndcp_xid_test.c rename to tests/sndcp_xid/sndcp_xid_test.c diff --git a/openbsc/tests/sndcp_xid/sndcp_xid_test.ok b/tests/sndcp_xid/sndcp_xid_test.ok similarity index 100% rename from openbsc/tests/sndcp_xid/sndcp_xid_test.ok rename to tests/sndcp_xid/sndcp_xid_test.ok diff --git a/openbsc/tests/subscr/Makefile.am b/tests/subscr/Makefile.am similarity index 100% rename from openbsc/tests/subscr/Makefile.am rename to tests/subscr/Makefile.am diff --git a/openbsc/tests/subscr/bsc_subscr_test.c b/tests/subscr/bsc_subscr_test.c similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.c rename to tests/subscr/bsc_subscr_test.c diff --git a/openbsc/tests/subscr/bsc_subscr_test.err b/tests/subscr/bsc_subscr_test.err similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.err rename to tests/subscr/bsc_subscr_test.err diff --git a/openbsc/tests/subscr/bsc_subscr_test.ok b/tests/subscr/bsc_subscr_test.ok similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.ok rename to tests/subscr/bsc_subscr_test.ok diff --git a/openbsc/tests/subscr/subscr_test.c b/tests/subscr/subscr_test.c similarity index 100% rename from openbsc/tests/subscr/subscr_test.c rename to tests/subscr/subscr_test.c diff --git a/openbsc/tests/subscr/subscr_test.ok b/tests/subscr/subscr_test.ok similarity index 100% rename from openbsc/tests/subscr/subscr_test.ok rename to tests/subscr/subscr_test.ok diff --git a/openbsc/tests/testsuite.at b/tests/testsuite.at similarity index 100% rename from openbsc/tests/testsuite.at rename to tests/testsuite.at diff --git a/openbsc/tests/trau/Makefile.am b/tests/trau/Makefile.am similarity index 100% rename from openbsc/tests/trau/Makefile.am rename to tests/trau/Makefile.am diff --git a/openbsc/tests/trau/trau_test.c b/tests/trau/trau_test.c similarity index 100% rename from openbsc/tests/trau/trau_test.c rename to tests/trau/trau_test.c diff --git a/openbsc/tests/trau/trau_test.ok b/tests/trau/trau_test.ok similarity index 100% rename from openbsc/tests/trau/trau_test.ok rename to tests/trau/trau_test.ok diff --git a/openbsc/tests/v42bis/Makefile.am b/tests/v42bis/Makefile.am similarity index 100% rename from openbsc/tests/v42bis/Makefile.am rename to tests/v42bis/Makefile.am diff --git a/openbsc/tests/v42bis/v42bis_test.c b/tests/v42bis/v42bis_test.c similarity index 100% rename from openbsc/tests/v42bis/v42bis_test.c rename to tests/v42bis/v42bis_test.c diff --git a/openbsc/tests/v42bis/v42bis_test.ok b/tests/v42bis/v42bis_test.ok similarity index 100% rename from openbsc/tests/v42bis/v42bis_test.ok rename to tests/v42bis/v42bis_test.ok diff --git a/openbsc/tests/vty_test_runner.py b/tests/vty_test_runner.py similarity index 100% rename from openbsc/tests/vty_test_runner.py rename to tests/vty_test_runner.py diff --git a/openbsc/tests/xid/Makefile.am b/tests/xid/Makefile.am similarity index 100% rename from openbsc/tests/xid/Makefile.am rename to tests/xid/Makefile.am diff --git a/openbsc/tests/xid/xid_test.c b/tests/xid/xid_test.c similarity index 100% rename from openbsc/tests/xid/xid_test.c rename to tests/xid/xid_test.c diff --git a/openbsc/tests/xid/xid_test.ok b/tests/xid/xid_test.ok similarity index 100% rename from openbsc/tests/xid/xid_test.ok rename to tests/xid/xid_test.ok diff --git a/openbsc/tools/hlrstat.pl b/tools/hlrstat.pl similarity index 100% rename from openbsc/tools/hlrstat.pl rename to tools/hlrstat.pl -- To view, visit https://gerrit.osmocom.org/3188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:43:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 21:43:52 +0000 Subject: [PATCH] osmo-msc[master]: jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' Message-ID: Review at https://gerrit.osmocom.org/3221 jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' We are building with libosmo-sccp tag 'old_sua' until the new sigtran has been applied. Since osmo-iuh commit 0f88c110093935305143987638e46dc6db304a3e "migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA" osmo-iuh requires libosmo-sccp master. A similar 'old_sua' tag is in place in osmo-iuh.git, to match libosmo-sccp 'old_sua'. Do that to fix the jenkins build of --enable-iu. Change-Id: I70f731db0b74ed48ae6dd713ed4c3247222ef0de --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/21/3221/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 0021947..068ee34 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -19,6 +19,7 @@ if [ "x$IU" = "x--enable-iu" ]; then sccp_branch="old_sua" + osmo_iuh_branch="old_sua" fi osmo-build-dep.sh libosmo-abis @@ -30,7 +31,7 @@ if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh + osmo-build-dep.sh osmo-iuh $osmo_iuh_branch fi set +x -- To view, visit https://gerrit.osmocom.org/3221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70f731db0b74ed48ae6dd713ed4c3247222ef0de Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:43:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 21:43:52 +0000 Subject: [PATCH] osmo-msc[master]: jenkins: apply rename to osmo-msc in log marker Message-ID: Review at https://gerrit.osmocom.org/3222 jenkins: apply rename to osmo-msc in log marker Change-Id: I8ca9a1a8bdb5b9615df5f19f0c1017cb9383f6ee --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/22/3222/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b315b97..6650b5d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -38,7 +38,7 @@ echo echo echo -echo " =============================== openbsc ===============================" +echo " =============================== osmo-msc ===============================" echo set -x -- To view, visit https://gerrit.osmocom.org/3222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ca9a1a8bdb5b9615df5f19f0c1017cb9383f6ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:51 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Initial commit of virt-phy to work with osmo-bts v... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Initial commit of virt-phy to work with osmo-bts virt-phy. ...................................................................... VIRT-PHY: Initial commit of virt-phy to work with osmo-bts virt-phy. This patch implements a virtual physical layer replacing the air interface. The purpose is to get rid of the hardware requirements and be able to start testing and implementing layer 2 communication functionality on one machine. Multicast sockets are used to enable bidirectional communication between the BTS and the MS process. The GSMTAP protocol designed for wireshark capturing is used to encapsulate the payload on the virtual physical layer. The virtual physical layer on the osmocom-bb side implements the L1CTL interface to the layer23 apps like mobile. * Working mcast socket communication and extraction of its functionality. * Basic handlers for file descriptor callbacks from incoming L1CTL messages and extraction of that functionality to a l1ctl socket class. * Multiplexing to different routines depending on incoming L1CTL message type. * Uses virt_um and osmocom_mcast_sock implementation from osmo-bts virt-phy. * Ecapsulation and parsing methods to and from GSMTAP messages. * Basic handlers for file descriptor callbacks from incoming mcast messages on the virtual um. * Multiplexing to different channel routines based on GSMTAP header channel type. * Example configuration for l23 app mobile using virtual test sim. Change-Id: I203c8ec58326e52a09603a37232fce7ae3641415 --- A .gitignore M src/Makefile A src/host/virt_phy/.gitignore A src/host/virt_phy/Makefile.am A src/host/virt_phy/README A src/host/virt_phy/configure.ac A src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg A src/host/virt_phy/include/layer1/mframe_sched.h A src/host/virt_phy/include/layer1/sync.h A src/host/virt_phy/include/layer1/tdma_sched.h A src/host/virt_phy/src/Makefile.am A src/host/virt_phy/src/gsmtapl1_if.c A src/host/virt_phy/src/gsmtapl1_if.h A src/host/virt_phy/src/l1ctl_sap.c A src/host/virt_phy/src/l1ctl_sap.h A src/host/virt_phy/src/l1ctl_sock.c A src/host/virt_phy/src/l1ctl_sock.h A src/host/virt_phy/src/logging.c A src/host/virt_phy/src/logging.h A src/host/virt_phy/src/osmo_mcast_sock.c A src/host/virt_phy/src/osmo_mcast_sock.h A src/host/virt_phy/src/virt_l1_model.c A src/host/virt_phy/src/virt_l1_model.h A src/host/virt_phy/src/virtphy.c A src/host/virt_phy/src/virtual_um.c A src/host/virt_phy/src/virtual_um.h 26 files changed, 2,515 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..363f656 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +*.o +*.a +Makefile.in +Makefile +.deps + +build-target +aclocal.m4 +autom4te.cache +config.log +config.status +config.guess +config.sub +configure +compile +depcomp +install-sh +missing +stamp-h1 +core +core.* + +# Backups, vi, merges +*~ +*.sw? +*.orig +*.sav + +# development environment +/.autotools +/.cproject +/.project +/.settings/ + diff --git a/src/Makefile b/src/Makefile index 00231a6..e83175c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,7 +12,8 @@ TOPDIR=$(shell pwd) all: libosmocore-target nofirmware firmware mtk-firmware -nofirmware: layer23 osmocon gsmmap + +nofirmware: layer23 osmocon gsmmap virtphy libosmocore-target: shared/libosmocore/build-target/src/.libs/libosmocore.a @@ -45,6 +46,15 @@ host/osmocon/osmocon: host/osmocon/Makefile make -C host/osmocon +.PHONY: virtphy +virtphy: host/virt_phy/Makefile + cd host/virt_phy && make + +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) .PHONY: gsmmap gsmmap: host/gsmmap/gsmmap @@ -86,6 +96,7 @@ make -C host/layer23 $@ make -C host/osmocon $@ make -C host/gsmmap $@ + make -C host/virt_phy $@ make -C target/firmware $@ make -C target/firmware -f Makefile.mtk $@ @@ -94,5 +105,6 @@ make -C host/layer23 $@ make -C host/osmocon $@ make -C host/gsmmap $@ + make -C host/virt_phy $@ # 'firmware' also handles 'mtk-firmware' make -C target/firmware $@ diff --git a/src/host/virt_phy/.gitignore b/src/host/virt_phy/.gitignore new file mode 100644 index 0000000..1e19c7f --- /dev/null +++ b/src/host/virt_phy/.gitignore @@ -0,0 +1,3 @@ +config.h +config.h.in +src/virtphy \ No newline at end of file diff --git a/src/host/virt_phy/Makefile.am b/src/host/virt_phy/Makefile.am new file mode 100644 index 0000000..515d51b --- /dev/null +++ b/src/host/virt_phy/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src +dist_doc_DATA = README \ No newline at end of file diff --git a/src/host/virt_phy/README b/src/host/virt_phy/README new file mode 100644 index 0000000..a780664 --- /dev/null +++ b/src/host/virt_phy/README @@ -0,0 +1,2 @@ +This is the package for the Osmocom virtual physical layer. +A layer 1 implementation satisfying the L1CTL interface towards the l23 application (e.g. mobile). \ No newline at end of file diff --git a/src/host/virt_phy/configure.ac b/src/host/virt_phy/configure.ac new file mode 100644 index 0000000..bcdbf91 --- /dev/null +++ b/src/host/virt_phy/configure.ac @@ -0,0 +1,27 @@ +dnl Process this file with autoconf to produce a configure script +AC_INIT([virtphy], 0.0.0) +AM_CONFIG_HEADER([config.h]) +AM_INIT_AUTOMAKE([foreign dist-bzip2]) + +dnl kernel style compile messages +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +dnl checks for programs +AC_PROG_MAKE_SET +AC_PROG_CC +AC_PROG_INSTALL + +dnl checks for libraries +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm) + +dnl checks for header files +AC_HEADER_STDC + +dnl Checks for typedefs, structures and compiler characteristics + +AC_CONFIG_FILES([ + Makefile + src/Makefile +]) +AC_OUTPUT diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg new file mode 100644 index 0000000..382a09d --- /dev/null +++ b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg @@ -0,0 +1,67 @@ +! +! OsmocomBB (0.0.0) configuration saved from vty +!! +! +line vty + no login +! +gps device /dev/ttyACM0 +gps baudrate default +no gps enable +! +no hide-default +! +ms 1 + layer2-socket /tmp/osmocom_l2 + sap-socket /tmp/osmocom_sap + sim test + network-selection-mode auto + imei 123456789012345 0 + imei-fixed + no emergency-imsi + no sms-service-center + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + no gsm-850 + dcs + no pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + exit + test-sim + imsi 901700000000403 + ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + no barred-access + no rplmn + hplmn-search foreign-country + exit + no shutdown +exit +! diff --git a/src/host/virt_phy/include/layer1/mframe_sched.h b/src/host/virt_phy/include/layer1/mframe_sched.h new file mode 100644 index 0000000..ecdb1ec --- /dev/null +++ b/src/host/virt_phy/include/layer1/mframe_sched.h @@ -0,0 +1,68 @@ +#ifndef _L1_MFRAME_SCHED_H +#define _L1_MFRAME_SCHED_H + +#include + +enum mframe_task { + MF_TASK_BCCH_NORM, + MF_TASK_BCCH_EXT, + MF_TASK_CCCH, + MF_TASK_CCCH_COMB, + + MF_TASK_SDCCH4_0, + MF_TASK_SDCCH4_1, + MF_TASK_SDCCH4_2, + MF_TASK_SDCCH4_3, + + MF_TASK_SDCCH8_0, + MF_TASK_SDCCH8_1, + MF_TASK_SDCCH8_2, + MF_TASK_SDCCH8_3, + MF_TASK_SDCCH8_4, + MF_TASK_SDCCH8_5, + MF_TASK_SDCCH8_6, + MF_TASK_SDCCH8_7, + + MF_TASK_TCH_F_EVEN, + MF_TASK_TCH_F_ODD, + MF_TASK_TCH_H_0, + MF_TASK_TCH_H_1, + + MF_TASK_NEIGH_PM51_C0T0, + MF_TASK_NEIGH_PM51, + MF_TASK_NEIGH_PM26E, + MF_TASK_NEIGH_PM26O, + + /* Test task: send Normal Burst in all timeslots */ + MF_TASK_UL_ALL_NB, +}; + +enum mf_sched_item_flag { + MF_F_SACCH = (1 << 0), +}; + +/* The scheduler itself */ +struct mframe_scheduler { + uint32_t tasks; + uint32_t tasks_tgt; + uint32_t safe_fn; +}; + +uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t ts); + +/* Enable a specific task */ +void mframe_enable(enum mframe_task task_id); + +/* Disable a specific task */ +void mframe_disable(enum mframe_task task_id); + +/* Replace the current active set by the new one */ +void mframe_set(uint32_t tasks); + +/* Schedule mframe_sched_items according to current MF TASK list */ +void mframe_schedule(void); + +/* reset the scheduler, disabling all tasks */ +void mframe_reset(void); + +#endif /* _MFRAME_SCHED_H */ diff --git a/src/host/virt_phy/include/layer1/sync.h b/src/host/virt_phy/include/layer1/sync.h new file mode 100644 index 0000000..dae85a1 --- /dev/null +++ b/src/host/virt_phy/include/layer1/sync.h @@ -0,0 +1,204 @@ +#ifndef _L1_SYNC_H +#define _L1_SYNC_H + +#include +#include +#include +#include +#include + +/* structure representing L1 sync information about a cell */ +struct l1_cell_info { + /* on which ARFCN (+band) is the cell? */ + uint16_t arfcn; + /* what's the BSIC of the cell (from SCH burst decoding) */ + uint8_t bsic; + /* Combined or non-combined CCCH */ + uint8_t ccch_mode; /* enum ccch_mode */ + /* whats the delta of the cells current GSM frame number + * compared to our current local frame number */ + int32_t fn_offset; + /* how much does the TPU need adjustment (delta) to synchronize + * with the cells burst */ + uint32_t time_alignment; + /* FIXME: should we also store the AFC value? */ +}; + +enum l1s_chan { + L1S_CHAN_MAIN, + L1S_CHAN_SACCH, + L1S_CHAN_TRAFFIC, + _NUM_L1S_CHAN +}; + +enum l1_compl { + L1_COMPL_FB, + L1_COMPL_RACH, + L1_COMPL_TX_NB, + L1_COMPL_TX_TCH, +}; + +typedef void l1_compl_cb(enum l1_compl c); + +#define L1S_NUM_COMPL 32 +#define L1S_NUM_NEIGH_CELL 6 + +struct l1s_h0 { + uint16_t arfcn; +}; + +struct l1s_h1 { + uint8_t hsn; + uint8_t maio; + uint8_t n; + uint16_t ma[64]; +}; + +struct l1s_state { + struct gsm_time current_time; /* current GSM time */ + struct gsm_time next_time; /* GSM time at next TMDMA irq */ + + /* the cell on which we are camping right now */ + struct l1_cell_info serving_cell; + + /* neighbor cell sync info */ + struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; + + /* TDMA scheduler */ + struct tdma_scheduler tdma_sched; + + /* Multiframe scheduler */ + struct mframe_scheduler mframe_sched; + + /* The current TPU offset register */ + uint32_t tpu_offset; + int32_t tpu_offset_correction; + + /* TX parameters */ + int8_t ta; + uint8_t tx_power; + + /* TCH */ + uint8_t tch_mode; + uint8_t tch_sync; + uint8_t audio_mode; + + /* Transmit queues of pending packets for main DCCH and ACCH */ + struct llist_head tx_queue[_NUM_L1S_CHAN]; + struct msgb *tx_meas; + + /* Which L1A completions are scheduled right now */ + uint32_t scheduled_compl; + /* callbacks for each of the completions */ + l1_compl_cb *completion[L1S_NUM_COMPL]; + + /* Structures below are for L1-task specific parameters, used + * to communicate between l1-sync and l1-async (l23_api) */ + struct { + uint8_t mode; /* FB_MODE 0/1 */ + } fb; + + struct { + /* power measurement l1 task */ + unsigned int mode; + union { + struct { + uint16_t arfcn_start; + uint16_t arfcn_next; + uint16_t arfcn_end; + } range; + }; + struct msgb *msg; + } pm; + + struct { + uint8_t ra; + } rach; + + struct { + enum { + GSM_DCHAN_NONE = 0, + GSM_DCHAN_SDCCH_4, + GSM_DCHAN_SDCCH_8, + GSM_DCHAN_TCH_H, + GSM_DCHAN_TCH_F, + GSM_DCHAN_UNKNOWN, + } type; + + uint8_t scn; + uint8_t tsc; + uint8_t tn; + uint8_t h; + + union { + struct l1s_h0 h0; + struct l1s_h1 h1; + }; + + uint8_t st_tsc; + uint8_t st_tn; + uint8_t st_h; + + union { + struct l1s_h0 st_h0; + struct l1s_h1 st_h1; + }; + } dedicated; + + /* neighbour cell power measurement process */ + struct { + uint8_t n, second; + uint8_t pos; + uint8_t running; + uint16_t band_arfcn[64]; + uint8_t tn[64]; + uint8_t level[64]; + } neigh_pm; +}; + +extern struct l1s_state l1s; + +struct l1s_meas_hdr { + uint16_t snr; /* signal/noise ratio */ + int16_t toa_qbit; /* time of arrival (qbits) */ + int16_t pm_dbm8; /* power level in dbm/8 */ + int16_t freq_err; /* Frequency error in Hz */ +}; + +int16_t l1s_snr_int(uint16_t snr); +uint16_t l1s_snr_fract(uint16_t snr); + +void l1s_dsp_abort(void); + +void l1s_tx_apc_helper(uint16_t arfcn); + +/* schedule a completion */ +void l1s_compl_sched(enum l1_compl c); + +void l1s_init(void); + +/* reset the layer1 as part of synchronizing to a new cell */ +void l1s_reset(void); + +/* init.c */ +void layer1_init(void); + +/* A debug macro to print every TDMA frame */ +#ifdef DEBUG_EVERY_TDMA +#define putchart(x) putchar(x) +#else +#define putchart(x) +#endif + +/* Convert an angle in fx1.15 notatinon into Hz */ +#define BITFREQ_DIV_2PI 43104 /* 270kHz / 2 * pi */ +#define BITFREQ_DIV_PI 86208 /* 270kHz / pi */ +#define ANG2FREQ_SCALING (2<<15) /* 2^15 scaling factor for fx1.15 */ +#define ANGLE_TO_FREQ(angle) ((int16_t)angle * BITFREQ_DIV_PI / ANG2FREQ_SCALING) + +void l1s_reset_hw(void); +void synchronize_tdma(struct l1_cell_info *cinfo); +void l1s_time_inc(struct gsm_time *time, uint32_t delta_fn); +void l1s_time_dump(const struct gsm_time *time); + +#endif /* _L1_SYNC_H */ diff --git a/src/host/virt_phy/include/layer1/tdma_sched.h b/src/host/virt_phy/include/layer1/tdma_sched.h new file mode 100644 index 0000000..f58d59b --- /dev/null +++ b/src/host/virt_phy/include/layer1/tdma_sched.h @@ -0,0 +1,73 @@ +#ifndef _L1_TDMA_SCHED_H +#define _L1_TDMA_SCHED_H + +#include + +/* TDMA scheduler */ + +/* The idea of this scheduler is that we have a circular buffer of buckets, + * where each bucket corresponds to one future TDMA frame [interrupt]. Each + * bucket contains of a list of callbacks which are executed when the bucket + * index reaches that particular bucket. */ + +#define TDMASCHED_NUM_FRAMES 25 +#define TDMASCHED_NUM_CB 8 + +#define TDMA_IFLG_TPU (1<<0) +#define TDMA_IFLG_DSP (1<<1) + +typedef int tdma_sched_cb(uint8_t p1, uint8_t p2, uint16_t p3); + +/* A single item in a TDMA scheduler bucket */ +struct tdma_sched_item { + tdma_sched_cb *cb; + uint8_t p1; + uint8_t p2; + uint16_t p3; + int16_t prio; + uint16_t flags; /* TDMA_IFLG_xxx */ +}; + +/* A bucket inside the TDMA scheduler */ +struct tdma_sched_bucket { + struct tdma_sched_item item[TDMASCHED_NUM_CB]; + uint8_t num_items; +}; + +/* The scheduler itself, consisting of buckets and a current index */ +struct tdma_scheduler { + struct tdma_sched_bucket bucket[TDMASCHED_NUM_FRAMES]; + uint8_t cur_bucket; +}; + +/* Schedule an item at 'frame_offset' TDMA frames in the future */ +int tdma_schedule(uint8_t frame_offset, tdma_sched_cb *cb, + uint8_t p1, uint8_t p2, uint16_t p3, int16_t prio); + +/* Schedule a set of items starting from 'frame_offset' TDMA frames in the future */ +int tdma_schedule_set(uint8_t frame_offset, const struct tdma_sched_item *item_set, uint16_t p3); + +/* Scan current frame scheduled items for flags */ +uint16_t tdma_sched_flag_scan(void); + +/* Execute pre-scheduled events for current frame */ +int tdma_sched_execute(void); + +/* Advance TDMA scheduler to the next bucket */ +void tdma_sched_advance(void); + +/* reset the scheduler; erase all scheduled items */ +void tdma_sched_reset(void); + +/* debug function: print number of entries of all TDMA buckets */ +void tdma_sched_dump(void); + + +extern int tdma_end_set(uint8_t p1, uint8_t p2, uint16_t p3); +#define SCHED_ITEM(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, .flags = 0 } +#define SCHED_ITEM_DT(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, \ + .flags = TDMA_IFLG_TPU | TDMA_IFLG_DSP } +#define SCHED_END_FRAME() { .cb = NULL, .p1 = 0, .p2 = 0 } +#define SCHED_END_SET() { .cb = &tdma_end_set, .p1 = 0, .p2 = 0 } + +#endif /* _L1_TDMA_SCHED_H */ diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am new file mode 100644 index 0000000..a110435 --- /dev/null +++ b/src/host/virt_phy/src/Makefile.am @@ -0,0 +1,19 @@ +OSMOCOM_DIR = /home/basti/Osmocom +OSMO_BB_DIR = $(OSMOCOM_DIR)/osmocom-bb +OSMO_BTS_DIR = $(OSMOCOM_DIR)/osmo-bts +OPENBSC_DIR = $(OSMOCOM_DIR)/openbsc + +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OSMO_BB_DIR)/include -I$(OSMO_BTS_DIR)/include -I$(OPENBSC_DIR)/openbsc/include -I$(OSMO_BB_DIR)/src/host/layer23/include +# TODO: somehow this include path causes errors, thus the needed files are copied into $(top_srcdir)/include. Would be better to include directly from $(OSMO_BB_DIR)/src/target/firmware/include to avoid redundancy. +# -I$(OSMO_BB_DIR)/src/target/firmware/include + +CFLAGS = -g -O0 + +sbin_PROGRAMS = virtphy +virtphy_SOURCES = virtphy.c l1ctl_sock.c l1ctl_sap.c gsmtapl1_if.c logging.c virt_l1_model.c virtual_um.c osmo_mcast_sock.c +virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +# debug output +all: + $(info $$AM_CPPFLAGS is [${AM_CPPFLAGS}]) diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c new file mode 100644 index 0000000..11214cf --- /dev/null +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -0,0 +1,282 @@ +/* GSMTAP layer1 is transmits gsmtap messages over a virtual layer 1.*/ + +/* (C) 2016 Sebastian Stumpf + * + * 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 "virtual_um.h" +#include "l1ctl_sock.h" +#include "virt_l1_model.h" +#include "l1ctl_sap.h" +#include "gsmtapl1_if.h" +#include "logging.h" + +static struct l1_model_ms *l1_model_ms = NULL; + +// for debugging +static const struct value_string gsmtap_channels [22] = { + { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, + { GSMTAP_CHANNEL_BCCH, "BCCH" }, + { GSMTAP_CHANNEL_CCCH, "CCCH" }, + { GSMTAP_CHANNEL_RACH, "RACH" }, + { GSMTAP_CHANNEL_AGCH, "AGCH" }, + { GSMTAP_CHANNEL_PCH, "PCH" }, + { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, + { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, + { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, + { GSMTAP_CHANNEL_TCH_F, "FACCH/F" }, + { GSMTAP_CHANNEL_TCH_H, "FACCH/H" }, + { GSMTAP_CHANNEL_PACCH, "PACCH" }, + { GSMTAP_CHANNEL_CBCH52, "CBCH" }, + { GSMTAP_CHANNEL_PDCH, "PDCH" }, + { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, + { GSMTAP_CHANNEL_CBCH51, "CBCH" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_SDCCH, "LSACCH" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, + { GSMTAP_CHANNEL_ACCH| + GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, + { 0, NULL }, +}; +// for debugging +static const struct value_string gsmtap_types [10] = { + { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, + { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, + { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, + { GSMTAP_TYPE_SIM, "SIM" }, + { GSMTAP_TYPE_TETRA_I1, "TETRA V+D"}, + { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, + { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)" }, + { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, + { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, + { 0, NULL }, +}; + +void gsmtapl1_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} + +/** + * Append a gsmtap header to msg and send it over the virt um. + */ +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg) +{ + struct l1ctl_hdr *l1hdr = (struct l1ctl_hdr *)msg->l1h; + struct l1ctl_info_dl *l1dl = (struct l1ctl_info_dl *)msg->data; + uint8_t ss = 0; + uint8_t gsmtap_chan; + struct msgb *outmsg; + + switch (l1hdr->msg_type) { + case L1CTL_DATA_REQ: + // TODO: check what data request and set gsmtap_chan depending on that + gsmtap_chan = 0; + break; + } + outmsg = gsmtap_makemsg(l1dl->band_arfcn, l1dl->chan_nr, gsmtap_chan, + ss, l1dl->frame_nr, 0, 0, msgb_l2(msg), + msgb_l2len(msg)); + if (outmsg) { + struct gsmtap_hdr *gh = (struct gsmtap_hdr *)outmsg->l1h; + virt_um_write_msg(vui, outmsg); + DEBUGP(DVIRPHY, + "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, gh->timeslot, + gh->sub_slot); + } else { + LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); + } + + /* free message */ + msgb_free(msg); +} + +/** + * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, struct msgb *msg). + */ +void gsmtapl1_tx_to_virt_um(struct msgb *msg) +{ + gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, msg); +} + +/* This is the header as it is used by gsmtap peer virtual layer 1. +struct gsmtap_hdr { + guint8 version; // version, set to 0x01 currently + guint8 hdr_len; // length in number of 32bit words + guint8 type; // see GSMTAP_TYPE_* + guint8 timeslot; // timeslot (0..7 on Um) + guint16 arfcn; // ARFCN (frequency) + gint8 signal_dbm; // signal level in dBm + gint8 snr_db; // signal/noise ratio in dB + guint32 frame_number; // GSM Frame Number (FN) + guint8 sub_type; // Type of burst/channel, see above + guint8 antenna_nr; // Antenna Number + guint8 sub_slot; // sub-slot within timeslot + guint8 res; // reserved for future use (RFU) +} + */ + +/** + * Receive a gsmtap message from the virt um. + */ +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, + struct msgb *msg) +{ + if (msg) { + struct gsmtap_hdr *gh; + struct l1ctl_info_dl *l1dl; + struct msgb *l1ctl_msg = NULL; + struct l1ctl_data_ind * l1di; + + msg->l1h = msgb_data(msg); + msg->l2h = msgb_pull(msg, sizeof(*gh)); + gh = msgb_l1(msg); + + DEBUGP(DVIRPHY, + "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u)\n", + ntohs(gh->arfcn), ntohl(gh->frame_number), get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gh->sub_type), gh->timeslot, + gh->sub_slot); + + // compose the l1ctl message for layer 2 + switch (gh->sub_type) { + case GSMTAP_CHANNEL_RACH: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + break; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + // TODO: implement channel handling + break; + case GSMTAP_CHANNEL_TCH_F: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); + // TODO: implement channel handling + break; + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); + l1di = (struct l1ctl_data_ind *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_data_ind)); + + l1dl->band_arfcn = htons(ntohs(gh->arfcn)); + l1dl->link_id = gh->timeslot; + // see GSM 8.58 -> 9.3.1 for channel number encoding + l1dl->chan_nr = rsl_enc_chan_nr(chantype_gsmtap2rsl(gh->sub_type), gh->sub_slot, gh->timeslot); + l1dl->frame_nr = htonl(ntohl(gh->frame_number)); + l1dl->snr = gh->snr_db; + l1dl->rx_level = gh->signal_dbm; + l1dl->num_biterr = 0; + l1dl->fire_crc = 0; + + memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); + + break; + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_TCH_H: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + break; + default: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + break; + } + + /* forward l1ctl message to l2 */ + if(l1ctl_msg) { + l1ctl_sap_tx_to_l23(l1ctl_msg); + } + + // handle memory deallocation + talloc_free(msg); + } +} + +/** + * @see void gsmtapl1_rx_from_virt_um_cb(struct virt_um_inst *vui, struct msgb msg). + */ +void gsmtapl1_rx_from_virt_um(struct msgb *msg) +{ + gsmtapl1_rx_from_virt_um_inst_cb(l1_model_ms->vui, msg); +} + +/*! \brief convert GSMTAP channel type to RSL channel number + * \param[in] rsl_chantype RSL channel type + * \param[in] link_id RSL link identifier + * \returns GSMTAP channel type + */ +uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype) +{ + // TODO: proper retval for unknown channel + uint8_t ret = 0; + + switch (gsmtap_chantype) { + case GSMTAP_CHANNEL_TCH_F: + ret = RSL_CHAN_Bm_ACCHs; + break; + case GSMTAP_CHANNEL_TCH_H: + ret = RSL_CHAN_Lm_ACCHs; + break; + case GSMTAP_CHANNEL_SDCCH4: + ret = RSL_CHAN_SDCCH4_ACCH; + break; + case GSMTAP_CHANNEL_SDCCH8: + ret = RSL_CHAN_SDCCH8_ACCH; + break; + case GSMTAP_CHANNEL_BCCH: + ret = RSL_CHAN_BCCH; + break; + case GSMTAP_CHANNEL_RACH: + ret = RSL_CHAN_RACH; + break; + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_AGCH: + ret = RSL_CHAN_PCH_AGCH; + break; + } + + // TODO: check how to handle this... +// if (link_id & 0x40) +// ret |= GSMTAP_CHANNEL_ACCH; + + return ret; +} diff --git a/src/host/virt_phy/src/gsmtapl1_if.h b/src/host/virt_phy/src/gsmtapl1_if.h new file mode 100644 index 0000000..8c7491c --- /dev/null +++ b/src/host/virt_phy/src/gsmtapl1_if.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +#include "l1ctl_sock.h" +#include "virtual_um.h" +#include "virt_l1_model.h" + +void gsmtapl1_init(struct l1_model_ms *model); + +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_rx_from_virt_um(struct msgb *msg); + +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_tx_to_virt_um(struct msgb *msg); + +uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c new file mode 100644 index 0000000..46121ed --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -0,0 +1,833 @@ +/* L1CTL SAP implementation. */ + +#include +#include +#include +#include +#include +#include + +#include "virtual_um.h" +#include "l1ctl_sock.h" +#include "virt_l1_model.h" +#include "l1ctl_sap.h" +#include "logging.h" + +static struct l1_model_ms *l1_model_ms = NULL; + +/** + * @brief Init the SAP. + */ +void l1ctl_sap_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} + +/** + * @brief L1CTL handler called for received messages from L23. + * + * Enqueues the message into the rx queue. + */ +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) +{ + if (msg) { + DEBUGP(DL1C, "Message incoming from layer 2: %s\n", + osmo_hexdump(msg->data, msg->len)); + l1ctl_sap_handler(msg); + } +} +/** + * @see l1ctl_sap_rx_from_l23_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg). + */ +void l1ctl_sap_rx_from_l23(struct msgb *msg) +{ + l1ctl_sap_rx_from_l23_inst_cb(l1_model_ms->lsi, msg); +} + +/** + * @brief Send a l1ctl message to layer 23. + * + * This will forward the message as it is to the upper layer. + */ +void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg) +{ + uint16_t *len; + /* prepend 16bit length before sending */ + len = (uint16_t *) msgb_push(msg, sizeof(*len)); + *len = htons(msg->len - sizeof(*len)); + + if(l1ctl_sock_write_msg(lsi, msg) == -1 ) { + //DEBUGP(DL1C, "Error writing to layer2 socket"); + } +} + +/** + * @see void l1ctl_sap_tx_to_l23(struct l1ctl_sock_inst *lsi, struct msgb *msg). + */ +void l1ctl_sap_tx_to_l23(struct msgb *msg) +{ + l1ctl_sap_tx_to_l23_inst(l1_model_ms->lsi, msg); +} + +/** + * @brief Allocates a msgb with set l1ctl header and room for a l3 header. + * + * @param [in] msg_type L1CTL primitive message type set to l1ctl_hdr. + * @return the allocated message. + * + * The message looks as follows: + * # headers + * [l1ctl_hdr] : initialized. msgb->l1h points here + * [spare-bytes] : L3_MSG_HEAD bytes reserved for l3 header + * # data + * [spare-bytes] : L3_MSG_DATA bytes reserved for data. msgb->tail points here. msgb->data points here. + */ +struct msgb *l1ctl_msgb_alloc(uint8_t msg_type) +{ + struct msgb *msg; + struct l1ctl_hdr *l1h; + msg = msgb_alloc_headroom(L3_MSG_SIZE, L3_MSG_HEAD, "l1ctl"); + if (!msg) { + while (1) { + puts("OOPS. Out of buffers...\n"); + } + + return NULL; + } + l1h = (struct l1ctl_hdr *)msgb_put(msg, sizeof(*l1h)); + l1h->msg_type = msg_type; + l1h->flags = 0; + + msg->l1h = (uint8_t *)l1h; + + return msg; +} + +/** + * @brief Allocates a msgb with set l1ctl header and room for a l3 header and puts l1ctl_info_dl to the msgb data. + * + * @param [in] msg_type L1CTL primitive message type set to l1ctl_hdr. + * @param [in] fn framenumber put into l1ctl_info_dl. + * @param [in] snr time slot number put into l1ctl_info_dl. + * @param [in] arfcn arfcn put into l1ctl_info_dl. + * @return the allocated message. + * + * The message looks as follows: + * # headers + * [l1ctl_hdr] : initialized. msgb->l1h points here + * [spare-bytes] : L3_MSG_HEAD bytes reserved for l3 header + * # data + * [l1ctl_info_dl] : initialized with params. msgb->data points here. + * [spare-bytes] : L3_MSG_DATA bytes reserved for data. msgb->tail points here. + */ +struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, + uint16_t arfcn) +{ + struct l1ctl_info_dl *dl; + struct msgb *msg = l1ctl_msgb_alloc(msg_type); + + dl = (struct l1ctl_info_dl *)msgb_put(msg, sizeof(*dl)); + dl->frame_nr = htonl(fn); + dl->snr = snr; + dl->band_arfcn = htons(arfcn); + + return msg; +} + +/** + * @brief General handler for incoming L1CTL messages from layer 2/3. + * + * This handler will dequeue the rx queue (if !empty) and call the specific routine for the dequeued l1ctl message. + * + */ +void l1ctl_sap_handler(struct msgb *msg) +{ +// struct msgb *msg; + struct l1ctl_hdr *l1h; + unsigned long flags; + + if (!msg) + return; + + l1h = (struct l1ctl_hdr *)msg->data; + + if (sizeof(*l1h) > msg->len) { + LOGP(DL1C, LOGL_NOTICE, "Short message. %u\n", msg->len); + goto exit_msgbfree; + } + + switch (l1h->msg_type) { + case L1CTL_FBSB_REQ: + l1ctl_rx_fbsb_req(msg); + break; + case L1CTL_DM_EST_REQ: + l1ctl_rx_dm_est_req(msg); + break; + case L1CTL_DM_REL_REQ: + l1ctl_rx_dm_rel_req(msg); + break; + case L1CTL_PARAM_REQ: + l1ctl_rx_param_req(msg); + break; + case L1CTL_DM_FREQ_REQ: + l1ctl_rx_dm_freq_req(msg); + break; + case L1CTL_CRYPTO_REQ: + l1ctl_rx_crypto_req(msg); + break; + case L1CTL_RACH_REQ: + l1ctl_rx_rach_req(msg); + break; + case L1CTL_DATA_REQ: + l1ctl_rx_data_req(msg); + /* we have to keep the msgb, not free it! */ + goto exit_nofree; + case L1CTL_PM_REQ: + l1ctl_rx_pm_req(msg); + break; + case L1CTL_RESET_REQ: + l1ctl_rx_reset_req(msg); + break; + case L1CTL_CCCH_MODE_REQ: + l1ctl_rx_ccch_mode_req(msg); + break; + case L1CTL_TCH_MODE_REQ: + l1ctl_rx_tch_mode_req(msg); + break; + case L1CTL_NEIGH_PM_REQ: + l1ctl_rx_neigh_pm_req(msg); + break; + case L1CTL_TRAFFIC_REQ: + l1ctl_rx_traffic_req(msg); + /* we have to keep the msgb, not free it! */ + goto exit_nofree; + case L1CTL_SIM_REQ: + l1ctl_rx_sim_req(msg); + break; + } + + exit_msgbfree: msgb_free(msg); + exit_nofree: return; +} + +/*************************************************************** + * L1CTL RX ROUTINES ******************************************* + ***************************************************************/ + +/** + * @brief Handler for received L1CTL_FBSB_REQ from L23. + * + * -- frequency burst synchronisation burst request -- + * + * @param [in] msg the received message. + * + * Transmit frequency control and synchronisation bursts on FCCH and SCH to calibrate transceiver and search for base stations. + * Sync to a given arfcn. + * + * Note: Not needed for virtual physical layer. + * TODO: Could be used to bind/connect to different virtual_bts sockets with a arfcn-socket mapping. + */ +void l1ctl_rx_fbsb_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + ntohs(sync_req->band_arfcn), sync_req->flags); + + l1ctl_tx_fbsb_conf(0, ntohs(sync_req->band_arfcn)); +} + +/** + * @brief Handler for received L1CTL_DM_EST_REQ from L23. + * + * -- dedicated mode established request -- + * + * @param [in] msg the received message. + * + * Handle state change from idle to dedicated mode. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_dm_est_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_dm_est_req *est_req = + (struct l1ctl_dm_est_req *)ul->payload; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_DM_EST_REQ (arfcn=%u, chan_nr=0x%02x, tsc=%u)\n", + ntohs(est_req->h0.band_arfcn), ul->chan_nr, + est_req->tsc); + +// /* disable neighbour cell measurement of C0 TS 0 */ +// mframe_disable(MF_TASK_NEIGH_PM51_C0T0); +// +// /* configure dedicated channel state */ +// l1s.dedicated.type = chan_nr2dchan_type(ul->chan_nr); +// l1s.dedicated.tsc = est_req->tsc; +// l1s.dedicated.tn = ul->chan_nr & 0x7; +// l1s.dedicated.h = est_req->h; +// +// if (est_req->h) { +// int i; +// l1s.dedicated.h1.hsn = est_req->h1.hsn; +// l1s.dedicated.h1.maio = est_req->h1.maio; +// l1s.dedicated.h1.n = est_req->h1.n; +// for (i=0; ih1.n; i++) +// l1s.dedicated.h1.ma[i] = ntohs(est_req->h1.ma[i]); +// } else { +// l1s.dedicated.h0.arfcn = ntohs(est_req->h0.band_arfcn); +// } +// +// /* TCH config */ +// if (chan_nr_is_tch(ul->chan_nr)) { +// /* Mode */ +// l1a_tch_mode_set(est_req->tch_mode); +// l1a_audio_mode_set(est_req->audio_mode); +// +// /* Sync */ +// l1s.tch_sync = 1; /* can be set without locking */ +// +// /* Audio path */ +// audio_set_enabled(est_req->tch_mode, est_req->audio_mode); +// } +// +// /* figure out which MF tasks to enable */ +// l1a_mftask_set(chan_nr2mf_task_mask(ul->chan_nr, NEIGH_MODE_PM)); +} + +/** + * @brief Handler for received L1CTL_DM_FREQ_REQ from L23. + * + * -- dedicated mode frequency request -- + * + * @param [in] msg the received message. + * + * Handle frequency change in dedicated mode. E.g. used for frequency hopping. + * + * Note: Not needed for virtual physical layer. + */ +void l1ctl_rx_dm_freq_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_dm_freq_req *freq_req = + (struct l1ctl_dm_freq_req *)ul->payload; + + DEBUGP(DL1C, + "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn=%u, tsc=%u)\n", + ntohs(freq_req->h0.band_arfcn), freq_req->tsc); +} + +/** + * @brief Handler for received L1CTL_CRYPTO_REQ from L23. + * + * -- cryptographic request -- + * + * @param [in] msg the received message. + * + * Configure the key and algorithm used for cryptographic operations in the DSP (Digital Signal Processor). + * + * Note: in the virtual physical layer the cryptographic operations are not handled in the DSP. + * + * TODO: Implement cryptographic operations for virtual um! + * TODO: Implement this handler routine! + */ +void l1ctl_rx_crypto_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *)ul->payload; + uint8_t key_len = msg->len - sizeof(*l1h) - sizeof(*ul) - sizeof(*cr); + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", + cr->algo, key_len); + +// if (cr->algo && key_len != 8) { +// DEBUGP(DL1C, "L1CTL_CRYPTO_REQ -> Invalid key\n"); +// return; +// } +// +// dsp_load_ciph_param(cr->algo, cr->key); +} + +/** + * @brief Handler for received L1CTL_DM_REL_REQ from L23. + * + * -- dedicated mode release request -- + * + * @param [in] msg the received message. + * + * Handle state change from dedicated to idle mode. Flush message buffers of dedicated channel. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_dm_rel_req(struct msgb *msg) +{ +// struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + + DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_DM_REL_REQ\n"); +// l1a_mftask_set(0); +// l1s.dedicated.type = GSM_DCHAN_NONE; +// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_MAIN]); +// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_SACCH]); +// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); +// l1a_meas_msgb_set(NULL); +// dsp_load_ciph_param(0, NULL); +// l1a_tch_mode_set(GSM48_CMODE_SIGN); +// audio_set_enabled(GSM48_CMODE_SIGN, 0); +// l1s.neigh_pm.n = 0; +} + +/** + * @brief Handler for received L1CTL_PARAM_REQ from L23. + * + * -- parameter request -- + * + * @param [in] msg the received message. + * + * Configure transceiver parameters timing advance value and sending power. + * + * Note: Not needed for virtual physical layer. + */ +void l1ctl_rx_param_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_par_req *par_req = (struct l1ctl_par_req *)ul->payload; + + DEBUGP(DL1C, + "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", + par_req->ta, par_req->tx_power); +} + +/** + * @brief Handler for received L1CTL_RACH_REQ from L23. + * + * -- random access channel request -- + * + * @param [in] msg the received message. + * + * Transmit RACH request on RACH. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_rach_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + rach_req->ra, ntohs(rach_req->offset), + rach_req->combined); + +// l1a_rach_req(ntohs(rach_req->offset), rach_req->combined, +// rach_req->ra); +} + +/** + * @brief Handler for received L1CTL_DATA_REQ from L23. + * + * -- data request -- + * + * @param [in] msg the received message. + * + * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_data_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; + struct llist_head *tx_queue; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x)\n", + ul->link_id); + +// msg->l3h = data_ind->data; +// if (ul->link_id & 0x40) { +// struct gsm48_hdr *gh = (struct gsm48_hdr *)(data_ind->data + 5); +// if (gh->proto_discr == GSM48_PDISC_RR +// && gh->msg_type == GSM48_MT_RR_MEAS_REP) { +// DEBUGP(DL1C, "updating measurement report\n"); +// l1a_meas_msgb_set(msg); +// return; +// } +// tx_queue = &l1s.tx_queue[L1S_CHAN_SACCH]; +// } else +// tx_queue = &l1s.tx_queue[L1S_CHAN_MAIN]; +// +// DEBUGP(DL1C, "ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p\n", +// ul, ul->payload, data_ind, data_ind->data, msg->l3h); +// +// l1a_txq_msgb_enq(tx_queue, msg); +} + +/** + * @brief Handler for received L1CTL_PM_REQ from L23. + * + * -- power measurement request -- + * + * @param [in] msg the received message. + * + * Process power measurement for a given range of arfcns to calculate signal power and connection quality. + * + * Note: We do not need to calculate that for the virtual physical layer, but l23 apps can expect a response. So this response is mocked here. + */ +void l1ctl_rx_pm_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *)l1h->data; + struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + uint16_t arfcn_next; + // convert to host order + pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); + pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); + + DEBUGP(DL1C, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); + + for(arfcn_next = pm_req->range.band_arfcn_from; arfcn_next <= pm_req->range.band_arfcn_to; ++arfcn_next) { + struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *)msgb_put(resp_msg, sizeof(*pm_conf)); + pm_conf->band_arfcn = htons(arfcn_next); + // rxlev 63 is great, 0 is bad the two values are probably min and max + pm_conf->pm[0] = 63; + pm_conf->pm[1] = 63; + if(arfcn_next == pm_req->range.band_arfcn_to) { + struct l1ctl_hdr *resp_l1h = resp_msg->l1h; + resp_l1h->flags |= L1CTL_F_DONE; + } + // no more space in msgb, flush to l2 + if(msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { + l1ctl_sap_tx_to_l23(resp_msg); + resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + } + } + if(resp_msg) { + l1ctl_sap_tx_to_l23(resp_msg); + } +} + +/** + * @brief Handler for received L1CTL_RESET_REQ from L23. + * + * -- reset request -- + * + * @param [in] msg the received message. + * + * Reset layer 1 (state machine, scheduler, transceiver) depending on the reset type. + * + */ +void l1ctl_rx_reset_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_reset *reset_req = (struct l1ctl_reset *)l1h->data; + + switch (reset_req->type) { + case L1CTL_RES_T_FULL: + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); +// l1s_reset(); +// l1s_reset_hw(); +// audio_set_enabled(GSM48_CMODE_SIGN, 0); + l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + break; + case L1CTL_RES_T_SCHED: + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); +// sched_gsmtime_reset(); + l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + break; + default: + LOGP(DL1C, LOGL_ERROR, + "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + break; + } +} + +/** + * @brief Handler for received L1CTL_CCCH_MODE_REQ from L23. + * + * -- common control channel mode request -- + * + * @param [in] msg the received message. + * + * Configure CCCH combined / non-combined mode. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_ccch_mode_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_ccch_mode_req *ccch_mode_req = + (struct l1ctl_ccch_mode_req *)l1h->data; + uint8_t ccch_mode = ccch_mode_req->ccch_mode; + + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); + + l1_model_ms->state->serving_cell.ccch_mode = ccch_mode; + + // check if more has to be done here + + l1ctl_tx_ccch_mode_conf(ccch_mode); + +// /* pre-set the CCCH mode */ +// l1s.serving_cell.ccch_mode = ccch_mode; +// +// /* Update task */ +// mframe_disable(MF_TASK_CCCH_COMB); +// mframe_disable(MF_TASK_CCCH); +// +// if (ccch_mode == CCCH_MODE_COMBINED) +// mframe_enable(MF_TASK_CCCH_COMB); +// else if (ccch_mode == CCCH_MODE_NON_COMBINED) +// mframe_enable(MF_TASK_CCCH); +// +// l1ctl_tx_ccch_mode_conf(ccch_mode); +} + +/** + * @brief Handler for received L1CTL_TCH_MODE_REQ from L23. + * + * -- traffic channel mode request -- + * + * @param [in] msg the received message. + * + * Configure TCH mode and audio mode. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_tch_mode_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_tch_mode_req *tch_mode_req = + (struct l1ctl_tch_mode_req *)l1h->data; + uint8_t tch_mode = tch_mode_req->tch_mode; + uint8_t audio_mode = tch_mode_req->audio_mode; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", + tch_mode, audio_mode); +// tch_mode = l1a_tch_mode_set(tch_mode); +// audio_mode = l1a_audio_mode_set(audio_mode); +// +// audio_set_enabled(tch_mode, audio_mode); +// +// l1s.tch_sync = 1; /* Needed for audio to work */ +// +// l1ctl_tx_tch_mode_conf(tch_mode, audio_mode); +} + +/** + * @brief Handler for received L1CTL_NEIGH_PM_REQ from L23. + * + * -- neighbor power measurement request -- + * + * @param [in] msg the received message. + * + * Update the maintained list of neighbor cells used in neighbor cell power measurement. + * The neighbor cell description is one of the info messages sent by the BTS on BCCH. + * This method will also enable neighbor measurement in the multiframe scheduler. + * + * Note: Not needed for virtual physical layer. + */ +void l1ctl_rx_neigh_pm_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_neigh_pm_req *pm_req = + (struct l1ctl_neigh_pm_req *)l1h->data; + + DEBUGP(DL1C, + "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", + pm_req->n); +} + +/** + * @brief Handler for received L1CTL_TRAFFIC_REQ from L23. + * + * -- traffic request -- + * + * @param [in] msg the received message. + * + * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. + * Will drop the traffic frame at queue sizes >= 4. + * + * TODO: Implement this handler routine! + */ +void l1ctl_rx_traffic_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; + int num = 0; + + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + +// msg->l2h = tr->data; + +// num = l1a_txq_msgb_count(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); +// if (num >= 4) { +// DEBUGP(DL1C, "dropping traffic frame\n"); +// msgb_free(msg); +// return; +// } +// +// l1a_txq_msgb_enq(&l1s.tx_queue[L1S_CHAN_TRAFFIC], msg); +} + +/** + * @brief Handler for received L1CTL_SIM_REQ from L23. + * + * -- sim request -- + * + * @param [in] msg the received message. + * + * Forward and a sim request to the SIM APDU. + * + * Note: Not needed for virtual layer. Please configure layer23 application to use test-sim implementation. + * ms + * -------- + * sim test + * test-sim + * imsi + * ki comp128 + * -------- + */ +void l1ctl_rx_sim_req(struct msgb *msg) +{ + uint16_t len = msg->len - sizeof(struct l1ctl_hdr); + uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); + + DEBUGP(DL1C, + "Received and ignored from l23 - SIM Request length: %u, data: %s: ", + len, osmo_hexdump(data, sizeof(data))); + +} + +/*************************************************************** + * L1CTL TX ROUTINES ******************************************* + ***************************************************************/ + +/** + * @brief Transmit L1CTL_RESET_IND or L1CTL_RESET_CONF to layer 23. + * + * -- reset indication / confirm -- + * + * @param [in] msg_type L1CTL primitive message type. + * @param [in] reset_type reset type (full, boot or just scheduler reset). + */ +void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type) +{ + struct msgb *msg = l1ctl_msgb_alloc(msg_type); + struct l1ctl_reset *reset_resp; + reset_resp = (struct l1ctl_reset *)msgb_put(msg, sizeof(*reset_resp)); + reset_resp->type = reset_type; + + DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", + getL1ctlPrimName(msg_type), reset_type); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL msg of a given type to layer 23. + * + * @param [in] msg_type L1CTL primitive message type. + */ +void l1ctl_tx_msg(uint8_t msg_type) +{ + struct msgb *msg = l1ctl_msgb_alloc(msg_type); + DEBUGP(DL1C, "Sending to l23 - %s\n", getL1ctlPrimName(msg_type)); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL_FBSB_CONF to l23. + * + * -- frequency burst synchronisation burst confirm -- + * + * @param [in] res 0 -> success, 255 -> error. + * @param [in] arfcn the arfcn we are synced to. + * + * No calculation needed for virtual pyh -> uses default values for a good link quality. + */ +void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) +{ + struct msgb *msg; + struct l1ctl_fbsb_conf *resp; + uint32_t fn = 0; // 0 should be okay here + uint16_t snr = 40; // signal noise ratio > 40db is best signal. + int16_t initial_freq_err = 0; // 0 means no error. + uint8_t bsic = 0; + + msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, + snr, + arfcn); + + resp = (struct l1ctl_fbsb_conf *) msgb_put(msg, sizeof(*resp)); + resp->initial_freq_err = htons(initial_freq_err); + resp->result = res; + resp->bsic = bsic; + + DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", + getL1ctlPrimName(L1CTL_FBSB_CONF), res); + + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL_CCCH_MODE_CONF to layer 23. + * + * -- common control channel mode confirm -- + * + * @param [in] ccch_mode the new configured ccch mode. Combined or non-combined, see l1ctl_proto. + * + * Called by layer 1 to inform layer 2 that the ccch mode was successfully changed. + */ +void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode) +{ + struct msgb *msg = l1ctl_msgb_alloc(L1CTL_CCCH_MODE_CONF); + struct l1ctl_ccch_mode_conf *mode_conf; + mode_conf = (struct l1ctl_ccch_mode_conf *)msgb_put(msg, + sizeof(*mode_conf)); + mode_conf->ccch_mode = ccch_mode; + + DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", + ccch_mode); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Transmit L1CTL_TCH_MODE_CONF to layer 23. + * + * -- traffic channel mode confirm -- + * + * @param [in] tch_mode the new configured traffic channel mode, see gsm48_chan_mode in gsm_04_08.h. + * @param [in] audio_mode the new configured audio mode(s), see l1ctl_tch_mode_req in l1ctl_proto.h. + * + * Called by layer 1 to inform layer 23 that the traffic channel mode was successfully changed. + */ +void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode) +{ + struct msgb *msg = l1ctl_msgb_alloc(L1CTL_TCH_MODE_CONF); + struct l1ctl_tch_mode_conf *mode_conf; + mode_conf = (struct l1ctl_tch_mode_conf *)msgb_put(msg, + sizeof(*mode_conf)); + mode_conf->tch_mode = tch_mode; + mode_conf->audio_mode = audio_mode; + + DEBUGP(DL1C, + "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, + audio_mode); + l1ctl_sap_tx_to_l23(msg); +} + + diff --git a/src/host/virt_phy/src/l1ctl_sap.h b/src/host/virt_phy/src/l1ctl_sap.h new file mode 100644 index 0000000..2d67128 --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sap.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include + +#include "l1ctl_sock.h" +#include "virtual_um.h" +#include "virt_l1_model.h" + +/* following sizes are used for message allocation */ +/* size of layer 3 header */ +#define L3_MSG_HEAD 4 +/* size of layer 3 payload */ +#define L3_MSG_DATA 200 +#define L3_MSG_SIZE (sizeof(struct l1ctl_hdr) + L3_MSG_HEAD + L3_MSG_DATA) + +void l1ctl_sap_init(struct l1_model_ms *model); +void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); +void l1ctl_sap_tx_to_l23(struct msgb *msg); +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg); +void l1ctl_sap_rx_from_l23(struct msgb *msg); +void l1ctl_sap_handler(struct msgb *msg); + +/* utility methods */ +struct msgb *l1ctl_msgb_alloc(uint8_t msg_type); +struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, + uint16_t arfcn); + +/* receive routines */ +void l1ctl_rx_fbsb_req(struct msgb *msg); +void l1ctl_rx_dm_est_req(struct msgb *msg); +void l1ctl_rx_dm_rel_req(struct msgb *msg); +void l1ctl_rx_param_req(struct msgb *msg); +void l1ctl_rx_dm_freq_req(struct msgb *msg); +void l1ctl_rx_crypto_req(struct msgb *msg); +void l1ctl_rx_rach_req(struct msgb *msg); +void l1ctl_rx_data_req(struct msgb *msg); +void l1ctl_rx_pm_req(struct msgb *msg); +void l1ctl_rx_reset_req(struct msgb *msg); +void l1ctl_rx_ccch_mode_req(struct msgb *msg); +void l1ctl_rx_tch_mode_req(struct msgb *msg); +void l1ctl_rx_neigh_pm_req(struct msgb *msg); +void l1ctl_rx_traffic_req(struct msgb *msg); +void l1ctl_rx_sim_req(struct msgb *msg); + +/* transmit routines */ +void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type); +void l1ctl_tx_pm_conf(struct l1ctl_pm_req *pm_req); +void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn); +void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); +void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode); +void l1ctl_tx_msg(uint8_t msg_type); diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c new file mode 100644 index 0000000..e52b731 --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -0,0 +1,197 @@ +/* Socket based Layer1 <-> Layer23 communication over L1CTL primitives. */ + +/* (C) 2016 Sebastian Stumpf + * + * 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 + +#include + +#include "l1ctl_sock.h" +#include "virtual_um.h" +#include "logging.h" + +#define L1CTL_SOCK_MSGB_SIZE 256 + +/** + * @brief L1CTL socket file descriptor callback function. + * + * @param ofd The osmocom file descriptor. + * @param what Indicates if the fd has a read, write or exception request. See select.h. + * + * Will be called by osmo_select_main() if data on fd is pending. + */ +static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct l1ctl_sock_inst *lsi = ofd->data; + int cnt = 0; + // Check if request is really read request + if (what & BSC_FD_READ) { + struct msgb *msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, + "L1CTL sock rx"); + int rc; + uint16_t len; + + // read length of the message first and convert to host byte order + rc = read(ofd->fd, &len, sizeof(len)); + if (rc < sizeof(len)) { + goto ERR; + } + // convert to host byte order + len = ntohs(len); + if (len <= 0 || len > L1CTL_SOCK_MSGB_SIZE) { + goto ERR; + } + rc = read(ofd->fd, msgb_data(msg), len); + + if (rc == len) { + msgb_put(msg, rc); + msg->l1h = msgb_data(msg); + lsi->recv_cb(lsi, msg); + return 0; + } +ERR: + perror("Failed to receive msg from l2. Connection will be closed.\n"); + l1ctl_sock_disconnect(lsi); + } + return 0; + +} + +static int l1ctl_sock_accept_cb(struct osmo_fd *ofd, unsigned int what) +{ + + struct l1ctl_sock_inst *lsi = ofd->data; + struct sockaddr_un local_addr; + socklen_t addr_len = sizeof(struct sockaddr_in); + int fd; + + fd = accept(ofd->fd, (struct sockaddr *)&local_addr, &addr_len); + if (fd < 0) { + fprintf(stderr, "Failed to accept connection to l2.\n"); + return -1; + } + + lsi->connection.fd = fd; + lsi->connection.when = BSC_FD_READ; + lsi->connection.cb = l1ctl_sock_data_cb; + lsi->connection.data = lsi; + + if (osmo_fd_register(&lsi->connection) != 0) { + fprintf(stderr, "Failed to register the l2 connection fd.\n"); + return -1; + } + return 0; +} + +struct l1ctl_sock_inst *l1ctl_sock_init( + void *ctx, + void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + char *path) +{ + struct l1ctl_sock_inst *lsi; + struct sockaddr_un local_addr; + int fd, rc; + + if (!path) + path = L1CTL_SOCK_PATH; + + if ((fd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) { + fprintf(stderr, "Failed to create Unix Domain Socket.\n"); + return NULL; + } + + local_addr.sun_family = AF_LOCAL; + strcpy(local_addr.sun_path, path); + unlink(local_addr.sun_path); + + if ((rc = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) + != 0) { + fprintf(stderr, "Failed to bind the unix domain socket. '%s'\n", + local_addr.sun_path); + return NULL; + } + + if (listen(fd, 0) != 0) { + fprintf(stderr, "Failed to listen.\n"); + return NULL; + } + + lsi = talloc_zero(ctx, struct l1ctl_sock_inst); + lsi->priv = NULL; + lsi->recv_cb = recv_cb; + lsi->ofd.data = lsi; + lsi->ofd.fd = fd; + lsi->ofd.when = BSC_FD_READ; + lsi->ofd.cb = l1ctl_sock_accept_cb; + // no connection -> invalid filedescriptor and not 0 (==std_in) + lsi->connection.fd = -1; + + osmo_fd_register(&lsi->ofd); + + return lsi; +} + +void l1ctl_sock_destroy(struct l1ctl_sock_inst *lsi) +{ + struct osmo_fd *ofd = &lsi->ofd; + + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; + + talloc_free(lsi); +} + +void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi) +{ + struct osmo_fd *ofd = &lsi->connection; + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; +} + +int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg) +{ + int rc; + rc = write(lsi->connection.fd, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + return rc; +} diff --git a/src/host/virt_phy/src/l1ctl_sock.h b/src/host/virt_phy/src/l1ctl_sock.h new file mode 100644 index 0000000..ef9799c --- /dev/null +++ b/src/host/virt_phy/src/l1ctl_sock.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include + +#define L1CTL_SOCK_PATH "/tmp/osmocom_l2" + +/* L1CTL socket instance contains socket data. */ +struct l1ctl_sock_inst { + void *priv; /* Will be appended after osmo-fd's data pointer. */ + struct osmo_fd connection; /* L1CTL connection to l2 app */ + struct osmo_fd ofd; /* Osmocom file descriptor to accept L1CTL connections. */ + void (*recv_cb)(struct l1ctl_sock_inst *vui, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ +}; + +/** + * @brief Initialise the l1ctl socket for communication with l2 apps. + */ +struct l1ctl_sock_inst *l1ctl_sock_init( + void *ctx, + void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + char *path); + +/** + * @brief Transmit message to l2. + */ +int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg); + +/** + * @brief Destroy instance. + */ +void l1ctl_sock_destroy(); + +/** + * @brief Disconnect current connection. + */ +void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi); diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c new file mode 100644 index 0000000..a017a52 --- /dev/null +++ b/src/host/virt_phy/src/logging.c @@ -0,0 +1,113 @@ +/* Logging/Debug support of the virtual physical layer */ + +/* (C) 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 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 "logging.h" + +const char* l1ctlPrimNames[] = { + "_L1CTL_NONE", + "L1CTL_FBSB_REQ", + "L1CTL_FBSB_CONF", + "L1CTL_DATA_IND", + "L1CTL_RACH_REQ", + "L1CTL_DM_EST_REQ", + "L1CTL_DATA_REQ", + "L1CTL_RESET_IND", + "L1CTL_PM_REQ", + "L1CTL_PM_CONF", + "L1CTL_ECHO_REQ", + "L1CTL_ECHO_CONF", + "L1CTL_RACH_CONF", + "L1CTL_RESET_REQ", + "L1CTL_RESET_CONF", + "L1CTL_DATA_CONF", + "L1CTL_CCCH_MODE_REQ", + "L1CTL_CCCH_MODE_CONF", + "L1CTL_DM_REL_REQ", + "L1CTL_PARAM_REQ", + "L1CTL_DM_FREQ_REQ", + "L1CTL_CRYPTO_REQ", + "L1CTL_SIM_REQ", + "L1CTL_SIM_CONF", + "L1CTL_TCH_MODE_REQ", + "L1CTL_TCH_MODE_CONF", + "L1CTL_NEIGH_PM_REQ", + "L1CTL_NEIGH_PM_IND", + "L1CTL_TRAFFIC_REQ", + "L1CTL_TRAFFIC_CONF", + "L1CTL_TRAFFIC_IND" +}; + +static const struct log_info_cat default_categories[] = { + [DL1C] = { + .name = "DL1C", + .description = "Layer 1 Control", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + }, + [DVIRPHY] = { + .name = "DVIRPHY", + .description = "Virtual Layer 1 Interface", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + } +}; + +const struct log_info ms_log_info = { + .filter_fn = NULL, + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +/** + * Initialize the logging system for the virtual physical layer. + */ +int ms_log_init(char *cat_mask) { + struct log_target *stderr_target; + + log_init(&ms_log_info, NULL); + stderr_target = log_target_create_stderr(); + if(!stderr) { + return -1; + } + log_add_target(stderr_target); + log_set_all_filter(stderr_target, 1); + //log_set_log_level(stderr_target, 1); + log_set_print_filename(stderr_target, 0); + log_set_use_color(stderr_target, 0); + log_set_print_timestamp(stderr_target, 1); + log_set_print_category(stderr_target, 1); + if(cat_mask) { + log_parse_category_mask(stderr_target, cat_mask); + } + return 0; +} + +char *getL1ctlPrimName(uint8_t type) +{ + return l1ctlPrimNames[type]; +} diff --git a/src/host/virt_phy/src/logging.h b/src/host/virt_phy/src/logging.h new file mode 100644 index 0000000..87f12f7 --- /dev/null +++ b/src/host/virt_phy/src/logging.h @@ -0,0 +1,11 @@ +#pragma once + +#include + +#define DL1C 0 +#define DVIRPHY 1 + +extern const struct log_info ms_log_info; + +int ms_log_init(char *cat_mask); +char *getL1ctlPrimName(uint8_t type); diff --git a/src/host/virt_phy/src/osmo_mcast_sock.c b/src/host/virt_phy/src/osmo_mcast_sock.c new file mode 100644 index 0000000..c177734 --- /dev/null +++ b/src/host/virt_phy/src/osmo_mcast_sock.c @@ -0,0 +1,192 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "osmo_mcast_sock.h" + +struct mcast_server_sock *mcast_server_sock_setup(void *ctx, + char* tx_mcast_group, + int tx_mcast_port, + int loopback) +{ + struct mcast_server_sock *serv_sock = talloc_zero(ctx, + struct mcast_server_sock); + + serv_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); + serv_sock->sock_conf = talloc_zero(ctx, struct sockaddr_in); + + // setup mcast server socket + serv_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (serv_sock->osmo_fd->fd == -1) { + perror("Failed to create Multicast Server Socket"); + return NULL; + } + + serv_sock->sock_conf->sin_family = AF_INET; + serv_sock->sock_conf->sin_addr.s_addr = inet_addr(tx_mcast_group); + serv_sock->sock_conf->sin_port = htons(tx_mcast_port); + + // determines whether sent mcast packets should be looped back to the local sockets. + // loopback must be enabled if the mcast client is on the same machine + if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, + IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0) { + perror("Failed to disable loopback.\n"); + return NULL; + } + + return serv_sock; +} + +struct mcast_client_sock *mcast_client_sock_setup( + void *ctx, char* mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_client_sock *client_sock = talloc_zero(ctx, + struct mcast_client_sock); + struct sockaddr_in *rx_sock_conf = talloc_zero(NULL, + struct sockaddr_in); + int rc, reuseaddr = 1, loopback = 1; + + client_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); + client_sock->mcast_group = talloc_zero(ctx, struct ip_mreq); + + // Create mcast client socket + client_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (client_sock->osmo_fd->fd == -1) { + perror("Could not create mcast client socket"); + return NULL; + } + + // Enable SO_REUSEADDR to allow multiple instances of this application to receive copies of the multicast datagrams. + rc = setsockopt(client_sock->osmo_fd->fd, + SOL_SOCKET, + SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr)); + if (rc < 0) { + perror("Failed to configure REUSEADDR option"); + return NULL; + } + + // Bind to the proper port number with the IP address specified as INADDR_ANY. + rx_sock_conf->sin_family = AF_INET; + rx_sock_conf->sin_addr.s_addr = htonl(INADDR_ANY); + rx_sock_conf->sin_port = htons(mcast_port); + rc = bind(client_sock->osmo_fd->fd, (struct sockaddr *)rx_sock_conf, + sizeof(*rx_sock_conf)); + talloc_free(rx_sock_conf); + if (rc < 0) { + perror("Could not bind mcast client socket"); + return NULL; + } + + // Enable loopback of msgs to the host. + // Loopback must be enabled for the client, so multiple processes are able to recevie a mcast package. + rc = setsockopt(client_sock->osmo_fd->fd, + IPPROTO_IP, + IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); + if (rc < 0) { + perror("Failed to enable IP_MULTICAST_LOOP"); + return NULL; + } + + // Configure and join the multicast group + client_sock->mcast_group->imr_multiaddr.s_addr = inet_addr(mcast_group); + client_sock->mcast_group->imr_interface.s_addr = htonl(INADDR_ANY); + rc = setsockopt(client_sock->osmo_fd->fd, + IPPROTO_IP, + IP_ADD_MEMBERSHIP, client_sock->mcast_group, + sizeof(*client_sock->mcast_group)); + if (rc < 0) { + perror("Failed to join to mcast goup"); + return NULL; + } + + // configure and register the osmocom filedescriptor + client_sock->osmo_fd->cb = fd_rx_cb; + client_sock->osmo_fd->when = BSC_FD_READ; + client_sock->osmo_fd->data = osmo_fd_data; + + osmo_fd_register(client_sock->osmo_fd); + + return client_sock; +} + +struct mcast_bidir_sock *mcast_bidir_sock_setup( + void *ctx, char* tx_mcast_group, int tx_mcast_port, + char* rx_mcast_group, int rx_mcast_port, int loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_bidir_sock *bidir_sock = talloc(ctx, + struct mcast_bidir_sock); + bidir_sock->rx_sock = mcast_client_sock_setup(ctx, rx_mcast_group, + rx_mcast_port, fd_rx_cb, osmo_fd_data); + bidir_sock->tx_sock = mcast_server_sock_setup(ctx, tx_mcast_group, + tx_mcast_port, loopback); + if (!bidir_sock->rx_sock || !bidir_sock->tx_sock) { + return NULL; + } + return bidir_sock; + +} + +int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, + int buf_len) +{ + return recv(client_sock->osmo_fd->fd, buf, buf_len, 0); +} + +int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, + int data_len) +{ + return sendto(serv_sock->osmo_fd->fd, data, data_len, 0, + (struct sockaddr *)serv_sock->sock_conf, + sizeof(*serv_sock->sock_conf)); +} + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, + int data_len) +{ + return mcast_server_sock_tx(bidir_sock->tx_sock, data, data_len); +} +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, + int buf_len) +{ + return mcast_client_sock_rx(bidir_sock->rx_sock, buf, buf_len); +} + +void mcast_client_sock_close(struct mcast_client_sock *client_sock) +{ + setsockopt(client_sock->osmo_fd->fd, + IPPROTO_IP, + IP_DROP_MEMBERSHIP, client_sock->mcast_group, + sizeof(*client_sock->mcast_group)); + osmo_fd_unregister(client_sock->osmo_fd); + client_sock->osmo_fd->fd = -1; + client_sock->osmo_fd->when = 0; + close(client_sock->osmo_fd->fd); + talloc_free(client_sock->mcast_group); + talloc_free(client_sock->osmo_fd); + talloc_free(client_sock); + +} +void mcast_server_sock_close(struct mcast_server_sock *serv_sock) +{ + close(serv_sock->osmo_fd->fd); + talloc_free(serv_sock->sock_conf); + talloc_free(serv_sock); +} + +void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) +{ + mcast_client_sock_close(bidir_sock->rx_sock); + mcast_server_sock_close(bidir_sock->tx_sock); + talloc_free(bidir_sock); +} diff --git a/src/host/virt_phy/src/osmo_mcast_sock.h b/src/host/virt_phy/src/osmo_mcast_sock.h new file mode 100644 index 0000000..f318ffe --- /dev/null +++ b/src/host/virt_phy/src/osmo_mcast_sock.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include + +struct mcast_server_sock { + struct osmo_fd *osmo_fd; + struct sockaddr_in *sock_conf; +}; + +struct mcast_client_sock { + struct osmo_fd *osmo_fd; + struct ip_mreq *mcast_group; +}; + +struct mcast_bidir_sock { + struct mcast_server_sock *tx_sock; + struct mcast_client_sock *rx_sock; +}; + +struct mcast_bidir_sock *mcast_bidir_sock_setup( + void *ctx, char* tx_mcast_group, int tx_mcast_port, + char* rx_mcast_group, int rx_mcast_port, int loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +struct mcast_server_sock *mcast_server_sock_setup(void *ctx, + char* tx_mcast_group, + int tx_mcast_port, + int loopback); +struct mcast_client_sock *mcast_client_sock_setup( + void *ctx, char* mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); +int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, + int buf_len); +int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, + int data_len); +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, + int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, + int buf_len); +void mcast_client_sock_close(struct mcast_client_sock* client_sock); +void mcast_server_sock_close(struct mcast_server_sock* server_sock); +void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); + diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c new file mode 100644 index 0000000..f2e1690 --- /dev/null +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -0,0 +1,16 @@ +#include "virt_l1_model.h" + +struct l1_model_ms* l1_model_ms_init(void *ctx) { + + struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); + model->state = talloc_zero(ctx, struct l1_state_ms); + + return model; +} + +void l1_model_ms_destroy(struct l1_model_ms *model) { + virt_um_destroy(model->vui); + l1ctl_sock_destroy(model->lsi); + talloc_free(model->state); + talloc_free(model); +} diff --git a/src/host/virt_phy/src/virt_l1_model.h b/src/host/virt_phy/src/virt_l1_model.h new file mode 100644 index 0000000..55a1e3a --- /dev/null +++ b/src/host/virt_phy/src/virt_l1_model.h @@ -0,0 +1,31 @@ +#pragma once + +#include +#include "l1ctl_sock.h" +#include "virtual_um.h" + +struct l1_model_ms { + struct l1ctl_sock_inst *lsi; + struct virt_um_inst *vui; + struct l1_state_ms *state; +}; + +//TODO: must contain logical channel information (fram number, ciphering mode, ...) +struct l1_state_ms { + + /* the cell on which we are camping right now */ + struct l1_cell_info serving_cell; + + /* neighbor cell sync info */ + struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; + + /* TCH */ + uint8_t tch_mode; + uint8_t tch_sync; + uint8_t audio_mode; +}; + +struct l1_model_ms *l1_model_ms_init(void *ctx); + +void l1_model_ms_destroy(struct l1_model_ms *model); + diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c new file mode 100644 index 0000000..94f6fa5 --- /dev/null +++ b/src/host/virt_phy/src/virtphy.c @@ -0,0 +1,50 @@ +/* osmocom includes */ + +#include "logging.h" +#include +#include +#include +#include +#include +#include +#include + +#include "virtual_um.h" +#include "l1ctl_sock.h" +#include "virt_l1_model.h" +#include "gsmtapl1_if.h" +#include "l1ctl_sap.h" + +int main(void) +{ + + // init loginfo + static struct l1_model_ms *model; + ms_log_init("DL1C,1:DVIRPHY,1"); + //ms_log_init("DL1C,8:DVIRPHY,8"); + + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); + + model = l1_model_ms_init(NULL); + + // TODO: make this configurable + model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); + model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, NULL); + + gsmtapl1_init(model); + l1ctl_sap_init(model); + + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n"); + + while (1) { + // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) + osmo_select_main(0); + // handle outgoing l1ctl primitives to l2 + // TODO implement scheduler for uplink messages + } + + l1_model_ms_destroy(model); + + // not reached + return EXIT_FAILURE; +} diff --git a/src/host/virt_phy/src/virtual_um.c b/src/host/virt_phy/src/virtual_um.c new file mode 100644 index 0000000..2b15509 --- /dev/null +++ b/src/host/virt_phy/src/virtual_um.c @@ -0,0 +1,100 @@ +/* Routines for a Virtual Um interface over GSMTAP/UDP */ + +/* (C) 2015 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 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 "virtual_um.h" +#include "osmo_mcast_sock.h" + +/** + * Virtual UM interface file descriptor callback. + * Should be called by select.c when the fd is ready for reading. + */ +static int virt_um_fd_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct virt_um_inst *vui = ofd->data; + + // check if the read flag is set + if (what & BSC_FD_READ) { + // allocate message buffer of specified size + struct msgb *msg = msgb_alloc(VIRT_UM_MSGB_SIZE, + "Virtual UM Rx"); + int rc; + + // read message from fd in message buffer + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + // rc is number of bytes actually read + if (rc > 0) { + msgb_put(msg, rc); + // call the l1 callback function for a received msg + vui->recv_cb(vui, msg); + } else { + // TODO: this kind of error handling might be a bit harsh + vui->recv_cb(vui, NULL); + // Unregister fd from select loop + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; + } + } + + return 0; +} + +struct virt_um_inst *virt_um_init( + void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) +{ + + struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, + rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->recv_cb = recv_cb; + + return vui; + +} + +void virt_um_destroy(struct virt_um_inst *vui) +{ + mcast_bidir_sock_close(vui->mcast_sock); + talloc_free(vui); +} + +/** + * Write msg to to multicast socket and free msg afterwards + */ +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg) +{ + int rc; + + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + + return rc; +} diff --git a/src/host/virt_phy/src/virtual_um.h b/src/host/virt_phy/src/virtual_um.h new file mode 100644 index 0000000..eafb994 --- /dev/null +++ b/src/host/virt_phy/src/virtual_um.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include "osmo_mcast_sock.h" + +#define VIRT_UM_MSGB_SIZE 256 +#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_PORT 6666 +#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_PORT 6667 + +struct virt_um_inst { + void *priv; + struct mcast_bidir_sock *mcast_sock; + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); +}; + +struct virt_um_inst *virt_um_init(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, const char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); + +void virt_um_destroy(struct virt_um_inst *vui); + +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg); -- To view, visit https://gerrit.osmocom.org/3197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I203c8ec58326e52a09603a37232fce7ae3641415 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:51 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT_PHY: Improved l1ctl-to-l23 interface + gsmtap header pa... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT_PHY: Improved l1ctl-to-l23 interface + gsmtap header parsing. ...................................................................... VIRT_PHY: Improved l1ctl-to-l23 interface + gsmtap header parsing. Fixed mapping from gsmtap msg type to rsl msg type and vice versa. Proper chan_nr decoding instead of usage of dummy values for timeslot / link_id / subslot. Implemented missing l23 rx handler routines. Change-Id: Ibad741d112643c55091b8ba00164b05d728ae1a1 --- M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/gsmtapl1_if.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sap.h M src/host/virt_phy/src/virt_l1_model.h M src/host/virt_phy/src/virtphy.c M src/host/virt_phy/src/virtual_um.c 7 files changed, 433 insertions(+), 342 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 53cc952..d46bb2f 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -91,25 +91,43 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint32_t fn, + struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - uint8_t ss = 0; - uint8_t *data = msgb_l2(msg); // data bits to transmit (whole message without l1 header) - uint8_t data_len = msgb_l2len(msg); - struct msgb *outmsg; + struct gsmtap_hdr *gh; + struct msgb *outmsg; // msg to send with gsmtap header prepended + uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; // arfcn of the cell we currently camp on + uint8_t signal_dbm = 63; // signal strength, 63 is best + uint8_t snr = 63; // signal noise ratio, 63 is best + uint8_t *data = msgb_l2(msg); // data to transmit (whole message without l1 header) + uint8_t data_len = msgb_l2len(msg); // length of data - outmsg = gsmtap_makemsg(l1_model_ms->state->serving_cell.arfcn, ul->chan_nr, gsmtap_chan, - ss, fn, 0, 0, data, - data_len); + uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) + uint8_t subslot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) + uint8_t timeslot; // tdma timeslot to send in (0-7) + uint8_t gsmtap_chan; // the gsmtap channel + + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); + + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chan, subslot, fn, + signal_dbm, snr, data, data_len); if (outmsg) { - struct gsmtap_hdr *gh = msgb_data(msg); - virt_um_write_msg(l1_model_ms->vui, outmsg); - DEBUGP(DVIRPHY, - "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, gh->timeslot, - gh->sub_slot); + outmsg->l1h = msgb_data(outmsg); + gh = msgb_l1(outmsg); + if (virt_um_write_msg(l1_model_ms->vui, outmsg) == -1) { + LOGP(DVIRPHY, LOGL_ERROR, + "Gsmtap msg could not send to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, + gh->timeslot, gh->sub_slot); + } else { + DEBUGP(DVIRPHY, + "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, + gh->timeslot, gh->sub_slot); + } } else { LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); } @@ -119,29 +137,12 @@ } /** - * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg). + * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint32_t fn, struct msgb *msg). */ -void gsmtapl1_tx_to_virt_um(uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg) +void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, tn, fn, gsmtap_chan, msg); + gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, fn, msg); } - -/* This is the header as it is used by gsmtap peer virtual layer 1. -struct gsmtap_hdr { - guint8 version; // version, set to 0x01 currently - guint8 hdr_len; // length in number of 32bit words - guint8 type; // see GSMTAP_TYPE_* - guint8 timeslot; // timeslot (0..7 on Um) - guint16 arfcn; // ARFCN (frequency) - gint8 signal_dbm; // signal level in dBm - gint8 snr_db; // signal/noise ratio in dB - guint32 frame_number; // GSM Frame Number (FN) - guint8 sub_type; // Type of burst/channel, see above - guint8 antenna_nr; // Antenna Number - guint8 sub_slot; // sub-slot within timeslot - guint8 res; // reserved for future use (RFU) -} - */ /** * Receive a gsmtap message from the virt um. @@ -149,81 +150,117 @@ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg) { - if (msg) { - // we assume we only receive msgs if we actually camp on a cell - if (l1_model_ms->state->camping) { - struct gsmtap_hdr *gh; - struct l1ctl_info_dl *l1dl; - struct msgb *l1ctl_msg = NULL; - struct l1ctl_data_ind * l1di; - - msg->l1h = msgb_data(msg); - msg->l2h = msgb_pull(msg, sizeof(*gh)); - gh = msgb_l1(msg); - - DEBUGP(DVIRPHY, - "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u)\n", - ntohs(gh->arfcn), ntohl(gh->frame_number), get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gh->sub_type), gh->timeslot, - gh->sub_slot); - - // compose the l1ctl message for layer 2 - switch (gh->sub_type) { - case GSMTAP_CHANNEL_RACH: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); - break; - case GSMTAP_CHANNEL_TCH_F: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); - // TODO: implement channel handling - break; - case GSMTAP_CHANNEL_SDCCH: - case GSMTAP_CHANNEL_SDCCH4: - case GSMTAP_CHANNEL_SDCCH8: - // TODO: we might need to implement own channel handling for standalone dedicated channels - case GSMTAP_CHANNEL_AGCH: - case GSMTAP_CHANNEL_PCH: - case GSMTAP_CHANNEL_BCCH: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); - l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); - l1di = (struct l1ctl_data_ind *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_data_ind)); - - l1dl->band_arfcn = htons(ntohs(gh->arfcn)); - l1dl->link_id = gh->timeslot; - // see GSM 8.58 -> 9.3.1 for channel number encoding - l1dl->chan_nr = rsl_enc_chan_nr(chantype_gsmtap2rsl(gh->sub_type), gh->sub_slot, gh->timeslot); - l1dl->frame_nr = htonl(ntohl(gh->frame_number)); - l1dl->snr = gh->snr_db; - l1dl->rx_level = gh->signal_dbm; - l1dl->num_biterr = 0; - l1dl->fire_crc = 0; - - memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - - break; - case GSMTAP_CHANNEL_CCCH: - case GSMTAP_CHANNEL_TCH_H: - case GSMTAP_CHANNEL_PACCH: - case GSMTAP_CHANNEL_PDCH: - case GSMTAP_CHANNEL_PTCCH: - case GSMTAP_CHANNEL_CBCH51: - case GSMTAP_CHANNEL_CBCH52: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type not supported!\n"); - break; - default: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type unknown.\n"); - break; - } - - /* forward l1ctl message to l2 */ - if(l1ctl_msg) { - l1ctl_sap_tx_to_l23(l1ctl_msg); - } - } - // handle memory deallocation - talloc_free(msg); + if (!msg) { + return; } + // we assume we only receive msgs if we actually camp on a cell + if (!l1_model_ms->state->camping) { + talloc_free(msg); + return; + } + + struct gsmtap_hdr *gh = msgb_l1(msg); + struct msgb *l1ctl_msg = NULL; + struct l1ctl_info_dl *l1dl; + uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg + uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the cell we currently camp on + uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type + uint8_t signal_dbm = gh->signal_dbm; // signal strength, 63 is best + uint8_t snr = gh->snr_db; // signal noise ratio, 63 is best + uint8_t subslot = gh->sub_slot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) + uint8_t timeslot = gh->timeslot; // tdma timeslot to send in (0-7) + uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) + uint8_t link_id; // rsl link id tells if this is an ssociated or dedicated link + uint8_t chan_nr; // encoded rsl channel type, timeslot and mf subslot + + msg->l2h = msgb_pull(msg, sizeof(*gh)); + chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); + // see GSM 8.58 -> 9.3.1 for channel number encoding + chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + + DEBUGP(DVIRPHY, + "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", + arfcn, fn, get_value_string(gsmtap_types, gh->type), + get_value_string(gsmtap_channels, gsmtap_chantype), + timeslot, subslot, rsl_chantype, link_id, chan_nr); + + // switch case with removed acch flag + switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { + case GSMTAP_CHANNEL_TCH_H: + case GSMTAP_CHANNEL_TCH_F: + struct l1ctl_traffic_ind * l1ti; + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); + l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_info_dl)); + l1ti = (struct l1ctl_traffic_ind *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_traffic_ind)); + + l1dl->band_arfcn = htons(arfcn); + l1dl->link_id = link_id; + l1dl->chan_nr = chan_nr; + l1dl->frame_nr = htonl(fn); + l1dl->snr = snr; + l1dl->rx_level = signal_dbm; + l1dl->num_biterr = 0; // no biterrors + l1dl->fire_crc = 0; + + // TODO: traffic decoding and decryption + + memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); + break; + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + // TODO: we might need to implement own channel handling for standalone dedicated channels + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + struct l1ctl_data_ind * l1di; + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_info_dl)); + l1di = (struct l1ctl_data_ind *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_data_ind)); + + l1dl->band_arfcn = htons(arfcn); + l1dl->link_id = link_id; + l1dl->chan_nr = chan_nr; + l1dl->frame_nr = htonl(fn); + l1dl->snr = snr; + l1dl->rx_level = signal_dbm; + l1dl->num_biterr = 0; // no biterrors + l1dl->fire_crc = 0; // TODO: check if this means fire crc is not used or crc produced no error + + // TODO: data decoding and decryption + + memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); + + break; + case GSMTAP_CHANNEL_RACH: + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + break; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + break; + default: + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + break; + } + + /* forward l1ctl message to l2 */ + if (l1ctl_msg) { + l1ctl_sap_tx_to_l23(l1ctl_msg); + } + // handle memory deallocation + talloc_free(msg); } /** @@ -236,41 +273,77 @@ /*! \brief convert GSMTAP channel type to RSL channel number * \param[in] gsmtap_chantype GSMTAP channel type - * \returns RSL channel type + * \param[out] rsl_chantype rsl channel type + * \param[out] rsl_chantype rsl link id + * + * Mapping from gsmtap channel: + * GSMTAP_CHANNEL_UNKNOWN * 0x00 + * GSMTAP_CHANNEL_BCCH * 0x01 + * GSMTAP_CHANNEL_CCCH * 0x02 + * GSMTAP_CHANNEL_RACH * 0x03 + * GSMTAP_CHANNEL_AGCH * 0x04 + * GSMTAP_CHANNEL_PCH * 0x05 + * GSMTAP_CHANNEL_SDCCH * 0x06 + * GSMTAP_CHANNEL_SDCCH4 * 0x07 + * GSMTAP_CHANNEL_SDCCH8 * 0x08 + * GSMTAP_CHANNEL_TCH_F * 0x09 + * GSMTAP_CHANNEL_TCH_H * 0x0a + * GSMTAP_CHANNEL_PACCH * 0x0b + * GSMTAP_CHANNEL_CBCH52 * 0x0c + * GSMTAP_CHANNEL_PDCH * 0x0d + * GSMTAP_CHANNEL_PTCCH * 0x0e + * GSMTAP_CHANNEL_CBCH51 * 0x0f + * to rsl channel type: + * RSL_CHAN_NR_MASK * 0xf8 + * RSL_CHAN_NR_1 * * 0x08 + * RSL_CHAN_Bm_ACCHs * 0x08 + * RSL_CHAN_Lm_ACCHs * 0x10 + * RSL_CHAN_SDCCH4_ACCH * 0x20 + * RSL_CHAN_SDCCH8_ACCH * 0x40 + * RSL_CHAN_BCCH * * 0x80 + * RSL_CHAN_RACH * * 0x88 + * RSL_CHAN_PCH_AGCH * 0x90 + * RSL_CHAN_OSMO_PDCH * 0xc0 + * and logical channel link id: + * LID_SACCH * * 0x40 + * LID_DEDIC * * 0x00 + * + * TODO: move this to a library used by both ms and bts virt um */ -uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype) +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id) { - // TODO: proper retval for unknown channel - uint8_t ret = 0; - - switch (gsmtap_chantype) { - case GSMTAP_CHANNEL_TCH_F: - ret = RSL_CHAN_Bm_ACCHs; + // switch case with removed acch flag + switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { + case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F + *rsl_chantype = RSL_CHAN_Bm_ACCHs; break; - case GSMTAP_CHANNEL_TCH_H: - ret = RSL_CHAN_Lm_ACCHs; + case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H + *rsl_chantype = RSL_CHAN_Lm_ACCHs; break; - case GSMTAP_CHANNEL_SDCCH4: - ret = RSL_CHAN_SDCCH4_ACCH; + case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 + *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; break; - case GSMTAP_CHANNEL_SDCCH8: - ret = RSL_CHAN_SDCCH8_ACCH; + case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 + *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; break; - case GSMTAP_CHANNEL_BCCH: - ret = RSL_CHAN_BCCH; + case GSMTAP_CHANNEL_BCCH: // BCCH + *rsl_chantype = RSL_CHAN_BCCH; break; - case GSMTAP_CHANNEL_RACH: - ret = RSL_CHAN_RACH; + case GSMTAP_CHANNEL_RACH: // RACH + *rsl_chantype = RSL_CHAN_RACH; break; - case GSMTAP_CHANNEL_PCH: - case GSMTAP_CHANNEL_AGCH: - ret = RSL_CHAN_PCH_AGCH; + case GSMTAP_CHANNEL_PCH: // PCH + case GSMTAP_CHANNEL_AGCH: // AGCH + *rsl_chantype = RSL_CHAN_PCH_AGCH; + break; + case GSMTAP_CHANNEL_PDCH: + *rsl_chantype = GSMTAP_CHANNEL_PDCH; break; } - // TODO: check how to handle this... -// if (link_id & 0x40) -// ret |= GSMTAP_CHANNEL_ACCH; + *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? + LID_SACCH : + LID_DEDIC; - return ret; } diff --git a/src/host/virt_phy/src/gsmtapl1_if.h b/src/host/virt_phy/src/gsmtapl1_if.h index 09d34f4..6311e07 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.h +++ b/src/host/virt_phy/src/gsmtapl1_if.h @@ -8,11 +8,11 @@ #include "virt_l1_model.h" void gsmtapl1_init(struct l1_model_ms *model); - -void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, + struct msgb *msg); void gsmtapl1_rx_from_virt_um(struct msgb *msg); - -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg); -void gsmtapl1_tx_to_virt_um(uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg); - -uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype); +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint32_t fn, + struct msgb *msg); +void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg); +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index b5fb0f0..91f1d10 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -4,9 +4,13 @@ #include #include #include +#include +#include +#include #include #include #include +#include #include "virtual_um.h" #include "l1ctl_sock.h" @@ -16,6 +20,18 @@ #include "gsmtapl1_if.h" static struct l1_model_ms *l1_model_ms = NULL; + +static void l1_model_tch_mode_set(uint8_t tch_mode) +{ + if (tch_mode == GSM48_CMODE_SPEECH_V1 + || tch_mode == GSM48_CMODE_SPEECH_EFR) { + l1_model_ms->state->tch_mode = tch_mode; + + } else { + // set default value if no proper mode was assigned by l23 + l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; + } +} /** * @brief Init the SAP. @@ -30,7 +46,8 @@ * * Enqueues the message into the rx queue. */ -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, + struct msgb *msg) { // check if the received msg is not empty if (msg) { @@ -56,11 +73,11 @@ { uint16_t *len; /* prepend 16bit length before sending */ - len = (uint16_t *) msgb_push(msg, sizeof(*len)); + len = (uint16_t *)msgb_push(msg, sizeof(*len)); *len = htons(msg->len - sizeof(*len)); - if(l1ctl_sock_write_msg(lsi, msg) == -1 ) { - //DEBUGP(DL1C, "Error writing to layer2 socket"); + if (l1ctl_sock_write_msg(lsi, msg) == -1) { + DEBUGP(DL1C, "Error writing to layer2 socket"); } } @@ -140,22 +157,22 @@ /** * @brief General handler for incoming L1CTL messages from layer 2/3. * - * This handler will dequeue the rx queue (if !empty) and call the specific routine for the dequeued l1ctl message. + * This handler will call the specific routine dependent on the L1CTL message type. * */ void l1ctl_sap_handler(struct msgb *msg) { -// struct msgb *msg; struct l1ctl_hdr *l1h; - unsigned long flags; - if (!msg) + if (!msg) { return; + } l1h = (struct l1ctl_hdr *)msg->data; if (sizeof(*l1h) > msg->len) { - LOGP(DL1C, LOGL_NOTICE, "Short message. %u\n", msg->len); + LOGP(DL1C, LOGL_NOTICE, "Malformed message: too short. %u\n", + msg->len); goto exit_msgbfree; } @@ -182,7 +199,6 @@ l1ctl_rx_rach_req(msg); // msg is freed by rx routine goto exit_nofree; - break; case L1CTL_DATA_REQ: l1ctl_rx_data_req(msg); /* we have to keep the msgb, not free it! */ @@ -229,24 +245,29 @@ * Transmit frequency control and synchronisation bursts on FCCH and SCH to calibrate transceiver and search for base stations. * Sync to a given arfcn. * - * Note: Not needed for virtual physical layer. + * Note: ms will start receiving msgs on virtual um only after this req was received. + * Note: virt bts does not broadcast freq and sync bursts. + * * TODO: Could be used to bind/connect to different virtual_bts sockets with a arfcn-socket mapping. + * TODO: Check flags if this is a sync or freq request and handle it accordingly. */ void l1ctl_rx_fbsb_req(struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); l1_model_ms->state->camping = 1; - l1_model_ms->state->serving_cell.arfcn = ntohs(sync_req->band_arfcn); - l1_model_ms->state->serving_cell.ccch_mode = sync_req->ccch_mode; - l1_model_ms->state->serving_cell.fn_offset = 0; - l1_model_ms->state->serving_cell.bsic = 0; - l1_model_ms->state->serving_cell.time_alignment = 0; - // TODO: reset and synchronize the ms uplink schedulers with bts multiframe structure. + l1_model_ms->state->serving_cell.arfcn = ntohs(sync_req->band_arfcn); // freq req + + // not needed in virt um + l1_model_ms->state->serving_cell.ccch_mode = sync_req->ccch_mode; // sync req + l1_model_ms->state->serving_cell.fn_offset = 0; // sync req + l1_model_ms->state->serving_cell.bsic = 0; // sync req + l1_model_ms->state->serving_cell.time_alignment = 0; // sync req l1ctl_tx_fbsb_conf(0, l1_model_ms->state->serving_cell.arfcn); } @@ -268,47 +289,25 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_dm_est_req *est_req = (struct l1ctl_dm_est_req *)ul->payload; + uint8_t rsl_chantype, subslot, timeslot; + + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DM_EST_REQ (arfcn=%u, chan_nr=0x%02x, tsc=%u)\n", - ntohs(est_req->h0.band_arfcn), ul->chan_nr, - est_req->tsc); + "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u)\n", + ul->chan_nr, timeslot); -// /* disable neighbour cell measurement of C0 TS 0 */ -// mframe_disable(MF_TASK_NEIGH_PM51_C0T0); -// -// /* configure dedicated channel state */ -// l1s.dedicated.type = chan_nr2dchan_type(ul->chan_nr); -// l1s.dedicated.tsc = est_req->tsc; -// l1s.dedicated.tn = ul->chan_nr & 0x7; -// l1s.dedicated.h = est_req->h; -// -// if (est_req->h) { -// int i; -// l1s.dedicated.h1.hsn = est_req->h1.hsn; -// l1s.dedicated.h1.maio = est_req->h1.maio; -// l1s.dedicated.h1.n = est_req->h1.n; -// for (i=0; ih1.n; i++) -// l1s.dedicated.h1.ma[i] = ntohs(est_req->h1.ma[i]); -// } else { -// l1s.dedicated.h0.arfcn = ntohs(est_req->h0.band_arfcn); -// } -// -// /* TCH config */ -// if (chan_nr_is_tch(ul->chan_nr)) { -// /* Mode */ -// l1a_tch_mode_set(est_req->tch_mode); -// l1a_audio_mode_set(est_req->audio_mode); -// -// /* Sync */ -// l1s.tch_sync = 1; /* can be set without locking */ -// -// /* Audio path */ -// audio_set_enabled(est_req->tch_mode, est_req->audio_mode); -// } -// -// /* figure out which MF tasks to enable */ -// l1a_mftask_set(chan_nr2mf_task_mask(ul->chan_nr, NEIGH_MODE_PM)); + l1_model_ms->state->dedicated.chan_type = rsl_chantype; + l1_model_ms->state->dedicated.tn = timeslot; + + /* TCH config */ + if (rsl_chantype == RSL_CHAN_Bm_ACCHs + || rsl_chantype == RSL_CHAN_Lm_ACCHs) { + l1_model_ms->state->tch_mode = est_req->tch_mode; + l1_model_tch_mode_set(est_req->tch_mode); + l1_model_ms->state->audio_mode = est_req->audio_mode; + // TODO: configure audio hardware for encoding / decoding / recording / playing voice + } } /** @@ -320,7 +319,7 @@ * * Handle frequency change in dedicated mode. E.g. used for frequency hopping. * - * Note: Not needed for virtual physical layer. + * Note: Not needed for virtual physical layer as freqency hopping is generally disabled. */ void l1ctl_rx_dm_freq_req(struct msgb *msg) { @@ -330,8 +329,9 @@ (struct l1ctl_dm_freq_req *)ul->payload; DEBUGP(DL1C, - "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn=%u, tsc=%u)\n", - ntohs(freq_req->h0.band_arfcn), freq_req->tsc); + "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", + ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, + freq_req->h1.maio); } /** @@ -359,12 +359,14 @@ "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", cr->algo, key_len); -// if (cr->algo && key_len != 8) { -// DEBUGP(DL1C, "L1CTL_CRYPTO_REQ -> Invalid key\n"); -// return; -// } -// -// dsp_load_ciph_param(cr->algo, cr->key); + if (cr->algo && key_len != A5_KEY_LEN) { + DEBUGP(DL1C, "L1CTL_CRYPTO_REQ -> Invalid key\n"); + return; + } + + l1_model_ms->crypto_inf->algo = cr->algo; + memcpy(l1_model_ms->crypto_inf->key, cr->key, + sizeof(uint8_t) * A5_KEY_LEN); } /** @@ -380,19 +382,13 @@ */ void l1ctl_rx_dm_rel_req(struct msgb *msg) { -// struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); - DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_DM_REL_REQ\n"); -// l1a_mftask_set(0); -// l1s.dedicated.type = GSM_DCHAN_NONE; -// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_MAIN]); -// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_SACCH]); -// l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); -// l1a_meas_msgb_set(NULL); -// dsp_load_ciph_param(0, NULL); -// l1a_tch_mode_set(GSM48_CMODE_SIGN); -// audio_set_enabled(GSM48_CMODE_SIGN, 0); -// l1s.neigh_pm.n = 0; + l1_model_ms->state->dedicated.chan_type = 0; + l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; + + // TODO: disable ciphering + // TODO: disable audio recording / playing } /** @@ -424,44 +420,38 @@ * * @param [in] msg the received message. * - * Transmit RACH request on RACH. + * Transmit RACH request on RACH. Refer to 04.08 - 9.1.8 - Channel request. * - * TODO: Implement this handler routine! */ void l1ctl_rx_rach_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; - struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; - - uint32_t fn_sched; - uint8_t ts; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + // FIXME: proper frame number + uint32_t fn_sched = 42; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", rach_req->ra, ntohs(rach_req->offset), rach_req->combined); - // TODO: calculate correct fn/ts for a RACH (if needed by bts) - // TODO: implement scheduler for uplink! - fn_sched = 42; - ts = 0; // for the rach channel request, there is no layer2 header, but only the one bit ra content to submit - // see 4.18-9.1.8 CHannel Request - // that means we have to set l2h of msgb to the ra content - msg->l2h = &rach_req->ra; - // avoid all data after ra to also be submitted - msgb_trim(msg, sizeof(rach_req->ra)); - // TODO: check if we need to submit more data than the ra content to the bts + // replace l1ctl_rach_req with ra data that rly shall be submitted + // ra on peer side is decoded as uint16_t, but we do not use the 11bit option and thus 8bits must be sufficient + msg->l2h = msgb_put(msg, sizeof(uint8_t)); + *msg->l2h = rach_req->ra; + + // chan_nr is not specified in info_ul for rach request coming from l23, but needed in gsmtapl1_tx_to_virt_um() + ul->chan_nr = rsl_enc_chan_nr(RSL_CHAN_RACH, 0, 0); + ul->link_id = LID_DEDIC; // send rach over virt um - gsmtapl1_tx_to_virt_um(ts, fn_sched, GSMTAP_CHANNEL_RACH, msg); + gsmtapl1_tx_to_virt_um(fn_sched, msg); // send confirm to layer23 l1ctl_tx_rach_conf(fn_sched, l1_model_ms->state->serving_cell.arfcn); -// l1a_rach_req(ntohs(rach_req->offset), rach_req->combined, -// rach_req->ra); } /** @@ -473,36 +463,29 @@ * * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). * - * TODO: Implement this handler routine! + * TODO: Check if a msg on FACCH is coming in here and needs special handling. */ void l1ctl_rx_data_req(struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; - struct llist_head *tx_queue; + // FIXME: proper frame number + uint32_t fn_sched = 42; DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x)\n", - ul->link_id); + "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", + ul->link_id, ul, ul->payload, data_ind, data_ind->data, + msg->l3h); -// msg->l3h = data_ind->data; -// if (ul->link_id & 0x40) { -// struct gsm48_hdr *gh = (struct gsm48_hdr *)(data_ind->data + 5); -// if (gh->proto_discr == GSM48_PDISC_RR -// && gh->msg_type == GSM48_MT_RR_MEAS_REP) { -// DEBUGP(DL1C, "updating measurement report\n"); -// l1a_meas_msgb_set(msg); -// return; -// } -// tx_queue = &l1s.tx_queue[L1S_CHAN_SACCH]; -// } else -// tx_queue = &l1s.tx_queue[L1S_CHAN_MAIN]; -// -// DEBUGP(DL1C, "ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p\n", -// ul, ul->payload, data_ind, data_ind->data, msg->l3h); -// -// l1a_txq_msgb_enq(tx_queue, msg); + msg->l2h = data_ind->data; + + // send msg over virt um + gsmtapl1_tx_to_virt_um(fn_sched, msg); + + // send confirm to layer23 + msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn_sched, 0, 0); + l1ctl_sap_tx_to_l23(msg); } /** @@ -528,26 +511,33 @@ pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - DEBUGP(DL1C, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", - pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); + DEBUGP(DL1C, + "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + pm_req->type, pm_req->range.band_arfcn_from, + pm_req->range.band_arfcn_to); - for(arfcn_next = pm_req->range.band_arfcn_from; arfcn_next <= pm_req->range.band_arfcn_to; ++arfcn_next) { - struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *)msgb_put(resp_msg, sizeof(*pm_conf)); + for (arfcn_next = pm_req->range.band_arfcn_from; + arfcn_next <= pm_req->range.band_arfcn_to; + ++arfcn_next) { + struct l1ctl_pm_conf *pm_conf = + (struct l1ctl_pm_conf *)msgb_put(resp_msg, + sizeof(*pm_conf)); pm_conf->band_arfcn = htons(arfcn_next); // rxlev 63 is great, 0 is bad the two values are min and max pm_conf->pm[0] = 63; pm_conf->pm[1] = 63; - if(arfcn_next == pm_req->range.band_arfcn_to) { + if (arfcn_next == pm_req->range.band_arfcn_to) { struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; } - // no more space in msgb, flush to l2 - if(msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { + // no more space to hold mor pm info in msgb, flush to l23 + if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { l1ctl_sap_tx_to_l23(resp_msg); resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); } } - if(resp_msg) { + // transmit the remaining part of pm response to l23 + if (resp_msg) { l1ctl_sap_tx_to_l23(resp_msg); } } @@ -563,7 +553,6 @@ * * Note: Currently we do not perform anything else than response with a reset confirm * to just tell l2 that we are rdy. - * TODO: Validate if an action has to be done here. * */ void l1ctl_rx_reset_req(struct msgb *msg) @@ -573,16 +562,20 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); l1_model_ms->state->camping = 0; + // TODO: check if we also need to reset the dedicated channel state l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; default: - LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGP(DL1C, LOGL_ERROR, + "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); break; } } @@ -595,6 +588,8 @@ * @param [in] msg the received message. * * Configure CCCH combined / non-combined mode. + * + * @see l1ctl_proto.h -- enum ccch_mode * * TODO: Implement this handler routine! */ @@ -610,22 +605,7 @@ l1_model_ms->state->serving_cell.ccch_mode = ccch_mode; // check if more has to be done here - l1ctl_tx_ccch_mode_conf(ccch_mode); - -// /* pre-set the CCCH mode */ -// l1s.serving_cell.ccch_mode = ccch_mode; -// -// /* Update task */ -// mframe_disable(MF_TASK_CCCH_COMB); -// mframe_disable(MF_TASK_CCCH); -// -// if (ccch_mode == CCCH_MODE_COMBINED) -// mframe_enable(MF_TASK_CCCH_COMB); -// else if (ccch_mode == CCCH_MODE_NON_COMBINED) -// mframe_enable(MF_TASK_CCCH); -// -// l1ctl_tx_ccch_mode_conf(ccch_mode); } /** @@ -644,20 +624,18 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_tch_mode_req *tch_mode_req = (struct l1ctl_tch_mode_req *)l1h->data; - uint8_t tch_mode = tch_mode_req->tch_mode; - uint8_t audio_mode = tch_mode_req->audio_mode; + + l1_model_tch_mode_set(tch_mode_req->tch_mode); + l1_model_ms->state->audio_mode = tch_mode_req->audio_mode; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", - tch_mode, audio_mode); -// tch_mode = l1a_tch_mode_set(tch_mode); -// audio_mode = l1a_audio_mode_set(audio_mode); -// -// audio_set_enabled(tch_mode, audio_mode); -// -// l1s.tch_sync = 1; /* Needed for audio to work */ -// -// l1ctl_tx_tch_mode_conf(tch_mode, audio_mode); + tch_mode_req->tch_mode, tch_mode_req->audio_mode); + + // TODO: configure audio hardware for encoding / decoding / recording / playing voice + + l1ctl_tx_tch_mode_conf(l1_model_ms->state->tch_mode, + l1_model_ms->state->audio_mode); } /** @@ -671,7 +649,7 @@ * The neighbor cell description is one of the info messages sent by the BTS on BCCH. * This method will also enable neighbor measurement in the multiframe scheduler. * - * Note: Not needed for virtual physical layer. + * Note: Not needed for virtual physical layer as we dont maintain neigbors. */ void l1ctl_rx_neigh_pm_req(struct msgb *msg) { @@ -691,30 +669,26 @@ * * @param [in] msg the received message. * - * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. - * Will drop the traffic frame at queue sizes >= 4. + * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. In virtual layer1 just submit it to the virt um. * - * TODO: Implement this handler routine! */ void l1ctl_rx_traffic_req(struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; - int num = 0; + uint32_t fn_sched = 42; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); -// msg->l2h = tr->data; + msg->l2h = tr->data; -// num = l1a_txq_msgb_count(&l1s.tx_queue[L1S_CHAN_TRAFFIC]); -// if (num >= 4) { -// DEBUGP(DL1C, "dropping traffic frame\n"); -// msgb_free(msg); -// return; -// } -// -// l1a_txq_msgb_enq(&l1s.tx_queue[L1S_CHAN_TRAFFIC], msg); + // send msg over virt um + gsmtapl1_tx_to_virt_um(fn_sched, msg); + + // send confirm to layer23 + msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn_sched, 0, 0); + l1ctl_sap_tx_to_l23(msg); } /** @@ -727,6 +701,7 @@ * Forward and a sim request to the SIM APDU. * * Note: Not needed for virtual layer. Please configure layer23 application to use test-sim implementation. + * In this case layer1 wont need to handle sim logic. * ms * -------- * sim test @@ -766,7 +741,7 @@ reset_resp->type = reset_type; DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", - getL1ctlPrimName(msg_type), reset_type); + getL1ctlPrimName(msg_type), reset_type); l1ctl_sap_tx_to_l23(msg); } @@ -783,7 +758,7 @@ struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", - getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); + getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); l1ctl_sap_tx_to_l23(msg); } @@ -807,22 +782,20 @@ * @param [in] res 0 -> success, 255 -> error. * @param [in] arfcn the arfcn we are synced to. * - * No calculation needed for virtual pyh -> uses default values for a good link quality. + * No calculation needed for virtual pyh -> uses dummy values for a good link quality. */ void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) { struct msgb *msg; struct l1ctl_fbsb_conf *resp; uint32_t fn = 0; // 0 should be okay here - uint16_t snr = 40; // signal noise ratio > 40db is best signal. - int16_t initial_freq_err = 0; // 0 means no error. - uint8_t bsic = 0; + uint16_t snr = 40; // signal noise ratio > 40db is best signal (unused in virt) + int16_t initial_freq_err = 0; // 0 means no error (unused in virt) + uint8_t bsic = 0; // bsci can be read from sync burst (unused in virt) - msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, - snr, - arfcn); + msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, snr, arfcn); - resp = (struct l1ctl_fbsb_conf *) msgb_put(msg, sizeof(*resp)); + resp = (struct l1ctl_fbsb_conf *)msgb_put(msg, sizeof(*resp)); resp->initial_freq_err = htons(initial_freq_err); resp->result = res; resp->bsic = bsic; @@ -875,9 +848,8 @@ mode_conf->audio_mode = audio_mode; DEBUGP(DL1C, - "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, - audio_mode); + "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", + tch_mode, audio_mode); l1ctl_sap_tx_to_l23(msg); } - diff --git a/src/host/virt_phy/src/l1ctl_sap.h b/src/host/virt_phy/src/l1ctl_sap.h index f540197..9472013 100644 --- a/src/host/virt_phy/src/l1ctl_sap.h +++ b/src/host/virt_phy/src/l1ctl_sap.h @@ -15,6 +15,10 @@ #define L3_MSG_DATA 200 #define L3_MSG_SIZE (sizeof(struct l1ctl_hdr) + L3_MSG_HEAD + L3_MSG_DATA) +/* lchan link ID */ +#define LID_SACCH 0x40 +#define LID_DEDIC 0x00 + void l1ctl_sap_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); diff --git a/src/host/virt_phy/src/virt_l1_model.h b/src/host/virt_phy/src/virt_l1_model.h index f0619ab..38d9efe 100644 --- a/src/host/virt_phy/src/virt_l1_model.h +++ b/src/host/virt_phy/src/virt_l1_model.h @@ -1,29 +1,65 @@ #pragma once -#include #include "l1ctl_sock.h" #include "virtual_um.h" + +#define L1S_NUM_NEIGH_CELL 6 +#define A5_KEY_LEN 8 struct l1_model_ms { struct l1ctl_sock_inst *lsi; struct virt_um_inst *vui; struct l1_state_ms *state; + struct crypto_info_ms *crypto_inf; }; -//TODO: must contain logical channel information (fram number, ciphering mode, ...) +/* structure representing L1 sync information about a cell */ +struct l1_cell_info { + /* on which ARFCN (+band) is the cell? */ + uint16_t arfcn; + /* what's the BSIC of the cell (from SCH burst decoding) */ + uint8_t bsic; + /* Combined or non-combined CCCH */ + uint8_t ccch_mode; /* enum ccch_mode */ + /* whats the delta of the cells current GSM frame number + * compared to our current local frame number */ + int32_t fn_offset; + /* how much does the TPU need adjustment (delta) to synchronize + * with the cells burst */ + uint32_t time_alignment; +}; + +struct crypto_info_ms { + /* key is expected in the same format as in RSL + * Encryption information IE. */ + uint8_t key[A5_KEY_LEN]; + uint8_t algo; +}; + struct l1_state_ms { - uint8_t camping; + uint8_t camping; // are we currently camping on a cell + /* the cell on which we are camping right now */ struct l1_cell_info serving_cell; - /* neighbor cell sync info */ struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; - /* TCH */ - uint8_t tch_mode; - uint8_t tch_sync; - uint8_t audio_mode; + /* TCH info */ + uint8_t tch_mode; // see enum gsm48_chan_mode in gsm_04_08.h + uint8_t tch_sync; // needed for audio synchronization + uint8_t audio_mode; // see l1ctl_proto.h, e.g. AUDIO_TX_MICROPHONE + + /* dedicated channel info */ + struct { + uint8_t chan_type; // like rsl chantype 08.58 -> Chapter 9.3.1 */ + + uint8_t tn; // timeslot number 1-7 + + uint8_t scn; // single-hop cellular network? (ununsed in virtual um) + uint8_t tsc; // training sequence code (ununsed in virtual um) + uint8_t h; // hopping enabled flag (ununsed in virtual um) + } dedicated; }; struct l1_model_ms *l1_model_ms_init(void *ctx); diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 94f6fa5..b2a2d4f 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -17,10 +17,10 @@ int main(void) { - // init loginfo static struct l1_model_ms *model; - ms_log_init("DL1C,1:DVIRPHY,1"); + //ms_log_init("DL1C,1:DVIRPHY,1"); + ms_log_init("DL1C,1"); //ms_log_init("DL1C,8:DVIRPHY,8"); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); @@ -28,7 +28,10 @@ model = l1_model_ms_init(NULL); // TODO: make this configurable - model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); + model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, + DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, + DEFAULT_MS_MCAST_PORT, + gsmtapl1_rx_from_virt_um_inst_cb); model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, NULL); gsmtapl1_init(model); diff --git a/src/host/virt_phy/src/virtual_um.c b/src/host/virt_phy/src/virtual_um.c index 2b15509..e2e86e4 100644 --- a/src/host/virt_phy/src/virtual_um.c +++ b/src/host/virt_phy/src/virtual_um.c @@ -19,7 +19,6 @@ * */ -#include #include #include #include @@ -46,10 +45,12 @@ int rc; // read message from fd in message buffer - rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), + msgb_tailroom(msg)); // rc is number of bytes actually read if (rc > 0) { msgb_put(msg, rc); + msg->l1h = msgb_data(msg); // call the l1 callback function for a received msg vui->recv_cb(vui, msg); } else { @@ -68,12 +69,13 @@ struct virt_um_inst *virt_um_init( void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, - const char *rx_mcast_group, uint16_t rx_mcast_port, void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) + const char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) { - struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); - vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, - rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, + tx_mcast_port, rx_mcast_group, rx_mcast_port, 1, + virt_um_fd_cb, vui); vui->recv_cb = recv_cb; return vui; @@ -93,7 +95,8 @@ { int rc; - rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), msgb_length(msg)); + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), + msgb_length(msg)); msgb_free(msg); return rc; -- To view, visit https://gerrit.osmocom.org/3199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibad741d112643c55091b8ba00164b05d728ae1a1 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:52 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Implemented RACH on uplink. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Implemented RACH on uplink. ...................................................................... VIRT-PHY: Implemented RACH on uplink. RACH will now be transmitted over GSMTAP virtual UM interface if L1CTL command is received. Minor further changes: - Incoming messages are now only then forwarded if ms is synced to a cell (fbsb cmd from l1ctl received). - SDCCH/4/8 are forwarded to l23 for now as we don't use encoding/ciphering (yet) this should not be a problem. Change-Id: Ic15188c5c0bba96c223d689be733324a9778a2e8 --- M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/gsmtapl1_if.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sap.h M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/virt_l1_model.h 7 files changed, 160 insertions(+), 111 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index a110435..2dac297 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -8,6 +8,7 @@ # TODO: somehow this include path causes errors, thus the needed files are copied into $(top_srcdir)/include. Would be better to include directly from $(OSMO_BB_DIR)/src/target/firmware/include to avoid redundancy. # -I$(OSMO_BB_DIR)/src/target/firmware/include +# disable optimization and enable debugging CFLAGS = -g -O0 sbin_PROGRAMS = virtphy diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 11214cf..53cc952 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -89,28 +89,23 @@ } /** - * Append a gsmtap header to msg and send it over the virt um. + * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg) { - struct l1ctl_hdr *l1hdr = (struct l1ctl_hdr *)msg->l1h; - struct l1ctl_info_dl *l1dl = (struct l1ctl_info_dl *)msg->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; uint8_t ss = 0; - uint8_t gsmtap_chan; + uint8_t *data = msgb_l2(msg); // data bits to transmit (whole message without l1 header) + uint8_t data_len = msgb_l2len(msg); struct msgb *outmsg; - switch (l1hdr->msg_type) { - case L1CTL_DATA_REQ: - // TODO: check what data request and set gsmtap_chan depending on that - gsmtap_chan = 0; - break; - } - outmsg = gsmtap_makemsg(l1dl->band_arfcn, l1dl->chan_nr, gsmtap_chan, - ss, l1dl->frame_nr, 0, 0, msgb_l2(msg), - msgb_l2len(msg)); + outmsg = gsmtap_makemsg(l1_model_ms->state->serving_cell.arfcn, ul->chan_nr, gsmtap_chan, + ss, fn, 0, 0, data, + data_len); if (outmsg) { - struct gsmtap_hdr *gh = (struct gsmtap_hdr *)outmsg->l1h; - virt_um_write_msg(vui, outmsg); + struct gsmtap_hdr *gh = msgb_data(msg); + virt_um_write_msg(l1_model_ms->vui, outmsg); DEBUGP(DVIRPHY, "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, @@ -124,11 +119,11 @@ } /** - * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, struct msgb *msg). + * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg). */ -void gsmtapl1_tx_to_virt_um(struct msgb *msg) +void gsmtapl1_tx_to_virt_um(uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, msg); + gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, tn, fn, gsmtap_chan, msg); } /* This is the header as it is used by gsmtap peer virtual layer 1. @@ -155,77 +150,77 @@ struct msgb *msg) { if (msg) { - struct gsmtap_hdr *gh; - struct l1ctl_info_dl *l1dl; - struct msgb *l1ctl_msg = NULL; - struct l1ctl_data_ind * l1di; + // we assume we only receive msgs if we actually camp on a cell + if (l1_model_ms->state->camping) { + struct gsmtap_hdr *gh; + struct l1ctl_info_dl *l1dl; + struct msgb *l1ctl_msg = NULL; + struct l1ctl_data_ind * l1di; - msg->l1h = msgb_data(msg); - msg->l2h = msgb_pull(msg, sizeof(*gh)); - gh = msgb_l1(msg); + msg->l1h = msgb_data(msg); + msg->l2h = msgb_pull(msg, sizeof(*gh)); + gh = msgb_l1(msg); - DEBUGP(DVIRPHY, - "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u)\n", - ntohs(gh->arfcn), ntohl(gh->frame_number), get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gh->sub_type), gh->timeslot, - gh->sub_slot); + DEBUGP(DVIRPHY, + "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u)\n", + ntohs(gh->arfcn), ntohl(gh->frame_number), get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gh->sub_type), gh->timeslot, + gh->sub_slot); - // compose the l1ctl message for layer 2 - switch (gh->sub_type) { - case GSMTAP_CHANNEL_RACH: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); - break; - case GSMTAP_CHANNEL_SDCCH: - case GSMTAP_CHANNEL_SDCCH4: - case GSMTAP_CHANNEL_SDCCH8: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); - // TODO: implement channel handling - break; - case GSMTAP_CHANNEL_TCH_F: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); - // TODO: implement channel handling - break; - case GSMTAP_CHANNEL_AGCH: - case GSMTAP_CHANNEL_PCH: - case GSMTAP_CHANNEL_BCCH: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); - l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); - l1di = (struct l1ctl_data_ind *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_data_ind)); + // compose the l1ctl message for layer 2 + switch (gh->sub_type) { + case GSMTAP_CHANNEL_RACH: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + break; + case GSMTAP_CHANNEL_TCH_F: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); + // TODO: implement channel handling + break; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + // TODO: we might need to implement own channel handling for standalone dedicated channels + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); + l1di = (struct l1ctl_data_ind *) msgb_put(l1ctl_msg, sizeof(struct l1ctl_data_ind)); - l1dl->band_arfcn = htons(ntohs(gh->arfcn)); - l1dl->link_id = gh->timeslot; - // see GSM 8.58 -> 9.3.1 for channel number encoding - l1dl->chan_nr = rsl_enc_chan_nr(chantype_gsmtap2rsl(gh->sub_type), gh->sub_slot, gh->timeslot); - l1dl->frame_nr = htonl(ntohl(gh->frame_number)); - l1dl->snr = gh->snr_db; - l1dl->rx_level = gh->signal_dbm; - l1dl->num_biterr = 0; - l1dl->fire_crc = 0; + l1dl->band_arfcn = htons(ntohs(gh->arfcn)); + l1dl->link_id = gh->timeslot; + // see GSM 8.58 -> 9.3.1 for channel number encoding + l1dl->chan_nr = rsl_enc_chan_nr(chantype_gsmtap2rsl(gh->sub_type), gh->sub_slot, gh->timeslot); + l1dl->frame_nr = htonl(ntohl(gh->frame_number)); + l1dl->snr = gh->snr_db; + l1dl->rx_level = gh->signal_dbm; + l1dl->num_biterr = 0; + l1dl->fire_crc = 0; - memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); + memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - break; - case GSMTAP_CHANNEL_CCCH: - case GSMTAP_CHANNEL_TCH_H: - case GSMTAP_CHANNEL_PACCH: - case GSMTAP_CHANNEL_PDCH: - case GSMTAP_CHANNEL_PTCCH: - case GSMTAP_CHANNEL_CBCH51: - case GSMTAP_CHANNEL_CBCH52: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type not supported!\n"); - break; - default: - LOGP(DL1C, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type unknown.\n"); - break; + break; + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_TCH_H: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + break; + default: + LOGP(DL1C, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + break; + } + + /* forward l1ctl message to l2 */ + if(l1ctl_msg) { + l1ctl_sap_tx_to_l23(l1ctl_msg); + } } - - /* forward l1ctl message to l2 */ - if(l1ctl_msg) { - l1ctl_sap_tx_to_l23(l1ctl_msg); - } - // handle memory deallocation talloc_free(msg); } @@ -240,9 +235,8 @@ } /*! \brief convert GSMTAP channel type to RSL channel number - * \param[in] rsl_chantype RSL channel type - * \param[in] link_id RSL link identifier - * \returns GSMTAP channel type + * \param[in] gsmtap_chantype GSMTAP channel type + * \returns RSL channel type */ uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype) { diff --git a/src/host/virt_phy/src/gsmtapl1_if.h b/src/host/virt_phy/src/gsmtapl1_if.h index 8c7491c..09d34f4 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.h +++ b/src/host/virt_phy/src/gsmtapl1_if.h @@ -12,7 +12,7 @@ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); void gsmtapl1_rx_from_virt_um(struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_tx_to_virt_um(struct msgb *msg); +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg); +void gsmtapl1_tx_to_virt_um(uint8_t tn, uint32_t fn, uint8_t gsmtap_chan, struct msgb *msg); uint8_t chantype_gsmtap2rsl(uint8_t gsmtap_chantype); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 46121ed..b5fb0f0 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -12,6 +13,7 @@ #include "virt_l1_model.h" #include "l1ctl_sap.h" #include "logging.h" +#include "gsmtapl1_if.h" static struct l1_model_ms *l1_model_ms = NULL; @@ -30,6 +32,7 @@ */ void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) { + // check if the received msg is not empty if (msg) { DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); @@ -177,6 +180,8 @@ break; case L1CTL_RACH_REQ: l1ctl_rx_rach_req(msg); + // msg is freed by rx routine + goto exit_nofree; break; case L1CTL_DATA_REQ: l1ctl_rx_data_req(msg); @@ -232,11 +237,18 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); - l1ctl_tx_fbsb_conf(0, ntohs(sync_req->band_arfcn)); + l1_model_ms->state->camping = 1; + l1_model_ms->state->serving_cell.arfcn = ntohs(sync_req->band_arfcn); + l1_model_ms->state->serving_cell.ccch_mode = sync_req->ccch_mode; + l1_model_ms->state->serving_cell.fn_offset = 0; + l1_model_ms->state->serving_cell.bsic = 0; + l1_model_ms->state->serving_cell.time_alignment = 0; + // TODO: reset and synchronize the ms uplink schedulers with bts multiframe structure. + + l1ctl_tx_fbsb_conf(0, l1_model_ms->state->serving_cell.arfcn); } /** @@ -418,16 +430,37 @@ */ void l1ctl_rx_rach_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; + + uint32_t fn_sched; + uint8_t ts; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", rach_req->ra, ntohs(rach_req->offset), rach_req->combined); -// l1a_rach_req(ntohs(rach_req->offset), rach_req->combined, + // TODO: calculate correct fn/ts for a RACH (if needed by bts) + // TODO: implement scheduler for uplink! + fn_sched = 42; + ts = 0; + // for the rach channel request, there is no layer2 header, but only the one bit ra content to submit + // see 4.18-9.1.8 CHannel Request + // that means we have to set l2h of msgb to the ra content + msg->l2h = &rach_req->ra; + // avoid all data after ra to also be submitted + msgb_trim(msg, sizeof(rach_req->ra)); + // TODO: check if we need to submit more data than the ra content to the bts + + // send rach over virt um + gsmtapl1_tx_to_virt_um(ts, fn_sched, GSMTAP_CHANNEL_RACH, msg); + + // send confirm to layer23 + l1ctl_tx_rach_conf(fn_sched, l1_model_ms->state->serving_cell.arfcn); + +// l1a_rach_req(ntohs(rach_req->offset), rach_req->combined, // rach_req->ra); } @@ -481,7 +514,9 @@ * * Process power measurement for a given range of arfcns to calculate signal power and connection quality. * - * Note: We do not need to calculate that for the virtual physical layer, but l23 apps can expect a response. So this response is mocked here. + * Note: We do not need to calculate that for the virtual physical layer, + * but l23 apps can expect a response. So this response is mocked here. + * TODO: Might be possible to sync to different virtual BTS. Mapping from arfcn to mcast address would be needed. Configurable rx_lev for each mcast address. */ void l1ctl_rx_pm_req(struct msgb *msg) { @@ -499,11 +534,11 @@ for(arfcn_next = pm_req->range.band_arfcn_from; arfcn_next <= pm_req->range.band_arfcn_to; ++arfcn_next) { struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *)msgb_put(resp_msg, sizeof(*pm_conf)); pm_conf->band_arfcn = htons(arfcn_next); - // rxlev 63 is great, 0 is bad the two values are probably min and max + // rxlev 63 is great, 0 is bad the two values are min and max pm_conf->pm[0] = 63; pm_conf->pm[1] = 63; if(arfcn_next == pm_req->range.band_arfcn_to) { - struct l1ctl_hdr *resp_l1h = resp_msg->l1h; + struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; } // no more space in msgb, flush to l2 @@ -526,6 +561,10 @@ * * Reset layer 1 (state machine, scheduler, transceiver) depending on the reset type. * + * Note: Currently we do not perform anything else than response with a reset confirm + * to just tell l2 that we are rdy. + * TODO: Validate if an action has to be done here. + * */ void l1ctl_rx_reset_req(struct msgb *msg) { @@ -534,22 +573,16 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); -// l1s_reset(); -// l1s_reset_hw(); -// audio_set_enabled(GSM48_CMODE_SIGN, 0); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + l1_model_ms->state->camping = 0; l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); -// sched_gsmtime_reset(); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; default: - LOGP(DL1C, LOGL_ERROR, - "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); break; } } @@ -738,6 +771,23 @@ } /** + * @brief Transmit L1CTL_RESET_IND or L1CTL_RESET_CONF to layer 23. + * + * -- reset indication / confirm -- + * + * @param [in] msg_type L1CTL primitive message type. + * @param [in] reset_type reset type (full, boot or just scheduler reset). + */ +void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn) +{ + struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); + + DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", + getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); + l1ctl_sap_tx_to_l23(msg); +} + +/** * @brief Transmit L1CTL msg of a given type to layer 23. * * @param [in] msg_type L1CTL primitive message type. diff --git a/src/host/virt_phy/src/l1ctl_sap.h b/src/host/virt_phy/src/l1ctl_sap.h index 2d67128..f540197 100644 --- a/src/host/virt_phy/src/l1ctl_sap.h +++ b/src/host/virt_phy/src/l1ctl_sap.h @@ -46,6 +46,7 @@ /* transmit routines */ void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type); +void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn); void l1ctl_tx_pm_conf(struct l1ctl_pm_req *pm_req); void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn); void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index e52b731..b507369 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -42,6 +42,8 @@ #include +#include + #include "l1ctl_sock.h" #include "virtual_um.h" #include "logging.h" @@ -59,14 +61,13 @@ static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what) { struct l1ctl_sock_inst *lsi = ofd->data; - int cnt = 0; // Check if request is really read request if (what & BSC_FD_READ) { struct msgb *msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, "L1CTL sock rx"); int rc; uint16_t len; - + struct l1ctl_hdr *l1h; // read length of the message first and convert to host byte order rc = read(ofd->fd, &len, sizeof(len)); if (rc < sizeof(len)) { @@ -81,7 +82,8 @@ if (rc == len) { msgb_put(msg, rc); - msg->l1h = msgb_data(msg); + l1h = msgb_data(msg); + msg->l1h = l1h; lsi->recv_cb(lsi, msg); return 0; } diff --git a/src/host/virt_phy/src/virt_l1_model.h b/src/host/virt_phy/src/virt_l1_model.h index 55a1e3a..f0619ab 100644 --- a/src/host/virt_phy/src/virt_l1_model.h +++ b/src/host/virt_phy/src/virt_l1_model.h @@ -13,6 +13,7 @@ //TODO: must contain logical channel information (fram number, ciphering mode, ...) struct l1_state_ms { + uint8_t camping; /* the cell on which we are camping right now */ struct l1_cell_info serving_cell; -- To view, visit https://gerrit.osmocom.org/3198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic15188c5c0bba96c223d689be733324a9778a2e8 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:52 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: coding style / API usage cleanup In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: coding style / API usage cleanup ...................................................................... VIRT-PHY: coding style / API usage cleanup This is the result of my manual clean-up of the many coding style issues found in the stumpf/virt-phy branch of OsmocomBB. Some may remain, but it's much closer to what we're used to in the Osmocom world now. Change-Id: I3aa95dbef75d7749d490aad0237d074528527e8b --- M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 12 files changed, 564 insertions(+), 486 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 2e1a207..ae9cd32 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -1,12 +1,12 @@ /* GSMTAP layer1 is transmits gsmtap messages over a virtual layer 1.*/ -/* (C) 2016 Sebastian Stumpf +/* (C) 2016 by Sebastian Stumpf * * 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 + * 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, @@ -14,7 +14,7 @@ * 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 + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ @@ -40,47 +40,45 @@ static struct l1_model_ms *l1_model_ms = NULL; -// for debugging -static const struct value_string gsmtap_channels[22] = { - {GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN"}, - {GSMTAP_CHANNEL_BCCH, "BCCH"}, - {GSMTAP_CHANNEL_CCCH, "CCCH"}, - {GSMTAP_CHANNEL_RACH, "RACH"}, - {GSMTAP_CHANNEL_AGCH, "AGCH"}, - {GSMTAP_CHANNEL_PCH, "PCH"}, - {GSMTAP_CHANNEL_SDCCH, "SDCCH"}, - {GSMTAP_CHANNEL_SDCCH4, "SDCCH/4"}, - {GSMTAP_CHANNEL_SDCCH8, "SDCCH/8"}, - {GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F"}, - {GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H"}, - {GSMTAP_CHANNEL_PACCH, "PACCH"}, - {GSMTAP_CHANNEL_CBCH52, "CBCH"}, - {GSMTAP_CHANNEL_PDCH, "PDCH"}, - {GSMTAP_CHANNEL_PTCCH, "PTTCH"}, - {GSMTAP_CHANNEL_CBCH51, "CBCH"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_SDCCH, "LSACCH"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_SDCCH4, "SACCH/4"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_SDCCH8, "SACCH/8"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_TCH_F, "SACCH/F"}, - {GSMTAP_CHANNEL_ACCH | - GSMTAP_CHANNEL_TCH_H, "SACCH/H"}, - {0, NULL}, }; -// for debugging -static const struct value_string gsmtap_types[10] = {{ - GSMTAP_TYPE_UM, - "GSM Um (MS<->BTS)"}, {GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)"}, { - GSMTAP_TYPE_UM_BURST, - "GSM Um burst (MS<->BTS)"}, {GSMTAP_TYPE_SIM, "SIM"}, { - GSMTAP_TYPE_TETRA_I1, - "TETRA V+D"}, {GSMTAP_TYPE_WMX_BURST, "WiMAX burst"}, { - GSMTAP_TYPE_GMR1_UM, - "GMR-1 air interfeace (MES-MS<->GTS)"}, { - GSMTAP_TYPE_UMTS_RLC_MAC, - "UMTS RLC/MAC"}, {GSMTAP_TYPE_UMTS_RRC, "UMTS RRC"}, {0, NULL}, }; +/* for debugging */ +static const struct value_string gsmtap_channels[] = { + { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, + { GSMTAP_CHANNEL_BCCH, "BCCH" }, + { GSMTAP_CHANNEL_CCCH, "CCCH" }, + { GSMTAP_CHANNEL_RACH, "RACH" }, + { GSMTAP_CHANNEL_AGCH, "AGCH" }, + { GSMTAP_CHANNEL_PCH, "PCH" }, + { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, + { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, + { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, + { GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F" }, + { GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H" }, + { GSMTAP_CHANNEL_PACCH, "PACCH" }, + { GSMTAP_CHANNEL_CBCH52, "CBCH" }, + { GSMTAP_CHANNEL_PDCH, "PDCH" } , + { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, + { GSMTAP_CHANNEL_CBCH51, "CBCH" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH, "LSACCH" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, + { 0, NULL } +}; + +/* for debugging */ +static const struct value_string gsmtap_types[10] = { + { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, + { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, + { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, + { GSMTAP_TYPE_SIM, "SIM Card" }, + { GSMTAP_TYPE_TETRA_I1, "TETRA V+D" }, + { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, + { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)"}, + { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, + { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, + { 0, NULL } +}; void gsmtapl1_init(struct l1_model_ms *model) { @@ -91,48 +89,46 @@ * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, - struct msgb *msg) + struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; - struct msgb *outmsg; // msg to send with gsmtap header prepended - uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; // arfcn of the cell we currently camp on - uint8_t signal_dbm = 63; // signal strength, 63 is best - uint8_t snr = 63; // signal noise ratio, 63 is best - uint8_t *data = msgb_l2(msg); // data to transmit (whole message without l1 header) - uint8_t data_len = msgb_l2len(msg); // length of data + struct msgb *outmsg; /* msg to send with gsmtap header prepended */ + uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; /* arfcn of the cell we currently camp on */ + uint8_t signal_dbm = 63; /* signal strength */ + uint8_t snr = 63; /* signal noise ratio, 63 is best */ + uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ + uint8_t data_len = msgb_l2len(msg); /* length of data */ - uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) - uint8_t subslot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) - uint8_t timeslot; // tdma timeslot to send in (0-7) - uint8_t gsmtap_chan; // the gsmtap channel + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t subslot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t gsmtap_chan; /* the gsmtap channel */ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); - // arfcn needs to be flagged to be able to distinguish between uplink and downlink + /* arfcn needs to be flagged to be able to distinguish between uplink and downlink */ outmsg = gsmtap_makemsg(arfcn | GSMTAP_ARFCN_F_UPLINK, timeslot, - gsmtap_chan, subslot, fn, signal_dbm, snr, data, - data_len); + gsmtap_chan, subslot, fn, signal_dbm, snr, data, + data_len); if (outmsg) { outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); if (virt_um_write_msg(l1_model_ms->vui, outmsg) == -1) { - LOGP(DVIRPHY, - LOGL_ERROR, - "Gsmtap msg could not send to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not send to virt um - " + "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, gh->sub_slot); } else { - DEBUGP(DVIRPHY, - "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + DEBUGP(DVIRPHY, "Sending gsmtap msg to virt um - " + "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, gh->sub_slot); } - } else { + } else LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); - } /* free message */ msgb_free(msg); @@ -166,96 +162,89 @@ * - if in MS_STATE_IDLE_SEARCHING */ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, - struct msgb *msg) + struct msgb *msg) { - if (!msg) { + if (!msg) return; - } struct gsmtap_hdr *gh = msgb_l1(msg); - uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg - uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg - uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type - uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); // Power measurement with each received massage - uint8_t snr = gh->snr_db; // signal noise ratio, 63 is best - uint8_t subslot = gh->sub_slot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) - uint8_t timeslot = gh->timeslot; // tdma timeslot to send in (0-7) - uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) - uint8_t link_id; // rsl link id tells if this is an ssociated or dedicated link - uint8_t chan_nr; // encoded rsl channel type, timeslot and mf subslot + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ + uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ + uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); /* Power measurement with each received massage */ + uint8_t snr = gh->snr_db; /* signal noise ratio */ + uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ + uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ - // generally ignore all uplink messages received + /* generally ignore all uplink messages received */ if (arfcn & GSMTAP_ARFCN_F_UPLINK) { - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); goto freemsg; } - - // we do not forward messages to l23 if we are in network search state - if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { + /* we do not forward messages to l23 if we are in network search state */ + if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) goto freemsg; - } - // forward downlink msg to fbsb sync routine if we are in sync state + /* forward downlink msg to fbsb sync routine if we are in sync state */ if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { prim_fbsb_sync(msg); return; } - - // generally ignore all messages coming from another arfcn than the camped one + /* generally ignore all messages coming from another arfcn than the camped one */ if (l1_model_ms->state->serving_cell.arfcn != arfcn) { - LOGP(DVIRPHY, - LOGL_NOTICE, + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn, - l1_model_ms->state->serving_cell.arfcn); + arfcn, l1_model_ms->state->serving_cell.arfcn); goto freemsg; } msg->l2h = msgb_pull(msg, sizeof(*gh)); chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); - // see GSM 8.58 -> 9.3.1 for channel number encoding + /* see TS 08.58 -> 9.3.1 for channel number encoding */ chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); virt_l1_sched_sync_time(l1_model_ms->state->downlink_time, 0); virt_l1_sched_execute(fn); - DEBUGP(DVIRPHY, - "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", + DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " + "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", arfcn, fn, get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); - // switch case with removed acch flag + /* switch case with removed ACCH flag */ switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { case GSMTAP_CHANNEL_TCH_H: case GSMTAP_CHANNEL_TCH_F: -#if(0) - // TODO: handle msgs on TCH that are neither FACCH nor TCH/ACCH - if(!facch && ! tch_acch) { +#if 0 + /* TODO: handle voice */ + if (!facch && !tch_acch) { l1ctl_tx_traffic_ind(msg, arfcn, link_id, chan_nr, fn, - snr, signal_dbm, 0, 0); + snr, signal_dbm, 0, 0); } #endif case GSMTAP_CHANNEL_SDCCH4: case GSMTAP_CHANNEL_SDCCH8: - // only forward messages on dedicated channels to l2, if the timeslot and subslot is fitting - if(l1_model_ms->state->dedicated.tn == timeslot && l1_model_ms->state->dedicated.subslot == subslot) { - l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, - signal_dbm, 0, 0); + /* only forward messages on dedicated channels to l2, if + * the timeslot and subslot is fitting */ + if (l1_model_ms->state->dedicated.tn == timeslot + && l1_model_ms->state->dedicated.subslot == subslot) { + l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); } break; case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: - // save to just forward here, as upper layer ignores messages that do not fit the current state (e.g. gsm48_rr.c:2159) - l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, - signal_dbm, 0, 0); + /* save to just forward here, as upper layer ignores messages that + * do not fit the current state (e.g. gsm48_rr.c:2159) */ + l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: - LOGP(DVIRPHY, - LOGL_NOTICE, + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); break; case GSMTAP_CHANNEL_SDCCH: @@ -265,19 +254,16 @@ case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: - LOGP(DVIRPHY, - LOGL_NOTICE, + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - channel type not supported!\n"); break; default: - LOGP(DVIRPHY, - LOGL_NOTICE, + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - channel type unknown.\n"); break; } - freemsg: - // handle memory deallocation +freemsg: talloc_free(msg); } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 9957bf3..0871f1f 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -1,5 +1,25 @@ /* L1CTL SAP implementation. */ +/* (C) 2016 by Sebastian Stumpf + * + * 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, see . + * + */ + + #include #include #include @@ -23,12 +43,10 @@ static void l1_model_tch_mode_set(uint8_t tch_mode) { - if (tch_mode == GSM48_CMODE_SPEECH_V1 - || tch_mode == GSM48_CMODE_SPEECH_EFR) { + if (tch_mode == GSM48_CMODE_SPEECH_V1 || tch_mode == GSM48_CMODE_SPEECH_EFR) l1_model_ms->state->tch_mode = tch_mode; - - } else { - // set default value if no proper mode was assigned by l23 + else { + /* set default value if no proper mode was assigned by l23 */ l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; } } @@ -51,13 +69,11 @@ * * Enqueues the message into the rx queue. */ -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, - struct msgb *msg) +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) { - // check if the received msg is not empty + /* check if the received msg is not empty */ if (msg) { - DEBUGP(DL1C, "Message incoming from layer 2: %s\n", - osmo_hexdump(msg->data, msg->len)); + DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); l1ctl_sap_handler(msg); } } @@ -76,10 +92,8 @@ */ void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg) { - uint16_t *len; /* prepend 16bit length before sending */ - len = (uint16_t *)msgb_push(msg, sizeof(*len)); - *len = htons(msg->len - sizeof(*len)); + msgb_push_u16(msg, msg->len); l1ctl_sock_write_msg(lsi, msg); } @@ -108,15 +122,11 @@ { struct msgb *msg; struct l1ctl_hdr *l1h; - msg = msgb_alloc_headroom(L3_MSG_SIZE, L3_MSG_HEAD, "l1ctl"); - if (!msg) { - while (1) { - puts("OOPS. Out of buffers...\n"); - } - return NULL; - } - l1h = (struct l1ctl_hdr *)msgb_put(msg, sizeof(*l1h)); + msg = msgb_alloc_headroom(L3_MSG_SIZE, L3_MSG_HEAD, "l1ctl"); + OSMO_ASSERT(msg); + + l1h = (struct l1ctl_hdr *) msgb_put(msg, sizeof(*l1h)); l1h->msg_type = msg_type; l1h->flags = 0; @@ -142,13 +152,12 @@ * [l1ctl_info_dl] : initialized with params. msgb->data points here. * [spare-bytes] : L3_MSG_DATA bytes reserved for data. msgb->tail points here. */ -struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, - uint16_t arfcn) +struct msgb *l1ctl_create_l2_msg(int msg_type, uint32_t fn, uint16_t snr, uint16_t arfcn) { struct l1ctl_info_dl *dl; struct msgb *msg = l1ctl_msgb_alloc(msg_type); - dl = (struct l1ctl_info_dl *)msgb_put(msg, sizeof(*dl)); + dl = (struct l1ctl_info_dl *) msgb_put(msg, sizeof(*dl)); dl->frame_nr = htonl(fn); dl->snr = htons(snr); dl->band_arfcn = htons(arfcn); @@ -160,21 +169,18 @@ * @brief General handler for incoming L1CTL messages from layer 2/3. * * This handler will call the specific routine dependent on the L1CTL message type. - * */ void l1ctl_sap_handler(struct msgb *msg) { struct l1ctl_hdr *l1h; - if (!msg) { + if (!msg) return; - } - l1h = (struct l1ctl_hdr *)msg->data; + l1h = (struct l1ctl_hdr *) msg->data; if (sizeof(*l1h) > msg->len) { - LOGP(DL1C, LOGL_NOTICE, "Malformed message: too short. %u\n", - msg->len); + LOGP(DL1C, LOGL_NOTICE, "Malformed message: too short. %u\n", msg->len); goto exit_msgbfree; } @@ -226,8 +232,11 @@ break; } - exit_msgbfree: msgb_free(msg); - exit_nofree: return; /* msg is scheduled for uplink and mustn't be freed here */ +exit_msgbfree: + msgb_free(msg); + +exit_nofree: + return; /* msg is scheduled for uplink and mustn't be freed here */ } /*************************************************************** @@ -248,17 +257,15 @@ */ void l1ctl_rx_dm_est_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_dm_est_req *est_req = - (struct l1ctl_dm_est_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_dm_est_req *est_req = (struct l1ctl_dm_est_req *) ul->payload; uint8_t rsl_chantype, subslot, timeslot; rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", - ul->chan_nr, timeslot, subslot); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", + ul->chan_nr, timeslot, subslot); l1_model_ms->state->dedicated.chan_type = rsl_chantype; l1_model_ms->state->dedicated.tn = timeslot; @@ -266,12 +273,12 @@ l1_model_ms->state->state = MS_STATE_DEDICATED; /* TCH config */ - if (rsl_chantype == RSL_CHAN_Bm_ACCHs - || rsl_chantype == RSL_CHAN_Lm_ACCHs) { + if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { l1_model_ms->state->tch_mode = est_req->tch_mode; l1_model_tch_mode_set(est_req->tch_mode); l1_model_ms->state->audio_mode = est_req->audio_mode; - // TODO: configure audio hardware for encoding / decoding / recording / playing voice + /* TODO: configure audio hardware for encoding / + * decoding / recording / playing voice */ } } @@ -288,15 +295,12 @@ */ void l1ctl_rx_dm_freq_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_dm_freq_req *freq_req = - (struct l1ctl_dm_freq_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_dm_freq_req *freq_req = (struct l1ctl_dm_freq_req *) ul->payload; - DEBUGP(DL1C, - "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", - ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, - freq_req->h1.maio); + DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", + ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, freq_req->h1.maio); } /** @@ -315,23 +319,21 @@ */ void l1ctl_rx_crypto_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *) ul->payload; uint8_t key_len = msg->len - sizeof(*l1h) - sizeof(*ul) - sizeof(*cr); - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", - cr->algo, key_len); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", + cr->algo, key_len); if (cr->algo && key_len != A5_KEY_LEN) { - DEBUGP(DL1C, "L1CTL_CRYPTO_REQ -> Invalid key\n"); + LOGP(DL1C, LOGL_ERROR, "L1CTL_CRYPTO_REQ -> Invalid key\n"); return; } l1_model_ms->crypto_inf->algo = cr->algo; - memcpy(l1_model_ms->crypto_inf->key, cr->key, - sizeof(uint8_t) * A5_KEY_LEN); + memcpy(l1_model_ms->crypto_inf->key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); } /** @@ -354,8 +356,8 @@ l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; - // TODO: disable ciphering - // TODO: disable audio recording / playing + /* TODO: disable ciphering */ + /* TODO: disable audio recording / playing */ } /** @@ -375,9 +377,8 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_par_req *par_req = (struct l1ctl_par_req *)ul->payload; - DEBUGP(DL1C, - "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", - par_req->ta, par_req->tx_power); + DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", + par_req->ta, par_req->tx_power); } /** @@ -395,26 +396,23 @@ */ void l1ctl_rx_reset_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_reset *reset_req = (struct l1ctl_reset *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_reset *reset_req = (struct l1ctl_reset *) l1h->data; switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; virt_l1_sched_stop(); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: virt_l1_sched_restart(l1_model_ms->state->downlink_time); - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; default: - LOGP(DL1C, LOGL_ERROR, - "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); break; } } @@ -434,16 +432,15 @@ */ void l1ctl_rx_ccch_mode_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_ccch_mode_req *ccch_mode_req = - (struct l1ctl_ccch_mode_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_ccch_mode_req *ccch_mode_req = (struct l1ctl_ccch_mode_req *) l1h->data; uint8_t ccch_mode = ccch_mode_req->ccch_mode; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); l1_model_ms->state->serving_cell.ccch_mode = ccch_mode; - // check if more has to be done here + /* check if more has to be done here */ l1ctl_tx_ccch_mode_conf(ccch_mode); } @@ -460,21 +457,18 @@ */ void l1ctl_rx_tch_mode_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_tch_mode_req *tch_mode_req = - (struct l1ctl_tch_mode_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_tch_mode_req *tch_mode_req = (struct l1ctl_tch_mode_req *) l1h->data; l1_model_tch_mode_set(tch_mode_req->tch_mode); l1_model_ms->state->audio_mode = tch_mode_req->audio_mode; - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", - tch_mode_req->tch_mode, tch_mode_req->audio_mode); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", + tch_mode_req->tch_mode, tch_mode_req->audio_mode); - // TODO: configure audio hardware for encoding / decoding / recording / playing voice + /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ - l1ctl_tx_tch_mode_conf(l1_model_ms->state->tch_mode, - l1_model_ms->state->audio_mode); + l1ctl_tx_tch_mode_conf(l1_model_ms->state->tch_mode, l1_model_ms->state->audio_mode); } /** @@ -492,13 +486,11 @@ */ void l1ctl_rx_neigh_pm_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_neigh_pm_req *pm_req = - (struct l1ctl_neigh_pm_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_neigh_pm_req *pm_req = (struct l1ctl_neigh_pm_req *) l1h->data; - DEBUGP(DL1C, - "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", - pm_req->n); + DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", + pm_req->n); } /** @@ -525,9 +517,8 @@ uint16_t len = msg->len - sizeof(struct l1ctl_hdr); uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); - DEBUGP(DL1C, - "Received and ignored from l23 - SIM Request length: %u, data: %s: ", - len, osmo_hexdump(data, sizeof(data))); + LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - SIM Request length: %u, data: %s\n", + len, osmo_hexdump(data, sizeof(data))); } @@ -548,12 +539,11 @@ void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type) { struct msgb *msg = l1ctl_msgb_alloc(msg_type); - struct l1ctl_reset *reset_resp; - reset_resp = (struct l1ctl_reset *)msgb_put(msg, sizeof(*reset_resp)); - reset_resp->type = reset_type; + struct l1ctl_reset *reset_resp = (struct l1ctl_reset *) msgb_put(msg, sizeof(*reset_resp)); - DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", - getL1ctlPrimName(msg_type), reset_type); + reset_resp->type = reset_type; + DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); + l1ctl_sap_tx_to_l23(msg); } @@ -570,12 +560,11 @@ { struct msgb *msg = l1ctl_msgb_alloc(L1CTL_CCCH_MODE_CONF); struct l1ctl_ccch_mode_conf *mode_conf; - mode_conf = (struct l1ctl_ccch_mode_conf *)msgb_put(msg, - sizeof(*mode_conf)); + + mode_conf = (struct l1ctl_ccch_mode_conf *) msgb_put(msg, sizeof(*mode_conf)); mode_conf->ccch_mode = ccch_mode; - DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", - ccch_mode); + DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); l1ctl_sap_tx_to_l23(msg); } @@ -593,56 +582,53 @@ { struct msgb *msg = l1ctl_msgb_alloc(L1CTL_TCH_MODE_CONF); struct l1ctl_tch_mode_conf *mode_conf; - mode_conf = (struct l1ctl_tch_mode_conf *)msgb_put(msg, - sizeof(*mode_conf)); + + mode_conf = (struct l1ctl_tch_mode_conf *) msgb_put(msg, sizeof(*mode_conf)); mode_conf->tch_mode = tch_mode; mode_conf->audio_mode = audio_mode; - DEBUGP(DL1C, - "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", - tch_mode, audio_mode); + DEBUGP(DL1C, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", + tch_mode, audio_mode); l1ctl_sap_tx_to_l23(msg); } /** * @brief Get the scheduled fn for a msg depending on its chan_nr and link_id. */ -uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, - uint8_t link_id) +uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, uint8_t link_id) { uint8_t chan_type, chan_ss, chan_ts; - rsl_dec_chan_nr(chan_nr, &chan_type, &chan_ss, &chan_ts); - uint32_t sched_fn = cur_time.fn; uint16_t mod_102 = cur_time.fn % 2 * 51; + + rsl_dec_chan_nr(chan_nr, &chan_type, &chan_ss, &chan_ts); + + /* TODO: Replace this spaghetti monster with some lookup table */ switch (chan_type) { case RSL_CHAN_Bm_ACCHs: switch (link_id) { case LID_DEDIC: - // dl=[0...11,13...24] ul=[0...11,13...24] - // skip idle frames and frames reserved for TCH_ACCH - if(cur_time.t2 == 12 || cur_time.t2 == 25) { + /* dl=[0...11,13...24] ul=[0...11,13...24] + * skip idle frames and frames reserved for TCH_ACCH */ + if (cur_time.t2 == 12 || cur_time.t2 == 25) sched_fn++; - } break; - // dl=42, ul=42+15 + /* dl=42, ul=42+15 */ case LID_SACCH: - if((chan_ts & 1)) { - // Odd traffic channel timeslot -> dl=[25] ul=[25] - // TCH_ACCH always at the end of tch multiframe (mod 26) + if ((chan_ts & 1)) { + /* Odd traffic channel timeslot -> dl=[25] ul=[25] + * TCH_ACCH always at the end of tch multiframe (mod 26) */ sched_fn -= cur_time.t2; sched_fn += 25; - } - else { - // Even traffic channel timeslot -> dl=[12] ul=[12] - if(cur_time.t2 <= 12) { + } else { + /* Even traffic channel timeslot -> dl=[12] ul=[12] */ + if (cur_time.t2 <= 12) { sched_fn -= cur_time.t2; sched_fn += 12; } else { sched_fn -= cur_time.t2; sched_fn += 26 + 12; } - } break; } @@ -653,9 +639,9 @@ switch (chan_ss) { case 0: switch (link_id) { - // dl=22, ul=22+15 + /* dl=22, ul=22+15 */ case LID_DEDIC: - if(cur_time.t3 <= 22 + 15) { + if (cur_time.t3 <= 22 + 15) { sched_fn -= cur_time.t3; sched_fn += 22 + 15; } else { @@ -663,9 +649,9 @@ sched_fn += 51 + 22 + 15; } break; - // dl=42, ul=42+15 + /* dl=42, ul=42+15 */ case LID_SACCH: - if(mod_102 <= 42 + 15) { + if (mod_102 <= 42 + 15) { sched_fn -= mod_102; sched_fn += 42 + 15; } else { @@ -677,9 +663,9 @@ break; case 1: switch (link_id) { - // dl=26, ul=26+15 + /* dl=26, ul=26+15 */ case LID_DEDIC: - if(cur_time.t3 <= 26 + 15) { + if (cur_time.t3 <= 26 + 15) { sched_fn -= cur_time.t3; sched_fn += 26 + 15; } else { @@ -687,9 +673,9 @@ sched_fn += 51 + 26 + 15; } break; - // dl=46, ul=46+15 + /* dl=46, ul=46+15 */ case LID_SACCH: - if(mod_102 <= 46 + 15) { + if (mod_102 <= 46 + 15) { sched_fn -= mod_102; sched_fn += 46 + 15; } else { @@ -701,9 +687,9 @@ break; case 2: switch (link_id) { - // dl=32, ul=32+15 + /* dl=32, ul=32+15 */ case LID_DEDIC: - if(cur_time.t3 <= 32 + 15) { + if (cur_time.t3 <= 32 + 15) { sched_fn -= cur_time.t3; sched_fn += 32 + 15; } else { @@ -711,9 +697,9 @@ sched_fn += 51 + 32 + 15; } break; - // dl=51+42, ul=51+42+15 + /* dl=51+42, ul=51+42+15 */ case LID_SACCH: - if(mod_102 <= 51 + 42 + 15) { + if (mod_102 <= 51 + 42 + 15) { sched_fn -= mod_102; sched_fn += 51 + 42 + 15; } else { @@ -725,9 +711,9 @@ break; case 3: switch (link_id) { - // dl=36, ul=36+15 + /* dl=36, ul=36+15 */ case LID_DEDIC: - if(cur_time.t3 <= 36 + 15) { + if (cur_time.t3 <= 36 + 15) { sched_fn -= cur_time.t3; sched_fn += 36 + 15; } else { @@ -735,9 +721,9 @@ sched_fn += 51 + 36 + 15; } break; - // dl=51+46, ul=51+46+15 + /* dl=51+46, ul=51+46+15 */ case LID_SACCH: - if(mod_102 <= 51 + 46 + 15) { + if (mod_102 <= 51 + 46 + 15) { sched_fn -= mod_102; sched_fn += 51 + 46 + 15; } else { @@ -753,9 +739,9 @@ switch (chan_ss) { case 0: switch (link_id) { - // dl=0, ul=0+15 + /* dl=0, ul=0+15 */ case LID_DEDIC: - if(cur_time.t3 <= 0 + 15) { + if (cur_time.t3 <= 0 + 15) { sched_fn -= cur_time.t3; sched_fn += 0 + 15; } else { @@ -763,9 +749,9 @@ sched_fn += 51 + 0 + 15; } break; - // dl=32, ul=32+15 + /* dl=32, ul=32+15 */ case LID_SACCH: - if(mod_102 <= 32 + 15) { + if (mod_102 <= 32 + 15) { sched_fn -= mod_102; sched_fn += 32 + 15; } else { @@ -777,9 +763,9 @@ break; case 1: switch (link_id) { - // dl=4, ul=4+15 + /* dl=4, ul=4+15 */ case LID_DEDIC: - if(cur_time.t3 <= 4 + 15) { + if (cur_time.t3 <= 4 + 15) { sched_fn -= cur_time.t3; sched_fn += 4 + 15; } else { @@ -787,9 +773,9 @@ sched_fn += 51 + 4 + 15; } break; - // dl=36, ul=36+15 + /* dl=36, ul=36+15 */ case LID_SACCH: - if(mod_102 <= 36 + 15) { + if (mod_102 <= 36 + 15) { sched_fn -= mod_102; sched_fn += 36 + 15; } else { @@ -801,9 +787,9 @@ break; case 2: switch (link_id) { - // dl=8, ul=8+15 + /* dl=8, ul=8+15 */ case LID_DEDIC: - if(cur_time.t3 <= 8 + 15) { + if (cur_time.t3 <= 8 + 15) { sched_fn -= cur_time.t3; sched_fn += 8 + 15; } else { @@ -811,9 +797,9 @@ sched_fn += 51 + 8 + 15; } break; - // dl=40, ul=40+15 + /* dl=40, ul=40+15 */ case LID_SACCH: - if(mod_102 <= 40 + 15) { + if (mod_102 <= 40 + 15) { sched_fn -= mod_102; sched_fn += 40 + 15; } else { @@ -825,9 +811,9 @@ break; case 3: switch (link_id) { - // dl=12, ul=12+15 + /* dl=12, ul=12+15 */ case LID_DEDIC: - if(cur_time.t3 <= 12 + 15) { + if (cur_time.t3 <= 12 + 15) { sched_fn -= cur_time.t3; sched_fn += 12 + 15; } else { @@ -835,9 +821,9 @@ sched_fn += 51 + 12 + 15; } break; - // dl=44, ul=44+15 + /* dl=44, ul=44+15 */ case LID_SACCH: - if(mod_102 <= 44 + 15) { + if (mod_102 <= 44 + 15) { sched_fn -= mod_102; sched_fn += 44 + 15; } else { @@ -849,9 +835,9 @@ break; case 4: switch (link_id) { - // dl=16, ul=16+15 + /* dl=16, ul=16+15 */ case LID_DEDIC: - if(cur_time.t3 <= 16 + 15) { + if (cur_time.t3 <= 16 + 15) { sched_fn -= cur_time.t3; sched_fn += 16 + 15; } else { @@ -859,9 +845,9 @@ sched_fn += 51 + 16 + 15; } break; - // dl=51+32, ul=51+32+15 + /* dl=51+32, ul=51+32+15 */ case LID_SACCH: - if(mod_102 <= 51 + 32 + 15) { + if (mod_102 <= 51 + 32 + 15) { sched_fn -= mod_102; sched_fn += 51 + 32 + 15; } else { @@ -873,9 +859,9 @@ break; case 5: switch (link_id) { - // dl=20, ul=36+15 + /* dl=20, ul=36+15 */ case LID_DEDIC: - if(cur_time.t3 <= 20 + 15) { + if (cur_time.t3 <= 20 + 15) { sched_fn -= cur_time.t3; sched_fn += 20 + 15; } else { @@ -883,9 +869,9 @@ sched_fn += 51 + 20 + 15; } break; - // dl=51+36, ul=51+36+15 ==> 0 + /* dl=51+36, ul=51+36+15 ==> 0 */ case LID_SACCH: - if(mod_102 <= 0) { + if (mod_102 <= 0) { sched_fn -= mod_102; sched_fn += 0; } else { @@ -897,9 +883,9 @@ break; case 6: switch (link_id) { - // dl=24, ul=24+15 + /* dl=24, ul=24+15 */ case LID_DEDIC: - if(cur_time.t3 <= 24 + 15) { + if (cur_time.t3 <= 24 + 15) { sched_fn -= cur_time.t3; sched_fn += 24 + 15; } else { @@ -907,9 +893,9 @@ sched_fn += 51 + 24 + 15; } break; - // dl=51+40, ul=51+40+15 ==> 4 + /* dl=51+40, ul=51+40+15 ==> 4 */ case LID_SACCH: - if(mod_102 <= 4) { + if (mod_102 <= 4) { sched_fn -= mod_102; sched_fn += 4; } else { @@ -921,9 +907,9 @@ break; case 7: switch (link_id) { - // dl=28, ul=28+15 + /* dl=28, ul=28+15 */ case LID_DEDIC: - if(cur_time.t3 <= 28 + 15) { + if (cur_time.t3 <= 28 + 15) { sched_fn -= cur_time.t3; sched_fn += 28 + 15; } else { @@ -931,9 +917,9 @@ sched_fn += 51 + 28 + 15; } break; - // dl=51+44, ul=51+44+15 ==> 8 + /* dl=51+44, ul=51+44+15 ==> 8 */ case LID_SACCH: - if(mod_102 <= 8) { + if (mod_102 <= 8) { sched_fn -= mod_102; sched_fn += 8; } else { diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index ada251c..e136aa8 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -1,12 +1,12 @@ /* Socket based Layer1 <-> Layer23 communication over L1CTL primitives. */ -/* (C) 2016 Sebastian Stumpf +/* (C) 2016 by Sebastian Stumpf * * 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 + * 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, @@ -14,7 +14,7 @@ * 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 + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ @@ -61,36 +61,39 @@ static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what) { struct l1ctl_sock_inst *lsi = ofd->data; - // Check if request is really read request - if (what & BSC_FD_READ) { - struct msgb *msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, - "L1CTL sock rx"); - int rc; - uint16_t len; - struct l1ctl_hdr *l1h; - // read length of the message first and convert to host byte order - rc = read(ofd->fd, &len, sizeof(len)); - if (rc < sizeof(len)) { - goto ERR; - } - // convert to host byte order - len = ntohs(len); - if (len <= 0 || len > L1CTL_SOCK_MSGB_SIZE) { - goto ERR; - } - rc = read(ofd->fd, msgb_data(msg), len); + struct l1ctl_hdr *l1h; + struct msgb *msg; + uint16_t len; + int rc; - if (rc == len) { - msgb_put(msg, rc); - l1h = (void *) msgb_data(msg); - msg->l1h = l1h; - lsi->recv_cb(lsi, msg); - return 0; - } - ERR: perror( - "Failed to receive msg from l2. Connection will be closed.\n"); - l1ctl_sock_disconnect(lsi); + /* Check if request is really read request */ + if (!(what & BSC_FD_READ)) + return 0; + + msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, "L1CTL sock rx"); + + /* read length of the message first and convert to host byte order */ + rc = read(ofd->fd, &len, sizeof(len)); + if (rc < sizeof(len)) + goto err_close; + + /* convert to host byte order */ + len = ntohs(len); + if (len <= 0 || len > L1CTL_SOCK_MSGB_SIZE) + goto err_close; + + rc = read(ofd->fd, msgb_data(msg), len); + if (rc == len) { + msgb_put(msg, rc); + l1h = (void *) msgb_data(msg); + msg->l1h = l1h; + lsi->recv_cb(lsi, msg); + return 0; } +err_close: + perror("Failed to receive msg from l2. Connection will be closed.\n"); + l1ctl_sock_disconnect(lsi); + return 0; } @@ -142,8 +145,7 @@ strcpy(local_addr.sun_path, path); unlink(local_addr.sun_path); - if ((rc = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) - != 0) { + if ((rc = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) != 0) { fprintf(stderr, "Failed to bind the unix domain socket. '%s'\n", local_addr.sun_path); return NULL; @@ -161,7 +163,7 @@ lsi->ofd.fd = fd; lsi->ofd.when = BSC_FD_READ; lsi->ofd.cb = l1ctl_sock_accept_cb; - // no connection -> invalid filedescriptor and not 0 (==std_in) + /* no connection -> invalid filedescriptor and not 0 (==std_in) */ lsi->connection.fd = -1; lsi->l1ctl_sock_path = path; diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 88ffd22..097bf35 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -1,6 +1,7 @@ /* Logging/Debug support of the virtual physical layer */ /* (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf * * All Rights Reserved * @@ -57,20 +58,27 @@ "L1CTL_TRAFFIC_CONF", "L1CTL_TRAFFIC_IND"}; -static const struct log_info_cat default_categories[] = {[DL1C] = { - .name = "DL1C", - .description = "Layer 1 Control", - .color = "\033[1;31m", - .enabled = 1, - .loglevel = LOGL_DEBUG, }, [DVIRPHY] = { - .name = "DVIRPHY", - .description = "Virtual Layer 1 Interface", - .color = "\033[1;31m", - .enabled = 1, - .loglevel = LOGL_DEBUG, }}; +static const struct log_info_cat default_categories[] = { + [DL1C] = { + .name = "DL1C", + .description = "Layer 1 Control", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, }, + [DVIRPHY] = { + .name = "DVIRPHY", + .description = "Virtual Layer 1 Interface", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + } +}; -const struct log_info ms_log_info = {.filter_fn = NULL, .cat = - default_categories, .num_cat = ARRAY_SIZE(default_categories), }; +const struct log_info ms_log_info = { + .filter_fn = NULL, + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; /** * Initialize the logging system for the virtual physical layer. @@ -81,9 +89,9 @@ log_init(&ms_log_info, NULL); stderr_target = log_target_create_stderr(); - if (!stderr) { + if (!stderr) return -1; - } + log_add_target(stderr_target); log_set_all_filter(stderr_target, 1); //log_set_log_level(stderr_target, 1); @@ -91,9 +99,9 @@ log_set_use_color(stderr_target, 0); log_set_print_timestamp(stderr_target, 1); log_set_print_category(stderr_target, 1); - if (cat_mask) { + if (cat_mask) log_parse_category_mask(stderr_target, cat_mask); - } + return 0; } diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index bcd6735..65e8068 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -1,3 +1,23 @@ + +/* (C) 2016 by Sebastian Stumpf + * + * 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, see . + * + */ + #include #include diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index d3975ee..40bc57a 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -1,3 +1,22 @@ +/* (C) 2016 by Sebastian Stumpf + * + * 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, see . + * + */ + #include #include #include @@ -14,7 +33,7 @@ /** * @brief Initialize schedulers data structures. */ -void virt_l1_sched_init(struct l1_model_ms * model) +void virt_l1_sched_init(struct l1_model_ms *model) { l1_model_ms = model; } @@ -53,11 +72,10 @@ struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; /* Empty tdma and mframe sched items lists */ - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) - { + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; - llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) - { + + llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) { talloc_free(ti_next->msg); llist_del(&ti_next->tdma_item_entry); } @@ -74,32 +92,31 @@ struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; uint8_t hyperframe_restart = fn < last_exec_fn; - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) - { + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { /* execute all registered handler for current mf sched item */ uint8_t exec_now = mi_next->fn <= fn || (hyperframe_restart && mi_next->fn > last_exec_fn); /* break loop, as we have an ordered list in case the hyperframe had not been reset */ uint8_t break_now = mi_next->fn > fn && !hyperframe_restart; - if(exec_now) { + if (exec_now) { struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; - // run through all scheduled tdma sched items for that frame number - llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) - { - // exec tdma sched item's handler callback - // TODO: we do not have a tdma scheduler currently and execute alle scheduled tdma items here at once + /* run through all scheduled tdma sched items for that frame number */ + llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, + tdma_item_entry) { + /* exec tdma sched item's handler callback */ + /* TODO: we do not have a TDMA scheduler currently and execute + * all scheduled tdma items here at once */ ti_next->handler_cb(mi_next->fn, ti_next->msg); - // remove handled tdma sched item + /* remove handled tdma sched item */ llist_del(&ti_next->tdma_item_entry); } - // remove handled mframe sched item + /* remove handled mframe sched item */ llist_del(&mi_next->mframe_item_entry); talloc_free(mi_next); } - if(break_now) { + if (break_now) break; - } } last_exec_fn = fn; } @@ -110,36 +127,33 @@ void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, virt_l1_sched_cb * handler_cb) { - struct virt_l1_sched_mframe_item *mi_next = NULL, *mi_tmp = NULL, - *mi_fn = NULL; + struct virt_l1_sched_mframe_item *mi_next = NULL, *mi_tmp = NULL, *mi_fn = NULL; struct virt_l1_sched_tdma_item *ti_new = NULL; - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) - { + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { if (mi_next->fn == fn) { mi_fn = mi_next; break; - } else if (mi_next->fn > fn) { + } else if (mi_next->fn > fn) break; - } } if (!mi_fn) { - // list did not contain mframe item with needed fn + /* list did not contain mframe item with needed fn */ mi_fn = talloc_zero(NULL, struct virt_l1_sched_mframe_item); mi_fn->fn = fn; - // need to manually init the struct content.... no so happy + /* need to manually init the struct content.... no so happy */ mi_fn->tdma_item_list.prev = &mi_fn->tdma_item_list; mi_fn->tdma_item_list.next = &mi_fn->tdma_item_list; - // TODO: check if we get an error if list is empty... - llist_add(&mi_fn->mframe_item_entry, - mi_next->mframe_item_entry.prev); - + /* TODO: check if we get an error if list is empty... */ + llist_add(&mi_fn->mframe_item_entry, mi_next->mframe_item_entry.prev); } + ti_new = talloc_zero(mi_fn, struct virt_l1_sched_tdma_item); ti_new->msg = msg; ti_new->handler_cb = handler_cb; ti_new->ts = ts; - // simply add at end, no ordering for tdma sched items currently - llist_add_tail(&ti_new->tdma_item_entry, &mi_fn->tdma_item_list); // TODO: ordered insert needed if tdma scheduler should be implemented + /* simply add at end, no ordering for tdma sched items currently */ + llist_add_tail(&ti_new->tdma_item_entry, &mi_fn->tdma_item_list); + /* TODO: ordered insert needed if tdma scheduler should be implemented */ } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 5d62afd..226078c 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -2,6 +2,7 @@ /* (C) 2010 by Dieter Spaar * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf * * All Rights Reserved * @@ -79,9 +80,7 @@ msg->l2h = data_ind->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, - &virt_l1_sched_handler_cb); - + virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, @@ -103,16 +102,15 @@ l1dl->frame_nr = htonl(fn); l1dl->snr = snr; l1dl->rx_level = signal_dbm; - l1dl->num_biterr = 0; // no biterrors + l1dl->num_biterr = 0; /* no biterrors */ l1dl->fire_crc = 0; - // TODO: data decoding and decryption + /* TODO: data decoding and decryption */ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); DEBUGP(DL1C, "Sending signaling-data to l23.\n"); l1ctl_sap_tx_to_l23(l1ctl_msg); - } /** @@ -127,7 +125,7 @@ { struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn, snr, arfcn); - // send confirm to layer23 + /* send confirm to layer23 */ l1ctl_sap_tx_to_l23(l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 2c0f10c..4f6306e 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -1,3 +1,26 @@ + +/* (C) 2010 by Dieter Spaar + * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf + * + * 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 @@ -31,11 +54,10 @@ */ void l1ctl_rx_fbsb_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); l1_model_ms->state->state = MS_STATE_IDLE_SYNCING; @@ -50,14 +72,15 @@ void prim_fbsb_sync(struct msgb *msg) { struct gsmtap_hdr *gh = msgb_l1(msg); - uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg - uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ - // ignore messages from other arfcns as the one requested to sync to by l23 + /* ignore messages from other arfcns as the one requested to sync to by l23 */ if (l1_model_ms->state->fbsb.arfcn != arfcn) { talloc_free(msg); - // cancel sync if we did not receive a msg on dl from the requested arfcn that we can sync to - if(sync_count++ > 20) { + /* cancel sync if we did not receive a msg on dl from + * the requested arfcn that we can sync to */ + if (sync_count++ > 20) { sync_count = 0; l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; l1ctl_tx_fbsb_conf(1, (l1_model_ms->state->fbsb.arfcn)); @@ -92,10 +115,10 @@ { struct msgb *msg; struct l1ctl_fbsb_conf *resp; - uint32_t fn = 0; // 0 should be okay here - uint16_t snr = 40; // signal noise ratio > 40db is best signal (unused in virt) - int16_t initial_freq_err = 0; // 0 means no error (unused in virt) - uint8_t bsic = 0; // bsci can be read from sync burst (unused in virt) + uint32_t fn = 0; /* 0 should be okay here */ + uint16_t snr = 40; /* signal noise ratio > 40db is best signal (unused in virt)*/ + int16_t initial_freq_err = 0; /* 0 means no error (unused in virt) */ + uint8_t bsic = 0; /* BSIC can be read from sync burst (unused in virt) */ msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, snr, arfcn); @@ -104,8 +127,7 @@ resp->result = res; resp->bsic = bsic; - DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", - getL1ctlPrimName(L1CTL_FBSB_CONF), res); + DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); l1ctl_sap_tx_to_l23(msg); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 312461c..9afee0c 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -1,3 +1,26 @@ + +/* (C) 2010 by Dieter Spaar + * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf + * + * 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 @@ -22,19 +45,26 @@ * @param [in] arfcn to change sig str for. * @param [in] sig_lev the measured signal level value. */ -uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) { - if(l1_model_ms->state->pm.timeout_s > 0 || l1_model_ms->state->pm.timeout_us > 0) { - osmo_timer_schedule(&l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[arfcn], l1_model_ms->state->pm.timeout_s, l1_model_ms->state->pm.timeout_us); +uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) +{ + if (l1_model_ms->state->pm.timeout_s > 0 || l1_model_ms->state->pm.timeout_us > 0) { + osmo_timer_schedule(&l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[arfcn], + l1_model_ms->state->pm.timeout_s, + l1_model_ms->state->pm.timeout_us); } - l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn] = sig_lev - l1_model_ms->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; - DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", arfcn, l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn], dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn])); + l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn] = + sig_lev - l1_model_ms->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; + DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", + arfcn, l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn], + dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn])); return l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn]; } -void prim_pm_timer_cb(void *data) { - // reset the signal level to bad value if no messages have been received from that rfcn for a given time - DEBUGP(DL1C, - "Timeout occurred for arfcn, signal level reset to worst value.\n"); +void prim_pm_timer_cb(void *data) +{ + /* reset the signal level to bad value if no messages have been + * received from that rfcn for a given time */ + DEBUGP(DL1C, "Timeout occurred for arfcn, signal level reset to worst value.\n"); *((int16_t*)data) = MIN_SIG_LEV_DBM; } @@ -45,50 +75,47 @@ * * @param [in] msg the received message. * - * Process power measurement for a given range of arfcns to calculate signal power and connection quality. + * Process power measurement for a given range of arfcns to calculate + * signal power and connection quality. * - * Note: This should only be called after a certain time so some messages have already been received. - * + * Note: This should only be called after a certain time so some + * messages have already been received. */ void l1ctl_rx_pm_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *)l1h->data; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *) l1h->data; struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); uint16_t arfcn_next; - // convert to host order + + /* convert to host order */ pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - DEBUGP(DL1C, - "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", - pm_req->type, pm_req->range.band_arfcn_from, - pm_req->range.band_arfcn_to); + DEBUGP(DL1C, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); for (arfcn_next = pm_req->range.band_arfcn_from; - arfcn_next <= pm_req->range.band_arfcn_to; - ++arfcn_next) { - struct l1ctl_pm_conf *pm_conf = - (struct l1ctl_pm_conf *)msgb_put(resp_msg, - sizeof(*pm_conf)); + arfcn_next <= pm_req->range.band_arfcn_to; ++arfcn_next) { + struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *) msgb_put(resp_msg, sizeof(*pm_conf)); pm_conf->band_arfcn = htons(arfcn_next); - // set min and max to the value calculated for that arfcn (IGNORE UPLINKK AND PCS AND OTHER FLAGS) + /* set min and max to the value calculated for that + * arfcn (IGNORE UPLINKK AND PCS AND OTHER FLAGS) */ pm_conf->pm[0] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); pm_conf->pm[1] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); if (arfcn_next == pm_req->range.band_arfcn_to) { struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; } - // no more space to hold mor pm info in msgb, flush to l23 + /* no more space to hold mor pm info in msgb, flush to l23 */ if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { l1ctl_sap_tx_to_l23(resp_msg); resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); } } - // transmit the remaining part of pm response to l23 - if (resp_msg) { + /* transmit the remaining part of pm response to l23 */ + if (resp_msg) l1ctl_sap_tx_to_l23(resp_msg); - } } /** @@ -100,10 +127,10 @@ { int i; l1_model_ms = model; - // init the signal level of all arfcns with the lowest value possible - memset (model->state->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); - // init timers - for(i = 0; i < 1024; ++i) { + /* init the signal level of all arfcns with the lowest value possible */ + memset(model->state->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); + /* init timers */ + for (i = 0; i < 1024; ++i) { l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].cb = prim_pm_timer_cb; l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].data = &l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[i]; } diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index e455e06..0bda7e9 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -2,6 +2,7 @@ /* (C) 2010 by Dieter Spaar * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf * * All Rights Reserved * @@ -39,26 +40,28 @@ static struct l1_model_ms *l1_model_ms = NULL; static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); -// use if we have a combined uplink (RACH, SDCCH, ...) (see http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) -// if we have no combined channel config, uplink consists of only RACH -static uint8_t t3_to_rach_comb[51] = { +/* use if we have a combined uplink (RACH, SDCCH, ...) (see + * http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) + * if we have no combined channel config, uplink consists of only RACH * */ +static const uint8_t t3_to_rach_comb[51] = { 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 26, 27, 27, 27, 27}; -static uint8_t rach_to_t3_comb[27] = { + 25, 25, 25, 25, 25, 26, 27, 27, 27, 27 +}; +static const uint8_t rach_to_t3_comb[27] = { 4, 5, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 45, 46}; + 30, 31, 32, 33, 34, 35, 36, 45, 46 +}; /** * @brief Handler callback function for RACH request. * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb *msg) { gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_rach_conf(fn, - l1_model_ms->state->serving_cell.arfcn); + l1ctl_tx_rach_conf(fn, l1_model_ms->state->serving_cell.arfcn); } /** @@ -73,30 +76,29 @@ */ void l1ctl_rx_rach_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; uint32_t fn_sched; - uint8_t ts = 1; //FIXME mostly, ts 1 is used for rach, where can i get that info? System info? + uint8_t ts = 1; /* FIXME mostly, ts 1 is used for rach, where can i get that info? System info? */ uint16_t offset = ntohs(rach_req->offset); - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", - rach_req->ra, offset, rach_req->combined); + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + rach_req->ra, offset, rach_req->combined); - if (rach_req->ra == 0x03) { + if (rach_req->ra == 0x03) fn_sched = 42; - } - // set ra data to msg (8bits, the 11bit option is not used) + /* set ra data to msg (8bits, the 11bit option is not used for GSM) */ msg->l2h = msgb_put(msg, sizeof(uint8_t)); *msg->l2h = rach_req->ra; - // chan_nr need to be encoded here, as it is not set by l23 for the rach request, but needed by virt um + /* chan_nr need to be encoded here, as it is not set by l23 for + * the rach request, but needed by virt um */ ul->chan_nr = rsl_enc_chan_nr(RSL_CHAN_RACH, 0, ts); ul->link_id = LID_DEDIC; - // sched fn calculation if we have a combined ccch channel configuration + /* sched fn calculation if we have a combined ccch channel configuration */ if (rach_req->combined) { /* add elapsed RACH slots to offset */ offset += t3_to_rach_comb[l1_model_ms->state->current_time.t3]; @@ -104,12 +106,10 @@ fn_sched = l1_model_ms->state->current_time.fn - l1_model_ms->state->current_time.t3; fn_sched += offset / 27 * 51; fn_sched += rach_to_t3_comb[offset % 27]; - } else { + } else fn_sched = l1_model_ms->state->current_time.fn + offset; - } virt_l1_sched_schedule(msg, fn_sched, ts, &virt_l1_sched_handler_cb); - } /** diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index dbdcac3..0e02153 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -2,6 +2,7 @@ /* (C) 2010 by Dieter Spaar * (C) 2010 by Harald Welte + * (C) 2016 by Sebastian Stumpf * * All Rights Reserved * @@ -63,20 +64,18 @@ */ void l1ctl_rx_traffic_req(struct msgb *msg) { - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; + struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *) ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, - ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, - &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, @@ -89,10 +88,8 @@ struct l1ctl_info_dl * l1dl; uint8_t rsl_chan_type, subchan, timeslot; l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); - l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_info_dl)); - l1ti = (struct l1ctl_traffic_ind *)msgb_put( - l1ctl_msg, sizeof(struct l1ctl_traffic_ind)); + l1dl = (struct l1ctl_info_dl *) msgb_put(l1ctl_msg, sizeof(*l1dl)); + l1ti = (struct l1ctl_traffic_ind *) msgb_put(l1ctl_msg, sizeof(*l1ti)); rsl_dec_chan_nr(chan_nr, &rsl_chan_type, &subchan, ×lot); @@ -102,10 +99,10 @@ l1dl->frame_nr = htonl(fn); l1dl->snr = snr; l1dl->rx_level = signal_dbm; - l1dl->num_biterr = 0; // no biterrors + l1dl->num_biterr = 0; /* no biterrors */ l1dl->fire_crc = 0; - // TODO: traffic decoding and decryption + /* TODO: traffic decoding and decryption */ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); DEBUGP(DL1C, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); @@ -124,7 +121,7 @@ { struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn, snr, arfcn); - // send confirm to layer23 + /* send confirm to layer23 */ l1ctl_sap_tx_to_l23(l1ctl_msg); } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index aaa9311..e4f5fd2 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -1,5 +1,24 @@ /* osmocom includes */ +/* (C) 2016 by Sebastian Stumpf + * + * 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, see . + * + */ + #include #include #include @@ -18,13 +37,13 @@ #define DEFAULT_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ #define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" -static char* dl_rx_grp = DEFAULT_MS_MCAST_GROUP; -static char* ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; +static char *dl_rx_grp = DEFAULT_MS_MCAST_GROUP; +static char *ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; static int port = DEFAULT_MCAST_PORT; -static char* log_mask = DEFAULT_LOG_MASK; -static char * l1ctl_sock_path = L1CTL_SOCK_PATH; -static char * arfcn_sig_lev_red_mask = NULL; -static char * pm_timeout = NULL; +static char *log_mask = DEFAULT_LOG_MASK; +static char *l1ctl_sock_path = L1CTL_SOCK_PATH; +static char *arfcn_sig_lev_red_mask = NULL; +static char *pm_timeout = NULL; static void handle_options(int argc, char **argv) { @@ -75,17 +94,16 @@ void parse_pm_timeout(struct l1_model_ms *model, char *pm_timeout) { - if(!pm_timeout || (strcmp(pm_timeout, "") == 0)) { + if (!pm_timeout || (strcmp(pm_timeout, "") == 0)) return; - } - // seconds + + /* seconds */ char *buf = strtok(pm_timeout, ":"); model->state->pm.timeout_s = atoi(buf); - // microseconds + /* microseconds */ buf = strtok(NULL, ":"); - if(buf) { + if (buf) model->state->pm.timeout_us = atoi(buf); - } } /** @@ -93,30 +111,30 @@ */ void parse_arfcn_sig_lev_red(struct l1_model_ms *model, char * arfcn_sig_lev_red_mask) { - if(!arfcn_sig_lev_red_mask || (strcmp(arfcn_sig_lev_red_mask, "") == 0)) { + if (!arfcn_sig_lev_red_mask || (strcmp(arfcn_sig_lev_red_mask, "") == 0)) return; - } + char *token = strtok(arfcn_sig_lev_red_mask, ":"); do { char* colon = strstr(token, ","); uint16_t arfcn; uint8_t red; - if(!colon) { + if (!colon) continue; - } + colon[0] = '\0'; arfcn = atoi(token); red = atoi(colon + 1); - //TODO: this may go wild if the token string is not properly formatted + /* TODO: this may go wild if the token string is not properly formatted */ model->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn] = red; } while ((token = strtok(NULL, ":"))); } int main(int argc, char *argv[]) { - // init loginfo + /* init loginfo */ static struct l1_model_ms *model; handle_options(argc, argv); @@ -136,7 +154,7 @@ l1ctl_sap_init(model); virt_l1_sched_init(model); - // apply timeout and arfcn reduction value config to model + /* apply timeout and arfcn reduction value config to model */ parse_pm_timeout(model, pm_timeout); parse_arfcn_sig_lev_red(model, arfcn_sig_lev_red_mask); @@ -146,12 +164,12 @@ l1ctl_sock_path); while (1) { - // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) + /* handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) */ osmo_select_main(0); } l1_model_ms_destroy(model); - // not reached + /* not reached */ return EXIT_FAILURE; } -- To view, visit https://gerrit.osmocom.org/3217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3aa95dbef75d7749d490aad0237d074528527e8b Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:52 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Fix all compiler warnings on gcc-6.3.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Fix all compiler warnings on gcc-6.3.0 ...................................................................... VIRT-PHY: Fix all compiler warnings on gcc-6.3.0 Change-Id: I95b93ec907fbfd180a0f2ac681dd63791ede24db --- M src/host/virt_phy/include/virtphy/logging.h M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c 6 files changed, 7 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/logging.h b/src/host/virt_phy/include/virtphy/logging.h index 87f12f7..6ca2525 100644 --- a/src/host/virt_phy/include/virtphy/logging.h +++ b/src/host/virt_phy/include/virtphy/logging.h @@ -8,4 +8,4 @@ extern const struct log_info ms_log_info; int ms_log_init(char *cat_mask); -char *getL1ctlPrimName(uint8_t type); +const char *getL1ctlPrimName(uint8_t type); diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index e136aa8..2e16bfa 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -86,7 +86,7 @@ if (rc == len) { msgb_put(msg, rc); l1h = (void *) msgb_data(msg); - msg->l1h = l1h; + msg->l1h = (void *) l1h; lsi->recv_cb(lsi, msg); return 0; } diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 097bf35..7801bec 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -25,7 +25,7 @@ #include #include -const char* l1ctlPrimNames[] = { +static const char* l1ctlPrimNames[] = { "_L1CTL_NONE", "L1CTL_FBSB_REQ", "L1CTL_FBSB_CONF", @@ -105,7 +105,7 @@ return 0; } -char *getL1ctlPrimName(uint8_t type) +const char *getL1ctlPrimName(uint8_t type) { return l1ctlPrimNames[type]; } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 226078c..8b65d6d 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index 0bda7e9..1642ac6 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 0e02153..50e6857 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95b93ec907fbfd180a0f2ac681dd63791ede24db Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:52 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Make sure heaer files are part of 'make dist' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Make sure heaer files are part of 'make dist' ...................................................................... VIRT-PHY: Make sure heaer files are part of 'make dist' Change-Id: Ib4cd0463da1cf22e04a1debfed55a33f7b6542d4 --- M src/host/virt_phy/Makefile.am M src/host/virt_phy/configure.ac A src/host/virt_phy/include/Makefile.am D src/host/virt_phy/include/layer1/mframe_sched.h D src/host/virt_phy/include/layer1/sync.h D src/host/virt_phy/include/layer1/tdma_sched.h 6 files changed, 12 insertions(+), 346 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/Makefile.am b/src/host/virt_phy/Makefile.am index 38bdf12..629ce0f 100644 --- a/src/host/virt_phy/Makefile.am +++ b/src/host/virt_phy/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = src +SUBDIRS = include src dist_doc_DATA = README diff --git a/src/host/virt_phy/configure.ac b/src/host/virt_phy/configure.ac index 860082e..c8012c9 100644 --- a/src/host/virt_phy/configure.ac +++ b/src/host/virt_phy/configure.ac @@ -22,6 +22,7 @@ AC_CONFIG_FILES([ Makefile + include/Makefile src/Makefile ]) AC_OUTPUT diff --git a/src/host/virt_phy/include/Makefile.am b/src/host/virt_phy/include/Makefile.am new file mode 100644 index 0000000..6048a4b --- /dev/null +++ b/src/host/virt_phy/include/Makefile.am @@ -0,0 +1,10 @@ +noinst_HEADERS = \ + virtphy/logging.h \ + virtphy/osmo_mcast_sock.h \ + virtphy/l1ctl_sock.h \ + virtphy/virtual_um.h \ + virtphy/gsmtapl1_if.h \ + virtphy/virt_l1_sched.h \ + virtphy/common_util.h \ + virtphy/l1ctl_sap.h \ + virtphy/virt_l1_model.h diff --git a/src/host/virt_phy/include/layer1/mframe_sched.h b/src/host/virt_phy/include/layer1/mframe_sched.h deleted file mode 100644 index ecdb1ec..0000000 --- a/src/host/virt_phy/include/layer1/mframe_sched.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef _L1_MFRAME_SCHED_H -#define _L1_MFRAME_SCHED_H - -#include - -enum mframe_task { - MF_TASK_BCCH_NORM, - MF_TASK_BCCH_EXT, - MF_TASK_CCCH, - MF_TASK_CCCH_COMB, - - MF_TASK_SDCCH4_0, - MF_TASK_SDCCH4_1, - MF_TASK_SDCCH4_2, - MF_TASK_SDCCH4_3, - - MF_TASK_SDCCH8_0, - MF_TASK_SDCCH8_1, - MF_TASK_SDCCH8_2, - MF_TASK_SDCCH8_3, - MF_TASK_SDCCH8_4, - MF_TASK_SDCCH8_5, - MF_TASK_SDCCH8_6, - MF_TASK_SDCCH8_7, - - MF_TASK_TCH_F_EVEN, - MF_TASK_TCH_F_ODD, - MF_TASK_TCH_H_0, - MF_TASK_TCH_H_1, - - MF_TASK_NEIGH_PM51_C0T0, - MF_TASK_NEIGH_PM51, - MF_TASK_NEIGH_PM26E, - MF_TASK_NEIGH_PM26O, - - /* Test task: send Normal Burst in all timeslots */ - MF_TASK_UL_ALL_NB, -}; - -enum mf_sched_item_flag { - MF_F_SACCH = (1 << 0), -}; - -/* The scheduler itself */ -struct mframe_scheduler { - uint32_t tasks; - uint32_t tasks_tgt; - uint32_t safe_fn; -}; - -uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t ts); - -/* Enable a specific task */ -void mframe_enable(enum mframe_task task_id); - -/* Disable a specific task */ -void mframe_disable(enum mframe_task task_id); - -/* Replace the current active set by the new one */ -void mframe_set(uint32_t tasks); - -/* Schedule mframe_sched_items according to current MF TASK list */ -void mframe_schedule(void); - -/* reset the scheduler, disabling all tasks */ -void mframe_reset(void); - -#endif /* _MFRAME_SCHED_H */ diff --git a/src/host/virt_phy/include/layer1/sync.h b/src/host/virt_phy/include/layer1/sync.h deleted file mode 100644 index dae85a1..0000000 --- a/src/host/virt_phy/include/layer1/sync.h +++ /dev/null @@ -1,204 +0,0 @@ -#ifndef _L1_SYNC_H -#define _L1_SYNC_H - -#include -#include -#include -#include -#include - -/* structure representing L1 sync information about a cell */ -struct l1_cell_info { - /* on which ARFCN (+band) is the cell? */ - uint16_t arfcn; - /* what's the BSIC of the cell (from SCH burst decoding) */ - uint8_t bsic; - /* Combined or non-combined CCCH */ - uint8_t ccch_mode; /* enum ccch_mode */ - /* whats the delta of the cells current GSM frame number - * compared to our current local frame number */ - int32_t fn_offset; - /* how much does the TPU need adjustment (delta) to synchronize - * with the cells burst */ - uint32_t time_alignment; - /* FIXME: should we also store the AFC value? */ -}; - -enum l1s_chan { - L1S_CHAN_MAIN, - L1S_CHAN_SACCH, - L1S_CHAN_TRAFFIC, - _NUM_L1S_CHAN -}; - -enum l1_compl { - L1_COMPL_FB, - L1_COMPL_RACH, - L1_COMPL_TX_NB, - L1_COMPL_TX_TCH, -}; - -typedef void l1_compl_cb(enum l1_compl c); - -#define L1S_NUM_COMPL 32 -#define L1S_NUM_NEIGH_CELL 6 - -struct l1s_h0 { - uint16_t arfcn; -}; - -struct l1s_h1 { - uint8_t hsn; - uint8_t maio; - uint8_t n; - uint16_t ma[64]; -}; - -struct l1s_state { - struct gsm_time current_time; /* current GSM time */ - struct gsm_time next_time; /* GSM time at next TMDMA irq */ - - /* the cell on which we are camping right now */ - struct l1_cell_info serving_cell; - - /* neighbor cell sync info */ - struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; - - /* TDMA scheduler */ - struct tdma_scheduler tdma_sched; - - /* Multiframe scheduler */ - struct mframe_scheduler mframe_sched; - - /* The current TPU offset register */ - uint32_t tpu_offset; - int32_t tpu_offset_correction; - - /* TX parameters */ - int8_t ta; - uint8_t tx_power; - - /* TCH */ - uint8_t tch_mode; - uint8_t tch_sync; - uint8_t audio_mode; - - /* Transmit queues of pending packets for main DCCH and ACCH */ - struct llist_head tx_queue[_NUM_L1S_CHAN]; - struct msgb *tx_meas; - - /* Which L1A completions are scheduled right now */ - uint32_t scheduled_compl; - /* callbacks for each of the completions */ - l1_compl_cb *completion[L1S_NUM_COMPL]; - - /* Structures below are for L1-task specific parameters, used - * to communicate between l1-sync and l1-async (l23_api) */ - struct { - uint8_t mode; /* FB_MODE 0/1 */ - } fb; - - struct { - /* power measurement l1 task */ - unsigned int mode; - union { - struct { - uint16_t arfcn_start; - uint16_t arfcn_next; - uint16_t arfcn_end; - } range; - }; - struct msgb *msg; - } pm; - - struct { - uint8_t ra; - } rach; - - struct { - enum { - GSM_DCHAN_NONE = 0, - GSM_DCHAN_SDCCH_4, - GSM_DCHAN_SDCCH_8, - GSM_DCHAN_TCH_H, - GSM_DCHAN_TCH_F, - GSM_DCHAN_UNKNOWN, - } type; - - uint8_t scn; - uint8_t tsc; - uint8_t tn; - uint8_t h; - - union { - struct l1s_h0 h0; - struct l1s_h1 h1; - }; - - uint8_t st_tsc; - uint8_t st_tn; - uint8_t st_h; - - union { - struct l1s_h0 st_h0; - struct l1s_h1 st_h1; - }; - } dedicated; - - /* neighbour cell power measurement process */ - struct { - uint8_t n, second; - uint8_t pos; - uint8_t running; - uint16_t band_arfcn[64]; - uint8_t tn[64]; - uint8_t level[64]; - } neigh_pm; -}; - -extern struct l1s_state l1s; - -struct l1s_meas_hdr { - uint16_t snr; /* signal/noise ratio */ - int16_t toa_qbit; /* time of arrival (qbits) */ - int16_t pm_dbm8; /* power level in dbm/8 */ - int16_t freq_err; /* Frequency error in Hz */ -}; - -int16_t l1s_snr_int(uint16_t snr); -uint16_t l1s_snr_fract(uint16_t snr); - -void l1s_dsp_abort(void); - -void l1s_tx_apc_helper(uint16_t arfcn); - -/* schedule a completion */ -void l1s_compl_sched(enum l1_compl c); - -void l1s_init(void); - -/* reset the layer1 as part of synchronizing to a new cell */ -void l1s_reset(void); - -/* init.c */ -void layer1_init(void); - -/* A debug macro to print every TDMA frame */ -#ifdef DEBUG_EVERY_TDMA -#define putchart(x) putchar(x) -#else -#define putchart(x) -#endif - -/* Convert an angle in fx1.15 notatinon into Hz */ -#define BITFREQ_DIV_2PI 43104 /* 270kHz / 2 * pi */ -#define BITFREQ_DIV_PI 86208 /* 270kHz / pi */ -#define ANG2FREQ_SCALING (2<<15) /* 2^15 scaling factor for fx1.15 */ -#define ANGLE_TO_FREQ(angle) ((int16_t)angle * BITFREQ_DIV_PI / ANG2FREQ_SCALING) - -void l1s_reset_hw(void); -void synchronize_tdma(struct l1_cell_info *cinfo); -void l1s_time_inc(struct gsm_time *time, uint32_t delta_fn); -void l1s_time_dump(const struct gsm_time *time); - -#endif /* _L1_SYNC_H */ diff --git a/src/host/virt_phy/include/layer1/tdma_sched.h b/src/host/virt_phy/include/layer1/tdma_sched.h deleted file mode 100644 index f58d59b..0000000 --- a/src/host/virt_phy/include/layer1/tdma_sched.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef _L1_TDMA_SCHED_H -#define _L1_TDMA_SCHED_H - -#include - -/* TDMA scheduler */ - -/* The idea of this scheduler is that we have a circular buffer of buckets, - * where each bucket corresponds to one future TDMA frame [interrupt]. Each - * bucket contains of a list of callbacks which are executed when the bucket - * index reaches that particular bucket. */ - -#define TDMASCHED_NUM_FRAMES 25 -#define TDMASCHED_NUM_CB 8 - -#define TDMA_IFLG_TPU (1<<0) -#define TDMA_IFLG_DSP (1<<1) - -typedef int tdma_sched_cb(uint8_t p1, uint8_t p2, uint16_t p3); - -/* A single item in a TDMA scheduler bucket */ -struct tdma_sched_item { - tdma_sched_cb *cb; - uint8_t p1; - uint8_t p2; - uint16_t p3; - int16_t prio; - uint16_t flags; /* TDMA_IFLG_xxx */ -}; - -/* A bucket inside the TDMA scheduler */ -struct tdma_sched_bucket { - struct tdma_sched_item item[TDMASCHED_NUM_CB]; - uint8_t num_items; -}; - -/* The scheduler itself, consisting of buckets and a current index */ -struct tdma_scheduler { - struct tdma_sched_bucket bucket[TDMASCHED_NUM_FRAMES]; - uint8_t cur_bucket; -}; - -/* Schedule an item at 'frame_offset' TDMA frames in the future */ -int tdma_schedule(uint8_t frame_offset, tdma_sched_cb *cb, - uint8_t p1, uint8_t p2, uint16_t p3, int16_t prio); - -/* Schedule a set of items starting from 'frame_offset' TDMA frames in the future */ -int tdma_schedule_set(uint8_t frame_offset, const struct tdma_sched_item *item_set, uint16_t p3); - -/* Scan current frame scheduled items for flags */ -uint16_t tdma_sched_flag_scan(void); - -/* Execute pre-scheduled events for current frame */ -int tdma_sched_execute(void); - -/* Advance TDMA scheduler to the next bucket */ -void tdma_sched_advance(void); - -/* reset the scheduler; erase all scheduled items */ -void tdma_sched_reset(void); - -/* debug function: print number of entries of all TDMA buckets */ -void tdma_sched_dump(void); - - -extern int tdma_end_set(uint8_t p1, uint8_t p2, uint16_t p3); -#define SCHED_ITEM(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, .flags = 0 } -#define SCHED_ITEM_DT(x, p, y, z) { .cb = x, .p1 = y, .p2 = z, .prio = p, \ - .flags = TDMA_IFLG_TPU | TDMA_IFLG_DSP } -#define SCHED_END_FRAME() { .cb = NULL, .p1 = 0, .p2 = 0 } -#define SCHED_END_SET() { .cb = &tdma_end_set, .p1 = 0, .p2 = 0 } - -#endif /* _L1_TDMA_SCHED_H */ -- To view, visit https://gerrit.osmocom.org/3218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib4cd0463da1cf22e04a1debfed55a33f7b6542d4 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:53 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Remove non-overridable CFLAGS "-g -O0" In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Remove non-overridable CFLAGS "-g -O0" ...................................................................... VIRT-PHY: Remove non-overridable CFLAGS "-g -O0" If the user wants debugging / no optimziation, they can always pass the related CFLAGS at ./configure time, there's no nee to have them hard-coded in the actual Makefiles. Change-Id: I6a2b30f946579bbd49bf66c4f59d160a975a1b56 --- M src/host/virt_phy/Makefile.am M src/host/virt_phy/src/Makefile.am 2 files changed, 0 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/Makefile.am b/src/host/virt_phy/Makefile.am index 57b4571..38bdf12 100644 --- a/src/host/virt_phy/Makefile.am +++ b/src/host/virt_phy/Makefile.am @@ -1,4 +1,2 @@ SUBDIRS = src dist_doc_DATA = README - -CFLAGS = "-g -O0" \ No newline at end of file diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index 6628bce..caaec04 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -1,8 +1,6 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/../layer23/include -CFLAGS = "-g -O0" - sbin_PROGRAMS = virtphy virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c shared/common_util.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) -- To view, visit https://gerrit.osmocom.org/3216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6a2b30f946579bbd49bf66c4f59d160a975a1b56 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:53 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Extracted common virtphy utils. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Extracted common virtphy utils. ...................................................................... VIRT-PHY: Extracted common virtphy utils. Change-Id: I759c6e9805ab012f9553bcba9b5d379193462955 --- A src/host/virt_phy/include/virtphy/common_util.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c A src/host/virt_phy/src/shared/common_util.c 4 files changed, 96 insertions(+), 78 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/common_util.h b/src/host/virt_phy/include/virtphy/common_util.h new file mode 100644 index 0000000..672ff93 --- /dev/null +++ b/src/host/virt_phy/include/virtphy/common_util.h @@ -0,0 +1,51 @@ +/* + * Utility function used both in osmo bts virt and osmocom bb virt. + */ + +#pragma once + +#include +#include + +#define LID_SACCH 0x40 +#define LID_DEDIC 0x00 + +/*! \brief convert GSMTAP channel type to RSL channel number + * \param[in] gsmtap_chantype GSMTAP channel type + * \param[out] rsl_chantype rsl channel type + * \param[out] rsl_chantype rsl link id + * + * Mapping from gsmtap channel: + * GSMTAP_CHANNEL_UNKNOWN * 0x00 + * GSMTAP_CHANNEL_BCCH * 0x01 + * GSMTAP_CHANNEL_CCCH * 0x02 + * GSMTAP_CHANNEL_RACH * 0x03 + * GSMTAP_CHANNEL_AGCH * 0x04 + * GSMTAP_CHANNEL_PCH * 0x05 + * GSMTAP_CHANNEL_SDCCH * 0x06 + * GSMTAP_CHANNEL_SDCCH4 * 0x07 + * GSMTAP_CHANNEL_SDCCH8 * 0x08 + * GSMTAP_CHANNEL_TCH_F * 0x09 + * GSMTAP_CHANNEL_TCH_H * 0x0a + * GSMTAP_CHANNEL_PACCH * 0x0b + * GSMTAP_CHANNEL_CBCH52 * 0x0c + * GSMTAP_CHANNEL_PDCH * 0x0d + * GSMTAP_CHANNEL_PTCCH * 0x0e + * GSMTAP_CHANNEL_CBCH51 * 0x0f + * to rsl channel type: + * RSL_CHAN_NR_MASK * 0xf8 + * RSL_CHAN_NR_1 * * 0x08 + * RSL_CHAN_Bm_ACCHs * 0x08 + * RSL_CHAN_Lm_ACCHs * 0x10 + * RSL_CHAN_SDCCH4_ACCH * 0x20 + * RSL_CHAN_SDCCH8_ACCH * 0x40 + * RSL_CHAN_BCCH * * 0x80 + * RSL_CHAN_RACH * * 0x88 + * RSL_CHAN_PCH_AGCH * 0x90 + * RSL_CHAN_OSMO_PDCH * 0xc0 + * and logical channel link id: + * LID_SACCH * * 0x40 + * LID_DEDIC * * 0x00 + */ +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index d34b8ad..6628bce 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -4,7 +4,7 @@ CFLAGS = "-g -O0" sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c shared/common_util.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) virtphy_LDFLAGS = -pthread diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 401df9e..1a2c085 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -282,80 +282,3 @@ { gsmtapl1_rx_from_virt_um_inst_cb(l1_model_ms->vui, msg); } - -/*! \brief convert GSMTAP channel type to RSL channel number - * \param[in] gsmtap_chantype GSMTAP channel type - * \param[out] rsl_chantype rsl channel type - * \param[out] rsl_chantype rsl link id - * - * Mapping from gsmtap channel: - * GSMTAP_CHANNEL_UNKNOWN * 0x00 - * GSMTAP_CHANNEL_BCCH * 0x01 - * GSMTAP_CHANNEL_CCCH * 0x02 - * GSMTAP_CHANNEL_RACH * 0x03 - * GSMTAP_CHANNEL_AGCH * 0x04 - * GSMTAP_CHANNEL_PCH * 0x05 - * GSMTAP_CHANNEL_SDCCH * 0x06 - * GSMTAP_CHANNEL_SDCCH4 * 0x07 - * GSMTAP_CHANNEL_SDCCH8 * 0x08 - * GSMTAP_CHANNEL_TCH_F * 0x09 - * GSMTAP_CHANNEL_TCH_H * 0x0a - * GSMTAP_CHANNEL_PACCH * 0x0b - * GSMTAP_CHANNEL_CBCH52 * 0x0c - * GSMTAP_CHANNEL_PDCH * 0x0d - * GSMTAP_CHANNEL_PTCCH * 0x0e - * GSMTAP_CHANNEL_CBCH51 * 0x0f - * to rsl channel type: - * RSL_CHAN_NR_MASK * 0xf8 - * RSL_CHAN_NR_1 * * 0x08 - * RSL_CHAN_Bm_ACCHs * 0x08 - * RSL_CHAN_Lm_ACCHs * 0x10 - * RSL_CHAN_SDCCH4_ACCH * 0x20 - * RSL_CHAN_SDCCH8_ACCH * 0x40 - * RSL_CHAN_BCCH * * 0x80 - * RSL_CHAN_RACH * * 0x88 - * RSL_CHAN_PCH_AGCH * 0x90 - * RSL_CHAN_OSMO_PDCH * 0xc0 - * and logical channel link id: - * LID_SACCH * * 0x40 - * LID_DEDIC * * 0x00 - * - * TODO: move this to a library used by both ms and bts virt um - */ -void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, - uint8_t *link_id) -{ - // switch case with removed acch flag - switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { - case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F - *rsl_chantype = RSL_CHAN_Bm_ACCHs; - break; - case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H - *rsl_chantype = RSL_CHAN_Lm_ACCHs; - break; - case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 - *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; - break; - case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 - *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; - break; - case GSMTAP_CHANNEL_BCCH: // BCCH - *rsl_chantype = RSL_CHAN_BCCH; - break; - case GSMTAP_CHANNEL_RACH: // RACH - *rsl_chantype = RSL_CHAN_RACH; - break; - case GSMTAP_CHANNEL_PCH: // PCH - case GSMTAP_CHANNEL_AGCH: // AGCH - *rsl_chantype = RSL_CHAN_PCH_AGCH; - break; - case GSMTAP_CHANNEL_PDCH: - *rsl_chantype = GSMTAP_CHANNEL_PDCH; - break; - } - - *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? - LID_SACCH : - LID_DEDIC; - -} diff --git a/src/host/virt_phy/src/shared/common_util.c b/src/host/virt_phy/src/shared/common_util.c new file mode 100644 index 0000000..49dea18 --- /dev/null +++ b/src/host/virt_phy/src/shared/common_util.c @@ -0,0 +1,44 @@ +/* + * Utility function used both in osmo bts virt and osmocom bb virt. + */ + +#include +#include +#include + +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id) +{ + // switch case with removed acch flag + switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { + case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F + *rsl_chantype = RSL_CHAN_Bm_ACCHs; + break; + case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H + *rsl_chantype = RSL_CHAN_Lm_ACCHs; + break; + case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 + *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; + break; + case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 + *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; + break; + case GSMTAP_CHANNEL_BCCH: // BCCH + *rsl_chantype = RSL_CHAN_BCCH; + break; + case GSMTAP_CHANNEL_RACH: // RACH + *rsl_chantype = RSL_CHAN_RACH; + break; + case GSMTAP_CHANNEL_PCH: // PCH + case GSMTAP_CHANNEL_AGCH: // AGCH + *rsl_chantype = RSL_CHAN_PCH_AGCH; + break; + case GSMTAP_CHANNEL_PDCH: + *rsl_chantype = GSMTAP_CHANNEL_PDCH; + break; + } + + *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? LID_SACCH : + LID_DEDIC; + +} -- To view, visit https://gerrit.osmocom.org/3214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I759c6e9805ab012f9553bcba9b5d379193462955 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:53 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Configurable signal power reductions for multiple ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Configurable signal power reductions for multiple arfcns. ...................................................................... VIRT-PHY: Configurable signal power reductions for multiple arfcns. Model was expanded and holds now power management information consisting of an array of received power levels for all arfcns and one for the reduction of this signal in dbm. The reduction is configurable by commandline by --arfcn-sig-lev-red 666,12:888,13. The signal level is assumed to be max level (-63) if a packet from that arfcn is received within a timeframe (also configurable via cmd -- timeout-pm 5:800 == :). After that timeout it will be reduced to min level (-110). Change-Id: I369ca26703f14bba4e9334b8f417deef640462f9 --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virtphy.c 8 files changed, 126 insertions(+), 25 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index a126128..b84c3e9 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -18,6 +18,14 @@ #define LID_SACCH 0x40 #define LID_DEDIC 0x00 +/* signature strengths for the ms */ +#define MIN_SIG_LEV_DBM -110 +#define MAX_SIG_LEV_DBM -63 + +/* Ignore all flags of the arfcn */ +#define ARFCN_NO_FLAGS_MASK 0x0fff + + void l1ctl_sap_init(struct l1_model_ms *model); void prim_rach_init(struct l1_model_ms *model); void prim_data_init(struct l1_model_ms *model); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index d4969eb..296931a 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -3,6 +3,7 @@ #include #include #include +#include #define L1S_NUM_NEIGH_CELL 6 #define A5_KEY_LEN 8 @@ -78,6 +79,17 @@ struct { uint32_t arfcn; } fbsb; + + /* power management state */ + struct { + uint32_t timeout_us; + uint32_t timeout_s; + struct { + int16_t arfcn_sig_lev_dbm[1024]; + uint8_t arfcn_sig_lev_red_dbm[1024]; + struct osmo_timer_list arfcn_sig_lev_timers[1024]; + } meas; + } pm; }; struct l1_model_ms *l1_model_ms_init(void *ctx); diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 1a2c085..2e1a207 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -152,6 +152,11 @@ extern void prim_fbsb_sync(struct msgb *msg); /** + * @see virt_prim_pm.c + */ +extern uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev); + +/** * Receive a gsmtap message from the virt um. * * As we do not have a downlink scheduler, but not all dl messages must be processed and thus forwarded to l2, this function also implements some message filtering. @@ -166,16 +171,12 @@ if (!msg) { return; } - // we do not forward messages to l23 if we are in network search state - if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { - goto freemsg; - } struct gsmtap_hdr *gh = msgb_l1(msg); uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type - uint8_t signal_dbm = gh->signal_dbm; // signal strength, 63 is best + uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); // Power measurement with each received massage uint8_t snr = gh->snr_db; // signal noise ratio, 63 is best uint8_t subslot = gh->sub_slot; // multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) uint8_t timeslot = gh->timeslot; // tdma timeslot to send in (0-7) @@ -190,6 +191,11 @@ goto freemsg; } + // we do not forward messages to l23 if we are in network search state + if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { + goto freemsg; + } + // forward downlink msg to fbsb sync routine if we are in sync state if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { prim_fbsb_sync(msg); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index f0f3f68..9957bf3 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -43,6 +43,7 @@ prim_fbsb_init(model); prim_data_init(model); prim_traffic_init(model); + prim_pm_init(model); } /** diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index 1b1d0df..bcd6735 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -6,7 +6,6 @@ struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); model->state = talloc_zero(ctx, struct l1_state_ms); return model; - } void l1_model_ms_destroy(struct l1_model_ms *model) diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index f0c7f52..2c0f10c 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -57,7 +57,7 @@ if (l1_model_ms->state->fbsb.arfcn != arfcn) { talloc_free(msg); // cancel sync if we did not receive a msg on dl from the requested arfcn that we can sync to - if(sync_count++ > 100) { + if(sync_count++ > 20) { sync_count = 0; l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; l1ctl_tx_fbsb_conf(1, (l1_model_ms->state->fbsb.arfcn)); diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index c08ce03..312461c 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -13,8 +13,30 @@ #include static struct l1_model_ms *l1_model_ms = NULL; -// FIXME: ugly to configure that in code. Either make a config file or change power selection to automatically check which arfcns can be received. -static uint16_t available_arfcns[] = {666}; + +/** + * @brief Change the signal strength for a given arfcn. + * + * Should be called if a msg is received on the virtual layer. The configured signal level reduction is applied. + * + * @param [in] arfcn to change sig str for. + * @param [in] sig_lev the measured signal level value. + */ +uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) { + if(l1_model_ms->state->pm.timeout_s > 0 || l1_model_ms->state->pm.timeout_us > 0) { + osmo_timer_schedule(&l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[arfcn], l1_model_ms->state->pm.timeout_s, l1_model_ms->state->pm.timeout_us); + } + l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn] = sig_lev - l1_model_ms->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; + DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", arfcn, l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn], dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn])); + return l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn]; +} + +void prim_pm_timer_cb(void *data) { + // reset the signal level to bad value if no messages have been received from that rfcn for a given time + DEBUGP(DL1C, + "Timeout occurred for arfcn, signal level reset to worst value.\n"); + *((int16_t*)data) = MIN_SIG_LEV_DBM; +} /** * @brief Handler for received L1CTL_PM_REQ from L23. @@ -25,11 +47,8 @@ * * Process power measurement for a given range of arfcns to calculate signal power and connection quality. * - * Note: We do not need to calculate that for the virtual physical layer, - * but l23 apps can expect a response. So this response is mocked here. - * For available arfcns we always return a perfect link quality, for all other the worst. + * Note: This should only be called after a certain time so some messages have already been received. * - * TODO: Change PM so that we check the downlink first for for some time to get the arfcns we receive. Then return a good link for that and a bad for all others. */ void l1ctl_rx_pm_req(struct msgb *msg) { @@ -52,18 +71,10 @@ struct l1ctl_pm_conf *pm_conf = (struct l1ctl_pm_conf *)msgb_put(resp_msg, sizeof(*pm_conf)); - int cnt, available = 0; pm_conf->band_arfcn = htons(arfcn_next); - // check if arfcn is available - for(cnt = 0; cnt < sizeof(available_arfcns) / sizeof(uint16_t); cnt++) { - if(arfcn_next == available_arfcns[cnt]) { - available = 1; - break; - } - } - // rxlev 63 is great, 0 is bad the two values are min and max - pm_conf->pm[0] = available ? 63 : 0; - pm_conf->pm[1] = available ? 63 : 0; + // set min and max to the value calculated for that arfcn (IGNORE UPLINKK AND PCS AND OTHER FLAGS) + pm_conf->pm[0] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); + pm_conf->pm[1] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); if (arfcn_next == pm_req->range.band_arfcn_to) { struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; @@ -87,5 +98,13 @@ */ void prim_pm_init(struct l1_model_ms *model) { + int i; l1_model_ms = model; + // init the signal level of all arfcns with the lowest value possible + memset (model->state->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); + // init timers + for(i = 0; i < 1024; ++i) { + l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].cb = prim_pm_timer_cb; + l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].data = &l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[i]; + } } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index dd11c67..aaa9311 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -22,6 +23,8 @@ static int port = DEFAULT_MCAST_PORT; static char* log_mask = DEFAULT_LOG_MASK; static char * l1ctl_sock_path = L1CTL_SOCK_PATH; +static char * arfcn_sig_lev_red_mask = NULL; +static char * pm_timeout = NULL; static void handle_options(int argc, char **argv) { @@ -33,9 +36,11 @@ {"port", required_argument, 0, 'x'}, {"log-mask", required_argument, 0, 'd'}, {"l1ctl-sock", required_argument, 0, 's'}, + {"arfcn-sig-lev-red", required_argument, 0, 'r'}, + {"pm-timeout", required_argument, 0, 't'}, {0, 0, 0, 0}, }; - c = getopt_long(argc, argv, "z:y:x:d:s:", long_options, + c = getopt_long(argc, argv, "z:y:x:d:s:r:t:", long_options, &option_index); if (c == -1) break; @@ -56,10 +61,57 @@ case 's': l1ctl_sock_path = optarg; break; + case 'r': + arfcn_sig_lev_red_mask = optarg; + break; + case 't': + pm_timeout = optarg; + break; default: break; } } +} + +void parse_pm_timeout(struct l1_model_ms *model, char *pm_timeout) { + + if(!pm_timeout || (strcmp(pm_timeout, "") == 0)) { + return; + } + // seconds + char *buf = strtok(pm_timeout, ":"); + model->state->pm.timeout_s = atoi(buf); + // microseconds + buf = strtok(NULL, ":"); + if(buf) { + model->state->pm.timeout_us = atoi(buf); + } +} + +/** + * arfcn_sig_lev_red_mask has to be formatted like 666,12:888,43:176,22 + */ +void parse_arfcn_sig_lev_red(struct l1_model_ms *model, char * arfcn_sig_lev_red_mask) { + + if(!arfcn_sig_lev_red_mask || (strcmp(arfcn_sig_lev_red_mask, "") == 0)) { + return; + } + char *token = strtok(arfcn_sig_lev_red_mask, ":"); + do { + char* colon = strstr(token, ","); + uint16_t arfcn; + uint8_t red; + if(!colon) { + continue; + } + colon[0] = '\0'; + + arfcn = atoi(token); + red = atoi(colon + 1); + + //TODO: this may go wild if the token string is not properly formatted + model->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn] = red; + } while ((token = strtok(NULL, ":"))); } int main(int argc, char *argv[]) @@ -84,6 +136,10 @@ l1ctl_sap_init(model); virt_l1_sched_init(model); + // apply timeout and arfcn reduction value config to model + parse_pm_timeout(model, pm_timeout); + parse_arfcn_sig_lev_red(model, arfcn_sig_lev_red_mask); + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ Waiting for l23 app on %s", -- To view, visit https://gerrit.osmocom.org/3215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I369ca26703f14bba4e9334b8f417deef640462f9 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:53 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Added option parsing. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Added option parsing. ...................................................................... VIRT-PHY: Added option parsing. Available options: dl-rx-grp: mcast group messages on downlink are received from ul-tx-grp: mcast group messages on uplink are sent to port: port used for mcast sockets log-mask: logging mask l1ctl-sock: l1ctl socket path to connect to l23 Change-Id: Id939e5d7b90b592c85ad19f3ad6f459351e2d8f6 --- M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virtphy.c 3 files changed, 70 insertions(+), 20 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index b84186a..401df9e 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -153,6 +153,12 @@ /** * Receive a gsmtap message from the virt um. + * + * As we do not have a downlink scheduler, but not all dl messages must be processed and thus forwarded to l2, this function also implements some message filtering. + * E.g. we do not forward: + * - uplink messages + * - messages with a wrong arfcn + * - if in MS_STATE_IDLE_SEARCHING */ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg) @@ -237,6 +243,7 @@ case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: + // save to just forward here, as upper layer ignores messages that do not fit the current state (e.g. gsm48_rr.c:2159) l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); break; diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index b6c4508..f0f3f68 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -262,6 +262,8 @@ l1_model_ms->state->dedicated.chan_type = rsl_chantype; l1_model_ms->state->dedicated.tn = timeslot; l1_model_ms->state->dedicated.subslot = subslot; + l1_model_ms->state->state = MS_STATE_DEDICATED; + /* TCH config */ if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { @@ -340,7 +342,6 @@ * * Handle state change from dedicated to idle mode. Flush message buffers of dedicated channel. * - * TODO: Implement this handler routine! */ void l1ctl_rx_dm_rel_req(struct msgb *msg) { @@ -350,6 +351,7 @@ l1_model_ms->state->dedicated.tn = 0; l1_model_ms->state->dedicated.subslot = 0; l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; + l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; // TODO: disable ciphering // TODO: disable audio recording / playing diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 1454c4e..dd11c67 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -13,44 +14,84 @@ #include #include -int main( int argc, char *argv[] ) +#define DEFAULT_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ +#define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" + +static char* dl_rx_grp = DEFAULT_MS_MCAST_GROUP; +static char* ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; +static int port = DEFAULT_MCAST_PORT; +static char* log_mask = DEFAULT_LOG_MASK; +static char * l1ctl_sock_path = L1CTL_SOCK_PATH; + +static void handle_options(int argc, char **argv) +{ + while (1) { + int option_index = 0, c; + static struct option long_options[] = { + {"dl-rx-grp", required_argument, 0, 'z'}, + {"ul-tx-grp", required_argument, 0, 'y'}, + {"port", required_argument, 0, 'x'}, + {"log-mask", required_argument, 0, 'd'}, + {"l1ctl-sock", required_argument, 0, 's'}, + {0, 0, 0, 0}, + }; + c = getopt_long(argc, argv, "z:y:x:d:s:", long_options, + &option_index); + if (c == -1) + break; + + switch (c) { + case 'z': + dl_rx_grp = optarg; + break; + case 'y': + ul_tx_grp = optarg; + break; + case 'x': + port = atoi(optarg); + break; + case 'd': + log_mask = optarg; + break; + case 's': + l1ctl_sock_path = optarg; + break; + default: + break; + } + } +} + +int main(int argc, char *argv[]) { // init loginfo static struct l1_model_ms *model; - char * l1ctl_sock_path = NULL; - // get path from commandline argument - if( argc > 1 ) { - l1ctl_sock_path = argv[1]; - } + handle_options(argc, argv); - - //ms_log_init("DL1C,1:DVIRPHY,1"); - ms_log_init("DL1C,1"); - //ms_log_init("DL1C,8:DVIRPHY,8"); + ms_log_init(log_mask); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); model = l1_model_ms_init(NULL); - // TODO: make this configurable - model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, - DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, - DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); - model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, l1ctl_sock_path); + model->vui = virt_um_init(NULL, ul_tx_grp, port, dl_rx_grp, port, + gsmtapl1_rx_from_virt_um_inst_cb); + model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, + l1ctl_sock_path); gsmtapl1_init(model); l1ctl_sap_init(model); virt_l1_sched_init(model); - LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ - Waiting for l23 app on %s", l1ctl_sock_path ? l1ctl_sock_path : L1CTL_SOCK_PATH); + LOGP(DVIRPHY, LOGL_INFO, + "Virtual physical layer ready...\n \ + Waiting for l23 app on %s", + l1ctl_sock_path); while (1) { // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) osmo_select_main(0); - // handle outgoing l1ctl primitives to l2 - // TODO implement scheduler for uplink messages } l1_model_ms_destroy(model); -- To view, visit https://gerrit.osmocom.org/3213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id939e5d7b90b592c85ad19f3ad6f459351e2d8f6 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:53 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Add downlink filter for msg on dedicated channels. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Add downlink filter for msg on dedicated channels. ...................................................................... VIRT-PHY: Add downlink filter for msg on dedicated channels. Messages incoming on dedicated channel (SDCCH/8, SDCCH/4) are no longer forwarded to l23 if their timeslot/subchannel is not fitting the ones configured by l23 via L1CTL_DM_EST_REQ. Change-Id: I6112b20e31c25636e53d3a6cda6f7443a94ff9c3 --- M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virtphy.c 4 files changed, 18 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 69115f2..d4969eb 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -67,6 +67,7 @@ uint8_t chan_type; // like rsl chantype 08.58 -> Chapter 9.3.1 */ uint8_t tn; // timeslot number 1-7 + uint8_t subslot; // subslot of the dedicated channel, SDCCH/4:[0-3], SDCCH/8:[0-7] uint8_t scn; // single-hop cellular network? (ununsed in virtual um) uint8_t tsc; // training sequence code (ununsed in virtual um) diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 155b4dc..b84186a 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -162,12 +162,10 @@ } // we do not forward messages to l23 if we are in network search state if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { - talloc_free(msg); - return; + goto freemsg; } struct gsmtap_hdr *gh = msgb_l1(msg); - struct msgb *l1ctl_msg = NULL; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type @@ -183,7 +181,7 @@ if (arfcn & GSMTAP_ARFCN_F_UPLINK) { LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); - goto nomessage; + goto freemsg; } // forward downlink msg to fbsb sync routine if we are in sync state @@ -199,7 +197,7 @@ "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn, l1_model_ms->state->serving_cell.arfcn); - goto nomessage; + goto freemsg; } msg->l2h = msgb_pull(msg, sizeof(*gh)); @@ -230,11 +228,17 @@ #endif case GSMTAP_CHANNEL_SDCCH4: case GSMTAP_CHANNEL_SDCCH8: + // only forward messages on dedicated channels to l2, if the timeslot and subslot is fitting + if(l1_model_ms->state->dedicated.tn == timeslot && l1_model_ms->state->dedicated.subslot == subslot) { + l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, + signal_dbm, 0, 0); + } + break; case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, - signal_dbm, 0, 0); + signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: LOGP(DVIRPHY, @@ -259,11 +263,7 @@ break; } - /* forward l1ctl message to l2 */ - if (l1ctl_msg) { - l1ctl_sap_tx_to_l23(l1ctl_msg); - } - nomessage: + freemsg: // handle memory deallocation talloc_free(msg); } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index bd6051b..b6c4508 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -244,7 +244,6 @@ * * Handle state change from idle to dedicated mode. * - * TODO: Implement this handler routine! */ void l1ctl_rx_dm_est_req(struct msgb *msg) { @@ -257,12 +256,12 @@ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u)\n", - ul->chan_nr, timeslot); + "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", + ul->chan_nr, timeslot, subslot); l1_model_ms->state->dedicated.chan_type = rsl_chantype; l1_model_ms->state->dedicated.tn = timeslot; - + l1_model_ms->state->dedicated.subslot = subslot; /* TCH config */ if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { @@ -348,6 +347,8 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); l1_model_ms->state->dedicated.chan_type = 0; + l1_model_ms->state->dedicated.tn = 0; + l1_model_ms->state->dedicated.subslot = 0; l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; // TODO: disable ciphering diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 70265a0..1454c4e 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -44,7 +44,7 @@ virt_l1_sched_init(model); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ - Waiting for l23 app on %s", l1ctl_sock_path); + Waiting for l23 app on %s", l1ctl_sock_path ? l1ctl_sock_path : L1CTL_SOCK_PATH); while (1) { // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) -- To view, visit https://gerrit.osmocom.org/3212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6112b20e31c25636e53d3a6cda6f7443a94ff9c3 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:54 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Fixed power management and PCS sync. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Fixed power management and PCS sync. ...................................................................... VIRT-PHY: Fixed power management and PCS sync. PCS flag was ignored in fbsb. Power management returned a perfect link for all possible arfcns causing the mobile trying to sync to all these afterwards. This took too long and PM now only returnes a good link quality for arfcns configured as available. Power management was also extracted to an own file. Change-Id: Ia1b79aa47c9df3b1e316122455ceccb4a66724e0 --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_prim_fbsb.c A src/host/virt_phy/src/virt_prim_pm.c 6 files changed, 127 insertions(+), 82 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index 71d4765..a126128 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -23,6 +23,7 @@ void prim_data_init(struct l1_model_ms *model); void prim_traffic_init(struct l1_model_ms *model); void prim_fbsb_init(struct l1_model_ms *model); +void prim_pm_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index ae14ef6..d34b8ad 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -4,7 +4,7 @@ CFLAGS = "-g -O0" sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) virtphy_LDFLAGS = -pthread diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 3cb0df9..155b4dc 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -166,12 +166,6 @@ return; } - // forward msg to fbsb sync routine if we are in sync state - if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { - prim_fbsb_sync(msg); - return; - } - struct gsmtap_hdr *gh = msgb_l1(msg); struct msgb *l1ctl_msg = NULL; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg @@ -184,6 +178,29 @@ uint8_t rsl_chantype; // rsl chan type (8.58, 9.3.1) uint8_t link_id; // rsl link id tells if this is an ssociated or dedicated link uint8_t chan_nr; // encoded rsl channel type, timeslot and mf subslot + + // generally ignore all uplink messages received + if (arfcn & GSMTAP_ARFCN_F_UPLINK) { + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + goto nomessage; + } + + // forward downlink msg to fbsb sync routine if we are in sync state + if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { + prim_fbsb_sync(msg); + return; + } + + // generally ignore all messages coming from another arfcn than the camped one + if (l1_model_ms->state->serving_cell.arfcn != arfcn) { + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", + arfcn, + l1_model_ms->state->serving_cell.arfcn); + goto nomessage; + } msg->l2h = msgb_pull(msg, sizeof(*gh)); chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); @@ -199,23 +216,6 @@ arfcn, fn, get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); - - // generally ignore all messages coming from another arfcn than the camped one - if (l1_model_ms->state->serving_cell.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { - LOGP(DVIRPHY, - LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn & GSMTAP_ARFCN_MASK, - l1_model_ms->state->serving_cell.arfcn); - goto nomessage; - } - - // generally ignore all uplink messages received - if (arfcn & GSMTAP_ARFCN_F_UPLINK) { - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - uplink flag set!\n"); - goto nomessage; - } // switch case with removed acch flag switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index c03da3b..bd6051b 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -377,60 +377,6 @@ } /** - * @brief Handler for received L1CTL_PM_REQ from L23. - * - * -- power measurement request -- - * - * @param [in] msg the received message. - * - * Process power measurement for a given range of arfcns to calculate signal power and connection quality. - * - * Note: We do not need to calculate that for the virtual physical layer, - * but l23 apps can expect a response. So this response is mocked here. - * TODO: Might be possible to sync to different virtual BTS. Mapping from arfcn to mcast address would be needed. Configurable rx_lev for each mcast address. - */ -void l1ctl_rx_pm_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *)l1h->data; - struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); - uint16_t arfcn_next; - // convert to host order - pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); - pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - - DEBUGP(DL1C, - "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", - pm_req->type, pm_req->range.band_arfcn_from, - pm_req->range.band_arfcn_to); - - for (arfcn_next = pm_req->range.band_arfcn_from; - arfcn_next <= pm_req->range.band_arfcn_to; - ++arfcn_next) { - struct l1ctl_pm_conf *pm_conf = - (struct l1ctl_pm_conf *)msgb_put(resp_msg, - sizeof(*pm_conf)); - pm_conf->band_arfcn = htons(arfcn_next); - // rxlev 63 is great, 0 is bad the two values are min and max - pm_conf->pm[0] = 63; - pm_conf->pm[1] = 63; - if (arfcn_next == pm_req->range.band_arfcn_to) { - struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); - resp_l1h->flags |= L1CTL_F_DONE; - } - // no more space to hold mor pm info in msgb, flush to l23 - if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { - l1ctl_sap_tx_to_l23(resp_msg); - resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); - } - } - // transmit the remaining part of pm response to l23 - if (resp_msg) { - l1ctl_sap_tx_to_l23(resp_msg); - } -} - -/** * @brief Handler for received L1CTL_RESET_REQ from L23. * * -- reset request -- diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 6a678d0..f0c7f52 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -13,6 +13,7 @@ #include static struct l1_model_ms *l1_model_ms = NULL; +static uint16_t sync_count = 0; /** * @brief Handler for received L1CTL_FBSB_REQ from L23. @@ -53,11 +54,17 @@ uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg // ignore messages from other arfcns as the one requested to sync to by l23 - if (l1_model_ms->state->fbsb.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { + if (l1_model_ms->state->fbsb.arfcn != arfcn) { talloc_free(msg); + // cancel sync if we did not receive a msg on dl from the requested arfcn that we can sync to + if(sync_count++ > 100) { + sync_count = 0; + l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; + l1ctl_tx_fbsb_conf(1, (l1_model_ms->state->fbsb.arfcn)); + } return; } - l1_model_ms->state->serving_cell.arfcn = (arfcn & GSMTAP_ARFCN_MASK); + l1_model_ms->state->serving_cell.arfcn = arfcn; l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; /* Not needed in virtual phy */ l1_model_ms->state->serving_cell.fn_offset = 0; @@ -68,7 +75,7 @@ /* Restart scheduler */ virt_l1_sched_restart(l1_model_ms->state->downlink_time); talloc_free(msg); - l1ctl_tx_fbsb_conf(0, (arfcn & GSMTAP_ARFCN_MASK)); + l1ctl_tx_fbsb_conf(0, arfcn); } /** @@ -103,7 +110,7 @@ l1ctl_sap_tx_to_l23(msg); } /** - * @brief Initialize virtual prim rach. + * @brief Initialize virtual prim pm. * * @param [in] model the l1 model instance */ diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c new file mode 100644 index 0000000..c08ce03 --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -0,0 +1,91 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static struct l1_model_ms *l1_model_ms = NULL; +// FIXME: ugly to configure that in code. Either make a config file or change power selection to automatically check which arfcns can be received. +static uint16_t available_arfcns[] = {666}; + +/** + * @brief Handler for received L1CTL_PM_REQ from L23. + * + * -- power measurement request -- + * + * @param [in] msg the received message. + * + * Process power measurement for a given range of arfcns to calculate signal power and connection quality. + * + * Note: We do not need to calculate that for the virtual physical layer, + * but l23 apps can expect a response. So this response is mocked here. + * For available arfcns we always return a perfect link quality, for all other the worst. + * + * TODO: Change PM so that we check the downlink first for for some time to get the arfcns we receive. Then return a good link for that and a bad for all others. + */ +void l1ctl_rx_pm_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *)l1h->data; + struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + uint16_t arfcn_next; + // convert to host order + pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); + pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); + + DEBUGP(DL1C, + "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + pm_req->type, pm_req->range.band_arfcn_from, + pm_req->range.band_arfcn_to); + + for (arfcn_next = pm_req->range.band_arfcn_from; + arfcn_next <= pm_req->range.band_arfcn_to; + ++arfcn_next) { + struct l1ctl_pm_conf *pm_conf = + (struct l1ctl_pm_conf *)msgb_put(resp_msg, + sizeof(*pm_conf)); + int cnt, available = 0; + pm_conf->band_arfcn = htons(arfcn_next); + // check if arfcn is available + for(cnt = 0; cnt < sizeof(available_arfcns) / sizeof(uint16_t); cnt++) { + if(arfcn_next == available_arfcns[cnt]) { + available = 1; + break; + } + } + // rxlev 63 is great, 0 is bad the two values are min and max + pm_conf->pm[0] = available ? 63 : 0; + pm_conf->pm[1] = available ? 63 : 0; + if (arfcn_next == pm_req->range.band_arfcn_to) { + struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); + resp_l1h->flags |= L1CTL_F_DONE; + } + // no more space to hold mor pm info in msgb, flush to l23 + if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { + l1ctl_sap_tx_to_l23(resp_msg); + resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); + } + } + // transmit the remaining part of pm response to l23 + if (resp_msg) { + l1ctl_sap_tx_to_l23(resp_msg); + } +} + +/** + * @brief Initialize virtual prim pm. + * + * @param [in] model the l1 model instance + */ +void prim_pm_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} -- To view, visit https://gerrit.osmocom.org/3211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia1b79aa47c9df3b1e316122455ceccb4a66724e0 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:54 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Fixed FACCH processing on TCH. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Fixed FACCH processing on TCH. ...................................................................... VIRT-PHY: Fixed FACCH processing on TCH. As TCH is not supported in GSMTAP yet, all incoming frames on the virt-phy are forwarded as FACCH to the l23 for now. Cleanup code in virt_prim_data and virt_prim_traffic. Change-Id: I6b41f21b6984e62ad98edfe4398bd678d5b2dad5 --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_traffic.c 6 files changed, 160 insertions(+), 94 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index acf8f98..71d4765 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -55,12 +55,21 @@ /* transmit routines */ void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type); void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn); +void l1ctl_tx_data_conf(uint32_t fn, uint16_t snr, uint16_t arfcn); +void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, + uint8_t signal_dbm, uint8_t num_biterr, + uint8_t fire_crc); +void l1ctl_tx_traffic_conf(uint32_t fn, uint16_t snr, uint16_t arfcn); +void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, + uint8_t signal_dbm, uint8_t num_biterr, + uint8_t fire_crc); void l1ctl_tx_pm_conf(struct l1ctl_pm_req *pm_req); void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn); void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode); -void l1ctl_tx_msg(uint8_t msg_type); /* scheduler functions */ uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, - uint8_t link_id); + uint8_t link_id); diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 76941cd..3cb0df9 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -51,8 +51,8 @@ {GSMTAP_CHANNEL_SDCCH, "SDCCH"}, {GSMTAP_CHANNEL_SDCCH4, "SDCCH/4"}, {GSMTAP_CHANNEL_SDCCH8, "SDCCH/8"}, - {GSMTAP_CHANNEL_TCH_F, "FACCH/F"}, - {GSMTAP_CHANNEL_TCH_H, "FACCH/H"}, + {GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F"}, + {GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H"}, {GSMTAP_CHANNEL_PACCH, "PACCH"}, {GSMTAP_CHANNEL_CBCH52, "CBCH"}, {GSMTAP_CHANNEL_PDCH, "PDCH"}, @@ -90,7 +90,8 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, + struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; @@ -112,21 +113,22 @@ // arfcn needs to be flagged to be able to distinguish between uplink and downlink outmsg = gsmtap_makemsg(arfcn | GSMTAP_ARFCN_F_UPLINK, timeslot, - gsmtap_chan, subslot, fn, signal_dbm, snr, data, - data_len); + gsmtap_chan, subslot, fn, signal_dbm, snr, data, + data_len); if (outmsg) { outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); if (virt_um_write_msg(l1_model_ms->vui, outmsg) == -1) { - LOGP(DVIRPHY, LOGL_ERROR, - "Gsmtap msg could not send to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, - gh->timeslot, gh->sub_slot); + LOGP(DVIRPHY, + LOGL_ERROR, + "Gsmtap msg could not send to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, gh->timeslot, + gh->sub_slot); } else { DEBUGP(DVIRPHY, - "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, - gh->timeslot, gh->sub_slot); + "Sending gsmtap msg to virt um - (arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", + gh->arfcn, gh->type, gh->sub_type, gh->timeslot, + gh->sub_slot); } } else { LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); @@ -172,9 +174,6 @@ struct gsmtap_hdr *gh = msgb_l1(msg); struct msgb *l1ctl_msg = NULL; - struct l1ctl_info_dl *l1dl; - struct l1ctl_traffic_ind * l1ti; - struct l1ctl_data_ind * l1di; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type @@ -196,22 +195,25 @@ virt_l1_sched_execute(fn); DEBUGP(DVIRPHY, - "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", - arfcn, fn, get_value_string(gsmtap_types, gh->type), - get_value_string(gsmtap_channels, gsmtap_chantype), - timeslot, subslot, rsl_chantype, link_id, chan_nr); + "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", + arfcn, fn, get_value_string(gsmtap_types, gh->type), + get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, + subslot, rsl_chantype, link_id, chan_nr); // generally ignore all messages coming from another arfcn than the camped one if (l1_model_ms->state->serving_cell.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn & GSMTAP_ARFCN_MASK, l1_model_ms->state->serving_cell.arfcn); + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", + arfcn & GSMTAP_ARFCN_MASK, + l1_model_ms->state->serving_cell.arfcn); goto nomessage; } // generally ignore all uplink messages received if (arfcn & GSMTAP_ARFCN_F_UPLINK) { LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + "Ignoring gsmtap msg from virt um - uplink flag set!\n"); goto nomessage; } @@ -219,54 +221,25 @@ switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { case GSMTAP_CHANNEL_TCH_H: case GSMTAP_CHANNEL_TCH_F: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); - l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_info_dl)); - l1ti = (struct l1ctl_traffic_ind *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_traffic_ind)); - - l1dl->band_arfcn = htons(arfcn); - l1dl->link_id = link_id; - l1dl->chan_nr = chan_nr; - l1dl->frame_nr = htonl(fn); - l1dl->snr = snr; - l1dl->rx_level = signal_dbm; - l1dl->num_biterr = 0; // no biterrors - l1dl->fire_crc = 0; - - // TODO: traffic decoding and decryption - - memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); - break; +#if(0) + // TODO: handle msgs on TCH that are neither FACCH nor TCH/ACCH + if(!facch && ! tch_acch) { + l1ctl_tx_traffic_ind(msg, arfcn, link_id, chan_nr, fn, + snr, signal_dbm, 0, 0); + } +#endif case GSMTAP_CHANNEL_SDCCH4: case GSMTAP_CHANNEL_SDCCH8: - // TODO: we might need to implement own channel handling for standalone dedicated channels case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: - l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); - l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_info_dl)); - l1di = (struct l1ctl_data_ind *)msgb_put(l1ctl_msg, - sizeof(struct l1ctl_data_ind)); - - l1dl->band_arfcn = htons(arfcn); - l1dl->link_id = link_id; - l1dl->chan_nr = chan_nr; - l1dl->frame_nr = htonl(fn); - l1dl->snr = snr; - l1dl->rx_level = signal_dbm; - l1dl->num_biterr = 0; // no biterrors - l1dl->fire_crc = 0; // TODO: check if this means fire crc is not used or crc produced no error - - // TODO: data decoding and decryption - - memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - + l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, + signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); break; case GSMTAP_CHANNEL_SDCCH: case GSMTAP_CHANNEL_CCCH: @@ -275,12 +248,14 @@ case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type not supported!\n"); break; default: - LOGP(DVIRPHY, LOGL_NOTICE, - "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + LOGP(DVIRPHY, + LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - channel type unknown.\n"); break; } @@ -288,7 +263,7 @@ if (l1ctl_msg) { l1ctl_sap_tx_to_l23(l1ctl_msg); } -nomessage: + nomessage: // handle memory deallocation talloc_free(msg); } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 71bb554..c03da3b 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -149,7 +149,7 @@ dl = (struct l1ctl_info_dl *)msgb_put(msg, sizeof(*dl)); dl->frame_nr = htonl(fn); - dl->snr = snr; + dl->snr = htons(snr); dl->band_arfcn = htons(arfcn); return msg; @@ -604,18 +604,6 @@ DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); - l1ctl_sap_tx_to_l23(msg); -} - -/** - * @brief Transmit L1CTL msg of a given type to layer 23. - * - * @param [in] msg_type L1CTL primitive message type. - */ -void l1ctl_tx_msg(uint8_t msg_type) -{ - struct msgb *msg = l1ctl_msgb_alloc(msg_type); - DEBUGP(DL1C, "Sending to l23 - %s\n", getL1ctlPrimName(msg_type)); l1ctl_sap_tx_to_l23(msg); } diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 1cfb40f..88ffd22 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -87,7 +87,7 @@ log_add_target(stderr_target); log_set_all_filter(stderr_target, 1); //log_set_log_level(stderr_target, 1); - log_set_print_filename(stderr_target, 0); + log_set_print_filename(stderr_target, 1); log_set_use_color(stderr_target, 0); log_set_print_timestamp(stderr_target, 1); log_set_print_category(stderr_target, 1); diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 932683c..5d62afd 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -42,15 +42,13 @@ /** * @brief Handler callback function for DATA request. * + * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { gsmtapl1_tx_to_virt_um(fn, msg); - // send confirm to layer23 - msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, - fn, 0, 0); - l1ctl_sap_tx_to_l23(msg); + l1ctl_tx_data_conf(fn, 0, l1_model_ms->state->serving_cell.arfcn); } /** @@ -70,7 +68,8 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, + ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, @@ -85,6 +84,53 @@ } +void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, + uint8_t signal_dbm, uint8_t num_biterr, uint8_t fire_crc) +{ + struct msgb *l1ctl_msg = NULL; + struct l1ctl_data_ind * l1di; + struct l1ctl_info_dl * l1dl; + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); + l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_info_dl)); + l1di = (struct l1ctl_data_ind *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_data_ind)); + + l1dl->band_arfcn = htons(arfcn); + l1dl->link_id = link_id; + l1dl->chan_nr = chan_nr; + l1dl->frame_nr = htonl(fn); + l1dl->snr = snr; + l1dl->rx_level = signal_dbm; + l1dl->num_biterr = 0; // no biterrors + l1dl->fire_crc = 0; + + // TODO: data decoding and decryption + + memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); + + DEBUGP(DL1C, "Sending signaling-data to l23.\n"); + l1ctl_sap_tx_to_l23(l1ctl_msg); + +} + +/** + * @brief Send a L1CTL_DATA_CONF to L23. + * + * @param [in] fn frame number + * @param [in] snr signal noise ratio + * @param [in] arfcn arfcn of the cell the message was send on + * + */ +void l1ctl_tx_data_conf(uint32_t fn, uint16_t snr, uint16_t arfcn) +{ + struct msgb * l1ctl_msg; + l1ctl_msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn, snr, arfcn); + // send confirm to layer23 + l1ctl_sap_tx_to_l23(l1ctl_msg); +} + /** * @brief Initialize virtual prim data. * diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 0175b8d..dbdcac3 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -42,15 +42,13 @@ /** * @brief Handler callback function for TRAFFIC request. * + * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { gsmtapl1_tx_to_virt_um(fn, msg); - // send confirm to layer23 - msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, - fn, 0, 0); - l1ctl_sap_tx_to_l23(msg); + l1ctl_tx_traffic_conf(fn, 0, l1_model_ms->state->serving_cell.arfcn); } /** @@ -69,7 +67,8 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, + ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); @@ -80,6 +79,55 @@ &virt_l1_sched_handler_cb); } +void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, + uint8_t signal_dbm, uint8_t num_biterr, + uint8_t fire_crc) +{ + struct msgb *l1ctl_msg = NULL; + struct l1ctl_traffic_ind * l1ti; + struct l1ctl_info_dl * l1dl; + uint8_t rsl_chan_type, subchan, timeslot; + l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); + l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, + sizeof(struct l1ctl_info_dl)); + l1ti = (struct l1ctl_traffic_ind *)msgb_put( + l1ctl_msg, sizeof(struct l1ctl_traffic_ind)); + + rsl_dec_chan_nr(chan_nr, &rsl_chan_type, &subchan, ×lot); + + l1dl->band_arfcn = htons(arfcn); + l1dl->link_id = link_id; + l1dl->chan_nr = chan_nr; + l1dl->frame_nr = htonl(fn); + l1dl->snr = snr; + l1dl->rx_level = signal_dbm; + l1dl->num_biterr = 0; // no biterrors + l1dl->fire_crc = 0; + + // TODO: traffic decoding and decryption + + memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); + DEBUGP(DL1C, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); + l1ctl_sap_tx_to_l23(l1ctl_msg); +} + +/** + * @brief Send a L1CTL_TRAFFIC_CONF to L23. + * + * @param [in] fn frame number + * @param [in] snr signal noise ratio + * @param [in] arfcn arfcn of the cell the message was send on + * + */ +void l1ctl_tx_traffic_conf(uint32_t fn, uint16_t snr, uint16_t arfcn) +{ + struct msgb * l1ctl_msg; + l1ctl_msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn, snr, arfcn); + // send confirm to layer23 + l1ctl_sap_tx_to_l23(l1ctl_msg); +} + /** * @brief Initialize virtual prim traffic. * -- To view, visit https://gerrit.osmocom.org/3210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6b41f21b6984e62ad98edfe4398bd678d5b2dad5 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:55 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Added example config for 2 mobile instances. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Added example config for 2 mobile instances. ...................................................................... VIRT-PHY: Added example config for 2 mobile instances. Change-Id: Iecfed3933ca88aa7a027e6247a8b71e28ee1883e --- M src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg A src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg 2 files changed, 125 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg index 382a09d..1aeb3f5 100644 --- a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg +++ b/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg @@ -19,7 +19,7 @@ imei 123456789012345 0 imei-fixed no emergency-imsi - no sms-service-center + sms-service-center 123123123 no call-waiting no auto-answer no force-rekey @@ -40,9 +40,9 @@ p-gsm e-gsm r-gsm - no gsm-850 + gsm-850 dcs - no pcs + pcs class-900 4 class-850 4 class-dcs 1 @@ -59,8 +59,8 @@ imsi 901700000000403 ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef no barred-access - no rplmn - hplmn-search foreign-country + rplmn 262 42 0x0001 + hplmn-search everywhere exit no shutdown exit diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg b/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg new file mode 100644 index 0000000..0c9ada4 --- /dev/null +++ b/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg @@ -0,0 +1,120 @@ +! +! OsmocomBB (0.0.0) configuration saved from vty +!! +! +line vty + no login +! +gps device /dev/ttyACM0 +gps baudrate default +no gps enable +! +no hide-default +! +ms 1 + layer2-socket /tmp/osmocom_l2 + sap-socket /tmp/osmocom_sap + sim test + network-selection-mode auto + imei 123456789012345 0 + imei-fixed + no emergency-imsi + sms-service-center 123123123 + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + gsm-850 + dcs + pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + exit + test-sim + imsi 901700000000403 + ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + barred-access + rplmn 262 42 0x0001 + hplmn-search everywhere + exit + no shutdown +exit +ms 2 + layer2-socket /tmp/osmocom_l2_NR2 + sap-socket /tmp/osmocom_sap_NR2 + sim test + network-selection-mode auto + imei 123456789012346 0 + imei-fixed + no emergency-imsi + sms-service-center 123123123 + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + gsm-850 + dcs + pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + exit + test-sim + imsi 901700000000404 + ki comp128 11 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + barred-access + rplmn 262 42 0x0001 + hplmn-search everywhere + exit + no shutdown +exit +! -- To view, visit https://gerrit.osmocom.org/3202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iecfed3933ca88aa7a027e6247a8b71e28ee1883e Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:55 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Uplink flag and arfcn check. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Uplink flag and arfcn check. ...................................................................... VIRT-PHY: Uplink flag and arfcn check. Incoming messages with the uplinks flag set in the arfcn or another arfcn than the cell's we are camping on are ignored. Change-Id: Ibb78ac68172fceaa04acca81271940632e52d857 --- M src/host/virt_phy/src/gsmtapl1_if.c 1 file changed, 57 insertions(+), 43 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 338f99c..ebfb5b6 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -39,48 +39,46 @@ static struct l1_model_ms *l1_model_ms = NULL; // for debugging -static const struct value_string gsmtap_channels [22] = { - { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, - { GSMTAP_CHANNEL_BCCH, "BCCH" }, - { GSMTAP_CHANNEL_CCCH, "CCCH" }, - { GSMTAP_CHANNEL_RACH, "RACH" }, - { GSMTAP_CHANNEL_AGCH, "AGCH" }, - { GSMTAP_CHANNEL_PCH, "PCH" }, - { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, - { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, - { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, - { GSMTAP_CHANNEL_TCH_F, "FACCH/F" }, - { GSMTAP_CHANNEL_TCH_H, "FACCH/H" }, - { GSMTAP_CHANNEL_PACCH, "PACCH" }, - { GSMTAP_CHANNEL_CBCH52, "CBCH" }, - { GSMTAP_CHANNEL_PDCH, "PDCH" }, - { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, - { GSMTAP_CHANNEL_CBCH51, "CBCH" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_SDCCH, "LSACCH" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, - { GSMTAP_CHANNEL_ACCH| - GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, - { 0, NULL }, -}; +static const struct value_string gsmtap_channels[22] = { + {GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN"}, + {GSMTAP_CHANNEL_BCCH, "BCCH"}, + {GSMTAP_CHANNEL_CCCH, "CCCH"}, + {GSMTAP_CHANNEL_RACH, "RACH"}, + {GSMTAP_CHANNEL_AGCH, "AGCH"}, + {GSMTAP_CHANNEL_PCH, "PCH"}, + {GSMTAP_CHANNEL_SDCCH, "SDCCH"}, + {GSMTAP_CHANNEL_SDCCH4, "SDCCH/4"}, + {GSMTAP_CHANNEL_SDCCH8, "SDCCH/8"}, + {GSMTAP_CHANNEL_TCH_F, "FACCH/F"}, + {GSMTAP_CHANNEL_TCH_H, "FACCH/H"}, + {GSMTAP_CHANNEL_PACCH, "PACCH"}, + {GSMTAP_CHANNEL_CBCH52, "CBCH"}, + {GSMTAP_CHANNEL_PDCH, "PDCH"}, + {GSMTAP_CHANNEL_PTCCH, "PTTCH"}, + {GSMTAP_CHANNEL_CBCH51, "CBCH"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_SDCCH, "LSACCH"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_SDCCH4, "SACCH/4"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_SDCCH8, "SACCH/8"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_TCH_F, "SACCH/F"}, + {GSMTAP_CHANNEL_ACCH | + GSMTAP_CHANNEL_TCH_H, "SACCH/H"}, + {0, NULL}, }; // for debugging -static const struct value_string gsmtap_types [10] = { - { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, - { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, - { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, - { GSMTAP_TYPE_SIM, "SIM" }, - { GSMTAP_TYPE_TETRA_I1, "TETRA V+D"}, - { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, - { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)" }, - { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, - { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, - { 0, NULL }, -}; +static const struct value_string gsmtap_types[10] = {{ + GSMTAP_TYPE_UM, + "GSM Um (MS<->BTS)"}, {GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)"}, { + GSMTAP_TYPE_UM_BURST, + "GSM Um burst (MS<->BTS)"}, {GSMTAP_TYPE_SIM, "SIM"}, { + GSMTAP_TYPE_TETRA_I1, + "TETRA V+D"}, {GSMTAP_TYPE_WMX_BURST, "WiMAX burst"}, { + GSMTAP_TYPE_GMR1_UM, + "GMR-1 air interfeace (MES-MS<->GTS)"}, { + GSMTAP_TYPE_UMTS_RLC_MAC, + "UMTS RLC/MAC"}, {GSMTAP_TYPE_UMTS_RRC, "UMTS RRC"}, {0, NULL}, }; void gsmtapl1_init(struct l1_model_ms *model) { @@ -111,8 +109,10 @@ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); - outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chan, subslot, fn, - signal_dbm, snr, data, data_len); + // arfcn needs to be flagged to be able to distinguish between uplink and downlink + outmsg = gsmtap_makemsg(arfcn | GSMTAP_ARFCN_F_UPLINK, timeslot, + gsmtap_chan, subslot, fn, signal_dbm, snr, data, + data_len); if (outmsg) { outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); @@ -184,6 +184,19 @@ arfcn, fn, get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); + + // generally ignore all messages coming from another arfcn than the synced one + if (l1_model_ms->state->serving_cell.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn & GSMTAP_ARFCN_MASK, l1_model_ms->state->serving_cell.arfcn); + goto nomessage; + } + // generally ignore all uplink messages received + if (arfcn & GSMTAP_ARFCN_F_UPLINK) { + LOGP(DVIRPHY, LOGL_NOTICE, + "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + goto nomessage; + } // switch case with removed acch flag switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { @@ -258,6 +271,7 @@ if (l1ctl_msg) { l1ctl_sap_tx_to_l23(l1ctl_msg); } +nomessage: // handle memory deallocation talloc_free(msg); } -- To view, visit https://gerrit.osmocom.org/3203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibb78ac68172fceaa04acca81271940632e52d857 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:56 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Calculate correct scheduler fn for data- and tch-m... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Calculate correct scheduler fn for data- and tch-msgs on ul. ...................................................................... VIRT-PHY: Calculate correct scheduler fn for data- and tch-msgs on ul. Proper calculation of the scheduled frame number and appending the jobs with that fn to the scheduler. Thus uplink msgs are scheduled at the (approx.) correct fn and with this fn set in the gsmtap hdr. Change-Id: I0f44d0b5b9208755e671c619d1f851a043aefb54 --- M src/host/virt_phy/.gitignore M src/host/virt_phy/include/virtphy/gsmtapl1_if.h M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/virt_l1_sched.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c 10 files changed, 385 insertions(+), 36 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/.gitignore b/src/host/virt_phy/.gitignore index 1e19c7f..0d2eba0 100644 --- a/src/host/virt_phy/.gitignore +++ b/src/host/virt_phy/.gitignore @@ -1,3 +1,4 @@ config.h config.h.in -src/virtphy \ No newline at end of file +src/virtphy +.dirstamp diff --git a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h index 34cd9c8..d8a4367 100644 --- a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -10,7 +10,7 @@ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); void gsmtapl1_rx_from_virt_um(struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_tx_to_virt_um(struct msgb *msg); +void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg); void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, uint8_t *link_id); diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index b82745c..acf8f98 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -60,3 +60,7 @@ void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode); void l1ctl_tx_msg(uint8_t msg_type); + +/* scheduler functions */ +uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, + uint8_t link_id); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_sched.h b/src/host/virt_phy/include/virtphy/virt_l1_sched.h index a68c58d..de08550 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_sched.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_sched.h @@ -5,7 +5,7 @@ #include #include -typedef void virt_l1_sched_cb(struct msgb * msg); +typedef void virt_l1_sched_cb(uint32_t fn, struct msgb * msg); /* bucket containing items to be executed for a specific mframe number */ struct virt_l1_sched_mframe_item { diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 6ab9edc..76941cd 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -90,13 +90,12 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; struct msgb *outmsg; // msg to send with gsmtap header prepended - uint32_t fn = gsm_gsmtime2fn(&l1_model_ms->state->downlink_time); uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; // arfcn of the cell we currently camp on uint8_t signal_dbm = 63; // signal strength, 63 is best uint8_t snr = 63; // signal noise ratio, 63 is best @@ -140,9 +139,9 @@ /** * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint32_t fn, struct msgb *msg). */ -void gsmtapl1_tx_to_virt_um(struct msgb *msg) +void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, msg); + gsmtapl1_tx_to_virt_um_inst(fn, l1_model_ms->vui, msg); } /** diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 1fb4a42..71bb554 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -666,3 +666,351 @@ l1ctl_sap_tx_to_l23(msg); } +/** + * @brief Get the scheduled fn for a msg depending on its chan_nr and link_id. + */ +uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, + uint8_t link_id) +{ + uint8_t chan_type, chan_ss, chan_ts; + rsl_dec_chan_nr(chan_nr, &chan_type, &chan_ss, &chan_ts); + + uint32_t sched_fn = cur_time.fn; + uint16_t mod_102 = cur_time.fn % 2 * 51; + switch (chan_type) { + case RSL_CHAN_Bm_ACCHs: + switch (link_id) { + case LID_DEDIC: + // dl=[0...11,13...24] ul=[0...11,13...24] + // skip idle frames and frames reserved for TCH_ACCH + if(cur_time.t2 == 12 || cur_time.t2 == 25) { + sched_fn++; + } + break; + // dl=42, ul=42+15 + case LID_SACCH: + if((chan_ts & 1)) { + // Odd traffic channel timeslot -> dl=[25] ul=[25] + // TCH_ACCH always at the end of tch multiframe (mod 26) + sched_fn -= cur_time.t2; + sched_fn += 25; + } + else { + // Even traffic channel timeslot -> dl=[12] ul=[12] + if(cur_time.t2 <= 12) { + sched_fn -= cur_time.t2; + sched_fn += 12; + } else { + sched_fn -= cur_time.t2; + sched_fn += 26 + 12; + } + + } + break; + } + break; + case RSL_CHAN_Lm_ACCHs: + break; /* TCH/H not supported */ + case RSL_CHAN_SDCCH4_ACCH: + switch (chan_ss) { + case 0: + switch (link_id) { + // dl=22, ul=22+15 + case LID_DEDIC: + if(cur_time.t3 <= 22 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 22 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 22 + 15; + } + break; + // dl=42, ul=42+15 + case LID_SACCH: + if(mod_102 <= 42 + 15) { + sched_fn -= mod_102; + sched_fn += 42 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 42 + 15; + } + break; + } + break; + case 1: + switch (link_id) { + // dl=26, ul=26+15 + case LID_DEDIC: + if(cur_time.t3 <= 26 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 26 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 26 + 15; + } + break; + // dl=46, ul=46+15 + case LID_SACCH: + if(mod_102 <= 46 + 15) { + sched_fn -= mod_102; + sched_fn += 46 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 46 + 15; + } + break; + } + break; + case 2: + switch (link_id) { + // dl=32, ul=32+15 + case LID_DEDIC: + if(cur_time.t3 <= 32 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 32 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 32 + 15; + } + break; + // dl=51+42, ul=51+42+15 + case LID_SACCH: + if(mod_102 <= 51 + 42 + 15) { + sched_fn -= mod_102; + sched_fn += 51 + 42 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 51 + 42 + 15; + } + break; + } + break; + case 3: + switch (link_id) { + // dl=36, ul=36+15 + case LID_DEDIC: + if(cur_time.t3 <= 36 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 36 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 36 + 15; + } + break; + // dl=51+46, ul=51+46+15 + case LID_SACCH: + if(mod_102 <= 51 + 46 + 15) { + sched_fn -= mod_102; + sched_fn += 51 + 46 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 51 + 46 + 15; + } + break; + } + break; + } + break; + case RSL_CHAN_SDCCH8_ACCH: + switch (chan_ss) { + case 0: + switch (link_id) { + // dl=0, ul=0+15 + case LID_DEDIC: + if(cur_time.t3 <= 0 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 0 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 0 + 15; + } + break; + // dl=32, ul=32+15 + case LID_SACCH: + if(mod_102 <= 32 + 15) { + sched_fn -= mod_102; + sched_fn += 32 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 32 + 15; + } + break; + } + break; + case 1: + switch (link_id) { + // dl=4, ul=4+15 + case LID_DEDIC: + if(cur_time.t3 <= 4 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 4 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 4 + 15; + } + break; + // dl=36, ul=36+15 + case LID_SACCH: + if(mod_102 <= 36 + 15) { + sched_fn -= mod_102; + sched_fn += 36 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 36 + 15; + } + break; + } + break; + case 2: + switch (link_id) { + // dl=8, ul=8+15 + case LID_DEDIC: + if(cur_time.t3 <= 8 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 8 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 8 + 15; + } + break; + // dl=40, ul=40+15 + case LID_SACCH: + if(mod_102 <= 40 + 15) { + sched_fn -= mod_102; + sched_fn += 40 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 40 + 15; + } + break; + } + break; + case 3: + switch (link_id) { + // dl=12, ul=12+15 + case LID_DEDIC: + if(cur_time.t3 <= 12 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 12 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 12 + 15; + } + break; + // dl=44, ul=44+15 + case LID_SACCH: + if(mod_102 <= 44 + 15) { + sched_fn -= mod_102; + sched_fn += 44 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 44 + 15; + } + break; + } + break; + case 4: + switch (link_id) { + // dl=16, ul=16+15 + case LID_DEDIC: + if(cur_time.t3 <= 16 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 16 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 16 + 15; + } + break; + // dl=51+32, ul=51+32+15 + case LID_SACCH: + if(mod_102 <= 51 + 32 + 15) { + sched_fn -= mod_102; + sched_fn += 51 + 32 + 15; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 51 + 32 + 15; + } + break; + } + break; + case 5: + switch (link_id) { + // dl=20, ul=36+15 + case LID_DEDIC: + if(cur_time.t3 <= 20 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 20 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 20 + 15; + } + break; + // dl=51+36, ul=51+36+15 ==> 0 + case LID_SACCH: + if(mod_102 <= 0) { + sched_fn -= mod_102; + sched_fn += 0; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 0; + } + break; + } + break; + case 6: + switch (link_id) { + // dl=24, ul=24+15 + case LID_DEDIC: + if(cur_time.t3 <= 24 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 24 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 24 + 15; + } + break; + // dl=51+40, ul=51+40+15 ==> 4 + case LID_SACCH: + if(mod_102 <= 4) { + sched_fn -= mod_102; + sched_fn += 4; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 4; + } + break; + } + break; + case 7: + switch (link_id) { + // dl=28, ul=28+15 + case LID_DEDIC: + if(cur_time.t3 <= 28 + 15) { + sched_fn -= cur_time.t3; + sched_fn += 28 + 15; + } else { + sched_fn -= cur_time.t3; + sched_fn += 51 + 28 + 15; + } + break; + // dl=51+44, ul=51+44+15 ==> 8 + case LID_SACCH: + if(mod_102 <= 8) { + sched_fn -= mod_102; + sched_fn += 8; + } else { + sched_fn -= mod_102; + sched_fn += 2 * 51 + 8; + } + break; + } + break; + } + break; + case RSL_CHAN_RACH: + break; /* Use virt_prim_rach.c for calculation of sched fn for rach */ + default: + break; /* Use current fn as default */ + } + return sched_fn; +} diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index 8df88ec..fbb5423 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -80,7 +80,7 @@ { // exec tdma sched item's handler callback // TODO: we do not have a tdma scheduler currently and execute alle scheduled tdma items here at once - ti_next->handler_cb(ti_next->msg); + ti_next->handler_cb(mi_next->fn, ti_next->msg); // remove handled tdma sched item llist_del(&ti_next->tdma_item_entry); } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 25036cc..932683c 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -1,4 +1,4 @@ -/* Layer 1 normal data burst tx handling */ +/* Layer 1 normal data burst uplink handling and scheduling */ /* (C) 2010 by Dieter Spaar * (C) 2010 by Harald Welte @@ -37,19 +37,19 @@ #include static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(struct msgb * msg); +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); /** * @brief Handler callback function for DATA request. * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct msgb * msg) +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(msg); + gsmtapl1_tx_to_virt_um(fn, msg); // send confirm to layer23 - // FIXME: as we might send multiple burst, the base fn may be another one than the current - msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, l1_model_ms->state->current_time.fn, 0, 0); + msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, + fn, 0, 0); l1ctl_sap_tx_to_l23(msg); } @@ -62,28 +62,26 @@ * * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). * - * TODO: Check if a msg on FACCH is coming in here and needs special handling. - * TODO: Check if msg contains data of a burst or data of 4 bursts! + * TODO: Check if a msg on FACCH needs special handling. */ void l1ctl_rx_data_req(struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; - // TODO: calc the scheduled fn - uint32_t fn_sched = l1_model_ms->state->current_time.fn; uint8_t rsl_chantype, subslot, timeslot; + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", - ul->link_id, ul, ul->payload, data_ind, data_ind->data, - msg->l3h); + "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", + ul->link_id, ul, ul->payload, data_ind, data_ind->data, + msg->l3h); msg->l2h = data_ind->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(msg, fn_sched, timeslot, + &virt_l1_sched_handler_cb); } diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index c558034..e455e06 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -37,7 +37,7 @@ #include static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(struct msgb * msg); +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); // use if we have a combined uplink (RACH, SDCCH, ...) (see http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) // if we have no combined channel config, uplink consists of only RACH @@ -54,10 +54,10 @@ * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct msgb * msg) +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(msg); - l1ctl_tx_rach_conf(l1_model_ms->state->current_time.fn, + gsmtapl1_tx_to_virt_um(fn, msg); + l1ctl_tx_rach_conf(fn, l1_model_ms->state->serving_cell.arfcn); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 5660945..0175b8d 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -37,19 +37,19 @@ #include static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(struct msgb * msg); +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); /** * @brief Handler callback function for TRAFFIC request. * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct msgb * msg) +static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(msg); + gsmtapl1_tx_to_virt_um(fn, msg); // send confirm to layer23 msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, - l1_model_ms->state->current_time.fn, 0, 0); + fn, 0, 0); l1ctl_sap_tx_to_l23(msg); } @@ -68,11 +68,10 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; - // TODO: calc the scheduled fn - uint32_t fn_sched = l1_model_ms->state->current_time.fn; uint8_t rsl_chantype, subslot, timeslot; - rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; -- To view, visit https://gerrit.osmocom.org/3208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0f44d0b5b9208755e671c619d1f851a043aefb54 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:56 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Cleanup dirs, makefile, dependencies and formattin... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Cleanup dirs, makefile, dependencies and formatting code. ...................................................................... VIRT-PHY: Cleanup dirs, makefile, dependencies and formatting code. Change-Id: Ibd68a03bcc439c262ba513782936c6b62937eaaa --- M src/Makefile M src/host/virt_phy/configure.ac R src/host/virt_phy/include/virtphy/gsmtapl1_if.h R src/host/virt_phy/include/virtphy/l1ctl_sap.h R src/host/virt_phy/include/virtphy/l1ctl_sock.h R src/host/virt_phy/include/virtphy/logging.h R src/host/virt_phy/include/virtphy/osmo_mcast_sock.h R src/host/virt_phy/include/virtphy/virt_l1_model.h R src/host/virt_phy/include/virtphy/virtual_um.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/logging.c R src/host/virt_phy/src/shared/osmo_mcast_sock.c R src/host/virt_phy/src/shared/virtual_um.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virtphy.c 18 files changed, 85 insertions(+), 107 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/Makefile b/src/Makefile index e83175c..f5e2128 100644 --- a/src/Makefile +++ b/src/Makefile @@ -47,8 +47,7 @@ make -C host/osmocon .PHONY: virtphy -virtphy: host/virt_phy/Makefile - cd host/virt_phy && make +virtphy: host/virt_phy/virtphy host/virt_phy/configure: host/virt_phy/configure.ac cd host/virt_phy && autoreconf -i @@ -56,6 +55,9 @@ host/virt_phy/Makefile: host/virt_phy/configure cd host/virt_phy && ./configure $(HOST_CONFARGS) +host/virt_phy/virtphy: host/virt_phy/Makefile + make -C host/virt_phy + .PHONY: gsmmap gsmmap: host/gsmmap/gsmmap diff --git a/src/host/virt_phy/configure.ac b/src/host/virt_phy/configure.ac index bcdbf91..860082e 100644 --- a/src/host/virt_phy/configure.ac +++ b/src/host/virt_phy/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script AC_INIT([virtphy], 0.0.0) AM_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects]) dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) diff --git a/src/host/virt_phy/src/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h similarity index 85% rename from src/host/virt_phy/src/gsmtapl1_if.h rename to src/host/virt_phy/include/virtphy/gsmtapl1_if.h index 6311e07..c511560 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -2,10 +2,9 @@ #include #include - -#include "l1ctl_sock.h" -#include "virtual_um.h" -#include "virt_l1_model.h" +#include +#include +#include void gsmtapl1_init(struct l1_model_ms *model); void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, diff --git a/src/host/virt_phy/src/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h similarity index 89% rename from src/host/virt_phy/src/l1ctl_sap.h rename to src/host/virt_phy/include/virtphy/l1ctl_sap.h index 9472013..902eb17 100644 --- a/src/host/virt_phy/src/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -3,10 +3,9 @@ #include #include #include - -#include "l1ctl_sock.h" -#include "virtual_um.h" -#include "virt_l1_model.h" +#include +#include +#include /* following sizes are used for message allocation */ /* size of layer 3 header */ @@ -22,7 +21,8 @@ void l1ctl_sap_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg); +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, + struct msgb *msg); void l1ctl_sap_rx_from_l23(struct msgb *msg); void l1ctl_sap_handler(struct msgb *msg); diff --git a/src/host/virt_phy/src/l1ctl_sock.h b/src/host/virt_phy/include/virtphy/l1ctl_sock.h similarity index 100% rename from src/host/virt_phy/src/l1ctl_sock.h rename to src/host/virt_phy/include/virtphy/l1ctl_sock.h diff --git a/src/host/virt_phy/src/logging.h b/src/host/virt_phy/include/virtphy/logging.h similarity index 100% rename from src/host/virt_phy/src/logging.h rename to src/host/virt_phy/include/virtphy/logging.h diff --git a/src/host/virt_phy/src/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h similarity index 100% rename from src/host/virt_phy/src/osmo_mcast_sock.h rename to src/host/virt_phy/include/virtphy/osmo_mcast_sock.h diff --git a/src/host/virt_phy/src/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h similarity index 90% rename from src/host/virt_phy/src/virt_l1_model.h rename to src/host/virt_phy/include/virtphy/virt_l1_model.h index 38d9efe..561025e 100644 --- a/src/host/virt_phy/src/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -1,7 +1,7 @@ #pragma once -#include "l1ctl_sock.h" -#include "virtual_um.h" +#include +#include #define L1S_NUM_NEIGH_CELL 6 #define A5_KEY_LEN 8 @@ -16,17 +16,17 @@ /* structure representing L1 sync information about a cell */ struct l1_cell_info { /* on which ARFCN (+band) is the cell? */ - uint16_t arfcn; + uint16_t arfcn; /* what's the BSIC of the cell (from SCH burst decoding) */ - uint8_t bsic; + uint8_t bsic; /* Combined or non-combined CCCH */ - uint8_t ccch_mode; /* enum ccch_mode */ + uint8_t ccch_mode; /* enum ccch_mode */ /* whats the delta of the cells current GSM frame number * compared to our current local frame number */ - int32_t fn_offset; + int32_t fn_offset; /* how much does the TPU need adjustment (delta) to synchronize * with the cells burst */ - uint32_t time_alignment; + uint32_t time_alignment; }; struct crypto_info_ms { diff --git a/src/host/virt_phy/src/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h similarity index 68% rename from src/host/virt_phy/src/virtual_um.h rename to src/host/virt_phy/include/virtphy/virtual_um.h index eafb994..5c883de 100644 --- a/src/host/virt_phy/src/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -16,8 +16,10 @@ void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); }; -struct virt_um_inst *virt_um_init(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, const char *rx_mcast_group, uint16_t rx_mcast_port, - void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); +struct virt_um_inst *virt_um_init( + void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); void virt_um_destroy(struct virt_um_inst *vui); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index 2dac297..8508509 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -1,18 +1,8 @@ -OSMOCOM_DIR = /home/basti/Osmocom -OSMO_BB_DIR = $(OSMOCOM_DIR)/osmocom-bb -OSMO_BTS_DIR = $(OSMOCOM_DIR)/osmo-bts -OPENBSC_DIR = $(OSMOCOM_DIR)/openbsc - AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OSMO_BB_DIR)/include -I$(OSMO_BTS_DIR)/include -I$(OPENBSC_DIR)/openbsc/include -I$(OSMO_BB_DIR)/src/host/layer23/include -# TODO: somehow this include path causes errors, thus the needed files are copied into $(top_srcdir)/include. Would be better to include directly from $(OSMO_BB_DIR)/src/target/firmware/include to avoid redundancy. -# -I$(OSMO_BB_DIR)/src/target/firmware/include - -# disable optimization and enable debugging -CFLAGS = -g -O0 +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/../layer23/include sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c l1ctl_sap.c gsmtapl1_if.c logging.c virt_l1_model.c virtual_um.c osmo_mcast_sock.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c l1ctl_sap.c gsmtapl1_if.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) # debug output diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index d46bb2f..338f99c 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -29,13 +29,12 @@ #include #include #include - -#include "virtual_um.h" -#include "l1ctl_sock.h" -#include "virt_l1_model.h" -#include "l1ctl_sap.h" -#include "gsmtapl1_if.h" -#include "logging.h" +#include +#include +#include +#include +#include +#include static struct l1_model_ms *l1_model_ms = NULL; @@ -162,6 +161,8 @@ struct gsmtap_hdr *gh = msgb_l1(msg); struct msgb *l1ctl_msg = NULL; struct l1ctl_info_dl *l1dl; + struct l1ctl_traffic_ind * l1ti; + struct l1ctl_data_ind * l1di; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the cell we currently camp on uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type @@ -188,7 +189,6 @@ switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { case GSMTAP_CHANNEL_TCH_H: case GSMTAP_CHANNEL_TCH_F: - struct l1ctl_traffic_ind * l1ti; l1ctl_msg = l1ctl_msgb_alloc(L1CTL_TRAFFIC_IND); l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); @@ -214,7 +214,6 @@ case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: - struct l1ctl_data_ind * l1di; l1ctl_msg = l1ctl_msgb_alloc(L1CTL_DATA_IND); l1dl = (struct l1ctl_info_dl *)msgb_put(l1ctl_msg, sizeof(struct l1ctl_info_dl)); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 91f1d10..3be6b9d 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -11,13 +11,12 @@ #include #include #include - -#include "virtual_um.h" -#include "l1ctl_sock.h" -#include "virt_l1_model.h" -#include "l1ctl_sap.h" -#include "logging.h" -#include "gsmtapl1_if.h" +#include +#include +#include +#include +#include +#include static struct l1_model_ms *l1_model_ms = NULL; diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index b507369..5e0ba43 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -44,9 +44,9 @@ #include -#include "l1ctl_sock.h" -#include "virtual_um.h" -#include "logging.h" +#include +#include +#include #define L1CTL_SOCK_MSGB_SIZE 256 @@ -87,8 +87,8 @@ lsi->recv_cb(lsi, msg); return 0; } -ERR: - perror("Failed to receive msg from l2. Connection will be closed.\n"); + ERR: perror( + "Failed to receive msg from l2. Connection will be closed.\n"); l1ctl_sock_disconnect(lsi); } return 0; diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index a017a52..1cfb40f 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -20,11 +20,9 @@ * */ - #include #include - -#include "logging.h" +#include const char* l1ctlPrimNames[] = { "_L1CTL_NONE", @@ -57,41 +55,33 @@ "L1CTL_NEIGH_PM_IND", "L1CTL_TRAFFIC_REQ", "L1CTL_TRAFFIC_CONF", - "L1CTL_TRAFFIC_IND" -}; + "L1CTL_TRAFFIC_IND"}; -static const struct log_info_cat default_categories[] = { - [DL1C] = { - .name = "DL1C", - .description = "Layer 1 Control", - .color = "\033[1;31m", - .enabled = 1, - .loglevel = LOGL_DEBUG, - }, - [DVIRPHY] = { - .name = "DVIRPHY", - .description = "Virtual Layer 1 Interface", - .color = "\033[1;31m", - .enabled = 1, - .loglevel = LOGL_DEBUG, - } -}; +static const struct log_info_cat default_categories[] = {[DL1C] = { + .name = "DL1C", + .description = "Layer 1 Control", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, }, [DVIRPHY] = { + .name = "DVIRPHY", + .description = "Virtual Layer 1 Interface", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, }}; -const struct log_info ms_log_info = { - .filter_fn = NULL, - .cat = default_categories, - .num_cat = ARRAY_SIZE(default_categories), -}; +const struct log_info ms_log_info = {.filter_fn = NULL, .cat = + default_categories, .num_cat = ARRAY_SIZE(default_categories), }; /** * Initialize the logging system for the virtual physical layer. */ -int ms_log_init(char *cat_mask) { +int ms_log_init(char *cat_mask) +{ struct log_target *stderr_target; log_init(&ms_log_info, NULL); stderr_target = log_target_create_stderr(); - if(!stderr) { + if (!stderr) { return -1; } log_add_target(stderr_target); @@ -101,7 +91,7 @@ log_set_use_color(stderr_target, 0); log_set_print_timestamp(stderr_target, 1); log_set_print_category(stderr_target, 1); - if(cat_mask) { + if (cat_mask) { log_parse_category_mask(stderr_target, cat_mask); } return 0; diff --git a/src/host/virt_phy/src/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c similarity index 99% rename from src/host/virt_phy/src/osmo_mcast_sock.c rename to src/host/virt_phy/src/shared/osmo_mcast_sock.c index c177734..acc6bcb 100644 --- a/src/host/virt_phy/src/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -8,8 +8,7 @@ #include #include #include - -#include "osmo_mcast_sock.h" +#include struct mcast_server_sock *mcast_server_sock_setup(void *ctx, char* tx_mcast_group, diff --git a/src/host/virt_phy/src/virtual_um.c b/src/host/virt_phy/src/shared/virtual_um.c similarity index 92% rename from src/host/virt_phy/src/virtual_um.c rename to src/host/virt_phy/src/shared/virtual_um.c index e2e86e4..9415bfb 100644 --- a/src/host/virt_phy/src/virtual_um.c +++ b/src/host/virt_phy/src/shared/virtual_um.c @@ -25,9 +25,9 @@ #include #include #include - -#include "virtual_um.h" -#include "osmo_mcast_sock.h" +#include +#include +#include /** * Virtual UM interface file descriptor callback. @@ -68,8 +68,8 @@ } struct virt_um_inst *virt_um_init( - void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, - const char *rx_mcast_group, uint16_t rx_mcast_port, + void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) { struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index f2e1690..1b1d0df 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -1,14 +1,16 @@ -#include "virt_l1_model.h" +#include +#include -struct l1_model_ms* l1_model_ms_init(void *ctx) { - +struct l1_model_ms* l1_model_ms_init(void *ctx) +{ struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); model->state = talloc_zero(ctx, struct l1_state_ms); - return model; + } -void l1_model_ms_destroy(struct l1_model_ms *model) { +void l1_model_ms_destroy(struct l1_model_ms *model) +{ virt_um_destroy(model->vui); l1ctl_sock_destroy(model->lsi); talloc_free(model->state); diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index b2a2d4f..5007146 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -1,19 +1,16 @@ /* osmocom includes */ -#include "logging.h" #include #include -#include #include #include #include -#include - -#include "virtual_um.h" -#include "l1ctl_sock.h" -#include "virt_l1_model.h" -#include "gsmtapl1_if.h" -#include "l1ctl_sap.h" +#include +#include +#include +#include +#include +#include int main(void) { @@ -29,9 +26,8 @@ // TODO: make this configurable model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, - DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, - DEFAULT_MS_MCAST_PORT, - gsmtapl1_rx_from_virt_um_inst_cb); + DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, + DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, NULL); gsmtapl1_init(model); -- To view, visit https://gerrit.osmocom.org/3200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibd68a03bcc439c262ba513782936c6b62937eaaa Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:56 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Enable multiple phy-instances by configurable l1ct... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Enable multiple phy-instances by configurable l1ctl-sock-path. ...................................................................... VIRT-PHY: Enable multiple phy-instances by configurable l1ctl-sock-path. Change-Id: Ief22eedacd1929450ff68f553068b95a778df80f --- M src/host/virt_phy/include/virtphy/l1ctl_sock.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/virtphy.c 4 files changed, 15 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sock.h b/src/host/virt_phy/include/virtphy/l1ctl_sock.h index ef9799c..8c96dc8 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sock.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sock.h @@ -9,6 +9,7 @@ struct l1ctl_sock_inst { void *priv; /* Will be appended after osmo-fd's data pointer. */ struct osmo_fd connection; /* L1CTL connection to l2 app */ + char* l1ctl_sock_path; /* Socket path used to connect to l23 */ struct osmo_fd ofd; /* Osmocom file descriptor to accept L1CTL connections. */ void (*recv_cb)(struct l1ctl_sock_inst *vui, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ }; diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 3be6b9d..b89d963 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -74,10 +74,7 @@ /* prepend 16bit length before sending */ len = (uint16_t *)msgb_push(msg, sizeof(*len)); *len = htons(msg->len - sizeof(*len)); - - if (l1ctl_sock_write_msg(lsi, msg) == -1) { - DEBUGP(DL1C, "Error writing to layer2 socket"); - } + l1ctl_sock_write_msg(lsi, msg); } /** diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index 5e0ba43..c28da60 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -163,6 +163,7 @@ lsi->ofd.cb = l1ctl_sock_accept_cb; // no connection -> invalid filedescriptor and not 0 (==std_in) lsi->connection.fd = -1; + lsi->l1ctl_sock_path = path; osmo_fd_register(&lsi->ofd); diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 5007146..977a358 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -12,10 +12,18 @@ #include #include -int main(void) +int main( int argc, char *argv[] ) { // init loginfo static struct l1_model_ms *model; + char * l1ctl_sock_path = NULL; + + // get path from commandline argument + if( argc > 1 ) { + l1ctl_sock_path = argv[1]; + } + + //ms_log_init("DL1C,1:DVIRPHY,1"); ms_log_init("DL1C,1"); //ms_log_init("DL1C,8:DVIRPHY,8"); @@ -28,12 +36,13 @@ model->vui = virt_um_init(NULL, DEFAULT_BTS_MCAST_GROUP, DEFAULT_BTS_MCAST_PORT, DEFAULT_MS_MCAST_GROUP, DEFAULT_MS_MCAST_PORT, gsmtapl1_rx_from_virt_um_inst_cb); - model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, NULL); + model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, l1ctl_sock_path); gsmtapl1_init(model); l1ctl_sap_init(model); - LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n"); + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ + Waiting for l23 app on", l1ctl_sock_path); while (1) { // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) -- To view, visit https://gerrit.osmocom.org/3201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief22eedacd1929450ff68f553068b95a778df80f Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:56 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Using IANA-registered port 4729 for GSMTAP for vir... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Using IANA-registered port 4729 for GSMTAP for virt um. ...................................................................... VIRT-PHY: Using IANA-registered port 4729 for GSMTAP for virt um. Change-Id: Id8e262c9a9a6260353bfb98e774b9d0b6eecae53 --- M src/host/virt_phy/include/virtphy/virtual_um.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h index 5c883de..6e7c384 100644 --- a/src/host/virt_phy/include/virtphy/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -6,9 +6,9 @@ #define VIRT_UM_MSGB_SIZE 256 #define DEFAULT_MS_MCAST_GROUP "224.0.0.1" -#define DEFAULT_MS_MCAST_PORT 6666 +#define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ #define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" -#define DEFAULT_BTS_MCAST_PORT 6667 +#define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ struct virt_um_inst { void *priv; -- To view, visit https://gerrit.osmocom.org/3205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id8e262c9a9a6260353bfb98e774b9d0b6eecae53 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:57 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Scheduler - correct handling over hyperframe repeat. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Scheduler - correct handling over hyperframe repeat. ...................................................................... VIRT-PHY: Scheduler - correct handling over hyperframe repeat. Scheduler will no longer skip tasks that are scheduler for a framenumber greater than the current fn because of a hyperframe repetition. Change-Id: I683ba18b5dee308d58f9a95a0ee10e22da207eda --- M src/host/virt_phy/src/virt_l1_sched_simple.c 1 file changed, 14 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index fbb5423..d3975ee 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -9,6 +9,8 @@ static LLIST_HEAD(mframe_item_list); +static uint32_t last_exec_fn = 0; + /** * @brief Initialize schedulers data structures. */ @@ -70,10 +72,16 @@ void virt_l1_sched_execute(uint32_t fn) { struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; - // FIXME: change of hyperframe and thus restarting fn at 0 may cause messages in the queue that are never handled + uint8_t hyperframe_restart = fn < last_exec_fn; + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { - if (mi_next->fn <= fn) { + /* execute all registered handler for current mf sched item */ + uint8_t exec_now = mi_next->fn <= fn || (hyperframe_restart && mi_next->fn > last_exec_fn); + /* break loop, as we have an ordered list in case the hyperframe had not been reset */ + uint8_t break_now = mi_next->fn > fn && !hyperframe_restart; + + if(exec_now) { struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; // run through all scheduled tdma sched items for that frame number llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) @@ -87,11 +95,13 @@ // remove handled mframe sched item llist_del(&mi_next->mframe_item_entry); talloc_free(mi_next); - } else if (mi_next->fn > fn) { - /* break the loop as our list is ordered */ + } + + if(break_now) { break; } } + last_exec_fn = fn; } /** -- To view, visit https://gerrit.osmocom.org/3209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I683ba18b5dee308d58f9a95a0ee10e22da207eda Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:57 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Data and traffic req from l23 now use scheduler. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Data and traffic req from l23 now use scheduler. ...................................................................... VIRT-PHY: Data and traffic req from l23 now use scheduler. Msgs are not put on virt um directly in the handler like before, but are scheduled. FN they are scheduled with not yet properly calculated. Also, code was extracted from lactl_sap.c into own files. Change-Id: Ibe57abebadf294f1407d82cef3fd0b51e7c1b23e --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c A src/host/virt_phy/src/virt_prim_data.c A src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 8 files changed, 202 insertions(+), 67 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index c11c5fe..b82745c 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -20,6 +20,8 @@ void l1ctl_sap_init(struct l1_model_ms *model); void prim_rach_init(struct l1_model_ms *model); +void prim_data_init(struct l1_model_ms *model); +void prim_traffic_init(struct l1_model_ms *model); void prim_fbsb_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index fd8d5d9..ae14ef6 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -4,7 +4,7 @@ CFLAGS = "-g -O0" sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_fbsb.c virt_prim_rach.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) virtphy_LDFLAGS = -pthread diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 3762cdc..6ab9edc 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -146,6 +146,11 @@ } /** + * @see virt_prim_fbsb.c + */ +extern void prim_fbsb_sync(struct msgb *msg); + +/** * Receive a gsmtap message from the virt um. */ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 6e42e5d..1fb4a42 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -41,6 +41,8 @@ l1_model_ms = model; prim_rach_init(model); prim_fbsb_init(model); + prim_data_init(model); + prim_traffic_init(model); } /** @@ -375,40 +377,6 @@ } /** - * @brief Handler for received L1CTL_DATA_REQ from L23. - * - * -- data request -- - * - * @param [in] msg the received message. - * - * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). - * - * TODO: Check if a msg on FACCH is coming in here and needs special handling. - */ -void l1ctl_rx_data_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; - // TODO: calc the scheduled fn - uint32_t fn_sched = l1_model_ms->state->downlink_time.fn; - - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", - ul->link_id, ul, ul->payload, data_ind, data_ind->data, - msg->l3h); - - msg->l2h = data_ind->data; - - // TODO: append to scheduler queue instead of sending here directly - gsmtapl1_tx_to_virt_um(msg); - - // send confirm to layer23 - msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn_sched, 0, 0); - l1ctl_sap_tx_to_l23(msg); -} - -/** * @brief Handler for received L1CTL_PM_REQ from L23. * * -- power measurement request -- @@ -581,36 +549,6 @@ DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", pm_req->n); -} - -/** - * @brief Handler for received L1CTL_TRAFFIC_REQ from L23. - * - * -- traffic request -- - * - * @param [in] msg the received message. - * - * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. In virtual layer1 just submit it to the virt um. - * - */ -void l1ctl_rx_traffic_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; - // TODO: calc the scheduled fn - uint32_t fn_sched = l1_model_ms->state->downlink_time.fn; - - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); - - msg->l2h = tr->data; - - // TODO: append to scheduler queue instead of sending here directly - gsmtapl1_tx_to_virt_um(msg); - - // send confirm to layer23 - msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn_sched, 0, 0); - l1ctl_sap_tx_to_l23(msg); } /** diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index c28da60..ada251c 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -82,7 +82,7 @@ if (rc == len) { msgb_put(msg, rc); - l1h = msgb_data(msg); + l1h = (void *) msgb_data(msg); msg->l1h = l1h; lsi->recv_cb(lsi, msg); return 0; diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c new file mode 100644 index 0000000..25036cc --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -0,0 +1,98 @@ +/* Layer 1 normal data burst tx handling */ + +/* (C) 2010 by Dieter Spaar + * (C) 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 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 +#include +#include +#include + +#include + +static struct l1_model_ms *l1_model_ms = NULL; +static void virt_l1_sched_handler_cb(struct msgb * msg); + +/** + * @brief Handler callback function for DATA request. + * + * @param [in] msg the msg to sent over virtual um. + */ +static void virt_l1_sched_handler_cb(struct msgb * msg) +{ + gsmtapl1_tx_to_virt_um(msg); + // send confirm to layer23 + // FIXME: as we might send multiple burst, the base fn may be another one than the current + msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, l1_model_ms->state->current_time.fn, 0, 0); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Handler for received L1CTL_DATA_REQ from L23. + * + * -- data request -- + * + * @param [in] msg the received message. + * + * Transmit message on a signalling channel. FACCH/SDCCH or SACCH depending on the headers set link id (TS 8.58 - 9.3.2). + * + * TODO: Check if a msg on FACCH is coming in here and needs special handling. + * TODO: Check if msg contains data of a burst or data of 4 bursts! + */ +void l1ctl_rx_data_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; + // TODO: calc the scheduled fn + uint32_t fn_sched = l1_model_ms->state->current_time.fn; + uint8_t rsl_chantype, subslot, timeslot; + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", + ul->link_id, ul, ul->payload, data_ind, data_ind->data, + msg->l3h); + + msg->l2h = data_ind->data; + + virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); + +} + +/** + * @brief Initialize virtual prim data. + * + * @param [in] model the l1 model instance + */ +void prim_data_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c new file mode 100644 index 0000000..5660945 --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -0,0 +1,92 @@ +/* Layer 1 normal data burst tx handling */ + +/* (C) 2010 by Dieter Spaar + * (C) 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 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 +#include +#include +#include + +#include + +static struct l1_model_ms *l1_model_ms = NULL; +static void virt_l1_sched_handler_cb(struct msgb * msg); + +/** + * @brief Handler callback function for TRAFFIC request. + * + * @param [in] msg the msg to sent over virtual um. + */ +static void virt_l1_sched_handler_cb(struct msgb * msg) +{ + gsmtapl1_tx_to_virt_um(msg); + // send confirm to layer23 + msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, + l1_model_ms->state->current_time.fn, 0, 0); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Handler for received L1CTL_TRAFFIC_REQ from L23. + * + * -- traffic request -- + * + * @param [in] msg the received message. + * + * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. In virtual layer1 just submit it to the virt um. + * + */ +void l1ctl_rx_traffic_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; + // TODO: calc the scheduled fn + uint32_t fn_sched = l1_model_ms->state->current_time.fn; + uint8_t rsl_chantype, subslot, timeslot; + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + + DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + + msg->l2h = tr->data; + + virt_l1_sched_schedule(msg, fn_sched, timeslot, + &virt_l1_sched_handler_cb); +} + +/** + * @brief Initialize virtual prim traffic. + * + * @param [in] model the l1 model instance + */ +void prim_traffic_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index c9e7bdd..70265a0 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -44,7 +44,7 @@ virt_l1_sched_init(model); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ - Waiting for l23 app on", l1ctl_sock_path); + Waiting for l23 app on %s", l1ctl_sock_path); while (1) { // handle osmocom fd READ events (l1ctl-unix-socket, virtual-um-mcast-socket) -- To view, visit https://gerrit.osmocom.org/3206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe57abebadf294f1407d82cef3fd0b51e7c1b23e Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:57 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Fixed error causing send msgs to be received on sa... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Fixed error causing send msgs to be received on same sock. ...................................................................... VIRT-PHY: Fixed error causing send msgs to be received on same sock. This could be disabled setting socket option IP_MULTICAST_ALL = 0. Change-Id: Ia2838c4cd39bfac04c014b4c8512466b301d8875 --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 9 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index acc6bcb..ff81063 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -52,7 +52,7 @@ struct mcast_client_sock); struct sockaddr_in *rx_sock_conf = talloc_zero(NULL, struct sockaddr_in); - int rc, reuseaddr = 1, loopback = 1; + int rc, reuseaddr = 1, loopback = 1, all = 0; client_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); client_sock->mcast_group = talloc_zero(ctx, struct ip_mreq); @@ -107,6 +107,14 @@ return NULL; } + // this option will set the delivery option so that only packages are received + // from sockets we are bound to via IP_ADD_MEMBERSHIP + if (setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, + IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { + perror("Failed to modify delivery policy to explicitly joined.\n"); + return NULL; + } + // configure and register the osmocom filedescriptor client_sock->osmo_fd->cb = fd_rx_cb; client_sock->osmo_fd->when = BSC_FD_READ; -- To view, visit https://gerrit.osmocom.org/3207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia2838c4cd39bfac04c014b4c8512466b301d8875 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 21:48:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 21:48:57 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Uplink scheduler implementation. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Uplink scheduler implementation. ...................................................................... VIRT-PHY: Uplink scheduler implementation. Implemented simple scheduler depending on frame number in downlink. It will be executed each time we receive a msg on downlink and send out all scheduled uplink msgs with a sched_fn smaller than the one of this received downlink msg. Further refactored l1ctl_sap by extracting rach and fbsb logic and putting it to own files virt_prim_fbsb.c and virt_prim_rach.c Added simple states to the ms layer 1 model, indicating if the ms is currently searching for bts, syncing to or camping on a bts. Downlink will be handled differently dependent of the state. Change-Id: I8937b1d6568f5d3750bbdc5d77fa283074d5365e --- M src/host/virt_phy/Makefile.am M src/host/virt_phy/include/virtphy/gsmtapl1_if.h M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/virt_l1_model.h A src/host/virt_phy/include/virtphy/virt_l1_sched.h M src/host/virt_phy/src/Makefile.am M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c A src/host/virt_phy/src/virt_l1_sched_simple.c A src/host/virt_phy/src/virt_prim_fbsb.c A src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virtphy.c 12 files changed, 492 insertions(+), 155 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/Makefile.am b/src/host/virt_phy/Makefile.am index 515d51b..57b4571 100644 --- a/src/host/virt_phy/Makefile.am +++ b/src/host/virt_phy/Makefile.am @@ -1,2 +1,4 @@ SUBDIRS = src -dist_doc_DATA = README \ No newline at end of file +dist_doc_DATA = README + +CFLAGS = "-g -O0" \ No newline at end of file diff --git a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h index c511560..34cd9c8 100644 --- a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -10,8 +10,7 @@ void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); void gsmtapl1_rx_from_virt_um(struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint32_t fn, - struct msgb *msg); -void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg); +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg); +void gsmtapl1_tx_to_virt_um(struct msgb *msg); void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, uint8_t *link_id); diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index 902eb17..c11c5fe 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -19,6 +19,8 @@ #define LID_DEDIC 0x00 void l1ctl_sap_init(struct l1_model_ms *model); +void prim_rach_init(struct l1_model_ms *model); +void prim_fbsb_init(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); void l1ctl_sap_tx_to_l23(struct msgb *msg); void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 561025e..69115f2 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -2,9 +2,18 @@ #include #include +#include #define L1S_NUM_NEIGH_CELL 6 #define A5_KEY_LEN 8 + +enum ms_state { + MS_STATE_IDLE_SEARCHING = 0, + MS_STATE_IDLE_SYNCING, + MS_STATE_IDLE_CAMPING, + MS_STATE_DEDICATED, +}; + struct l1_model_ms { struct l1ctl_sock_inst *lsi; @@ -38,7 +47,10 @@ struct l1_state_ms { - uint8_t camping; // are we currently camping on a cell + struct gsm_time downlink_time; /* current GSM time received on downlink */ + struct gsm_time current_time; /* GSM time used internally for scheduling */ + + uint8_t state; // the ms state like in ms_state /* the cell on which we are camping right now */ struct l1_cell_info serving_cell; @@ -60,6 +72,11 @@ uint8_t tsc; // training sequence code (ununsed in virtual um) uint8_t h; // hopping enabled flag (ununsed in virtual um) } dedicated; + + /* fbsb state */ + struct { + uint32_t arfcn; + } fbsb; }; struct l1_model_ms *l1_model_ms_init(void *ctx); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_sched.h b/src/host/virt_phy/include/virtphy/virt_l1_sched.h new file mode 100644 index 0000000..a68c58d --- /dev/null +++ b/src/host/virt_phy/include/virtphy/virt_l1_sched.h @@ -0,0 +1,32 @@ +#pragma once +#include +#include +#include +#include +#include + +typedef void virt_l1_sched_cb(struct msgb * msg); + +/* bucket containing items to be executed for a specific mframe number */ +struct virt_l1_sched_mframe_item { + struct llist_head mframe_item_entry; + struct llist_head tdma_item_list; /* list of tdma sched items */ + uint32_t fn; /* frame number of execution */ +}; + +/* item to be be executed for a specific tdma timeslot of a framenumber */ +struct virt_l1_sched_tdma_item { + struct llist_head tdma_item_entry; + struct msgb * msg; /* the msg to be handled */ + uint8_t ts; /* tdma timeslot of execution */ + virt_l1_sched_cb * handler_cb; /* handler callback */ +}; + +void virt_l1_sched_init(struct l1_model_ms * model); +int virt_l1_sched_start(struct gsm_time time); +int virt_l1_sched_restart(struct gsm_time time); +void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset); +void virt_l1_sched_stop(); +void virt_l1_sched_execute(uint32_t fn); +void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, + virt_l1_sched_cb * handler_cb); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index 8508509..fd8d5d9 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -1,9 +1,12 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/../layer23/include +CFLAGS = "-g -O0" + sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c l1ctl_sap.c gsmtapl1_if.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c -virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_fbsb.c virt_prim_rach.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c +virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) +virtphy_LDFLAGS = -pthread # debug output all: diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index ebfb5b6..3762cdc 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#include static struct l1_model_ms *l1_model_ms = NULL; @@ -88,13 +90,13 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, uint32_t fn, - struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct virt_um_inst *vui, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; struct msgb *outmsg; // msg to send with gsmtap header prepended + uint32_t fn = gsm_gsmtime2fn(&l1_model_ms->state->downlink_time); uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; // arfcn of the cell we currently camp on uint8_t signal_dbm = 63; // signal strength, 63 is best uint8_t snr = 63; // signal noise ratio, 63 is best @@ -138,9 +140,9 @@ /** * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint32_t fn, struct msgb *msg). */ -void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg) +void gsmtapl1_tx_to_virt_um(struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, fn, msg); + gsmtapl1_tx_to_virt_um_inst(l1_model_ms->vui, msg); } /** @@ -152,9 +154,15 @@ if (!msg) { return; } - // we assume we only receive msgs if we actually camp on a cell - if (!l1_model_ms->state->camping) { + // we do not forward messages to l23 if we are in network search state + if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) { talloc_free(msg); + return; + } + + // forward msg to fbsb sync routine if we are in sync state + if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { + prim_fbsb_sync(msg); return; } @@ -164,7 +172,7 @@ struct l1ctl_traffic_ind * l1ti; struct l1ctl_data_ind * l1di; uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg - uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the cell we currently camp on + uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg uint8_t gsmtap_chantype = gh->sub_type; // gsmtap channel type uint8_t signal_dbm = gh->signal_dbm; // signal strength, 63 is best uint8_t snr = gh->snr_db; // signal noise ratio, 63 is best @@ -179,18 +187,23 @@ // see GSM 8.58 -> 9.3.1 for channel number encoding chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); + virt_l1_sched_sync_time(l1_model_ms->state->downlink_time, 0); + virt_l1_sched_execute(fn); + DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - (arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", arfcn, fn, get_value_string(gsmtap_types, gh->type), get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); - // generally ignore all messages coming from another arfcn than the synced one + // generally ignore all messages coming from another arfcn than the camped one if (l1_model_ms->state->serving_cell.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn & GSMTAP_ARFCN_MASK, l1_model_ms->state->serving_cell.arfcn); goto nomessage; } + // generally ignore all uplink messages received if (arfcn & GSMTAP_ARFCN_F_UPLINK) { LOGP(DVIRPHY, LOGL_NOTICE, diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index b89d963..6e42e5d 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -17,6 +17,7 @@ #include #include #include +#include static struct l1_model_ms *l1_model_ms = NULL; @@ -38,6 +39,8 @@ void l1ctl_sap_init(struct l1_model_ms *model) { l1_model_ms = model; + prim_rach_init(model); + prim_fbsb_init(model); } /** @@ -193,11 +196,9 @@ break; case L1CTL_RACH_REQ: l1ctl_rx_rach_req(msg); - // msg is freed by rx routine goto exit_nofree; case L1CTL_DATA_REQ: l1ctl_rx_data_req(msg); - /* we have to keep the msgb, not free it! */ goto exit_nofree; case L1CTL_PM_REQ: l1ctl_rx_pm_req(msg); @@ -216,7 +217,6 @@ break; case L1CTL_TRAFFIC_REQ: l1ctl_rx_traffic_req(msg); - /* we have to keep the msgb, not free it! */ goto exit_nofree; case L1CTL_SIM_REQ: l1ctl_rx_sim_req(msg); @@ -224,49 +224,14 @@ } exit_msgbfree: msgb_free(msg); - exit_nofree: return; + exit_nofree: return; /* msg is scheduled for uplink and mustn't be freed here */ } /*************************************************************** * L1CTL RX ROUTINES ******************************************* + * For more routines check the respective handler classes ****** + * like virt_prim_rach.c *************************************** ***************************************************************/ - -/** - * @brief Handler for received L1CTL_FBSB_REQ from L23. - * - * -- frequency burst synchronisation burst request -- - * - * @param [in] msg the received message. - * - * Transmit frequency control and synchronisation bursts on FCCH and SCH to calibrate transceiver and search for base stations. - * Sync to a given arfcn. - * - * Note: ms will start receiving msgs on virtual um only after this req was received. - * Note: virt bts does not broadcast freq and sync bursts. - * - * TODO: Could be used to bind/connect to different virtual_bts sockets with a arfcn-socket mapping. - * TODO: Check flags if this is a sync or freq request and handle it accordingly. - */ -void l1ctl_rx_fbsb_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; - - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", - ntohs(sync_req->band_arfcn), sync_req->flags); - - l1_model_ms->state->camping = 1; - l1_model_ms->state->serving_cell.arfcn = ntohs(sync_req->band_arfcn); // freq req - - // not needed in virt um - l1_model_ms->state->serving_cell.ccch_mode = sync_req->ccch_mode; // sync req - l1_model_ms->state->serving_cell.fn_offset = 0; // sync req - l1_model_ms->state->serving_cell.bsic = 0; // sync req - l1_model_ms->state->serving_cell.time_alignment = 0; // sync req - - l1ctl_tx_fbsb_conf(0, l1_model_ms->state->serving_cell.arfcn); -} /** * @brief Handler for received L1CTL_DM_EST_REQ from L23. @@ -410,47 +375,6 @@ } /** - * @brief Handler for received L1CTL_RACH_REQ from L23. - * - * -- random access channel request -- - * - * @param [in] msg the received message. - * - * Transmit RACH request on RACH. Refer to 04.08 - 9.1.8 - Channel request. - * - */ -void l1ctl_rx_rach_req(struct msgb *msg) -{ - struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; - struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; - // FIXME: proper frame number - uint32_t fn_sched = 42; - - DEBUGP(DL1C, - "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", - rach_req->ra, ntohs(rach_req->offset), - rach_req->combined); - - // for the rach channel request, there is no layer2 header, but only the one bit ra content to submit - // replace l1ctl_rach_req with ra data that rly shall be submitted - // ra on peer side is decoded as uint16_t, but we do not use the 11bit option and thus 8bits must be sufficient - msg->l2h = msgb_put(msg, sizeof(uint8_t)); - *msg->l2h = rach_req->ra; - - // chan_nr is not specified in info_ul for rach request coming from l23, but needed in gsmtapl1_tx_to_virt_um() - ul->chan_nr = rsl_enc_chan_nr(RSL_CHAN_RACH, 0, 0); - ul->link_id = LID_DEDIC; - - // send rach over virt um - gsmtapl1_tx_to_virt_um(fn_sched, msg); - - // send confirm to layer23 - l1ctl_tx_rach_conf(fn_sched, l1_model_ms->state->serving_cell.arfcn); - -} - -/** * @brief Handler for received L1CTL_DATA_REQ from L23. * * -- data request -- @@ -466,8 +390,8 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; - // FIXME: proper frame number - uint32_t fn_sched = 42; + // TODO: calc the scheduled fn + uint32_t fn_sched = l1_model_ms->state->downlink_time.fn; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", @@ -476,8 +400,8 @@ msg->l2h = data_ind->data; - // send msg over virt um - gsmtapl1_tx_to_virt_um(fn_sched, msg); + // TODO: append to scheduler queue instead of sending here directly + gsmtapl1_tx_to_virt_um(msg); // send confirm to layer23 msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn_sched, 0, 0); @@ -560,11 +484,12 @@ case L1CTL_RES_T_FULL: DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); - l1_model_ms->state->camping = 0; - // TODO: check if we also need to reset the dedicated channel state + l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; + virt_l1_sched_stop(); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: + virt_l1_sched_restart(l1_model_ms->state->downlink_time); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); @@ -673,14 +598,15 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *)ul->payload; - uint32_t fn_sched = 42; + // TODO: calc the scheduled fn + uint32_t fn_sched = l1_model_ms->state->downlink_time.fn; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; - // send msg over virt um - gsmtapl1_tx_to_virt_um(fn_sched, msg); + // TODO: append to scheduler queue instead of sending here directly + gsmtapl1_tx_to_virt_um(msg); // send confirm to layer23 msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn_sched, 0, 0); @@ -719,6 +645,8 @@ /*************************************************************** * L1CTL TX ROUTINES ******************************************* + * For more routines check the respective handler classes ****** + * like virt_prim_rach.c *************************************** ***************************************************************/ /** @@ -742,23 +670,6 @@ } /** - * @brief Transmit L1CTL_RESET_IND or L1CTL_RESET_CONF to layer 23. - * - * -- reset indication / confirm -- - * - * @param [in] msg_type L1CTL primitive message type. - * @param [in] reset_type reset type (full, boot or just scheduler reset). - */ -void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn) -{ - struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); - - DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", - getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); - l1ctl_sap_tx_to_l23(msg); -} - -/** * @brief Transmit L1CTL msg of a given type to layer 23. * * @param [in] msg_type L1CTL primitive message type. @@ -767,38 +678,6 @@ { struct msgb *msg = l1ctl_msgb_alloc(msg_type); DEBUGP(DL1C, "Sending to l23 - %s\n", getL1ctlPrimName(msg_type)); - l1ctl_sap_tx_to_l23(msg); -} - -/** - * @brief Transmit L1CTL_FBSB_CONF to l23. - * - * -- frequency burst synchronisation burst confirm -- - * - * @param [in] res 0 -> success, 255 -> error. - * @param [in] arfcn the arfcn we are synced to. - * - * No calculation needed for virtual pyh -> uses dummy values for a good link quality. - */ -void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) -{ - struct msgb *msg; - struct l1ctl_fbsb_conf *resp; - uint32_t fn = 0; // 0 should be okay here - uint16_t snr = 40; // signal noise ratio > 40db is best signal (unused in virt) - int16_t initial_freq_err = 0; // 0 means no error (unused in virt) - uint8_t bsic = 0; // bsci can be read from sync burst (unused in virt) - - msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, snr, arfcn); - - resp = (struct l1ctl_fbsb_conf *)msgb_put(msg, sizeof(*resp)); - resp->initial_freq_err = htons(initial_freq_err); - resp->result = res; - resp->bsic = bsic; - - DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", - getL1ctlPrimName(L1CTL_FBSB_CONF), res); - l1ctl_sap_tx_to_l23(msg); } diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c new file mode 100644 index 0000000..8df88ec --- /dev/null +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -0,0 +1,135 @@ +#include +#include +#include +#include +#include +#include + +static struct l1_model_ms *l1_model_ms = NULL; + +static LLIST_HEAD(mframe_item_list); + +/** + * @brief Initialize schedulers data structures. + */ +void virt_l1_sched_init(struct l1_model_ms * model) +{ + l1_model_ms = model; +} + +/** + * @brief Clear scheduler queue and completely restart scheduler. + */ +int virt_l1_sched_restart(struct gsm_time time) +{ + virt_l1_sched_stop(); + return virt_l1_sched_start(time); +} + +/** + * @brief Start scheduler thread based on current gsm time from model + */ +int virt_l1_sched_start(struct gsm_time time) +{ + virt_l1_sched_sync_time(time, 1); + return 0; +} + +/** + * @brief Sync scheduler with given time. + */ +void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset) +{ + l1_model_ms->state->current_time = time; +} + +/** + * @brief Stop the scheduler thread and cleanup mframe items queue + */ +void virt_l1_sched_stop() +{ + struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; + + /* Empty tdma and mframe sched items lists */ + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) + { + struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; + llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) + { + talloc_free(ti_next->msg); + llist_del(&ti_next->tdma_item_entry); + } + llist_del(&mi_next->mframe_item_entry); + talloc_free(mi_next); + } +} + +/** + * @brief Handle all pending scheduled items for the current frame number. + */ +void virt_l1_sched_execute(uint32_t fn) +{ + struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; + // FIXME: change of hyperframe and thus restarting fn at 0 may cause messages in the queue that are never handled + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) + { + if (mi_next->fn <= fn) { + struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; + // run through all scheduled tdma sched items for that frame number + llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) + { + // exec tdma sched item's handler callback + // TODO: we do not have a tdma scheduler currently and execute alle scheduled tdma items here at once + ti_next->handler_cb(ti_next->msg); + // remove handled tdma sched item + llist_del(&ti_next->tdma_item_entry); + } + // remove handled mframe sched item + llist_del(&mi_next->mframe_item_entry); + talloc_free(mi_next); + } else if (mi_next->fn > fn) { + /* break the loop as our list is ordered */ + break; + } + } +} + +/** + * @brief Schedule a msg to the given framenumber and timeslot. + */ +void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, + virt_l1_sched_cb * handler_cb) +{ + struct virt_l1_sched_mframe_item *mi_next = NULL, *mi_tmp = NULL, + *mi_fn = NULL; + struct virt_l1_sched_tdma_item *ti_new = NULL; + + llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) + { + if (mi_next->fn == fn) { + mi_fn = mi_next; + break; + } else if (mi_next->fn > fn) { + break; + } + } + if (!mi_fn) { + // list did not contain mframe item with needed fn + mi_fn = talloc_zero(NULL, struct virt_l1_sched_mframe_item); + mi_fn->fn = fn; + // need to manually init the struct content.... no so happy + mi_fn->tdma_item_list.prev = &mi_fn->tdma_item_list; + mi_fn->tdma_item_list.next = &mi_fn->tdma_item_list; + + // TODO: check if we get an error if list is empty... + llist_add(&mi_fn->mframe_item_entry, + mi_next->mframe_item_entry.prev); + + } + ti_new = talloc_zero(mi_fn, struct virt_l1_sched_tdma_item); + ti_new->msg = msg; + ti_new->handler_cb = handler_cb; + ti_new->ts = ts; + // simply add at end, no ordering for tdma sched items currently + llist_add_tail(&ti_new->tdma_item_entry, &mi_fn->tdma_item_list); // TODO: ordered insert needed if tdma scheduler should be implemented +} diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c new file mode 100644 index 0000000..6a678d0 --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -0,0 +1,113 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static struct l1_model_ms *l1_model_ms = NULL; + +/** + * @brief Handler for received L1CTL_FBSB_REQ from L23. + * + * -- frequency burst synchronisation burst request -- + * + * @param [in] msg the received message. + * + * Transmit frequency control and synchronisation bursts on FCCH and SCH to calibrate transceiver and search for base stations. + * Sync to a given arfcn. + * + * Note: ms will start receiving msgs on virtual um only after this req was received. + * Note: virt bts does not broadcast freq and sync bursts. + * + */ +void l1ctl_rx_fbsb_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *)l1h->data; + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + ntohs(sync_req->band_arfcn), sync_req->flags); + + l1_model_ms->state->state = MS_STATE_IDLE_SYNCING; + l1_model_ms->state->fbsb.arfcn = ntohs(sync_req->band_arfcn); +} + +/** + * @brief A msg was received on l1 that can be used for synchronization. + * + * Note: for virtual layer 1 this can be a random downlink message, as we can parse the fn from the gsmtap header. + */ +void prim_fbsb_sync(struct msgb *msg) +{ + struct gsmtap_hdr *gh = msgb_l1(msg); + uint32_t fn = ntohl(gh->frame_number); // frame number of the rcv msg + uint16_t arfcn = ntohs(gh->arfcn); // arfcn of the received msg + + // ignore messages from other arfcns as the one requested to sync to by l23 + if (l1_model_ms->state->fbsb.arfcn != (arfcn & GSMTAP_ARFCN_MASK)) { + talloc_free(msg); + return; + } + l1_model_ms->state->serving_cell.arfcn = (arfcn & GSMTAP_ARFCN_MASK); + l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; + /* Not needed in virtual phy */ + l1_model_ms->state->serving_cell.fn_offset = 0; + l1_model_ms->state->serving_cell.time_alignment = 0; + l1_model_ms->state->serving_cell.bsic = 0; + /* Update current gsm time each time we receive a message on the virt um */ + gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); + /* Restart scheduler */ + virt_l1_sched_restart(l1_model_ms->state->downlink_time); + talloc_free(msg); + l1ctl_tx_fbsb_conf(0, (arfcn & GSMTAP_ARFCN_MASK)); +} + +/** + * @brief Transmit L1CTL_FBSB_CONF to l23. + * + * -- frequency burst synchronisation burst confirm -- + * + * @param [in] res 0 -> success, 255 -> error. + * @param [in] arfcn the arfcn we are synced to. + * + * No calculation needed for virtual pyh -> uses dummy values for a good link quality. + */ +void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) +{ + struct msgb *msg; + struct l1ctl_fbsb_conf *resp; + uint32_t fn = 0; // 0 should be okay here + uint16_t snr = 40; // signal noise ratio > 40db is best signal (unused in virt) + int16_t initial_freq_err = 0; // 0 means no error (unused in virt) + uint8_t bsic = 0; // bsci can be read from sync burst (unused in virt) + + msg = l1ctl_create_l2_msg(L1CTL_FBSB_CONF, fn, snr, arfcn); + + resp = (struct l1ctl_fbsb_conf *)msgb_put(msg, sizeof(*resp)); + resp->initial_freq_err = htons(initial_freq_err); + resp->result = res; + resp->bsic = bsic; + + DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", + getL1ctlPrimName(L1CTL_FBSB_CONF), res); + + l1ctl_sap_tx_to_l23(msg); +} +/** + * @brief Initialize virtual prim rach. + * + * @param [in] model the l1 model instance + */ +void prim_fbsb_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c new file mode 100644 index 0000000..c558034 --- /dev/null +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -0,0 +1,140 @@ +/* Layer 1 Random Access Channel Burst */ + +/* (C) 2010 by Dieter Spaar + * (C) 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 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 +#include +#include +#include + +#include + +static struct l1_model_ms *l1_model_ms = NULL; +static void virt_l1_sched_handler_cb(struct msgb * msg); + +// use if we have a combined uplink (RACH, SDCCH, ...) (see http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) +// if we have no combined channel config, uplink consists of only RACH +static uint8_t t3_to_rach_comb[51] = { + 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 26, 27, 27, 27, 27}; +static uint8_t rach_to_t3_comb[27] = { + 4, 5, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 45, 46}; + +/** + * @brief Handler callback function for RACH request. + * + * @param [in] msg the msg to sent over virtual um. + */ +static void virt_l1_sched_handler_cb(struct msgb * msg) +{ + gsmtapl1_tx_to_virt_um(msg); + l1ctl_tx_rach_conf(l1_model_ms->state->current_time.fn, + l1_model_ms->state->serving_cell.arfcn); +} + +/** + * @brief Handler for received L1CTL_RACH_REQ from L23. + * + * -- random access channel request -- + * + * @param [in] msg the received message. + * + * Transmit RACH request on RACH. Refer to 04.08 - 9.1.8 - Channel request. + * + */ +void l1ctl_rx_rach_req(struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; + struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *)ul->payload; + uint32_t fn_sched; + uint8_t ts = 1; //FIXME mostly, ts 1 is used for rach, where can i get that info? System info? + uint16_t offset = ntohs(rach_req->offset); + + DEBUGP(DL1C, + "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + rach_req->ra, offset, rach_req->combined); + + if (rach_req->ra == 0x03) { + fn_sched = 42; + } + + // set ra data to msg (8bits, the 11bit option is not used) + msg->l2h = msgb_put(msg, sizeof(uint8_t)); + *msg->l2h = rach_req->ra; + + // chan_nr need to be encoded here, as it is not set by l23 for the rach request, but needed by virt um + ul->chan_nr = rsl_enc_chan_nr(RSL_CHAN_RACH, 0, ts); + ul->link_id = LID_DEDIC; + + // sched fn calculation if we have a combined ccch channel configuration + if (rach_req->combined) { + /* add elapsed RACH slots to offset */ + offset += t3_to_rach_comb[l1_model_ms->state->current_time.t3]; + /* offset is the number of RACH slots in the future */ + fn_sched = l1_model_ms->state->current_time.fn - l1_model_ms->state->current_time.t3; + fn_sched += offset / 27 * 51; + fn_sched += rach_to_t3_comb[offset % 27]; + } else { + fn_sched = l1_model_ms->state->current_time.fn + offset; + } + + virt_l1_sched_schedule(msg, fn_sched, ts, &virt_l1_sched_handler_cb); + +} + +/** + * @brief Transmit L1CTL_RACH_CONF to layer 23. + * + * -- rach confirm -- + * + * @param [in] fn the fn on which the rach was sent + * @param [in] arfcn arfcn on which the rach was sent + */ +void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn) +{ + struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); + + DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", + getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); + l1ctl_sap_tx_to_l23(msg); +} + +/** + * @brief Initialize virtual prim rach. + * + * @param [in] model the l1 model instance + */ +void prim_rach_init(struct l1_model_ms *model) +{ + l1_model_ms = model; +} diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 977a358..c9e7bdd 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -11,6 +11,7 @@ #include #include #include +#include int main( int argc, char *argv[] ) { @@ -40,6 +41,7 @@ gsmtapl1_init(model); l1ctl_sap_init(model); + virt_l1_sched_init(model); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ Waiting for l23 app on", l1ctl_sock_path); -- To view, visit https://gerrit.osmocom.org/3204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8937b1d6568f5d3750bbdc5d77fa283074d5365e Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 12 22:03:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 22:03:58 +0000 Subject: [PATCH] libosmocore[master]: gsmtap_util: Add chantype_gsmtap2rsl() as inverse of chantyp... Message-ID: Review at https://gerrit.osmocom.org/3223 gsmtap_util: Add chantype_gsmtap2rsl() as inverse of chantype_rsl2gsmtap() Change-Id: Ie1bc00670887064da0fea61c3dab036c23ceea25 --- M include/osmocom/core/gsmtap_util.h M src/gsmtap_util.c 2 files changed, 41 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/23/3223/1 diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h index 59b81e5..5c5e3fd 100644 --- a/include/osmocom/core/gsmtap_util.h +++ b/include/osmocom/core/gsmtap_util.h @@ -9,6 +9,7 @@ * \file gsmtap_util.h */ uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t rsl_link_id); +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, uint8_t *link_id); struct msgb *gsmtap_makemsg_ex(uint8_t type, uint16_t arfcn, uint8_t ts, uint8_t chan_type, uint8_t ss, uint32_t fn, int8_t signal_dbm, diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 561cdb3..26720b6 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -1,7 +1,7 @@ /*! \file gsmtap_util.c * GSMTAP support code in libosmocore. */ /* - * (C) 2010-2011 by Harald Welte + * (C) 2010-2017 by Harald Welte * * All Rights Reserved * @@ -89,6 +89,45 @@ return ret; } +/*! convert GSMTAP channel type to RSL channel number + Link ID + * \param[in] gsmtap_chantype GSMTAP channel type + * \param[out] rsl_chantype RSL channel mumber + * \param[out] link_id RSL link identifier + */ +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id) +{ + switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { + case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F + *rsl_chantype = RSL_CHAN_Bm_ACCHs; + break; + case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H + *rsl_chantype = RSL_CHAN_Lm_ACCHs; + break; + case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 + *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; + break; + case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 + *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; + break; + case GSMTAP_CHANNEL_BCCH: // BCCH + *rsl_chantype = RSL_CHAN_BCCH; + break; + case GSMTAP_CHANNEL_RACH: // RACH + *rsl_chantype = RSL_CHAN_RACH; + break; + case GSMTAP_CHANNEL_PCH: // PCH + case GSMTAP_CHANNEL_AGCH: // AGCH + *rsl_chantype = RSL_CHAN_PCH_AGCH; + break; + case GSMTAP_CHANNEL_PDCH: + *rsl_chantype = GSMTAP_CHANNEL_PDCH; + break; + } + + *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? 0x40 : 0x00; +} + /*! create an arbitrary type GSMTAP message * \param[in] type The GSMTAP_TYPE_xxx constant of the message to create * \param[in] arfcn GSM ARFCN (Channel Number) -- To view, visit https://gerrit.osmocom.org/3223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1bc00670887064da0fea61c3dab036c23ceea25 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 12 22:03:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 12 Jul 2017 22:03:58 +0000 Subject: [PATCH] libosmocore[master]: gsmtap: Add value_strings for GSMTAP_TYPE and GSMTAP_CHANNEL Message-ID: Review at https://gerrit.osmocom.org/3224 gsmtap: Add value_strings for GSMTAP_TYPE and GSMTAP_CHANNEL Change-Id: Iaf8a99912f42a56ef785a1642e18238c0b67cf68 --- M include/osmocom/core/gsmtap_util.h M src/gsmtap_util.c 2 files changed, 48 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/24/3224/1 diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h index 5c5e3fd..f8a12a6 100644 --- a/include/osmocom/core/gsmtap_util.h +++ b/include/osmocom/core/gsmtap_util.h @@ -55,4 +55,7 @@ int8_t signal_dbm, uint8_t snr, const uint8_t *data, unsigned int len); +extern const struct value_string gsmtap_gsm_channel_names[]; +extern const struct value_string gsmtap_type_names[]; + /*! @} */ diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 26720b6..ad6f914 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -436,4 +436,49 @@ #endif /* HAVE_SYS_SOCKET_H */ +const struct value_string gsmtap_gsm_channel_names[] = { + { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, + { GSMTAP_CHANNEL_BCCH, "BCCH" }, + { GSMTAP_CHANNEL_CCCH, "CCCH" }, + { GSMTAP_CHANNEL_RACH, "RACH" }, + { GSMTAP_CHANNEL_AGCH, "AGCH" }, + { GSMTAP_CHANNEL_PCH, "PCH" }, + { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, + { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, + { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, + { GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F" }, + { GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H" }, + { GSMTAP_CHANNEL_PACCH, "PACCH" }, + { GSMTAP_CHANNEL_CBCH52, "CBCH" }, + { GSMTAP_CHANNEL_PDCH, "PDCH" } , + { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, + { GSMTAP_CHANNEL_CBCH51, "CBCH" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH, "LSACCH" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, + { 0, NULL } +}; + +/* for debugging */ +const struct value_string gsmtap_type_names[] = { + { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, + { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, + { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, + { GSMTAP_TYPE_SIM, "SIM Card" }, + { GSMTAP_TYPE_TETRA_I1, "TETRA V+D" }, + { GSMTAP_TYPE_TETRA_I1_BURST, "TETRA bursts" }, + { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, + { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)"}, + { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, + { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, + { GSMTAP_TYPE_LTE_RRC, "LTE RRC" }, + { GSMTAP_TYPE_LTE_MAC, "LTE MAC" }, + { GSMTAP_TYPE_LTE_MAC_FRAMED, "LTE MAC with context hdr" }, + { GSMTAP_TYPE_OSMOCORE_LOG, "libosmocore logging" }, + { GSMTAP_TYPE_QC_DIAG, "Qualcomm DIAG" }, + { 0, NULL } +}; + /*! @} */ -- To view, visit https://gerrit.osmocom.org/3224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf8a99912f42a56ef785a1642e18238c0b67cf68 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 12 23:17:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 23:17:17 +0000 Subject: [PATCH] osmo-msc[master]: move openbsc/* to repos root In-Reply-To: References: Message-ID: move openbsc/* to repos root This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 --- R AUTHORS R COPYING R Makefile.am R README R README.vty-tests R configure.ac R contrib/a-link/sccp-split-by-con.lua R contrib/bsc-test/README R contrib/bsc-test/all_dial R contrib/bsc-test/dial.sh R contrib/bsc-test/drop-oml.sh R contrib/bsc-test/drop.sh R contrib/bsc-test/hangup R contrib/bsc-test/msc.sh R contrib/bsc_control.py R contrib/bt.py R contrib/convert_to_enum.py R contrib/ctrl2sse.py R contrib/gprs/gb-proxy-unblock-bug.py R contrib/gprs/gprs-bssgp-histogram.lua R contrib/gprs/gprs-buffer-count.lua R contrib/gprs/gprs-split-trace-by-tlli.lua R contrib/gprs/gprs-verify-nu.lua R contrib/hlr-remove-old.sql R contrib/hlrsync/hlrsync.py R contrib/ipa.py M contrib/jenkins.sh R contrib/mgcp_server.py R contrib/nat/test_regexp.c R contrib/nat/ussd_example.py R contrib/rtp/gen_rtp_header.erl R contrib/rtp/rtp_replay.st R contrib/rtp/rtp_replay_shared.st R contrib/rtp/rtp_replay_sip.st R contrib/rtp/timestamp_rtp.lua R contrib/sms/fill-hlr.st R contrib/sms/hlr-query.st R contrib/sms/sqlite-probe.tap.d R contrib/soap.py R contrib/systemd/osmo-bsc-mgcp.service R contrib/systemd/osmo-bsc.service R contrib/systemd/osmo-gbproxy.service R contrib/systemd/osmo-nitb.service R contrib/systemd/osmo-sgsn.service R contrib/testconv/Makefile R contrib/testconv/testconv_main.c R contrib/twisted_ipa.py R doc/BS11-OML.txt R doc/Makefile.am R doc/call-routing.txt R doc/channel_release.txt R doc/e1-data-model.txt R doc/examples/Makefile.am R doc/examples/osmo-bsc/osmo-bsc.cfg R doc/examples/osmo-bsc_mgcp/mgcp.cfg R doc/examples/osmo-bsc_nat/black-list.cfg R doc/examples/osmo-bsc_nat/bscs.config R doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg R doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg R doc/examples/osmo-gbproxy/osmo-gbproxy.cfg R doc/examples/osmo-gtphub/gtphub-example.txt R doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg R doc/examples/osmo-gtphub/osmo-gtphub.cfg R doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg R doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg R doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg R doc/examples/osmo-nitb/bs11/openbsc.cfg R doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg R doc/examples/osmo-nitb/nanobts/openbsc.cfg R doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg R doc/examples/osmo-nitb/rbs2308/openbsc.cfg R doc/examples/osmo-nitb/sysmobts/openbsc.cfg R doc/examples/osmo-sgsn/osmo-sgsn.cfg R doc/gsm-hopping.txt R doc/handover.txt R doc/ipa-sccp.txt R doc/oml-interface.txt R doc/osmo-nitb-data_structures.dot R doc/paging.txt R git-version-gen R include/Makefile.am R include/compat_af_isdn.h R include/mISDNif.h R include/openbsc/Makefile.am R include/openbsc/abis_nm.h R include/openbsc/abis_om2000.h R include/openbsc/abis_rsl.h R include/openbsc/arfcn_range_encode.h R include/openbsc/auth.h R include/openbsc/bsc_api.h R include/openbsc/bsc_msc.h R include/openbsc/bsc_msc_data.h R include/openbsc/bsc_msg_filter.h R include/openbsc/bsc_nat.h R include/openbsc/bsc_nat_callstats.h R include/openbsc/bsc_nat_sccp.h R include/openbsc/bsc_rll.h R include/openbsc/bsc_subscriber.h R include/openbsc/bss.h R include/openbsc/bts_ipaccess_nanobts_omlattr.h R include/openbsc/chan_alloc.h R include/openbsc/common_bsc.h R include/openbsc/common_cs.h R include/openbsc/crc24.h R include/openbsc/ctrl.h R include/openbsc/db.h R include/openbsc/debug.h R include/openbsc/e1_config.h R include/openbsc/gb_proxy.h R include/openbsc/gprs_gb_parse.h R include/openbsc/gprs_gmm.h R include/openbsc/gprs_llc.h R include/openbsc/gprs_llc_xid.h R include/openbsc/gprs_sgsn.h R include/openbsc/gprs_sndcp.h R include/openbsc/gprs_sndcp_comp.h R include/openbsc/gprs_sndcp_dcomp.h R include/openbsc/gprs_sndcp_pcomp.h R include/openbsc/gprs_sndcp_xid.h R include/openbsc/gprs_subscriber.h R include/openbsc/gprs_utils.h R include/openbsc/gsm_04_08.h R include/openbsc/gsm_04_11.h R include/openbsc/gsm_04_80.h R include/openbsc/gsm_data.h R include/openbsc/gsm_data_shared.h R include/openbsc/gsm_subscriber.h R include/openbsc/gsup_client.h R include/openbsc/gtphub.h R include/openbsc/handover.h R include/openbsc/handover_decision.h R include/openbsc/ipaccess.h R include/openbsc/iu.h R include/openbsc/meas_feed.h R include/openbsc/meas_rep.h R include/openbsc/mgcp.h R include/openbsc/mgcp_internal.h R include/openbsc/mgcp_transcode.h R include/openbsc/misdn.h R include/openbsc/mncc.h R include/openbsc/mncc_int.h R include/openbsc/nat_rewrite_trie.h R include/openbsc/network_listen.h R include/openbsc/oap_client.h R include/openbsc/openbscdefines.h R include/openbsc/osmo_bsc.h R include/openbsc/osmo_bsc_grace.h R include/openbsc/osmo_bsc_rf.h R include/openbsc/osmo_msc.h R include/openbsc/osmux.h R include/openbsc/paging.h R include/openbsc/pcu_if.h R include/openbsc/pcuif_proto.h R include/openbsc/rest_octets.h R include/openbsc/rrlp.h R include/openbsc/rs232.h R include/openbsc/rtp_proxy.h R include/openbsc/sgsn.h R include/openbsc/signal.h R include/openbsc/silent_call.h R include/openbsc/slhc.h R include/openbsc/smpp.h R include/openbsc/sms_queue.h R include/openbsc/socket.h R include/openbsc/system_information.h R include/openbsc/token_auth.h R include/openbsc/transaction.h R include/openbsc/trau_mux.h R include/openbsc/trau_upqueue.h R include/openbsc/ussd.h R include/openbsc/v42bis.h R include/openbsc/v42bis_private.h R include/openbsc/vty.h R m4/README R m4/ax_check_compile_flag.m4 R openbsc.pc.in R osmoappdesc.py R src/Makefile.am R src/gprs/.gitignore R src/gprs/Makefile.am R src/gprs/crc24.c R src/gprs/gb_proxy.c R src/gprs/gb_proxy_main.c R src/gprs/gb_proxy_patch.c R src/gprs/gb_proxy_peer.c R src/gprs/gb_proxy_tlli.c R src/gprs/gb_proxy_vty.c R src/gprs/gprs_gb_parse.c R src/gprs/gprs_gmm.c R src/gprs/gprs_llc.c R src/gprs/gprs_llc_parse.c R src/gprs/gprs_llc_vty.c R src/gprs/gprs_llc_xid.c R src/gprs/gprs_sgsn.c R src/gprs/gprs_sndcp.c R src/gprs/gprs_sndcp_comp.c R src/gprs/gprs_sndcp_dcomp.c R src/gprs/gprs_sndcp_pcomp.c R src/gprs/gprs_sndcp_vty.c R src/gprs/gprs_sndcp_xid.c R src/gprs/gprs_subscriber.c R src/gprs/gprs_utils.c R src/gprs/gtphub.c R src/gprs/gtphub_ares.c R src/gprs/gtphub_main.c R src/gprs/gtphub_sock.c R src/gprs/gtphub_vty.c R src/gprs/osmo_sgsn.cfg R src/gprs/sgsn_ares.c R src/gprs/sgsn_auth.c R src/gprs/sgsn_cdr.c R src/gprs/sgsn_ctrl.c R src/gprs/sgsn_libgtp.c R src/gprs/sgsn_main.c R src/gprs/sgsn_vty.c R src/gprs/slhc.c R src/gprs/v42bis.c R src/ipaccess/Makefile.am R src/ipaccess/abisip-find.c R src/ipaccess/ipaccess-config.c R src/ipaccess/ipaccess-firmware.c R src/ipaccess/ipaccess-proxy.c R src/ipaccess/network_listen.c R src/libbsc/Makefile.am R src/libbsc/abis_nm.c R src/libbsc/abis_nm_ipaccess.c R src/libbsc/abis_nm_vty.c R src/libbsc/abis_om2000.c R src/libbsc/abis_om2000_vty.c R src/libbsc/abis_rsl.c R src/libbsc/arfcn_range_encode.c R src/libbsc/bsc_api.c R src/libbsc/bsc_ctrl_commands.c R src/libbsc/bsc_ctrl_lookup.c R src/libbsc/bsc_dyn_ts.c R src/libbsc/bsc_init.c R src/libbsc/bsc_msc.c R src/libbsc/bsc_rf_ctrl.c R src/libbsc/bsc_rll.c R src/libbsc/bsc_subscriber.c R src/libbsc/bsc_vty.c R src/libbsc/bts_ericsson_rbs2000.c R src/libbsc/bts_init.c R src/libbsc/bts_ipaccess_nanobts.c R src/libbsc/bts_ipaccess_nanobts_omlattr.c R src/libbsc/bts_nokia_site.c R src/libbsc/bts_siemens_bs11.c R src/libbsc/bts_sysmobts.c R src/libbsc/bts_unknown.c R src/libbsc/chan_alloc.c R src/libbsc/e1_config.c R src/libbsc/gsm_04_08_utils.c R src/libbsc/gsm_04_80_utils.c R src/libbsc/handover_decision.c R src/libbsc/handover_logic.c R src/libbsc/meas_proc.c R src/libbsc/meas_rep.c R src/libbsc/net_init.c R src/libbsc/paging.c R src/libbsc/pcu_sock.c R src/libbsc/rest_octets.c R src/libbsc/system_information.c R src/libcommon-cs/Makefile.am R src/libcommon-cs/common_cs.c R src/libcommon-cs/common_cs_vty.c R src/libcommon/Makefile.am R src/libcommon/bsc_version.c R src/libcommon/common_vty.c R src/libcommon/debug.c R src/libcommon/gsm_data.c R src/libcommon/gsm_data_shared.c R src/libcommon/gsm_subscriber_base.c R src/libcommon/gsup_client.c R src/libcommon/gsup_test_client.c R src/libcommon/oap_client.c R src/libcommon/socket.c R src/libcommon/talloc_ctx.c R src/libfilter/Makefile.am R src/libfilter/bsc_msg_acc.c R src/libfilter/bsc_msg_filter.c R src/libfilter/bsc_msg_vty.c R src/libiu/Makefile.am R src/libiu/iu.c R src/libiu/iu_vty.c R src/libmgcp/Makefile.am R src/libmgcp/g711common.h R src/libmgcp/mgcp_network.c R src/libmgcp/mgcp_osmux.c R src/libmgcp/mgcp_protocol.c R src/libmgcp/mgcp_sdp.c R src/libmgcp/mgcp_transcode.c R src/libmgcp/mgcp_vty.c R src/libmsc/Makefile.am R src/libmsc/auth.c R src/libmsc/ctrl_commands.c R src/libmsc/db.c R src/libmsc/gsm_04_08.c R src/libmsc/gsm_04_11.c R src/libmsc/gsm_04_80.c R src/libmsc/gsm_subscriber.c R src/libmsc/meas_feed.c R src/libmsc/meas_feed.h R src/libmsc/mncc.c R src/libmsc/mncc_builtin.c R src/libmsc/mncc_sock.c R src/libmsc/osmo_msc.c R src/libmsc/rrlp.c R src/libmsc/silent_call.c R src/libmsc/smpp_openbsc.c R src/libmsc/smpp_smsc.c R src/libmsc/smpp_smsc.h R src/libmsc/smpp_utils.c R src/libmsc/smpp_vty.c R src/libmsc/sms_queue.c R src/libmsc/token_auth.c R src/libmsc/transaction.c R src/libmsc/ussd.c R src/libmsc/vty_interface_layer3.c R src/libtrau/Makefile.am R src/libtrau/rtp_proxy.c R src/libtrau/trau_mux.c R src/libtrau/trau_upqueue.c R src/osmo-bsc/Makefile.am R src/osmo-bsc/osmo_bsc_api.c R src/osmo-bsc/osmo_bsc_audio.c R src/osmo-bsc/osmo_bsc_bssap.c R src/osmo-bsc/osmo_bsc_ctrl.c R src/osmo-bsc/osmo_bsc_filter.c R src/osmo-bsc/osmo_bsc_grace.c R src/osmo-bsc/osmo_bsc_main.c R src/osmo-bsc/osmo_bsc_msc.c R src/osmo-bsc/osmo_bsc_sccp.c R src/osmo-bsc/osmo_bsc_vty.c R src/osmo-bsc_mgcp/Makefile.am R src/osmo-bsc_mgcp/mgcp_main.c R src/osmo-bsc_nat/Makefile.am R src/osmo-bsc_nat/bsc_filter.c R src/osmo-bsc_nat/bsc_mgcp_utils.c R src/osmo-bsc_nat/bsc_nat.c R src/osmo-bsc_nat/bsc_nat_ctrl.c R src/osmo-bsc_nat/bsc_nat_filter.c R src/osmo-bsc_nat/bsc_nat_rewrite.c R src/osmo-bsc_nat/bsc_nat_rewrite_trie.c R src/osmo-bsc_nat/bsc_nat_utils.c R src/osmo-bsc_nat/bsc_nat_vty.c R src/osmo-bsc_nat/bsc_sccp.c R src/osmo-bsc_nat/bsc_ussd.c R src/osmo-nitb/Makefile.am R src/osmo-nitb/bsc_hack.c R src/utils/Makefile.am R src/utils/bs11_config.c R src/utils/isdnsync.c R src/utils/meas_db.c R src/utils/meas_db.h R src/utils/meas_json.c R src/utils/meas_pcap2db.c R src/utils/meas_udp2db.c R src/utils/meas_vis.c R src/utils/smpp_mirror.c R tests/Makefile.am R tests/abis/Makefile.am R tests/abis/abis_test.c R tests/abis/abis_test.ok R tests/atlocal.in R tests/bsc-nat-trie/Makefile.am R tests/bsc-nat-trie/bsc_nat_trie_test.c R tests/bsc-nat-trie/bsc_nat_trie_test.ok R tests/bsc-nat-trie/prefixes.csv R tests/bsc-nat/Makefile.am R tests/bsc-nat/barr.cfg R tests/bsc-nat/barr_dup.cfg R tests/bsc-nat/bsc_data.c R tests/bsc-nat/bsc_nat_test.c R tests/bsc-nat/bsc_nat_test.ok R tests/bsc-nat/prefixes.csv R tests/bsc/Makefile.am R tests/bsc/bsc_test.c R tests/bsc/bsc_test.ok R tests/channel/Makefile.am R tests/channel/channel_test.c R tests/channel/channel_test.ok R tests/ctrl_test_runner.py R tests/db/Makefile.am R tests/db/db_test.c R tests/db/db_test.err R tests/db/db_test.ok R tests/db/hlr.sqlite3 R tests/gbproxy/Makefile.am R tests/gbproxy/gbproxy_test.c R tests/gbproxy/gbproxy_test.ok R tests/gprs/Makefile.am R tests/gprs/gprs_test.c R tests/gprs/gprs_test.ok R tests/gsm0408/Makefile.am R tests/gsm0408/gsm0408_test.c R tests/gsm0408/gsm0408_test.ok R tests/gtphub/Makefile.am R tests/gtphub/gtphub_test.c R tests/gtphub/gtphub_test.ok R tests/mgcp/Makefile.am R tests/mgcp/mgcp_test.c R tests/mgcp/mgcp_test.ok R tests/mgcp/mgcp_transcoding_test.c R tests/mgcp/mgcp_transcoding_test.ok R tests/mm_auth/Makefile.am R tests/mm_auth/mm_auth_test.c R tests/mm_auth/mm_auth_test.ok R tests/nanobts_omlattr/Makefile.am R tests/nanobts_omlattr/nanobts_omlattr_test.c R tests/nanobts_omlattr/nanobts_omlattr_test.ok R tests/oap/Makefile.am R tests/oap/oap_client_test.c R tests/oap/oap_client_test.err R tests/oap/oap_client_test.ok R tests/sgsn/Makefile.am R tests/sgsn/sgsn_test.c R tests/sgsn/sgsn_test.ok R tests/slhc/Makefile.am R tests/slhc/slhc_test.c R tests/slhc/slhc_test.ok R tests/smpp/Makefile.am R tests/smpp/smpp_test.c R tests/smpp/smpp_test.err R tests/smpp/smpp_test.ok R tests/smpp_test_runner.py R tests/sndcp_xid/Makefile.am R tests/sndcp_xid/sndcp_xid_test.c R tests/sndcp_xid/sndcp_xid_test.ok R tests/subscr/Makefile.am R tests/subscr/bsc_subscr_test.c R tests/subscr/bsc_subscr_test.err R tests/subscr/bsc_subscr_test.ok R tests/subscr/subscr_test.c R tests/subscr/subscr_test.ok R tests/testsuite.at R tests/trau/Makefile.am R tests/trau/trau_test.c R tests/trau/trau_test.ok R tests/v42bis/Makefile.am R tests/v42bis/v42bis_test.c R tests/v42bis/v42bis_test.ok R tests/vty_test_runner.py R tests/xid/Makefile.am R tests/xid/xid_test.c R tests/xid/xid_test.ok R tools/hlrstat.pl 446 files changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/88/3188/3 diff --git a/openbsc/AUTHORS b/AUTHORS similarity index 100% rename from openbsc/AUTHORS rename to AUTHORS diff --git a/openbsc/COPYING b/COPYING similarity index 100% rename from openbsc/COPYING rename to COPYING diff --git a/openbsc/Makefile.am b/Makefile.am similarity index 100% rename from openbsc/Makefile.am rename to Makefile.am diff --git a/openbsc/README b/README similarity index 100% rename from openbsc/README rename to README diff --git a/openbsc/README.vty-tests b/README.vty-tests similarity index 100% rename from openbsc/README.vty-tests rename to README.vty-tests diff --git a/openbsc/configure.ac b/configure.ac similarity index 100% rename from openbsc/configure.ac rename to configure.ac diff --git a/openbsc/contrib/a-link/sccp-split-by-con.lua b/contrib/a-link/sccp-split-by-con.lua similarity index 100% rename from openbsc/contrib/a-link/sccp-split-by-con.lua rename to contrib/a-link/sccp-split-by-con.lua diff --git a/openbsc/contrib/bsc-test/README b/contrib/bsc-test/README similarity index 100% rename from openbsc/contrib/bsc-test/README rename to contrib/bsc-test/README diff --git a/openbsc/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial similarity index 100% rename from openbsc/contrib/bsc-test/all_dial rename to contrib/bsc-test/all_dial diff --git a/openbsc/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh similarity index 100% rename from openbsc/contrib/bsc-test/dial.sh rename to contrib/bsc-test/dial.sh diff --git a/openbsc/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh similarity index 100% rename from openbsc/contrib/bsc-test/drop-oml.sh rename to contrib/bsc-test/drop-oml.sh diff --git a/openbsc/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh similarity index 100% rename from openbsc/contrib/bsc-test/drop.sh rename to contrib/bsc-test/drop.sh diff --git a/openbsc/contrib/bsc-test/hangup b/contrib/bsc-test/hangup similarity index 100% rename from openbsc/contrib/bsc-test/hangup rename to contrib/bsc-test/hangup diff --git a/openbsc/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh similarity index 100% rename from openbsc/contrib/bsc-test/msc.sh rename to contrib/bsc-test/msc.sh diff --git a/openbsc/contrib/bsc_control.py b/contrib/bsc_control.py similarity index 100% rename from openbsc/contrib/bsc_control.py rename to contrib/bsc_control.py diff --git a/openbsc/contrib/bt.py b/contrib/bt.py similarity index 100% rename from openbsc/contrib/bt.py rename to contrib/bt.py diff --git a/openbsc/contrib/convert_to_enum.py b/contrib/convert_to_enum.py similarity index 100% rename from openbsc/contrib/convert_to_enum.py rename to contrib/convert_to_enum.py diff --git a/openbsc/contrib/ctrl2sse.py b/contrib/ctrl2sse.py similarity index 100% rename from openbsc/contrib/ctrl2sse.py rename to contrib/ctrl2sse.py diff --git a/openbsc/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py similarity index 100% rename from openbsc/contrib/gprs/gb-proxy-unblock-bug.py rename to contrib/gprs/gb-proxy-unblock-bug.py diff --git a/openbsc/contrib/gprs/gprs-bssgp-histogram.lua b/contrib/gprs/gprs-bssgp-histogram.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-bssgp-histogram.lua rename to contrib/gprs/gprs-bssgp-histogram.lua diff --git a/openbsc/contrib/gprs/gprs-buffer-count.lua b/contrib/gprs/gprs-buffer-count.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-buffer-count.lua rename to contrib/gprs/gprs-buffer-count.lua diff --git a/openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua b/contrib/gprs/gprs-split-trace-by-tlli.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua rename to contrib/gprs/gprs-split-trace-by-tlli.lua diff --git a/openbsc/contrib/gprs/gprs-verify-nu.lua b/contrib/gprs/gprs-verify-nu.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-verify-nu.lua rename to contrib/gprs/gprs-verify-nu.lua diff --git a/openbsc/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql similarity index 100% rename from openbsc/contrib/hlr-remove-old.sql rename to contrib/hlr-remove-old.sql diff --git a/openbsc/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py similarity index 100% rename from openbsc/contrib/hlrsync/hlrsync.py rename to contrib/hlrsync/hlrsync.py diff --git a/openbsc/contrib/ipa.py b/contrib/ipa.py similarity index 100% rename from openbsc/contrib/ipa.py rename to contrib/ipa.py diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 068ee34..b315b97 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -43,7 +43,6 @@ set -x cd "$base" -cd openbsc autoreconf --install --force ./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE diff --git a/openbsc/contrib/mgcp_server.py b/contrib/mgcp_server.py similarity index 100% rename from openbsc/contrib/mgcp_server.py rename to contrib/mgcp_server.py diff --git a/openbsc/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c similarity index 100% rename from openbsc/contrib/nat/test_regexp.c rename to contrib/nat/test_regexp.c diff --git a/openbsc/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py similarity index 100% rename from openbsc/contrib/nat/ussd_example.py rename to contrib/nat/ussd_example.py diff --git a/openbsc/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl similarity index 100% rename from openbsc/contrib/rtp/gen_rtp_header.erl rename to contrib/rtp/gen_rtp_header.erl diff --git a/openbsc/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay.st rename to contrib/rtp/rtp_replay.st diff --git a/openbsc/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay_shared.st rename to contrib/rtp/rtp_replay_shared.st diff --git a/openbsc/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay_sip.st rename to contrib/rtp/rtp_replay_sip.st diff --git a/openbsc/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua similarity index 100% rename from openbsc/contrib/rtp/timestamp_rtp.lua rename to contrib/rtp/timestamp_rtp.lua diff --git a/openbsc/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st similarity index 100% rename from openbsc/contrib/sms/fill-hlr.st rename to contrib/sms/fill-hlr.st diff --git a/openbsc/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st similarity index 100% rename from openbsc/contrib/sms/hlr-query.st rename to contrib/sms/hlr-query.st diff --git a/openbsc/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d similarity index 100% rename from openbsc/contrib/sms/sqlite-probe.tap.d rename to contrib/sms/sqlite-probe.tap.d diff --git a/openbsc/contrib/soap.py b/contrib/soap.py similarity index 100% rename from openbsc/contrib/soap.py rename to contrib/soap.py diff --git a/openbsc/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service similarity index 100% rename from openbsc/contrib/systemd/osmo-bsc-mgcp.service rename to contrib/systemd/osmo-bsc-mgcp.service diff --git a/openbsc/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service similarity index 100% rename from openbsc/contrib/systemd/osmo-bsc.service rename to contrib/systemd/osmo-bsc.service diff --git a/openbsc/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service similarity index 100% rename from openbsc/contrib/systemd/osmo-gbproxy.service rename to contrib/systemd/osmo-gbproxy.service diff --git a/openbsc/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service similarity index 100% rename from openbsc/contrib/systemd/osmo-nitb.service rename to contrib/systemd/osmo-nitb.service diff --git a/openbsc/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service similarity index 100% rename from openbsc/contrib/systemd/osmo-sgsn.service rename to contrib/systemd/osmo-sgsn.service diff --git a/openbsc/contrib/testconv/Makefile b/contrib/testconv/Makefile similarity index 100% rename from openbsc/contrib/testconv/Makefile rename to contrib/testconv/Makefile diff --git a/openbsc/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c similarity index 100% rename from openbsc/contrib/testconv/testconv_main.c rename to contrib/testconv/testconv_main.c diff --git a/openbsc/contrib/twisted_ipa.py b/contrib/twisted_ipa.py similarity index 100% rename from openbsc/contrib/twisted_ipa.py rename to contrib/twisted_ipa.py diff --git a/openbsc/doc/BS11-OML.txt b/doc/BS11-OML.txt similarity index 100% rename from openbsc/doc/BS11-OML.txt rename to doc/BS11-OML.txt diff --git a/openbsc/doc/Makefile.am b/doc/Makefile.am similarity index 100% rename from openbsc/doc/Makefile.am rename to doc/Makefile.am diff --git a/openbsc/doc/call-routing.txt b/doc/call-routing.txt similarity index 100% rename from openbsc/doc/call-routing.txt rename to doc/call-routing.txt diff --git a/openbsc/doc/channel_release.txt b/doc/channel_release.txt similarity index 100% rename from openbsc/doc/channel_release.txt rename to doc/channel_release.txt diff --git a/openbsc/doc/e1-data-model.txt b/doc/e1-data-model.txt similarity index 100% rename from openbsc/doc/e1-data-model.txt rename to doc/e1-data-model.txt diff --git a/openbsc/doc/examples/Makefile.am b/doc/examples/Makefile.am similarity index 100% rename from openbsc/doc/examples/Makefile.am rename to doc/examples/Makefile.am diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg rename to doc/examples/osmo-bsc/osmo-bsc.cfg diff --git a/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg rename to doc/examples/osmo-bsc_mgcp/mgcp.cfg diff --git a/openbsc/doc/examples/osmo-bsc_nat/black-list.cfg b/doc/examples/osmo-bsc_nat/black-list.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/black-list.cfg rename to doc/examples/osmo-bsc_nat/black-list.cfg diff --git a/openbsc/doc/examples/osmo-bsc_nat/bscs.config b/doc/examples/osmo-bsc_nat/bscs.config similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/bscs.config rename to doc/examples/osmo-bsc_nat/bscs.config diff --git a/openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg rename to doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg diff --git a/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg rename to doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg diff --git a/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg rename to doc/examples/osmo-gbproxy/osmo-gbproxy.cfg diff --git a/openbsc/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/gtphub-example.txt rename to doc/examples/osmo-gtphub/gtphub-example.txt diff --git a/openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg rename to doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg diff --git a/openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg rename to doc/examples/osmo-gtphub/osmo-gtphub.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg b/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg b/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg b/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg b/doc/examples/osmo-nitb/bs11/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg rename to doc/examples/osmo-nitb/bs11/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg b/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg rename to doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg b/doc/examples/osmo-nitb/nanobts/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg rename to doc/examples/osmo-nitb/nanobts/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg b/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg rename to doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg b/doc/examples/osmo-nitb/rbs2308/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg rename to doc/examples/osmo-nitb/rbs2308/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg b/doc/examples/osmo-nitb/sysmobts/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg rename to doc/examples/osmo-nitb/sysmobts/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg similarity index 100% rename from openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg rename to doc/examples/osmo-sgsn/osmo-sgsn.cfg diff --git a/openbsc/doc/gsm-hopping.txt b/doc/gsm-hopping.txt similarity index 100% rename from openbsc/doc/gsm-hopping.txt rename to doc/gsm-hopping.txt diff --git a/openbsc/doc/handover.txt b/doc/handover.txt similarity index 100% rename from openbsc/doc/handover.txt rename to doc/handover.txt diff --git a/openbsc/doc/ipa-sccp.txt b/doc/ipa-sccp.txt similarity index 100% rename from openbsc/doc/ipa-sccp.txt rename to doc/ipa-sccp.txt diff --git a/openbsc/doc/oml-interface.txt b/doc/oml-interface.txt similarity index 100% rename from openbsc/doc/oml-interface.txt rename to doc/oml-interface.txt diff --git a/openbsc/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot similarity index 100% rename from openbsc/doc/osmo-nitb-data_structures.dot rename to doc/osmo-nitb-data_structures.dot diff --git a/openbsc/doc/paging.txt b/doc/paging.txt similarity index 100% rename from openbsc/doc/paging.txt rename to doc/paging.txt diff --git a/openbsc/git-version-gen b/git-version-gen similarity index 100% rename from openbsc/git-version-gen rename to git-version-gen diff --git a/openbsc/include/Makefile.am b/include/Makefile.am similarity index 100% rename from openbsc/include/Makefile.am rename to include/Makefile.am diff --git a/openbsc/include/compat_af_isdn.h b/include/compat_af_isdn.h similarity index 100% rename from openbsc/include/compat_af_isdn.h rename to include/compat_af_isdn.h diff --git a/openbsc/include/mISDNif.h b/include/mISDNif.h similarity index 100% rename from openbsc/include/mISDNif.h rename to include/mISDNif.h diff --git a/openbsc/include/openbsc/Makefile.am b/include/openbsc/Makefile.am similarity index 100% rename from openbsc/include/openbsc/Makefile.am rename to include/openbsc/Makefile.am diff --git a/openbsc/include/openbsc/abis_nm.h b/include/openbsc/abis_nm.h similarity index 100% rename from openbsc/include/openbsc/abis_nm.h rename to include/openbsc/abis_nm.h diff --git a/openbsc/include/openbsc/abis_om2000.h b/include/openbsc/abis_om2000.h similarity index 100% rename from openbsc/include/openbsc/abis_om2000.h rename to include/openbsc/abis_om2000.h diff --git a/openbsc/include/openbsc/abis_rsl.h b/include/openbsc/abis_rsl.h similarity index 100% rename from openbsc/include/openbsc/abis_rsl.h rename to include/openbsc/abis_rsl.h diff --git a/openbsc/include/openbsc/arfcn_range_encode.h b/include/openbsc/arfcn_range_encode.h similarity index 100% rename from openbsc/include/openbsc/arfcn_range_encode.h rename to include/openbsc/arfcn_range_encode.h diff --git a/openbsc/include/openbsc/auth.h b/include/openbsc/auth.h similarity index 100% rename from openbsc/include/openbsc/auth.h rename to include/openbsc/auth.h diff --git a/openbsc/include/openbsc/bsc_api.h b/include/openbsc/bsc_api.h similarity index 100% rename from openbsc/include/openbsc/bsc_api.h rename to include/openbsc/bsc_api.h diff --git a/openbsc/include/openbsc/bsc_msc.h b/include/openbsc/bsc_msc.h similarity index 100% rename from openbsc/include/openbsc/bsc_msc.h rename to include/openbsc/bsc_msc.h diff --git a/openbsc/include/openbsc/bsc_msc_data.h b/include/openbsc/bsc_msc_data.h similarity index 100% rename from openbsc/include/openbsc/bsc_msc_data.h rename to include/openbsc/bsc_msc_data.h diff --git a/openbsc/include/openbsc/bsc_msg_filter.h b/include/openbsc/bsc_msg_filter.h similarity index 100% rename from openbsc/include/openbsc/bsc_msg_filter.h rename to include/openbsc/bsc_msg_filter.h diff --git a/openbsc/include/openbsc/bsc_nat.h b/include/openbsc/bsc_nat.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat.h rename to include/openbsc/bsc_nat.h diff --git a/openbsc/include/openbsc/bsc_nat_callstats.h b/include/openbsc/bsc_nat_callstats.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat_callstats.h rename to include/openbsc/bsc_nat_callstats.h diff --git a/openbsc/include/openbsc/bsc_nat_sccp.h b/include/openbsc/bsc_nat_sccp.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat_sccp.h rename to include/openbsc/bsc_nat_sccp.h diff --git a/openbsc/include/openbsc/bsc_rll.h b/include/openbsc/bsc_rll.h similarity index 100% rename from openbsc/include/openbsc/bsc_rll.h rename to include/openbsc/bsc_rll.h diff --git a/openbsc/include/openbsc/bsc_subscriber.h b/include/openbsc/bsc_subscriber.h similarity index 100% rename from openbsc/include/openbsc/bsc_subscriber.h rename to include/openbsc/bsc_subscriber.h diff --git a/openbsc/include/openbsc/bss.h b/include/openbsc/bss.h similarity index 100% rename from openbsc/include/openbsc/bss.h rename to include/openbsc/bss.h diff --git a/openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/openbsc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/openbsc/bts_ipaccess_nanobts_omlattr.h diff --git a/openbsc/include/openbsc/chan_alloc.h b/include/openbsc/chan_alloc.h similarity index 100% rename from openbsc/include/openbsc/chan_alloc.h rename to include/openbsc/chan_alloc.h diff --git a/openbsc/include/openbsc/common_bsc.h b/include/openbsc/common_bsc.h similarity index 100% rename from openbsc/include/openbsc/common_bsc.h rename to include/openbsc/common_bsc.h diff --git a/openbsc/include/openbsc/common_cs.h b/include/openbsc/common_cs.h similarity index 100% rename from openbsc/include/openbsc/common_cs.h rename to include/openbsc/common_cs.h diff --git a/openbsc/include/openbsc/crc24.h b/include/openbsc/crc24.h similarity index 100% rename from openbsc/include/openbsc/crc24.h rename to include/openbsc/crc24.h diff --git a/openbsc/include/openbsc/ctrl.h b/include/openbsc/ctrl.h similarity index 100% rename from openbsc/include/openbsc/ctrl.h rename to include/openbsc/ctrl.h diff --git a/openbsc/include/openbsc/db.h b/include/openbsc/db.h similarity index 100% rename from openbsc/include/openbsc/db.h rename to include/openbsc/db.h diff --git a/openbsc/include/openbsc/debug.h b/include/openbsc/debug.h similarity index 100% rename from openbsc/include/openbsc/debug.h rename to include/openbsc/debug.h diff --git a/openbsc/include/openbsc/e1_config.h b/include/openbsc/e1_config.h similarity index 100% rename from openbsc/include/openbsc/e1_config.h rename to include/openbsc/e1_config.h diff --git a/openbsc/include/openbsc/gb_proxy.h b/include/openbsc/gb_proxy.h similarity index 100% rename from openbsc/include/openbsc/gb_proxy.h rename to include/openbsc/gb_proxy.h diff --git a/openbsc/include/openbsc/gprs_gb_parse.h b/include/openbsc/gprs_gb_parse.h similarity index 100% rename from openbsc/include/openbsc/gprs_gb_parse.h rename to include/openbsc/gprs_gb_parse.h diff --git a/openbsc/include/openbsc/gprs_gmm.h b/include/openbsc/gprs_gmm.h similarity index 100% rename from openbsc/include/openbsc/gprs_gmm.h rename to include/openbsc/gprs_gmm.h diff --git a/openbsc/include/openbsc/gprs_llc.h b/include/openbsc/gprs_llc.h similarity index 100% rename from openbsc/include/openbsc/gprs_llc.h rename to include/openbsc/gprs_llc.h diff --git a/openbsc/include/openbsc/gprs_llc_xid.h b/include/openbsc/gprs_llc_xid.h similarity index 100% rename from openbsc/include/openbsc/gprs_llc_xid.h rename to include/openbsc/gprs_llc_xid.h diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h similarity index 100% rename from openbsc/include/openbsc/gprs_sgsn.h rename to include/openbsc/gprs_sgsn.h diff --git a/openbsc/include/openbsc/gprs_sndcp.h b/include/openbsc/gprs_sndcp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp.h rename to include/openbsc/gprs_sndcp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_comp.h b/include/openbsc/gprs_sndcp_comp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_comp.h rename to include/openbsc/gprs_sndcp_comp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_dcomp.h b/include/openbsc/gprs_sndcp_dcomp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_dcomp.h rename to include/openbsc/gprs_sndcp_dcomp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_pcomp.h b/include/openbsc/gprs_sndcp_pcomp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_pcomp.h rename to include/openbsc/gprs_sndcp_pcomp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_xid.h b/include/openbsc/gprs_sndcp_xid.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_xid.h rename to include/openbsc/gprs_sndcp_xid.h diff --git a/openbsc/include/openbsc/gprs_subscriber.h b/include/openbsc/gprs_subscriber.h similarity index 100% rename from openbsc/include/openbsc/gprs_subscriber.h rename to include/openbsc/gprs_subscriber.h diff --git a/openbsc/include/openbsc/gprs_utils.h b/include/openbsc/gprs_utils.h similarity index 100% rename from openbsc/include/openbsc/gprs_utils.h rename to include/openbsc/gprs_utils.h diff --git a/openbsc/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_08.h rename to include/openbsc/gsm_04_08.h diff --git a/openbsc/include/openbsc/gsm_04_11.h b/include/openbsc/gsm_04_11.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_11.h rename to include/openbsc/gsm_04_11.h diff --git a/openbsc/include/openbsc/gsm_04_80.h b/include/openbsc/gsm_04_80.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_80.h rename to include/openbsc/gsm_04_80.h diff --git a/openbsc/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h similarity index 100% rename from openbsc/include/openbsc/gsm_data.h rename to include/openbsc/gsm_data.h diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/include/openbsc/gsm_data_shared.h similarity index 100% rename from openbsc/include/openbsc/gsm_data_shared.h rename to include/openbsc/gsm_data_shared.h diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h similarity index 100% rename from openbsc/include/openbsc/gsm_subscriber.h rename to include/openbsc/gsm_subscriber.h diff --git a/openbsc/include/openbsc/gsup_client.h b/include/openbsc/gsup_client.h similarity index 100% rename from openbsc/include/openbsc/gsup_client.h rename to include/openbsc/gsup_client.h diff --git a/openbsc/include/openbsc/gtphub.h b/include/openbsc/gtphub.h similarity index 100% rename from openbsc/include/openbsc/gtphub.h rename to include/openbsc/gtphub.h diff --git a/openbsc/include/openbsc/handover.h b/include/openbsc/handover.h similarity index 100% rename from openbsc/include/openbsc/handover.h rename to include/openbsc/handover.h diff --git a/openbsc/include/openbsc/handover_decision.h b/include/openbsc/handover_decision.h similarity index 100% rename from openbsc/include/openbsc/handover_decision.h rename to include/openbsc/handover_decision.h diff --git a/openbsc/include/openbsc/ipaccess.h b/include/openbsc/ipaccess.h similarity index 100% rename from openbsc/include/openbsc/ipaccess.h rename to include/openbsc/ipaccess.h diff --git a/openbsc/include/openbsc/iu.h b/include/openbsc/iu.h similarity index 100% rename from openbsc/include/openbsc/iu.h rename to include/openbsc/iu.h diff --git a/openbsc/include/openbsc/meas_feed.h b/include/openbsc/meas_feed.h similarity index 100% rename from openbsc/include/openbsc/meas_feed.h rename to include/openbsc/meas_feed.h diff --git a/openbsc/include/openbsc/meas_rep.h b/include/openbsc/meas_rep.h similarity index 100% rename from openbsc/include/openbsc/meas_rep.h rename to include/openbsc/meas_rep.h diff --git a/openbsc/include/openbsc/mgcp.h b/include/openbsc/mgcp.h similarity index 100% rename from openbsc/include/openbsc/mgcp.h rename to include/openbsc/mgcp.h diff --git a/openbsc/include/openbsc/mgcp_internal.h b/include/openbsc/mgcp_internal.h similarity index 100% rename from openbsc/include/openbsc/mgcp_internal.h rename to include/openbsc/mgcp_internal.h diff --git a/openbsc/include/openbsc/mgcp_transcode.h b/include/openbsc/mgcp_transcode.h similarity index 100% rename from openbsc/include/openbsc/mgcp_transcode.h rename to include/openbsc/mgcp_transcode.h diff --git a/openbsc/include/openbsc/misdn.h b/include/openbsc/misdn.h similarity index 100% rename from openbsc/include/openbsc/misdn.h rename to include/openbsc/misdn.h diff --git a/openbsc/include/openbsc/mncc.h b/include/openbsc/mncc.h similarity index 100% rename from openbsc/include/openbsc/mncc.h rename to include/openbsc/mncc.h diff --git a/openbsc/include/openbsc/mncc_int.h b/include/openbsc/mncc_int.h similarity index 100% rename from openbsc/include/openbsc/mncc_int.h rename to include/openbsc/mncc_int.h diff --git a/openbsc/include/openbsc/nat_rewrite_trie.h b/include/openbsc/nat_rewrite_trie.h similarity index 100% rename from openbsc/include/openbsc/nat_rewrite_trie.h rename to include/openbsc/nat_rewrite_trie.h diff --git a/openbsc/include/openbsc/network_listen.h b/include/openbsc/network_listen.h similarity index 100% rename from openbsc/include/openbsc/network_listen.h rename to include/openbsc/network_listen.h diff --git a/openbsc/include/openbsc/oap_client.h b/include/openbsc/oap_client.h similarity index 100% rename from openbsc/include/openbsc/oap_client.h rename to include/openbsc/oap_client.h diff --git a/openbsc/include/openbsc/openbscdefines.h b/include/openbsc/openbscdefines.h similarity index 100% rename from openbsc/include/openbsc/openbscdefines.h rename to include/openbsc/openbscdefines.h diff --git a/openbsc/include/openbsc/osmo_bsc.h b/include/openbsc/osmo_bsc.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc.h rename to include/openbsc/osmo_bsc.h diff --git a/openbsc/include/openbsc/osmo_bsc_grace.h b/include/openbsc/osmo_bsc_grace.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc_grace.h rename to include/openbsc/osmo_bsc_grace.h diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/include/openbsc/osmo_bsc_rf.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc_rf.h rename to include/openbsc/osmo_bsc_rf.h diff --git a/openbsc/include/openbsc/osmo_msc.h b/include/openbsc/osmo_msc.h similarity index 100% rename from openbsc/include/openbsc/osmo_msc.h rename to include/openbsc/osmo_msc.h diff --git a/openbsc/include/openbsc/osmux.h b/include/openbsc/osmux.h similarity index 100% rename from openbsc/include/openbsc/osmux.h rename to include/openbsc/osmux.h diff --git a/openbsc/include/openbsc/paging.h b/include/openbsc/paging.h similarity index 100% rename from openbsc/include/openbsc/paging.h rename to include/openbsc/paging.h diff --git a/openbsc/include/openbsc/pcu_if.h b/include/openbsc/pcu_if.h similarity index 100% rename from openbsc/include/openbsc/pcu_if.h rename to include/openbsc/pcu_if.h diff --git a/openbsc/include/openbsc/pcuif_proto.h b/include/openbsc/pcuif_proto.h similarity index 100% rename from openbsc/include/openbsc/pcuif_proto.h rename to include/openbsc/pcuif_proto.h diff --git a/openbsc/include/openbsc/rest_octets.h b/include/openbsc/rest_octets.h similarity index 100% rename from openbsc/include/openbsc/rest_octets.h rename to include/openbsc/rest_octets.h diff --git a/openbsc/include/openbsc/rrlp.h b/include/openbsc/rrlp.h similarity index 100% rename from openbsc/include/openbsc/rrlp.h rename to include/openbsc/rrlp.h diff --git a/openbsc/include/openbsc/rs232.h b/include/openbsc/rs232.h similarity index 100% rename from openbsc/include/openbsc/rs232.h rename to include/openbsc/rs232.h diff --git a/openbsc/include/openbsc/rtp_proxy.h b/include/openbsc/rtp_proxy.h similarity index 100% rename from openbsc/include/openbsc/rtp_proxy.h rename to include/openbsc/rtp_proxy.h diff --git a/openbsc/include/openbsc/sgsn.h b/include/openbsc/sgsn.h similarity index 100% rename from openbsc/include/openbsc/sgsn.h rename to include/openbsc/sgsn.h diff --git a/openbsc/include/openbsc/signal.h b/include/openbsc/signal.h similarity index 100% rename from openbsc/include/openbsc/signal.h rename to include/openbsc/signal.h diff --git a/openbsc/include/openbsc/silent_call.h b/include/openbsc/silent_call.h similarity index 100% rename from openbsc/include/openbsc/silent_call.h rename to include/openbsc/silent_call.h diff --git a/openbsc/include/openbsc/slhc.h b/include/openbsc/slhc.h similarity index 100% rename from openbsc/include/openbsc/slhc.h rename to include/openbsc/slhc.h diff --git a/openbsc/include/openbsc/smpp.h b/include/openbsc/smpp.h similarity index 100% rename from openbsc/include/openbsc/smpp.h rename to include/openbsc/smpp.h diff --git a/openbsc/include/openbsc/sms_queue.h b/include/openbsc/sms_queue.h similarity index 100% rename from openbsc/include/openbsc/sms_queue.h rename to include/openbsc/sms_queue.h diff --git a/openbsc/include/openbsc/socket.h b/include/openbsc/socket.h similarity index 100% rename from openbsc/include/openbsc/socket.h rename to include/openbsc/socket.h diff --git a/openbsc/include/openbsc/system_information.h b/include/openbsc/system_information.h similarity index 100% rename from openbsc/include/openbsc/system_information.h rename to include/openbsc/system_information.h diff --git a/openbsc/include/openbsc/token_auth.h b/include/openbsc/token_auth.h similarity index 100% rename from openbsc/include/openbsc/token_auth.h rename to include/openbsc/token_auth.h diff --git a/openbsc/include/openbsc/transaction.h b/include/openbsc/transaction.h similarity index 100% rename from openbsc/include/openbsc/transaction.h rename to include/openbsc/transaction.h diff --git a/openbsc/include/openbsc/trau_mux.h b/include/openbsc/trau_mux.h similarity index 100% rename from openbsc/include/openbsc/trau_mux.h rename to include/openbsc/trau_mux.h diff --git a/openbsc/include/openbsc/trau_upqueue.h b/include/openbsc/trau_upqueue.h similarity index 100% rename from openbsc/include/openbsc/trau_upqueue.h rename to include/openbsc/trau_upqueue.h diff --git a/openbsc/include/openbsc/ussd.h b/include/openbsc/ussd.h similarity index 100% rename from openbsc/include/openbsc/ussd.h rename to include/openbsc/ussd.h diff --git a/openbsc/include/openbsc/v42bis.h b/include/openbsc/v42bis.h similarity index 100% rename from openbsc/include/openbsc/v42bis.h rename to include/openbsc/v42bis.h diff --git a/openbsc/include/openbsc/v42bis_private.h b/include/openbsc/v42bis_private.h similarity index 100% rename from openbsc/include/openbsc/v42bis_private.h rename to include/openbsc/v42bis_private.h diff --git a/openbsc/include/openbsc/vty.h b/include/openbsc/vty.h similarity index 100% rename from openbsc/include/openbsc/vty.h rename to include/openbsc/vty.h diff --git a/openbsc/m4/README b/m4/README similarity index 100% rename from openbsc/m4/README rename to m4/README diff --git a/openbsc/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 similarity index 100% rename from openbsc/m4/ax_check_compile_flag.m4 rename to m4/ax_check_compile_flag.m4 diff --git a/openbsc/openbsc.pc.in b/openbsc.pc.in similarity index 100% rename from openbsc/openbsc.pc.in rename to openbsc.pc.in diff --git a/openbsc/osmoappdesc.py b/osmoappdesc.py similarity index 100% rename from openbsc/osmoappdesc.py rename to osmoappdesc.py diff --git a/openbsc/src/Makefile.am b/src/Makefile.am similarity index 100% rename from openbsc/src/Makefile.am rename to src/Makefile.am diff --git a/openbsc/src/gprs/.gitignore b/src/gprs/.gitignore similarity index 100% rename from openbsc/src/gprs/.gitignore rename to src/gprs/.gitignore diff --git a/openbsc/src/gprs/Makefile.am b/src/gprs/Makefile.am similarity index 100% rename from openbsc/src/gprs/Makefile.am rename to src/gprs/Makefile.am diff --git a/openbsc/src/gprs/crc24.c b/src/gprs/crc24.c similarity index 100% rename from openbsc/src/gprs/crc24.c rename to src/gprs/crc24.c diff --git a/openbsc/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c similarity index 100% rename from openbsc/src/gprs/gb_proxy.c rename to src/gprs/gb_proxy.c diff --git a/openbsc/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_main.c rename to src/gprs/gb_proxy_main.c diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_patch.c rename to src/gprs/gb_proxy_patch.c diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_peer.c rename to src/gprs/gb_proxy_peer.c diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/src/gprs/gb_proxy_tlli.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_tlli.c rename to src/gprs/gb_proxy_tlli.c diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_vty.c rename to src/gprs/gb_proxy_vty.c diff --git a/openbsc/src/gprs/gprs_gb_parse.c b/src/gprs/gprs_gb_parse.c similarity index 100% rename from openbsc/src/gprs/gprs_gb_parse.c rename to src/gprs/gprs_gb_parse.c diff --git a/openbsc/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c similarity index 100% rename from openbsc/src/gprs/gprs_gmm.c rename to src/gprs/gprs_gmm.c diff --git a/openbsc/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c similarity index 100% rename from openbsc/src/gprs/gprs_llc.c rename to src/gprs/gprs_llc.c diff --git a/openbsc/src/gprs/gprs_llc_parse.c b/src/gprs/gprs_llc_parse.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_parse.c rename to src/gprs/gprs_llc_parse.c diff --git a/openbsc/src/gprs/gprs_llc_vty.c b/src/gprs/gprs_llc_vty.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_vty.c rename to src/gprs/gprs_llc_vty.c diff --git a/openbsc/src/gprs/gprs_llc_xid.c b/src/gprs/gprs_llc_xid.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_xid.c rename to src/gprs/gprs_llc_xid.c diff --git a/openbsc/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c similarity index 100% rename from openbsc/src/gprs/gprs_sgsn.c rename to src/gprs/gprs_sgsn.c diff --git a/openbsc/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp.c rename to src/gprs/gprs_sndcp.c diff --git a/openbsc/src/gprs/gprs_sndcp_comp.c b/src/gprs/gprs_sndcp_comp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_comp.c rename to src/gprs/gprs_sndcp_comp.c diff --git a/openbsc/src/gprs/gprs_sndcp_dcomp.c b/src/gprs/gprs_sndcp_dcomp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_dcomp.c rename to src/gprs/gprs_sndcp_dcomp.c diff --git a/openbsc/src/gprs/gprs_sndcp_pcomp.c b/src/gprs/gprs_sndcp_pcomp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_pcomp.c rename to src/gprs/gprs_sndcp_pcomp.c diff --git a/openbsc/src/gprs/gprs_sndcp_vty.c b/src/gprs/gprs_sndcp_vty.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_vty.c rename to src/gprs/gprs_sndcp_vty.c diff --git a/openbsc/src/gprs/gprs_sndcp_xid.c b/src/gprs/gprs_sndcp_xid.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_xid.c rename to src/gprs/gprs_sndcp_xid.c diff --git a/openbsc/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c similarity index 100% rename from openbsc/src/gprs/gprs_subscriber.c rename to src/gprs/gprs_subscriber.c diff --git a/openbsc/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c similarity index 100% rename from openbsc/src/gprs/gprs_utils.c rename to src/gprs/gprs_utils.c diff --git a/openbsc/src/gprs/gtphub.c b/src/gprs/gtphub.c similarity index 100% rename from openbsc/src/gprs/gtphub.c rename to src/gprs/gtphub.c diff --git a/openbsc/src/gprs/gtphub_ares.c b/src/gprs/gtphub_ares.c similarity index 100% rename from openbsc/src/gprs/gtphub_ares.c rename to src/gprs/gtphub_ares.c diff --git a/openbsc/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c similarity index 100% rename from openbsc/src/gprs/gtphub_main.c rename to src/gprs/gtphub_main.c diff --git a/openbsc/src/gprs/gtphub_sock.c b/src/gprs/gtphub_sock.c similarity index 100% rename from openbsc/src/gprs/gtphub_sock.c rename to src/gprs/gtphub_sock.c diff --git a/openbsc/src/gprs/gtphub_vty.c b/src/gprs/gtphub_vty.c similarity index 100% rename from openbsc/src/gprs/gtphub_vty.c rename to src/gprs/gtphub_vty.c diff --git a/openbsc/src/gprs/osmo_sgsn.cfg b/src/gprs/osmo_sgsn.cfg similarity index 100% rename from openbsc/src/gprs/osmo_sgsn.cfg rename to src/gprs/osmo_sgsn.cfg diff --git a/openbsc/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c similarity index 100% rename from openbsc/src/gprs/sgsn_ares.c rename to src/gprs/sgsn_ares.c diff --git a/openbsc/src/gprs/sgsn_auth.c b/src/gprs/sgsn_auth.c similarity index 100% rename from openbsc/src/gprs/sgsn_auth.c rename to src/gprs/sgsn_auth.c diff --git a/openbsc/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c similarity index 100% rename from openbsc/src/gprs/sgsn_cdr.c rename to src/gprs/sgsn_cdr.c diff --git a/openbsc/src/gprs/sgsn_ctrl.c b/src/gprs/sgsn_ctrl.c similarity index 100% rename from openbsc/src/gprs/sgsn_ctrl.c rename to src/gprs/sgsn_ctrl.c diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c similarity index 100% rename from openbsc/src/gprs/sgsn_libgtp.c rename to src/gprs/sgsn_libgtp.c diff --git a/openbsc/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c similarity index 100% rename from openbsc/src/gprs/sgsn_main.c rename to src/gprs/sgsn_main.c diff --git a/openbsc/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c similarity index 100% rename from openbsc/src/gprs/sgsn_vty.c rename to src/gprs/sgsn_vty.c diff --git a/openbsc/src/gprs/slhc.c b/src/gprs/slhc.c similarity index 100% rename from openbsc/src/gprs/slhc.c rename to src/gprs/slhc.c diff --git a/openbsc/src/gprs/v42bis.c b/src/gprs/v42bis.c similarity index 100% rename from openbsc/src/gprs/v42bis.c rename to src/gprs/v42bis.c diff --git a/openbsc/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am similarity index 100% rename from openbsc/src/ipaccess/Makefile.am rename to src/ipaccess/Makefile.am diff --git a/openbsc/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c similarity index 100% rename from openbsc/src/ipaccess/abisip-find.c rename to src/ipaccess/abisip-find.c diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-config.c rename to src/ipaccess/ipaccess-config.c diff --git a/openbsc/src/ipaccess/ipaccess-firmware.c b/src/ipaccess/ipaccess-firmware.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-firmware.c rename to src/ipaccess/ipaccess-firmware.c diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-proxy.c rename to src/ipaccess/ipaccess-proxy.c diff --git a/openbsc/src/ipaccess/network_listen.c b/src/ipaccess/network_listen.c similarity index 100% rename from openbsc/src/ipaccess/network_listen.c rename to src/ipaccess/network_listen.c diff --git a/openbsc/src/libbsc/Makefile.am b/src/libbsc/Makefile.am similarity index 100% rename from openbsc/src/libbsc/Makefile.am rename to src/libbsc/Makefile.am diff --git a/openbsc/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c similarity index 100% rename from openbsc/src/libbsc/abis_nm.c rename to src/libbsc/abis_nm.c diff --git a/openbsc/src/libbsc/abis_nm_ipaccess.c b/src/libbsc/abis_nm_ipaccess.c similarity index 100% rename from openbsc/src/libbsc/abis_nm_ipaccess.c rename to src/libbsc/abis_nm_ipaccess.c diff --git a/openbsc/src/libbsc/abis_nm_vty.c b/src/libbsc/abis_nm_vty.c similarity index 100% rename from openbsc/src/libbsc/abis_nm_vty.c rename to src/libbsc/abis_nm_vty.c diff --git a/openbsc/src/libbsc/abis_om2000.c b/src/libbsc/abis_om2000.c similarity index 100% rename from openbsc/src/libbsc/abis_om2000.c rename to src/libbsc/abis_om2000.c diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/src/libbsc/abis_om2000_vty.c similarity index 100% rename from openbsc/src/libbsc/abis_om2000_vty.c rename to src/libbsc/abis_om2000_vty.c diff --git a/openbsc/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c similarity index 100% rename from openbsc/src/libbsc/abis_rsl.c rename to src/libbsc/abis_rsl.c diff --git a/openbsc/src/libbsc/arfcn_range_encode.c b/src/libbsc/arfcn_range_encode.c similarity index 100% rename from openbsc/src/libbsc/arfcn_range_encode.c rename to src/libbsc/arfcn_range_encode.c diff --git a/openbsc/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c similarity index 100% rename from openbsc/src/libbsc/bsc_api.c rename to src/libbsc/bsc_api.c diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c similarity index 100% rename from openbsc/src/libbsc/bsc_ctrl_commands.c rename to src/libbsc/bsc_ctrl_commands.c diff --git a/openbsc/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c similarity index 100% rename from openbsc/src/libbsc/bsc_ctrl_lookup.c rename to src/libbsc/bsc_ctrl_lookup.c diff --git a/openbsc/src/libbsc/bsc_dyn_ts.c b/src/libbsc/bsc_dyn_ts.c similarity index 100% rename from openbsc/src/libbsc/bsc_dyn_ts.c rename to src/libbsc/bsc_dyn_ts.c diff --git a/openbsc/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c similarity index 100% rename from openbsc/src/libbsc/bsc_init.c rename to src/libbsc/bsc_init.c diff --git a/openbsc/src/libbsc/bsc_msc.c b/src/libbsc/bsc_msc.c similarity index 100% rename from openbsc/src/libbsc/bsc_msc.c rename to src/libbsc/bsc_msc.c diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c similarity index 100% rename from openbsc/src/libbsc/bsc_rf_ctrl.c rename to src/libbsc/bsc_rf_ctrl.c diff --git a/openbsc/src/libbsc/bsc_rll.c b/src/libbsc/bsc_rll.c similarity index 100% rename from openbsc/src/libbsc/bsc_rll.c rename to src/libbsc/bsc_rll.c diff --git a/openbsc/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c similarity index 100% rename from openbsc/src/libbsc/bsc_subscriber.c rename to src/libbsc/bsc_subscriber.c diff --git a/openbsc/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c similarity index 100% rename from openbsc/src/libbsc/bsc_vty.c rename to src/libbsc/bsc_vty.c diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/src/libbsc/bts_ericsson_rbs2000.c similarity index 100% rename from openbsc/src/libbsc/bts_ericsson_rbs2000.c rename to src/libbsc/bts_ericsson_rbs2000.c diff --git a/openbsc/src/libbsc/bts_init.c b/src/libbsc/bts_init.c similarity index 100% rename from openbsc/src/libbsc/bts_init.c rename to src/libbsc/bts_init.c diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c similarity index 100% rename from openbsc/src/libbsc/bts_ipaccess_nanobts.c rename to src/libbsc/bts_ipaccess_nanobts.c diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/src/libbsc/bts_ipaccess_nanobts_omlattr.c similarity index 100% rename from openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c rename to src/libbsc/bts_ipaccess_nanobts_omlattr.c diff --git a/openbsc/src/libbsc/bts_nokia_site.c b/src/libbsc/bts_nokia_site.c similarity index 100% rename from openbsc/src/libbsc/bts_nokia_site.c rename to src/libbsc/bts_nokia_site.c diff --git a/openbsc/src/libbsc/bts_siemens_bs11.c b/src/libbsc/bts_siemens_bs11.c similarity index 100% rename from openbsc/src/libbsc/bts_siemens_bs11.c rename to src/libbsc/bts_siemens_bs11.c diff --git a/openbsc/src/libbsc/bts_sysmobts.c b/src/libbsc/bts_sysmobts.c similarity index 100% rename from openbsc/src/libbsc/bts_sysmobts.c rename to src/libbsc/bts_sysmobts.c diff --git a/openbsc/src/libbsc/bts_unknown.c b/src/libbsc/bts_unknown.c similarity index 100% rename from openbsc/src/libbsc/bts_unknown.c rename to src/libbsc/bts_unknown.c diff --git a/openbsc/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c similarity index 100% rename from openbsc/src/libbsc/chan_alloc.c rename to src/libbsc/chan_alloc.c diff --git a/openbsc/src/libbsc/e1_config.c b/src/libbsc/e1_config.c similarity index 100% rename from openbsc/src/libbsc/e1_config.c rename to src/libbsc/e1_config.c diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c similarity index 100% rename from openbsc/src/libbsc/gsm_04_08_utils.c rename to src/libbsc/gsm_04_08_utils.c diff --git a/openbsc/src/libbsc/gsm_04_80_utils.c b/src/libbsc/gsm_04_80_utils.c similarity index 100% rename from openbsc/src/libbsc/gsm_04_80_utils.c rename to src/libbsc/gsm_04_80_utils.c diff --git a/openbsc/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c similarity index 100% rename from openbsc/src/libbsc/handover_decision.c rename to src/libbsc/handover_decision.c diff --git a/openbsc/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c similarity index 100% rename from openbsc/src/libbsc/handover_logic.c rename to src/libbsc/handover_logic.c diff --git a/openbsc/src/libbsc/meas_proc.c b/src/libbsc/meas_proc.c similarity index 100% rename from openbsc/src/libbsc/meas_proc.c rename to src/libbsc/meas_proc.c diff --git a/openbsc/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c similarity index 100% rename from openbsc/src/libbsc/meas_rep.c rename to src/libbsc/meas_rep.c diff --git a/openbsc/src/libbsc/net_init.c b/src/libbsc/net_init.c similarity index 100% rename from openbsc/src/libbsc/net_init.c rename to src/libbsc/net_init.c diff --git a/openbsc/src/libbsc/paging.c b/src/libbsc/paging.c similarity index 100% rename from openbsc/src/libbsc/paging.c rename to src/libbsc/paging.c diff --git a/openbsc/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c similarity index 100% rename from openbsc/src/libbsc/pcu_sock.c rename to src/libbsc/pcu_sock.c diff --git a/openbsc/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c similarity index 100% rename from openbsc/src/libbsc/rest_octets.c rename to src/libbsc/rest_octets.c diff --git a/openbsc/src/libbsc/system_information.c b/src/libbsc/system_information.c similarity index 100% rename from openbsc/src/libbsc/system_information.c rename to src/libbsc/system_information.c diff --git a/openbsc/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am similarity index 100% rename from openbsc/src/libcommon-cs/Makefile.am rename to src/libcommon-cs/Makefile.am diff --git a/openbsc/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c similarity index 100% rename from openbsc/src/libcommon-cs/common_cs.c rename to src/libcommon-cs/common_cs.c diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c similarity index 100% rename from openbsc/src/libcommon-cs/common_cs_vty.c rename to src/libcommon-cs/common_cs_vty.c diff --git a/openbsc/src/libcommon/Makefile.am b/src/libcommon/Makefile.am similarity index 100% rename from openbsc/src/libcommon/Makefile.am rename to src/libcommon/Makefile.am diff --git a/openbsc/src/libcommon/bsc_version.c b/src/libcommon/bsc_version.c similarity index 100% rename from openbsc/src/libcommon/bsc_version.c rename to src/libcommon/bsc_version.c diff --git a/openbsc/src/libcommon/common_vty.c b/src/libcommon/common_vty.c similarity index 100% rename from openbsc/src/libcommon/common_vty.c rename to src/libcommon/common_vty.c diff --git a/openbsc/src/libcommon/debug.c b/src/libcommon/debug.c similarity index 100% rename from openbsc/src/libcommon/debug.c rename to src/libcommon/debug.c diff --git a/openbsc/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c similarity index 100% rename from openbsc/src/libcommon/gsm_data.c rename to src/libcommon/gsm_data.c diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c similarity index 100% rename from openbsc/src/libcommon/gsm_data_shared.c rename to src/libcommon/gsm_data_shared.c diff --git a/openbsc/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c similarity index 100% rename from openbsc/src/libcommon/gsm_subscriber_base.c rename to src/libcommon/gsm_subscriber_base.c diff --git a/openbsc/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c similarity index 100% rename from openbsc/src/libcommon/gsup_client.c rename to src/libcommon/gsup_client.c diff --git a/openbsc/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c similarity index 100% rename from openbsc/src/libcommon/gsup_test_client.c rename to src/libcommon/gsup_test_client.c diff --git a/openbsc/src/libcommon/oap_client.c b/src/libcommon/oap_client.c similarity index 100% rename from openbsc/src/libcommon/oap_client.c rename to src/libcommon/oap_client.c diff --git a/openbsc/src/libcommon/socket.c b/src/libcommon/socket.c similarity index 100% rename from openbsc/src/libcommon/socket.c rename to src/libcommon/socket.c diff --git a/openbsc/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c similarity index 100% rename from openbsc/src/libcommon/talloc_ctx.c rename to src/libcommon/talloc_ctx.c diff --git a/openbsc/src/libfilter/Makefile.am b/src/libfilter/Makefile.am similarity index 100% rename from openbsc/src/libfilter/Makefile.am rename to src/libfilter/Makefile.am diff --git a/openbsc/src/libfilter/bsc_msg_acc.c b/src/libfilter/bsc_msg_acc.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_acc.c rename to src/libfilter/bsc_msg_acc.c diff --git a/openbsc/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_filter.c rename to src/libfilter/bsc_msg_filter.c diff --git a/openbsc/src/libfilter/bsc_msg_vty.c b/src/libfilter/bsc_msg_vty.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_vty.c rename to src/libfilter/bsc_msg_vty.c diff --git a/openbsc/src/libiu/Makefile.am b/src/libiu/Makefile.am similarity index 100% rename from openbsc/src/libiu/Makefile.am rename to src/libiu/Makefile.am diff --git a/openbsc/src/libiu/iu.c b/src/libiu/iu.c similarity index 100% rename from openbsc/src/libiu/iu.c rename to src/libiu/iu.c diff --git a/openbsc/src/libiu/iu_vty.c b/src/libiu/iu_vty.c similarity index 100% rename from openbsc/src/libiu/iu_vty.c rename to src/libiu/iu_vty.c diff --git a/openbsc/src/libmgcp/Makefile.am b/src/libmgcp/Makefile.am similarity index 100% rename from openbsc/src/libmgcp/Makefile.am rename to src/libmgcp/Makefile.am diff --git a/openbsc/src/libmgcp/g711common.h b/src/libmgcp/g711common.h similarity index 100% rename from openbsc/src/libmgcp/g711common.h rename to src/libmgcp/g711common.h diff --git a/openbsc/src/libmgcp/mgcp_network.c b/src/libmgcp/mgcp_network.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_network.c rename to src/libmgcp/mgcp_network.c diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/src/libmgcp/mgcp_osmux.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_osmux.c rename to src/libmgcp/mgcp_osmux.c diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/src/libmgcp/mgcp_protocol.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_protocol.c rename to src/libmgcp/mgcp_protocol.c diff --git a/openbsc/src/libmgcp/mgcp_sdp.c b/src/libmgcp/mgcp_sdp.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_sdp.c rename to src/libmgcp/mgcp_sdp.c diff --git a/openbsc/src/libmgcp/mgcp_transcode.c b/src/libmgcp/mgcp_transcode.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_transcode.c rename to src/libmgcp/mgcp_transcode.c diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/src/libmgcp/mgcp_vty.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_vty.c rename to src/libmgcp/mgcp_vty.c diff --git a/openbsc/src/libmsc/Makefile.am b/src/libmsc/Makefile.am similarity index 100% rename from openbsc/src/libmsc/Makefile.am rename to src/libmsc/Makefile.am diff --git a/openbsc/src/libmsc/auth.c b/src/libmsc/auth.c similarity index 100% rename from openbsc/src/libmsc/auth.c rename to src/libmsc/auth.c diff --git a/openbsc/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c similarity index 100% rename from openbsc/src/libmsc/ctrl_commands.c rename to src/libmsc/ctrl_commands.c diff --git a/openbsc/src/libmsc/db.c b/src/libmsc/db.c similarity index 100% rename from openbsc/src/libmsc/db.c rename to src/libmsc/db.c diff --git a/openbsc/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_08.c rename to src/libmsc/gsm_04_08.c diff --git a/openbsc/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_11.c rename to src/libmsc/gsm_04_11.c diff --git a/openbsc/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_80.c rename to src/libmsc/gsm_04_80.c diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c similarity index 100% rename from openbsc/src/libmsc/gsm_subscriber.c rename to src/libmsc/gsm_subscriber.c diff --git a/openbsc/src/libmsc/meas_feed.c b/src/libmsc/meas_feed.c similarity index 100% rename from openbsc/src/libmsc/meas_feed.c rename to src/libmsc/meas_feed.c diff --git a/openbsc/src/libmsc/meas_feed.h b/src/libmsc/meas_feed.h similarity index 100% rename from openbsc/src/libmsc/meas_feed.h rename to src/libmsc/meas_feed.h diff --git a/openbsc/src/libmsc/mncc.c b/src/libmsc/mncc.c similarity index 100% rename from openbsc/src/libmsc/mncc.c rename to src/libmsc/mncc.c diff --git a/openbsc/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c similarity index 100% rename from openbsc/src/libmsc/mncc_builtin.c rename to src/libmsc/mncc_builtin.c diff --git a/openbsc/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c similarity index 100% rename from openbsc/src/libmsc/mncc_sock.c rename to src/libmsc/mncc_sock.c diff --git a/openbsc/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c similarity index 100% rename from openbsc/src/libmsc/osmo_msc.c rename to src/libmsc/osmo_msc.c diff --git a/openbsc/src/libmsc/rrlp.c b/src/libmsc/rrlp.c similarity index 100% rename from openbsc/src/libmsc/rrlp.c rename to src/libmsc/rrlp.c diff --git a/openbsc/src/libmsc/silent_call.c b/src/libmsc/silent_call.c similarity index 100% rename from openbsc/src/libmsc/silent_call.c rename to src/libmsc/silent_call.c diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c similarity index 100% rename from openbsc/src/libmsc/smpp_openbsc.c rename to src/libmsc/smpp_openbsc.c diff --git a/openbsc/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c similarity index 100% rename from openbsc/src/libmsc/smpp_smsc.c rename to src/libmsc/smpp_smsc.c diff --git a/openbsc/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h similarity index 100% rename from openbsc/src/libmsc/smpp_smsc.h rename to src/libmsc/smpp_smsc.h diff --git a/openbsc/src/libmsc/smpp_utils.c b/src/libmsc/smpp_utils.c similarity index 100% rename from openbsc/src/libmsc/smpp_utils.c rename to src/libmsc/smpp_utils.c diff --git a/openbsc/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c similarity index 100% rename from openbsc/src/libmsc/smpp_vty.c rename to src/libmsc/smpp_vty.c diff --git a/openbsc/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c similarity index 100% rename from openbsc/src/libmsc/sms_queue.c rename to src/libmsc/sms_queue.c diff --git a/openbsc/src/libmsc/token_auth.c b/src/libmsc/token_auth.c similarity index 100% rename from openbsc/src/libmsc/token_auth.c rename to src/libmsc/token_auth.c diff --git a/openbsc/src/libmsc/transaction.c b/src/libmsc/transaction.c similarity index 100% rename from openbsc/src/libmsc/transaction.c rename to src/libmsc/transaction.c diff --git a/openbsc/src/libmsc/ussd.c b/src/libmsc/ussd.c similarity index 100% rename from openbsc/src/libmsc/ussd.c rename to src/libmsc/ussd.c diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c similarity index 100% rename from openbsc/src/libmsc/vty_interface_layer3.c rename to src/libmsc/vty_interface_layer3.c diff --git a/openbsc/src/libtrau/Makefile.am b/src/libtrau/Makefile.am similarity index 100% rename from openbsc/src/libtrau/Makefile.am rename to src/libtrau/Makefile.am diff --git a/openbsc/src/libtrau/rtp_proxy.c b/src/libtrau/rtp_proxy.c similarity index 100% rename from openbsc/src/libtrau/rtp_proxy.c rename to src/libtrau/rtp_proxy.c diff --git a/openbsc/src/libtrau/trau_mux.c b/src/libtrau/trau_mux.c similarity index 100% rename from openbsc/src/libtrau/trau_mux.c rename to src/libtrau/trau_mux.c diff --git a/openbsc/src/libtrau/trau_upqueue.c b/src/libtrau/trau_upqueue.c similarity index 100% rename from openbsc/src/libtrau/trau_upqueue.c rename to src/libtrau/trau_upqueue.c diff --git a/openbsc/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc/Makefile.am rename to src/osmo-bsc/Makefile.am diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_api.c rename to src/osmo-bsc/osmo_bsc_api.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_audio.c rename to src/osmo-bsc/osmo_bsc_audio.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_bssap.c rename to src/osmo-bsc/osmo_bsc_bssap.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_ctrl.c rename to src/osmo-bsc/osmo_bsc_ctrl.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_filter.c rename to src/osmo-bsc/osmo_bsc_filter.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_grace.c rename to src/osmo-bsc/osmo_bsc_grace.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_main.c rename to src/osmo-bsc/osmo_bsc_main.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_msc.c rename to src/osmo-bsc/osmo_bsc_msc.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/src/osmo-bsc/osmo_bsc_sccp.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_sccp.c rename to src/osmo-bsc/osmo_bsc_sccp.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_vty.c rename to src/osmo-bsc/osmo_bsc_vty.c diff --git a/openbsc/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc_mgcp/Makefile.am rename to src/osmo-bsc_mgcp/Makefile.am diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c similarity index 100% rename from openbsc/src/osmo-bsc_mgcp/mgcp_main.c rename to src/osmo-bsc_mgcp/mgcp_main.c diff --git a/openbsc/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc_nat/Makefile.am rename to src/osmo-bsc_nat/Makefile.am diff --git a/openbsc/src/osmo-bsc_nat/bsc_filter.c b/src/osmo-bsc_nat/bsc_filter.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_filter.c rename to src/osmo-bsc_nat/bsc_filter.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c rename to src/osmo-bsc_nat/bsc_mgcp_utils.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat.c rename to src/osmo-bsc_nat/bsc_nat.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/src/osmo-bsc_nat/bsc_nat_ctrl.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c rename to src/osmo-bsc_nat/bsc_nat_ctrl.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c b/src/osmo-bsc_nat/bsc_nat_filter.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_filter.c rename to src/osmo-bsc_nat/bsc_nat_filter.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c b/src/osmo-bsc_nat/bsc_nat_rewrite.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c rename to src/osmo-bsc_nat/bsc_nat_rewrite.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c rename to src/osmo-bsc_nat/bsc_nat_rewrite_trie.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/src/osmo-bsc_nat/bsc_nat_utils.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_utils.c rename to src/osmo-bsc_nat/bsc_nat_utils.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/src/osmo-bsc_nat/bsc_nat_vty.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_vty.c rename to src/osmo-bsc_nat/bsc_nat_vty.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_sccp.c b/src/osmo-bsc_nat/bsc_sccp.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_sccp.c rename to src/osmo-bsc_nat/bsc_sccp.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/src/osmo-bsc_nat/bsc_ussd.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_ussd.c rename to src/osmo-bsc_nat/bsc_ussd.c diff --git a/openbsc/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am similarity index 100% rename from openbsc/src/osmo-nitb/Makefile.am rename to src/osmo-nitb/Makefile.am diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/src/osmo-nitb/bsc_hack.c similarity index 100% rename from openbsc/src/osmo-nitb/bsc_hack.c rename to src/osmo-nitb/bsc_hack.c diff --git a/openbsc/src/utils/Makefile.am b/src/utils/Makefile.am similarity index 100% rename from openbsc/src/utils/Makefile.am rename to src/utils/Makefile.am diff --git a/openbsc/src/utils/bs11_config.c b/src/utils/bs11_config.c similarity index 100% rename from openbsc/src/utils/bs11_config.c rename to src/utils/bs11_config.c diff --git a/openbsc/src/utils/isdnsync.c b/src/utils/isdnsync.c similarity index 100% rename from openbsc/src/utils/isdnsync.c rename to src/utils/isdnsync.c diff --git a/openbsc/src/utils/meas_db.c b/src/utils/meas_db.c similarity index 100% rename from openbsc/src/utils/meas_db.c rename to src/utils/meas_db.c diff --git a/openbsc/src/utils/meas_db.h b/src/utils/meas_db.h similarity index 100% rename from openbsc/src/utils/meas_db.h rename to src/utils/meas_db.h diff --git a/openbsc/src/utils/meas_json.c b/src/utils/meas_json.c similarity index 100% rename from openbsc/src/utils/meas_json.c rename to src/utils/meas_json.c diff --git a/openbsc/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c similarity index 100% rename from openbsc/src/utils/meas_pcap2db.c rename to src/utils/meas_pcap2db.c diff --git a/openbsc/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c similarity index 100% rename from openbsc/src/utils/meas_udp2db.c rename to src/utils/meas_udp2db.c diff --git a/openbsc/src/utils/meas_vis.c b/src/utils/meas_vis.c similarity index 100% rename from openbsc/src/utils/meas_vis.c rename to src/utils/meas_vis.c diff --git a/openbsc/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c similarity index 100% rename from openbsc/src/utils/smpp_mirror.c rename to src/utils/smpp_mirror.c diff --git a/openbsc/tests/Makefile.am b/tests/Makefile.am similarity index 100% rename from openbsc/tests/Makefile.am rename to tests/Makefile.am diff --git a/openbsc/tests/abis/Makefile.am b/tests/abis/Makefile.am similarity index 100% rename from openbsc/tests/abis/Makefile.am rename to tests/abis/Makefile.am diff --git a/openbsc/tests/abis/abis_test.c b/tests/abis/abis_test.c similarity index 100% rename from openbsc/tests/abis/abis_test.c rename to tests/abis/abis_test.c diff --git a/openbsc/tests/abis/abis_test.ok b/tests/abis/abis_test.ok similarity index 100% rename from openbsc/tests/abis/abis_test.ok rename to tests/abis/abis_test.ok diff --git a/openbsc/tests/atlocal.in b/tests/atlocal.in similarity index 100% rename from openbsc/tests/atlocal.in rename to tests/atlocal.in diff --git a/openbsc/tests/bsc-nat-trie/Makefile.am b/tests/bsc-nat-trie/Makefile.am similarity index 100% rename from openbsc/tests/bsc-nat-trie/Makefile.am rename to tests/bsc-nat-trie/Makefile.am diff --git a/openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.c b/tests/bsc-nat-trie/bsc_nat_trie_test.c similarity index 100% rename from openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.c rename to tests/bsc-nat-trie/bsc_nat_trie_test.c diff --git a/openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.ok b/tests/bsc-nat-trie/bsc_nat_trie_test.ok similarity index 100% rename from openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.ok rename to tests/bsc-nat-trie/bsc_nat_trie_test.ok diff --git a/openbsc/tests/bsc-nat-trie/prefixes.csv b/tests/bsc-nat-trie/prefixes.csv similarity index 100% rename from openbsc/tests/bsc-nat-trie/prefixes.csv rename to tests/bsc-nat-trie/prefixes.csv diff --git a/openbsc/tests/bsc-nat/Makefile.am b/tests/bsc-nat/Makefile.am similarity index 100% rename from openbsc/tests/bsc-nat/Makefile.am rename to tests/bsc-nat/Makefile.am diff --git a/openbsc/tests/bsc-nat/barr.cfg b/tests/bsc-nat/barr.cfg similarity index 100% rename from openbsc/tests/bsc-nat/barr.cfg rename to tests/bsc-nat/barr.cfg diff --git a/openbsc/tests/bsc-nat/barr_dup.cfg b/tests/bsc-nat/barr_dup.cfg similarity index 100% rename from openbsc/tests/bsc-nat/barr_dup.cfg rename to tests/bsc-nat/barr_dup.cfg diff --git a/openbsc/tests/bsc-nat/bsc_data.c b/tests/bsc-nat/bsc_data.c similarity index 100% rename from openbsc/tests/bsc-nat/bsc_data.c rename to tests/bsc-nat/bsc_data.c diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/tests/bsc-nat/bsc_nat_test.c similarity index 100% rename from openbsc/tests/bsc-nat/bsc_nat_test.c rename to tests/bsc-nat/bsc_nat_test.c diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.ok b/tests/bsc-nat/bsc_nat_test.ok similarity index 100% rename from openbsc/tests/bsc-nat/bsc_nat_test.ok rename to tests/bsc-nat/bsc_nat_test.ok diff --git a/openbsc/tests/bsc-nat/prefixes.csv b/tests/bsc-nat/prefixes.csv similarity index 100% rename from openbsc/tests/bsc-nat/prefixes.csv rename to tests/bsc-nat/prefixes.csv diff --git a/openbsc/tests/bsc/Makefile.am b/tests/bsc/Makefile.am similarity index 100% rename from openbsc/tests/bsc/Makefile.am rename to tests/bsc/Makefile.am diff --git a/openbsc/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c similarity index 100% rename from openbsc/tests/bsc/bsc_test.c rename to tests/bsc/bsc_test.c diff --git a/openbsc/tests/bsc/bsc_test.ok b/tests/bsc/bsc_test.ok similarity index 100% rename from openbsc/tests/bsc/bsc_test.ok rename to tests/bsc/bsc_test.ok diff --git a/openbsc/tests/channel/Makefile.am b/tests/channel/Makefile.am similarity index 100% rename from openbsc/tests/channel/Makefile.am rename to tests/channel/Makefile.am diff --git a/openbsc/tests/channel/channel_test.c b/tests/channel/channel_test.c similarity index 100% rename from openbsc/tests/channel/channel_test.c rename to tests/channel/channel_test.c diff --git a/openbsc/tests/channel/channel_test.ok b/tests/channel/channel_test.ok similarity index 100% rename from openbsc/tests/channel/channel_test.ok rename to tests/channel/channel_test.ok diff --git a/openbsc/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py similarity index 100% rename from openbsc/tests/ctrl_test_runner.py rename to tests/ctrl_test_runner.py diff --git a/openbsc/tests/db/Makefile.am b/tests/db/Makefile.am similarity index 100% rename from openbsc/tests/db/Makefile.am rename to tests/db/Makefile.am diff --git a/openbsc/tests/db/db_test.c b/tests/db/db_test.c similarity index 100% rename from openbsc/tests/db/db_test.c rename to tests/db/db_test.c diff --git a/openbsc/tests/db/db_test.err b/tests/db/db_test.err similarity index 100% rename from openbsc/tests/db/db_test.err rename to tests/db/db_test.err diff --git a/openbsc/tests/db/db_test.ok b/tests/db/db_test.ok similarity index 100% rename from openbsc/tests/db/db_test.ok rename to tests/db/db_test.ok diff --git a/openbsc/tests/db/hlr.sqlite3 b/tests/db/hlr.sqlite3 similarity index 100% rename from openbsc/tests/db/hlr.sqlite3 rename to tests/db/hlr.sqlite3 Binary files differ diff --git a/openbsc/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am similarity index 100% rename from openbsc/tests/gbproxy/Makefile.am rename to tests/gbproxy/Makefile.am diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c similarity index 100% rename from openbsc/tests/gbproxy/gbproxy_test.c rename to tests/gbproxy/gbproxy_test.c diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/tests/gbproxy/gbproxy_test.ok similarity index 100% rename from openbsc/tests/gbproxy/gbproxy_test.ok rename to tests/gbproxy/gbproxy_test.ok diff --git a/openbsc/tests/gprs/Makefile.am b/tests/gprs/Makefile.am similarity index 100% rename from openbsc/tests/gprs/Makefile.am rename to tests/gprs/Makefile.am diff --git a/openbsc/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c similarity index 100% rename from openbsc/tests/gprs/gprs_test.c rename to tests/gprs/gprs_test.c diff --git a/openbsc/tests/gprs/gprs_test.ok b/tests/gprs/gprs_test.ok similarity index 100% rename from openbsc/tests/gprs/gprs_test.ok rename to tests/gprs/gprs_test.ok diff --git a/openbsc/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am similarity index 100% rename from openbsc/tests/gsm0408/Makefile.am rename to tests/gsm0408/Makefile.am diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c similarity index 100% rename from openbsc/tests/gsm0408/gsm0408_test.c rename to tests/gsm0408/gsm0408_test.c diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok similarity index 100% rename from openbsc/tests/gsm0408/gsm0408_test.ok rename to tests/gsm0408/gsm0408_test.ok diff --git a/openbsc/tests/gtphub/Makefile.am b/tests/gtphub/Makefile.am similarity index 100% rename from openbsc/tests/gtphub/Makefile.am rename to tests/gtphub/Makefile.am diff --git a/openbsc/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c similarity index 100% rename from openbsc/tests/gtphub/gtphub_test.c rename to tests/gtphub/gtphub_test.c diff --git a/openbsc/tests/gtphub/gtphub_test.ok b/tests/gtphub/gtphub_test.ok similarity index 100% rename from openbsc/tests/gtphub/gtphub_test.ok rename to tests/gtphub/gtphub_test.ok diff --git a/openbsc/tests/mgcp/Makefile.am b/tests/mgcp/Makefile.am similarity index 100% rename from openbsc/tests/mgcp/Makefile.am rename to tests/mgcp/Makefile.am diff --git a/openbsc/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c similarity index 100% rename from openbsc/tests/mgcp/mgcp_test.c rename to tests/mgcp/mgcp_test.c diff --git a/openbsc/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok similarity index 100% rename from openbsc/tests/mgcp/mgcp_test.ok rename to tests/mgcp/mgcp_test.ok diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/tests/mgcp/mgcp_transcoding_test.c similarity index 100% rename from openbsc/tests/mgcp/mgcp_transcoding_test.c rename to tests/mgcp/mgcp_transcoding_test.c diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.ok b/tests/mgcp/mgcp_transcoding_test.ok similarity index 100% rename from openbsc/tests/mgcp/mgcp_transcoding_test.ok rename to tests/mgcp/mgcp_transcoding_test.ok diff --git a/openbsc/tests/mm_auth/Makefile.am b/tests/mm_auth/Makefile.am similarity index 100% rename from openbsc/tests/mm_auth/Makefile.am rename to tests/mm_auth/Makefile.am diff --git a/openbsc/tests/mm_auth/mm_auth_test.c b/tests/mm_auth/mm_auth_test.c similarity index 100% rename from openbsc/tests/mm_auth/mm_auth_test.c rename to tests/mm_auth/mm_auth_test.c diff --git a/openbsc/tests/mm_auth/mm_auth_test.ok b/tests/mm_auth/mm_auth_test.ok similarity index 100% rename from openbsc/tests/mm_auth/mm_auth_test.ok rename to tests/mm_auth/mm_auth_test.ok diff --git a/openbsc/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am similarity index 100% rename from openbsc/tests/nanobts_omlattr/Makefile.am rename to tests/nanobts_omlattr/Makefile.am diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c similarity index 100% rename from openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c rename to tests/nanobts_omlattr/nanobts_omlattr_test.c diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/tests/nanobts_omlattr/nanobts_omlattr_test.ok similarity index 100% rename from openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok rename to tests/nanobts_omlattr/nanobts_omlattr_test.ok diff --git a/openbsc/tests/oap/Makefile.am b/tests/oap/Makefile.am similarity index 100% rename from openbsc/tests/oap/Makefile.am rename to tests/oap/Makefile.am diff --git a/openbsc/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c similarity index 100% rename from openbsc/tests/oap/oap_client_test.c rename to tests/oap/oap_client_test.c diff --git a/openbsc/tests/oap/oap_client_test.err b/tests/oap/oap_client_test.err similarity index 100% rename from openbsc/tests/oap/oap_client_test.err rename to tests/oap/oap_client_test.err diff --git a/openbsc/tests/oap/oap_client_test.ok b/tests/oap/oap_client_test.ok similarity index 100% rename from openbsc/tests/oap/oap_client_test.ok rename to tests/oap/oap_client_test.ok diff --git a/openbsc/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am similarity index 100% rename from openbsc/tests/sgsn/Makefile.am rename to tests/sgsn/Makefile.am diff --git a/openbsc/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c similarity index 100% rename from openbsc/tests/sgsn/sgsn_test.c rename to tests/sgsn/sgsn_test.c diff --git a/openbsc/tests/sgsn/sgsn_test.ok b/tests/sgsn/sgsn_test.ok similarity index 100% rename from openbsc/tests/sgsn/sgsn_test.ok rename to tests/sgsn/sgsn_test.ok diff --git a/openbsc/tests/slhc/Makefile.am b/tests/slhc/Makefile.am similarity index 100% rename from openbsc/tests/slhc/Makefile.am rename to tests/slhc/Makefile.am diff --git a/openbsc/tests/slhc/slhc_test.c b/tests/slhc/slhc_test.c similarity index 100% rename from openbsc/tests/slhc/slhc_test.c rename to tests/slhc/slhc_test.c diff --git a/openbsc/tests/slhc/slhc_test.ok b/tests/slhc/slhc_test.ok similarity index 100% rename from openbsc/tests/slhc/slhc_test.ok rename to tests/slhc/slhc_test.ok diff --git a/openbsc/tests/smpp/Makefile.am b/tests/smpp/Makefile.am similarity index 100% rename from openbsc/tests/smpp/Makefile.am rename to tests/smpp/Makefile.am diff --git a/openbsc/tests/smpp/smpp_test.c b/tests/smpp/smpp_test.c similarity index 100% rename from openbsc/tests/smpp/smpp_test.c rename to tests/smpp/smpp_test.c diff --git a/openbsc/tests/smpp/smpp_test.err b/tests/smpp/smpp_test.err similarity index 100% rename from openbsc/tests/smpp/smpp_test.err rename to tests/smpp/smpp_test.err diff --git a/openbsc/tests/smpp/smpp_test.ok b/tests/smpp/smpp_test.ok similarity index 100% rename from openbsc/tests/smpp/smpp_test.ok rename to tests/smpp/smpp_test.ok diff --git a/openbsc/tests/smpp_test_runner.py b/tests/smpp_test_runner.py similarity index 100% rename from openbsc/tests/smpp_test_runner.py rename to tests/smpp_test_runner.py diff --git a/openbsc/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am similarity index 100% rename from openbsc/tests/sndcp_xid/Makefile.am rename to tests/sndcp_xid/Makefile.am diff --git a/openbsc/tests/sndcp_xid/sndcp_xid_test.c b/tests/sndcp_xid/sndcp_xid_test.c similarity index 100% rename from openbsc/tests/sndcp_xid/sndcp_xid_test.c rename to tests/sndcp_xid/sndcp_xid_test.c diff --git a/openbsc/tests/sndcp_xid/sndcp_xid_test.ok b/tests/sndcp_xid/sndcp_xid_test.ok similarity index 100% rename from openbsc/tests/sndcp_xid/sndcp_xid_test.ok rename to tests/sndcp_xid/sndcp_xid_test.ok diff --git a/openbsc/tests/subscr/Makefile.am b/tests/subscr/Makefile.am similarity index 100% rename from openbsc/tests/subscr/Makefile.am rename to tests/subscr/Makefile.am diff --git a/openbsc/tests/subscr/bsc_subscr_test.c b/tests/subscr/bsc_subscr_test.c similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.c rename to tests/subscr/bsc_subscr_test.c diff --git a/openbsc/tests/subscr/bsc_subscr_test.err b/tests/subscr/bsc_subscr_test.err similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.err rename to tests/subscr/bsc_subscr_test.err diff --git a/openbsc/tests/subscr/bsc_subscr_test.ok b/tests/subscr/bsc_subscr_test.ok similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.ok rename to tests/subscr/bsc_subscr_test.ok diff --git a/openbsc/tests/subscr/subscr_test.c b/tests/subscr/subscr_test.c similarity index 100% rename from openbsc/tests/subscr/subscr_test.c rename to tests/subscr/subscr_test.c diff --git a/openbsc/tests/subscr/subscr_test.ok b/tests/subscr/subscr_test.ok similarity index 100% rename from openbsc/tests/subscr/subscr_test.ok rename to tests/subscr/subscr_test.ok diff --git a/openbsc/tests/testsuite.at b/tests/testsuite.at similarity index 100% rename from openbsc/tests/testsuite.at rename to tests/testsuite.at diff --git a/openbsc/tests/trau/Makefile.am b/tests/trau/Makefile.am similarity index 100% rename from openbsc/tests/trau/Makefile.am rename to tests/trau/Makefile.am diff --git a/openbsc/tests/trau/trau_test.c b/tests/trau/trau_test.c similarity index 100% rename from openbsc/tests/trau/trau_test.c rename to tests/trau/trau_test.c diff --git a/openbsc/tests/trau/trau_test.ok b/tests/trau/trau_test.ok similarity index 100% rename from openbsc/tests/trau/trau_test.ok rename to tests/trau/trau_test.ok diff --git a/openbsc/tests/v42bis/Makefile.am b/tests/v42bis/Makefile.am similarity index 100% rename from openbsc/tests/v42bis/Makefile.am rename to tests/v42bis/Makefile.am diff --git a/openbsc/tests/v42bis/v42bis_test.c b/tests/v42bis/v42bis_test.c similarity index 100% rename from openbsc/tests/v42bis/v42bis_test.c rename to tests/v42bis/v42bis_test.c diff --git a/openbsc/tests/v42bis/v42bis_test.ok b/tests/v42bis/v42bis_test.ok similarity index 100% rename from openbsc/tests/v42bis/v42bis_test.ok rename to tests/v42bis/v42bis_test.ok diff --git a/openbsc/tests/vty_test_runner.py b/tests/vty_test_runner.py similarity index 100% rename from openbsc/tests/vty_test_runner.py rename to tests/vty_test_runner.py diff --git a/openbsc/tests/xid/Makefile.am b/tests/xid/Makefile.am similarity index 100% rename from openbsc/tests/xid/Makefile.am rename to tests/xid/Makefile.am diff --git a/openbsc/tests/xid/xid_test.c b/tests/xid/xid_test.c similarity index 100% rename from openbsc/tests/xid/xid_test.c rename to tests/xid/xid_test.c diff --git a/openbsc/tests/xid/xid_test.ok b/tests/xid/xid_test.ok similarity index 100% rename from openbsc/tests/xid/xid_test.ok rename to tests/xid/xid_test.ok diff --git a/openbsc/tools/hlrstat.pl b/tools/hlrstat.pl similarity index 100% rename from openbsc/tools/hlrstat.pl rename to tools/hlrstat.pl -- To view, visit https://gerrit.osmocom.org/3188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 12 23:21:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 12 Jul 2017 23:21:58 +0000 Subject: osmo-msc[master]: move openbsc/* to repos root In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3188/3//COMMIT_MSG Commit Message: Line 10: (trivial edit because jenkins refused to retrigger an aborted build for this patch. very annoying.) -- To view, visit https://gerrit.osmocom.org/3188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 13 02:20:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 02:20:40 +0000 Subject: [PATCH] osmo-msc[master]: Add libvlr implementation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3194 to look at the new patch set (#4). Add libvlr implementation Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 --- M configure.ac M include/openbsc/Makefile.am A include/openbsc/vlr.h M src/Makefile.am A src/libmsc/subscr_conn.c A src/libvlr/Makefile.am A src/libvlr/vlr.c A src/libvlr/vlr_access_req_fsm.c A src/libvlr/vlr_access_req_fsm.h A src/libvlr/vlr_auth_fsm.c A src/libvlr/vlr_auth_fsm.h A src/libvlr/vlr_core.h A src/libvlr/vlr_lu_fsm.c A src/libvlr/vlr_lu_fsm.h M src/osmo-nitb/Makefile.am A tests/vlr/Makefile.am A tests/vlr/vlr_test.c 17 files changed, 5,439 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/3194/4 diff --git a/configure.ac b/configure.ac index ff51ccf..3089a2e 100644 --- a/configure.ac +++ b/configure.ac @@ -225,6 +225,7 @@ src/libtrau/Makefile src/libbsc/Makefile src/libmsc/Makefile + src/libvlr/Makefile src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile @@ -261,6 +262,7 @@ tests/slhc/Makefile tests/v42bis/Makefile tests/nanobts_omlattr/Makefile + tests/vlr/Makefile doc/Makefile doc/examples/Makefile Makefile) diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 2740a5d..532328c 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -84,6 +84,7 @@ trau_mux.h \ trau_upqueue.h \ ussd.h \ + vlr.h \ vty.h \ v42bis.h \ v42bis_private.h \ diff --git a/include/openbsc/vlr.h b/include/openbsc/vlr.h new file mode 100644 index 0000000..d7e8f19 --- /dev/null +++ b/include/openbsc/vlr.h @@ -0,0 +1,409 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +// for GSM_NAME_LENGTH +#include + +/* from 3s to 10s */ +#define GSM_29002_TIMER_S 10 +/* from 15s to 30s */ +#define GSM_29002_TIMER_M 30 +/* from 1min to 10min */ +#define GSM_29002_TIMER_ML (10*60) +/* from 28h to 38h */ +#define GSM_29002_TIMER_L (32*60*60) + + +/* VLR subscriber authentication state */ +enum vlr_subscr_auth_state { + /* subscriber needs to be autenticated */ + VLR_SUB_AS_NEEDS_AUTH, + /* waiting for AuthInfo from HLR/AUC */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + /* waiting for response from subscriber */ + VLR_SUB_AS_WAIT_RESP, + /* successfully authenticated */ + VLR_SUB_AS_AUTHENTICATED, + /* subscriber needs re-sync */ + VLR_SUB_AS_NEEDS_RESYNC, + /* waiting for AuthInfo with ReSync */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + /* waiting for response from subscr, resync case */ + VLR_SUB_AS_WAIT_RESP_RESYNC, + /* waiting for IMSI from subscriber */ + VLR_SUB_AS_WAIT_ID_IMSI, + /* authentication has failed */ + VLR_SUB_AS_AUTH_FAILED, +}; + +enum vlr_lu_event { + VLR_ULA_E_UPDATE_LA, /* Initial trigger (LU from MS) */ + VLR_ULA_E_SEND_ID_ACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_SEND_ID_NACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_AUTH_RES, /* Result of auth procedure */ + VLR_ULA_E_CIPH_RES, /* Result of Ciphering Mode Command */ + VLR_ULA_E_ID_IMSI, /* IMSI recieved from MS */ + VLR_ULA_E_ID_IMEI, /* IMEI received from MS */ + VLR_ULA_E_ID_IMEISV, /* IMEISV received from MS */ + VLR_ULA_E_HLR_LU_RES, /* HLR UpdateLocation result */ + VLR_ULA_E_UPD_HLR_COMPL,/* UpdatE_HLR_VLR result */ + VLR_ULA_E_LU_COMPL_SUCCESS,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_LU_COMPL_FAILURE,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_NEW_TMSI_ACK, /* TMSI Reallocation Complete */ +}; + +enum vlr_ciph_result_cause { + VLR_CIPH_REJECT, /* ? */ + VLR_CIPH_COMPL, +}; + +struct vlr_ciph_result { + enum vlr_ciph_result_cause cause; + const char *imeisv; +}; + +enum vlr_subscr_security_context { + VLR_SEC_CTX_NONE, + VLR_SEC_CTX_GSM, + VLR_SEC_CTX_UMTS, +}; + +enum vlr_lu_type { + VLR_LU_TYPE_PERIODIC, + VLR_LU_TYPE_IMSI_ATTACH, + VLR_LU_TYPE_REGULAR, +}; + +#define OSMO_LBUF_DECL(name, xlen) \ + struct { \ + uint8_t buf[xlen]; \ + size_t len; \ + } name + +struct sgsn_mm_ctx; +struct vlr_instance; + +/* The VLR subscriber is the part of the GSM subscriber state in VLR (CS) or + * SGSN (PS), particularly while interacting with the HLR via GSUP */ +struct vlr_subscr { + struct llist_head list; + struct vlr_instance *vlr; + + /* TODO either populate from HLR or drop this completely? */ + long long unsigned int id; + + /* Data from HLR */ /* 3GPP TS 23.008 */ + /* Always use vlr_subscr_set_imsi() to write to imsi[] */ + char imsi[GSM23003_IMSI_MAX_DIGITS+1]; /* 2.1.1.1 */ + char msisdn[GSM_EXTENSION_LENGTH+1]; /* 2.1.2 */ + char name[GSM_NAME_LENGTH+1]; /* proprietary */ + OSMO_LBUF_DECL(hlr, 16); /* 2.4.7 */ + uint32_t periodic_lu_timer; /* 2.4.24 */ + uint32_t age_indicator; /* 2.17.1 */ + + /* Authentication Data */ + struct gsm_auth_tuple auth_tuples[5]; /* 2.3.1-2.3.4 */ + struct gsm_auth_tuple *last_tuple; + enum vlr_subscr_security_context sec_ctx; + + /* Data local to VLR is below */ + uint32_t tmsi; /* 2.1.4 */ + /* Newly allocated TMSI that was not yet acked by MS */ + uint32_t tmsi_new; + + /* some redundancy in information below? */ + struct osmo_cell_global_id cgi; /* 2.4.16 */ + uint16_t lac; /* 2.4.2 */ + + char imeisv[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.2.3 */ + char imei[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.1.9 */ + bool imsi_detached_flag; /* 2.7.1 */ + bool conf_by_radio_contact_ind; /* 2.7.4.1 */ + bool sub_dataconf_by_hlr_ind; /* 2.7.4.2 */ + bool loc_conf_in_hlr_ind; /* 2.7.4.3 */ + bool dormant_ind; /* 2.7.8 */ + bool cancel_loc_rx; /* 2.7.8A */ + bool ms_not_reachable_flag; /* 2.10.2 (MNRF) */ + bool la_allowed; + + int use_count; + time_t expire_lu; /* FIXME: overlap with periodic_lu_timer/age_indicator */ + + struct osmo_fsm_inst *lu_fsm; + struct osmo_fsm_inst *auth_fsm; + struct osmo_fsm_inst *proc_arq_fsm; + + bool lu_complete; + + void *msc_conn_ref; + + /* PS (SGSN) specific parts */ + struct { + struct llist_head pdp_list; + uint8_t rac; + uint8_t sac; + struct gprs_mm_ctx *mmctx; + } ps; + /* CS (NITB/CSCN) specific parts */ + struct { + /* pending requests */ + bool is_paging; + struct llist_head requests; + } cs; +}; + +enum vlr_proc_arq_result; + +enum vlr_ciph { + VLR_CIPH_NONE, /*< A5/0, no encryption */ + VLR_CIPH_A5_1, /*< A5/1, encryption */ + VLR_CIPH_A5_2, /*< A5/2, deprecated export-grade encryption */ + VLR_CIPH_A5_3, /*< A5/3, 'new secure' encryption */ +}; + +struct vlr_ops { + /* encode + transmit an AUTH REQ towards the MS. + * \param[in] at auth tuple providing rand, key_seq and autn. + * \param[in] send_autn True to send AUTN, for r99 UMTS auth. + */ + int (*tx_auth_req)(void *msc_conn_ref, struct gsm_auth_tuple *at, + bool send_autn); + /* encode + transmit an AUTH REJECT towards the MS */ + int (*tx_auth_rej)(void *msc_conn_ref); + + /* encode + transmit an IDENTITY REQUEST towards the MS */ + int (*tx_id_req)(void *msc_conn_ref, uint8_t mi_type); + + int (*tx_lu_acc)(void *msc_conn_ref, uint32_t send_tmsi); + int (*tx_lu_rej)(void *msc_conn_ref, uint8_t cause); + 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 retrieve_imeisv); + + /* notify MSC/SGSN that the subscriber data in VLR has been updated */ + void (*subscr_update)(struct vlr_subscr *vsub); + /* notify MSC/SGSN that the given subscriber has been associated + * with this msc_conn_ref */ + void (*subscr_assoc)(void *msc_conn_ref, struct vlr_subscr *vsub); +}; + +enum vlr_timer { + VLR_T_3250, + VLR_T_3260, + VLR_T_3270, + _NUM_VLR_TIMERS +}; + +/* An instance of the VLR codebase */ +struct vlr_instance { + struct llist_head subscribers; + struct llist_head operations; + struct gsup_client *gsup_client; + struct vlr_ops ops; + struct { + bool retrieve_imeisv; + bool assign_tmsi; + bool check_imei_rqd; + int auth_tuple_max_use_count; + bool auth_reuse_old_sets_on_error; + bool parq_retrieve_imsi; + bool is_ps; + uint32_t timer[_NUM_VLR_TIMERS]; + } cfg; + /* A free-form pointer for use by the caller */ + void *user_ctx; +}; + +extern const struct value_string vlr_ciph_names[]; +static inline const char *vlr_ciph_name(enum vlr_ciph val) +{ + return get_value_string(vlr_ciph_names, val); +} + +/* Location Updating request */ +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi); + +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi); + +/* tell the VLR that the subscriber connection is gone */ +int vlr_subscr_disconnected(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); +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); +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); +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub); + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops); +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port); + +/* internal use only */ + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event); +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event); + +struct osmo_fsm_inst * +lu_compl_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure); + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +const char *vlr_subscr_msisdn_or_name(struct vlr_subscr *vsub); + +#define vlr_subscr_find_by_imsi(vlr, imsi) \ + _vlr_subscr_find_by_imsi(vlr, imsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_imsi(vlr, imsi, created) \ + _vlr_subscr_find_or_create_by_imsi(vlr, imsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_tmsi(vlr, tmsi) \ + _vlr_subscr_find_by_tmsi(vlr, tmsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created) \ + _vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_msisdn(vlr, msisdn) \ + _vlr_subscr_find_by_msisdn(vlr, msisdn, __BASE_FILE__, __LINE__) + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line); + +#define vlr_subscr_get(sub) _vlr_subscr_get(sub, __BASE_FILE__, __LINE__) +#define vlr_subscr_put(sub) _vlr_subscr_put(sub, __BASE_FILE__, __LINE__) +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line); +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line); + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_free(struct vlr_subscr *vsub); +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub); + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi); +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei); +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv); +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn); + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi); +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi); +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn); +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei); + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer); + +int vlr_subscr_changed(struct vlr_subscr *vsub); +int vlr_subscr_purge(struct vlr_subscr *vsub); +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause); + + +/* Process Acccess Request FSM */ + +enum vlr_proc_arq_result { + VLR_PR_ARQ_RES_NONE, + VLR_PR_ARQ_RES_SYSTEM_FAILURE, + VLR_PR_ARQ_RES_ILLEGAL_SUBSCR, + VLR_PR_ARQ_RES_UNIDENT_SUBSCR, + VLR_PR_ARQ_RES_ROAMING_NOTALLOWED, + VLR_PR_ARQ_RES_ILLEGAL_EQUIP, + VLR_PR_ARQ_RES_UNKNOWN_ERROR, + VLR_PR_ARQ_RES_TIMEOUT, + VLR_PR_ARQ_RES_PASSED, +}; + +extern const struct value_string vlr_proc_arq_result_names[]; +static inline const char *vlr_proc_arq_result_name(enum vlr_proc_arq_result res) +{ + return get_value_string(vlr_proc_arq_result_names, res); +} + +enum proc_arq_vlr_event { + PR_ARQ_E_START, + PR_ARQ_E_ID_IMSI, + PR_ARQ_E_AUTH_RES, + PR_ARQ_E_CIPH_RES, + PR_ARQ_E_UPD_LOC_RES, + PR_ARQ_E_TRACE_RES, + PR_ARQ_E_IMEI_RES, + PR_ARQ_E_PRES_RES, + PR_ARQ_E_TMSI_ACK, +}; + +enum vlr_parq_type { + VLR_PR_ARQ_T_INVALID = 0, /* to guard against unset vars */ + VLR_PR_ARQ_T_CM_SERV_REQ, + VLR_PR_ARQ_T_PAGING_RESP, + /* FIXME: differentiate between services of 24.008 10.5.3.3 */ +}; + +/* Process Access Request (CM SERV REQ / PAGING RESP) */ +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran); + +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi); + +void vlr_parq_fsm_init(void); + +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv); diff --git a/src/Makefile.am b/src/Makefile.am index cfad7df..c66f9e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,7 @@ # Libraries SUBDIRS = \ libcommon \ + libvlr \ libmgcp \ libbsc \ libmsc \ diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c new file mode 100644 index 0000000..91ffe40 --- /dev/null +++ b/src/libmsc/subscr_conn.c @@ -0,0 +1,269 @@ +/* MSC subscriber connection implementation */ + +/* + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +static const struct value_string subscr_conn_fsm_event_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_E_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_E_ACCEPTED), + OSMO_VALUE_STRING(SUBSCR_CONN_E_BUMP), + OSMO_VALUE_STRING(SUBSCR_CONN_E_MO_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CN_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CLOSE_CONF), + { 0, NULL } +}; + +const struct value_string subscr_conn_from_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_LU), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_CM_SERVICE_REQ), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_PAGING_RESP), + { 0, NULL } +}; + +static void paging_resp(struct gsm_subscriber_connection *conn, + enum gsm_paging_event pe) +{ + subscr_paging_dispatch(GSM_HOOK_RR_PAGING, pe, NULL, conn, conn->subscr); +} + +void subscr_conn_fsm_new(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + enum subscr_conn_from from = SUBSCR_CONN_FROM_INVALID; + enum gsm_paging_event pe; + + if (data) { + from = *(enum subscr_conn_from*)data; + LOGPFSM(fi, "%s\n", subscr_conn_from_name(from)); + } + + /* If accepted, transition the state, all other cases mean failure. */ + switch (event) { + case SUBSCR_CONN_E_ACCEPTED: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + break; + + case SUBSCR_CONN_E_MO_CLOSE: + case SUBSCR_CONN_E_CN_CLOSE: + case SUBSCR_CONN_E_CLOSE_CONF: + break; + + default: + LOGPFSM(fi, "Unexpected event: %d %s\n", + event, osmo_fsm_event_name(fi->fsm, event)); + break; + } + + /* if appropriate, signal paging success or failure */ + if (from == SUBSCR_CONN_FROM_PAGING_RESP) { + pe = (fi->state == SUBSCR_CONN_S_ACCEPTED)? + GSM_PAGING_SUCCEEDED : GSM_PAGING_EXPIRED; + paging_resp(conn, pe); + } + + /* On failure, discard the conn */ + if (fi->state != SUBSCR_CONN_S_ACCEPTED) { + /* TODO: on MO_CLOSE or CN_CLOSE, first go to RELEASING and + * await BSC confirmation? */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); + return; + } + + /* On success, handle pending requests and/or close conn */ + + if (from == SUBSCR_CONN_FROM_CM_SERVICE_REQ) { + conn->received_cm_service_request = true; + LOGPFSM(fi, "received_cm_service_request = true\n"); + } + + osmo_fsm_inst_dispatch(fi, SUBSCR_CONN_E_BUMP, data); +} + +#if 0 + case SUBSCR_CONN_E_PARQ_SUCCESS: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + accept_conn = true; + /* fall through */ + case SUBSCR_CONN_E_PARQ_FAILURE: + parq_type = data ? *(enum vlr_parq_type*)data : VLR_PR_ARQ_T_INVALID; + switch (parq_type) { + + case VLR_PR_ARQ_T_CM_SERV_REQ: + accept_conn = handle_cm_serv_result(fi, accept_conn); + break; + + case VLR_PR_ARQ_T_PAGING_RESP: + accept_conn = handle_paging_result(fi, accept_conn); + break; + + default: + LOGPFSML(fi, LOGL_ERROR, + "Invalid VLR Process Access Request type" + " %d\n", parq_type); + accept_conn = false; + break; + } + break; +#endif + +static void subscr_conn_fsm_bump(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + + if (conn->silent_call) + return; + + if (conn->received_cm_service_request) + return; + + /* is this needed? */ + if (conn->subscr && !llist_empty(&conn->subscr->requests)) + return; + + if (trans_has_conn(conn)) + return; + + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_accepted(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case SUBSCR_CONN_E_BUMP: + subscr_conn_fsm_bump(fi, event, data); + return; + + default: + break; + } + /* Whatever unexpected happens in the accepted state, it means release. + * Even if an unexpected event is passed, the safest thing to do is + * discard the conn. We don't expect another SUBSCR_CONN_E_ACCEPTED. */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_release(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = fi->priv; + if (!conn) + return; + + /* temporary hack, see owned_by_msc */ + if (!conn->owned_by_msc) { + DEBUGP(DMM, "%s leaving bsc_subscr_con_free() to bsc_api.c, owned_by_msc = false\n", + subscr_name(conn->subscr)); + return; + } + + DEBUGP(DMM, "%s calling bsc_subscr_con_free(), owned_by_msc = true\n", + subscr_name(conn->subscr)); + gsm0808_clear(conn); + bsc_subscr_con_free(conn); +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state subscr_conn_fsm_states[] = { + [SUBSCR_CONN_S_NEW] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_NEW), + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_ACCEPTED) | + S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_new, + }, + [SUBSCR_CONN_S_ACCEPTED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_ACCEPTED), + /* allow everything to release for any odd behavior */ + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_BUMP) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_accepted, + }, + [SUBSCR_CONN_S_RELEASED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_RELEASED), + .onenter = subscr_conn_fsm_release, + }, +}; + +static struct osmo_fsm subscr_conn_fsm = { + .name = "Subscr_Conn", + .states = subscr_conn_fsm_states, + .num_states = ARRAY_SIZE(subscr_conn_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = subscr_conn_fsm_event_names, +}; + +int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id) +{ + struct osmo_fsm_inst *fi; + OSMO_ASSERT(conn); + + if (conn->conn_fsm) { + LOGP(DMM, LOGL_ERROR, + "%s: Error: connection already in use\n", id); + return -EINVAL; + } + + fi = osmo_fsm_inst_alloc(&subscr_conn_fsm, conn, conn, LOGL_DEBUG, id); + + if (!fi) { + LOGP(DMM, LOGL_ERROR, + "%s: Failed to allocate subscr conn master FSM\n", id); + return -ENOMEM; + } + conn->conn_fsm = fi; + return 0; +} + +bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn) +{ + if (!conn) + return false; + if (!conn->subscr) + return false; + if (!conn->conn_fsm) + return false; + if (conn->conn_fsm->state != SUBSCR_CONN_S_ACCEPTED) + return false; + return true; +} + +void msc_subscr_conn_init(void) +{ + osmo_fsm_register(&subscr_conn_fsm); +} diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am new file mode 100644 index 0000000..17ad411 --- /dev/null +++ b/src/libvlr/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) + +noinst_HEADERS = \ + vlr_access_req_fsm.h \ + vlr_auth_fsm.h \ + vlr_core.h \ + vlr_lu_fsm.h \ + $(NULL) + +noinst_LIBRARIES = libvlr.a + +libvlr_a_SOURCES = \ + vlr.c \ + vlr_access_req_fsm.c \ + vlr_auth_fsm.c \ + vlr_lu_fsm.c \ + $(NULL) diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c new file mode 100644 index 0000000..0e0d31c --- /dev/null +++ b/src/libvlr/vlr.c @@ -0,0 +1,1108 @@ +/* Osmocom Visitor Location Register (VLR) code base */ + +/* (C) 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define SGSN_SUBSCR_MAX_RETRIES 3 +#define SGSN_SUBSCR_RETRY_INTERVAL 10 + +/*********************************************************************** + * Convenience functions + ***********************************************************************/ + +const struct value_string vlr_ciph_names[] = { + OSMO_VALUE_STRING(VLR_CIPH_NONE), + OSMO_VALUE_STRING(VLR_CIPH_A5_1), + OSMO_VALUE_STRING(VLR_CIPH_A5_2), + OSMO_VALUE_STRING(VLR_CIPH_A5_3), + { 0, NULL } +}; + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer) +{ + uint32_t tidx = 0xffffffff; + + switch (timer) { + case 3270: + tidx = VLR_T_3270; + break; + case 3260: + tidx = VLR_T_3260; + break; + case 3250: + tidx = VLR_T_3250; + break; + } + + OSMO_ASSERT(tidx < sizeof(vlr->cfg.timer)); + return vlr->cfg.timer[tidx]; +} + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!imsi || !*imsi) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_imsi(vsub, imsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (tmsi == GSM_RESERVED_TMSI) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_tmsi(vsub, tmsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!msisdn || !*msisdn) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_msisdn(vsub, msisdn)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +/* Transmit GSUP message to HLR */ +static int vlr_tx_gsup_message(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + struct msgb *msg = gsup_client_msgb_alloc(); + + osmo_gsup_encode(msg, gsup_msg); + + if (!vlr->gsup_client) { + LOGP(DVLR, LOGL_NOTICE, "GSUP link is down, cannot " + "send GSUP: %s\n", msgb_hexdump(msg)); + msgb_free(msg); + return -ENOTSUP; + } + + LOGP(DVLR, LOGL_DEBUG, "GSUP tx: %s\n", + osmo_hexdump_nospc(msg->data, msg->len)); + + return gsup_client_send(vlr->gsup_client, msg); +} + +/* Transmit GSUP message for subscriber to HLR, using IMSI from subscriber */ +static int vlr_subscr_tx_gsup_message(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct vlr_instance *vlr = vsub->vlr; + + if (strlen(gsup_msg->imsi) == 0) + osmo_strlcpy(gsup_msg->imsi, vsub->imsi, sizeof(gsup_msg->imsi)); + + return vlr_tx_gsup_message(vlr, gsup_msg); +} + +/* Transmit GSUP error in response to original message */ +static int vlr_tx_gsup_error_reply(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_orig, + enum gsm48_gmm_cause cause) +{ + struct osmo_gsup_message gsup_reply = {0}; + + osmo_strlcpy(gsup_reply.imsi, gsup_orig->imsi, sizeof(gsup_reply.imsi)); + gsup_reply.cause = cause; + gsup_reply.message_type = + OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type); + + return vlr_tx_gsup_message(vlr, &gsup_reply); +} + +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + OSMO_ASSERT(sub->use_count < INT_MAX); + sub->use_count++; + LOGPSRC(DREF, LOGL_DEBUG, file, line, + "VLR subscr %s usage increases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + return sub; +} + +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + sub->use_count--; + LOGPSRC(DREF, sub->use_count >= 0? LOGL_DEBUG : LOGL_ERROR, + file, line, + "VLR subscr %s usage decreases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + if (sub->use_count <= 0) + vlr_subscr_free(sub); + return NULL; +} + +/* Allocate a new subscriber and insert it into list */ +static struct vlr_subscr *_vlr_subscr_alloc(struct vlr_instance *vlr) +{ + struct vlr_subscr *vsub; + int i; + + vsub = talloc_zero(vlr, struct vlr_subscr); + vsub->vlr = vlr; + vsub->tmsi = GSM_RESERVED_TMSI; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + + INIT_LLIST_HEAD(&vsub->cs.requests); + INIT_LLIST_HEAD(&vsub->ps.pdp_list); + + llist_add_tail(&vsub->list, &vlr->subscribers); + return vsub; +} + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr) +{ + return vlr_subscr_get(_vlr_subscr_alloc(vlr)); +} + +/* Send a GSUP Purge MS request. + * TODO: this should be sent to the *previous* VLR when this VLR is "taking" + * this subscriber, not to the HLR? */ +int vlr_subscr_purge(struct vlr_subscr *vsub) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_PURGE_MS_REQUEST; + + /* provide HLR number in case we know it */ + gsup_msg.hlr_enc_len = vsub->hlr.len; + gsup_msg.hlr_enc = vsub->hlr.buf; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause) +{ + if (!vsub) + return; + + if (vsub->lu_fsm) { + if (vsub->lu_fsm->state == VLR_ULA_S_WAIT_HLR_UPD) + osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_HLR_LU_RES, + (void*)&cause); + else + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_ERROR, + 0); + } + + if (vsub->proc_arq_fsm) + osmo_fsm_inst_term(vsub->proc_arq_fsm, OSMO_FSM_TERM_ERROR, 0); +} + +/* Call vlr_subscr_cancel(), then completely drop the entry from the VLR */ +void vlr_subscr_free(struct vlr_subscr *vsub) +{ + llist_del(&vsub->list); + DEBUGP(DREF, "freeing VLR subscr %s\n", vlr_subscr_name(vsub)); + talloc_free(vsub); +} + +/* Generate a new TMSI and store in vsub->tmsi_new. + * Search all known subscribers to ensure that the TMSI is unique. */ +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub) +{ + struct vlr_instance *vlr = vsub->vlr; + uint32_t tmsi; + int tried; + + for (tried = 0; tried < 100; tried++) { + if (RAND_bytes((uint8_t *) &tmsi, sizeof(tmsi)) != 1) { + LOGP(DVLR, LOGL_ERROR, "RAND_bytes failed\n"); + return -1; + } + /* throw the dice again, if the TSMI doesn't fit */ + if (tmsi == GSM_RESERVED_TMSI) + continue; + + /* Section 2.4 of 23.003: MSC has two MSB 00/01/10, SGSN 11 */ + if (vlr->cfg.is_ps) { + /* SGSN */ + tmsi |= 0xC000000; + } else { + /* MSC */ + if ((tmsi & 0xC0000000) == 0xC0000000) + tmsi &= ~0xC0000000; + } + + /* If this TMSI is already in use, try another one. */ + if (vlr_subscr_find_by_tmsi(vlr, tmsi)) + continue; + + vsub->tmsi_new = tmsi; + return 0; + } + + LOGP(DVLR, LOGL_ERROR, "subscr %s: unable to generate valid TMSI" + " after %d tries\n", vlr_subscr_name(vsub), tried); + return -1; +} + +/* Find subscriber by IMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] imsi IMSI string. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_imsi(vlr, imsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vlr_subscr_set_imsi(vsub, imsi); + LOGP(DVLR, LOGL_INFO, "New subscr, IMSI: %s\n", vsub->imsi); + if (created) + *created = true; + return vsub; +} + +/* Find subscriber by TMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] tmsi TMSI. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_tmsi(vlr, tmsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vsub->tmsi = tmsi; + LOGP(DVLR, LOGL_INFO, "New subscr, TMSI: 0x%08x\n", vsub->tmsi); + if (created) + *created = true; + return vsub; +} + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + vsub->id = atoll(vsub->imsi); + DEBUGP(DVLR, "set IMSI on subscriber; IMSI=%s id=%llu\n", + vsub->imsi, vsub->id); +} + +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imei, imei, sizeof(vsub->imei)); + DEBUGP(DVLR, "set IMEI on subscriber; IMSI=%s IMEI=%s\n", + vsub->imsi, vsub->imei); +} + +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imeisv, imeisv, sizeof(vsub->imeisv)); + DEBUGP(DVLR, "set IMEISV on subscriber; IMSI=%s IMEISV=%s\n", + vsub->imsi, vsub->imeisv); +} + +/* Safely copy the given MSISDN string to vsub->msisdn */ +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->msisdn, msisdn, sizeof(vsub->msisdn)); + DEBUGP(DVLR, "set MSISDN on subscriber; IMSI=%s MSISDN=%s\n", + vsub->imsi, vsub->msisdn); +} + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + return vsub && imsi && vsub->imsi[0] && !strcmp(vsub->imsi, imsi); +} + +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi) +{ + return vsub && tmsi != GSM_RESERVED_TMSI + && (vsub->tmsi == tmsi || vsub->tmsi_new == tmsi); +} + +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + return vsub && msisdn && vsub->msisdn[0] + && !strcmp(vsub->msisdn, msisdn); +} + +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei) +{ + return vsub && imei && vsub->imei[0] + && !strcmp(vsub->imei, imei); +} + +/* Send updated subscriber information to HLR */ +int vlr_subscr_changed(struct vlr_subscr *vsub) +{ + /* FIXME */ + LOGP(DVLR, LOGL_ERROR, "Not implemented: %s\n", __func__); + return 0; +} + +/*********************************************************************** + * PDP context data + ***********************************************************************/ + +struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_alloc(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data* pdata; + + pdata = talloc_zero(vsub, struct sgsn_subscriber_pdp_data); + + llist_add_tail(&pdata->list, &vsub->ps.pdp_list); + + return pdata; +} + +static int vlr_subscr_pdp_data_clear(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data *pdp, *pdp2; + int count = 0; + + llist_for_each_entry_safe(pdp, pdp2, &vsub->ps.pdp_list, list) { + llist_del(&pdp->list); + talloc_free(pdp); + count += 1; + } + + return count; +} + +static struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_get_by_id(struct vlr_subscr *vsub, unsigned context_id) +{ + struct sgsn_subscriber_pdp_data *pdp; + + llist_for_each_entry(pdp, &vsub->ps.pdp_list, list) { + if (pdp->context_id == context_id) + return pdp; + } + + return NULL; +} + +/*********************************************************************** + * Actual Implementation + ***********************************************************************/ + +static int vlr_rx_gsup_unknown_imsi(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup_msg->message_type)) { + vlr_tx_gsup_error_reply(vlr, gsup_msg, + GMM_CAUSE_IMSI_UNKNOWN); + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP request " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } else if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP error " + "of type 0x%02x, cause '%s' (%d)\n", + gsup_msg->imsi, gsup_msg->message_type, + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + } else { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP response " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } + + return -GMM_CAUSE_IMSI_UNKNOWN; +} + +static int vlr_rx_gsup_purge_no_subscr(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGGSUPP(LOGL_NOTICE, gsup_msg, + "Purge MS has failed with cause '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + return -gsup_msg->cause; + } + LOGGSUPP(LOGL_INFO, gsup_msg, "Completing purge MS\n"); + return 0; +} + +/* VLR internal call to request UpdateLocation from HLR */ +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps) +{ + struct osmo_gsup_message gsup_msg = {0}; + int rc; + + gsup_msg.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; + rc = vlr_subscr_tx_gsup_message(vsub, &gsup_msg); + + return rc; +} + +/* VLR internal call to request tuples from HLR */ +int vlr_subscr_req_sai(struct vlr_subscr *vsub, + const uint8_t *auts, const uint8_t *auts_rand) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; + gsup_msg.auts = auts; + gsup_msg.rand = auts_rand; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +/* Tell HLR that authentication failure occurred */ +int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub) +{ + 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)); + return vlr_tx_gsup_message(vsub->vlr, &gsup_msg); +} + +/* Update the subscriber with GSUP-received auth tuples */ +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + unsigned int i; + unsigned int got_tuples; + + if (gsup->num_auth_vectors) { + memset(&vsub->auth_tuples, 0, sizeof(vsub->auth_tuples)); + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + } + + got_tuples = 0; + for (i = 0; i < gsup->num_auth_vectors; i++) { + size_t key_seq = i; + + if (key_seq >= ARRAY_SIZE(vsub->auth_tuples)) { + LOGVSUBP(LOGL_NOTICE, vsub, + "Skipping auth tuple wih invalid cksn %zu\n", + key_seq); + continue; + } + vsub->auth_tuples[i].vec = gsup->auth_vectors[i]; + vsub->auth_tuples[i].key_seq = key_seq; + got_tuples ++; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "Received %u auth tuples\n", got_tuples); + + if (!got_tuples) { + /* FIXME what now? */ + // vlr_subscr_cancel(vsub, GMM_CAUSE_GSM_AUTH_UNACCEPT); ? + } + + /* New tuples means last_tuple becomes invalid */ + vsub->last_tuple = NULL; +} + +/* Handle SendAuthInfo Result/Error from HLR */ +static int vlr_subscr_handle_sai_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + void *data = (void *) gsup; + + switch (gsup->message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_ACK, data); + break; + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_NACK, data); + break; + default: + return -1; + } + + return 0; +} + +static int decode_bcd_number_safe(char *output, int output_len, + const uint8_t *bcd_lv, int input_len, + int h_len) +{ + uint8_t len; + OSMO_ASSERT(output_len >= 1); + *output = '\0'; + if (input_len < 1) + return -EIO; + len = bcd_lv[0]; + if (input_len < len) + return -EIO; + return gsm48_decode_bcd_number(output, output_len, bcd_lv, h_len); +} + +static void vlr_subscr_gsup_insert_data(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup_msg) +{ + unsigned idx; + int rc; + + if (gsup_msg->msisdn_enc) { + decode_bcd_number_safe(vsub->msisdn, sizeof(vsub->msisdn), + gsup_msg->msisdn_enc, + gsup_msg->msisdn_enc_len, 0); + LOGP(DVLR, LOGL_DEBUG, "IMSI:%s has MSISDN:%s\n", + vsub->imsi, vsub->msisdn); + } + + if (gsup_msg->hlr_enc) { + if (gsup_msg->hlr_enc_len > sizeof(vsub->hlr.buf)) { + LOGP(DVLR, LOGL_ERROR, "HLR-Number too long (%zu)\n", + gsup_msg->hlr_enc_len); + vsub->hlr.len = 0; + } else { + memcpy(vsub->hlr.buf, gsup_msg->hlr_enc, + gsup_msg->hlr_enc_len); + vsub->hlr.len = gsup_msg->hlr_enc_len; + } + } + + if (gsup_msg->pdp_info_compl) { + rc = vlr_subscr_pdp_data_clear(vsub); + if (rc > 0) + LOGP(DVLR, LOGL_INFO, "Cleared existing PDP info\n"); + } + + for (idx = 0; idx < gsup_msg->num_pdp_infos; idx++) { + const struct osmo_gsup_pdp_info *pdp_info = &gsup_msg->pdp_infos[idx]; + size_t ctx_id = pdp_info->context_id; + struct sgsn_subscriber_pdp_data *pdp_data; + + if (pdp_info->apn_enc_len >= sizeof(pdp_data->apn_str)-1) { + LOGVSUBP(LOGL_ERROR, vsub, + "APN too long, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, + pdp_info->apn_enc_len)); + continue; + } + + if (pdp_info->qos_enc_len > sizeof(pdp_data->qos_subscribed)) { + LOGVSUBP(LOGL_ERROR, vsub, + "QoS info too long (%zu)\n", + pdp_info->qos_enc_len); + continue; + } + + LOGVSUBP(LOGL_INFO, vsub, + "Will set PDP info, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, pdp_info->apn_enc_len)); + + /* Set PDP info [ctx_id] */ + pdp_data = vlr_subscr_pdp_data_get_by_id(vsub, ctx_id); + if (!pdp_data) { + pdp_data = vlr_subscr_pdp_data_alloc(vsub); + pdp_data->context_id = ctx_id; + } + + OSMO_ASSERT(pdp_data != NULL); + pdp_data->pdp_type = pdp_info->pdp_type; + osmo_apn_to_str(pdp_data->apn_str, + pdp_info->apn_enc, pdp_info->apn_enc_len); + memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); + pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + } +} + + +/* Handle InsertSubscrData Result from HLR */ +static int vlr_subscr_handle_isd_req(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_gsup_message gsup_reply = {0}; + + vlr_subscr_gsup_insert_data(vsub, gsup); + vsub->vlr->ops.subscr_update(vsub); + + gsup_reply.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; + return vlr_subscr_tx_gsup_message(vsub, &gsup_reply); +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Result " + "without LU in progress\n"); + return -ENODEV; + } + + /* contrary to MAP, we allow piggy-backing subscriber data onto the + * UPDATE LOCATION RESULT, and don't mandate the use of a separate + * nested INSERT SUBSCRIBER DATA transaction */ + vlr_subscr_gsup_insert_data(vsub, gsup); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, NULL); + + return 0; +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_err(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Error " + "without LU in progress\n"); + return -ENODEV; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "UpdateLocation failed; gmm_cause: %s\n", + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, + (void *)&gsup->cause); + + return 0; +} + +/* Handle LOCATION CANCEL request from HLR */ +static int vlr_subscr_handle_cancel_req(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct osmo_gsup_message gsup_reply = {0}; + int is_update_procedure = !gsup_msg->cancel_type || + gsup_msg->cancel_type == OSMO_GSUP_CANCEL_TYPE_UPDATE; + + LOGVSUBP(LOGL_INFO, vsub, "Cancelling MS subscriber (%s)\n", + is_update_procedure ? + "update procedure" : "subscription withdraw"); + + gsup_reply.message_type = OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT; + vlr_subscr_tx_gsup_message(vsub, &gsup_reply); + + vlr_subscr_cancel(vsub, gsup_msg->cause); + + return 0; +} + +/* Incoming handler for GSUP from HLR. + * Keep this function non-static for direct invocation by unit tests. */ +int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +{ + struct vlr_instance *vlr = (struct vlr_instance *) gsupc->data; + struct vlr_subscr *vsub; + struct osmo_gsup_message gsup; + int rc; + + DEBUGP(DVLR, "GSUP rx %u: %s\n", msgb_l2len(msg), + osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup); + if (rc < 0) { + LOGP(DVLR, LOGL_ERROR, + "decoding GSUP message fails with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return rc; + } + + if (!gsup.imsi[0]) { + LOGP(DVLR, LOGL_ERROR, "Missing IMSI in GSUP message\n"); + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup.message_type)) + vlr_tx_gsup_error_reply(vlr, &gsup, + GMM_CAUSE_INV_MAND_INFO); + return -GMM_CAUSE_INV_MAND_INFO; + } + + vsub = vlr_subscr_find_by_imsi(vlr, gsup.imsi); + if (!vsub) { + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + return vlr_rx_gsup_purge_no_subscr(vlr, &gsup); + default: + return vlr_rx_gsup_unknown_imsi(vlr, &gsup); + } + } + + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + rc = vlr_subscr_handle_sai_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: + rc = vlr_subscr_handle_isd_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST: + rc = vlr_subscr_handle_cancel_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: + rc = vlr_subscr_handle_lu_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: + rc = vlr_subscr_handle_lu_err(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_DELETE_DATA_REQUEST: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not yet implemented\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + default: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not valid at VLR/SGSN side\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + } + + vlr_subscr_put(vsub); + return rc; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_id_resp(struct vlr_subscr *vsub, + const uint8_t *mi, size_t mi_len) +{ + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type = mi[0] & GSM_MI_TYPE_MASK; + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); + + /* update the vlr_subscr with the given identity */ + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else + vlr_subscr_set_imsi(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEI: + vlr_subscr_set_imei(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEISV: + vlr_subscr_set_imeisv(vsub, mi_string); + break; + } + + if (vsub->auth_fsm) { + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + osmo_fsm_inst_dispatch(vsub->auth_fsm, + VLR_AUTH_E_MS_ID_IMSI, mi_string); + break; + } + } + + if (vsub->lu_fsm) { + uint32_t event = 0; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + event = VLR_ULA_E_ID_IMSI; + break; + case GSM_MI_TYPE_IMEI: + event = VLR_ULA_E_ID_IMEI; + break; + case GSM_MI_TYPE_IMEISV: + event = VLR_ULA_E_ID_IMEISV; + break; + default: + OSMO_ASSERT(0); + break; + } + osmo_fsm_inst_dispatch(vsub->lu_fsm, event, mi_string); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, "gratuitous ID RESPONSE?!?\n"); + } + + return 0; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_tmsi_reall_compl(struct vlr_subscr *vsub) +{ + if (vsub->lu_fsm) { + return osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_NEW_TMSI_ACK, NULL); + } else if (vsub->proc_arq_fsm) { + return osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, + PR_ARQ_E_TMSI_ACK, NULL); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, + "gratuitous TMSI REALLOC COMPL"); + return -EINVAL; + } +} + +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); + } + return 0; +} + +/* Tear down any running FSMs due to MSC connection timeout. + * Visit all vsub->*_fsm pointers and give them a queue to send a final reject + * message before the entire connection is torn down. + * \param[in] vsub subscriber to tear down + */ +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub) +{ + if (!vsub) + return; + + vlr_loc_update_conn_timeout(vsub->lu_fsm); + vlr_parq_conn_timeout(vsub->proc_arq_fsm); +} + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops) +{ + struct vlr_instance *vlr = talloc_zero(ctx, struct vlr_instance); + OSMO_ASSERT(vlr); + OSMO_ASSERT(ops->tx_auth_req); + OSMO_ASSERT(ops->tx_auth_rej); + OSMO_ASSERT(ops->tx_id_req); + OSMO_ASSERT(ops->tx_lu_acc); + OSMO_ASSERT(ops->tx_lu_rej); + OSMO_ASSERT(ops->tx_cm_serv_acc); + OSMO_ASSERT(ops->tx_cm_serv_rej); + OSMO_ASSERT(ops->set_ciph_mode); + OSMO_ASSERT(ops->subscr_update); + OSMO_ASSERT(ops->subscr_assoc); + + INIT_LLIST_HEAD(&vlr->subscribers); + INIT_LLIST_HEAD(&vlr->operations); + memcpy(&vlr->ops, ops, sizeof(vlr->ops)); + + /* osmo_auth_fsm.c */ + osmo_fsm_register(&vlr_auth_fsm); + /* osmo_lu_fsm.c */ + vlr_lu_fsm_init(); + /* vlr_access_request_fsm.c */ + vlr_parq_fsm_init(); + + return vlr; +} + +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port) +{ + OSMO_ASSERT(vlr); + + vlr->gsup_client = gsup_client_create(gsup_unit_name, + gsup_server_addr_str, + gsup_server_port, + &vlr_gsupc_read_cb, NULL); + if (!vlr->gsup_client) + return -ENOMEM; + vlr->gsup_client->data = vlr; + + return 0; +} + +/* MSC->VLR: Subscribre has disconnected */ +int vlr_subscr_disconnected(struct vlr_subscr *vsub) +{ + /* This corresponds to a MAP-ABORT from MSC->VLR on a classic B + * interface */ + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_REQUEST, NULL); + osmo_fsm_inst_term(vsub->auth_fsm, OSMO_FSM_TERM_REQUEST, NULL); + vsub->msc_conn_ref = NULL; + + return 0; +} + +/* MSC->VLR: Receive Authentication Failure from Subscriber */ +int vlr_subscr_rx_auth_fail(struct vlr_subscr *vsub, const uint8_t *auts) +{ + struct vlr_auth_resp_par par = {0}; + par.auts = auts; + + osmo_fsm_inst_dispatch(vsub->auth_fsm, VLR_AUTH_E_MS_AUTH_FAIL, &par); + return 0; +} + +/* MSC->VLR: Receive Authentication Response from MS + * \returns 1 in case of success, 0 in case of delay, -1 on auth error */ +int vlr_subscr_rx_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, uint8_t res_len) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + struct vlr_auth_resp_par par; + + par.is_r99 = is_r99; + par.is_utran = is_utran; + par.res = res; + par.res_len = res_len; + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_MS_AUTH_RESP, (void *) &par); + + return 0; +} + +/* MSC->VLR: Receive result of Ciphering Mode Command from MS */ +void vlr_subscr_rx_ciph_res(struct vlr_subscr *vsub, struct vlr_ciph_result *res) +{ + if (vsub->lu_fsm && vsub->lu_fsm->state == VLR_ULA_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_CIPH_RES, res); + if (vsub->proc_arq_fsm + && vsub->proc_arq_fsm->state == PR_ARQ_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, PR_ARQ_E_CIPH_RES, + res); +} + +/* Internal evaluation of requested ciphering mode. + * Send set_ciph_mode() to MSC depending on the ciph_mode argument. + * \param[in] vlr VLR instance. + * \param[in] fi Calling FSM instance, for logging. + * \param[in] msc_conn_ref MSC conn to send to. + * \param[in] ciph_mode Ciphering config, to decide whether to do ciphering. + * \returns 0 if no ciphering is needed or message was sent successfully, + * or a negative value if ciph_mode is invalid or sending failed. + */ +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv) +{ + switch (ciph_mode) { + case VLR_CIPH_NONE: + return 0; + + case VLR_CIPH_A5_1: + case VLR_CIPH_A5_3: + return vlr->ops.set_ciph_mode(msc_conn_ref, + ciph_mode, + 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; + } +} + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr) +{ + struct vlr_subscr **fsub = (void*)&target->filter_data[LOG_FLT_VLR_SUBSCR]; + + /* free the old data */ + if (*fsub) { + vlr_subscr_put(*fsub); + *fsub = NULL; + } + + if (vlr_subscr) { + target->filter_map |= (1 << LOG_FLT_VLR_SUBSCR); + *fsub = vlr_subscr_get(vlr_subscr); + } else + target->filter_map &= ~(1 << LOG_FLT_VLR_SUBSCR); +} diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c new file mode 100644 index 0000000..241478f --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.c @@ -0,0 +1,776 @@ +/* Osmocom Visitor Location Register (VLR): Access Request FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define S(x) (1 << (x)) + +/*********************************************************************** + * Process_Access_Request_VLR, TS 29.002 Chapter 25.4.2 + ***********************************************************************/ + +const struct value_string vlr_proc_arq_result_names[] = { + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_NONE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_SYSTEM_FAILURE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNIDENT_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ROAMING_NOTALLOWED), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_EQUIP), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNKNOWN_ERROR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_TIMEOUT), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_PASSED), + { 0, NULL } +}; + +static const struct value_string proc_arq_vlr_event_names[] = { + OSMO_VALUE_STRING(PR_ARQ_E_START), + OSMO_VALUE_STRING(PR_ARQ_E_ID_IMSI), + OSMO_VALUE_STRING(PR_ARQ_E_AUTH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_CIPH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_UPD_LOC_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TRACE_RES), + OSMO_VALUE_STRING(PR_ARQ_E_IMEI_RES), + OSMO_VALUE_STRING(PR_ARQ_E_PRES_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TMSI_ACK), + { 0, NULL } +}; + +struct proc_arq_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *ul_child_fsm; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + + enum vlr_parq_type type; + enum vlr_proc_arq_result result; + bool by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool implicitly_accepted_parq_by_ciphering_cmd; +}; + +static void assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + + vsub->msc_conn_ref = par->msc_conn_ref; + par->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(par->msc_conn_ref, par->vsub); +} + +#define proc_arq_fsm_done(fi, res) _proc_arq_fsm_done(fi, res, __FILE__, __LINE__) +static void _proc_arq_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_proc_arq_result res, + const char *file, int line) +{ + struct proc_arq_priv *par = fi->priv; + LOGPFSMSRC(fi, file, line, "proc_arq_fsm_done(%s)\n", + vlr_proc_arq_result_name(res)); + par->result = res; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_DONE, 0, 0); +} + +static void proc_arq_vlr_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct proc_arq_priv *par = fi->priv; + bool success; + int rc; + LOGPFSM(fi, "Process Access Request result: %s\n", + vlr_proc_arq_result_name(par->result)); + + success = (par->result == VLR_PR_ARQ_RES_PASSED); + + /* It would be logical to first dispatch the success event to the + * parent FSM, but that could start actions that send messages to the + * MS. Rather send the CM Service Accept message first and then signal + * success. Since messages are handled synchronously, the success event + * will be processed before we handle new incoming data from the MS. */ + + if (par->type == VLR_PR_ARQ_T_CM_SERV_REQ) { + if (success + && !par->implicitly_accepted_parq_by_ciphering_cmd) { + rc = par->vlr->ops.tx_cm_serv_acc(par->msc_conn_ref); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Accept\n"); + success = false; + } + } + if (!success) { + rc = par->vlr->ops.tx_cm_serv_rej(par->msc_conn_ref, + par->result); + if (rc) + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Reject\n"); + } + } + + /* For VLR_PR_ARQ_T_PAGING_RESP, there is nothing to send. The conn_fsm + * will start handling pending paging transactions. */ + + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + success ? par->parent_event_success + : par->parent_event_failure, + par->parent_event_data); +} + +void proc_arq_vlr_cleanup(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause) +{ + struct proc_arq_priv *par = fi->priv; + if (par->vsub && par->vsub->proc_arq_fsm == fi) + par->vsub->proc_arq_fsm = NULL; +} + +static void _proc_arq_vlr_post_imei(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + /* TODO: Identity := IMSI */ + if (0 /* TODO: TMSI reallocation at access: vlr->cfg.alloc_tmsi_arq */) { + vlr_subscr_alloc_tmsi(vsub); + /* TODO: forward TMSI to MS, wait for TMSI + * REALLOC COMPLETE */ + /* TODO: Freeze old TMSI */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TMSI_ACK, 0, 0); + return; + } + + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static void _proc_arq_vlr_post_trace(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + /* Node 3 */ + if (0 /* IMEI check required */) { + /* Chck_IMEI_VLR */ + vlr->ops.tx_id_req(par->msc_conn_ref, GSM_MI_TYPE_IMEI); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CHECK_IMEI, + vlr_timer(vlr, 3270), 3270); + } else + _proc_arq_vlr_post_imei(fi); +} + +/* After Subscriber_Present_VLR */ +static void _proc_arq_vlr_post_pres(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + if (0 /* TODO: tracing required */) { + /* TODO: Trace_Subscriber_Activity_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TRACE_SUB, 0, 0); + } + _proc_arq_vlr_post_trace(fi); +} + +/* After Update_Location_Child_VLR */ +static void _proc_arq_vlr_node2_post_vlr(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!vsub->sub_dataconf_by_hlr_ind) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + if (0 /* roaming not allowed in LA */) { + /* Set User Error: Roaming not allowed in this LA */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ROAMING_NOTALLOWED); + return; + } + vsub->imsi_detached_flag = false; + if (vsub->ms_not_reachable_flag) { + /* Start Subscriber_Present_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_SUB_PRES, 0, 0); + par->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + PR_ARQ_E_PRES_RES); + return; + } + _proc_arq_vlr_post_pres(fi); +} + +static void _proc_arq_vlr_node2_post_ciph(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + vsub->conf_by_radio_contact_ind = true; + if (vsub->loc_conf_in_hlr_ind == false) { + /* start Update_Location_Child_VLR. WE use + * Update_HLR_VLR instead, the differences appear + * insignificant for now. */ + par->ul_child_fsm = upd_hlr_vlr_proc_start(fi, vsub, + PR_ARQ_E_UPD_LOC_RES); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_UPD_LOC_CHILD, 0, 0); + return; + } + _proc_arq_vlr_node2_post_vlr(fi); +} + +static bool is_ciph_required(struct proc_arq_priv *par) +{ + return par->ciphering_required != VLR_CIPH_NONE; +} + +static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!is_ciph_required(par)) { + _proc_arq_vlr_node2_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, par->msc_conn_ref, + par->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_SYSTEM_FAILURE); + return; + } + + par->implicitly_accepted_parq_by_ciphering_cmd = true; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CIPH, 0, 0); +} + +static bool is_auth_required(struct proc_arq_priv *par) +{ + /* 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); +} + +/* after the IMSI is known */ +static void proc_arq_vlr_fn_post_imsi(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + /* TODO: Identity IMEI -> System Failure */ + if (is_auth_required(par)) { + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_AUTH, + 0, 0); + vsub->auth_fsm = auth_fsm_start(vsub, fi->log_level, fi, + PR_ARQ_E_AUTH_RES, + par->is_r99, + par->is_utran); + } else { + _proc_arq_vlr_node2(fi); + } +} + +static void proc_arq_vlr_fn_init(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub = NULL; + + OSMO_ASSERT(event == PR_ARQ_E_START); + + /* Obtain_Identity_VLR */ + if (!par->by_tmsi) { + /* IMSI was included */ + vsub = vlr_subscr_find_by_imsi(par->vlr, par->imsi); + } else { + /* TMSI was included */ + vsub = vlr_subscr_find_by_tmsi(par->vlr, par->tmsi); + } + if (vsub) { + if (vsub->proc_arq_fsm && fi != vsub->proc_arq_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "Another proc_arq_fsm is already" + " associated with subscr %s," + " terminating the other FSM.\n", + vlr_subscr_name(vsub)); + proc_arq_fsm_done(vsub->proc_arq_fsm, + VLR_PR_ARQ_RES_SYSTEM_FAILURE); + } + vsub->proc_arq_fsm = fi; + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); + return; + } + /* No VSUB could be resolved. What now? */ + + if (!par->by_tmsi) { + /* We couldn't find a subscriber even by IMSI, + * Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } else { + /* TMSI was included, are we permitted to use it? */ + if (vlr->cfg.parq_retrieve_imsi) { + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_OBTAIN_IMSI, + vlr_timer(vlr, 3270), 3270); + return; + } else { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + } +} + +/* ID REQ(IMSI) has returned */ +static void proc_arq_vlr_fn_w_obt_imsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub; + + OSMO_ASSERT(event == PR_ARQ_E_ID_IMSI); + + vsub = vlr_subscr_find_by_imsi(vlr, par->imsi); + if (!vsub) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); +} + +/* Authenticate_VLR has completed */ +static void proc_arq_vlr_fn_w_auth(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + enum vlr_auth_fsm_result *res = data; + enum vlr_proc_arq_result ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + + OSMO_ASSERT(res); + LOGPFSM(fi, "got %s\n", vlr_auth_fsm_result_name(*res)); + + OSMO_ASSERT(event == PR_ARQ_E_AUTH_RES); + + if (res) { + switch (*res) { + case VLR_AUTH_RES_PASSED: + /* Node 2 */ + _proc_arq_vlr_node2(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* Error */ + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* Set User Error: Unidentified Subscriber */ + ret = VLR_PR_ARQ_RES_UNIDENT_SUBSCR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* Set User Error: Illegal Subscriber */ + ret = VLR_PR_ARQ_RES_ILLEGAL_SUBSCR; + break; + case VLR_AUTH_RES_PROC_ERR: + /* Set User Error: System failure */ + ret = VLR_PR_ARQ_RES_SYSTEM_FAILURE; + break; + } + } + /* send process_access_req response to caller */ + /* enter error state */ + proc_arq_fsm_done(fi, ret); +} + +static void proc_arq_vlr_fn_w_ciph(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == PR_ARQ_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + } + + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + _proc_arq_vlr_node2_post_ciph(fi); +} + +/* Update_Location_Child_VLR has completed */ +static void proc_arq_vlr_fn_w_upd_loc(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_UPD_LOC_RES); + + _proc_arq_vlr_node2_post_vlr(fi); +} + +/* Subscriber_Present_VLR has completed */ +static void proc_arq_vlr_fn_w_pres(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_PRES_RES); + + _proc_arq_vlr_post_pres(fi); +} + +static void proc_arq_vlr_fn_w_trace(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TRACE_RES); + + _proc_arq_vlr_post_trace(fi); +} + +/* we have received the ID RESPONSE (IMEI) */ +static void proc_arq_vlr_fn_w_imei(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_IMEI_RES); + + _proc_arq_vlr_post_imei(fi); +} + +/* MSC tells us that MS has acknowleded TMSI re-allocation */ +static void proc_arq_vlr_fn_w_tmsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TMSI_ACK); + + /* FIXME: check confirmation? unfreeze? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static const struct osmo_fsm_state proc_arq_vlr_states[] = { + [PR_ARQ_S_INIT] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_INIT), + .in_event_mask = S(PR_ARQ_E_START), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_OBTAIN_IMSI) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_init, + }, + [PR_ARQ_S_WAIT_OBTAIN_IMSI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_OBTAIN_IMSI), + .in_event_mask = S(PR_ARQ_E_ID_IMSI), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_obt_imsi, + }, + [PR_ARQ_S_WAIT_AUTH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_AUTH), + .in_event_mask = S(PR_ARQ_E_AUTH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CIPH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_auth, + }, + [PR_ARQ_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CIPH), + .in_event_mask = S(PR_ARQ_E_CIPH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_ciph, + }, + [PR_ARQ_S_WAIT_UPD_LOC_CHILD] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_UPD_LOC_CHILD), + .in_event_mask = S(PR_ARQ_E_UPD_LOC_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_upd_loc, + }, + [PR_ARQ_S_WAIT_SUB_PRES] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_SUB_PRES), + .in_event_mask = S(PR_ARQ_E_PRES_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_pres, + }, + [PR_ARQ_S_WAIT_TRACE_SUB] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TRACE_SUB), + .in_event_mask = S(PR_ARQ_E_TRACE_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_trace, + }, + [PR_ARQ_S_WAIT_CHECK_IMEI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CHECK_IMEI), + .in_event_mask = S(PR_ARQ_E_IMEI_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_imei, + }, + [PR_ARQ_S_WAIT_TMSI_ACK] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TMSI_ACK), + .in_event_mask = S(PR_ARQ_E_TMSI_ACK), + .out_state_mask = S(PR_ARQ_S_DONE), + .action = proc_arq_vlr_fn_w_tmsi, + }, + [PR_ARQ_S_DONE] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_DONE), + .onenter = proc_arq_vlr_dispatch_result, + }, +}; + +static struct osmo_fsm proc_arq_vlr_fsm = { + .name = "Process_Access_Request_VLR", + .states = proc_arq_vlr_states, + .num_states = ARRAY_SIZE(proc_arq_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = proc_arq_vlr_event_names, + .cleanup = proc_arq_vlr_cleanup, +}; + +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct proc_arq_priv *par; + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type; + + fi = osmo_fsm_inst_alloc_child(&proc_arq_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return; + + par = talloc_zero(fi, struct proc_arq_priv); + fi->priv = par; + par->vlr = vlr; + par->msc_conn_ref = msc_conn_ref; + par->type = type; + par->lai = *lai; + par->parent_event_success = parent_event_success; + par->parent_event_failure = parent_event_failure; + par->parent_event_data = parent_event_data; + par->authentication_required = authentication_required; + par->ciphering_required = ciphering_required; + par->is_r99 = is_r99; + par->is_utran = is_utran; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi_lv+1, mi_lv[0]); + mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); + par->imsi[sizeof(par->imsi)-1] = '\0'; + par->by_tmsi = false; + break; + case GSM_MI_TYPE_TMSI: + par->by_tmsi = true; + par->tmsi = osmo_load32be(mi_lv+2); + break; + case GSM_MI_TYPE_IMEI: + /* TODO: IMEI (emergency call) */ + default: + /* FIXME: directly send reject? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + + osmo_fsm_inst_dispatch(fi, PR_ARQ_E_START, NULL); +} + +/* Gracefully terminate an FSM created by vlr_proc_acc_req() in case of + * external timeout (i.e. from MSC). */ +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == PR_ARQ_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_TIMEOUT); +} + + +#if 0 +/*********************************************************************** + * Update_Location_Child_VLR, TS 29.002 Chapter 25.4.4 + ***********************************************************************/ + +enum upd_loc_child_vlr_state { + ULC_S_IDLE, + ULC_S_WAIT_HLR_RESP, + ULC_S_DONE, +}; + +enum upd_loc_child_vlr_event { + ULC_E_START, +}; + +static const struct value_string upd_loc_child_vlr_event_names[] = { + { ULC_E_START, "START" }, + { 0, NULL } +}; + +static void upd_loc_child_f_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + OSMO_ASSERT(event == ULC_E_START); + + /* send update location */ +} + +static void upd_loc_child_f_w_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ +} + +static const struct osmo_fsm_state upd_loc_child_vlr_states[] = { + [ULC_S_IDLE] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_WAIT_HLR_RESP) | + S(ULC_S_DONE), + .name = "IDLE", + .action = upd_loc_child_f_idle, + }, + [ULC_S_WAIT_HLR_RESP] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_DONE), + .name = "WAIT-HLR-RESP", + .action = upd_loc_child_f_w_hlr, + }, + [ULC_S_DONE] = { + .name = "DONE", + }, +}; + +static struct osmo_fsm upd_loc_child_vlr_fsm = { + .name = "Update_Location_Child_VLR", + .states = upd_loc_child_vlr_states, + .num_states = ARRAY_SIZE(upd_loc_child_vlr_states), + .log_subsys = DVLR, + .event_names = upd_loc_child_vlr_event_names, +}; +#endif + +void vlr_parq_fsm_init(void) +{ + //osmo_fsm_register(&upd_loc_child_vlr_fsm); + osmo_fsm_register(&proc_arq_vlr_fsm); +} diff --git a/src/libvlr/vlr_access_req_fsm.h b/src/libvlr/vlr_access_req_fsm.h new file mode 100644 index 0000000..8386da6 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.h @@ -0,0 +1,17 @@ +#pragma once + +enum proc_arq_vlr_state { + PR_ARQ_S_INIT, + /* Waiting for Obtain_Identity_VLR (IMSI) result */ + PR_ARQ_S_WAIT_OBTAIN_IMSI, + /* Waiting for Authenticate_VLR result */ + PR_ARQ_S_WAIT_AUTH, + PR_ARQ_S_WAIT_CIPH, + PR_ARQ_S_WAIT_UPD_LOC_CHILD, + PR_ARQ_S_WAIT_SUB_PRES, + PR_ARQ_S_WAIT_TRACE_SUB, + PR_ARQ_S_WAIT_CHECK_IMEI, + PR_ARQ_S_WAIT_TMSI_ACK, + PR_ARQ_S_WAIT_CECK_CONF, + PR_ARQ_S_DONE, +}; diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c new file mode 100644 index 0000000..0eb86e7 --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.c @@ -0,0 +1,605 @@ +/* Osmocom Visitor Location Register (VLR) Autentication FSM */ + +/* (C) 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 +#include +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" + +#define S(x) (1 << (x)) + +static const struct value_string fsm_auth_event_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_E_START), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_NACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ABORT), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_RESP), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_FAIL), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_ID_IMSI), + { 0, NULL } +}; + +const struct value_string vlr_auth_fsm_result_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_RES_ABORTED), + OSMO_VALUE_STRING(VLR_AUTH_RES_UNKNOWN_SUBSCR), + OSMO_VALUE_STRING(VLR_AUTH_RES_PROC_ERR), + OSMO_VALUE_STRING(VLR_AUTH_RES_AUTH_FAILED), + OSMO_VALUE_STRING(VLR_AUTH_RES_PASSED), + {0, NULL} +}; + +/* private state of the auth_fsm_instance */ +struct auth_fsm_priv { + struct vlr_subscr *vsub; + bool by_imsi; + bool is_r99; + bool is_utran; + bool auth_requested; + + int auth_tuple_max_use_count; /* see vlr->cfg instead */ +}; + +/*********************************************************************** + * Utility functions + ***********************************************************************/ + +/* Always use either vlr_subscr_get_auth_tuple() or vlr_subscr_has_auth_tuple() + * instead, to ensure proper use count. + * Return an auth tuple with the lowest use_count among the auth tuples. If + * max_use_count >= 0, return NULL if all available auth tuples have a use + * count > max_use_count. If max_use_count is negative, return a currently + * least used auth tuple without enforcing a maximum use count. If there are + * no auth tuples, return NULL. + */ +static struct gsm_auth_tuple * +_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + unsigned int count; + unsigned int idx; + struct gsm_auth_tuple *at = NULL; + unsigned int key_seq = GSM_KEY_SEQ_INVAL; + + if (!vsub) + return NULL; + + if (vsub->last_tuple) + key_seq = vsub->last_tuple->key_seq; + + if (key_seq == GSM_KEY_SEQ_INVAL) + /* Start with 0 after increment modulo array size */ + idx = ARRAY_SIZE(vsub->auth_tuples) - 1; + else + idx = key_seq; + + for (count = ARRAY_SIZE(vsub->auth_tuples); count > 0; count--) { + idx = (idx + 1) % ARRAY_SIZE(vsub->auth_tuples); + + if (vsub->auth_tuples[idx].key_seq == GSM_KEY_SEQ_INVAL) + continue; + + if (!at || vsub->auth_tuples[idx].use_count < at->use_count) + at = &vsub->auth_tuples[idx]; + } + + if (!at || (max_use_count >= 0 && at->use_count > max_use_count)) + return NULL; + + return at; +} + +/* Return an auth tuple and increment its use count. */ +static struct gsm_auth_tuple * +vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + struct gsm_auth_tuple *at = _vlr_subscr_next_auth_tuple(vsub, + max_use_count); + if (!at) + return NULL; + at->use_count++; + return at; +} + +/* Return whether an auth tuple with the given max_use_count is available. */ +static bool vlr_subscr_has_auth_tuple(struct vlr_subscr *vsub, + int max_use_count) +{ + return _vlr_subscr_next_auth_tuple(vsub, max_use_count) != NULL; +} + +static bool check_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, + uint8_t res_len) +{ + struct gsm_auth_tuple *at = vsub->last_tuple; + struct osmo_auth_vector *vec = &at->vec; + bool check_umts; + OSMO_ASSERT(at); + + LOGVSUBP(LOGL_DEBUG, vsub, "received res: %s\n", + osmo_hexdump(res, res_len)); + + /* RES must be present and at least 32bit */ + if (!res || res_len < sizeof(vec->sres)) { + LOGVSUBP(LOGL_NOTICE, vsub, "AUTH RES missing or too short " + "(%u)\n", res_len); + goto out_false; + } + + check_umts = false; + if (is_r99 && (vec->auth_types & OSMO_AUTH_TYPE_UMTS)) { + check_umts = true; + /* We have a R99 capable UE and have a UMTS AKA capable USIM. + * However, the ME may still choose to only perform GSM AKA, as + * long as the bearer is GERAN */ + if (res_len != vec->res_len) { + if (is_utran) { + LOGVSUBP(LOGL_NOTICE, vsub, + "AUTH via UTRAN but " + "res_len(%u) != vec->res_len(%u)\n", + res_len, vec->res_len); + goto out_false; + } + check_umts = false; + } + } + + if (check_umts) { + if (res_len != vec->res_len + || memcmp(res, vec->res, res_len)) { + LOGVSUBP(LOGL_INFO, vsub, "UMTS AUTH failure:" + " mismatching res (expected res=%s)\n", + osmo_hexdump(vec->res, vec->res_len)); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established UMTS security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_UMTS; + return true; + } else { + if (res_len != sizeof(vec->sres) + || memcmp(res, vec->sres, sizeof(vec->sres))) { + LOGVSUBP(LOGL_INFO, vsub, "GSM AUTH failure:" + " mismatching sres (expected sres=%s)\n", + osmo_hexdump(vec->sres, sizeof(vec->sres))); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established GSM security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_GSM; + return true; + } + +out_false: + vsub->sec_ctx = VLR_SEC_CTX_NONE; + return false; +} + +static void auth_fsm_onenter_failed(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + /* If authentication hasn't even started, e.g. the HLR sent no auth + * info, then we also don't need to tell the HLR about an auth failure. + */ + if (afp->auth_requested) + vlr_subscr_tx_auth_fail_rep(vsub); +} + +static bool is_umts_auth(struct auth_fsm_priv *afp, + uint32_t auth_types) +{ + if (!afp->is_r99) + return false; + if (!(auth_types & OSMO_AUTH_TYPE_UMTS)) + return false; + return true; +} + +/* Terminate the Auth FSM Instance and notify parent */ +static void auth_fsm_term(struct osmo_fsm_inst *fi, enum vlr_auth_fsm_result res) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + LOGPFSM(fi, "Authentication terminating with result %s\n", + vlr_auth_fsm_result_name(res)); + + /* Do one final state transition (mostly for logging purpose) */ + if (res == VLR_AUTH_RES_PASSED) + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTHENTICATED, 0, 0); + else + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTH_FAILED, 0, 0); + + /* return the result to the parent FSM */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, &res); + vsub->auth_fsm = NULL; +} + +/* back-end function transmitting authentication. Caller ensures we have valid + * tuple */ +static int _vlr_subscr_authenticate(struct osmo_fsm_inst *fi) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct gsm_auth_tuple *at; + + /* Caller ensures we have vectors available */ + at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_use_count); + if (!at) { + LOGPFSML(fi, LOGL_ERROR, "A previous check ensured that an" + " auth tuple was available, but now there is in fact" + " none.\n"); + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return -1; + } + + LOGPFSM(fi, "got auth tuple: use_count=%d key_seq=%d\n", + at->use_count, at->key_seq); + + OSMO_ASSERT(at); + + /* Transmit auth req to subscriber */ + afp->auth_requested = true; + vsub->last_tuple = at; + vsub->vlr->ops.tx_auth_req(vsub->msc_conn_ref, at, + is_umts_auth(afp, at->vec.auth_types)); + return 0; +} + +/*********************************************************************** + * FSM State Action functions + ***********************************************************************/ + +/* Initial State of TS 23.018 AUT_VLR */ +static void auth_fsm_needs_auth(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + OSMO_ASSERT(event == VLR_AUTH_E_START); + + /* Start off with the default max_use_count, possibly change that if we + * need to re-use an old tuple. */ + afp->auth_tuple_max_use_count = vsub->vlr->cfg.auth_tuple_max_use_count; + + /* Check if we have vectors available */ + if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_use_count)) { + /* Obtain_Authentication_Sets_VLR */ + vlr_subscr_req_sai(vsub, NULL, NULL); + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + GSM_29002_TIMER_M, 0); + } else { + /* go straight ahead with sending auth request */ + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); + } +} + +/* Waiting for Authentication Info from HLR */ +static void auth_fsm_wait_ai(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + if (event == VLR_AUTH_E_HLR_SAI_NACK) + LOGPFSM(fi, "GSUP: rx Auth Info Error cause: %d: %s\n", + gsup->cause, + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) + || (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) + || (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + if (vsub->vlr->cfg.auth_reuse_old_sets_on_error + && vlr_subscr_has_auth_tuple(vsub, -1)) { + /* To re-use an old tuple, disable the max_use_count + * constraint. */ + afp->auth_tuple_max_use_count = -1; + goto pass; + } + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return; + } + + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for Authentication Response from MS */ +static void auth_fsm_wait_auth_resp(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_instance *vlr = vsub->vlr; + struct vlr_auth_resp_par *par = data; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + } + } else { + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + if (par->auts) { + /* First failure, start re-sync attempt */ + vlr_subscr_req_sai(vsub, par->auts, + vsub->last_tuple->vec.rand); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + GSM_29002_TIMER_M, 0); + } else + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* Waiting for Authentication Info from HLR (resync case) */ +static void auth_fsm_wait_ai_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) || + (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) || + (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + } + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP_RESYNC, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for AUTH RESP from MS (re-sync case) */ +static void auth_fsm_wait_auth_resp_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_auth_resp_par *par = data; + struct vlr_instance *vlr = vsub->vlr; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + /* Result = Aborted */ + auth_fsm_term(fi, VLR_AUTH_RES_ABORTED); + } + } else { + /* Result = Pass */ + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + /* Second failure: Result = Fail */ + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* AUT_VLR waiting for Obtain_IMSI_VLR result */ +static void auth_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + const char *mi_string = data; + + switch (event) { + case VLR_AUTH_E_MS_ID_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else { + strncpy(vsub->imsi, mi_string, sizeof(vsub->imsi)); + vsub->imsi[sizeof(vsub->imsi)-1] = '\0'; + } + /* retry with identity=IMSI */ + afp->by_imsi = true; + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH, 0, 0); + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + break; + } +} + +static const struct osmo_fsm_state auth_fsm_states[] = { + [VLR_SUB_AS_NEEDS_AUTH] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH), + .in_event_mask = S(VLR_AUTH_E_START), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_needs_auth, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_AI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_wait_ai, + }, + [VLR_SUB_AS_WAIT_RESP] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_WAIT_ID_IMSI) | + S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED) | + S(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .action = auth_fsm_wait_auth_resp, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP_RESYNC), + .action = auth_fsm_wait_ai_resync, + }, + [VLR_SUB_AS_WAIT_RESP_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP_RESYNC), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED), + .action = auth_fsm_wait_auth_resp_resync, + }, + [VLR_SUB_AS_WAIT_ID_IMSI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_ID_IMSI), + .in_event_mask = S(VLR_AUTH_E_MS_ID_IMSI), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH), + .action = auth_fsm_wait_imsi, + }, + [VLR_SUB_AS_AUTHENTICATED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTHENTICATED), + .in_event_mask = 0, + .out_state_mask = 0, + }, + [VLR_SUB_AS_AUTH_FAILED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTH_FAILED), + .in_event_mask = 0, + .out_state_mask = 0, + .onenter = auth_fsm_onenter_failed, + }, +}; + +struct osmo_fsm vlr_auth_fsm = { + .name = "VLR_Authenticate", + .states = auth_fsm_states, + .num_states = ARRAY_SIZE(auth_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_auth_event_names, +}; + +/*********************************************************************** + * User API (for SGSN/MSC code) + ***********************************************************************/ + +/* MSC->VLR: Start Procedure Authenticate_VLR (TS 23.012 Ch. 4.1.2.2) */ +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct auth_fsm_priv *afp; + + fi = osmo_fsm_inst_alloc_child(&vlr_auth_fsm, parent, + parent_term_event); + + + afp = talloc_zero(fi, struct auth_fsm_priv); + if (!afp) { + osmo_fsm_inst_dispatch(parent, parent_term_event, 0); + return NULL; + } + + afp->vsub = vsub; + if (vsub->imsi[0]) + afp->by_imsi = true; + afp->is_r99 = is_r99; + afp->is_utran = is_utran; + fi->priv = afp; + vsub->auth_fsm = fi; + + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + + return fi; +} diff --git a/src/libvlr/vlr_auth_fsm.h b/src/libvlr/vlr_auth_fsm.h new file mode 100644 index 0000000..226435f --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.h @@ -0,0 +1,52 @@ +#pragma once + +#include + +/* Parameters to VLR_AUTH_E_MS_AUTH_RESP */ +struct vlr_auth_resp_par { + bool is_r99; + bool is_utran; + const uint8_t *res; + unsigned int res_len; + const uint8_t *auts; +}; + +/* Result communicated back to parent FMS */ +enum vlr_auth_fsm_result { + VLR_AUTH_RES_ABORTED, + VLR_AUTH_RES_UNKNOWN_SUBSCR, + VLR_AUTH_RES_PROC_ERR, + VLR_AUTH_RES_AUTH_FAILED, + VLR_AUTH_RES_PASSED, +}; + +extern const struct value_string vlr_auth_fsm_result_names[]; +static inline const char *vlr_auth_fsm_result_name(enum vlr_auth_fsm_result val) +{ + return get_value_string(vlr_auth_fsm_result_names, val); +} + +enum vlr_fsm_auth_event { + VLR_AUTH_E_START, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo ACK from HLR */ + VLR_AUTH_E_HLR_SAI_ACK, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo NACK from HLR */ + VLR_AUTH_E_HLR_SAI_NACK, + /* FIXME: merge with NACK? */ + VLR_AUTH_E_HLR_SAI_ABORT, + /* Authentication Response from MS */ + VLR_AUTH_E_MS_AUTH_RESP, + /* Authentication Failure from MS */ + VLR_AUTH_E_MS_AUTH_FAIL, + /* Identity Response (IMSI) from MS */ + VLR_AUTH_E_MS_ID_IMSI, +}; + +struct osmo_fsm vlr_auth_fsm; + +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran); diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h new file mode 100644 index 0000000..0e63c7e --- /dev/null +++ b/src/libvlr/vlr_core.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#define LOGGSUPP(level, gsup, fmt, args...) \ + LOGP(DVLR, level, "GSUP(%s) " fmt, \ + (gsup)->imsi, \ + ## args) + +#define LOGVSUBP(level, vsub, fmt, args...) \ + LOGP(DVLR, level, "SUBSCR(%s) " fmt, \ + vlr_subscr_name(vsub), ## args) + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps); +int vlr_subscr_req_sai(struct vlr_subscr *vsub, const uint8_t *auts, + const uint8_t *auts_rand); +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c new file mode 100644 index 0000000..d32659f --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.c @@ -0,0 +1,1424 @@ +/* Osmocom Visitor Location Register (VLR): Location Update FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" + +#define S(x) (1 << (x)) + +#define LU_TIMEOUT_LONG 30 + +enum vlr_fsm_result { + VLR_FSM_RESULT_NONE, + VLR_FSM_RESULT_SUCCESS, + VLR_FSM_RESULT_FAILURE, +}; + + +/*********************************************************************** + * Update_HLR_VLR, TS 23.012 Chapter 4.1.2.4 + ***********************************************************************/ + +enum upd_hlr_vlr_state { + UPD_HLR_VLR_S_INIT, + UPD_HLR_VLR_S_WAIT_FOR_DATA, + UPD_HLR_VLR_S_DONE, +}; + +enum upd_hlr_vlr_evt { + UPD_HLR_VLR_E_START, + UPD_HLR_VLR_E_INS_SUB_DATA, + UPD_HLR_VLR_E_ACT_TRACE_MODE, + UPD_HLR_VLR_E_FW_CHECK_SS_IND, + UPD_HLR_VLR_E_UPD_LOC_ACK, + UPD_HLR_VLR_E_UPD_LOC_NACK, +}; + +static const struct value_string upd_hlr_vlr_event_names[] = { + OSMO_VALUE_STRING(UPD_HLR_VLR_E_START), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_INS_SUB_DATA), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_ACT_TRACE_MODE), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_FW_CHECK_SS_IND), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_ACK), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_NACK), + { 0, NULL } +}; + +static void upd_hlr_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + OSMO_ASSERT(event == UPD_HLR_VLR_E_START); + + /* Send UpdateLocation to HLR */ + vlr_subscr_req_lu(vsub, vsub->vlr->cfg.is_ps); + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_WAIT_FOR_DATA, + LU_TIMEOUT_LONG, 0); +} + +static void upd_hlr_vlr_fsm_wait_data(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case UPD_HLR_VLR_E_INS_SUB_DATA: + /* FIXME: Insert_Subscr_Data_VLR */ + break; + case UPD_HLR_VLR_E_ACT_TRACE_MODE: + /* TODO: Activate_Tracing_VLR */ + break; + case UPD_HLR_VLR_E_FW_CHECK_SS_IND: + /* TODO: Forward Check SS Ind to MSC */ + break; + case UPD_HLR_VLR_E_UPD_LOC_ACK: + /* Inside Update_HLR_VLR after UpdateLocationAck */ + vsub->sub_dataconf_by_hlr_ind = true; + vsub->loc_conf_in_hlr_ind = true; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + case UPD_HLR_VLR_E_UPD_LOC_NACK: + /* Inside Update_HLR_VLR after UpdateLocationNack */ + /* TODO: Check_User_Error_In_Serving_Network_Entity */ + vsub->sub_dataconf_by_hlr_ind = false; + vsub->loc_conf_in_hlr_ind = false; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + /* Data is a pointer to a gsm48_gmm_cause which we + * simply pass through */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, data); + break; + } +} + +static const struct osmo_fsm_state upd_hlr_vlr_states[] = { + [UPD_HLR_VLR_S_INIT] = { + .in_event_mask = S(UPD_HLR_VLR_E_START), + .out_state_mask = S(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_INIT), + .action = upd_hlr_vlr_fsm_init, + }, + [UPD_HLR_VLR_S_WAIT_FOR_DATA] = { + .in_event_mask = S(UPD_HLR_VLR_E_INS_SUB_DATA) | + S(UPD_HLR_VLR_E_ACT_TRACE_MODE) | + S(UPD_HLR_VLR_E_FW_CHECK_SS_IND) | + S(UPD_HLR_VLR_E_UPD_LOC_ACK) | + S(UPD_HLR_VLR_E_UPD_LOC_NACK), + .out_state_mask = S(UPD_HLR_VLR_S_DONE), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .action = upd_hlr_vlr_fsm_wait_data, + }, + [UPD_HLR_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_DONE), + }, +}; + +static struct osmo_fsm upd_hlr_vlr_fsm = { + .name = "upd_hlr_vlr_fsm", + .states = upd_hlr_vlr_states, + .num_states = ARRAY_SIZE(upd_hlr_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = upd_hlr_vlr_event_names, +}; + +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&upd_hlr_vlr_fsm, parent, + parent_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, UPD_HLR_VLR_E_START, NULL); + + return fi; +} + + +/*********************************************************************** + * Subscriber_Present_VLR, TS 29.002 Chapter 25.10.1 + ***********************************************************************/ + +enum sub_pres_vlr_state { + SUB_PRES_VLR_S_INIT, + SUB_PRES_VLR_S_WAIT_FOR_HLR, + SUB_PRES_VLR_S_DONE, +}; + +enum sub_pres_vlr_event { + SUB_PRES_VLR_E_START, + SUB_PRES_VLR_E_READY_SM_CNF, + SUB_PRES_VLR_E_READY_SM_ERR, +}; + +static const struct value_string sub_pres_vlr_event_names[] = { + OSMO_VALUE_STRING(SUB_PRES_VLR_E_START), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_CNF), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_ERR), + { 0, NULL } +}; + +static void sub_pres_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + OSMO_ASSERT(event == SUB_PRES_VLR_E_START); + + if (!vsub->ms_not_reachable_flag) { + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + return; + } + /* FIXME: Send READY_FOR_SM via GSUP */ + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_WAIT_FOR_HLR, + LU_TIMEOUT_LONG, 0); +} + +static void sub_pres_vlr_fsm_wait_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case SUB_PRES_VLR_E_READY_SM_CNF: + vsub->ms_not_reachable_flag = false; + break; + case SUB_PRES_VLR_E_READY_SM_ERR: + break; + } + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +static const struct osmo_fsm_state sub_pres_vlr_states[] = { + [SUB_PRES_VLR_S_INIT] = { + .in_event_mask = S(SUB_PRES_VLR_E_START), + .out_state_mask = S(SUB_PRES_VLR_S_WAIT_FOR_HLR) | + S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_INIT), + .action = sub_pres_vlr_fsm_init, + }, + [SUB_PRES_VLR_S_WAIT_FOR_HLR] = { + .in_event_mask = S(SUB_PRES_VLR_E_READY_SM_CNF) | + S(SUB_PRES_VLR_E_READY_SM_ERR), + .out_state_mask = S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_WAIT_FOR_HLR), + .action = sub_pres_vlr_fsm_wait_hlr, + }, + [SUB_PRES_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_DONE), + }, +}; + +static struct osmo_fsm sub_pres_vlr_fsm = { + .name = "sub_pres_vlr_fsm", + .states = sub_pres_vlr_states, + .num_states = ARRAY_SIZE(sub_pres_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = sub_pres_vlr_event_names, +}; + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&sub_pres_vlr_fsm, parent, + term_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, SUB_PRES_VLR_E_START, NULL); + + return fi; +} + +/*********************************************************************** + * Location_Update_Completion_VLR, TS 23.012 Chapter 4.1.2.3 + ***********************************************************************/ + +enum lu_compl_vlr_state { + LU_COMPL_VLR_S_INIT, + LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_COMPL_VLR_S_WAIT_IMEI, + LU_COMPL_VLR_S_WAIT_IMEI_TMSI, + LU_COMPL_VLR_S_WAIT_TMSI_CNF, + LU_COMPL_VLR_S_DONE, +}; + +enum lu_compl_vlr_event { + LU_COMPL_VLR_E_START, + LU_COMPL_VLR_E_SUB_PRES_COMPL, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, + LU_COMPL_VLR_E_IMEI_CHECK_NACK, + LU_COMPL_VLR_E_NEW_TMSI_ACK, +}; + +static const struct value_string lu_compl_vlr_event_names[] = { + OSMO_VALUE_STRING(LU_COMPL_VLR_E_START), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_SUB_PRES_COMPL), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_ACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_compl_vlr_priv { + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t cause; + bool assign_tmsi; +}; + +static void _vlr_lu_compl_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result, + uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->result = result; + lcvp->cause = cause; + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_DONE, 0, 0); +} + +static void vlr_lu_compl_fsm_success(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + if (!vsub->lu_complete) { + vsub->lu_complete = true; + /* Balanced by vlr_subscr_rx_imsi_detach() */ + vlr_subscr_get(vsub); + } + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_SUCCESS, 0); +} + +static void vlr_lu_compl_fsm_failure(struct osmo_fsm_inst *fi, uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->vsub->vlr->ops.tx_lu_rej(lcvp->msc_conn_ref, cause); + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_FAILURE, cause); +} + +static void vlr_lu_compl_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lcvp->result == VLR_FSM_RESULT_SUCCESS) + ? lcvp->parent_event_success + : lcvp->parent_event_failure, + &lcvp->cause); +} + +static void lu_compl_vlr_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr; + OSMO_ASSERT(vsub); + vlr = vsub->vlr; + OSMO_ASSERT(vlr); + + OSMO_ASSERT(event == LU_COMPL_VLR_E_START); + + /* TODO: National Roaming restrictions? */ + /* TODO: Roaming restriction due to unsupported feature in subscriber + * data? */ + /* TODO: Regional subscription restriction? */ + /* TODO: Administrative restriction of subscribres' access feature? */ + /* TODO: AccessRestrictuionData parameter available? */ + /* TODO: AccessRestrictionData permits RAT? */ + /* Node 1 */ + /* TODO: Autonomous CSG supported in VPLMN and allowed by HPLMN? */ + /* TODO: Hybrid Cel / CSG Cell */ + /* Node 2 */ + vsub->la_allowed = true; + vsub->imsi_detached_flag = false; + /* Start Subscriber_Present_VLR Procedure */ + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_TIMEOUT_LONG, 0); + + lcvp->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + LU_COMPL_VLR_E_SUB_PRES_COMPL); + +} + +static void lu_compl_vlr_new_tmsi(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + if (vlr_subscr_alloc_tmsi(vsub)) { + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_TMSI_CNF, + vlr_timer(vlr, 3250), 3250); + + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, vsub->tmsi_new); +} + +/* After completion of Subscriber_Present_VLR */ +static void lu_compl_vlr_wait_subscr_pres(struct osmo_fsm_inst *fi, + uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_SUB_PRES_COMPL); + + lcvp->sub_pres_vlr_fsm = NULL; + + /* TODO: Trace_Subscriber_Activity_VLR */ + + if (vlr->cfg.check_imei_rqd) { + /* Check IMEI VLR */ + osmo_fsm_inst_state_chg(fi, + lcvp->assign_tmsi ? + LU_COMPL_VLR_S_WAIT_IMEI_TMSI + : LU_COMPL_VLR_S_WAIT_IMEI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lcvp->msc_conn_ref, GSM_MI_TYPE_IMEI); + return; + } + + /* Do we need to allocate a TMSI? */ + if (lcvp->assign_tmsi) { + lu_compl_vlr_new_tmsi(fi); + return; + } + + /* Location Updating Accept */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for completion of CHECK_IMEI_VLR */ +static void lu_compl_vlr_wait_imei(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + switch (event) { + case LU_COMPL_VLR_E_IMEI_CHECK_ACK: + if (!vsub->imei[0]) { + /* Abort: Do nothing */ + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_PROTOCOL_ERROR); + return; + } + /* Pass */ + break; + + case LU_COMPL_VLR_E_IMEI_CHECK_NACK: + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_ILLEGAL_ME); + /* FIXME: IMEI Check Fail to VLR Application (Detach IMSI VLR) */ + return; + } + + /* IMEI is available. Allocate TMSI if needed. */ + if (lcvp->assign_tmsi) { + if (fi->state != LU_COMPL_VLR_S_WAIT_IMEI_TMSI) + LOGPFSML(fi, LOGL_ERROR, + "TMSI required, expected to be in state" + " LU_COMPL_VLR_S_WAIT_IMEI_TMSI," + " am in %s instead\n", + osmo_fsm_state_name(fi->fsm, fi->state)); + /* Logged an error, continue anyway. */ + + lu_compl_vlr_new_tmsi(fi); + + /* Wait for TMSI ack */ + return; + } + + /* No TMSI needed, accept now. */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for TMSI confirmation */ +static void lu_compl_vlr_wait_tmsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_NEW_TMSI_ACK); + + if (!vsub || vsub->tmsi_new == GSM_RESERVED_TMSI) { + LOGPFSML(fi, LOGL_ERROR, "TMSI Realloc Compl implies that" + " the subscriber has a new TMSI allocated, but" + " the new TMSI is unset.\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + vsub->tmsi = vsub->tmsi_new; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + vlr_lu_compl_fsm_success(fi); +} + +static const struct osmo_fsm_state lu_compl_vlr_states[] = { + [LU_COMPL_VLR_S_INIT] = { + .in_event_mask = S(LU_COMPL_VLR_E_START), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_SUB_PRES) | + S(LU_COMPL_VLR_S_WAIT_IMEI), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_INIT), + .action = lu_compl_vlr_init, + }, + [LU_COMPL_VLR_S_WAIT_SUB_PRES] = { + .in_event_mask = S(LU_COMPL_VLR_E_SUB_PRES_COMPL), + .out_state_mask = S(LU_COMPL_VLR_S_WAIT_IMEI) | + S(LU_COMPL_VLR_S_WAIT_IMEI_TMSI) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF) | + S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_SUB_PRES), + .action = lu_compl_vlr_wait_subscr_pres, + }, + [LU_COMPL_VLR_S_WAIT_IMEI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_IMEI_TMSI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI_TMSI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_TMSI_CNF] = { + .in_event_mask = S(LU_COMPL_VLR_E_NEW_TMSI_ACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .action = lu_compl_vlr_wait_tmsi, + }, + [LU_COMPL_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_DONE), + .onenter = vlr_lu_compl_fsm_dispatch_result, + }, +}; + +static struct osmo_fsm lu_compl_vlr_fsm = { + .name = "lu_compl_vlr_fsm", + .states = lu_compl_vlr_states, + .num_states = ARRAY_SIZE(lu_compl_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = lu_compl_vlr_event_names, +}; + +struct osmo_fsm_inst * +lu_compl_vlr_proc_alloc(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_compl_vlr_priv *lcvp; + + fi = osmo_fsm_inst_alloc_child(&lu_compl_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return NULL; + + lcvp = talloc_zero(fi, struct lu_compl_vlr_priv); + lcvp->vsub = vsub; + lcvp->msc_conn_ref = msc_conn_ref; + lcvp->parent_event_success = parent_event_success; + lcvp->parent_event_failure = parent_event_failure; + lcvp->assign_tmsi = assign_tmsi; + fi->priv = lcvp; + + return fi; +} + + +/*********************************************************************** + * Update_Location_Area_VLR, TS 23.012 Chapter 4.1.2.1 + ***********************************************************************/ + +static const struct value_string fsm_lu_event_names[] = { + OSMO_VALUE_STRING(VLR_ULA_E_UPDATE_LA), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_ACK), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_NACK), + OSMO_VALUE_STRING(VLR_ULA_E_AUTH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_CIPH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMSI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEISV), + OSMO_VALUE_STRING(VLR_ULA_E_HLR_LU_RES), + OSMO_VALUE_STRING(VLR_ULA_E_UPD_HLR_COMPL), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_SUCCESS), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_FAILURE), + OSMO_VALUE_STRING(VLR_ULA_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_fsm_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *upd_hlr_vlr_fsm; + struct osmo_fsm_inst *lu_compl_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t rej_cause; + + enum vlr_lu_type type; + bool lu_by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id old_lai; + struct osmo_location_area_id new_lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool assign_tmsi; +}; + + +/* Determine if given location area is served by this VLR */ +static bool lai_in_this_vlr(struct vlr_instance *vlr, + const struct osmo_location_area_id *lai) +{ + /* TODO: VLR needs to keep a locally configued list of LAIs */ + return true; +} + +/* Determine if authentication is required */ +static bool is_auth_required(struct lu_fsm_priv *lfp) +{ + /* 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); +} + +/* Determine if ciphering is required */ +static bool is_ciph_required(struct lu_fsm_priv *lfp) +{ + return lfp->ciphering_required != VLR_CIPH_NONE; +} + +/* Determine if a HLR Update is required */ +static bool hlr_update_needed(struct vlr_subscr *vsub) +{ + /* TODO: properly decide this, rather than always assuming we + * need to update the HLR. */ + return true; +} + +static void lu_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lfp->result == VLR_FSM_RESULT_SUCCESS) + ? lfp->parent_event_success + : lfp->parent_event_failure, + lfp->parent_event_data); +} + +static void _lu_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->result = result; + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_DONE, 0, 0); +} + +static void lu_fsm_success(struct osmo_fsm_inst *fi) +{ + _lu_fsm_done(fi, VLR_FSM_RESULT_SUCCESS); +} + +static void lu_fsm_failure(struct osmo_fsm_inst *fi, uint8_t rej_cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (rej_cause) + lfp->vlr->ops.tx_lu_rej(lfp->msc_conn_ref, rej_cause); + _lu_fsm_done(fi, VLR_FSM_RESULT_FAILURE); +} + +static void vlr_loc_upd_start_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->lu_compl_vlr_fsm = + lu_compl_vlr_proc_alloc(fi, lfp->vsub, lfp->msc_conn_ref, + VLR_ULA_E_LU_COMPL_SUCCESS, + VLR_ULA_E_LU_COMPL_FAILURE, + lfp->assign_tmsi); + + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, LU_COMPL_VLR_E_START, NULL); +} + +static void lu_fsm_discard_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!lfp->lu_compl_vlr_fsm) + return; + osmo_fsm_inst_term(lfp->lu_compl_vlr_fsm, OSMO_FSM_TERM_PARENT, NULL); +} + +/* 4.1.2.1 Node 4 */ +static void vlr_loc_upd_node_4(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + bool hlr_unknown = false; + + LOGPFSM(fi, "%s()\n", __func__); + + if (hlr_unknown) { + /* FIXME: Delete subscriber record */ + /* LU REJ: Roaming not allowed */ + lu_fsm_failure(fi, GSM48_REJECT_ROAMING_NOT_ALLOWED); + } else { + /* Update_HLR_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_HLR_UPD, + LU_TIMEOUT_LONG, 0); + lfp->upd_hlr_vlr_fsm = + upd_hlr_vlr_proc_start(fi, vsub, VLR_ULA_E_UPD_HLR_COMPL); + } +} + +/* 4.1.2.1 Node B */ +static void vlr_loc_upd_node_b(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + + /* FIXME */ + if (0) { /* IMEISV or PgA to send */ + vlr_loc_upd_node_4(fi); + } else { + /* Location_Update_Completion */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } +} + +/* Non-standard: after Ciphering Mode Complete (or no ciph required) */ +static void vlr_loc_upd_post_ciph(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + vsub->conf_by_radio_contact_ind = true; + /* Update LAI */ + vsub->cgi.lai = lfp->new_lai; + vsub->dormant_ind = false; + vsub->cancel_loc_rx = false; + if (hlr_update_needed(vsub)) { + vlr_loc_upd_node_4(fi); + } else { + /* TODO: ADD Support */ + /* TODO: Node A: PgA Support */ + vlr_loc_upd_node_b(fi); + } +} + +/* 4.1.2.1 after Authentication successful (or no auth rqd) */ +static void vlr_loc_upd_post_auth(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (!is_ciph_required(lfp)) { + vlr_loc_upd_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, lfp->msc_conn_ref, + lfp->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_CIPH, LU_TIMEOUT_LONG, 0); +} + +static void vlr_loc_upd_node1(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (is_auth_required(lfp)) { + /* Authenticate_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_AUTH, + LU_TIMEOUT_LONG, 0); + vsub->auth_fsm = auth_fsm_start(lfp->vsub, fi->log_level, + fi, VLR_ULA_E_AUTH_RES, + lfp->is_r99, + lfp->is_utran); + } else { + /* no need for authentication */ + vlr_loc_upd_post_auth(fi); + } +} + +static void vlr_loc_upd_want_imsi(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(lfp->vsub); + + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMSI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMSI); + /* will continue at vlr_loc_upd_node1() once IMSI arrives */ +} + +static int assoc_lfp_with_sub(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + if (vsub->lu_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "A Location Updating process is already pending for" + " this subscriber. Aborting.\n"); + /* Also get rid of the other pending LU attempt? */ + /*lu_fsm_failure(vsub->lu_fsm, GSM48_REJECT_CONGESTION);*/ + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); + return -EINVAL; + } + vsub->lu_fsm = fi; + vsub->msc_conn_ref = lfp->msc_conn_ref; + /* FIXME: send new LAC to HLR? */ + vsub->lac = lfp->new_lai.lac; + lfp->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(lfp->msc_conn_ref, lfp->vsub); + return 0; +} + +static const char *lai_name(struct osmo_location_area_id *lai) +{ + static char buf[64]; + snprintf(buf, sizeof(buf),"MCC:%u, MNC:%u, LAC:%u", + lai->plmn.mcc, lai->plmn.mnc, lai->lac); + return buf; +} + +/* 4.1.2.1: Subscriber (via MSC/SGSN) requests location update */ +static void _start_lu_main(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + struct vlr_subscr *vsub = NULL; + bool created; + + /* TODO: PUESBINE related handling */ + + /* Is previous LAI in this VLR? */ + if (!lai_in_this_vlr(vlr, &lfp->old_lai)) { +#if 0 + /* FIXME: check previous VLR, (3) */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_PVLR, + LU_TIMEOUT_LONG, 0); + return; +#endif + LOGPFSML(fi, LOGL_NOTICE, "LAI change from %s," + " but checking previous VLR not implemented\n", + lai_name(&lfp->old_lai)); + } + + if (!lfp->imsi[0]) { + /* TMSI was used */ + lfp->lu_by_tmsi = true; + /* TMSI clash: if a different subscriber already has this TMSI, + * we will find that other subscriber in the VLR. So the IMSIs + * would mismatch, but we don't know about it. Theoretically, + * an authentication process would thwart any attempt to use + * someone else's TMSI. + * TODO: Otherwise we can ask for the IMSI and verify that it + * matches the IMSI on record. */ + vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, + &created); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + + if (created) + vlr_loc_upd_want_imsi(fi); + else + vlr_loc_upd_node1(fi); + /* We cannot have MSC area change, as the VLR + * serves only one MSC */ + vlr_subscr_put(vsub); + } else { + /* IMSI was used */ + vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + vlr_subscr_put(vsub); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + vlr_loc_upd_node1(fi); + vlr_subscr_put(vsub); + } +} + + +static void lu_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + OSMO_ASSERT(event == VLR_ULA_E_UPDATE_LA); + + if (1) { // FIXME + //if (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0]) + /* R_IMEISV_IR1 passed */ + _start_lu_main(fi); + } else { + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMEISV); + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMEISV, + vlr_timer(vlr, 3270), 3270); + } +} + +static void lu_fsm_wait_imeisv(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_ID_IMEISV: + /* FIXME: copy IMEISV */ + _start_lu_main(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for response from Send_Identification to PVLR */ +static void lu_fsm_wait_pvlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_SEND_ID_ACK: + vlr_loc_upd_node1(fi); + break; + case VLR_ULA_E_SEND_ID_NACK: + vlr_loc_upd_want_imsi(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for result of Authenticate_VLR procedure */ +static void lu_fsm_wait_auth(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + enum vlr_auth_fsm_result *res = data; + uint8_t rej_cause = 0; + + OSMO_ASSERT(event == VLR_ULA_E_AUTH_RES); + + lfp->upd_hlr_vlr_fsm = NULL; + + if (res) { + switch (*res) { + case VLR_AUTH_RES_PASSED: + /* Result == Pass */ + vlr_loc_upd_post_auth(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* go to Idle with no response */ + rej_cause = 0; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* FIXME: delete subscribe record */ + rej_cause = GSM48_REJECT_IMSI_UNKNOWN_IN_HLR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* cause = illegal subscriber */ + rej_cause = GSM48_REJECT_ILLEGAL_MS; + break; + case VLR_AUTH_RES_PROC_ERR: + /* cause = system failure */ + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } + } else + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + + lu_fsm_failure(fi, rej_cause); +} + +static void lu_fsm_wait_ciph(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == VLR_ULA_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + } + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + vlr_loc_upd_post_ciph(fi); +} + +static void lu_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + char *mi_string = data; + + switch (event) { + case VLR_ULA_E_ID_IMSI: + vlr_subscr_set_imsi(vsub, mi_string); + vlr_loc_upd_node1(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* At the end of Update_HLR_VLR */ +static void lu_fsm_wait_hlr_ul_res(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + + switch (event) { + case VLR_ULA_E_HLR_LU_RES: + /* pass-through this event to Update_HLR_VLR */ + if (data == NULL) + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_ACK, NULL); + else + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_NACK, data); + break; + case VLR_ULA_E_UPD_HLR_COMPL: + if (data == NULL) { + /* successful case */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + /* continue in MSC ?!? */ + } else { + /* unsuccessful case */ + enum gsm48_gmm_cause cause = + *(enum gsm48_gmm_cause *)data; + if (0 /* procedure_error && vlr->cfg.standalone_mode */) { + osmo_fsm_inst_state_chg(fi, + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } else { + lu_fsm_failure(fi, cause); + } + } + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR */ +static void lu_fsm_wait_lu_compl(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_ID_IMEI: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + + /* Update Register */ + /* TODO: Set_Notification_Type 23.078 */ + /* TODO: Notify_gsmSCF 23.078 */ + /* TODO: Authenticated Radio Contact Established -> ARC */ + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR (standalone case) */ +static void lu_fsm_wait_lu_compl_standalone(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + vsub->sub_dataconf_by_hlr_ind = false; + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + vsub->sub_dataconf_by_hlr_ind = false; + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +static const struct osmo_fsm_state vlr_lu_fsm_states[] = { + [VLR_ULA_S_IDLE] = { + .in_event_mask = S(VLR_ULA_E_UPDATE_LA), + .out_state_mask = S(VLR_ULA_S_WAIT_IMEISV) | + S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_IDLE), + .action = lu_fsm_idle, + }, + [VLR_ULA_S_WAIT_IMEISV] = { + .in_event_mask = S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMEISV), + .action = lu_fsm_wait_imeisv, + }, + [VLR_ULA_S_WAIT_PVLR] = { + .in_event_mask = S(VLR_ULA_E_SEND_ID_ACK) | + S(VLR_ULA_E_SEND_ID_NACK), + .out_state_mask = S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_PVLR), + .action = lu_fsm_wait_pvlr, + }, + [VLR_ULA_S_WAIT_AUTH] = { + .in_event_mask = S(VLR_ULA_E_AUTH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_CIPH) | + S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_AUTH), + .action = lu_fsm_wait_auth, + }, + [VLR_ULA_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_CIPH), + .in_event_mask = S(VLR_ULA_E_CIPH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .action = lu_fsm_wait_ciph, + }, + [VLR_ULA_S_WAIT_IMSI] = { + .in_event_mask = S(VLR_ULA_E_ID_IMSI), + .out_state_mask = S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMSI), + .action = lu_fsm_wait_imsi, + }, + [VLR_ULA_S_WAIT_HLR_UPD] = { + .in_event_mask = S(VLR_ULA_E_HLR_LU_RES) | + S(VLR_ULA_E_UPD_HLR_COMPL), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_HLR_UPD), + .action = lu_fsm_wait_hlr_ul_res, + }, + [VLR_ULA_S_WAIT_LU_COMPL] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK) | + S(VLR_ULA_E_ID_IMEI) | + S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL), + .action = lu_fsm_wait_lu_compl, + }, + [VLR_ULA_S_WAIT_LU_COMPL_STANDALONE] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE), + .action = lu_fsm_wait_lu_compl_standalone, + }, + [VLR_ULA_S_DONE] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_DONE), + .onenter = lu_fsm_dispatch_result, + }, +}; + +static void fsm_lu_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "fsm_lu_cleanup called with cause %s\n", + osmo_fsm_term_cause_name(cause)); + if (vsub && vsub->lu_fsm == fi) + vsub->lu_fsm = NULL; +} + +static struct osmo_fsm vlr_lu_fsm = { + .name = "vlr_lu_fsm", + .states = vlr_lu_fsm_states, + .num_states = ARRAY_SIZE(vlr_lu_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_lu_event_names, + .cleanup = fsm_lu_cleanup, +}; + +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_fsm_priv *lfp; + + fi = osmo_fsm_inst_alloc_child(&vlr_lu_fsm, parent, parent_event_failure); + if (!fi) + return NULL; + + lfp = talloc_zero(fi, struct lu_fsm_priv); + lfp->vlr = vlr; + lfp->msc_conn_ref = msc_conn_ref; + lfp->tmsi = tmsi; + lfp->type = type; + lfp->old_lai = *old_lai; + lfp->new_lai = *new_lai; + lfp->lu_by_tmsi = true; + lfp->parent_event_success = parent_event_success; + lfp->parent_event_failure = parent_event_failure; + lfp->parent_event_data = parent_event_data; + lfp->authentication_required = authentication_required; + lfp->ciphering_required = ciphering_required; + lfp->is_r99 = is_r99; + lfp->is_utran = is_utran; + lfp->assign_tmsi = assign_tmsi; + if (imsi) { + strncpy(lfp->imsi, imsi, sizeof(lfp->imsi)-1); + lfp->imsi[sizeof(lfp->imsi)-1] = '\0'; + lfp->lu_by_tmsi = false; + } + fi->priv = lfp; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + osmo_fsm_inst_dispatch(fi, VLR_ULA_E_UPDATE_LA, NULL); + + return fi; +} + +/* Gracefully terminate an FSM created by vlr_loc_update() in case of external + * timeout (i.e. from MSC). */ +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == VLR_ULA_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); +} + +void vlr_lu_fsm_init(void) +{ + osmo_fsm_register(&vlr_lu_fsm); + osmo_fsm_register(&upd_hlr_vlr_fsm); + osmo_fsm_register(&sub_pres_vlr_fsm); + osmo_fsm_register(&lu_compl_vlr_fsm); +} diff --git a/src/libvlr/vlr_lu_fsm.h b/src/libvlr/vlr_lu_fsm.h new file mode 100644 index 0000000..5cf13c7 --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +enum vlr_lu_state { + VLR_ULA_S_IDLE, + VLR_ULA_S_WAIT_IMEISV, + VLR_ULA_S_WAIT_PVLR, /* Waiting for ID from PVLR */ + VLR_ULA_S_WAIT_AUTH, /* Waiting for Authentication */ + VLR_ULA_S_WAIT_CIPH, /* Waiting for Ciphering Complete */ + VLR_ULA_S_WAIT_IMSI, /* Waiting for IMSI from MS */ + VLR_ULA_S_WAIT_HLR_UPD, /* Waiting for end of HLR update */ + VLR_ULA_S_WAIT_LU_COMPL,/* Waiting for LU complete */ + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, /* Standalone VLR */ + VLR_ULA_S_DONE +}; + +void vlr_lu_fsm_init(void); diff --git a/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am index f4ef487..a99334d 100644 --- a/src/osmo-nitb/Makefile.am +++ b/src/osmo-nitb/Makefile.am @@ -32,6 +32,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libvlr/libvlr.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOGSM_LIBS) \ diff --git a/tests/vlr/Makefile.am b/tests/vlr/Makefile.am new file mode 100644 index 0000000..2208a6f --- /dev/null +++ b/tests/vlr/Makefile.am @@ -0,0 +1,22 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS = -Wall -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(NULL) +AM_LDFLAGS = $(COVERAGE_LDFLAGS) + +noinst_PROGRAMS = vlr_test + +vlr_test_SOURCES = vlr_test.c +vlr_test_LDADD = \ + $(top_builddir)/src/libvlr/libvlr.a \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(LIBRARY_DL) \ + $(LIBCRYPTO_LIBS) \ + $(NULL) diff --git a/tests/vlr/vlr_test.c b/tests/vlr/vlr_test.c new file mode 100644 index 0000000..19beb69 --- /dev/null +++ b/tests/vlr/vlr_test.c @@ -0,0 +1,694 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#define S(x) (1 << (x)) + +/* + * TODO: + * * test FSM for all testvlr_mode (and more) + * * test also the time-outs in the vlr code + * * test for memory leaks + * * how to get the HLR running? Or test against stub? + * * test disappearing MS connection + * * test absence of HLR + */ + +void *tall_bsc_ctx; +static struct vlr_instance *g_vlr; + +/*********************************************************************** + * Finite State Machine simulating MS and MSC towards VLR + ***********************************************************************/ + +static int timer_error_cb(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "timer expired waiting for completion\n"); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return 1; +} + +enum testvlr_mode { + MODE_SUCCESS, + MODE_SUCCESS_TMSI, + MODE_AUTH_FAIL, + MODE_AUTH_RESYNC, +}; + +struct testvlr_priv { + enum testvlr_mode mode; + uint32_t tmsi; + char imsi[16]; + char imei[16]; + struct osmo_location_area_id old_lai; + struct osmo_location_area_id new_lai; + + struct vlr_subscr *subscr; + + struct osmo_fsm_inst *lu_fsm; +}; + +#define fsi_priv(x) (struct testvlr_priv *)(x)->priv + +enum f_state { + /*! initial state */ + ST_NULL, + /*! LU was sent by MS */ + ST_LU_SENT, + /*! waiting for auth re-sync */ + ST_RESYNC_SENT, + /* Waiting for LU ACK */ + ST_WAIT_LU_ACK, + ST_DONE, + ST_FAILED, +}; + +enum f_event { + /* events from MS */ + EVT_MS_TX_LU, /* transmit LU REQ to network */ + EVT_MS_TX_ID_RESP, /* tranmit ID RSP to network */ + EVT_MS_TX_AUTH_RESP, /* transmit AUTH RESP to network */ + EVT_MS_TX_AUTH_FAIL, /* transmit AUTH FAIL to network */ + EVT_MS_CONN_LOST, /* connection to MS was lost */ + + /* events from VLR */ + EVT_VLR_AUTH_REQ, /* transmit AUTH REQ to MS */ + EVT_VLR_ID_REQ_IMSI, /* transmit ID REQ(IMSI) to MS */ + EVT_VLR_ID_REQ_IMEI, /* tramsmit ID REQ(IMEI) to MS */ + EVT_VLR_ID_REQ_IMEISV, /* trasnmit ID REQ(IMEISV) to MS */ + EVT_VLR_AUTH_REJ, /* transmit AUTH REJ to MS */ + EVT_VLR_SET_CIPH, /* transmit SET CIPH to MS */ + EVT_VLR_LU_ACK, /* transmit LU ACK to MS */ + EVT_VLR_LU_REJ, /* transmit LU REJ to MS */ +}; + +static struct value_string f_event_names[] = { + { EVT_MS_TX_LU, "MS-TX-LU" }, + { EVT_MS_TX_ID_RESP, "MS-TX-ID-RESP" }, + { EVT_MS_TX_AUTH_RESP, "MS-TX-AUTH-RESP" }, + { EVT_MS_TX_AUTH_FAIL, "MS-TX-AUTH-FAIL" }, + { EVT_MS_CONN_LOST, "MS-CONN-LOST" }, + + { EVT_VLR_AUTH_REQ, "VLR-AUTH-REQ" }, + { EVT_VLR_ID_REQ_IMSI, "VLR-ID-REQ-IMSI" }, + { EVT_VLR_ID_REQ_IMEI, "VLR-ID-REQ-IMEI" }, + { EVT_VLR_ID_REQ_IMEISV,"VLR-ID-REQ-IMEISV" }, + { EVT_VLR_AUTH_REJ, "VLR-AUTH-REJ" }, + { EVT_VLR_SET_CIPH, "VLR-SET-CIPH" }, + { EVT_VLR_LU_ACK, "VLR-LU-ACK" }, + { EVT_VLR_LU_REJ, "VLR-LU-REJ" }, + { 0, NULL } +}; + +static void fsm_f_allstate(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + uint8_t mi[16]; + unsigned int mi_len; + + switch (event) { + case EVT_VLR_ID_REQ_IMSI: + if (priv->mode != MODE_SUCCESS_TMSI) { + LOGP(DGPRS, LOGL_NOTICE, "Unexpected ID REQ " + "(IMSI)\n"); + } + mi_len = gsm48_generate_mid_from_imsi(mi, priv->imsi); + vlr_subscr_rx_id_resp(priv->subscr, mi+2, mi_len-2); + break; + case EVT_VLR_ID_REQ_IMEI: + mi_len = gsm48_generate_mid_from_imsi(mi, priv->imei); + mi[0] = (mi[0] & 0xf8) | GSM_MI_TYPE_IMEI; + vlr_subscr_rx_id_resp(priv->subscr+2, mi, mi_len-2); + break; + case EVT_VLR_ID_REQ_IMEISV: + mi_len = gsm48_generate_mid_from_imsi(mi, priv->imei); + mi[0] = (mi[0] & 0xf8) | GSM_MI_TYPE_IMEISV; + vlr_subscr_rx_id_resp(priv->subscr, mi+2, mi_len-2); + break; + case EVT_MS_CONN_LOST: + vlr_subscr_disconnected(priv->subscr); + /* IDEA: not release but keep around in extra state to + * see if VLR still sends us anything? */ + osmo_fsm_inst_free(fi); + break; + } +} + +static void fsm_f_null(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + uint32_t tmsi = 0; + const char *imsi = NULL; + + switch (event) { + case EVT_MS_TX_LU: + /* send LU to VLR */ + if (priv->mode == MODE_SUCCESS) + imsi = priv->imsi; + else + tmsi = priv->tmsi; + priv->lu_fsm = vlr_loc_update(fi, + EVT_VLR_LU_ACK, + EVT_VLR_LU_REJ, + NULL, + g_vlr, NULL, + VLR_LU_TYPE_IMSI_ATTACH, tmsi, + imsi, &priv->old_lai, + &priv->new_lai, + true, + true, + false, + false, + true); + OSMO_ASSERT(priv->subscr); + osmo_fsm_inst_state_chg(fi, ST_LU_SENT, 0, 0); + break; + default: + break; + } +} + +static void fsm_f_lu_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct gsm_auth_tuple *at = NULL; + struct testvlr_priv *priv = fsi_priv(fi); + uint8_t res_fail[4]; + uint8_t auts[14]; + + switch (event) { + case EVT_VLR_AUTH_REQ: + at = data; + OSMO_ASSERT(at); + DEBUGP(DGPRS, "%s: at->res=%s\n", __func__, osmo_hexdump(at->vec.res, at->vec.res_len)); + switch (priv->mode) { + case MODE_SUCCESS: + case MODE_SUCCESS_TMSI: + /* return matching SRES/AUTS */ + vlr_subscr_rx_auth_resp(priv->subscr, true, false, + at->vec.res, at->vec.res_len); + break; + case MODE_AUTH_FAIL: + /* return not matching SRES/AUTS */ + vlr_subscr_rx_auth_resp(priv->subscr, true, false, + res_fail, sizeof(res_fail)); + /* FIXME: state transition? */ + break; + case MODE_AUTH_RESYNC: + /* return SRES/AUTS requesting re-sync */ + /* FIXME: generate a proper authenticating + * re-sync request */ + vlr_subscr_rx_auth_fail(priv->subscr, auts); + /* FIXME: state transition? */ + osmo_fsm_inst_state_chg(fi, ST_RESYNC_SENT, 0, 0); + break; + } + osmo_fsm_inst_state_chg(fi, ST_WAIT_LU_ACK, 0, 0); + break; + case EVT_VLR_LU_REJ: + { + uint8_t cause = *(uint8_t *)data; + LOGP(DGPRS, LOGL_NOTICE, "LU(%s): Rejected; cause=0x%02x\n", + priv->imsi, cause); + + } + break; + default: + break; + } +} + +#if 0 +static void fsm_f_resync_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + struct gsm_auth_tuple *at = NULL; + + /* second auth request is supposed to succed after the + * re-sync procedure before */ + switch (event) { + case EVT_VLR_AUTH_REQ: + at = data; + /* return matching SRES/AUTS now */ + vlr_subscr_rx_auth_resp(priv->subscr, true, false, + at->vec.res, at->vec.res_len); + osmo_fsm_inst_state_chg(fi, ST_WAIT_LU_ACK, 0, 0); + break; + } +} +#endif + +static void fsm_f_wait_lu_ack(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + + switch (event) { + case EVT_VLR_LU_ACK: + if (priv->subscr->tmsi != GSM_RESERVED_TMSI) { + /* we need to send an TMSI REALLOC COMPL */ + vlr_subscr_rx_tmsi_reall_compl(priv->subscr); + } + osmo_fsm_inst_state_chg(fi, ST_DONE, 0, 0); + break; + case EVT_VLR_LU_REJ: + osmo_fsm_inst_state_chg(fi, ST_FAILED, 0, 0); + break; + } +} + +static void fsm_f_imsi_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case EVT_MS_TX_ID_RESP: + break; + } +} + +#if 0 +static void fsm_f_areq_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case EVT_MS_TX_AUTH_RESP: + break; + case EVT_MS_TX_AUTH_FAIL: + break; + } +} +#endif + +static struct osmo_fsm_state fsm_success_states[] = { + [ST_NULL] = { + .in_event_mask = S(EVT_MS_TX_LU), + .out_state_mask = S(ST_LU_SENT), + .name = "NULL", + .action = fsm_f_null, + }, + [ST_LU_SENT] = { + .in_event_mask = S(EVT_VLR_AUTH_REQ) | + S(EVT_VLR_LU_REJ), + //.out_state_mask = S(ST_IDREQ_IMSI_SENT) | S(ST_AUTH_REQ_SENT), + .out_state_mask = S(ST_WAIT_LU_ACK), + .name = "LU Sent", + .action = fsm_f_lu_sent, + }, + [ST_RESYNC_SENT] = { + .in_event_mask = S(EVT_VLR_AUTH_REQ), + .out_state_mask = S(ST_WAIT_LU_ACK), + .name = "AUTH-RESYNC sent", + .action = fsm_f_imsi_sent, + }, + [ST_WAIT_LU_ACK] = { + .in_event_mask = S(EVT_VLR_LU_ACK) | + S(EVT_VLR_SET_CIPH) | + S(EVT_VLR_LU_REJ), + .out_state_mask = S(ST_DONE), + .name = "WAIT-LU-ACK", + .action = fsm_f_wait_lu_ack, + }, + [ST_DONE] = { + .name = "DONE" + }, +}; + +static struct osmo_fsm vlr_test_fsm = { + .name = "VLR Test FSM", + .states = fsm_success_states, + .num_states = ARRAY_SIZE(fsm_success_states), + .log_subsys = DGPRS, + .event_names = f_event_names, + .allstate_event_mask = S(EVT_MS_CONN_LOST) | + S(EVT_VLR_ID_REQ_IMSI) | + S(EVT_VLR_ID_REQ_IMEI) | + S(EVT_VLR_ID_REQ_IMEISV), + .allstate_action = fsm_f_allstate, +}; + +/* Testing of Subscriber_Present_VLR */ + +enum test_sub_pres_state { + TSPV_S_INIT, + TSPV_S_RUNNING, +}; + +enum test_sub_pres_evt { + TSPV_E_START, + TSPV_E_COMPL, +}; + +static void tspv_f_running(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case TSPV_E_COMPL: + OSMO_ASSERT(vsub); + OSMO_ASSERT(vsub->ms_not_reachable_flag == false); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + } +} + +static void tspv_f_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_fsm_inst *spv; + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case TSPV_E_START: + OSMO_ASSERT(vsub); + vsub->ms_not_reachable_flag = true; + spv = sub_pres_vlr_fsm_start(fi, vsub, TSPV_E_COMPL); + OSMO_ASSERT(spv); + osmo_fsm_inst_state_chg(fi, TSPV_S_RUNNING, 4, 0); + break; + } +} + +static const struct osmo_fsm_state test_sub_pres_vlr_states[] = { + [TSPV_S_INIT] = { + .in_event_mask = S(TSPV_E_START), + .out_state_mask = S(TSPV_S_RUNNING), + .name = "INIT", + .action = tspv_f_init, + }, + [TSPV_S_RUNNING] = { + .in_event_mask = S(TSPV_E_COMPL), + .out_state_mask = 0, + .name = "RUNNING", + .action = tspv_f_running, + }, +}; + +static struct osmo_fsm test_sub_pres_vlr_fsm = { + .name = "Test Subscriber_Present_VLR", + .states = test_sub_pres_vlr_states, + .num_states = ARRAY_SIZE(test_sub_pres_vlr_states), + .log_subsys = DGPRS, + .event_names = f_event_names, + .timer_cb = timer_error_cb, +}; + +#if 0 +static void start_sub_pres_vlr(void *ctx, uint32_t tmsi, const char *imsi) +{ + struct osmo_fsm_inst *fi; + struct vlr_subscr *vsub = vlr_subscr_alloc(g_vlr); + + vsub->tmsi = tmsi; + strncpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + fi = osmo_fsm_inst_alloc(&test_sub_pres_vlr_fsm, ctx, vsub, LOGL_DEBUG, vsub->imsi); + osmo_fsm_inst_dispatch(fi, TSPV_E_START, NULL); +} +#endif + +/* Testing of Update_HLR_VLR */ + +enum test_update_hlr_vlr_state { + TUHV_S_INIT, + TUHV_S_RUNNING, +}; + +enum test_update_hlr_vlr_event { + TUHV_E_START, + TUHV_E_COMPL, +}; + +static void tuhv_f_running(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + enum gsm48_gmm_cause *res = data; + + switch (event) { + case TUHV_E_COMPL: + if (!res) { + /* Success */ + LOGPFSM(fi, "success\n"); + } else { + /* error */ + LOGPFSM(fi, "errror cause=0x%u\n", *res); + } + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + } +} + +static void tuhv_f_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_fsm_inst *child; + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case TUHV_E_START: + child = upd_hlr_vlr_proc_start(fi, vsub, TUHV_E_COMPL); + OSMO_ASSERT(child); + osmo_fsm_inst_state_chg(fi, TUHV_S_RUNNING, 4, 0); + break; + } +} + +static const struct osmo_fsm_state test_upd_hlr_vlr_states[] = { + [TUHV_S_INIT] = { + .in_event_mask = S(TUHV_E_START), + .out_state_mask = S(TUHV_S_RUNNING), + .name = "INIT", + .action = tuhv_f_init, + }, + [TUHV_S_RUNNING] = { + .in_event_mask = S(TUHV_E_COMPL), + .out_state_mask = 0, + .name = "RUNNING", + .action = tuhv_f_running, + }, +}; + +static struct osmo_fsm test_upd_hlr_vlr_fsm = { + .name = "Test Update_HLR_VLR", + .states = test_upd_hlr_vlr_states, + .num_states = ARRAY_SIZE(test_upd_hlr_vlr_states), + .log_subsys = DGPRS, + .event_names = f_event_names, + .timer_cb = timer_error_cb, +}; + +#if 0 +static void start_upd_hlr_vlr(void *ctx, uint32_t tmsi, const char *imsi) +{ + struct osmo_fsm_inst *fi; + struct vlr_subscr *vsub = vlr_subscr_alloc(g_vlr); + + vsub->tmsi = tmsi; + strncpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + + + fi = osmo_fsm_inst_alloc(&test_upd_hlr_vlr_fsm, ctx, vsub, LOGL_DEBUG, + vsub->imsi); + /* we need to set this to fool vlr.c in an ongoing LU */ + vsub->lu_fsm = fi; + osmo_fsm_inst_dispatch(fi, TUHV_E_START, NULL); +} +#endif + +/*********************************************************************** + * Integration with VLR code + ***********************************************************************/ + +static struct vlr_instance *g_vlr; + +/* VLR asks us to send an authentication request */ +static int msc_vlr_tx_auth_req(void *msc_conn_ref, struct gsm_auth_tuple *at, + bool send_autn) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + OSMO_ASSERT(at); + DEBUGP(DGPRS, "%s: RES=%s\n", __func__, + osmo_hexdump_nospc(at->vec.res, at->vec.res_len)); + osmo_fsm_inst_dispatch(fi, EVT_VLR_AUTH_REQ, at); + return 0; +} + +/* VLR asks us to send an authentication reject */ +static int msc_vlr_tx_auth_rej(void *msc_conn_ref) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_AUTH_REJ, NULL); + return 0; +} + +/* VLR asks us to transmit an Identity Request of given type */ +static int msc_vlr_tx_id_req(void *msc_conn_ref, uint8_t mi_type) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + uint32_t event; + + DEBUGP(DGPRS, "%s (%u)\n", __func__, mi_type); + + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + event = EVT_VLR_ID_REQ_IMSI; + break; + case GSM_MI_TYPE_IMEI: + event = EVT_VLR_ID_REQ_IMEI; + break; + case GSM_MI_TYPE_IMEISV: + event = EVT_VLR_ID_REQ_IMEISV; + break; + default: + LOGP(DGPRS, LOGL_ERROR, "Unknown identity 0x%02x\n", + mi_type); + return -1; + } + osmo_fsm_inst_dispatch(fi, event, NULL); + return 0; +} + +/* VLR asks us to transmit a Location Update Accept */ +static int msc_vlr_tx_lu_ack(void *msc_conn_ref, uint32_t send_tmsi) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_LU_ACK, NULL); + return 0; +} + +/* VLR asks us to transmit a Location Update Reject */ +static int msc_vlr_tx_lu_rej(void *msc_conn_ref, uint8_t cause) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_LU_REJ, (void *) &cause); + return 0; +} + +static int msc_vlr_set_ciph_mode(void *msc_conn_ref, enum vlr_ciph mode, + bool retrieve_imeisv) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_SET_CIPH, NULL); + return 0; +} + +/* VLR informs us that the subscriber data has somehow been modified */ +static void msc_vlr_subscr_update(struct vlr_subscr *subscr) +{ + DEBUGP(DGPRS, "%s\n", __func__); + /* FIXME */ +} + +static void msc_vlr_subscr_assoc(void *msc_conn_ref, struct vlr_subscr *vsub) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + struct testvlr_priv *priv = fsi_priv(fi); + DEBUGP(DGPRS, "%s(%p, %s)\n", __func__, msc_conn_ref, vlr_subscr_name(vsub)); + priv->subscr = vsub; +} + +/* operations that we need to implement for libvlr */ +static const struct vlr_ops test_vlr_ops = { + .tx_auth_req = msc_vlr_tx_auth_req, + .tx_auth_rej = msc_vlr_tx_auth_rej, + .tx_id_req = msc_vlr_tx_id_req, + .tx_lu_acc = msc_vlr_tx_lu_ack, + .tx_lu_rej = msc_vlr_tx_lu_rej, + .set_ciph_mode = msc_vlr_set_ciph_mode, + .subscr_update = msc_vlr_subscr_update, + .subscr_assoc = msc_vlr_subscr_assoc, +}; + +/*********************************************************************** + * Actual test cases + ***********************************************************************/ + + +static struct osmo_fsm_inst * +start_lu(enum testvlr_mode mode, uint32_t tmsi, + const char *imsi, const char *imei) +{ + struct testvlr_priv *vp; + struct osmo_fsm_inst *fi; + + vp = talloc_zero(tall_bsc_ctx, struct testvlr_priv); + vp->mode = mode; + vp->tmsi = tmsi; + strncpy(vp->imsi, imsi, sizeof(vp->imsi)); + strncpy(vp->imei, imei, sizeof(vp->imei)); + + fi = osmo_fsm_inst_alloc(&vlr_test_fsm, vp, vp, LOGL_DEBUG, vp->imsi); + osmo_fsm_inst_dispatch(fi, EVT_MS_TX_LU, NULL); + return fi; +} + +/*********************************************************************** + * Main / Misc + ***********************************************************************/ + +static struct osmo_timer_list tmr; + +static void timer_cb(void *data) +{ + uint32_t tmsi = rand() % 1000000; + uint64_t imsi = 901790000000000 + tmsi; + char imsi_str[32]; + + snprintf(imsi_str, sizeof(imsi_str), "%lu", imsi); + //start_lu(MODE_AUTH_FAIL, tmsi, imsi_str, "23422342"); + start_lu(MODE_SUCCESS_TMSI, tmsi, imsi_str, "23422342"); + //start_lu(MODE_SUCCESS, tmsi, imsi_str, "23422342"); + //start_upd_hlr_vlr(tall_bsc_ctx, tmsi, imsi_str); + //start_sub_pres_vlr(tall_bsc_ctx); + osmo_timer_schedule(&tmr, 8, 0); +} + +static void sighdlr(int sig) +{ + switch (sig) { + case SIGUSR1: + talloc_report_full(tall_bsc_ctx, stderr); + break; + } +} + +int main(int argc, char **argv) +{ + tall_bsc_ctx = talloc_named_const(NULL, 1, "tall_bsc_ctx"); + + signal(SIGUSR1, sighdlr); + + osmo_init_logging(&log_info); + + g_vlr = vlr_alloc(NULL, &test_vlr_ops); + vlr_start("VLRTEST", g_vlr, "localhost", 2222); + OSMO_ASSERT(g_vlr); + osmo_fsm_register(&vlr_test_fsm); + osmo_fsm_register(&test_sub_pres_vlr_fsm); + osmo_fsm_register(&test_upd_hlr_vlr_fsm); + + g_vlr->cfg.assign_tmsi = true; + + tmr.cb = timer_cb; + timer_cb(NULL); + + while (1) { + osmo_select_main(0); + } + + exit(0); +} + +struct gsm_subscriber_connection; +int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn) { return 0; } -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 07:57:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 07:57:39 +0000 Subject: libosmo-abis[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff8506832d3472ab193b19b43cfbe7a9511075d1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Thu Jul 13 07:57:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 07:57:43 +0000 Subject: [MERGED] libosmo-abis[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: check for missing result of rate_ctr_group_alloc() ...................................................................... check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. Change-Id: Iff8506832d3472ab193b19b43cfbe7a9511075d1 Related: OS#2361 --- M src/e1_input.c 1 file changed, 5 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/src/e1_input.c b/src/e1_input.c index 40e36b4..3cf810f 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -364,6 +364,11 @@ line->num = e1_nr; line->rate_ctr = rate_ctr_group_alloc(line, &e1inp_ctr_g_d, line->num); + if (!line->rate_ctr) { + LOGP(DLINP, LOGL_ERROR, "Cannot allocate counter group\n"); + talloc_free(line); + return NULL; + } line->num_ts = NUM_E1_TS; for (i = 0; i < line->num_ts; i++) { -- To view, visit https://gerrit.osmocom.org/3182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff8506832d3472ab193b19b43cfbe7a9511075d1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Thu Jul 13 07:58:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 07:58:06 +0000 Subject: osmo-pcu[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6d780c67b4af15aaa5c6f2b8b00f2a0b70a7385 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Thu Jul 13 07:58:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 07:58:14 +0000 Subject: [MERGED] osmo-pcu[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: check for missing result of rate_ctr_group_alloc() ...................................................................... check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. Change-Id: Id6d780c67b4af15aaa5c6f2b8b00f2a0b70a7385 Related: OS#2361 --- M src/bts.cpp M src/tbf.cpp 2 files changed, 26 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/src/bts.cpp b/src/bts.cpp index 5192646..2d289d7 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -207,7 +207,9 @@ } m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); + OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); + OSMO_ASSERT(m_statg); } BTS::~BTS() diff --git a/src/tbf.cpp b/src/tbf.cpp index 48e8289..bbed29c 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -760,6 +760,10 @@ tbf->name(), tbf->trx->trx_no, tbf->ul_slots(), tbf->dl_slots()); tbf->m_ctrs = rate_ctr_group_alloc(tbf, &tbf_ctrg_desc, 0); + if (!tbf->m_ctrs) { + LOGP(DRLCMAC, LOGL_ERROR, "Couldn't allocate TBF counters\n"); + return -1; + } return 0; } @@ -844,6 +848,11 @@ tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_egprs_ctrg_desc, 0); tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_gprs_ctrg_desc, 0); + if (!tbf->m_ul_egprs_ctrs || !tbf->m_ul_gprs_ctrs) { + LOGP(DRLCMAC, LOGL_ERROR, "Couldn't allocate TBF UL counters\n"); + talloc_free(tbf); + return NULL; + } llist_add(&tbf->list(), &bts->bts->ul_tbfs()); tbf->bts->tbf_ul_created(); @@ -930,8 +939,18 @@ if (tbf->is_egprs_enabled()) { tbf->egprs_calc_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"); + talloc_free(tbf); + return NULL; + } } else { tbf->m_dl_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_gprs_ctrg_desc, 0); + if (!tbf->m_dl_gprs_ctrs) { + LOGP(DRLCMAC, LOGL_ERROR, "Couldn't allocate GPRS DL counters\n"); + talloc_free(tbf); + return NULL; + } } llist_add(&tbf->list(), &bts->bts->dl_tbfs()); @@ -1439,6 +1458,11 @@ &tbf_ul_egprs_ctrg_desc, 0); ul_tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ul_gprs_ctrg_desc, 0); + if (!ul_tbf->m_ctrs || !ul_tbf->m_ul_egprs_ctrs || !ul_tbf->m_ul_gprs_ctrs) { + LOGP(DRLCMAC, LOGL_ERROR, "Cound not allocate TBF UL rate counters\n"); + talloc_free(ul_tbf); + return NULL; + } return ul_tbf; } -- To view, visit https://gerrit.osmocom.org/3183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id6d780c67b4af15aaa5c6f2b8b00f2a0b70a7385 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Thu Jul 13 08:14:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:14:05 +0000 Subject: osmo-msc[master]: Add libvlr implementation In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 (3 comments) https://gerrit.osmocom.org/#/c/3194/4/src/libvlr/vlr_access_req_fsm.c File src/libvlr/vlr_access_req_fsm.c: Line 416: if (res) { we have an OSMO_ASSERT(res) above, and then a runtime if (res) here. Either of the two doesn't make sense. We can either ASSERT and remove the if, or we can kep he if (but then remove the *res from LOGPFSM outside of the if(res) clause. https://gerrit.osmocom.org/#/c/3194/4/src/libvlr/vlr_auth_fsm.c File src/libvlr/vlr_auth_fsm.c: Line 552: .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTH_FAILED), What I dislike about OSMO_STRINGIFY is that the log output gets unneccessarily long without any gain in information. We already know the type of VLR from the auto generated prefix, so the name "AUTH_FAILED" would be much better than "VLR_SUB_AS_AUTH_FAILED" in the log output. Not a critical issue for merging this, but I do have my reasons for almost never using OSMO_STRINGIFY. https://gerrit.osmocom.org/#/c/3194/4/src/libvlr/vlr_lu_fsm.c File src/libvlr/vlr_lu_fsm.c: Line 984: if (1) { // FIXME a more verbose description of the FIXME would make sense. I don't really know what is meant here. -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 13 08:14:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:14:20 +0000 Subject: osmo-msc[master]: logging: auth request: use hexdump without spaces for RAND, ... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie16bb2c01e770914f411bfb34b523c56ea9fab81 Gerrit-PatchSet: 3 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 Thu Jul 13 08:15:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:15:23 +0000 Subject: osmo-msc[master]: gsup_client: allow passing a unit id to identify with HLR In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a60681ab4a4d73e26fe8f0637447db4b6fe6eb2 Gerrit-PatchSet: 3 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 Thu Jul 13 08:15:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:15:34 +0000 Subject: osmo-msc[master]: GPRS/IuPS: remove all 3G authentication dev hacks In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie42945bb687b077fd0ee430c2711d19782151610 Gerrit-PatchSet: 3 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 Thu Jul 13 08:15:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:15:39 +0000 Subject: osmo-msc[master]: git-version-gen: look for .git in ./, not ../ In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic71cfb8dde0a43325b50c75aae1e6ef3c3008501 Gerrit-PatchSet: 3 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 Thu Jul 13 08:16:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:16:16 +0000 Subject: osmo-msc[master]: join openbsc/.gitignore with .gitignore In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3189/3/.gitignore File .gitignore: Line 64: tests/bsc-nat/bsc_nat_test most of these can be replaced with tests/*/*_test -- To view, visit https://gerrit.osmocom.org/3189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib2120592749e85a4d13f6668e198857e3bddcf1e Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 13 08:16:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:16:30 +0000 Subject: osmo-msc[master]: jenkins: apply rename to osmo-msc in log marker In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ca9a1a8bdb5b9615df5f19f0c1017cb9383f6ee Gerrit-PatchSet: 2 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 Thu Jul 13 08:16:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:16:37 +0000 Subject: osmo-msc[master]: move openbsc/* to repos root In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 08:16:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:16:51 +0000 Subject: osmo-msc[master]: jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f731db0b74ed48ae6dd713ed4c3247222ef0de 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 Thu Jul 13 08:18:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:18:11 +0000 Subject: osmo-msc[master]: Add msc_vlr test suite for MSC+VLR end-to-end tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd Gerrit-PatchSet: 2 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 Thu Jul 13 08:35:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:35:46 +0000 Subject: osmo-msc[master]: Use libvlr in libmsc (large refactoring) In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (11 comments) https://gerrit.osmocom.org/#/c/3195/2/include/openbsc/gsm_data.h File include/openbsc/gsm_data.h: Line 117: uint8_t classmark3[14]; classmark3 length gets extended every so often when new 3GPP releases are coming out. I think it might make sense to either extend it to 256 bytes here, or allocate it dynamically. In any case, not a blocker, as long as we properly deal with the fact that the subscriber-provided CM3 might be longer (we then simply truncate). Maybe a comment here. https://gerrit.osmocom.org/#/c/3195/2/include/openbsc/osmo_msc.h File include/openbsc/osmo_msc.h: Line 13: #define MSC_HLR_REMOTE_PORT_DEFAULT 2222 we should probably go for a more 'reasonable' port number closer to the other ports that we already use. also, is this documented in the wiki / manual yet? https://gerrit.osmocom.org/#/c/3195/2/src/libbsc/bsc_vty.c File src/libbsc/bsc_vty.c: Line 840: TODO: add in libvlr? a VLR by definition holds all of its state in volatile memory (i.e. RAM). So let's remove that bogus TODO here. https://gerrit.osmocom.org/#/c/3195/2/src/libcommon-cs/common_cs_vty.c File src/libcommon-cs/common_cs_vty.c: Line 232: vty_out(vty, "%% subscriber-keep-in-ram is currently not implemented%s", just drop it altogether? https://gerrit.osmocom.org/#/c/3195/2/src/libmsc/gsm_04_08.c File src/libmsc/gsm_04_08.c: Line 730: memcpy(conn->classmark.classmark2, classmark2, classmark2_len); we can overflow classmark2 buffer here, as we unconditionally use the user-provided length from the packet. We should truncate and log (with NOTICE level?) the fact that we had to truncate a too long value. Line 1112: lai.lac = 23; /* FIXME bts->location_area_code; */ I'm really not sure we can simply use hard-coded location area information here. What is this information used for later on down the road? Are we sure this is safe? If so, an explanation might be useful here. https://gerrit.osmocom.org/#/c/3195/2/src/libmsc/osmo_msc.c File src/libmsc/osmo_msc.c: Line 79: whitespace https://gerrit.osmocom.org/#/c/3195/2/src/libmsc/token_auth.c File src/libmsc/token_auth.c: Line 23: VLR: what do do with this? remove all of it. https://gerrit.osmocom.org/#/c/3195/2/src/libmsc/transaction.c File src/libmsc/transaction.c: Line 194: void trans_conn_closed(struct gsm_subscriber_connection *conn) all other functions have received nice doxygen documentation, not this one? ;) https://gerrit.osmocom.org/#/c/3195/2/src/osmo-nitb/bsc_hack.c File src/osmo-nitb/bsc_hack.c: Line 264: #if 0 remove https://gerrit.osmocom.org/#/c/3195/2/tests/mm_auth/mm_auth_test.c File tests/mm_auth/mm_auth_test.c: Line 13: #if 0 shouldn't the entire test case be dropped? -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 13 08:36:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:36:09 +0000 Subject: libosmocore[master]: gsmtap: Add value_strings for GSMTAP_TYPE and GSMTAP_CHANNEL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaf8a99912f42a56ef785a1642e18238c0b67cf68 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 Thu Jul 13 08:36:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:36:14 +0000 Subject: libosmocore[master]: gsmtap_util: Add chantype_gsmtap2rsl() as inverse of chantyp... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie1bc00670887064da0fea61c3dab036c23ceea25 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 Thu Jul 13 08:36:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:36:16 +0000 Subject: [MERGED] libosmocore[master]: gsmtap_util: Add chantype_gsmtap2rsl() as inverse of chantyp... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsmtap_util: Add chantype_gsmtap2rsl() as inverse of chantype_rsl2gsmtap() ...................................................................... gsmtap_util: Add chantype_gsmtap2rsl() as inverse of chantype_rsl2gsmtap() Change-Id: Ie1bc00670887064da0fea61c3dab036c23ceea25 --- M include/osmocom/core/gsmtap_util.h M src/gsmtap_util.c 2 files changed, 41 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h index 59b81e5..5c5e3fd 100644 --- a/include/osmocom/core/gsmtap_util.h +++ b/include/osmocom/core/gsmtap_util.h @@ -9,6 +9,7 @@ * \file gsmtap_util.h */ uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t rsl_link_id); +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, uint8_t *link_id); struct msgb *gsmtap_makemsg_ex(uint8_t type, uint16_t arfcn, uint8_t ts, uint8_t chan_type, uint8_t ss, uint32_t fn, int8_t signal_dbm, diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 561cdb3..26720b6 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -1,7 +1,7 @@ /*! \file gsmtap_util.c * GSMTAP support code in libosmocore. */ /* - * (C) 2010-2011 by Harald Welte + * (C) 2010-2017 by Harald Welte * * All Rights Reserved * @@ -89,6 +89,45 @@ return ret; } +/*! convert GSMTAP channel type to RSL channel number + Link ID + * \param[in] gsmtap_chantype GSMTAP channel type + * \param[out] rsl_chantype RSL channel mumber + * \param[out] link_id RSL link identifier + */ +void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, + uint8_t *link_id) +{ + switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { + case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F + *rsl_chantype = RSL_CHAN_Bm_ACCHs; + break; + case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H + *rsl_chantype = RSL_CHAN_Lm_ACCHs; + break; + case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 + *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; + break; + case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 + *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; + break; + case GSMTAP_CHANNEL_BCCH: // BCCH + *rsl_chantype = RSL_CHAN_BCCH; + break; + case GSMTAP_CHANNEL_RACH: // RACH + *rsl_chantype = RSL_CHAN_RACH; + break; + case GSMTAP_CHANNEL_PCH: // PCH + case GSMTAP_CHANNEL_AGCH: // AGCH + *rsl_chantype = RSL_CHAN_PCH_AGCH; + break; + case GSMTAP_CHANNEL_PDCH: + *rsl_chantype = GSMTAP_CHANNEL_PDCH; + break; + } + + *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? 0x40 : 0x00; +} + /*! create an arbitrary type GSMTAP message * \param[in] type The GSMTAP_TYPE_xxx constant of the message to create * \param[in] arfcn GSM ARFCN (Channel Number) -- To view, visit https://gerrit.osmocom.org/3223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1bc00670887064da0fea61c3dab036c23ceea25 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 Thu Jul 13 08:36:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 08:36:17 +0000 Subject: [MERGED] libosmocore[master]: gsmtap: Add value_strings for GSMTAP_TYPE and GSMTAP_CHANNEL In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsmtap: Add value_strings for GSMTAP_TYPE and GSMTAP_CHANNEL ...................................................................... gsmtap: Add value_strings for GSMTAP_TYPE and GSMTAP_CHANNEL Change-Id: Iaf8a99912f42a56ef785a1642e18238c0b67cf68 --- M include/osmocom/core/gsmtap_util.h M src/gsmtap_util.c 2 files changed, 48 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h index 5c5e3fd..f8a12a6 100644 --- a/include/osmocom/core/gsmtap_util.h +++ b/include/osmocom/core/gsmtap_util.h @@ -55,4 +55,7 @@ int8_t signal_dbm, uint8_t snr, const uint8_t *data, unsigned int len); +extern const struct value_string gsmtap_gsm_channel_names[]; +extern const struct value_string gsmtap_type_names[]; + /*! @} */ diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 26720b6..ad6f914 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -436,4 +436,49 @@ #endif /* HAVE_SYS_SOCKET_H */ +const struct value_string gsmtap_gsm_channel_names[] = { + { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, + { GSMTAP_CHANNEL_BCCH, "BCCH" }, + { GSMTAP_CHANNEL_CCCH, "CCCH" }, + { GSMTAP_CHANNEL_RACH, "RACH" }, + { GSMTAP_CHANNEL_AGCH, "AGCH" }, + { GSMTAP_CHANNEL_PCH, "PCH" }, + { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, + { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, + { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, + { GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F" }, + { GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H" }, + { GSMTAP_CHANNEL_PACCH, "PACCH" }, + { GSMTAP_CHANNEL_CBCH52, "CBCH" }, + { GSMTAP_CHANNEL_PDCH, "PDCH" } , + { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, + { GSMTAP_CHANNEL_CBCH51, "CBCH" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH, "LSACCH" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, + { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, + { 0, NULL } +}; + +/* for debugging */ +const struct value_string gsmtap_type_names[] = { + { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, + { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, + { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, + { GSMTAP_TYPE_SIM, "SIM Card" }, + { GSMTAP_TYPE_TETRA_I1, "TETRA V+D" }, + { GSMTAP_TYPE_TETRA_I1_BURST, "TETRA bursts" }, + { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, + { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)"}, + { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, + { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, + { GSMTAP_TYPE_LTE_RRC, "LTE RRC" }, + { GSMTAP_TYPE_LTE_MAC, "LTE MAC" }, + { GSMTAP_TYPE_LTE_MAC_FRAMED, "LTE MAC with context hdr" }, + { GSMTAP_TYPE_OSMOCORE_LOG, "libosmocore logging" }, + { GSMTAP_TYPE_QC_DIAG, "Qualcomm DIAG" }, + { 0, NULL } +}; + /*! @} */ -- To view, visit https://gerrit.osmocom.org/3224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaf8a99912f42a56ef785a1642e18238c0b67cf68 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 Thu Jul 13 08:39:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 13 Jul 2017 08:39:14 +0000 Subject: openbsc[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: Would it make sense to add __attribute__((warn_unused_result)) to rate_ctr_group_alloc() or there might be legitimate case when we can ignore the return value? -- To view, visit https://gerrit.osmocom.org/3184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 08:56:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 13 Jul 2017 08:56:17 +0000 Subject: [PATCH] osmo-hlr[master]: Another attempt at fixing .deb Message-ID: Review at https://gerrit.osmocom.org/3225 Another attempt at fixing .deb The previous efforts have failed: python3 does not supply /usr/bin/python symlink. Let's use python-minimal dependency. Change-Id: If9e3f31622efae132b25683c54ce09c83ce43415 --- M debian/control M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/25/3225/1 diff --git a/debian/control b/debian/control index 571c24e..0ff3801 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python3, + python-minimal, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index acc0f7d..b01a797 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # FIXME: use python3 once buildslaves are updated. # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/3225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9e3f31622efae132b25683c54ce09c83ce43415 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 13 09:14:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 09:14:05 +0000 Subject: osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client* In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) https://gerrit.osmocom.org/#/c/3187/1/include/osmocom/ranap/iu_client.h File include/osmocom/ranap/iu_client.h: Line 26: /* TODO: It's not needed to store the full SCCP address for each > I took a brief look and the causality is as follows: It probably makes sense to create/lookup a RNC data structure when receiving N-CONNECT.ind. After all, the source SCCP address is known at this time, and we probably need some kind of context structure to identify the peer to whom we're talking to. This is similar to the AoIP case, where we need to look up the BSC that's sending us the N-CONNECT.ind, andwe still have an ongoing discussion if and when to auto-create BSC structures or whether they must always be manually defined in the VTY. Conceptually it's exactly the same in the Iu case. The only difference is that it's happening in libiu, as it is the same code for both SGSN and MSC. I'll leave it up to you to decide on the details, but I think we should avoid introducing something that we know is wrong (and needs to be changed) now. Line 43: * ranap_ue_conn_ctx should no longer be used, for whatever reason. */ > same here. I'll drop the FIXME because there is no need. Whichever user wan fine with me. Line 54: /* TODO "gprs_" in generic CS+PS domain ^ */ > more appropriate would be struct osmo_routing_area_id, or could replace wit definitely use a structure. I don't mind whcih ones, but having a handful of function arguments definitely seems less appealing. https://gerrit.osmocom.org/#/c/3187/1/src/iu_client_vty.c File src/iu_client_vty.c: Line 35: "logging asn1-debug (1|0)", > I think I added these commands back in the days upon you requesting VTY com well, those are useful commands to have. If they don't relate to our existing logging though, they should simply be called differently until we (might eventually) have new true "logging" commands. This is a bit similar to e.g. configuring sysmobts trace flags on osmo-bts-sysmo: We allow to confiugure them (persistently under a config node), but we don't call it "logging" to avoid confusion with the actual libosmocore logging Line 80: DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, > you introduced this in the port-to-new-sigtran commit; the address book cam difficult choice. Having a global namespace where then the indidivual address book record points to the sccp instance makes probably sense. But I think there were some technical reasons preventing it? Philipp? -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 13 09:15:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 09:15:19 +0000 Subject: osmo-hlr[master]: Another attempt at fixing .deb In-Reply-To: References: Message-ID: Patch Set 1: It seems like you are submitting debian packaging changes "blindly" without testing them first? How are those changes validated before submitting them? It's odd that we merge something here which then breaks the build? -- To view, visit https://gerrit.osmocom.org/3225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9e3f31622efae132b25683c54ce09c83ce43415 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr 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 Jul 13 09:17:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 09:17:19 +0000 Subject: osmo-bts[master]: trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3067/3/src/osmo-bts-trx/l1_if.c File src/osmo-bts-trx/l1_if.c: Line 112: if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { I can see *what* you are doing,but not why. This looks more like a hack to work around a problem rather than a fix. Which particular part of the code requires lchan->rel_act_kind to be LCHAN_REL_ACT_RSL further down the line? -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 13 09:27:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 09:27:04 +0000 Subject: openbsc[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: > Would it make sense to add __attribute__((warn_unused_result)) to > rate_ctr_group_alloc() or there might be legitimate case when we > can ignore the return value? yes, could make senes. thanks for the suggestion. but then this could/should be part of a larger patchset as this is probably the case for many of our API functions? -- To view, visit https://gerrit.osmocom.org/3184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 10:23:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 10:23:19 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: common_util: chantype_gsmtap2rsl() now in libosmocore Message-ID: Review at https://gerrit.osmocom.org/3226 VIRT-PHY: common_util: chantype_gsmtap2rsl() now in libosmocore As of Change-Id Ie1bc00670887064da0fea61c3dab036c23ceea25, this function is offered by libosmocore. Change-Id: Ie269afe314967fd2c42b91ee854c217f699252dc --- M src/host/virt_phy/include/virtphy/common_util.h M src/host/virt_phy/src/Makefile.am D src/host/virt_phy/src/shared/common_util.c 3 files changed, 1 insertion(+), 85 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/26/3226/1 diff --git a/src/host/virt_phy/include/virtphy/common_util.h b/src/host/virt_phy/include/virtphy/common_util.h index 672ff93..2585d06 100644 --- a/src/host/virt_phy/include/virtphy/common_util.h +++ b/src/host/virt_phy/include/virtphy/common_util.h @@ -9,43 +9,3 @@ #define LID_SACCH 0x40 #define LID_DEDIC 0x00 - -/*! \brief convert GSMTAP channel type to RSL channel number - * \param[in] gsmtap_chantype GSMTAP channel type - * \param[out] rsl_chantype rsl channel type - * \param[out] rsl_chantype rsl link id - * - * Mapping from gsmtap channel: - * GSMTAP_CHANNEL_UNKNOWN * 0x00 - * GSMTAP_CHANNEL_BCCH * 0x01 - * GSMTAP_CHANNEL_CCCH * 0x02 - * GSMTAP_CHANNEL_RACH * 0x03 - * GSMTAP_CHANNEL_AGCH * 0x04 - * GSMTAP_CHANNEL_PCH * 0x05 - * GSMTAP_CHANNEL_SDCCH * 0x06 - * GSMTAP_CHANNEL_SDCCH4 * 0x07 - * GSMTAP_CHANNEL_SDCCH8 * 0x08 - * GSMTAP_CHANNEL_TCH_F * 0x09 - * GSMTAP_CHANNEL_TCH_H * 0x0a - * GSMTAP_CHANNEL_PACCH * 0x0b - * GSMTAP_CHANNEL_CBCH52 * 0x0c - * GSMTAP_CHANNEL_PDCH * 0x0d - * GSMTAP_CHANNEL_PTCCH * 0x0e - * GSMTAP_CHANNEL_CBCH51 * 0x0f - * to rsl channel type: - * RSL_CHAN_NR_MASK * 0xf8 - * RSL_CHAN_NR_1 * * 0x08 - * RSL_CHAN_Bm_ACCHs * 0x08 - * RSL_CHAN_Lm_ACCHs * 0x10 - * RSL_CHAN_SDCCH4_ACCH * 0x20 - * RSL_CHAN_SDCCH8_ACCH * 0x40 - * RSL_CHAN_BCCH * * 0x80 - * RSL_CHAN_RACH * * 0x88 - * RSL_CHAN_PCH_AGCH * 0x90 - * RSL_CHAN_OSMO_PDCH * 0xc0 - * and logical channel link id: - * LID_SACCH * * 0x40 - * LID_DEDIC * * 0x00 - */ -void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, - uint8_t *link_id); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index caaec04..48f9de7 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -2,7 +2,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/../layer23/include sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c shared/common_util.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) virtphy_LDFLAGS = -pthread diff --git a/src/host/virt_phy/src/shared/common_util.c b/src/host/virt_phy/src/shared/common_util.c deleted file mode 100644 index 49dea18..0000000 --- a/src/host/virt_phy/src/shared/common_util.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Utility function used both in osmo bts virt and osmocom bb virt. - */ - -#include -#include -#include - -void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, - uint8_t *link_id) -{ - // switch case with removed acch flag - switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { - case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F - *rsl_chantype = RSL_CHAN_Bm_ACCHs; - break; - case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H - *rsl_chantype = RSL_CHAN_Lm_ACCHs; - break; - case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 - *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; - break; - case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 - *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; - break; - case GSMTAP_CHANNEL_BCCH: // BCCH - *rsl_chantype = RSL_CHAN_BCCH; - break; - case GSMTAP_CHANNEL_RACH: // RACH - *rsl_chantype = RSL_CHAN_RACH; - break; - case GSMTAP_CHANNEL_PCH: // PCH - case GSMTAP_CHANNEL_AGCH: // AGCH - *rsl_chantype = RSL_CHAN_PCH_AGCH; - break; - case GSMTAP_CHANNEL_PDCH: - *rsl_chantype = GSMTAP_CHANNEL_PDCH; - break; - } - - *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? LID_SACCH : - LID_DEDIC; - -} -- To view, visit https://gerrit.osmocom.org/3226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie269afe314967fd2c42b91ee854c217f699252dc Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 10:23:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 10:23:19 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Use gsmtap value_strings in recent libosmocore Message-ID: Review at https://gerrit.osmocom.org/3227 VIRT-PHY: Use gsmtap value_strings in recent libosmocore In Change-ID Iaf8a99912f42a56ef785a1642e18238c0b67cf68 libosmocore introduced value_strings fro the GSMTAP_CHANNEL_* and GSMTAP_TYPE_* constants, so we can remove the private tables. Change-Id: I771dbe079fc6d1a5e66e958deb832c1168990851 --- M src/host/virt_phy/src/gsmtapl1_if.c 1 file changed, 2 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/27/3227/1 diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index ae9cd32..2624046 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -40,46 +40,6 @@ static struct l1_model_ms *l1_model_ms = NULL; -/* for debugging */ -static const struct value_string gsmtap_channels[] = { - { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, - { GSMTAP_CHANNEL_BCCH, "BCCH" }, - { GSMTAP_CHANNEL_CCCH, "CCCH" }, - { GSMTAP_CHANNEL_RACH, "RACH" }, - { GSMTAP_CHANNEL_AGCH, "AGCH" }, - { GSMTAP_CHANNEL_PCH, "PCH" }, - { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, - { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, - { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, - { GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F" }, - { GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H" }, - { GSMTAP_CHANNEL_PACCH, "PACCH" }, - { GSMTAP_CHANNEL_CBCH52, "CBCH" }, - { GSMTAP_CHANNEL_PDCH, "PDCH" } , - { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, - { GSMTAP_CHANNEL_CBCH51, "CBCH" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH, "LSACCH" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, - { 0, NULL } -}; - -/* for debugging */ -static const struct value_string gsmtap_types[10] = { - { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, - { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, - { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, - { GSMTAP_TYPE_SIM, "SIM Card" }, - { GSMTAP_TYPE_TETRA_I1, "TETRA V+D" }, - { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, - { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)"}, - { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, - { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, - { 0, NULL } -}; - void gsmtapl1_init(struct l1_model_ms *model) { l1_model_ms = model; @@ -212,8 +172,8 @@ DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", - arfcn, fn, get_value_string(gsmtap_types, gh->type), - get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, + arfcn, fn, get_value_string(gsmtap_type_names, gh->type), + get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); /* switch case with removed ACCH flag */ -- To view, visit https://gerrit.osmocom.org/3227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I771dbe079fc6d1a5e66e958deb832c1168990851 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 10:39:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 10:39:08 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Use gsmtap value_strings in recent libosmocore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I771dbe079fc6d1a5e66e958deb832c1168990851 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 10:39:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 10:39:19 +0000 Subject: osmocom-bb[master]: VIRT-PHY: common_util: chantype_gsmtap2rsl() now in libosmocore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie269afe314967fd2c42b91ee854c217f699252dc Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 10:39:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 10:39:23 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: common_util: chantype_gsmtap2rsl() now in libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: common_util: chantype_gsmtap2rsl() now in libosmocore ...................................................................... VIRT-PHY: common_util: chantype_gsmtap2rsl() now in libosmocore As of Change-Id Ie1bc00670887064da0fea61c3dab036c23ceea25, this function is offered by libosmocore. Change-Id: Ie269afe314967fd2c42b91ee854c217f699252dc --- M src/host/virt_phy/include/virtphy/common_util.h M src/host/virt_phy/src/Makefile.am D src/host/virt_phy/src/shared/common_util.c 3 files changed, 1 insertion(+), 85 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/common_util.h b/src/host/virt_phy/include/virtphy/common_util.h index 672ff93..2585d06 100644 --- a/src/host/virt_phy/include/virtphy/common_util.h +++ b/src/host/virt_phy/include/virtphy/common_util.h @@ -9,43 +9,3 @@ #define LID_SACCH 0x40 #define LID_DEDIC 0x00 - -/*! \brief convert GSMTAP channel type to RSL channel number - * \param[in] gsmtap_chantype GSMTAP channel type - * \param[out] rsl_chantype rsl channel type - * \param[out] rsl_chantype rsl link id - * - * Mapping from gsmtap channel: - * GSMTAP_CHANNEL_UNKNOWN * 0x00 - * GSMTAP_CHANNEL_BCCH * 0x01 - * GSMTAP_CHANNEL_CCCH * 0x02 - * GSMTAP_CHANNEL_RACH * 0x03 - * GSMTAP_CHANNEL_AGCH * 0x04 - * GSMTAP_CHANNEL_PCH * 0x05 - * GSMTAP_CHANNEL_SDCCH * 0x06 - * GSMTAP_CHANNEL_SDCCH4 * 0x07 - * GSMTAP_CHANNEL_SDCCH8 * 0x08 - * GSMTAP_CHANNEL_TCH_F * 0x09 - * GSMTAP_CHANNEL_TCH_H * 0x0a - * GSMTAP_CHANNEL_PACCH * 0x0b - * GSMTAP_CHANNEL_CBCH52 * 0x0c - * GSMTAP_CHANNEL_PDCH * 0x0d - * GSMTAP_CHANNEL_PTCCH * 0x0e - * GSMTAP_CHANNEL_CBCH51 * 0x0f - * to rsl channel type: - * RSL_CHAN_NR_MASK * 0xf8 - * RSL_CHAN_NR_1 * * 0x08 - * RSL_CHAN_Bm_ACCHs * 0x08 - * RSL_CHAN_Lm_ACCHs * 0x10 - * RSL_CHAN_SDCCH4_ACCH * 0x20 - * RSL_CHAN_SDCCH8_ACCH * 0x40 - * RSL_CHAN_BCCH * * 0x80 - * RSL_CHAN_RACH * * 0x88 - * RSL_CHAN_PCH_AGCH * 0x90 - * RSL_CHAN_OSMO_PDCH * 0xc0 - * and logical channel link id: - * LID_SACCH * * 0x40 - * LID_DEDIC * * 0x00 - */ -void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, - uint8_t *link_id); diff --git a/src/host/virt_phy/src/Makefile.am b/src/host/virt_phy/src/Makefile.am index caaec04..48f9de7 100644 --- a/src/host/virt_phy/src/Makefile.am +++ b/src/host/virt_phy/src/Makefile.am @@ -2,7 +2,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/../layer23/include sbin_PROGRAMS = virtphy -virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c shared/common_util.c +virtphy_SOURCES = virtphy.c l1ctl_sock.c gsmtapl1_if.c l1ctl_sap.c virt_prim_pm.c virt_prim_fbsb.c virt_prim_rach.c virt_prim_data.c virt_prim_traffic.c virt_l1_sched_simple.c logging.c virt_l1_model.c shared/virtual_um.c shared/osmo_mcast_sock.c virtphy_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) virtphy_LDFLAGS = -pthread diff --git a/src/host/virt_phy/src/shared/common_util.c b/src/host/virt_phy/src/shared/common_util.c deleted file mode 100644 index 49dea18..0000000 --- a/src/host/virt_phy/src/shared/common_util.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Utility function used both in osmo bts virt and osmocom bb virt. - */ - -#include -#include -#include - -void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, - uint8_t *link_id) -{ - // switch case with removed acch flag - switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { - case GSMTAP_CHANNEL_TCH_F: // TCH/F, FACCH/F - *rsl_chantype = RSL_CHAN_Bm_ACCHs; - break; - case GSMTAP_CHANNEL_TCH_H: // TCH/H, FACCH/H - *rsl_chantype = RSL_CHAN_Lm_ACCHs; - break; - case GSMTAP_CHANNEL_SDCCH4: // SDCCH/4 - *rsl_chantype = RSL_CHAN_SDCCH4_ACCH; - break; - case GSMTAP_CHANNEL_SDCCH8: // SDCCH/8 - *rsl_chantype = RSL_CHAN_SDCCH8_ACCH; - break; - case GSMTAP_CHANNEL_BCCH: // BCCH - *rsl_chantype = RSL_CHAN_BCCH; - break; - case GSMTAP_CHANNEL_RACH: // RACH - *rsl_chantype = RSL_CHAN_RACH; - break; - case GSMTAP_CHANNEL_PCH: // PCH - case GSMTAP_CHANNEL_AGCH: // AGCH - *rsl_chantype = RSL_CHAN_PCH_AGCH; - break; - case GSMTAP_CHANNEL_PDCH: - *rsl_chantype = GSMTAP_CHANNEL_PDCH; - break; - } - - *link_id = gsmtap_chantype & GSMTAP_CHANNEL_ACCH ? LID_SACCH : - LID_DEDIC; - -} -- To view, visit https://gerrit.osmocom.org/3226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie269afe314967fd2c42b91ee854c217f699252dc Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 10:39:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 10:39:23 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Use gsmtap value_strings in recent libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Use gsmtap value_strings in recent libosmocore ...................................................................... VIRT-PHY: Use gsmtap value_strings in recent libosmocore In Change-ID Iaf8a99912f42a56ef785a1642e18238c0b67cf68 libosmocore introduced value_strings fro the GSMTAP_CHANNEL_* and GSMTAP_TYPE_* constants, so we can remove the private tables. Change-Id: I771dbe079fc6d1a5e66e958deb832c1168990851 --- M src/host/virt_phy/src/gsmtapl1_if.c 1 file changed, 2 insertions(+), 42 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index ae9cd32..2624046 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -40,46 +40,6 @@ static struct l1_model_ms *l1_model_ms = NULL; -/* for debugging */ -static const struct value_string gsmtap_channels[] = { - { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" }, - { GSMTAP_CHANNEL_BCCH, "BCCH" }, - { GSMTAP_CHANNEL_CCCH, "CCCH" }, - { GSMTAP_CHANNEL_RACH, "RACH" }, - { GSMTAP_CHANNEL_AGCH, "AGCH" }, - { GSMTAP_CHANNEL_PCH, "PCH" }, - { GSMTAP_CHANNEL_SDCCH, "SDCCH" }, - { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" }, - { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" }, - { GSMTAP_CHANNEL_TCH_F, "TCH/F/FACCH/F" }, - { GSMTAP_CHANNEL_TCH_H, "TCH/H/FACCH/H" }, - { GSMTAP_CHANNEL_PACCH, "PACCH" }, - { GSMTAP_CHANNEL_CBCH52, "CBCH" }, - { GSMTAP_CHANNEL_PDCH, "PDCH" } , - { GSMTAP_CHANNEL_PTCCH, "PTTCH" }, - { GSMTAP_CHANNEL_CBCH51, "CBCH" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH, "LSACCH" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH4, "SACCH/4" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_SDCCH8, "SACCH/8" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_F, "SACCH/F" }, - { GSMTAP_CHANNEL_ACCH | GSMTAP_CHANNEL_TCH_H, "SACCH/H" }, - { 0, NULL } -}; - -/* for debugging */ -static const struct value_string gsmtap_types[10] = { - { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" }, - { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" }, - { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" }, - { GSMTAP_TYPE_SIM, "SIM Card" }, - { GSMTAP_TYPE_TETRA_I1, "TETRA V+D" }, - { GSMTAP_TYPE_WMX_BURST, "WiMAX burst" }, - { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)"}, - { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" }, - { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" }, - { 0, NULL } -}; - void gsmtapl1_init(struct l1_model_ms *model) { l1_model_ms = model; @@ -212,8 +172,8 @@ DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", - arfcn, fn, get_value_string(gsmtap_types, gh->type), - get_value_string(gsmtap_channels, gsmtap_chantype), timeslot, + arfcn, fn, get_value_string(gsmtap_type_names, gh->type), + get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype), timeslot, subslot, rsl_chantype, link_id, chan_nr); /* switch case with removed ACCH flag */ -- To view, visit https://gerrit.osmocom.org/3227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I771dbe079fc6d1a5e66e958deb832c1168990851 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:29:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:29:41 +0000 Subject: [PATCH] libosmocore[master]: select: Add new osmo_fd_close() function Message-ID: Review at https://gerrit.osmocom.org/3228 select: Add new osmo_fd_close() function This is a convenience helper that will both close a fd, mark it as closed and unregister it from the event loop abstraction. In most cases, you probably actually want to use it instead of manually closing + calling osmo_fd_unregister(). Change-Id: Icd0933eed6a24edde7cdcb378e138897ecc5332c --- M include/osmocom/core/select.h M src/select.c 2 files changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/3228/1 diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index 9b5f372..2abda2d 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -39,6 +39,7 @@ bool osmo_fd_is_registered(struct osmo_fd *fd); int osmo_fd_register(struct osmo_fd *fd); void osmo_fd_unregister(struct osmo_fd *fd); +void osmo_fd_close(struct osmo_fd *fd); int osmo_select_main(int polling); struct osmo_fd *osmo_fd_get_by_fd(int fd); diff --git a/src/select.c b/src/select.c index f7ee424..b34d45c 100644 --- a/src/select.c +++ b/src/select.c @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -117,6 +118,16 @@ llist_del(&fd->list); } +void osmo_fd_close(struct osmo_fd *fd) +{ + if (osmo_fd_is_registered(fd)) + osmo_fd_unregister(fd); + if (fd->fd != -1) + close(fd->fd); + fd->fd = -1; + fd->when = 0; +} + /*! Populate the fd_sets and return the highest fd number * \param[in] _rset The readfds to populate * \param[in] _wset The wrtiefds to populate -- To view, visit https://gerrit.osmocom.org/3228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd0933eed6a24edde7cdcb378e138897ecc5332c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:32:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:32:06 +0000 Subject: [PATCH] osmocom-bb[master]: Port osmo_mcast_sock to libosmocore socket routines Message-ID: Review at https://gerrit.osmocom.org/3229 Port osmo_mcast_sock to libosmocore socket routines Change-Id: Ia44c086fb8e428edf49bafd1662c31b2dc2bfc43 --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 44 insertions(+), 65 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/29/3229/1 diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index ff81063..94aa925 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -10,32 +10,38 @@ #include #include +/* server socket is what we use for transmission. It is not subscribed + * to a multicast group or locally bound, but it is just a normal UDP + * socket that's connected to the remote mcast group + port */ struct mcast_server_sock *mcast_server_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, int loopback) { - struct mcast_server_sock *serv_sock = talloc_zero(ctx, - struct mcast_server_sock); + struct mcast_server_sock *serv_sock = talloc_zero(ctx, struct mcast_server_sock); + int rc; - serv_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); - serv_sock->sock_conf = talloc_zero(ctx, struct sockaddr_in); + /* TODO: why allocate those dynamically ?!? */ + serv_sock->osmo_fd = talloc_zero(serv_sock, struct osmo_fd); + serv_sock->sock_conf = talloc_zero(serv_sock, struct sockaddr_in); - // setup mcast server socket - serv_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (serv_sock->osmo_fd->fd == -1) { + /* setup mcast server socket */ + rc = osmo_sock_init_ofd(serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + tx_mcast_group, tx_mcast_port, OSMO_SOCK_F_CONNECT); + if (rc < 0) { perror("Failed to create Multicast Server Socket"); return NULL; } + /* TODO: Why kleep this stored in sock_conf? */ serv_sock->sock_conf->sin_family = AF_INET; serv_sock->sock_conf->sin_addr.s_addr = inet_addr(tx_mcast_group); serv_sock->sock_conf->sin_port = htons(tx_mcast_port); // determines whether sent mcast packets should be looped back to the local sockets. // loopback must be enabled if the mcast client is on the same machine - if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, - IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0) { + if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, + &loopback, sizeof(loopback)) < 0) { perror("Failed to disable loopback.\n"); return NULL; } @@ -43,84 +49,59 @@ return serv_sock; } +/* the client socket is what we use for reception. It is a UDP socket + * that's bound to the GSMTAP UDP port and subscribed to the respective + * multicast group */ struct mcast_client_sock *mcast_client_sock_setup( void *ctx, char* mcast_group, int mcast_port, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { - struct mcast_client_sock *client_sock = talloc_zero(ctx, - struct mcast_client_sock); - struct sockaddr_in *rx_sock_conf = talloc_zero(NULL, - struct sockaddr_in); - int rc, reuseaddr = 1, loopback = 1, all = 0; + struct mcast_client_sock *client_sock = talloc_zero(ctx, struct mcast_client_sock); + int rc, loopback = 1, all = 0; - client_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); - client_sock->mcast_group = talloc_zero(ctx, struct ip_mreq); + /* TODO: why allocate those dynamically ?!? */ + client_sock->osmo_fd = talloc_zero(client_sock, struct osmo_fd); + client_sock->mcast_group = talloc_zero(client_sock, struct ip_mreq); - // Create mcast client socket - client_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (client_sock->osmo_fd->fd == -1) { + client_sock->osmo_fd->cb = fd_rx_cb; + client_sock->osmo_fd->when = BSC_FD_READ; + client_sock->osmo_fd->data = osmo_fd_data; + + /* Create mcast client socket */ + rc = osmo_sock_init_ofd(client_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + NULL, mcast_port, OSMO_SOCK_F_BIND); + if (rc < 0) { perror("Could not create mcast client socket"); return NULL; } - // Enable SO_REUSEADDR to allow multiple instances of this application to receive copies of the multicast datagrams. - rc = setsockopt(client_sock->osmo_fd->fd, - SOL_SOCKET, - SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr)); - if (rc < 0) { - perror("Failed to configure REUSEADDR option"); - return NULL; - } - - // Bind to the proper port number with the IP address specified as INADDR_ANY. - rx_sock_conf->sin_family = AF_INET; - rx_sock_conf->sin_addr.s_addr = htonl(INADDR_ANY); - rx_sock_conf->sin_port = htons(mcast_port); - rc = bind(client_sock->osmo_fd->fd, (struct sockaddr *)rx_sock_conf, - sizeof(*rx_sock_conf)); - talloc_free(rx_sock_conf); - if (rc < 0) { - perror("Could not bind mcast client socket"); - return NULL; - } - - // Enable loopback of msgs to the host. - // Loopback must be enabled for the client, so multiple processes are able to recevie a mcast package. - rc = setsockopt(client_sock->osmo_fd->fd, - IPPROTO_IP, - IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); + /* Enable loopback of msgs to the host. */ + /* Loopback must be enabled for the client, so multiple + * processes are able to receive a mcast package. */ + rc = setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, + &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to enable IP_MULTICAST_LOOP"); return NULL; } - // Configure and join the multicast group + /* Configure and join the multicast group */ client_sock->mcast_group->imr_multiaddr.s_addr = inet_addr(mcast_group); client_sock->mcast_group->imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(client_sock->osmo_fd->fd, - IPPROTO_IP, - IP_ADD_MEMBERSHIP, client_sock->mcast_group, - sizeof(*client_sock->mcast_group)); + rc = setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, + client_sock->mcast_group, sizeof(*client_sock->mcast_group)); if (rc < 0) { perror("Failed to join to mcast goup"); return NULL; } - // this option will set the delivery option so that only packages are received - // from sockets we are bound to via IP_ADD_MEMBERSHIP - if (setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, - IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { + /* this option will set the delivery option so that only packets + * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ + if (setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { perror("Failed to modify delivery policy to explicitly joined.\n"); return NULL; } - - // configure and register the osmocom filedescriptor - client_sock->osmo_fd->cb = fd_rx_cb; - client_sock->osmo_fd->when = BSC_FD_READ; - client_sock->osmo_fd->data = osmo_fd_data; - - osmo_fd_register(client_sock->osmo_fd); return client_sock; } @@ -171,10 +152,8 @@ void mcast_client_sock_close(struct mcast_client_sock *client_sock) { - setsockopt(client_sock->osmo_fd->fd, - IPPROTO_IP, - IP_DROP_MEMBERSHIP, client_sock->mcast_group, - sizeof(*client_sock->mcast_group)); + setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, + client_sock->mcast_group, sizeof(*client_sock->mcast_group)); osmo_fd_unregister(client_sock->osmo_fd); client_sock->osmo_fd->fd = -1; client_sock->osmo_fd->when = 0; -- To view, visit https://gerrit.osmocom.org/3229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia44c086fb8e428edf49bafd1662c31b2dc2bfc43 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:32:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:32:06 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: osmo_mcast_sock.c coding style cleanup Message-ID: Review at https://gerrit.osmocom.org/3230 VIRT-PHY: osmo_mcast_sock.c coding style cleanup Change-Id: Ie45ea5911167600cb9a1a79dfcd9656be1e91dab --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 20 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/30/3230/1 diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 94aa925..b9bf90c 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -13,10 +13,8 @@ /* server socket is what we use for transmission. It is not subscribed * to a multicast group or locally bound, but it is just a normal UDP * socket that's connected to the remote mcast group + port */ -struct mcast_server_sock *mcast_server_sock_setup(void *ctx, - char* tx_mcast_group, - int tx_mcast_port, - int loopback) +struct mcast_server_sock * +mcast_server_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, int loopback) { struct mcast_server_sock *serv_sock = talloc_zero(ctx, struct mcast_server_sock); int rc; @@ -38,11 +36,11 @@ serv_sock->sock_conf->sin_addr.s_addr = inet_addr(tx_mcast_group); serv_sock->sock_conf->sin_port = htons(tx_mcast_port); - // determines whether sent mcast packets should be looped back to the local sockets. - // loopback must be enabled if the mcast client is on the same machine + /* determines whether sent mcast packets should be looped back to the local sockets. + * loopback must be enabled if the mcast client is on the same machine */ if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0) { - perror("Failed to disable loopback.\n"); + perror("Failed to configure multicast loopback.\n"); return NULL; } @@ -52,10 +50,10 @@ /* the client socket is what we use for reception. It is a UDP socket * that's bound to the GSMTAP UDP port and subscribed to the respective * multicast group */ -struct mcast_client_sock *mcast_client_sock_setup( - void *ctx, char* mcast_group, int mcast_port, - int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), - void *osmo_fd_data) +struct mcast_client_sock * +mcast_client_sock_setup(void *ctx, char* mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) { struct mcast_client_sock *client_sock = talloc_zero(ctx, struct mcast_client_sock); int rc, loopback = 1, all = 0; @@ -106,18 +104,17 @@ return client_sock; } -struct mcast_bidir_sock *mcast_bidir_sock_setup( - void *ctx, char* tx_mcast_group, int tx_mcast_port, - char* rx_mcast_group, int rx_mcast_port, int loopback, - int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), - void *osmo_fd_data) +struct mcast_bidir_sock * +mcast_bidir_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, + char* rx_mcast_group, int rx_mcast_port, int loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) { - struct mcast_bidir_sock *bidir_sock = talloc(ctx, - struct mcast_bidir_sock); + struct mcast_bidir_sock *bidir_sock = talloc(ctx, struct mcast_bidir_sock); bidir_sock->rx_sock = mcast_client_sock_setup(ctx, rx_mcast_group, - rx_mcast_port, fd_rx_cb, osmo_fd_data); + rx_mcast_port, fd_rx_cb, osmo_fd_data); bidir_sock->tx_sock = mcast_server_sock_setup(ctx, tx_mcast_group, - tx_mcast_port, loopback); + tx_mcast_port, loopback); if (!bidir_sock->rx_sock || !bidir_sock->tx_sock) { return NULL; } @@ -135,8 +132,7 @@ int data_len) { return sendto(serv_sock->osmo_fd->fd, data, data_len, 0, - (struct sockaddr *)serv_sock->sock_conf, - sizeof(*serv_sock->sock_conf)); + (struct sockaddr *)serv_sock->sock_conf, sizeof(*serv_sock->sock_conf)); } int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, @@ -144,8 +140,8 @@ { return mcast_server_sock_tx(bidir_sock->tx_sock, data, data_len); } -int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, - int buf_len) + +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, int buf_len) { return mcast_client_sock_rx(bidir_sock->rx_sock, buf, buf_len); } -- To view, visit https://gerrit.osmocom.org/3230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie45ea5911167600cb9a1a79dfcd9656be1e91dab Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:32:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:32:07 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: osmo_mcast_sock: Get rid of server_sock.sock_conf Message-ID: Review at https://gerrit.osmocom.org/3231 VIRT-PHY: osmo_mcast_sock: Get rid of server_sock.sock_conf We don't need to store this data, we cans simply connect the socket to the destination mcast address instead. Change-Id: I3c98653c41eff9feb649d9c47cd40b26fd81ed05 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/31/3231/1 diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index f318ffe..abf2c48 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -5,7 +5,6 @@ struct mcast_server_sock { struct osmo_fd *osmo_fd; - struct sockaddr_in *sock_conf; }; struct mcast_client_sock { diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index b9bf90c..fdbbb88 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -21,7 +21,6 @@ /* TODO: why allocate those dynamically ?!? */ serv_sock->osmo_fd = talloc_zero(serv_sock, struct osmo_fd); - serv_sock->sock_conf = talloc_zero(serv_sock, struct sockaddr_in); /* setup mcast server socket */ rc = osmo_sock_init_ofd(serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, @@ -30,11 +29,6 @@ perror("Failed to create Multicast Server Socket"); return NULL; } - - /* TODO: Why kleep this stored in sock_conf? */ - serv_sock->sock_conf->sin_family = AF_INET; - serv_sock->sock_conf->sin_addr.s_addr = inet_addr(tx_mcast_group); - serv_sock->sock_conf->sin_port = htons(tx_mcast_port); /* determines whether sent mcast packets should be looped back to the local sockets. * loopback must be enabled if the mcast client is on the same machine */ @@ -131,8 +125,7 @@ int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, int data_len) { - return sendto(serv_sock->osmo_fd->fd, data, data_len, 0, - (struct sockaddr *)serv_sock->sock_conf, sizeof(*serv_sock->sock_conf)); + return send(serv_sock->osmo_fd->fd, data, data_len, 0); } int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, @@ -162,7 +155,6 @@ void mcast_server_sock_close(struct mcast_server_sock *serv_sock) { close(serv_sock->osmo_fd->fd); - talloc_free(serv_sock->sock_conf); talloc_free(serv_sock); } -- To view, visit https://gerrit.osmocom.org/3231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c98653c41eff9feb649d9c47cd40b26fd81ed05 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:32:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:32:07 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: mcast_sock: Avoid dynamic allocation of osmo_fd me... Message-ID: Review at https://gerrit.osmocom.org/3232 VIRT-PHY: mcast_sock: Avoid dynamic allocation of osmo_fd member Change-Id: I11e0137849797eb67047b4ddca0e917c599ed909 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 19 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/32/3232/1 diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index abf2c48..3c5954d 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -4,11 +4,11 @@ #include struct mcast_server_sock { - struct osmo_fd *osmo_fd; + struct osmo_fd osmo_fd; }; struct mcast_client_sock { - struct osmo_fd *osmo_fd; + struct osmo_fd osmo_fd; struct ip_mreq *mcast_group; }; diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index fdbbb88..a06d706 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -19,11 +19,8 @@ struct mcast_server_sock *serv_sock = talloc_zero(ctx, struct mcast_server_sock); int rc; - /* TODO: why allocate those dynamically ?!? */ - serv_sock->osmo_fd = talloc_zero(serv_sock, struct osmo_fd); - /* setup mcast server socket */ - rc = osmo_sock_init_ofd(serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + rc = osmo_sock_init_ofd(&serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, tx_mcast_group, tx_mcast_port, OSMO_SOCK_F_CONNECT); if (rc < 0) { perror("Failed to create Multicast Server Socket"); @@ -32,7 +29,7 @@ /* determines whether sent mcast packets should be looped back to the local sockets. * loopback must be enabled if the mcast client is on the same machine */ - if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, + if (setsockopt(serv_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0) { perror("Failed to configure multicast loopback.\n"); return NULL; @@ -53,15 +50,14 @@ int rc, loopback = 1, all = 0; /* TODO: why allocate those dynamically ?!? */ - client_sock->osmo_fd = talloc_zero(client_sock, struct osmo_fd); client_sock->mcast_group = talloc_zero(client_sock, struct ip_mreq); - client_sock->osmo_fd->cb = fd_rx_cb; - client_sock->osmo_fd->when = BSC_FD_READ; - client_sock->osmo_fd->data = osmo_fd_data; + client_sock->osmo_fd.cb = fd_rx_cb; + client_sock->osmo_fd.when = BSC_FD_READ; + client_sock->osmo_fd.data = osmo_fd_data; /* Create mcast client socket */ - rc = osmo_sock_init_ofd(client_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + rc = osmo_sock_init_ofd(&client_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, mcast_port, OSMO_SOCK_F_BIND); if (rc < 0) { perror("Could not create mcast client socket"); @@ -71,7 +67,7 @@ /* Enable loopback of msgs to the host. */ /* Loopback must be enabled for the client, so multiple * processes are able to receive a mcast package. */ - rc = setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, + rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to enable IP_MULTICAST_LOOP"); @@ -81,7 +77,7 @@ /* Configure and join the multicast group */ client_sock->mcast_group->imr_multiaddr.s_addr = inet_addr(mcast_group); client_sock->mcast_group->imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, + rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, client_sock->mcast_group, sizeof(*client_sock->mcast_group)); if (rc < 0) { perror("Failed to join to mcast goup"); @@ -90,7 +86,7 @@ /* this option will set the delivery option so that only packets * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ - if (setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { + if (setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { perror("Failed to modify delivery policy to explicitly joined.\n"); return NULL; } @@ -119,13 +115,13 @@ int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, int buf_len) { - return recv(client_sock->osmo_fd->fd, buf, buf_len, 0); + return recv(client_sock->osmo_fd.fd, buf, buf_len, 0); } int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, int data_len) { - return send(serv_sock->osmo_fd->fd, data, data_len, 0); + return send(serv_sock->osmo_fd.fd, data, data_len, 0); } int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, @@ -141,20 +137,19 @@ void mcast_client_sock_close(struct mcast_client_sock *client_sock) { - setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, + setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, client_sock->mcast_group, sizeof(*client_sock->mcast_group)); - osmo_fd_unregister(client_sock->osmo_fd); - client_sock->osmo_fd->fd = -1; - client_sock->osmo_fd->when = 0; - close(client_sock->osmo_fd->fd); + osmo_fd_unregister(&client_sock->osmo_fd); + client_sock->osmo_fd.fd = -1; + client_sock->osmo_fd.when = 0; + close(client_sock->osmo_fd.fd); talloc_free(client_sock->mcast_group); - talloc_free(client_sock->osmo_fd); talloc_free(client_sock); } void mcast_server_sock_close(struct mcast_server_sock *serv_sock) { - close(serv_sock->osmo_fd->fd); + close(serv_sock->osmo_fd.fd); talloc_free(serv_sock); } -- To view, visit https://gerrit.osmocom.org/3232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11e0137849797eb67047b4ddca0e917c599ed909 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:32:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:32:07 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: mcast_sock: Don't keep subscribed multicast group ... Message-ID: Review at https://gerrit.osmocom.org/3233 VIRT-PHY: mcast_sock: Don't keep subscribed multicast group around We can avoid having to keep around the multicast group in a chunk of dynamically allocated memory and simplify related code. Change-Id: Ic39ffe73dfd2cb8ffefb9614340e275dac87bd50 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 7 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/33/3233/1 diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index 3c5954d..ba5237a 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -9,7 +9,6 @@ struct mcast_client_sock { struct osmo_fd osmo_fd; - struct ip_mreq *mcast_group; }; struct mcast_bidir_sock { diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index a06d706..b42a5e4 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -47,10 +47,8 @@ void *osmo_fd_data) { struct mcast_client_sock *client_sock = talloc_zero(ctx, struct mcast_client_sock); + struct ip_mreq mreq; int rc, loopback = 1, all = 0; - - /* TODO: why allocate those dynamically ?!? */ - client_sock->mcast_group = talloc_zero(client_sock, struct ip_mreq); client_sock->osmo_fd.cb = fd_rx_cb; client_sock->osmo_fd.when = BSC_FD_READ; @@ -75,10 +73,10 @@ } /* Configure and join the multicast group */ - client_sock->mcast_group->imr_multiaddr.s_addr = inet_addr(mcast_group); - client_sock->mcast_group->imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, - client_sock->mcast_group, sizeof(*client_sock->mcast_group)); + memset(&mreq, 0, sizeof(mreq)); + mreq.imr_multiaddr.s_addr = inet_addr(mcast_group); + mreq.imr_interface.s_addr = htonl(INADDR_ANY); + rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); if (rc < 0) { perror("Failed to join to mcast goup"); return NULL; @@ -137,13 +135,12 @@ void mcast_client_sock_close(struct mcast_client_sock *client_sock) { - setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, - client_sock->mcast_group, sizeof(*client_sock->mcast_group)); + /* multicast memberships of socket are implicitly dropped when + * socket is closed */ osmo_fd_unregister(&client_sock->osmo_fd); client_sock->osmo_fd.fd = -1; client_sock->osmo_fd.when = 0; close(client_sock->osmo_fd.fd); - talloc_free(client_sock->mcast_group); talloc_free(client_sock); } -- To view, visit https://gerrit.osmocom.org/3233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic39ffe73dfd2cb8ffefb9614340e275dac87bd50 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:32:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:32:07 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: mcast_sock: We must close the fd before setting it... Message-ID: Review at https://gerrit.osmocom.org/3234 VIRT-PHY: mcast_sock: We must close the fd before setting it to -1 Change-Id: Id8e72c8800a8b3021ab350acaebd912f1b387063 --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/34/3234/1 diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index b42a5e4..6ef3969 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -138,9 +138,9 @@ /* multicast memberships of socket are implicitly dropped when * socket is closed */ osmo_fd_unregister(&client_sock->osmo_fd); + close(client_sock->osmo_fd.fd); client_sock->osmo_fd.fd = -1; client_sock->osmo_fd.when = 0; - close(client_sock->osmo_fd.fd); talloc_free(client_sock); } -- To view, visit https://gerrit.osmocom.org/3234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8e72c8800a8b3021ab350acaebd912f1b387063 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:32:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:32:08 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Further simplify mcast_sock code Message-ID: Review at https://gerrit.osmocom.org/3235 VIRT-PHY: Further simplify mcast_sock code By avoiding dynamic allocations and relying on osmo_fd, we can significantly simplify the code. Change-Id: Iad653686ac2bda5b3c92c30b4386ee7727d16271 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 69 insertions(+), 97 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/35/3235/1 diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index ba5237a..31b2fd4 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -3,42 +3,25 @@ #include #include -struct mcast_server_sock { - struct osmo_fd osmo_fd; -}; - -struct mcast_client_sock { - struct osmo_fd osmo_fd; -}; - struct mcast_bidir_sock { - struct mcast_server_sock *tx_sock; - struct mcast_client_sock *rx_sock; + struct osmo_fd tx_ofd; + struct osmo_fd rx_ofd; }; -struct mcast_bidir_sock *mcast_bidir_sock_setup( - void *ctx, char* tx_mcast_group, int tx_mcast_port, - char* rx_mcast_group, int rx_mcast_port, int loopback, +struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx, + const char *tx_mcast_group, int tx_mcast_port, + const char *rx_mcast_group, int rx_mcast_port, int loopback, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data); -struct mcast_server_sock *mcast_server_sock_setup(void *ctx, - char* tx_mcast_group, - int tx_mcast_port, - int loopback); -struct mcast_client_sock *mcast_client_sock_setup( - void *ctx, char* mcast_group, int mcast_port, - int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), - void *osmo_fd_data); -int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, - int buf_len); -int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, - int data_len); -int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, - int data_len); -int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, - int buf_len); -void mcast_client_sock_close(struct mcast_client_sock* client_sock); -void mcast_server_sock_close(struct mcast_server_sock* server_sock); +int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group, + int tx_mcast_port, int loopback); + +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void *data, int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void *buf, int buf_len); void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 6ef3969..11a1aa9 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -10,149 +10,138 @@ #include #include +/* convenience wrapper */ +static void fd_close(struct osmo_fd *ofd) +{ + /* multicast memberships of socket are implicitly dropped when + * socket is closed */ + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; +} + /* server socket is what we use for transmission. It is not subscribed * to a multicast group or locally bound, but it is just a normal UDP * socket that's connected to the remote mcast group + port */ -struct mcast_server_sock * -mcast_server_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, int loopback) +int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, int tx_mcast_port, + int loopback) { - struct mcast_server_sock *serv_sock = talloc_zero(ctx, struct mcast_server_sock); int rc; /* setup mcast server socket */ - rc = osmo_sock_init_ofd(&serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, tx_mcast_group, tx_mcast_port, OSMO_SOCK_F_CONNECT); if (rc < 0) { perror("Failed to create Multicast Server Socket"); - return NULL; + return rc; } /* determines whether sent mcast packets should be looped back to the local sockets. * loopback must be enabled if the mcast client is on the same machine */ - if (setsockopt(serv_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_LOOP, - &loopback, sizeof(loopback)) < 0) { + rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); + if (rc < 0) { perror("Failed to configure multicast loopback.\n"); - return NULL; + return rc; } - return serv_sock; + return 0; } /* the client socket is what we use for reception. It is a UDP socket * that's bound to the GSMTAP UDP port and subscribed to the respective * multicast group */ -struct mcast_client_sock * -mcast_client_sock_setup(void *ctx, char* mcast_group, int mcast_port, - int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), - void *osmo_fd_data) +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) { - struct mcast_client_sock *client_sock = talloc_zero(ctx, struct mcast_client_sock); struct ip_mreq mreq; int rc, loopback = 1, all = 0; - client_sock->osmo_fd.cb = fd_rx_cb; - client_sock->osmo_fd.when = BSC_FD_READ; - client_sock->osmo_fd.data = osmo_fd_data; + ofd->cb = fd_rx_cb; + ofd->when = BSC_FD_READ; + ofd->data = osmo_fd_data; /* Create mcast client socket */ - rc = osmo_sock_init_ofd(&client_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, mcast_port, OSMO_SOCK_F_BIND); if (rc < 0) { perror("Could not create mcast client socket"); - return NULL; + return rc; } /* Enable loopback of msgs to the host. */ /* Loopback must be enabled for the client, so multiple * processes are able to receive a mcast package. */ - rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_LOOP, + rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to enable IP_MULTICAST_LOOP"); - return NULL; + return rc; } /* Configure and join the multicast group */ memset(&mreq, 0, sizeof(mreq)); mreq.imr_multiaddr.s_addr = inet_addr(mcast_group); mreq.imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); + rc = setsockopt(ofd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); if (rc < 0) { perror("Failed to join to mcast goup"); - return NULL; + return rc; } /* this option will set the delivery option so that only packets * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ - if (setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { + if (setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { perror("Failed to modify delivery policy to explicitly joined.\n"); - return NULL; + return rc; } - return client_sock; + return 0; } struct mcast_bidir_sock * -mcast_bidir_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, - char* rx_mcast_group, int rx_mcast_port, int loopback, +mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, int tx_mcast_port, + const char *rx_mcast_group, int rx_mcast_port, int loopback, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { struct mcast_bidir_sock *bidir_sock = talloc(ctx, struct mcast_bidir_sock); - bidir_sock->rx_sock = mcast_client_sock_setup(ctx, rx_mcast_group, - rx_mcast_port, fd_rx_cb, osmo_fd_data); - bidir_sock->tx_sock = mcast_server_sock_setup(ctx, tx_mcast_group, - tx_mcast_port, loopback); - if (!bidir_sock->rx_sock || !bidir_sock->tx_sock) { + int rc; + + if (!bidir_sock) + return NULL; + + rc = mcast_client_sock_setup(&bidir_sock->rx_ofd, rx_mcast_group, rx_mcast_port, + fd_rx_cb, osmo_fd_data); + if (rc < 0) { + talloc_free(bidir_sock); + return NULL; + } + rc = mcast_server_sock_setup(&bidir_sock->tx_ofd, tx_mcast_group, tx_mcast_port, loopback); + if (rc < 0) { + fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); return NULL; } return bidir_sock; } -int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, - int buf_len) -{ - return recv(client_sock->osmo_fd.fd, buf, buf_len, 0); -} - -int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, - int data_len) -{ - return send(serv_sock->osmo_fd.fd, data, data_len, 0); -} - int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, int data_len) { - return mcast_server_sock_tx(bidir_sock->tx_sock, data, data_len); + return send(bidir_sock->tx_ofd.fd, data, data_len, 0); } int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, int buf_len) { - return mcast_client_sock_rx(bidir_sock->rx_sock, buf, buf_len); -} - -void mcast_client_sock_close(struct mcast_client_sock *client_sock) -{ - /* multicast memberships of socket are implicitly dropped when - * socket is closed */ - osmo_fd_unregister(&client_sock->osmo_fd); - close(client_sock->osmo_fd.fd); - client_sock->osmo_fd.fd = -1; - client_sock->osmo_fd.when = 0; - talloc_free(client_sock); - -} -void mcast_server_sock_close(struct mcast_server_sock *serv_sock) -{ - close(serv_sock->osmo_fd.fd); - talloc_free(serv_sock); + return recv(bidir_sock->rx_ofd.fd, buf, buf_len, 0); } void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) { - mcast_client_sock_close(bidir_sock->rx_sock); - mcast_server_sock_close(bidir_sock->tx_sock); + fd_close(&bidir_sock->tx_ofd); + fd_close(&bidir_sock->rx_ofd); talloc_free(bidir_sock); } -- To view, visit https://gerrit.osmocom.org/3235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad653686ac2bda5b3c92c30b4386ee7727d16271 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:32:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:32:08 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: mcast_sock: properly clean up in error paths (clos... Message-ID: Review at https://gerrit.osmocom.org/3236 VIRT-PHY: mcast_sock: properly clean up in error paths (close/unreg socket) Change-Id: I2c22359735af6b867e25e0f566cadbc88f21ef44 --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/36/3236/1 diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 11a1aa9..3a3c77a 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -42,6 +42,7 @@ rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to configure multicast loopback.\n"); + fd_close(ofd); return rc; } @@ -77,6 +78,7 @@ &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to enable IP_MULTICAST_LOOP"); + fd_close(ofd); return rc; } @@ -87,6 +89,7 @@ rc = setsockopt(ofd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); if (rc < 0) { perror("Failed to join to mcast goup"); + fd_close(ofd); return rc; } @@ -94,6 +97,7 @@ * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ if (setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { perror("Failed to modify delivery policy to explicitly joined.\n"); + fd_close(ofd); return rc; } -- To view, visit https://gerrit.osmocom.org/3236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2c22359735af6b867e25e0f566cadbc88f21ef44 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:32:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:32:08 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY mcast_sock: Use uint16_t for ports, bool and const Message-ID: Review at https://gerrit.osmocom.org/3237 VIRT-PHY mcast_sock: Use uint16_t for ports, bool and const Change-Id: I4eab1da8d43fdad05c04f23d89711081c4696fe7 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 16 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/37/3237/1 diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index 31b2fd4..aa2013c 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -1,5 +1,7 @@ #pragma once +#include +#include #include #include @@ -9,19 +11,19 @@ }; struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx, - const char *tx_mcast_group, int tx_mcast_port, - const char *rx_mcast_group, int rx_mcast_port, int loopback, + const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data); int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group, - int tx_mcast_port, int loopback); + uint16_t tx_mcast_port, bool loopback); -int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, int mcast_port, +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data); -int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void *data, int data_len); -int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void *buf, int buf_len); +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, unsigned int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len); void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 3a3c77a..df3abc3 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -24,8 +24,8 @@ /* server socket is what we use for transmission. It is not subscribed * to a multicast group or locally bound, but it is just a normal UDP * socket that's connected to the remote mcast group + port */ -int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, int tx_mcast_port, - int loopback) +int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, + uint16_t tx_mcast_port, bool loopback) { int rc; @@ -52,7 +52,7 @@ /* the client socket is what we use for reception. It is a UDP socket * that's bound to the GSMTAP UDP port and subscribed to the respective * multicast group */ -int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, int mcast_port, +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { @@ -105,8 +105,8 @@ } struct mcast_bidir_sock * -mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, int tx_mcast_port, - const char *rx_mcast_group, int rx_mcast_port, int loopback, +mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { @@ -132,13 +132,13 @@ } -int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, - int data_len) +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, + unsigned int data_len) { return send(bidir_sock->tx_ofd.fd, data, data_len, 0); } -int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, int buf_len) +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len) { return recv(bidir_sock->rx_ofd.fd, buf, buf_len, 0); } -- To view, visit https://gerrit.osmocom.org/3237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4eab1da8d43fdad05c04f23d89711081c4696fe7 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:36:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:37 +0000 Subject: osmocom-bb[master]: Port osmo_mcast_sock to libosmocore socket routines In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia44c086fb8e428edf49bafd1662c31b2dc2bfc43 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 12:36:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:39 +0000 Subject: osmocom-bb[master]: VIRT-PHY: osmo_mcast_sock.c coding style cleanup In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie45ea5911167600cb9a1a79dfcd9656be1e91dab Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 12:36:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:43 +0000 Subject: osmocom-bb[master]: VIRT-PHY: osmo_mcast_sock: Get rid of server_sock.sock_conf In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c98653c41eff9feb649d9c47cd40b26fd81ed05 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 12:36:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:46 +0000 Subject: osmocom-bb[master]: VIRT-PHY: mcast_sock: Avoid dynamic allocation of osmo_fd me... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11e0137849797eb67047b4ddca0e917c599ed909 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 12:36:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:48 +0000 Subject: osmocom-bb[master]: VIRT-PHY: mcast_sock: Don't keep subscribed multicast group ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic39ffe73dfd2cb8ffefb9614340e275dac87bd50 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 12:36:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:50 +0000 Subject: osmocom-bb[master]: VIRT-PHY: mcast_sock: We must close the fd before setting it... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8e72c8800a8b3021ab350acaebd912f1b387063 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 12:36:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:52 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Further simplify mcast_sock code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iad653686ac2bda5b3c92c30b4386ee7727d16271 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 12:36:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:54 +0000 Subject: osmocom-bb[master]: VIRT-PHY: mcast_sock: properly clean up in error paths (clos... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c22359735af6b867e25e0f566cadbc88f21ef44 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 12:36:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:56 +0000 Subject: osmocom-bb[master]: VIRT-PHY mcast_sock: Use uint16_t for ports, bool and const In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4eab1da8d43fdad05c04f23d89711081c4696fe7 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 13 12:36:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:58 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY mcast_sock: Use uint16_t for ports, bool and const In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY mcast_sock: Use uint16_t for ports, bool and const ...................................................................... VIRT-PHY mcast_sock: Use uint16_t for ports, bool and const Change-Id: I4eab1da8d43fdad05c04f23d89711081c4696fe7 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 16 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index 31b2fd4..aa2013c 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -1,5 +1,7 @@ #pragma once +#include +#include #include #include @@ -9,19 +11,19 @@ }; struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx, - const char *tx_mcast_group, int tx_mcast_port, - const char *rx_mcast_group, int rx_mcast_port, int loopback, + const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data); int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group, - int tx_mcast_port, int loopback); + uint16_t tx_mcast_port, bool loopback); -int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, int mcast_port, +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data); -int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void *data, int data_len); -int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void *buf, int buf_len); +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, unsigned int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len); void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 3a3c77a..df3abc3 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -24,8 +24,8 @@ /* server socket is what we use for transmission. It is not subscribed * to a multicast group or locally bound, but it is just a normal UDP * socket that's connected to the remote mcast group + port */ -int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, int tx_mcast_port, - int loopback) +int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, + uint16_t tx_mcast_port, bool loopback) { int rc; @@ -52,7 +52,7 @@ /* the client socket is what we use for reception. It is a UDP socket * that's bound to the GSMTAP UDP port and subscribed to the respective * multicast group */ -int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, int mcast_port, +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { @@ -105,8 +105,8 @@ } struct mcast_bidir_sock * -mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, int tx_mcast_port, - const char *rx_mcast_group, int rx_mcast_port, int loopback, +mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { @@ -132,13 +132,13 @@ } -int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, - int data_len) +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, + unsigned int data_len) { return send(bidir_sock->tx_ofd.fd, data, data_len, 0); } -int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, int buf_len) +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len) { return recv(bidir_sock->rx_ofd.fd, buf, buf_len, 0); } -- To view, visit https://gerrit.osmocom.org/3237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4eab1da8d43fdad05c04f23d89711081c4696fe7 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:36:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:58 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: mcast_sock: properly clean up in error paths (clos... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: mcast_sock: properly clean up in error paths (close/unreg socket) ...................................................................... VIRT-PHY: mcast_sock: properly clean up in error paths (close/unreg socket) Change-Id: I2c22359735af6b867e25e0f566cadbc88f21ef44 --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 11a1aa9..3a3c77a 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -42,6 +42,7 @@ rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to configure multicast loopback.\n"); + fd_close(ofd); return rc; } @@ -77,6 +78,7 @@ &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to enable IP_MULTICAST_LOOP"); + fd_close(ofd); return rc; } @@ -87,6 +89,7 @@ rc = setsockopt(ofd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); if (rc < 0) { perror("Failed to join to mcast goup"); + fd_close(ofd); return rc; } @@ -94,6 +97,7 @@ * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ if (setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { perror("Failed to modify delivery policy to explicitly joined.\n"); + fd_close(ofd); return rc; } -- To view, visit https://gerrit.osmocom.org/3236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2c22359735af6b867e25e0f566cadbc88f21ef44 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:36:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:58 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Further simplify mcast_sock code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Further simplify mcast_sock code ...................................................................... VIRT-PHY: Further simplify mcast_sock code By avoiding dynamic allocations and relying on osmo_fd, we can significantly simplify the code. Change-Id: Iad653686ac2bda5b3c92c30b4386ee7727d16271 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 69 insertions(+), 97 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index ba5237a..31b2fd4 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -3,42 +3,25 @@ #include #include -struct mcast_server_sock { - struct osmo_fd osmo_fd; -}; - -struct mcast_client_sock { - struct osmo_fd osmo_fd; -}; - struct mcast_bidir_sock { - struct mcast_server_sock *tx_sock; - struct mcast_client_sock *rx_sock; + struct osmo_fd tx_ofd; + struct osmo_fd rx_ofd; }; -struct mcast_bidir_sock *mcast_bidir_sock_setup( - void *ctx, char* tx_mcast_group, int tx_mcast_port, - char* rx_mcast_group, int rx_mcast_port, int loopback, +struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx, + const char *tx_mcast_group, int tx_mcast_port, + const char *rx_mcast_group, int rx_mcast_port, int loopback, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data); -struct mcast_server_sock *mcast_server_sock_setup(void *ctx, - char* tx_mcast_group, - int tx_mcast_port, - int loopback); -struct mcast_client_sock *mcast_client_sock_setup( - void *ctx, char* mcast_group, int mcast_port, - int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), - void *osmo_fd_data); -int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, - int buf_len); -int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, - int data_len); -int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, - int data_len); -int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, - int buf_len); -void mcast_client_sock_close(struct mcast_client_sock* client_sock); -void mcast_server_sock_close(struct mcast_server_sock* server_sock); +int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group, + int tx_mcast_port, int loopback); + +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void *data, int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void *buf, int buf_len); void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 6ef3969..11a1aa9 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -10,149 +10,138 @@ #include #include +/* convenience wrapper */ +static void fd_close(struct osmo_fd *ofd) +{ + /* multicast memberships of socket are implicitly dropped when + * socket is closed */ + osmo_fd_unregister(ofd); + close(ofd->fd); + ofd->fd = -1; + ofd->when = 0; +} + /* server socket is what we use for transmission. It is not subscribed * to a multicast group or locally bound, but it is just a normal UDP * socket that's connected to the remote mcast group + port */ -struct mcast_server_sock * -mcast_server_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, int loopback) +int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, int tx_mcast_port, + int loopback) { - struct mcast_server_sock *serv_sock = talloc_zero(ctx, struct mcast_server_sock); int rc; /* setup mcast server socket */ - rc = osmo_sock_init_ofd(&serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, tx_mcast_group, tx_mcast_port, OSMO_SOCK_F_CONNECT); if (rc < 0) { perror("Failed to create Multicast Server Socket"); - return NULL; + return rc; } /* determines whether sent mcast packets should be looped back to the local sockets. * loopback must be enabled if the mcast client is on the same machine */ - if (setsockopt(serv_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_LOOP, - &loopback, sizeof(loopback)) < 0) { + rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); + if (rc < 0) { perror("Failed to configure multicast loopback.\n"); - return NULL; + return rc; } - return serv_sock; + return 0; } /* the client socket is what we use for reception. It is a UDP socket * that's bound to the GSMTAP UDP port and subscribed to the respective * multicast group */ -struct mcast_client_sock * -mcast_client_sock_setup(void *ctx, char* mcast_group, int mcast_port, - int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), - void *osmo_fd_data) +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) { - struct mcast_client_sock *client_sock = talloc_zero(ctx, struct mcast_client_sock); struct ip_mreq mreq; int rc, loopback = 1, all = 0; - client_sock->osmo_fd.cb = fd_rx_cb; - client_sock->osmo_fd.when = BSC_FD_READ; - client_sock->osmo_fd.data = osmo_fd_data; + ofd->cb = fd_rx_cb; + ofd->when = BSC_FD_READ; + ofd->data = osmo_fd_data; /* Create mcast client socket */ - rc = osmo_sock_init_ofd(&client_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, mcast_port, OSMO_SOCK_F_BIND); if (rc < 0) { perror("Could not create mcast client socket"); - return NULL; + return rc; } /* Enable loopback of msgs to the host. */ /* Loopback must be enabled for the client, so multiple * processes are able to receive a mcast package. */ - rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_LOOP, + rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to enable IP_MULTICAST_LOOP"); - return NULL; + return rc; } /* Configure and join the multicast group */ memset(&mreq, 0, sizeof(mreq)); mreq.imr_multiaddr.s_addr = inet_addr(mcast_group); mreq.imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); + rc = setsockopt(ofd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); if (rc < 0) { perror("Failed to join to mcast goup"); - return NULL; + return rc; } /* this option will set the delivery option so that only packets * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ - if (setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { + if (setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { perror("Failed to modify delivery policy to explicitly joined.\n"); - return NULL; + return rc; } - return client_sock; + return 0; } struct mcast_bidir_sock * -mcast_bidir_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, - char* rx_mcast_group, int rx_mcast_port, int loopback, +mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, int tx_mcast_port, + const char *rx_mcast_group, int rx_mcast_port, int loopback, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { struct mcast_bidir_sock *bidir_sock = talloc(ctx, struct mcast_bidir_sock); - bidir_sock->rx_sock = mcast_client_sock_setup(ctx, rx_mcast_group, - rx_mcast_port, fd_rx_cb, osmo_fd_data); - bidir_sock->tx_sock = mcast_server_sock_setup(ctx, tx_mcast_group, - tx_mcast_port, loopback); - if (!bidir_sock->rx_sock || !bidir_sock->tx_sock) { + int rc; + + if (!bidir_sock) + return NULL; + + rc = mcast_client_sock_setup(&bidir_sock->rx_ofd, rx_mcast_group, rx_mcast_port, + fd_rx_cb, osmo_fd_data); + if (rc < 0) { + talloc_free(bidir_sock); + return NULL; + } + rc = mcast_server_sock_setup(&bidir_sock->tx_ofd, tx_mcast_group, tx_mcast_port, loopback); + if (rc < 0) { + fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); return NULL; } return bidir_sock; } -int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, - int buf_len) -{ - return recv(client_sock->osmo_fd.fd, buf, buf_len, 0); -} - -int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, - int data_len) -{ - return send(serv_sock->osmo_fd.fd, data, data_len, 0); -} - int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, int data_len) { - return mcast_server_sock_tx(bidir_sock->tx_sock, data, data_len); + return send(bidir_sock->tx_ofd.fd, data, data_len, 0); } int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, int buf_len) { - return mcast_client_sock_rx(bidir_sock->rx_sock, buf, buf_len); -} - -void mcast_client_sock_close(struct mcast_client_sock *client_sock) -{ - /* multicast memberships of socket are implicitly dropped when - * socket is closed */ - osmo_fd_unregister(&client_sock->osmo_fd); - close(client_sock->osmo_fd.fd); - client_sock->osmo_fd.fd = -1; - client_sock->osmo_fd.when = 0; - talloc_free(client_sock); - -} -void mcast_server_sock_close(struct mcast_server_sock *serv_sock) -{ - close(serv_sock->osmo_fd.fd); - talloc_free(serv_sock); + return recv(bidir_sock->rx_ofd.fd, buf, buf_len, 0); } void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) { - mcast_client_sock_close(bidir_sock->rx_sock); - mcast_server_sock_close(bidir_sock->tx_sock); + fd_close(&bidir_sock->tx_ofd); + fd_close(&bidir_sock->rx_ofd); talloc_free(bidir_sock); } -- To view, visit https://gerrit.osmocom.org/3235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iad653686ac2bda5b3c92c30b4386ee7727d16271 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:36:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:59 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: mcast_sock: We must close the fd before setting it... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: mcast_sock: We must close the fd before setting it to -1 ...................................................................... VIRT-PHY: mcast_sock: We must close the fd before setting it to -1 Change-Id: Id8e72c8800a8b3021ab350acaebd912f1b387063 --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index b42a5e4..6ef3969 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -138,9 +138,9 @@ /* multicast memberships of socket are implicitly dropped when * socket is closed */ osmo_fd_unregister(&client_sock->osmo_fd); + close(client_sock->osmo_fd.fd); client_sock->osmo_fd.fd = -1; client_sock->osmo_fd.when = 0; - close(client_sock->osmo_fd.fd); talloc_free(client_sock); } -- To view, visit https://gerrit.osmocom.org/3234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id8e72c8800a8b3021ab350acaebd912f1b387063 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:36:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:59 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: mcast_sock: Don't keep subscribed multicast group ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: mcast_sock: Don't keep subscribed multicast group around ...................................................................... VIRT-PHY: mcast_sock: Don't keep subscribed multicast group around We can avoid having to keep around the multicast group in a chunk of dynamically allocated memory and simplify related code. Change-Id: Ic39ffe73dfd2cb8ffefb9614340e275dac87bd50 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 7 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index 3c5954d..ba5237a 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -9,7 +9,6 @@ struct mcast_client_sock { struct osmo_fd osmo_fd; - struct ip_mreq *mcast_group; }; struct mcast_bidir_sock { diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index a06d706..b42a5e4 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -47,10 +47,8 @@ void *osmo_fd_data) { struct mcast_client_sock *client_sock = talloc_zero(ctx, struct mcast_client_sock); + struct ip_mreq mreq; int rc, loopback = 1, all = 0; - - /* TODO: why allocate those dynamically ?!? */ - client_sock->mcast_group = talloc_zero(client_sock, struct ip_mreq); client_sock->osmo_fd.cb = fd_rx_cb; client_sock->osmo_fd.when = BSC_FD_READ; @@ -75,10 +73,10 @@ } /* Configure and join the multicast group */ - client_sock->mcast_group->imr_multiaddr.s_addr = inet_addr(mcast_group); - client_sock->mcast_group->imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, - client_sock->mcast_group, sizeof(*client_sock->mcast_group)); + memset(&mreq, 0, sizeof(mreq)); + mreq.imr_multiaddr.s_addr = inet_addr(mcast_group); + mreq.imr_interface.s_addr = htonl(INADDR_ANY); + rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); if (rc < 0) { perror("Failed to join to mcast goup"); return NULL; @@ -137,13 +135,12 @@ void mcast_client_sock_close(struct mcast_client_sock *client_sock) { - setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, - client_sock->mcast_group, sizeof(*client_sock->mcast_group)); + /* multicast memberships of socket are implicitly dropped when + * socket is closed */ osmo_fd_unregister(&client_sock->osmo_fd); client_sock->osmo_fd.fd = -1; client_sock->osmo_fd.when = 0; close(client_sock->osmo_fd.fd); - talloc_free(client_sock->mcast_group); talloc_free(client_sock); } -- To view, visit https://gerrit.osmocom.org/3233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic39ffe73dfd2cb8ffefb9614340e275dac87bd50 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:36:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:59 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: mcast_sock: Avoid dynamic allocation of osmo_fd me... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: mcast_sock: Avoid dynamic allocation of osmo_fd member ...................................................................... VIRT-PHY: mcast_sock: Avoid dynamic allocation of osmo_fd member Change-Id: I11e0137849797eb67047b4ddca0e917c599ed909 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 19 insertions(+), 24 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index abf2c48..3c5954d 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -4,11 +4,11 @@ #include struct mcast_server_sock { - struct osmo_fd *osmo_fd; + struct osmo_fd osmo_fd; }; struct mcast_client_sock { - struct osmo_fd *osmo_fd; + struct osmo_fd osmo_fd; struct ip_mreq *mcast_group; }; diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index fdbbb88..a06d706 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -19,11 +19,8 @@ struct mcast_server_sock *serv_sock = talloc_zero(ctx, struct mcast_server_sock); int rc; - /* TODO: why allocate those dynamically ?!? */ - serv_sock->osmo_fd = talloc_zero(serv_sock, struct osmo_fd); - /* setup mcast server socket */ - rc = osmo_sock_init_ofd(serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + rc = osmo_sock_init_ofd(&serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, tx_mcast_group, tx_mcast_port, OSMO_SOCK_F_CONNECT); if (rc < 0) { perror("Failed to create Multicast Server Socket"); @@ -32,7 +29,7 @@ /* determines whether sent mcast packets should be looped back to the local sockets. * loopback must be enabled if the mcast client is on the same machine */ - if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, + if (setsockopt(serv_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0) { perror("Failed to configure multicast loopback.\n"); return NULL; @@ -53,15 +50,14 @@ int rc, loopback = 1, all = 0; /* TODO: why allocate those dynamically ?!? */ - client_sock->osmo_fd = talloc_zero(client_sock, struct osmo_fd); client_sock->mcast_group = talloc_zero(client_sock, struct ip_mreq); - client_sock->osmo_fd->cb = fd_rx_cb; - client_sock->osmo_fd->when = BSC_FD_READ; - client_sock->osmo_fd->data = osmo_fd_data; + client_sock->osmo_fd.cb = fd_rx_cb; + client_sock->osmo_fd.when = BSC_FD_READ; + client_sock->osmo_fd.data = osmo_fd_data; /* Create mcast client socket */ - rc = osmo_sock_init_ofd(client_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + rc = osmo_sock_init_ofd(&client_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, mcast_port, OSMO_SOCK_F_BIND); if (rc < 0) { perror("Could not create mcast client socket"); @@ -71,7 +67,7 @@ /* Enable loopback of msgs to the host. */ /* Loopback must be enabled for the client, so multiple * processes are able to receive a mcast package. */ - rc = setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, + rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to enable IP_MULTICAST_LOOP"); @@ -81,7 +77,7 @@ /* Configure and join the multicast group */ client_sock->mcast_group->imr_multiaddr.s_addr = inet_addr(mcast_group); client_sock->mcast_group->imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, + rc = setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, client_sock->mcast_group, sizeof(*client_sock->mcast_group)); if (rc < 0) { perror("Failed to join to mcast goup"); @@ -90,7 +86,7 @@ /* this option will set the delivery option so that only packets * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ - if (setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { + if (setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { perror("Failed to modify delivery policy to explicitly joined.\n"); return NULL; } @@ -119,13 +115,13 @@ int mcast_client_sock_rx(struct mcast_client_sock *client_sock, void* buf, int buf_len) { - return recv(client_sock->osmo_fd->fd, buf, buf_len, 0); + return recv(client_sock->osmo_fd.fd, buf, buf_len, 0); } int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, int data_len) { - return send(serv_sock->osmo_fd->fd, data, data_len, 0); + return send(serv_sock->osmo_fd.fd, data, data_len, 0); } int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, @@ -141,20 +137,19 @@ void mcast_client_sock_close(struct mcast_client_sock *client_sock) { - setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, + setsockopt(client_sock->osmo_fd.fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, client_sock->mcast_group, sizeof(*client_sock->mcast_group)); - osmo_fd_unregister(client_sock->osmo_fd); - client_sock->osmo_fd->fd = -1; - client_sock->osmo_fd->when = 0; - close(client_sock->osmo_fd->fd); + osmo_fd_unregister(&client_sock->osmo_fd); + client_sock->osmo_fd.fd = -1; + client_sock->osmo_fd.when = 0; + close(client_sock->osmo_fd.fd); talloc_free(client_sock->mcast_group); - talloc_free(client_sock->osmo_fd); talloc_free(client_sock); } void mcast_server_sock_close(struct mcast_server_sock *serv_sock) { - close(serv_sock->osmo_fd->fd); + close(serv_sock->osmo_fd.fd); talloc_free(serv_sock); } -- To view, visit https://gerrit.osmocom.org/3232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I11e0137849797eb67047b4ddca0e917c599ed909 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:36:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:36:59 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: osmo_mcast_sock: Get rid of server_sock.sock_conf In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: osmo_mcast_sock: Get rid of server_sock.sock_conf ...................................................................... VIRT-PHY: osmo_mcast_sock: Get rid of server_sock.sock_conf We don't need to store this data, we cans simply connect the socket to the destination mcast address instead. Change-Id: I3c98653c41eff9feb649d9c47cd40b26fd81ed05 --- M src/host/virt_phy/include/virtphy/osmo_mcast_sock.h M src/host/virt_phy/src/shared/osmo_mcast_sock.c 2 files changed, 1 insertion(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h index f318ffe..abf2c48 100644 --- a/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h +++ b/src/host/virt_phy/include/virtphy/osmo_mcast_sock.h @@ -5,7 +5,6 @@ struct mcast_server_sock { struct osmo_fd *osmo_fd; - struct sockaddr_in *sock_conf; }; struct mcast_client_sock { diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index b9bf90c..fdbbb88 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -21,7 +21,6 @@ /* TODO: why allocate those dynamically ?!? */ serv_sock->osmo_fd = talloc_zero(serv_sock, struct osmo_fd); - serv_sock->sock_conf = talloc_zero(serv_sock, struct sockaddr_in); /* setup mcast server socket */ rc = osmo_sock_init_ofd(serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, @@ -30,11 +29,6 @@ perror("Failed to create Multicast Server Socket"); return NULL; } - - /* TODO: Why kleep this stored in sock_conf? */ - serv_sock->sock_conf->sin_family = AF_INET; - serv_sock->sock_conf->sin_addr.s_addr = inet_addr(tx_mcast_group); - serv_sock->sock_conf->sin_port = htons(tx_mcast_port); /* determines whether sent mcast packets should be looped back to the local sockets. * loopback must be enabled if the mcast client is on the same machine */ @@ -131,8 +125,7 @@ int mcast_server_sock_tx(struct mcast_server_sock *serv_sock, void* data, int data_len) { - return sendto(serv_sock->osmo_fd->fd, data, data_len, 0, - (struct sockaddr *)serv_sock->sock_conf, sizeof(*serv_sock->sock_conf)); + return send(serv_sock->osmo_fd->fd, data, data_len, 0); } int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, @@ -162,7 +155,6 @@ void mcast_server_sock_close(struct mcast_server_sock *serv_sock) { close(serv_sock->osmo_fd->fd); - talloc_free(serv_sock->sock_conf); talloc_free(serv_sock); } -- To view, visit https://gerrit.osmocom.org/3231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3c98653c41eff9feb649d9c47cd40b26fd81ed05 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:37:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:37:00 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: osmo_mcast_sock.c coding style cleanup In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: osmo_mcast_sock.c coding style cleanup ...................................................................... VIRT-PHY: osmo_mcast_sock.c coding style cleanup Change-Id: Ie45ea5911167600cb9a1a79dfcd9656be1e91dab --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 20 insertions(+), 24 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 94aa925..b9bf90c 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -13,10 +13,8 @@ /* server socket is what we use for transmission. It is not subscribed * to a multicast group or locally bound, but it is just a normal UDP * socket that's connected to the remote mcast group + port */ -struct mcast_server_sock *mcast_server_sock_setup(void *ctx, - char* tx_mcast_group, - int tx_mcast_port, - int loopback) +struct mcast_server_sock * +mcast_server_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, int loopback) { struct mcast_server_sock *serv_sock = talloc_zero(ctx, struct mcast_server_sock); int rc; @@ -38,11 +36,11 @@ serv_sock->sock_conf->sin_addr.s_addr = inet_addr(tx_mcast_group); serv_sock->sock_conf->sin_port = htons(tx_mcast_port); - // determines whether sent mcast packets should be looped back to the local sockets. - // loopback must be enabled if the mcast client is on the same machine + /* determines whether sent mcast packets should be looped back to the local sockets. + * loopback must be enabled if the mcast client is on the same machine */ if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0) { - perror("Failed to disable loopback.\n"); + perror("Failed to configure multicast loopback.\n"); return NULL; } @@ -52,10 +50,10 @@ /* the client socket is what we use for reception. It is a UDP socket * that's bound to the GSMTAP UDP port and subscribed to the respective * multicast group */ -struct mcast_client_sock *mcast_client_sock_setup( - void *ctx, char* mcast_group, int mcast_port, - int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), - void *osmo_fd_data) +struct mcast_client_sock * +mcast_client_sock_setup(void *ctx, char* mcast_group, int mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) { struct mcast_client_sock *client_sock = talloc_zero(ctx, struct mcast_client_sock); int rc, loopback = 1, all = 0; @@ -106,18 +104,17 @@ return client_sock; } -struct mcast_bidir_sock *mcast_bidir_sock_setup( - void *ctx, char* tx_mcast_group, int tx_mcast_port, - char* rx_mcast_group, int rx_mcast_port, int loopback, - int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), - void *osmo_fd_data) +struct mcast_bidir_sock * +mcast_bidir_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, + char* rx_mcast_group, int rx_mcast_port, int loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) { - struct mcast_bidir_sock *bidir_sock = talloc(ctx, - struct mcast_bidir_sock); + struct mcast_bidir_sock *bidir_sock = talloc(ctx, struct mcast_bidir_sock); bidir_sock->rx_sock = mcast_client_sock_setup(ctx, rx_mcast_group, - rx_mcast_port, fd_rx_cb, osmo_fd_data); + rx_mcast_port, fd_rx_cb, osmo_fd_data); bidir_sock->tx_sock = mcast_server_sock_setup(ctx, tx_mcast_group, - tx_mcast_port, loopback); + tx_mcast_port, loopback); if (!bidir_sock->rx_sock || !bidir_sock->tx_sock) { return NULL; } @@ -135,8 +132,7 @@ int data_len) { return sendto(serv_sock->osmo_fd->fd, data, data_len, 0, - (struct sockaddr *)serv_sock->sock_conf, - sizeof(*serv_sock->sock_conf)); + (struct sockaddr *)serv_sock->sock_conf, sizeof(*serv_sock->sock_conf)); } int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, void* data, @@ -144,8 +140,8 @@ { return mcast_server_sock_tx(bidir_sock->tx_sock, data, data_len); } -int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, - int buf_len) + +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, void* buf, int buf_len) { return mcast_client_sock_rx(bidir_sock->rx_sock, buf, buf_len); } -- To view, visit https://gerrit.osmocom.org/3230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie45ea5911167600cb9a1a79dfcd9656be1e91dab Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 12:37:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 12:37:00 +0000 Subject: [MERGED] osmocom-bb[master]: Port osmo_mcast_sock to libosmocore socket routines In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Port osmo_mcast_sock to libosmocore socket routines ...................................................................... Port osmo_mcast_sock to libosmocore socket routines Change-Id: Ia44c086fb8e428edf49bafd1662c31b2dc2bfc43 --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 44 insertions(+), 65 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index ff81063..94aa925 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -10,32 +10,38 @@ #include #include +/* server socket is what we use for transmission. It is not subscribed + * to a multicast group or locally bound, but it is just a normal UDP + * socket that's connected to the remote mcast group + port */ struct mcast_server_sock *mcast_server_sock_setup(void *ctx, char* tx_mcast_group, int tx_mcast_port, int loopback) { - struct mcast_server_sock *serv_sock = talloc_zero(ctx, - struct mcast_server_sock); + struct mcast_server_sock *serv_sock = talloc_zero(ctx, struct mcast_server_sock); + int rc; - serv_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); - serv_sock->sock_conf = talloc_zero(ctx, struct sockaddr_in); + /* TODO: why allocate those dynamically ?!? */ + serv_sock->osmo_fd = talloc_zero(serv_sock, struct osmo_fd); + serv_sock->sock_conf = talloc_zero(serv_sock, struct sockaddr_in); - // setup mcast server socket - serv_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (serv_sock->osmo_fd->fd == -1) { + /* setup mcast server socket */ + rc = osmo_sock_init_ofd(serv_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + tx_mcast_group, tx_mcast_port, OSMO_SOCK_F_CONNECT); + if (rc < 0) { perror("Failed to create Multicast Server Socket"); return NULL; } + /* TODO: Why kleep this stored in sock_conf? */ serv_sock->sock_conf->sin_family = AF_INET; serv_sock->sock_conf->sin_addr.s_addr = inet_addr(tx_mcast_group); serv_sock->sock_conf->sin_port = htons(tx_mcast_port); // determines whether sent mcast packets should be looped back to the local sockets. // loopback must be enabled if the mcast client is on the same machine - if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, - IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0) { + if (setsockopt(serv_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, + &loopback, sizeof(loopback)) < 0) { perror("Failed to disable loopback.\n"); return NULL; } @@ -43,84 +49,59 @@ return serv_sock; } +/* the client socket is what we use for reception. It is a UDP socket + * that's bound to the GSMTAP UDP port and subscribed to the respective + * multicast group */ struct mcast_client_sock *mcast_client_sock_setup( void *ctx, char* mcast_group, int mcast_port, int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { - struct mcast_client_sock *client_sock = talloc_zero(ctx, - struct mcast_client_sock); - struct sockaddr_in *rx_sock_conf = talloc_zero(NULL, - struct sockaddr_in); - int rc, reuseaddr = 1, loopback = 1, all = 0; + struct mcast_client_sock *client_sock = talloc_zero(ctx, struct mcast_client_sock); + int rc, loopback = 1, all = 0; - client_sock->osmo_fd = talloc_zero(ctx, struct osmo_fd); - client_sock->mcast_group = talloc_zero(ctx, struct ip_mreq); + /* TODO: why allocate those dynamically ?!? */ + client_sock->osmo_fd = talloc_zero(client_sock, struct osmo_fd); + client_sock->mcast_group = talloc_zero(client_sock, struct ip_mreq); - // Create mcast client socket - client_sock->osmo_fd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (client_sock->osmo_fd->fd == -1) { + client_sock->osmo_fd->cb = fd_rx_cb; + client_sock->osmo_fd->when = BSC_FD_READ; + client_sock->osmo_fd->data = osmo_fd_data; + + /* Create mcast client socket */ + rc = osmo_sock_init_ofd(client_sock->osmo_fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + NULL, mcast_port, OSMO_SOCK_F_BIND); + if (rc < 0) { perror("Could not create mcast client socket"); return NULL; } - // Enable SO_REUSEADDR to allow multiple instances of this application to receive copies of the multicast datagrams. - rc = setsockopt(client_sock->osmo_fd->fd, - SOL_SOCKET, - SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr)); - if (rc < 0) { - perror("Failed to configure REUSEADDR option"); - return NULL; - } - - // Bind to the proper port number with the IP address specified as INADDR_ANY. - rx_sock_conf->sin_family = AF_INET; - rx_sock_conf->sin_addr.s_addr = htonl(INADDR_ANY); - rx_sock_conf->sin_port = htons(mcast_port); - rc = bind(client_sock->osmo_fd->fd, (struct sockaddr *)rx_sock_conf, - sizeof(*rx_sock_conf)); - talloc_free(rx_sock_conf); - if (rc < 0) { - perror("Could not bind mcast client socket"); - return NULL; - } - - // Enable loopback of msgs to the host. - // Loopback must be enabled for the client, so multiple processes are able to recevie a mcast package. - rc = setsockopt(client_sock->osmo_fd->fd, - IPPROTO_IP, - IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); + /* Enable loopback of msgs to the host. */ + /* Loopback must be enabled for the client, so multiple + * processes are able to receive a mcast package. */ + rc = setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, + &loopback, sizeof(loopback)); if (rc < 0) { perror("Failed to enable IP_MULTICAST_LOOP"); return NULL; } - // Configure and join the multicast group + /* Configure and join the multicast group */ client_sock->mcast_group->imr_multiaddr.s_addr = inet_addr(mcast_group); client_sock->mcast_group->imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(client_sock->osmo_fd->fd, - IPPROTO_IP, - IP_ADD_MEMBERSHIP, client_sock->mcast_group, - sizeof(*client_sock->mcast_group)); + rc = setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, + client_sock->mcast_group, sizeof(*client_sock->mcast_group)); if (rc < 0) { perror("Failed to join to mcast goup"); return NULL; } - // this option will set the delivery option so that only packages are received - // from sockets we are bound to via IP_ADD_MEMBERSHIP - if (setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, - IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { + /* this option will set the delivery option so that only packets + * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ + if (setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { perror("Failed to modify delivery policy to explicitly joined.\n"); return NULL; } - - // configure and register the osmocom filedescriptor - client_sock->osmo_fd->cb = fd_rx_cb; - client_sock->osmo_fd->when = BSC_FD_READ; - client_sock->osmo_fd->data = osmo_fd_data; - - osmo_fd_register(client_sock->osmo_fd); return client_sock; } @@ -171,10 +152,8 @@ void mcast_client_sock_close(struct mcast_client_sock *client_sock) { - setsockopt(client_sock->osmo_fd->fd, - IPPROTO_IP, - IP_DROP_MEMBERSHIP, client_sock->mcast_group, - sizeof(*client_sock->mcast_group)); + setsockopt(client_sock->osmo_fd->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, + client_sock->mcast_group, sizeof(*client_sock->mcast_group)); osmo_fd_unregister(client_sock->osmo_fd); client_sock->osmo_fd->fd = -1; client_sock->osmo_fd->when = 0; -- To view, visit https://gerrit.osmocom.org/3229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia44c086fb8e428edf49bafd1662c31b2dc2bfc43 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 13:59:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 13 Jul 2017 13:59:58 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#9). Add release target to Makefile Add simple helper target to automate basic release steps: * version bump * prepare release commit * git commit, tag and sign For library projects: * update debian/changelog from TODO-RELEASE * cleanup TODO-RELEASE For non-library projects: * update debian/changelog from git log Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control A osmo-release.mk 4 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/9 diff --git a/Makefile.am b/Makefile.am index b8de3ca..26df270 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,13 +7,18 @@ pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \ libosmogb.pc libosmoctrl.pc libosmocoding.pc +relengdir = $(includedir) +releng_DATA = osmo-release.mk + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md +EXTRA_DIST = git-version-gen .version README.md osmo-release.mk + + at RELMAKE@ if HAVE_DOXYGEN diff --git a/configure.ac b/configure.ac index 92544b6..641f852 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..4407c86 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,28 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +ISODATE := $(shell date -I) +endif + +release: +ifeq ($(NEW_VERSION),) + @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) +endif + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." +ifeq ($(LIBVERS),) + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge +else + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)." + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:19:44 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 13 Jul 2017 14:19:44 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#10). Add release target to Makefile Add simple helper target to automate basic release steps: * version bump * prepare release commit * git commit, tag and sign For library projects: * update debian/changelog from TODO-RELEASE * cleanup TODO-RELEASE For non-library projects: * update debian/changelog from git log Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M debian/control A osmo-release.mk 3 files changed, 35 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/10 diff --git a/Makefile.am b/Makefile.am index b8de3ca..19002b7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,13 +7,18 @@ pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \ libosmogb.pc libosmoctrl.pc libosmocoding.pc +-include osmo-release.mk + +relengdir = $(includedir) +releng_DATA = osmo-release.mk + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md +EXTRA_DIST = git-version-gen .version README.md osmo-release.mk if HAVE_DOXYGEN diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..4407c86 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,28 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +ISODATE := $(shell date -I) +endif + +release: +ifeq ($(NEW_VERSION),) + @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) +endif + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." +ifeq ($(LIBVERS),) + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge +else + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)." + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:34:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:34:12 +0000 Subject: [PATCH] libosmocore[master]: select: Add new osmo_fd_close() function In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3228 to look at the new patch set (#2). select: Add new osmo_fd_close() function This is a convenience helper that will both close a fd, mark it as closed and unregister it from the event loop abstraction. In most cases, you probably actually want to use it instead of manually closing and calling osmo_fd_unregister(). Change-Id: Icd0933eed6a24edde7cdcb378e138897ecc5332c --- M include/osmocom/core/select.h M src/select.c 2 files changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/3228/2 diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index 9b5f372..2abda2d 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -39,6 +39,7 @@ bool osmo_fd_is_registered(struct osmo_fd *fd); int osmo_fd_register(struct osmo_fd *fd); void osmo_fd_unregister(struct osmo_fd *fd); +void osmo_fd_close(struct osmo_fd *fd); int osmo_select_main(int polling); struct osmo_fd *osmo_fd_get_by_fd(int fd); diff --git a/src/select.c b/src/select.c index f7ee424..0ba8bc6 100644 --- a/src/select.c +++ b/src/select.c @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -117,6 +118,22 @@ llist_del(&fd->list); } +/*! Close a file descriptor, mark it as closed + unregister from select loop abstraction + * \param[in] fd osmocom file descriptor to be unregistered + closed + * + * If \a fd is registered, we unregister it from the select() loop + * abstraction. We then close the fd and set it to -1, as well as + * unsetting any 'when' flags */ +void osmo_fd_close(struct osmo_fd *fd) +{ + if (osmo_fd_is_registered(fd)) + osmo_fd_unregister(fd); + if (fd->fd != -1) + close(fd->fd); + fd->fd = -1; + fd->when = 0; +} + /*! Populate the fd_sets and return the highest fd number * \param[in] _rset The readfds to populate * \param[in] _wset The wrtiefds to populate -- To view, visit https://gerrit.osmocom.org/3228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icd0933eed6a24edde7cdcb378e138897ecc5332c 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 Jul 13 14:34:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:34:13 +0000 Subject: [PATCH] libosmocore[master]: socket.c: Add multicast related convenience functions Message-ID: Review at https://gerrit.osmocom.org/3238 socket.c: Add multicast related convenience functions Change-Id: Id703e7a7a1e065181a4c76c088b8dcc1b7fe15a2 --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 117 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/3238/1 diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index d2118ef..6db436a 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -8,6 +8,7 @@ * \file socket.h */ #include +#include struct sockaddr; struct osmo_fd; @@ -47,4 +48,9 @@ char *osmo_sock_get_name(void *ctx, int fd); +int osmo_sock_mcast_loop_set(int fd, bool enable); +int osmo_sock_mcast_ttl_set(int fd, uint8_t ttl); +int osmo_sock_mcast_all_set(int fd, bool enable); +int osmo_sock_mcast_subscribe(int fd, const char *grp_addr); + /*! @} */ diff --git a/src/socket.c b/src/socket.c index 28d9b1c..688fcb3 100644 --- a/src/socket.c +++ b/src/socket.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -614,6 +615,116 @@ return talloc_asprintf(ctx, "(r=NULL<->l=%s:%s)", hostbuf_l, portbuf_l); } +/*! Activate or de-activate local loop-back of transmitted multicast packets + * \param[in] fd file descriptor of related socket + * \param[in] enable Enable (true) or disable (false) loop-back + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_loop_set(int fd, bool enable) +{ + int rc, domain, loop = 0; + socklen_t dom_len = sizeof(domain); + + if (enable) + loop = 1; + + rc = getsockopt(fd, SOL_SOCKET, SO_DOMAIN, &domain, &dom_len); + if (rc < 0) + return rc; + + switch (domain) { + case AF_INET: + return setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)); + case AF_INET6: + return setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &loop, sizeof(loop)); + default: + return -EINVAL; + } +} + +/*! Set the TTL of outbound multicast packets + * \param[in] fd file descriptor of related socket + * \param[in] ttl TTL of to-be-sent multicast packets + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_ttl_set(int fd, uint8_t ttl) +{ + int rc, domain, ttli = ttl; + socklen_t dom_len = sizeof(domain); + + rc = getsockopt(fd, SOL_SOCKET, SO_DOMAIN, &domain, &dom_len); + if (rc < 0) + return rc; + + switch (domain) { + case AF_INET: + return setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttli, sizeof(ttli)); + case AF_INET6: + return setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttli, sizeof(ttli)); + default: + return -EINVAL; + } +} + +/*! Enable/disable receiving all multicast packets, even for non-subscribed groups + * \param[in] fd file descriptor of related socket + * \param[in] enable Enable or Disable receiving of all packets + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_all_set(int fd, bool enable) +{ + int rc, domain, all = 0; + socklen_t dom_len = sizeof(domain); + + if (enable) + all = 1; + + rc = getsockopt(fd, SOL_SOCKET, SO_DOMAIN, &domain, &dom_len); + if (rc < 0) + return rc; + + switch (domain) { + case AF_INET: + return setsockopt(fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)); + case AF_INET6: + /* there seems no equivalent ?!? */ + default: + return -EINVAL; + } +} + + +/*! Subscribe to the given IP multicast group + * \param[in] fd file descriptor of related scoket + * \param[in] grp_addr ASCII representation of the multicast group address + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_subscribe(int fd, const char *grp_addr) +{ + int rc, domain; + socklen_t dom_len = sizeof(domain); + struct ip_mreq mreq; + struct ipv6_mreq mreq6; + struct in6_addr i6a; + + rc = getsockopt(fd, SOL_SOCKET, SO_DOMAIN, &domain, &dom_len); + if (rc < 0) + return rc; + + switch (domain) { + case AF_INET: + memset(&mreq, 0, sizeof(mreq)); + mreq.imr_multiaddr.s_addr = inet_addr(grp_addr); + mreq.imr_interface.s_addr = htonl(INADDR_ANY); + return setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); + case AF_INET6: + memset(&mreq6, 0, sizeof(mreq6)); + rc = inet_pton(AF_INET6, grp_addr, (void *)&i6a); + if (rc < 0) + return -EINVAL; + mreq6.ipv6mr_multiaddr = i6a; + return setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq6, sizeof(mreq6)); + default: + return -EINVAL; + } +} + #endif /* HAVE_SYS_SOCKET_H */ /*! @} */ -- To view, visit https://gerrit.osmocom.org/3238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id703e7a7a1e065181a4c76c088b8dcc1b7fe15a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:34:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:34:14 +0000 Subject: [PATCH] libosmocore[master]: socket: Unify listen() calls and check for erroneous returns Message-ID: Review at https://gerrit.osmocom.org/3239 socket: Unify listen() calls and check for erroneous returns We had three places at the end of socket initialization functions calling listen(). Let's unify that and fix some bugs: * close + return error in case of bad listen() result * don't call listen() on AF_UNIX SOCK_DGRAM sockets Change-Id: I7e8dbe3c0486bb3b9810b0add1331e93fc106d82 --- M src/socket.c 1 file changed, 33 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/39/3239/1 diff --git a/src/socket.c b/src/socket.c index 688fcb3..372051f 100644 --- a/src/socket.c +++ b/src/socket.c @@ -104,6 +104,25 @@ } +static int osmo_sock_init_tail(int fd, uint16_t type, unsigned int flags) +{ + int rc = 0; + + /* Make sure to call 'listen' on a bound, connection-oriented sock */ + if ((flags & (OSMO_SOCK_F_BIND|OSMO_SOCK_F_CONNECT)) == OSMO_SOCK_F_BIND) { + switch (type) { + case SOCK_STREAM: + case SOCK_SEQPACKET: + rc = listen(fd, 10); + } + } + + if (rc < 0) + LOGP(DLGLOBAL, LOGL_ERROR, "unable to listen on socket: %s\n", strerror(errno)); + + return rc; +} + /*! Initialize a socket (including bind and/or connect) * \param[in] family Address Family like AF_INET, AF_INET6, AF_UNSPEC * \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM @@ -219,15 +238,12 @@ } } - /* Make sure to call 'listen' on a bound, connection-oriented sock */ - if ((flags & (OSMO_SOCK_F_BIND|OSMO_SOCK_F_CONNECT)) == OSMO_SOCK_F_BIND) { - switch (type) { - case SOCK_STREAM: - case SOCK_SEQPACKET: - listen(sfd, 10); - break; - } + rc = osmo_sock_init_tail(sfd, type, flags); + if (rc < 0) { + close(sfd); + sfd = -1; } + return sfd; } @@ -305,15 +321,12 @@ setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - /* Make sure to call 'listen' on a bound, connection-oriented sock */ - if (flags & OSMO_SOCK_F_BIND) { - switch (type) { - case SOCK_STREAM: - case SOCK_SEQPACKET: - listen(sfd, 10); - break; - } + rc = osmo_sock_init_tail(sfd, type, flags); + if (rc < 0) { + close(sfd); + sfd = -1; } + return sfd; } @@ -545,10 +558,10 @@ } } - if (flags & OSMO_SOCK_F_BIND) { - rc = listen(sfd, 10); - if (rc < 0) - goto err; + rc = osmo_sock_init_tail(sfd, type, flags); + if (rc < 0) { + close(sfd); + sfd = -1; } return sfd; -- To view, visit https://gerrit.osmocom.org/3239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e8dbe3c0486bb3b9810b0add1331e93fc106d82 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:34:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:34:14 +0000 Subject: [PATCH] libosmocore[master]: socket: Allow disabling multicast loop on socket creation Message-ID: Review at https://gerrit.osmocom.org/3240 socket: Allow disabling multicast loop on socket creation This introduces a new flag OSMO_SOCK_F_NO_MCAST_LOOP, which can be used to disable the looping back of multicast packets transmitted throug this socket to other local sockets on the machine. As this looping-back is active by default, a single option to deviate from the default is deemed sufficient. Change-Id: I24a5b1ebc3f84d2d5d4734e54df50efaea26490b --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 18 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/3240/1 diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index 6db436a..695e1d7 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -20,6 +20,8 @@ #define OSMO_SOCK_F_BIND (1 << 1) /*! switch socket to non-blocking mode */ #define OSMO_SOCK_F_NONBLOCK (1 << 2) +/*! disable multiast loop (IP_MULTICAST_LOOP) */ +#define OSMO_SOCK_F_NO_MCAST_LOOP (1 << 3) int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, const char *host, uint16_t port, unsigned int flags); diff --git a/src/socket.c b/src/socket.c index 372051f..0b8c22d 100644 --- a/src/socket.c +++ b/src/socket.c @@ -106,7 +106,7 @@ static int osmo_sock_init_tail(int fd, uint16_t type, unsigned int flags) { - int rc = 0; + int rc; /* Make sure to call 'listen' on a bound, connection-oriented sock */ if ((flags & (OSMO_SOCK_F_BIND|OSMO_SOCK_F_CONNECT)) == OSMO_SOCK_F_BIND) { @@ -114,13 +114,25 @@ case SOCK_STREAM: case SOCK_SEQPACKET: rc = listen(fd, 10); + if (rc < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "unable to listen on socket: %s\n", + strerror(errno)); + return rc; + } + break; } } - if (rc < 0) - LOGP(DLGLOBAL, LOGL_ERROR, "unable to listen on socket: %s\n", strerror(errno)); + if (flags & OSMO_SOCK_F_NO_MCAST_LOOP) { + rc = osmo_sock_mcast_loop_set(fd, false); + if (rc < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "unable to disable multicast loop: %s\n", + strerror(errno)); + return rc; + } + } - return rc; + return 0; } /*! Initialize a socket (including bind and/or connect) -- To view, visit https://gerrit.osmocom.org/3240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24a5b1ebc3f84d2d5d4734e54df50efaea26490b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:34:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:34:14 +0000 Subject: [PATCH] libosmocore[master]: socket: Add new OSMO_SOCK_F_NO_MCAST_ALL option Message-ID: Review at https://gerrit.osmocom.org/3241 socket: Add new OSMO_SOCK_F_NO_MCAST_ALL option Using this option at socket creation, the caller can request disabling the IP_MULTICAST_ALL socket option. Change-Id: I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/41/3241/1 diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index 695e1d7..ebfcab3 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -22,6 +22,8 @@ #define OSMO_SOCK_F_NONBLOCK (1 << 2) /*! disable multiast loop (IP_MULTICAST_LOOP) */ #define OSMO_SOCK_F_NO_MCAST_LOOP (1 << 3) +/*! disable receiving all multiast even for non-subscribed groups */ +#define OSMO_SOCK_F_NO_MCAST_ALL (1 << 4) int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, const char *host, uint16_t port, unsigned int flags); diff --git a/src/socket.c b/src/socket.c index 0b8c22d..871873b 100644 --- a/src/socket.c +++ b/src/socket.c @@ -132,6 +132,14 @@ } } + if (flags & OSMO_SOCK_F_NO_MCAST_ALL) { + rc = osmo_sock_mcast_all_set(fd, false); + if (rc < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "unable to disable receive of all multicast: %s\n", + strerror(errno)); + return rc; + } + } return 0; } -- To view, visit https://gerrit.osmocom.org/3241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:54:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:54:40 +0000 Subject: [PATCH] libosmocore[master]: socket.c: Add multicast related convenience functions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3238 to look at the new patch set (#2). socket.c: Add multicast related convenience functions Change-Id: Id703e7a7a1e065181a4c76c088b8dcc1b7fe15a2 --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 141 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/3238/2 diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index d2118ef..6db436a 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -8,6 +8,7 @@ * \file socket.h */ #include +#include struct sockaddr; struct osmo_fd; @@ -47,4 +48,9 @@ char *osmo_sock_get_name(void *ctx, int fd); +int osmo_sock_mcast_loop_set(int fd, bool enable); +int osmo_sock_mcast_ttl_set(int fd, uint8_t ttl); +int osmo_sock_mcast_all_set(int fd, bool enable); +int osmo_sock_mcast_subscribe(int fd, const char *grp_addr); + /*! @} */ diff --git a/src/socket.c b/src/socket.c index 28d9b1c..d18f756 100644 --- a/src/socket.c +++ b/src/socket.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -614,6 +615,140 @@ return talloc_asprintf(ctx, "(r=NULL<->l=%s:%s)", hostbuf_l, portbuf_l); } +static int sock_get_domain(int fd) +{ + int domain; +#ifdef SO_DOMAIN + socklen_t dom_len = sizeof(domain); + int rc; + + rc = getsockopt(fd, SOL_SOCKET, SO_DOMAIN, &domain, &dom_len); + if (rc < 0) + return rc; +#else + /* This of course sucks, but what shall we do on OSs like + * FreeBSD that don't seem to expose a method by which one can + * learn the address family of a socket? */ + domain = AF_INET; +#endif + return domain; +} + + +/*! Activate or de-activate local loop-back of transmitted multicast packets + * \param[in] fd file descriptor of related socket + * \param[in] enable Enable (true) or disable (false) loop-back + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_loop_set(int fd, bool enable) +{ + int domain, loop = 0; + + if (enable) + loop = 1; + + domain = sock_get_domain(fd); + if (domain < 0) + return domain; + + switch (domain) { + case AF_INET: + return setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)); + case AF_INET6: + return setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &loop, sizeof(loop)); + default: + return -EINVAL; + } +} + +/*! Set the TTL of outbound multicast packets + * \param[in] fd file descriptor of related socket + * \param[in] ttl TTL of to-be-sent multicast packets + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_ttl_set(int fd, uint8_t ttl) +{ + int domain, ttli = ttl; + + domain = sock_get_domain(fd); + if (domain < 0) + return domain; + + switch (domain) { + case AF_INET: + return setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttli, sizeof(ttli)); + case AF_INET6: + return setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttli, sizeof(ttli)); + default: + return -EINVAL; + } +} + +/*! Enable/disable receiving all multicast packets, even for non-subscribed groups + * \param[in] fd file descriptor of related socket + * \param[in] enable Enable or Disable receiving of all packets + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_all_set(int fd, bool enable) +{ + int domain, all = 0; + + if (enable) + all = 1; + + domain = sock_get_domain(fd); + if (domain < 0) + return domain; + + switch (domain) { + case AF_INET: +#ifdef IP_MULTICAST_ALL + return setsockopt(fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)); +#endif + case AF_INET6: + /* there seems no equivalent ?!? */ + default: + return -EINVAL; + } +} + +/* FreeBSD calls the socket option differently */ +#if !defined(IPV6_ADD_MEMBERSHIP) && defined(IPV6_JOIN_GROUP) +#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP +#endif + +/*! Subscribe to the given IP multicast group + * \param[in] fd file descriptor of related scoket + * \param[in] grp_addr ASCII representation of the multicast group address + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_subscribe(int fd, const char *grp_addr) +{ + int rc, domain; + struct ip_mreq mreq; + struct ipv6_mreq mreq6; + struct in6_addr i6a; + + domain = sock_get_domain(fd); + if (domain < 0) + return domain; + + switch (domain) { + case AF_INET: + memset(&mreq, 0, sizeof(mreq)); + mreq.imr_multiaddr.s_addr = inet_addr(grp_addr); + mreq.imr_interface.s_addr = htonl(INADDR_ANY); + return setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); +#ifdef IPV6_ADD_MEMBERSHIP + case AF_INET6: + memset(&mreq6, 0, sizeof(mreq6)); + rc = inet_pton(AF_INET6, grp_addr, (void *)&i6a); + if (rc < 0) + return -EINVAL; + mreq6.ipv6mr_multiaddr = i6a; + return setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq6, sizeof(mreq6)); +#endif + default: + return -EINVAL; + } +} + #endif /* HAVE_SYS_SOCKET_H */ /*! @} */ -- To view, visit https://gerrit.osmocom.org/3238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id703e7a7a1e065181a4c76c088b8dcc1b7fe15a2 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 Jul 13 14:54:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:54:40 +0000 Subject: [PATCH] libosmocore[master]: socket: Add new OSMO_SOCK_F_NO_MCAST_ALL option In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3241 to look at the new patch set (#2). socket: Add new OSMO_SOCK_F_NO_MCAST_ALL option Using this option at socket creation, the caller can request disabling the IP_MULTICAST_ALL socket option. Change-Id: I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/41/3241/2 diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index 695e1d7..ebfcab3 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -22,6 +22,8 @@ #define OSMO_SOCK_F_NONBLOCK (1 << 2) /*! disable multiast loop (IP_MULTICAST_LOOP) */ #define OSMO_SOCK_F_NO_MCAST_LOOP (1 << 3) +/*! disable receiving all multiast even for non-subscribed groups */ +#define OSMO_SOCK_F_NO_MCAST_ALL (1 << 4) int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, const char *host, uint16_t port, unsigned int flags); diff --git a/src/socket.c b/src/socket.c index c7d081c..ca50b6f 100644 --- a/src/socket.c +++ b/src/socket.c @@ -132,6 +132,16 @@ } } + if (flags & OSMO_SOCK_F_NO_MCAST_ALL) { + rc = osmo_sock_mcast_all_set(fd, false); + if (rc < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "unable to disable receive of all multicast: %s\n", + strerror(errno)); + /* do not abort here, as this is just an + * optional additional optimization that only + * exists on Linux only */ + } + } return 0; } -- To view, visit https://gerrit.osmocom.org/3241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 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 Jul 13 14:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:54:46 +0000 Subject: libosmocore[master]: select: Add new osmo_fd_close() function In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icd0933eed6a24edde7cdcb378e138897ecc5332c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:54:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:54:47 +0000 Subject: [MERGED] libosmocore[master]: select: Add new osmo_fd_close() function In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: select: Add new osmo_fd_close() function ...................................................................... select: Add new osmo_fd_close() function This is a convenience helper that will both close a fd, mark it as closed and unregister it from the event loop abstraction. In most cases, you probably actually want to use it instead of manually closing and calling osmo_fd_unregister(). Change-Id: Icd0933eed6a24edde7cdcb378e138897ecc5332c --- M include/osmocom/core/select.h M src/select.c 2 files changed, 18 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index 9b5f372..2abda2d 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -39,6 +39,7 @@ bool osmo_fd_is_registered(struct osmo_fd *fd); int osmo_fd_register(struct osmo_fd *fd); void osmo_fd_unregister(struct osmo_fd *fd); +void osmo_fd_close(struct osmo_fd *fd); int osmo_select_main(int polling); struct osmo_fd *osmo_fd_get_by_fd(int fd); diff --git a/src/select.c b/src/select.c index f7ee424..0ba8bc6 100644 --- a/src/select.c +++ b/src/select.c @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -117,6 +118,22 @@ llist_del(&fd->list); } +/*! Close a file descriptor, mark it as closed + unregister from select loop abstraction + * \param[in] fd osmocom file descriptor to be unregistered + closed + * + * If \a fd is registered, we unregister it from the select() loop + * abstraction. We then close the fd and set it to -1, as well as + * unsetting any 'when' flags */ +void osmo_fd_close(struct osmo_fd *fd) +{ + if (osmo_fd_is_registered(fd)) + osmo_fd_unregister(fd); + if (fd->fd != -1) + close(fd->fd); + fd->fd = -1; + fd->when = 0; +} + /*! Populate the fd_sets and return the highest fd number * \param[in] _rset The readfds to populate * \param[in] _wset The wrtiefds to populate -- To view, visit https://gerrit.osmocom.org/3228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icd0933eed6a24edde7cdcb378e138897ecc5332c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:57:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:57:10 +0000 Subject: libosmocore[master]: socket.c: Add multicast related convenience functions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id703e7a7a1e065181a4c76c088b8dcc1b7fe15a2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:57:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:57:29 +0000 Subject: libosmocore[master]: socket: Unify listen() calls and check for erroneous returns In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e8dbe3c0486bb3b9810b0add1331e93fc106d82 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:57:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:57:44 +0000 Subject: libosmocore[master]: socket: Allow disabling multicast loop on socket creation In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24a5b1ebc3f84d2d5d4734e54df50efaea26490b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:57:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:57:49 +0000 Subject: libosmocore[master]: socket: Add new OSMO_SOCK_F_NO_MCAST_ALL option In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 14:58:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 14:58:00 +0000 Subject: [MERGED] libosmocore[master]: socket.c: Add multicast related convenience functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: socket.c: Add multicast related convenience functions ...................................................................... socket.c: Add multicast related convenience functions Change-Id: Id703e7a7a1e065181a4c76c088b8dcc1b7fe15a2 --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 141 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index d2118ef..6db436a 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -8,6 +8,7 @@ * \file socket.h */ #include +#include struct sockaddr; struct osmo_fd; @@ -47,4 +48,9 @@ char *osmo_sock_get_name(void *ctx, int fd); +int osmo_sock_mcast_loop_set(int fd, bool enable); +int osmo_sock_mcast_ttl_set(int fd, uint8_t ttl); +int osmo_sock_mcast_all_set(int fd, bool enable); +int osmo_sock_mcast_subscribe(int fd, const char *grp_addr); + /*! @} */ diff --git a/src/socket.c b/src/socket.c index 28d9b1c..d18f756 100644 --- a/src/socket.c +++ b/src/socket.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -614,6 +615,140 @@ return talloc_asprintf(ctx, "(r=NULL<->l=%s:%s)", hostbuf_l, portbuf_l); } +static int sock_get_domain(int fd) +{ + int domain; +#ifdef SO_DOMAIN + socklen_t dom_len = sizeof(domain); + int rc; + + rc = getsockopt(fd, SOL_SOCKET, SO_DOMAIN, &domain, &dom_len); + if (rc < 0) + return rc; +#else + /* This of course sucks, but what shall we do on OSs like + * FreeBSD that don't seem to expose a method by which one can + * learn the address family of a socket? */ + domain = AF_INET; +#endif + return domain; +} + + +/*! Activate or de-activate local loop-back of transmitted multicast packets + * \param[in] fd file descriptor of related socket + * \param[in] enable Enable (true) or disable (false) loop-back + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_loop_set(int fd, bool enable) +{ + int domain, loop = 0; + + if (enable) + loop = 1; + + domain = sock_get_domain(fd); + if (domain < 0) + return domain; + + switch (domain) { + case AF_INET: + return setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)); + case AF_INET6: + return setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &loop, sizeof(loop)); + default: + return -EINVAL; + } +} + +/*! Set the TTL of outbound multicast packets + * \param[in] fd file descriptor of related socket + * \param[in] ttl TTL of to-be-sent multicast packets + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_ttl_set(int fd, uint8_t ttl) +{ + int domain, ttli = ttl; + + domain = sock_get_domain(fd); + if (domain < 0) + return domain; + + switch (domain) { + case AF_INET: + return setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttli, sizeof(ttli)); + case AF_INET6: + return setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttli, sizeof(ttli)); + default: + return -EINVAL; + } +} + +/*! Enable/disable receiving all multicast packets, even for non-subscribed groups + * \param[in] fd file descriptor of related socket + * \param[in] enable Enable or Disable receiving of all packets + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_all_set(int fd, bool enable) +{ + int domain, all = 0; + + if (enable) + all = 1; + + domain = sock_get_domain(fd); + if (domain < 0) + return domain; + + switch (domain) { + case AF_INET: +#ifdef IP_MULTICAST_ALL + return setsockopt(fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)); +#endif + case AF_INET6: + /* there seems no equivalent ?!? */ + default: + return -EINVAL; + } +} + +/* FreeBSD calls the socket option differently */ +#if !defined(IPV6_ADD_MEMBERSHIP) && defined(IPV6_JOIN_GROUP) +#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP +#endif + +/*! Subscribe to the given IP multicast group + * \param[in] fd file descriptor of related scoket + * \param[in] grp_addr ASCII representation of the multicast group address + * \returns 0 on success; negative otherwise */ +int osmo_sock_mcast_subscribe(int fd, const char *grp_addr) +{ + int rc, domain; + struct ip_mreq mreq; + struct ipv6_mreq mreq6; + struct in6_addr i6a; + + domain = sock_get_domain(fd); + if (domain < 0) + return domain; + + switch (domain) { + case AF_INET: + memset(&mreq, 0, sizeof(mreq)); + mreq.imr_multiaddr.s_addr = inet_addr(grp_addr); + mreq.imr_interface.s_addr = htonl(INADDR_ANY); + return setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); +#ifdef IPV6_ADD_MEMBERSHIP + case AF_INET6: + memset(&mreq6, 0, sizeof(mreq6)); + rc = inet_pton(AF_INET6, grp_addr, (void *)&i6a); + if (rc < 0) + return -EINVAL; + mreq6.ipv6mr_multiaddr = i6a; + return setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq6, sizeof(mreq6)); +#endif + default: + return -EINVAL; + } +} + #endif /* HAVE_SYS_SOCKET_H */ /*! @} */ -- To view, visit https://gerrit.osmocom.org/3238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id703e7a7a1e065181a4c76c088b8dcc1b7fe15a2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 15:07:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 13 Jul 2017 15:07:52 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#11). Add release target to Makefile Add simple helper target to automate basic release steps: * version bump * prepare release commit * git commit, tag and sign For library projects: * update debian/changelog from TODO-RELEASE * cleanup TODO-RELEASE For non-library projects: * update debian/changelog from git log Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control A osmo-release.mk 4 files changed, 41 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/11 diff --git a/Makefile.am b/Makefile.am index b8de3ca..edbe6c7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,13 +7,19 @@ pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \ libosmogb.pc libosmoctrl.pc libosmocoding.pc + at RELMAKE@ + +relengdir = $(includedir) +releng_DATA = osmo-release.mk +osmo-release.mk: $(SOURCES) + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md +EXTRA_DIST = git-version-gen .version README.md osmo-release.mk if HAVE_DOXYGEN @@ -67,4 +73,4 @@ DX_CLEAN = doc/{core,gsm,vty,codec,coding,gb}/html/search/* doc/{core,gsm,vty,codec,coding,gb}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec,coding,gb}/doxygen_sqlite3.db doc/*.tag endif -MOSTLYCLEANFILES = $(DX_CLEAN) +MOSTLYCLEANFILES = $(DX_CLEAN) $(DESTDIR)$(includedir)/osmo-release.mk diff --git a/configure.ac b/configure.ac index 92544b6..641f852 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..4407c86 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,28 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +ISODATE := $(shell date -I) +endif + +release: +ifeq ($(NEW_VERSION),) + @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) +endif + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." +ifeq ($(LIBVERS),) + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge +else + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)." + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 11 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Thu Jul 13 15:11:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 15:11:16 +0000 Subject: [MERGED] libosmocore[master]: socket: Unify listen() calls and check for erroneous returns In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: socket: Unify listen() calls and check for erroneous returns ...................................................................... socket: Unify listen() calls and check for erroneous returns We had three places at the end of socket initialization functions calling listen(). Let's unify that and fix some bugs: * close + return error in case of bad listen() result * don't call listen() on AF_UNIX SOCK_DGRAM sockets Change-Id: I7e8dbe3c0486bb3b9810b0add1331e93fc106d82 --- M src/socket.c 1 file changed, 33 insertions(+), 20 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/socket.c b/src/socket.c index d18f756..d0e4c24 100644 --- a/src/socket.c +++ b/src/socket.c @@ -104,6 +104,25 @@ } +static int osmo_sock_init_tail(int fd, uint16_t type, unsigned int flags) +{ + int rc = 0; + + /* Make sure to call 'listen' on a bound, connection-oriented sock */ + if ((flags & (OSMO_SOCK_F_BIND|OSMO_SOCK_F_CONNECT)) == OSMO_SOCK_F_BIND) { + switch (type) { + case SOCK_STREAM: + case SOCK_SEQPACKET: + rc = listen(fd, 10); + } + } + + if (rc < 0) + LOGP(DLGLOBAL, LOGL_ERROR, "unable to listen on socket: %s\n", strerror(errno)); + + return rc; +} + /*! Initialize a socket (including bind and/or connect) * \param[in] family Address Family like AF_INET, AF_INET6, AF_UNSPEC * \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM @@ -219,15 +238,12 @@ } } - /* Make sure to call 'listen' on a bound, connection-oriented sock */ - if ((flags & (OSMO_SOCK_F_BIND|OSMO_SOCK_F_CONNECT)) == OSMO_SOCK_F_BIND) { - switch (type) { - case SOCK_STREAM: - case SOCK_SEQPACKET: - listen(sfd, 10); - break; - } + rc = osmo_sock_init_tail(sfd, type, flags); + if (rc < 0) { + close(sfd); + sfd = -1; } + return sfd; } @@ -305,15 +321,12 @@ setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - /* Make sure to call 'listen' on a bound, connection-oriented sock */ - if (flags & OSMO_SOCK_F_BIND) { - switch (type) { - case SOCK_STREAM: - case SOCK_SEQPACKET: - listen(sfd, 10); - break; - } + rc = osmo_sock_init_tail(sfd, type, flags); + if (rc < 0) { + close(sfd); + sfd = -1; } + return sfd; } @@ -545,10 +558,10 @@ } } - if (flags & OSMO_SOCK_F_BIND) { - rc = listen(sfd, 10); - if (rc < 0) - goto err; + rc = osmo_sock_init_tail(sfd, type, flags); + if (rc < 0) { + close(sfd); + sfd = -1; } return sfd; -- To view, visit https://gerrit.osmocom.org/3239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e8dbe3c0486bb3b9810b0add1331e93fc106d82 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 15:11:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 15:11:16 +0000 Subject: [MERGED] libosmocore[master]: socket: Allow disabling multicast loop on socket creation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: socket: Allow disabling multicast loop on socket creation ...................................................................... socket: Allow disabling multicast loop on socket creation This introduces a new flag OSMO_SOCK_F_NO_MCAST_LOOP, which can be used to disable the looping back of multicast packets transmitted throug this socket to other local sockets on the machine. As this looping-back is active by default, a single option to deviate from the default is deemed sufficient. Change-Id: I24a5b1ebc3f84d2d5d4734e54df50efaea26490b --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 18 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index 6db436a..695e1d7 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -20,6 +20,8 @@ #define OSMO_SOCK_F_BIND (1 << 1) /*! switch socket to non-blocking mode */ #define OSMO_SOCK_F_NONBLOCK (1 << 2) +/*! disable multiast loop (IP_MULTICAST_LOOP) */ +#define OSMO_SOCK_F_NO_MCAST_LOOP (1 << 3) int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, const char *host, uint16_t port, unsigned int flags); diff --git a/src/socket.c b/src/socket.c index d0e4c24..c7d081c 100644 --- a/src/socket.c +++ b/src/socket.c @@ -106,7 +106,7 @@ static int osmo_sock_init_tail(int fd, uint16_t type, unsigned int flags) { - int rc = 0; + int rc; /* Make sure to call 'listen' on a bound, connection-oriented sock */ if ((flags & (OSMO_SOCK_F_BIND|OSMO_SOCK_F_CONNECT)) == OSMO_SOCK_F_BIND) { @@ -114,13 +114,25 @@ case SOCK_STREAM: case SOCK_SEQPACKET: rc = listen(fd, 10); + if (rc < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "unable to listen on socket: %s\n", + strerror(errno)); + return rc; + } + break; } } - if (rc < 0) - LOGP(DLGLOBAL, LOGL_ERROR, "unable to listen on socket: %s\n", strerror(errno)); + if (flags & OSMO_SOCK_F_NO_MCAST_LOOP) { + rc = osmo_sock_mcast_loop_set(fd, false); + if (rc < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "unable to disable multicast loop: %s\n", + strerror(errno)); + return rc; + } + } - return rc; + return 0; } /*! Initialize a socket (including bind and/or connect) -- To view, visit https://gerrit.osmocom.org/3240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24a5b1ebc3f84d2d5d4734e54df50efaea26490b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 15:34:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 13 Jul 2017 15:34:59 +0000 Subject: [PATCH] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3130 to look at the new patch set (#12). Add release target to Makefile Add simple helper target to automate basic release steps: * version bump * prepare release commit * git commit, tag and sign For library projects: * update debian/changelog from TODO-RELEASE * cleanup TODO-RELEASE For non-library projects: * update debian/changelog from git log Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control A osmo-release.mk 4 files changed, 41 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/3130/12 diff --git a/Makefile.am b/Makefile.am index b8de3ca..8b35856 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,13 +7,20 @@ pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \ libosmogb.pc libosmoctrl.pc libosmocoding.pc + at RELMAKE@ + +relengdir = $(includedir) +releng_DATA = osmo-release.mk + +osmo-release.mk: git-version-gen + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md +EXTRA_DIST = git-version-gen .version README.md osmo-release.mk if HAVE_DOXYGEN diff --git a/configure.ac b/configure.ac index 92544b6..641f852 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..4407c86 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,28 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +ISODATE := $(shell date -I) +endif + +release: +ifeq ($(NEW_VERSION),) + @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) +endif + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." +ifeq ($(LIBVERS),) + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge +else + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)." + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 12 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Thu Jul 13 15:40:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 13 Jul 2017 15:40:42 +0000 Subject: openbsc[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: It could but it doesn't have to - in this case we know that it's necessary to always check the return code. Other functions might require digging through the code which uses them so I think it might make sense to submit it as a series of small patches rather than batching it all together. -- To view, visit https://gerrit.osmocom.org/3184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:23:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:23:05 +0000 Subject: [MERGED] libosmocore[master]: socket: Add new OSMO_SOCK_F_NO_MCAST_ALL option In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: socket: Add new OSMO_SOCK_F_NO_MCAST_ALL option ...................................................................... socket: Add new OSMO_SOCK_F_NO_MCAST_ALL option Using this option at socket creation, the caller can request disabling the IP_MULTICAST_ALL socket option. Change-Id: I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index 695e1d7..ebfcab3 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -22,6 +22,8 @@ #define OSMO_SOCK_F_NONBLOCK (1 << 2) /*! disable multiast loop (IP_MULTICAST_LOOP) */ #define OSMO_SOCK_F_NO_MCAST_LOOP (1 << 3) +/*! disable receiving all multiast even for non-subscribed groups */ +#define OSMO_SOCK_F_NO_MCAST_ALL (1 << 4) int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, const char *host, uint16_t port, unsigned int flags); diff --git a/src/socket.c b/src/socket.c index c7d081c..ca50b6f 100644 --- a/src/socket.c +++ b/src/socket.c @@ -132,6 +132,16 @@ } } + if (flags & OSMO_SOCK_F_NO_MCAST_ALL) { + rc = osmo_sock_mcast_all_set(fd, false); + if (rc < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "unable to disable receive of all multicast: %s\n", + strerror(errno)); + /* do not abort here, as this is just an + * optional additional optimization that only + * exists on Linux only */ + } + } return 0; } -- To view, visit https://gerrit.osmocom.org/3241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:38:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:38:13 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Initial check-in of a new virtual BTS Message-ID: Review at https://gerrit.osmocom.org/3242 VIRT-PHY: Initial check-in of a new virtual BTS This patch adds a virtual physical layer designed to simulate the Um air interface between BTS and MS. It does so by encapsulating MAC blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP streams, both in uplink and in downlink. The purpose of this is enable testing without any radio hardware or related licenses. OsmocomBB has recently received as similar patch-set, adding a virty_phy executable that can be run on a PC instead of the classic 'layer1' firmware on a real phone. Using GSMTAP means that one can use unmodified wireshark to decode the messages exchanged on the virtual Um layer Change-Id: I1bf7670975b1e367c1c62983020865a043542622 --- M .gitignore M configure.ac M include/osmo-bts/gsm_data.h M include/osmo-bts/phy_link.h M src/Makefile.am A src/osmo-bts-virtual/Makefile.am A src/osmo-bts-virtual/bts_model.c A src/osmo-bts-virtual/l1_if.c A src/osmo-bts-virtual/l1_if.h A src/osmo-bts-virtual/main.c A src/osmo-bts-virtual/osmo_mcast_sock.c A src/osmo-bts-virtual/osmo_mcast_sock.h A src/osmo-bts-virtual/scheduler_virtbts.c A src/osmo-bts-virtual/virtual_um.c A src/osmo-bts-virtual/virtual_um.h A src/osmo-bts-virtual/virtualbts_vty.c 16 files changed, 1,892 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/3242/1 diff --git a/.gitignore b/.gitignore index 19ca274..a8c0ece 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ src/osmo-bts-octphy/osmo-bts-octphy +src/osmo-bts-virtual/osmo-bts-virtual + tests/atconfig tests/package.m4 tests/agch/agch_test diff --git a/configure.ac b/configure.ac index 64231b3..0ceb8eb 100644 --- a/configure.ac +++ b/configure.ac @@ -178,6 +178,7 @@ AC_OUTPUT( src/Makefile src/common/Makefile + src/osmo-bts-virtual/Makefile src/osmo-bts-sysmo/Makefile src/osmo-bts-litecell15/Makefile src/osmo-bts-trx/Makefile diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index c513b27..aeac4b2 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -114,6 +114,12 @@ struct { char *sock_path; } pcu; + + struct { + uint32_t last_fn; + struct timeval tv_clock; + struct osmo_timer_list fn_timer; + } vbts; }; enum lchan_ciph_state { diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4c7ff34..d8d3c6b 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -10,11 +10,13 @@ #include "btsconfig.h" struct gsm_bts_trx; +struct virt_um_inst; enum phy_link_type { PHY_LINK_T_NONE, PHY_LINK_T_SYSMOBTS, PHY_LINK_T_OSMOTRX, + PHY_LINK_T_VIRTUAL, }; enum phy_link_state { @@ -46,6 +48,14 @@ uint32_t clock_advance; uint32_t rts_advance; } osmotrx; + struct { + char *mcast_dev; /* Network device for multicast */ + char *bts_mcast_group; /* BTS are listening to this group */ + uint16_t bts_mcast_port; + char *ms_mcast_group; /* MS are listening to this group */ + uint16_t ms_mcast_port; + struct virt_um_inst *virt_um; + } virt; struct { /* MAC address of the PHY */ struct sockaddr_ll phy_addr; @@ -99,6 +109,9 @@ bool sw_act_reported; } osmotrx; struct { + struct l1sched_trx sched; + } virt; + struct { /* logical transceiver number within one PHY */ uint32_t trx_id; /* trx lock state variable */ diff --git a/src/Makefile.am b/src/Makefile.am index e7610fe..4f3f760 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = common +SUBDIRS = common osmo-bts-virtual if ENABLE_SYSMOBTS SUBDIRS += osmo-bts-sysmo diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am new file mode 100644 index 0000000..30069d4 --- /dev/null +++ b/src/osmo-bts-virtual/Makefile.am @@ -0,0 +1,10 @@ +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -Iinclude +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) + +noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h + +bin_PROGRAMS = osmo-bts-virtual + +osmo_bts_virtual_SOURCES = main.c bts_model.c virtualbts_vty.c scheduler_virtbts.c l1_if.c virtual_um.c osmo_mcast_sock.c +osmo_bts_virtual_LDADD = $(top_builddir)/src/common/libbts.a $(top_builddir)/src/common/libl1sched.a $(COMMON_LDADD) diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c new file mode 100644 index 0000000..5293cc3 --- /dev/null +++ b/src/osmo-bts-virtual/bts_model.c @@ -0,0 +1,169 @@ +/* (C) 2015 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 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 + +/* TODO: check if dummy method is sufficient, else implement */ +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return -1; +} + +/* TODO: check if dummy method is sufficient, else implement */ +int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr, + int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) +{ + return -1; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, + struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +static uint8_t vbts_set_bts(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx; + uint8_t tn; + + llist_for_each_entry(trx, &bts->trx_list, list) { + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); + oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OK); + + for (tn = 0; tn < TRX_NR_TS; tn++) + oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); + + /* report availability of trx to the bts. this will trigger the rsl connection */ + oml_mo_tx_sw_act_rep(&trx->mo); + oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + } + return 0; +} + +static uint8_t vbts_set_trx(struct gsm_bts_trx *trx) +{ + return 0; +} + +static uint8_t vbts_set_ts(struct gsm_bts_trx_ts *ts) +{ + struct phy_instance *pinst = trx_phy_instance(ts->trx); + int rc; + + rc = trx_sched_set_pchan(&pinst->u.virt.sched, ts->nr, ts->pchan); + if (rc) + return NM_NACK_RES_NOTAVAIL; + + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, + struct tlv_parsed *new_attr, int kind, void *obj) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + int cause = 0; + + switch (foh->msg_type) { + case NM_MT_SET_BTS_ATTR: + cause = vbts_set_bts(obj); + break; + case NM_MT_SET_RADIO_ATTR: + cause = vbts_set_trx(obj); + break; + case NM_MT_SET_CHAN_ATTR: + cause = vbts_set_ts(obj); + break; + } + return oml_fom_ack_nack(msg, cause); +} + +/* MO: TS 12.21 Managed Object */ +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + int rc; + + switch (mo->obj_class) { + case NM_OC_RADIO_CARRIER: + case NM_OC_CHANNEL: + case NM_OC_SITE_MANAGER: + case NM_OC_BASEB_TRANSC: + case NM_OC_BTS: + oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); + rc = oml_mo_opstart_ack(mo); + break; + /* TODO: gprs support */ + case NM_OC_GPRS_NSE: + case NM_OC_GPRS_CELL: + case NM_OC_GPRS_NSVC: + default: + rc = oml_mo_opstart_nack(mo, NM_NACK_OBJCLASS_NOTSUPP); + } + return rc; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, + void *obj, uint8_t adm_state) +{ + mo->nm_state.administrative = adm_state; + return oml_mo_statechg_ack(mo); +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + + +int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) +{ + return 0; +} + +int bts_model_ctrl_cmds_install(struct gsm_bts *bts) +{ + return 0; +} diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c new file mode 100644 index 0000000..b649461 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.c @@ -0,0 +1,465 @@ +/* Virtual BTS layer 1 primitive handling and interface + * + * Copyright (C) 2015-2017 Harald Welte + * Copyright (C) 2017 Sebastian Stumpf + * + * 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +extern int vbts_sched_start(struct gsm_bts *bts); + +static struct phy_instance *phy_instance_by_arfcn(struct phy_link *plink, uint16_t arfcn) +{ + struct phy_instance *pinst; + + llist_for_each_entry(pinst, &plink->instances, list) { + if (pinst->trx && pinst->trx->arfcn == arfcn) + return pinst; + } + + return NULL; +} + +/** + * Callback to handle incoming messages from the MS. + * The incoming message should be GSM_TAP encapsulated. + * TODO: implement all channels + */ +static void virt_um_rcv_cb(struct virt_um_inst *vui, struct msgb *msg) +{ + struct phy_link *plink = (struct phy_link *)vui->priv; + struct gsmtap_hdr *gh = msgb_l1(msg); + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the cell we currently camp on */ + uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ + uint8_t signal_dbm = gh->signal_dbm; /* signal strength in dBm */ + //uint8_t snr = gh->snr_db; /* signal noise ratio in dB */ + uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ + uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ + struct phy_instance *pinst; + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + /* get rid of l1 gsmtap hdr */ + msg->l2h = msgb_pull(msg, sizeof(*gh)); + + /* convert gsmtap chan to RSL chan and link id */ + chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); + chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + + /* ... or not uplink */ + if (!(arfcn & GSMTAP_ARFCN_F_UPLINK)) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - no uplink flag\n"); + goto nomessage; + } + + /* Generally ignore all msgs that are either not received with the right ARFCN... */ + pinst = phy_instance_by_arfcn(plink, arfcn & GSMTAP_ARFCN_MASK); + if (!pinst) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - msg ARFCN=%d not part of BTS\n", + arfcn & GSMTAP_ARFCN_MASK); + goto nomessage; + } + + /* switch case with removed ACCH flag */ + switch ((gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH) & 0xff) { + case GSMTAP_CHANNEL_RACH: + /* generate primitive for upper layer + * see 04.08 - 3.3.1.3.1: the IMMEDIATE_ASSIGNMENT coming back from the network has to be + * sent with the same ra reference as in the CHANNEL_REQUEST that was received */ + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_RACH, PRIM_OP_INDICATION, msg); + + l1sap.u.rach_ind.chan_nr = chan_nr; + /* TODO: 11bit RACH */ + l1sap.u.rach_ind.ra = msgb_pull_u8(msg); /* directly after gh hdr comes ra */ + l1sap.u.rach_ind.acc_delay = 0; /* probably not used in virt um */ + l1sap.u.rach_ind.is_11bit = 0; + l1sap.u.rach_ind.fn = fn; + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_NONE; /* FIXME: what comes here */ + break; + case GSMTAP_CHANNEL_TCH_F: + case GSMTAP_CHANNEL_TCH_H: +#if 0 + /* TODO: handle voice messages */ + if (!facch && ! tch_acch) { + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, msg); + } +#endif + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_DATA, + PRIM_OP_INDICATION, msg); + l1sap.u.data.chan_nr = chan_nr; + l1sap.u.data.link_id = link_id; + l1sap.u.data.fn = fn; + l1sap.u.data.rssi = 0; /* Radio Signal Strength Indicator. Best -> 0 */ + l1sap.u.data.ber10k = 0; /* Bit Error Rate in 0.01%. Best -> 0 */ + l1sap.u.data.ta_offs_qbits = 0; /* Burst time of arrival in quarter bits. Probably used for Timing Advance calc. Best -> 0 */ + l1sap.u.data.lqual_cb = 10 * signal_dbm; /* Link quality in centiBel = 10 * dB. */ + l1sap.u.data.pdch_presence_info = PRES_INFO_UNKNOWN; + break; + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type downlink only!\n"); + goto nomessage; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type not supported!\n"); + goto nomessage; + default: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type unknown\n"); + goto nomessage; + } + + /* forward primitive, forwarded msg will not be freed */ +#warning "we cannot just pass a l1sap primitive on the stack!!!" + l1sap_up(pinst->trx, &l1sap); + DEBUGP(DL1P, "Message forwarded to layer 2.\n"); + return; + +nomessage: + talloc_free(msg); +} + +/* called by common part once OML link is established */ +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +/* called by bts_main to initialize physical link */ +int bts_model_phy_link_open(struct phy_link *plink) +{ + struct phy_instance *pinst; + + //OSMO_ASSERT(plink->type == PHY_LINK_T_VIRTUAL); + + if (plink->u.virt.virt_um) + virt_um_destroy(plink->u.virt.virt_um); + + phy_link_state_set(plink, PHY_LINK_CONNECTING); + + if (!plink->u.virt.bts_mcast_group) + plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; + + if (!plink->u.virt.bts_mcast_port) + plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; + + if (!plink->u.virt.ms_mcast_group) + plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; + + if (!plink->u.virt.ms_mcast_port) + plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; + + plink->u.virt.virt_um = virt_um_init(plink, plink->u.virt.ms_mcast_group, plink->u.virt.ms_mcast_port, + plink->u.virt.bts_mcast_group, plink->u.virt.bts_mcast_port, + virt_um_rcv_cb); + /* set back reference to plink */ + plink->u.virt.virt_um->priv = plink; + if (!plink->u.virt.virt_um) { + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + return -1; + } + + /* iterate over list of PHY instances and initialize the scheduler */ + llist_for_each_entry(pinst, &plink->instances, list) { + trx_sched_init(&pinst->u.virt.sched, pinst->trx); + /* Only start the scheduler for the transceiver on C0. + * If we have multiple tranceivers, CCCH is always on C0 + * and has to be auto active */ + /* Other TRX are activated via OML by a PRIM_INFO_MODIFY + * / PRIM_INFO_ACTIVATE */ + if (pinst->trx == pinst->trx->bts->c0) { + vbts_sched_start(pinst->trx->bts); + /* init lapdm layer 3 callback for the trx on timeslot 0 == BCCH */ + lchan_init_lapdm(&pinst->trx->ts[0].lchan[CCCH_LCHAN]); + /* FIXME: This is probably the wrong location to set the CCCH to active... the OML link def. needs to be reworked and fixed. */ + pinst->trx->ts[0].lchan[CCCH_LCHAN].rel_act_kind = LCHAN_REL_ACT_OML; + lchan_set_state(&pinst->trx->ts[0].lchan[CCCH_LCHAN], LCHAN_S_ACTIVE); + } + } + + /* this will automatically update the MO state of all associated TRX objects */ + phy_link_state_set(plink, PHY_LINK_CONNECTED); + + return 0; +} + + +/* + * primitive handling + */ + +/* enable ciphering */ +static int l1if_set_ciphering(struct gsm_lchan *lchan, uint8_t chan_nr, int downlink) +{ + struct gsm_bts_trx *trx = lchan->ts->trx; + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + + /* ciphering already enabled in both directions */ + if (lchan->ciph_state == LCHAN_CIPH_RXTX_CONF) + return -EINVAL; + + if (!downlink) { + /* set uplink */ + trx_sched_set_cipher(sched, chan_nr, 0, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RX_CONF; + } else { + /* set downlink and also set uplink, if not already */ + if (lchan->ciph_state != LCHAN_CIPH_RX_CONF) { + trx_sched_set_cipher(sched, chan_nr, 0, + lchan->encr.alg_id - 1, lchan->encr.key, + lchan->encr.key_len); + } + trx_sched_set_cipher(sched, chan_nr, 1, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + } + + return 0; +} + +static int mph_info_chan_confirm(struct gsm_bts_trx *trx, uint8_t chan_nr, + enum osmo_mph_info_type type, uint8_t cause) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_CONFIRM, + NULL); + l1sap.u.info.type = type; + l1sap.u.info.u.act_cnf.chan_nr = chan_nr; + l1sap.u.info.u.act_cnf.cause = cause; + + return l1sap_up(trx, &l1sap); +} + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap.u.info.type = PRIM_INFO_TIME; + l1sap.u.info.u.time_ind.fn = fn; + + if (!bts->c0) + return -EINVAL; + + return l1sap_up(bts->c0, &l1sap); +} + + +static void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, + float ber, float rssi) +{ + memset(l1sap, 0, sizeof(*l1sap)); + osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap->u.info.type = PRIM_INFO_MEAS; + l1sap->u.info.u.meas_ind.chan_nr = chan_nr; + l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4); + l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000); + l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1); +} + +int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, + int n_errors, int n_bits_total, float rssi, float toa) +{ + struct gsm_lchan *lchan = &trx->ts[tn].lchan[l1sap_chan2ss(chan_nr)]; + struct osmo_phsap_prim l1sap; + /* 100% BER is n_bits_total is 0 */ + float ber = n_bits_total==0 ? 1.0 : (float)n_errors / (float)n_bits_total; + + LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS pwr=%ddBm rssi=%.1f dBFS " + "ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n", + gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), + rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); + + l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi); + + return l1sap_up(trx, &l1sap); +} + + + +/* primitive from common part */ +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + struct msgb *msg = l1sap->oph.msg; + uint8_t chan_nr; + uint8_t tn, ss; + int rc = 0; + struct gsm_lchan *lchan; + + switch (OSMO_PRIM_HDR(&l1sap->oph)) { + case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_ph_data_req(sched, l1sap); + case OSMO_PRIM(PRIM_TCH, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_tch_req(sched, l1sap); + case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_REQUEST): + switch (l1sap->u.info.type) { + case PRIM_INFO_ACT_CIPH: + chan_nr = l1sap->u.info.u.ciph_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + if (l1sap->u.info.u.ciph_req.uplink) + l1if_set_ciphering(lchan, chan_nr, 0); + if (l1sap->u.info.u.ciph_req.downlink) + l1if_set_ciphering(lchan, chan_nr, 1); + break; + case PRIM_INFO_ACTIVATE: + case PRIM_INFO_DEACTIVATE: + case PRIM_INFO_MODIFY: + chan_nr = l1sap->u.info.u.act_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + /* we receive a channel activation request from the BSC, + * e.g. as a response to a channel req on RACH */ + if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot activate" + " chan_nr 0x%02x\n", chan_nr); + break; + } + /* activate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_DEDIC, 1); + /* activate associated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_SACCH, 1); + /* set mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + (lchan->ho.active == 1)); + /* init lapdm */ + lchan_init_lapdm(lchan); + /* set lchan active */ + lchan_set_state(lchan, LCHAN_S_ACTIVE); + /* set initial ciphering */ + l1if_set_ciphering(lchan, chan_nr, 0); + l1if_set_ciphering(lchan, chan_nr, 1); + if (lchan->encr.alg_id) + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + else + lchan->ciph_state = LCHAN_CIPH_NONE; + + /* confirm */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_ACTIVATE, 0); + break; + } + if (l1sap->u.info.type == PRIM_INFO_MODIFY) { + /* change mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + 0); + break; + } + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot deactivate " + "chan_nr 0x%02x\n", chan_nr); + break; + } + /* deactivate associated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x40, 0); + if (!l1sap->u.info.u.act_req.sacch_only) { + /* set lchan inactive */ + lchan_set_state(lchan, LCHAN_S_NONE); + /* deactivate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x00, 0); + /* confirm only on dedicated channel */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_DEACTIVATE, 0); + lchan->ciph_state = 0; /* FIXME: do this in common/\*.c */ + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown MPH-INFO.req %d\n", + l1sap->u.info.type); + rc = -EINVAL; + goto done; + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d\n", + l1sap->oph.primitive, l1sap->oph.operation); + rc = -EINVAL; + goto done; + } + +done: + if (msg) + msgb_free(msg); + return rc; +} diff --git a/src/osmo-bts-virtual/l1_if.h b/src/osmo-bts-virtual/l1_if.h new file mode 100644 index 0000000..6a843b3 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +#include "virtual_um.h" + +struct vbts_l1h { + struct gsm_bts_trx *trx; + struct l1sched_trx l1s; + struct virt_um_inst *virt_um; +}; + +struct vbts_l1h *l1if_open(struct gsm_bts_trx *trx); +void l1if_close(struct vbts_l1h *l1h); +void l1if_reset(struct vbts_l1h *l1h); + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn); + +int vbts_sched_start(struct gsm_bts *bts); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c new file mode 100644 index 0000000..6ceeaec --- /dev/null +++ b/src/osmo-bts-virtual/main.c @@ -0,0 +1,126 @@ +/* Main program for Virtual OsmoBTS */ + +/* (C) 2015 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 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +/* dummy, since no direct dsp support */ +uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb; + + btsb = bts_role_bts(bts); + btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + + bts_model_vty_init(bts); + + return 0; +} + +void bts_model_print_help() +{ +} + +int bts_model_handle_options(int argc, char **argv) +{ + int num_errors = 0; + + while (1) { + int option_idx = 0, c; + static const struct option long_options[] = { + /* specific to this hardware */ + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "", + long_options, &option_idx); + if (c == -1) + break; + + switch (c) { + default: + num_errors++; + break; + } + } + + return num_errors; +} + +void bts_model_abis_close(struct gsm_bts *bts) +{ + /* for now, we simply terminate the program and re-spawn */ + bts_shutdown(bts, "Abis close"); +} + +void bts_model_phy_link_set_defaults(struct phy_link *plink) +{ +} + +void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) +{ +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} + +int main(int argc, char **argv) +{ + return bts_main(argc, argv); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.c b/src/osmo-bts-virtual/osmo_mcast_sock.c new file mode 100644 index 0000000..f092a73 --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.c @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "osmo_mcast_sock.h" + +/* server socket is what we use for transmission. It is not subscribed + * to a multicast group or locally bound, but it is just a normal UDP + * socket that's connected to the remote mcast group + port */ +int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, + uint16_t tx_mcast_port, bool loopback) +{ + int rc; + unsigned int flags = OSMO_SOCK_F_CONNECT; + + if (!loopback) + flags |= OSMO_SOCK_F_NO_MCAST_LOOP; + + /* setup mcast server socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + tx_mcast_group, tx_mcast_port, flags); + if (rc < 0) { + perror("Failed to create Multicast Server Socket"); + return rc; + } + + return 0; +} + +/* the client socket is what we use for reception. It is a UDP socket + * that's bound to the GSMTAP UDP port and subscribed to the respective + * multicast group */ +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + int rc; + + ofd->cb = fd_rx_cb; + ofd->when = BSC_FD_READ; + ofd->data = osmo_fd_data; + + /* Create mcast client socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + NULL, mcast_port, OSMO_SOCK_F_BIND|OSMO_SOCK_F_NO_MCAST_ALL); + if (rc < 0) { + perror("Could not create mcast client socket"); + return rc; + } + + /* Configure and join the multicast group */ + rc = osmo_sock_mcast_subscribe(ofd->fd, mcast_group); + if (rc < 0) { + perror("Failed to join to mcast goup"); + osmo_fd_close(ofd); + return rc; + } + + return 0; +} + +struct mcast_bidir_sock * +mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_bidir_sock *bidir_sock = talloc(ctx, struct mcast_bidir_sock); + int rc; + + if (!bidir_sock) + return NULL; + + rc = mcast_client_sock_setup(&bidir_sock->rx_ofd, rx_mcast_group, rx_mcast_port, + fd_rx_cb, osmo_fd_data); + if (rc < 0) { + talloc_free(bidir_sock); + return NULL; + } + rc = mcast_server_sock_setup(&bidir_sock->tx_ofd, tx_mcast_group, tx_mcast_port, loopback); + if (rc < 0) { + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); + return NULL; + } + return bidir_sock; + +} + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, + unsigned int data_len) +{ + return send(bidir_sock->tx_ofd.fd, data, data_len, 0); +} + +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len) +{ + return recv(bidir_sock->rx_ofd.fd, buf, buf_len, 0); +} + +void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) +{ + osmo_fd_close(&bidir_sock->tx_ofd); + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.h b/src/osmo-bts-virtual/osmo_mcast_sock.h new file mode 100644 index 0000000..aa2013c --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include +#include + +struct mcast_bidir_sock { + struct osmo_fd tx_ofd; + struct osmo_fd rx_ofd; +}; + +struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx, + const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group, + uint16_t tx_mcast_port, bool loopback); + +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, unsigned int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len); +void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); + diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c new file mode 100644 index 0000000..39da689 --- /dev/null +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -0,0 +1,635 @@ +/* Scheduler worker functiosn for Virtua OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * + * 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 +#include +#include "virtual_um.h" +#include "l1_if.h" + +static const char *gsmtap_hdr_stringify(const struct gsmtap_hdr *gh) +{ + static char buf[256]; + snprintf(buf, sizeof(buf), "(ARFCN=%u, ts=%u, ss=%u, type=%u/%u)", + gh->arfcn & GSMTAP_ARFCN_MASK, gh->timeslot, gh->sub_slot, gh->type, gh->sub_type); + return buf; +} + +/** + * Send a message over the virtual um interface. + * This will at first wrap the msg with a GSMTAP header and then write it to the declared multicast socket. + * TODO: we might want to remove unused argument uint8_t tn + */ +static void tx_to_virt_um(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, struct msgb *msg) +{ + const struct trx_chan_desc *chdesc = &trx_chan_desc[chan]; + struct msgb *outmsg; /* msg to send with gsmtap header prepended */ + uint16_t arfcn = l1t->trx->arfcn; /* ARFCN of the tranceiver the message is send with */ + uint8_t signal_dbm = 63; /* signal strength, 63 is best */ + uint8_t snr = 63; /* signal noise ratio, 63 is best */ + uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ + uint8_t data_len = msgb_l2len(msg); /* length of data */ + uint8_t rsl_chantype; /* RSL chan type (TS 08.58, 9.3.1) */ + uint8_t subslot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot; /* TDMA timeslot to send in (0-7) */ + uint8_t gsmtap_chantype; /* the GSMTAP channel */ + + rsl_dec_chan_nr(chdesc->chan_nr, &rsl_chantype, &subslot, ×lot); + /* in Osmocom, AGCH is only sent on ccch block 0. no idea why. this seems to cause false GSMTAP channel + * types for agch and pch. */ + if (rsl_chantype == RSL_CHAN_PCH_AGCH && L1SAP_FN2CCCHBLOCK(fn) == 0) + gsmtap_chantype = GSMTAP_CHANNEL_PCH; + else + gsmtap_chantype = chantype_rsl2gsmtap(rsl_chantype, chdesc->link_id); /* the logical channel type */ + + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chantype, subslot, fn, signal_dbm, snr, data, data_len); + if (outmsg) { + struct phy_instance *pinst = trx_phy_instance(l1t->trx); + struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); + + if (virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg) == -1) + LOGP(DL1P, LOGL_ERROR, "%s GSMTAP msg could not send to virtual Um\n", gsmtap_hdr_stringify(gh)); + else + DEBUGP(DL1C, "%s Sending GSMTAP message to virtual Um\n", gsmtap_hdr_stringify(gh)); + } else + LOGP(DL1C, LOGL_ERROR, "GSMTAP msg could not be created!\n"); + + /* free incoming message */ + msgb_free(msg); +} + +/* + * TX on downlink + */ + +/* an IDLE burst returns nothing. on C0 it is replaced by dummy burst */ +ubit_t *tx_idle_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_fcch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_sch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg; + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + /* check validity of message */ + if (msgb_l2len(msg) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg)); + /* free message */ + msgb_free(msg); + return NULL; + } + + /* transmit the msg received on dl from bsc to layer1 (virt Um) */ + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +ubit_t *tx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg = NULL; /* make GCC happy */ + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +static void tx_tch_common(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, struct msgb **_msg_tch, + struct msgb **_msg_facch, int codec_mode_request) +{ + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct msgb *msg1, *msg2, *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + uint8_t rsl_cmode = chan_state->rsl_cmode; + uint8_t tch_mode = chan_state->tch_mode; + struct osmo_phsap_prim *l1sap; +#if 0 + /* handle loss detection of received TCH frames */ + if (rsl_cmode == RSL_CMOD_SPD_SPEECH + && ++(chan_state->lost) > 5) { + uint8_t tch_data[GSM_FR_BYTES]; + int len; + + LOGP(DL1P, LOGL_NOTICE, "Missing TCH bursts detected, sending " + "BFI for %s\n", trx_chan_desc[chan].name); + + /* indicate bad frame */ + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + tch_data[0] = 0x70; /* F = 0, FT = 111 */ + memset(tch_data + 1, 0, 14); + len = 15; + break; + } + memset(tch_data, 0, GSM_FR_BYTES); + len = GSM_FR_BYTES; + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode1; + memset(tch_data, 0, GSM_EFR_BYTES); + len = GSM_EFR_BYTES; + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ + len = amr_compose_payload(tch_data, + chan_state->codec[chan_state->dl_cmr], + chan_state->codec[chan_state->dl_ft], 1); + if (len < 2) + break; + memset(tch_data + 2, 0, len - 2); + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + break; + default: +inval_mode1: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + len = 0; + } + if (len) + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + } +#endif + + /* get frame and unlink from queue */ + msg1 = _sched_dequeue_prim(l1t, tn, fn, chan); + msg2 = _sched_dequeue_prim(l1t, tn, fn, chan); + if (msg1) { + l1sap = msgb_l1sap_prim(msg1); + if (l1sap->oph.primitive == PRIM_TCH) { + msg_tch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "TCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_facch = msg2; + } + } else { + msg_facch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive != PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "FACCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_tch = msg2; + } + } + } else if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) + msg_tch = msg2; + else + msg_facch = msg2; + } + + /* check validity of message */ + if (msg_facch && msgb_l2len(msg_facch) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg_facch)); + /* free message */ + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* check validity of message, get AMR ft and cmr */ + if (!msg_facch && msg_tch) { + int len; +#if 0 + uint8_t bfi, cmr_codec, ft_codec; + int cmr, ft, i; +#endif + + if (rsl_cmode != RSL_CMOD_SPD_SPEECH) { + LOGP(DL1P, LOGL_NOTICE, "%s Dropping speech frame, " + "because we are not in speech mode trx=%u " + "ts=%u at fn=%u.\n", trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + len = 15; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] & 0xf0) != 0x00) { + LOGP(DL1P, LOGL_NOTICE, "%s " + "Transmitting 'bad " + "HR frame' trx=%u ts=%u at " + "fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + } + len = GSM_FR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xd) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "FR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode2; + len = GSM_EFR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xc) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "EFR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ +#if 0 + len = amr_decompose_payload(msg_tch->l2h, + msgb_l2len(msg_tch), &cmr_codec, &ft_codec, + &bfi); + cmr = -1; + ft = -1; + for (i = 0; i < chan_state->codecs; i++) { + if (chan_state->codec[i] == cmr_codec) + cmr = i; + if (chan_state->codec[i] == ft_codec) + ft = i; + } + if (cmr >= 0) { /* new request */ + chan_state->dl_cmr = cmr; + /* disable AMR loop */ + trx_loop_amr_set(chan_state, 0); + } else { + /* enable AMR loop */ + trx_loop_amr_set(chan_state, 1); + } + if (ft < 0) { + LOGP(DL1P, LOGL_ERROR, "%s Codec (FT = %d) " + " of RTP frame not in list. " + "trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + if (codec_mode_request && chan_state->dl_ft != ft) { + LOGP(DL1P, LOGL_NOTICE, "%s Codec (FT = %d) " + " of RTP cannot be changed now, but in " + "next frame. trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + chan_state->dl_ft = ft; + if (bfi) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "AMR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } +#else + LOGP(DL1P, LOGL_ERROR, "AMR not supported!\n"); + goto free_bad_msg; +#endif + break; + default: +inval_mode2: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + goto free_bad_msg; + } + if (len < 0) { + LOGP(DL1P, LOGL_ERROR, "Cannot send invalid AMR " + "payload\n"); + goto free_bad_msg; + } + if (msgb_l2len(msg_tch) != len) { + LOGP(DL1P, LOGL_ERROR, "Cannot send payload with " + "invalid length! (expecing %d, received %d)\n", + len, msgb_l2len(msg_tch)); +free_bad_msg: + /* free message */ + msgb_free(msg_tch); + msg_tch = NULL; + goto send_frame; + } + } + +send_frame: + *_msg_tch = msg_tch; + *_msg_facch = msg_facch; +} + +ubit_t *tx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + + if (bid > 0) + return NULL; + + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* no message at all */ + if (!msg_tch && !msg_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + + return NULL; +} + +ubit_t *tx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + //uint8_t tch_mode = chan_state->tch_mode; + + /* send burst, if we already got a frame */ + if (bid > 0) + return NULL; + + /* get TCH and/or FACCH */ + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* check for FACCH alignment */ + if (msg_facch && ((((fn + 4) % 26) >> 2) & 1)) { + LOGP(DL1P, LOGL_ERROR, "%s Cannot transmit FACCH starting on " + "even frames, please fix RTS!\n", + trx_chan_desc[chan].name); + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* no message at all */ + if (!msg_tch && !msg_facch && !chan_state->dl_ongoing_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + return NULL; +} + + +/*********************************************************************** + * RX on uplink (indication to upper layer) + ***********************************************************************/ + +/* we don't use those functions, as we feed the MAC frames from GSMTAP + * directly into the L1SAP, bypassing the TDMA multiplex logic oriented + * towards receiving bursts */ + +int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +/*! \brief a single burst was received by the PHY, process it */ +int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +void _sched_act_rach_det(struct l1sched_trx *l1t, uint8_t tn, uint8_t ss, int activate) +{ +} + +/*********************************************************************** + * main scheduler function + ***********************************************************************/ + +#define RTS_ADVANCE 5 /* about 20ms */ +#define FRAME_DURATION_uS 4615 + +static int vbts_sched_fn(struct gsm_bts *bts, uint32_t fn) +{ + struct gsm_bts_trx *trx; + + /* send time indication */ + /* update model with new frame number, lot of stuff happening, measurements of timeslots */ + /* saving GSM time in BTS model, and more */ + l1if_mph_time_ind(bts, fn); + + /* advance the frame number? */ + llist_for_each_entry(trx, &bts->trx_list, list) { + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *l1t = &pinst->u.virt.sched; + int tn; + uint16_t nbits; + + /* do for each of the 8 timeslots */ + for (tn = 0; tn < ARRAY_SIZE(l1t->ts); tn++) { + /* Generate RTS indication to higher layers */ + /* This will basically do 2 things (check l1_if:bts_model_l1sap_down): + * 1) Get pending messages from layer 2 (from the lapdm queue) + * 2) Process the messages + * --> Handle and process non-transparent RSL-Messages (activate channel, ) + * --> Forward transparent RSL-DATA-Messages to the ms by appending them to + * the l1-dl-queue */ + _sched_rts(l1t, tn, (fn + RTS_ADVANCE) % GSM_HYPERFRAME); + /* schedule transmit backend functions */ + /* Process data in the l1-dlqueue and forward it + * to MS */ + /* the returned bits are not used here, the routines called will directly forward their + * bits to the virt Um */ + _sched_dl_burst(l1t, tn, fn, &nbits); + } + } + + return 0; +} + +static void vbts_fn_timer_cb(void *data) +{ + struct gsm_bts *bts = data; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + struct timeval tv_now; + struct timeval *tv_clock = &btsb->vbts.tv_clock; + int32_t elapsed_us; + + gettimeofday(&tv_now, NULL); + + /* check how much time elapsed till the last timer callback call. + * this value should be about 4.615 ms (a bit greater) as this is the scheduling interval */ + elapsed_us = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 + + (tv_now.tv_usec - tv_clock->tv_usec); + + /* not so good somehow a lot of time passed between two timer callbacks */ + if (elapsed_us > 2 *FRAME_DURATION_uS) + LOGP(DL1P, LOGL_NOTICE, "vbts_fn_timer_cb after %d us\n", elapsed_us); + + /* schedule the current frame/s (fn = frame number) + * this loop will be called at least once, but can also be executed + * multiple times if more than one frame duration (4615us) passed till the last callback */ + while (elapsed_us > FRAME_DURATION_uS / 2) { + const struct timeval tv_frame = { + .tv_sec = 0, + .tv_usec = FRAME_DURATION_uS, + }; + timeradd(tv_clock, &tv_frame, tv_clock); + /* increment the frame number in the BTS model instance */ + btsb->vbts.last_fn = (btsb->vbts.last_fn + 1) % GSM_HYPERFRAME; + vbts_sched_fn(bts, btsb->vbts.last_fn); + elapsed_us -= FRAME_DURATION_uS; + } + + /* re-schedule the timer */ + /* timer is set to frame duration - elapsed time to guarantee that this cb method will be + * periodically executed every 4.615ms */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS - elapsed_us); +} + +int vbts_sched_start(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + + LOGP(DL1P, LOGL_NOTICE, "starting VBTS scheduler\n"); + + memset(&btsb->vbts.fn_timer, 0, sizeof(btsb->vbts.fn_timer)); + btsb->vbts.fn_timer.cb = vbts_fn_timer_cb; + btsb->vbts.fn_timer.data = bts; + + gettimeofday(&btsb->vbts.tv_clock, NULL); + /* trigger the first timer after 4615us (a frame duration) */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS); + + return 0; +} diff --git a/src/osmo-bts-virtual/virtual_um.c b/src/osmo-bts-virtual/virtual_um.c new file mode 100644 index 0000000..e6b9615 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.c @@ -0,0 +1,92 @@ +/* Routines for a Virtual Um interface over GSMTAP/UDP */ + +/* (C) 2015 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 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 "osmo_mcast_sock.h" +#include "virtual_um.h" +#include + +/** + * Virtual UM interface file descriptor callback. + * Should be called by select.c when the fd is ready for reading. + */ +static int virt_um_fd_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct virt_um_inst *vui = ofd->data; + + if (what & BSC_FD_READ) { + struct msgb *msg = msgb_alloc(VIRT_UM_MSGB_SIZE, "Virtual UM Rx"); + int rc; + + /* read message from fd into message buffer */ + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + if (rc > 0) { + msgb_put(msg, rc); + msg->l1h = msgb_data(msg); + /* call the l1 callback function for a received msg */ + vui->recv_cb(vui, msg); + } else { + /* FIXME: this kind of error handling might be a bit harsh */ + vui->recv_cb(vui, NULL); + osmo_fd_close(ofd); + } + } + + return 0; +} + +struct virt_um_inst *virt_um_init(void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) +{ + struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, + rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->recv_cb = recv_cb; + + return vui; + +} + +void virt_um_destroy(struct virt_um_inst *vui) +{ + mcast_bidir_sock_close(vui->mcast_sock); + talloc_free(vui); +} + +/** + * Write msg to to multicast socket and free msg afterwards + */ +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg) +{ + int rc; + + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), + msgb_length(msg)); + msgb_free(msg); + + return rc; +} diff --git a/src/osmo-bts-virtual/virtual_um.h b/src/osmo-bts-virtual/virtual_um.h new file mode 100644 index 0000000..6e7c384 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include "osmo_mcast_sock.h" + +#define VIRT_UM_MSGB_SIZE 256 +#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ +#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ + +struct virt_um_inst { + void *priv; + struct mcast_bidir_sock *mcast_sock; + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); +}; + +struct virt_um_inst *virt_um_init( + void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); + +void virt_um_destroy(struct virt_um_inst *vui); + +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg); diff --git a/src/osmo-bts-virtual/virtualbts_vty.c b/src/osmo-bts-virtual/virtualbts_vty.c new file mode 100644 index 0000000..45c1086 --- /dev/null +++ b/src/osmo-bts-virtual/virtualbts_vty.c @@ -0,0 +1,185 @@ +/* VTY interface for virtual OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * 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 +#include +#include +#include "virtual_um.h" + +#define TRX_STR "Transceiver related commands\n" "TRX number\n" + +#define SHOW_TRX_STR \ + SHOW_STR \ + TRX_STR + +static struct gsm_bts *vty_bts; + +void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) +{ +} + +void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) +{ +} + +void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) +{ +} + +void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) +{ + if (plink->u.virt.mcast_dev) + vty_out(vty, " virtual-um net-device %s%s", + plink->u.virt.mcast_dev, VTY_NEWLINE); + if (strcmp(plink->u.virt.ms_mcast_group, DEFAULT_BTS_MCAST_GROUP)) + vty_out(vty, " virtual-um ms-multicast-group %s%s", + plink->u.virt.ms_mcast_group, VTY_NEWLINE); + if (plink->u.virt.ms_mcast_port) + vty_out(vty, " virtual-um ms-udp-port %u%s", + plink->u.virt.ms_mcast_port, VTY_NEWLINE); + if (strcmp(plink->u.virt.bts_mcast_group, DEFAULT_MS_MCAST_GROUP)) + vty_out(vty, " virtual-um bts-multicast-group %s%s", + plink->u.virt.bts_mcast_group, VTY_NEWLINE); + if (plink->u.virt.bts_mcast_port) + vty_out(vty, " virtual-um bts-udp-port %u%s", + plink->u.virt.bts_mcast_port, VTY_NEWLINE); + +} + +#define VUM_STR "Virtual Um layer\n" + +DEFUN(cfg_phy_ms_mcast_group, cfg_phy_ms_mcast_group_cmd, + "virtual-um ms-multicast-group GROUP", + VUM_STR "Configure the MS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.ms_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_ms_mcast_port, cfg_phy_ms_mcast_port_cmd, + "virtual-um ms-udp-port <0-65535>", + VUM_STR "Configure the MS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.ms_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_group, cfg_phy_bts_mcast_group_cmd, + "virtual-um bts-multicast-group GROUP", + VUM_STR "Configure the BTS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.bts_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_port, cfg_phy_bts_mcast_port_cmd, + "virtual-um bts-udp-port <0-65535>", + VUM_STR "Configure the BTS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.bts_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_mcast_dev, cfg_phy_mcast_dev_cmd, + "virtual-um net-device NETDEV", + VUM_STR "Configure the network device\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.mcast_dev, argv[0]); + + return CMD_SUCCESS; +} + +int bts_model_vty_init(struct gsm_bts *bts) +{ + vty_bts = bts; + + install_element(PHY_NODE, &cfg_phy_ms_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_ms_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_mcast_dev_cmd); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1bf7670975b1e367c1c62983020865a043542622 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:38:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:38:13 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Added example configurations for openbsc and osmobts. Message-ID: Review at https://gerrit.osmocom.org/3243 VIRT-PHY: Added example configurations for openbsc and osmobts. Change-Id: I368d4a378e20028603b09825eee766abb9195774 --- A doc/examples/virtual/openbsc-virtual.cfg A doc/examples/virtual/osmobts-virtual-log-disabled.cfg A doc/examples/virtual/osmobts-virtual.cfg 3 files changed, 301 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/3243/1 diff --git a/doc/examples/virtual/openbsc-virtual.cfg b/doc/examples/virtual/openbsc-virtual.cfg new file mode 100644 index 0000000..8044fa8 --- /dev/null +++ b/doc/examples/virtual/openbsc-virtual.cfg @@ -0,0 +1,151 @@ +! +! OpenBSC (0.15.0.629-34f0-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 0 + logging print category 1 + logging timestamp 1 + logging level all info + logging level rll notice + logging level cc notice + logging level mm debug + logging level rr notice + logging level rsl notice + logging level nm info + logging level mncc notice + logging level pag notice + logging level meas notice + logging level sccp notice + logging level msc notice + logging level mgcp notice + logging level ho notice + logging level db notice + logging level ref notice + logging level gprs debug + logging level ns info + logging level bssgp debug + logging level llc debug + logging level sndcp debug + logging level nat notice + logging level ctrl notice + logging level smpp debug + logging level filter debug + logging level ranap debug + logging level sua debug + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats notice + logging level lgsup notice + logging level loap notice +! +stats interval 5 +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +network + network country code 262 + mobile network code 42 + short name OpenBSC + long name OpenBSC + auth policy accept-all + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + neci 1 + paging any use tch 0 + rrlp mode ms-based + mm info 1 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + timer t3101 10 + timer t3103 0 + timer t3105 0 + timer t3107 0 + timer t3109 4 + timer t3111 0 + timer t3113 60 + timer t3115 0 + timer t3117 0 + timer t3119 0 + timer t3122 10 + timer t3141 0 + subscriber-keep-in-ram 0 + bts 0 + type sysmobts + band DCS1800 + cell_identity 6969 + location_area_code 1 + base_station_id_code 63 + ms max power 0 + cell reselection hysteresis 4 + rxlev access min 0 + periodic location update 30 + radio-link-timeout 32 + channel allocator descending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + ip.access unit_id 6969 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode automatic + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 666 + nominal power 0 + max_power_red 0 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config SDCCH8 + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +mncc-int + default-codec tch-f fr + default-codec tch-h hr +nitb + subscriber-create-on-demand + subscriber-create-on-demand random 1 24 + assign-tmsi diff --git a/doc/examples/virtual/osmobts-virtual-log-disabled.cfg b/doc/examples/virtual/osmobts-virtual-log-disabled.cfg new file mode 100644 index 0000000..dce3c23 --- /dev/null +++ b/doc/examples/virtual/osmobts-virtual-log-disabled.cfg @@ -0,0 +1,46 @@ +! +! OsmoBTS (0.4.0.216-bc49-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 0 + logging color 0 + logging print category 0 + logging timestamp 0 + logging level all fatal +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +phy 0 + virtual-um net-device wlan0 + virtual-um ms-multicast-group 224.0.0.1 + virtual-um ms-udp-port 4729 + virtual-um bts-multicast-group 225.0.0.1 + virtual-um bts-udp-port 4729 + instance 0 +bts 0 + band DCS1800 + ipa unit-id 6969 0 + oml remote-ip 127.0.0.1 + rtp jitter-buffer 100 + paging queue-size 200 + paging lifetime 0 + uplink-power-target -75 + gsmtap-sapi bcch + gsmtap-sapi ccch + gsmtap-sapi rach + gsmtap-sapi pch + gsmtap-sapi tch/f + min-qual-rach 50 + min-qual-norm -5 + trx 0 + power-ramp max-initial 23000 mdBm + power-ramp step-size 2000 mdB + power-ramp step-interval 1 + ms-power-control dsp + phy 0 instance 0 diff --git a/doc/examples/virtual/osmobts-virtual.cfg b/doc/examples/virtual/osmobts-virtual.cfg new file mode 100644 index 0000000..e0af432 --- /dev/null +++ b/doc/examples/virtual/osmobts-virtual.cfg @@ -0,0 +1,104 @@ +! +! OsmoBTS (0.4.0.216-bc49-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 0 + logging color 0 + logging print category 1 + logging timestamp 0 + logging level all everything + logging level rsl debug + logging level oml debug + logging level rll error + logging level rr error + logging level meas error + logging level pag error + logging level l1c debug + logging level l1p debug + logging level dsp error + logging level pcu error + logging level ho error + logging level trx error + logging level loop error + logging level abis debug + logging level rtp error + logging level sum error + logging level lglobal error + logging level llapd error + logging level linp debug + logging level lmux error + logging level lmi error + logging level lmib error + logging level lsms error + logging level lctrl debug + logging level lgtp error + logging level lstats error +log file /home/basti/Osmocom/log-files/osmobts-vty.log + logging filter all 1 + logging color 0 + logging print category 1 + logging timestamp 1 + logging level all notice + logging level rsl info + logging level oml info + logging level rll notice + logging level rr notice + logging level meas notice + logging level pag info + logging level l1c info + logging level l1p info + logging level dsp debug + logging level pcu notice + logging level ho notice + logging level trx notice + logging level loop notice + logging level abis notice + logging level rtp notice + logging level sum notice + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats notice +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +phy 0 + virtual-um net-device wlan0 + virtual-um ms-multicast-group 224.0.0.1 + virtual-um ms-udp-port 4729 + virtual-um bts-multicast-group 225.0.0.1 + virtual-um bts-udp-port 4729 + instance 0 +bts 0 + band DCS1800 + ipa unit-id 6969 0 + oml remote-ip 127.0.0.1 + rtp jitter-buffer 100 + paging queue-size 200 + paging lifetime 0 + uplink-power-target -75 + gsmtap-sapi bcch + gsmtap-sapi ccch + gsmtap-sapi rach + gsmtap-sapi pch + gsmtap-sapi tch/f + min-qual-rach 50 + min-qual-norm -5 + trx 0 + power-ramp max-initial 23000 mdBm + power-ramp step-size 2000 mdB + power-ramp step-interval 1 + ms-power-control dsp + phy 0 instance 0 -- To view, visit https://gerrit.osmocom.org/3243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I368d4a378e20028603b09825eee766abb9195774 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:38:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:38:14 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was... Message-ID: Review at https://gerrit.osmocom.org/3244 VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was always 0. Timeslot is not encoded in the chan_nr accessible in the channel description but was taken from there and so it was always 0. Change-Id: I881a1c61ea47399c9b1385fb220cd587e3593e82 --- M src/osmo-bts-virtual/scheduler_virtbts.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/3244/1 diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index 39da689..47be6d7 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -74,6 +74,8 @@ uint8_t gsmtap_chantype; /* the GSMTAP channel */ rsl_dec_chan_nr(chdesc->chan_nr, &rsl_chantype, &subslot, ×lot); + /* the timeslot is not encoded in the chan_nr of the chdesc, and so has to be overwritten */ + timeslot = tn; /* in Osmocom, AGCH is only sent on ccch block 0. no idea why. this seems to cause false GSMTAP channel * types for agch and pch. */ if (rsl_chantype == RSL_CHAN_PCH_AGCH && L1SAP_FN2CCCHBLOCK(fn) == 0) -- To view, visit https://gerrit.osmocom.org/3244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I881a1c61ea47399c9b1385fb220cd587e3593e82 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:38:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:38:14 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Fix handling of default values for vty configuration Message-ID: Review at https://gerrit.osmocom.org/3245 VIRT-PHY: Fix handling of default values for vty configuration The defaults must be set during bts_model_phy_link_set_defaults() and can then later be overridden by the vty (from the config file). They should only be written back to the file if they differ from the default settings. Change-Id: I5d7f2c1dc8bc3d11db5c607b664730e4dcd58c96 --- M src/osmo-bts-virtual/l1_if.c M src/osmo-bts-virtual/main.c M src/osmo-bts-virtual/virtualbts_vty.c 3 files changed, 6 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/3245/1 diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index b649461..c3382d4 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -186,18 +186,6 @@ phy_link_state_set(plink, PHY_LINK_CONNECTING); - if (!plink->u.virt.bts_mcast_group) - plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; - - if (!plink->u.virt.bts_mcast_port) - plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; - - if (!plink->u.virt.ms_mcast_group) - plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; - - if (!plink->u.virt.ms_mcast_port) - plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; - plink->u.virt.virt_um = virt_um_init(plink, plink->u.virt.ms_mcast_group, plink->u.virt.ms_mcast_port, plink->u.virt.bts_mcast_group, plink->u.virt.bts_mcast_port, virt_um_rcv_cb); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index 6ceeaec..f1dc293 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -104,6 +104,10 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink) { + plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; + plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; + plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; + plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; } void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) diff --git a/src/osmo-bts-virtual/virtualbts_vty.c b/src/osmo-bts-virtual/virtualbts_vty.c index 45c1086..323222b 100644 --- a/src/osmo-bts-virtual/virtualbts_vty.c +++ b/src/osmo-bts-virtual/virtualbts_vty.c @@ -72,13 +72,13 @@ if (strcmp(plink->u.virt.ms_mcast_group, DEFAULT_BTS_MCAST_GROUP)) vty_out(vty, " virtual-um ms-multicast-group %s%s", plink->u.virt.ms_mcast_group, VTY_NEWLINE); - if (plink->u.virt.ms_mcast_port) + if (plink->u.virt.ms_mcast_port != DEFAULT_BTS_MCAST_PORT) vty_out(vty, " virtual-um ms-udp-port %u%s", plink->u.virt.ms_mcast_port, VTY_NEWLINE); if (strcmp(plink->u.virt.bts_mcast_group, DEFAULT_MS_MCAST_GROUP)) vty_out(vty, " virtual-um bts-multicast-group %s%s", plink->u.virt.bts_mcast_group, VTY_NEWLINE); - if (plink->u.virt.bts_mcast_port) + if (plink->u.virt.bts_mcast_port != DEFAULT_MS_MCAST_PORT) vty_out(vty, " virtual-um bts-udp-port %u%s", plink->u.virt.bts_mcast_port, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/3245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5d7f2c1dc8bc3d11db5c607b664730e4dcd58c96 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:38:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:38:14 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Added test option for fast hyperframe repeat. Message-ID: Review at https://gerrit.osmocom.org/3246 VIRT-PHY: Added test option for fast hyperframe repeat. Frame number will restart at 0 after each superframe (approx. 6.1 sec) if enabled. Can be enabled by preprocessor define. Change-Id: If3adf14df5fcd8daf53363c27b3772c42d7122e9 --- M src/osmo-bts-virtual/scheduler_virtbts.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/3246/1 diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index 47be6d7..19e6eb6 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -45,6 +45,8 @@ #include "virtual_um.h" #include "l1_if.h" +#define MODULO_HYPERFRAME 0 + static const char *gsmtap_hdr_stringify(const struct gsmtap_hdr *gh) { static char buf[256]; @@ -83,7 +85,13 @@ else gsmtap_chantype = chantype_rsl2gsmtap(rsl_chantype, chdesc->link_id); /* the logical channel type */ +#if MODULO_HYPERFRAME + /* Restart fn after every superframe (26 * 51 frames) to simulate hyperframe overflow each 6 seconds. */ + fn %= 26 * 51; +#endif + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chantype, subslot, fn, signal_dbm, snr, data, data_len); + if (outmsg) { struct phy_instance *pinst = trx_phy_instance(l1t->trx); struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); -- To view, visit https://gerrit.osmocom.org/3246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3adf14df5fcd8daf53363c27b3772c42d7122e9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:38:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:38:14 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Use IPv4 multicast groups for private / local scope Message-ID: Review at https://gerrit.osmocom.org/3247 VIRT-PHY: Use IPv4 multicast groups for private / local scope The addresses in the original code make little sense: * 224.0.0.1 is "All systems on this subnet" and not routed outside the local ethernet segment * 225.0.0.1 is in a RESERVED range that shouldn't be used Change-Id: Iba1ae69f3f193a33f1da343c6562f67bd8d3557f --- M src/osmo-bts-virtual/virtual_um.h 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/3247/1 diff --git a/src/osmo-bts-virtual/virtual_um.h b/src/osmo-bts-virtual/virtual_um.h index 6e7c384..ac098dd 100644 --- a/src/osmo-bts-virtual/virtual_um.h +++ b/src/osmo-bts-virtual/virtual_um.h @@ -4,10 +4,15 @@ #include #include "osmo_mcast_sock.h" +/* We use multicast group addresses from the 239.192.0.0/14 rage, as + * those are designated by RFC2365 as "IPv4 Organization Local Scope, + * "... the space from which an organization should allocate sub- + * ranges when defining scopes for private use." */ + #define VIRT_UM_MSGB_SIZE 256 -#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_GROUP "239.193.23.1" #define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ -#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_GROUP "239.193.23.2" #define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ struct virt_um_inst { -- To view, visit https://gerrit.osmocom.org/3247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba1ae69f3f193a33f1da343c6562f67bd8d3557f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:39:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:39:55 +0000 Subject: osmo-bts[master]: VIRT-PHY: Added example configurations for openbsc and osmobts. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/3243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I368d4a378e20028603b09825eee766abb9195774 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:49:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:49:31 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Initial check-in of a new virtual BTS In-Reply-To: References: Message-ID: VIRT-PHY: Initial check-in of a new virtual BTS This patch adds a virtual physical layer designed to simulate the Um air interface between BTS and MS. It does so by encapsulating MAC blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP streams, both in uplink and in downlink. The purpose of this is enable testing without any radio hardware or related licenses. OsmocomBB has recently received as similar patch-set, adding a virty_phy executable that can be run on a PC instead of the classic 'layer1' firmware on a real phone. Using GSMTAP means that one can use unmodified wireshark to decode the messages exchanged on the virtual Um layer Change-Id: I1bf7670975b1e367c1c62983020865a043542622 --- M .gitignore M configure.ac M include/osmo-bts/gsm_data.h M include/osmo-bts/phy_link.h M src/Makefile.am A src/osmo-bts-virtual/Makefile.am A src/osmo-bts-virtual/bts_model.c A src/osmo-bts-virtual/l1_if.c A src/osmo-bts-virtual/l1_if.h A src/osmo-bts-virtual/main.c A src/osmo-bts-virtual/osmo_mcast_sock.c A src/osmo-bts-virtual/osmo_mcast_sock.h A src/osmo-bts-virtual/scheduler_virtbts.c A src/osmo-bts-virtual/virtual_um.c A src/osmo-bts-virtual/virtual_um.h A src/osmo-bts-virtual/virtualbts_vty.c 16 files changed, 1,892 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/3242/2 diff --git a/.gitignore b/.gitignore index 19ca274..a8c0ece 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ src/osmo-bts-octphy/osmo-bts-octphy +src/osmo-bts-virtual/osmo-bts-virtual + tests/atconfig tests/package.m4 tests/agch/agch_test diff --git a/configure.ac b/configure.ac index 64231b3..0ceb8eb 100644 --- a/configure.ac +++ b/configure.ac @@ -178,6 +178,7 @@ AC_OUTPUT( src/Makefile src/common/Makefile + src/osmo-bts-virtual/Makefile src/osmo-bts-sysmo/Makefile src/osmo-bts-litecell15/Makefile src/osmo-bts-trx/Makefile diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index c513b27..aeac4b2 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -114,6 +114,12 @@ struct { char *sock_path; } pcu; + + struct { + uint32_t last_fn; + struct timeval tv_clock; + struct osmo_timer_list fn_timer; + } vbts; }; enum lchan_ciph_state { diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4c7ff34..d8d3c6b 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -10,11 +10,13 @@ #include "btsconfig.h" struct gsm_bts_trx; +struct virt_um_inst; enum phy_link_type { PHY_LINK_T_NONE, PHY_LINK_T_SYSMOBTS, PHY_LINK_T_OSMOTRX, + PHY_LINK_T_VIRTUAL, }; enum phy_link_state { @@ -46,6 +48,14 @@ uint32_t clock_advance; uint32_t rts_advance; } osmotrx; + struct { + char *mcast_dev; /* Network device for multicast */ + char *bts_mcast_group; /* BTS are listening to this group */ + uint16_t bts_mcast_port; + char *ms_mcast_group; /* MS are listening to this group */ + uint16_t ms_mcast_port; + struct virt_um_inst *virt_um; + } virt; struct { /* MAC address of the PHY */ struct sockaddr_ll phy_addr; @@ -99,6 +109,9 @@ bool sw_act_reported; } osmotrx; struct { + struct l1sched_trx sched; + } virt; + struct { /* logical transceiver number within one PHY */ uint32_t trx_id; /* trx lock state variable */ diff --git a/src/Makefile.am b/src/Makefile.am index e7610fe..4f3f760 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = common +SUBDIRS = common osmo-bts-virtual if ENABLE_SYSMOBTS SUBDIRS += osmo-bts-sysmo diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am new file mode 100644 index 0000000..30069d4 --- /dev/null +++ b/src/osmo-bts-virtual/Makefile.am @@ -0,0 +1,10 @@ +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -Iinclude +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) + +noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h + +bin_PROGRAMS = osmo-bts-virtual + +osmo_bts_virtual_SOURCES = main.c bts_model.c virtualbts_vty.c scheduler_virtbts.c l1_if.c virtual_um.c osmo_mcast_sock.c +osmo_bts_virtual_LDADD = $(top_builddir)/src/common/libbts.a $(top_builddir)/src/common/libl1sched.a $(COMMON_LDADD) diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c new file mode 100644 index 0000000..5293cc3 --- /dev/null +++ b/src/osmo-bts-virtual/bts_model.c @@ -0,0 +1,169 @@ +/* (C) 2015 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 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 + +/* TODO: check if dummy method is sufficient, else implement */ +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return -1; +} + +/* TODO: check if dummy method is sufficient, else implement */ +int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr, + int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) +{ + return -1; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, + struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +static uint8_t vbts_set_bts(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx; + uint8_t tn; + + llist_for_each_entry(trx, &bts->trx_list, list) { + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); + oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OK); + + for (tn = 0; tn < TRX_NR_TS; tn++) + oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); + + /* report availability of trx to the bts. this will trigger the rsl connection */ + oml_mo_tx_sw_act_rep(&trx->mo); + oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + } + return 0; +} + +static uint8_t vbts_set_trx(struct gsm_bts_trx *trx) +{ + return 0; +} + +static uint8_t vbts_set_ts(struct gsm_bts_trx_ts *ts) +{ + struct phy_instance *pinst = trx_phy_instance(ts->trx); + int rc; + + rc = trx_sched_set_pchan(&pinst->u.virt.sched, ts->nr, ts->pchan); + if (rc) + return NM_NACK_RES_NOTAVAIL; + + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, + struct tlv_parsed *new_attr, int kind, void *obj) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + int cause = 0; + + switch (foh->msg_type) { + case NM_MT_SET_BTS_ATTR: + cause = vbts_set_bts(obj); + break; + case NM_MT_SET_RADIO_ATTR: + cause = vbts_set_trx(obj); + break; + case NM_MT_SET_CHAN_ATTR: + cause = vbts_set_ts(obj); + break; + } + return oml_fom_ack_nack(msg, cause); +} + +/* MO: TS 12.21 Managed Object */ +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + int rc; + + switch (mo->obj_class) { + case NM_OC_RADIO_CARRIER: + case NM_OC_CHANNEL: + case NM_OC_SITE_MANAGER: + case NM_OC_BASEB_TRANSC: + case NM_OC_BTS: + oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); + rc = oml_mo_opstart_ack(mo); + break; + /* TODO: gprs support */ + case NM_OC_GPRS_NSE: + case NM_OC_GPRS_CELL: + case NM_OC_GPRS_NSVC: + default: + rc = oml_mo_opstart_nack(mo, NM_NACK_OBJCLASS_NOTSUPP); + } + return rc; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, + void *obj, uint8_t adm_state) +{ + mo->nm_state.administrative = adm_state; + return oml_mo_statechg_ack(mo); +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + + +int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) +{ + return 0; +} + +int bts_model_ctrl_cmds_install(struct gsm_bts *bts) +{ + return 0; +} diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c new file mode 100644 index 0000000..a931916 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.c @@ -0,0 +1,465 @@ +/* Virtual BTS layer 1 primitive handling and interface + * + * Copyright (C) 2015-2017 Harald Welte + * Copyright (C) 2017 Sebastian Stumpf + * + * 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +extern int vbts_sched_start(struct gsm_bts *bts); + +static struct phy_instance *phy_instance_by_arfcn(struct phy_link *plink, uint16_t arfcn) +{ + struct phy_instance *pinst; + + llist_for_each_entry(pinst, &plink->instances, list) { + if (pinst->trx && pinst->trx->arfcn == arfcn) + return pinst; + } + + return NULL; +} + +/** + * Callback to handle incoming messages from the MS. + * The incoming message should be GSM_TAP encapsulated. + * TODO: implement all channels + */ +static void virt_um_rcv_cb(struct virt_um_inst *vui, struct msgb *msg) +{ + struct phy_link *plink = (struct phy_link *)vui->priv; + struct gsmtap_hdr *gh = msgb_l1(msg); + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the cell we currently camp on */ + uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ + uint8_t signal_dbm = gh->signal_dbm; /* signal strength in dBm */ + //uint8_t snr = gh->snr_db; /* signal noise ratio in dB */ + uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ + uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ + struct phy_instance *pinst; + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + /* get rid of l1 gsmtap hdr */ + msg->l2h = msgb_pull(msg, sizeof(*gh)); + + /* convert gsmtap chan to RSL chan and link id */ + chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); + chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + + /* ... or not uplink */ + if (!(arfcn & GSMTAP_ARFCN_F_UPLINK)) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - no uplink flag\n"); + goto nomessage; + } + + /* Generally ignore all msgs that are either not received with the right ARFCN... */ + pinst = phy_instance_by_arfcn(plink, arfcn & GSMTAP_ARFCN_MASK); + if (!pinst) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - msg ARFCN=%d not part of BTS\n", + arfcn & GSMTAP_ARFCN_MASK); + goto nomessage; + } + + /* switch case with removed ACCH flag */ + switch ((gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH) & 0xff) { + case GSMTAP_CHANNEL_RACH: + /* generate primitive for upper layer + * see 04.08 - 3.3.1.3.1: the IMMEDIATE_ASSIGNMENT coming back from the network has to be + * sent with the same ra reference as in the CHANNEL_REQUEST that was received */ + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_RACH, PRIM_OP_INDICATION, msg); + + l1sap.u.rach_ind.chan_nr = chan_nr; + /* TODO: 11bit RACH */ + l1sap.u.rach_ind.ra = msgb_pull_u8(msg); /* directly after gh hdr comes ra */ + l1sap.u.rach_ind.acc_delay = 0; /* probably not used in virt um */ + l1sap.u.rach_ind.is_11bit = 0; + l1sap.u.rach_ind.fn = fn; + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_NONE; /* FIXME: what comes here */ + break; + case GSMTAP_CHANNEL_TCH_F: + case GSMTAP_CHANNEL_TCH_H: +#if 0 + /* TODO: handle voice messages */ + if (!facch && ! tch_acch) { + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, msg); + } +#endif + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_DATA, + PRIM_OP_INDICATION, msg); + l1sap.u.data.chan_nr = chan_nr; + l1sap.u.data.link_id = link_id; + l1sap.u.data.fn = fn; + l1sap.u.data.rssi = 0; /* Radio Signal Strength Indicator. Best -> 0 */ + l1sap.u.data.ber10k = 0; /* Bit Error Rate in 0.01%. Best -> 0 */ + l1sap.u.data.ta_offs_qbits = 0; /* Burst time of arrival in quarter bits. Probably used for Timing Advance calc. Best -> 0 */ + l1sap.u.data.lqual_cb = 10 * signal_dbm; /* Link quality in centiBel = 10 * dB. */ + l1sap.u.data.pdch_presence_info = PRES_INFO_UNKNOWN; + break; + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type downlink only!\n"); + goto nomessage; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type not supported!\n"); + goto nomessage; + default: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type unknown\n"); + goto nomessage; + } + + /* forward primitive, forwarded msg will not be freed */ +#warning "we cannot just pass a l1sap primitive on the stack!!!" + l1sap_up(pinst->trx, &l1sap); + DEBUGP(DL1P, "Message forwarded to layer 2.\n"); + return; + +nomessage: + talloc_free(msg); +} + +/* called by common part once OML link is established */ +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +/* called by bts_main to initialize physical link */ +int bts_model_phy_link_open(struct phy_link *plink) +{ + struct phy_instance *pinst; + + //OSMO_ASSERT(plink->type == PHY_LINK_T_VIRTUAL); + + if (plink->u.virt.virt_um) + virt_um_destroy(plink->u.virt.virt_um); + + phy_link_state_set(plink, PHY_LINK_CONNECTING); + + if (!plink->u.virt.bts_mcast_group) + plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; + + if (!plink->u.virt.bts_mcast_port) + plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; + + if (!plink->u.virt.ms_mcast_group) + plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; + + if (!plink->u.virt.ms_mcast_port) + plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; + + plink->u.virt.virt_um = virt_um_init(plink, plink->u.virt.ms_mcast_group, plink->u.virt.ms_mcast_port, + plink->u.virt.bts_mcast_group, plink->u.virt.bts_mcast_port, + virt_um_rcv_cb); + /* set back reference to plink */ + plink->u.virt.virt_um->priv = plink; + if (!plink->u.virt.virt_um) { + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + return -1; + } + + /* iterate over list of PHY instances and initialize the scheduler */ + llist_for_each_entry(pinst, &plink->instances, list) { + trx_sched_init(&pinst->u.virt.sched, pinst->trx); + /* Only start the scheduler for the transceiver on C0. + * If we have multiple tranceivers, CCCH is always on C0 + * and has to be auto active */ + /* Other TRX are activated via OML by a PRIM_INFO_MODIFY + * / PRIM_INFO_ACTIVATE */ + if (pinst->trx && pinst->trx == pinst->trx->bts->c0) { + vbts_sched_start(pinst->trx->bts); + /* init lapdm layer 3 callback for the trx on timeslot 0 == BCCH */ + lchan_init_lapdm(&pinst->trx->ts[0].lchan[CCCH_LCHAN]); + /* FIXME: This is probably the wrong location to set the CCCH to active... the OML link def. needs to be reworked and fixed. */ + pinst->trx->ts[0].lchan[CCCH_LCHAN].rel_act_kind = LCHAN_REL_ACT_OML; + lchan_set_state(&pinst->trx->ts[0].lchan[CCCH_LCHAN], LCHAN_S_ACTIVE); + } + } + + /* this will automatically update the MO state of all associated TRX objects */ + phy_link_state_set(plink, PHY_LINK_CONNECTED); + + return 0; +} + + +/* + * primitive handling + */ + +/* enable ciphering */ +static int l1if_set_ciphering(struct gsm_lchan *lchan, uint8_t chan_nr, int downlink) +{ + struct gsm_bts_trx *trx = lchan->ts->trx; + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + + /* ciphering already enabled in both directions */ + if (lchan->ciph_state == LCHAN_CIPH_RXTX_CONF) + return -EINVAL; + + if (!downlink) { + /* set uplink */ + trx_sched_set_cipher(sched, chan_nr, 0, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RX_CONF; + } else { + /* set downlink and also set uplink, if not already */ + if (lchan->ciph_state != LCHAN_CIPH_RX_CONF) { + trx_sched_set_cipher(sched, chan_nr, 0, + lchan->encr.alg_id - 1, lchan->encr.key, + lchan->encr.key_len); + } + trx_sched_set_cipher(sched, chan_nr, 1, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + } + + return 0; +} + +static int mph_info_chan_confirm(struct gsm_bts_trx *trx, uint8_t chan_nr, + enum osmo_mph_info_type type, uint8_t cause) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_CONFIRM, + NULL); + l1sap.u.info.type = type; + l1sap.u.info.u.act_cnf.chan_nr = chan_nr; + l1sap.u.info.u.act_cnf.cause = cause; + + return l1sap_up(trx, &l1sap); +} + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap.u.info.type = PRIM_INFO_TIME; + l1sap.u.info.u.time_ind.fn = fn; + + if (!bts->c0) + return -EINVAL; + + return l1sap_up(bts->c0, &l1sap); +} + + +static void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, + float ber, float rssi) +{ + memset(l1sap, 0, sizeof(*l1sap)); + osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap->u.info.type = PRIM_INFO_MEAS; + l1sap->u.info.u.meas_ind.chan_nr = chan_nr; + l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4); + l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000); + l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1); +} + +int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, + int n_errors, int n_bits_total, float rssi, float toa) +{ + struct gsm_lchan *lchan = &trx->ts[tn].lchan[l1sap_chan2ss(chan_nr)]; + struct osmo_phsap_prim l1sap; + /* 100% BER is n_bits_total is 0 */ + float ber = n_bits_total==0 ? 1.0 : (float)n_errors / (float)n_bits_total; + + LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS pwr=%ddBm rssi=%.1f dBFS " + "ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n", + gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), + rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); + + l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi); + + return l1sap_up(trx, &l1sap); +} + + + +/* primitive from common part */ +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + struct msgb *msg = l1sap->oph.msg; + uint8_t chan_nr; + uint8_t tn, ss; + int rc = 0; + struct gsm_lchan *lchan; + + switch (OSMO_PRIM_HDR(&l1sap->oph)) { + case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_ph_data_req(sched, l1sap); + case OSMO_PRIM(PRIM_TCH, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_tch_req(sched, l1sap); + case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_REQUEST): + switch (l1sap->u.info.type) { + case PRIM_INFO_ACT_CIPH: + chan_nr = l1sap->u.info.u.ciph_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + if (l1sap->u.info.u.ciph_req.uplink) + l1if_set_ciphering(lchan, chan_nr, 0); + if (l1sap->u.info.u.ciph_req.downlink) + l1if_set_ciphering(lchan, chan_nr, 1); + break; + case PRIM_INFO_ACTIVATE: + case PRIM_INFO_DEACTIVATE: + case PRIM_INFO_MODIFY: + chan_nr = l1sap->u.info.u.act_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + /* we receive a channel activation request from the BSC, + * e.g. as a response to a channel req on RACH */ + if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot activate" + " chan_nr 0x%02x\n", chan_nr); + break; + } + /* activate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_DEDIC, 1); + /* activate associated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_SACCH, 1); + /* set mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + (lchan->ho.active == 1)); + /* init lapdm */ + lchan_init_lapdm(lchan); + /* set lchan active */ + lchan_set_state(lchan, LCHAN_S_ACTIVE); + /* set initial ciphering */ + l1if_set_ciphering(lchan, chan_nr, 0); + l1if_set_ciphering(lchan, chan_nr, 1); + if (lchan->encr.alg_id) + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + else + lchan->ciph_state = LCHAN_CIPH_NONE; + + /* confirm */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_ACTIVATE, 0); + break; + } + if (l1sap->u.info.type == PRIM_INFO_MODIFY) { + /* change mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + 0); + break; + } + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot deactivate " + "chan_nr 0x%02x\n", chan_nr); + break; + } + /* deactivate associated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x40, 0); + if (!l1sap->u.info.u.act_req.sacch_only) { + /* set lchan inactive */ + lchan_set_state(lchan, LCHAN_S_NONE); + /* deactivate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x00, 0); + /* confirm only on dedicated channel */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_DEACTIVATE, 0); + lchan->ciph_state = 0; /* FIXME: do this in common/\*.c */ + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown MPH-INFO.req %d\n", + l1sap->u.info.type); + rc = -EINVAL; + goto done; + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d\n", + l1sap->oph.primitive, l1sap->oph.operation); + rc = -EINVAL; + goto done; + } + +done: + if (msg) + msgb_free(msg); + return rc; +} diff --git a/src/osmo-bts-virtual/l1_if.h b/src/osmo-bts-virtual/l1_if.h new file mode 100644 index 0000000..6a843b3 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +#include "virtual_um.h" + +struct vbts_l1h { + struct gsm_bts_trx *trx; + struct l1sched_trx l1s; + struct virt_um_inst *virt_um; +}; + +struct vbts_l1h *l1if_open(struct gsm_bts_trx *trx); +void l1if_close(struct vbts_l1h *l1h); +void l1if_reset(struct vbts_l1h *l1h); + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn); + +int vbts_sched_start(struct gsm_bts *bts); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c new file mode 100644 index 0000000..6ceeaec --- /dev/null +++ b/src/osmo-bts-virtual/main.c @@ -0,0 +1,126 @@ +/* Main program for Virtual OsmoBTS */ + +/* (C) 2015 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 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +/* dummy, since no direct dsp support */ +uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb; + + btsb = bts_role_bts(bts); + btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + + bts_model_vty_init(bts); + + return 0; +} + +void bts_model_print_help() +{ +} + +int bts_model_handle_options(int argc, char **argv) +{ + int num_errors = 0; + + while (1) { + int option_idx = 0, c; + static const struct option long_options[] = { + /* specific to this hardware */ + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "", + long_options, &option_idx); + if (c == -1) + break; + + switch (c) { + default: + num_errors++; + break; + } + } + + return num_errors; +} + +void bts_model_abis_close(struct gsm_bts *bts) +{ + /* for now, we simply terminate the program and re-spawn */ + bts_shutdown(bts, "Abis close"); +} + +void bts_model_phy_link_set_defaults(struct phy_link *plink) +{ +} + +void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) +{ +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} + +int main(int argc, char **argv) +{ + return bts_main(argc, argv); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.c b/src/osmo-bts-virtual/osmo_mcast_sock.c new file mode 100644 index 0000000..f092a73 --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.c @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "osmo_mcast_sock.h" + +/* server socket is what we use for transmission. It is not subscribed + * to a multicast group or locally bound, but it is just a normal UDP + * socket that's connected to the remote mcast group + port */ +int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, + uint16_t tx_mcast_port, bool loopback) +{ + int rc; + unsigned int flags = OSMO_SOCK_F_CONNECT; + + if (!loopback) + flags |= OSMO_SOCK_F_NO_MCAST_LOOP; + + /* setup mcast server socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + tx_mcast_group, tx_mcast_port, flags); + if (rc < 0) { + perror("Failed to create Multicast Server Socket"); + return rc; + } + + return 0; +} + +/* the client socket is what we use for reception. It is a UDP socket + * that's bound to the GSMTAP UDP port and subscribed to the respective + * multicast group */ +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + int rc; + + ofd->cb = fd_rx_cb; + ofd->when = BSC_FD_READ; + ofd->data = osmo_fd_data; + + /* Create mcast client socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + NULL, mcast_port, OSMO_SOCK_F_BIND|OSMO_SOCK_F_NO_MCAST_ALL); + if (rc < 0) { + perror("Could not create mcast client socket"); + return rc; + } + + /* Configure and join the multicast group */ + rc = osmo_sock_mcast_subscribe(ofd->fd, mcast_group); + if (rc < 0) { + perror("Failed to join to mcast goup"); + osmo_fd_close(ofd); + return rc; + } + + return 0; +} + +struct mcast_bidir_sock * +mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_bidir_sock *bidir_sock = talloc(ctx, struct mcast_bidir_sock); + int rc; + + if (!bidir_sock) + return NULL; + + rc = mcast_client_sock_setup(&bidir_sock->rx_ofd, rx_mcast_group, rx_mcast_port, + fd_rx_cb, osmo_fd_data); + if (rc < 0) { + talloc_free(bidir_sock); + return NULL; + } + rc = mcast_server_sock_setup(&bidir_sock->tx_ofd, tx_mcast_group, tx_mcast_port, loopback); + if (rc < 0) { + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); + return NULL; + } + return bidir_sock; + +} + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, + unsigned int data_len) +{ + return send(bidir_sock->tx_ofd.fd, data, data_len, 0); +} + +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len) +{ + return recv(bidir_sock->rx_ofd.fd, buf, buf_len, 0); +} + +void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) +{ + osmo_fd_close(&bidir_sock->tx_ofd); + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.h b/src/osmo-bts-virtual/osmo_mcast_sock.h new file mode 100644 index 0000000..aa2013c --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include +#include + +struct mcast_bidir_sock { + struct osmo_fd tx_ofd; + struct osmo_fd rx_ofd; +}; + +struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx, + const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group, + uint16_t tx_mcast_port, bool loopback); + +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, unsigned int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len); +void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); + diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c new file mode 100644 index 0000000..39da689 --- /dev/null +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -0,0 +1,635 @@ +/* Scheduler worker functiosn for Virtua OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * + * 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 +#include +#include "virtual_um.h" +#include "l1_if.h" + +static const char *gsmtap_hdr_stringify(const struct gsmtap_hdr *gh) +{ + static char buf[256]; + snprintf(buf, sizeof(buf), "(ARFCN=%u, ts=%u, ss=%u, type=%u/%u)", + gh->arfcn & GSMTAP_ARFCN_MASK, gh->timeslot, gh->sub_slot, gh->type, gh->sub_type); + return buf; +} + +/** + * Send a message over the virtual um interface. + * This will at first wrap the msg with a GSMTAP header and then write it to the declared multicast socket. + * TODO: we might want to remove unused argument uint8_t tn + */ +static void tx_to_virt_um(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, struct msgb *msg) +{ + const struct trx_chan_desc *chdesc = &trx_chan_desc[chan]; + struct msgb *outmsg; /* msg to send with gsmtap header prepended */ + uint16_t arfcn = l1t->trx->arfcn; /* ARFCN of the tranceiver the message is send with */ + uint8_t signal_dbm = 63; /* signal strength, 63 is best */ + uint8_t snr = 63; /* signal noise ratio, 63 is best */ + uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ + uint8_t data_len = msgb_l2len(msg); /* length of data */ + uint8_t rsl_chantype; /* RSL chan type (TS 08.58, 9.3.1) */ + uint8_t subslot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot; /* TDMA timeslot to send in (0-7) */ + uint8_t gsmtap_chantype; /* the GSMTAP channel */ + + rsl_dec_chan_nr(chdesc->chan_nr, &rsl_chantype, &subslot, ×lot); + /* in Osmocom, AGCH is only sent on ccch block 0. no idea why. this seems to cause false GSMTAP channel + * types for agch and pch. */ + if (rsl_chantype == RSL_CHAN_PCH_AGCH && L1SAP_FN2CCCHBLOCK(fn) == 0) + gsmtap_chantype = GSMTAP_CHANNEL_PCH; + else + gsmtap_chantype = chantype_rsl2gsmtap(rsl_chantype, chdesc->link_id); /* the logical channel type */ + + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chantype, subslot, fn, signal_dbm, snr, data, data_len); + if (outmsg) { + struct phy_instance *pinst = trx_phy_instance(l1t->trx); + struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); + + if (virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg) == -1) + LOGP(DL1P, LOGL_ERROR, "%s GSMTAP msg could not send to virtual Um\n", gsmtap_hdr_stringify(gh)); + else + DEBUGP(DL1C, "%s Sending GSMTAP message to virtual Um\n", gsmtap_hdr_stringify(gh)); + } else + LOGP(DL1C, LOGL_ERROR, "GSMTAP msg could not be created!\n"); + + /* free incoming message */ + msgb_free(msg); +} + +/* + * TX on downlink + */ + +/* an IDLE burst returns nothing. on C0 it is replaced by dummy burst */ +ubit_t *tx_idle_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_fcch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_sch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg; + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + /* check validity of message */ + if (msgb_l2len(msg) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg)); + /* free message */ + msgb_free(msg); + return NULL; + } + + /* transmit the msg received on dl from bsc to layer1 (virt Um) */ + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +ubit_t *tx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg = NULL; /* make GCC happy */ + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +static void tx_tch_common(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, struct msgb **_msg_tch, + struct msgb **_msg_facch, int codec_mode_request) +{ + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct msgb *msg1, *msg2, *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + uint8_t rsl_cmode = chan_state->rsl_cmode; + uint8_t tch_mode = chan_state->tch_mode; + struct osmo_phsap_prim *l1sap; +#if 0 + /* handle loss detection of received TCH frames */ + if (rsl_cmode == RSL_CMOD_SPD_SPEECH + && ++(chan_state->lost) > 5) { + uint8_t tch_data[GSM_FR_BYTES]; + int len; + + LOGP(DL1P, LOGL_NOTICE, "Missing TCH bursts detected, sending " + "BFI for %s\n", trx_chan_desc[chan].name); + + /* indicate bad frame */ + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + tch_data[0] = 0x70; /* F = 0, FT = 111 */ + memset(tch_data + 1, 0, 14); + len = 15; + break; + } + memset(tch_data, 0, GSM_FR_BYTES); + len = GSM_FR_BYTES; + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode1; + memset(tch_data, 0, GSM_EFR_BYTES); + len = GSM_EFR_BYTES; + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ + len = amr_compose_payload(tch_data, + chan_state->codec[chan_state->dl_cmr], + chan_state->codec[chan_state->dl_ft], 1); + if (len < 2) + break; + memset(tch_data + 2, 0, len - 2); + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + break; + default: +inval_mode1: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + len = 0; + } + if (len) + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + } +#endif + + /* get frame and unlink from queue */ + msg1 = _sched_dequeue_prim(l1t, tn, fn, chan); + msg2 = _sched_dequeue_prim(l1t, tn, fn, chan); + if (msg1) { + l1sap = msgb_l1sap_prim(msg1); + if (l1sap->oph.primitive == PRIM_TCH) { + msg_tch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "TCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_facch = msg2; + } + } else { + msg_facch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive != PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "FACCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_tch = msg2; + } + } + } else if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) + msg_tch = msg2; + else + msg_facch = msg2; + } + + /* check validity of message */ + if (msg_facch && msgb_l2len(msg_facch) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg_facch)); + /* free message */ + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* check validity of message, get AMR ft and cmr */ + if (!msg_facch && msg_tch) { + int len; +#if 0 + uint8_t bfi, cmr_codec, ft_codec; + int cmr, ft, i; +#endif + + if (rsl_cmode != RSL_CMOD_SPD_SPEECH) { + LOGP(DL1P, LOGL_NOTICE, "%s Dropping speech frame, " + "because we are not in speech mode trx=%u " + "ts=%u at fn=%u.\n", trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + len = 15; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] & 0xf0) != 0x00) { + LOGP(DL1P, LOGL_NOTICE, "%s " + "Transmitting 'bad " + "HR frame' trx=%u ts=%u at " + "fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + } + len = GSM_FR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xd) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "FR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode2; + len = GSM_EFR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xc) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "EFR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ +#if 0 + len = amr_decompose_payload(msg_tch->l2h, + msgb_l2len(msg_tch), &cmr_codec, &ft_codec, + &bfi); + cmr = -1; + ft = -1; + for (i = 0; i < chan_state->codecs; i++) { + if (chan_state->codec[i] == cmr_codec) + cmr = i; + if (chan_state->codec[i] == ft_codec) + ft = i; + } + if (cmr >= 0) { /* new request */ + chan_state->dl_cmr = cmr; + /* disable AMR loop */ + trx_loop_amr_set(chan_state, 0); + } else { + /* enable AMR loop */ + trx_loop_amr_set(chan_state, 1); + } + if (ft < 0) { + LOGP(DL1P, LOGL_ERROR, "%s Codec (FT = %d) " + " of RTP frame not in list. " + "trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + if (codec_mode_request && chan_state->dl_ft != ft) { + LOGP(DL1P, LOGL_NOTICE, "%s Codec (FT = %d) " + " of RTP cannot be changed now, but in " + "next frame. trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + chan_state->dl_ft = ft; + if (bfi) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "AMR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } +#else + LOGP(DL1P, LOGL_ERROR, "AMR not supported!\n"); + goto free_bad_msg; +#endif + break; + default: +inval_mode2: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + goto free_bad_msg; + } + if (len < 0) { + LOGP(DL1P, LOGL_ERROR, "Cannot send invalid AMR " + "payload\n"); + goto free_bad_msg; + } + if (msgb_l2len(msg_tch) != len) { + LOGP(DL1P, LOGL_ERROR, "Cannot send payload with " + "invalid length! (expecing %d, received %d)\n", + len, msgb_l2len(msg_tch)); +free_bad_msg: + /* free message */ + msgb_free(msg_tch); + msg_tch = NULL; + goto send_frame; + } + } + +send_frame: + *_msg_tch = msg_tch; + *_msg_facch = msg_facch; +} + +ubit_t *tx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + + if (bid > 0) + return NULL; + + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* no message at all */ + if (!msg_tch && !msg_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + + return NULL; +} + +ubit_t *tx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + //uint8_t tch_mode = chan_state->tch_mode; + + /* send burst, if we already got a frame */ + if (bid > 0) + return NULL; + + /* get TCH and/or FACCH */ + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* check for FACCH alignment */ + if (msg_facch && ((((fn + 4) % 26) >> 2) & 1)) { + LOGP(DL1P, LOGL_ERROR, "%s Cannot transmit FACCH starting on " + "even frames, please fix RTS!\n", + trx_chan_desc[chan].name); + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* no message at all */ + if (!msg_tch && !msg_facch && !chan_state->dl_ongoing_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + return NULL; +} + + +/*********************************************************************** + * RX on uplink (indication to upper layer) + ***********************************************************************/ + +/* we don't use those functions, as we feed the MAC frames from GSMTAP + * directly into the L1SAP, bypassing the TDMA multiplex logic oriented + * towards receiving bursts */ + +int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +/*! \brief a single burst was received by the PHY, process it */ +int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +void _sched_act_rach_det(struct l1sched_trx *l1t, uint8_t tn, uint8_t ss, int activate) +{ +} + +/*********************************************************************** + * main scheduler function + ***********************************************************************/ + +#define RTS_ADVANCE 5 /* about 20ms */ +#define FRAME_DURATION_uS 4615 + +static int vbts_sched_fn(struct gsm_bts *bts, uint32_t fn) +{ + struct gsm_bts_trx *trx; + + /* send time indication */ + /* update model with new frame number, lot of stuff happening, measurements of timeslots */ + /* saving GSM time in BTS model, and more */ + l1if_mph_time_ind(bts, fn); + + /* advance the frame number? */ + llist_for_each_entry(trx, &bts->trx_list, list) { + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *l1t = &pinst->u.virt.sched; + int tn; + uint16_t nbits; + + /* do for each of the 8 timeslots */ + for (tn = 0; tn < ARRAY_SIZE(l1t->ts); tn++) { + /* Generate RTS indication to higher layers */ + /* This will basically do 2 things (check l1_if:bts_model_l1sap_down): + * 1) Get pending messages from layer 2 (from the lapdm queue) + * 2) Process the messages + * --> Handle and process non-transparent RSL-Messages (activate channel, ) + * --> Forward transparent RSL-DATA-Messages to the ms by appending them to + * the l1-dl-queue */ + _sched_rts(l1t, tn, (fn + RTS_ADVANCE) % GSM_HYPERFRAME); + /* schedule transmit backend functions */ + /* Process data in the l1-dlqueue and forward it + * to MS */ + /* the returned bits are not used here, the routines called will directly forward their + * bits to the virt Um */ + _sched_dl_burst(l1t, tn, fn, &nbits); + } + } + + return 0; +} + +static void vbts_fn_timer_cb(void *data) +{ + struct gsm_bts *bts = data; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + struct timeval tv_now; + struct timeval *tv_clock = &btsb->vbts.tv_clock; + int32_t elapsed_us; + + gettimeofday(&tv_now, NULL); + + /* check how much time elapsed till the last timer callback call. + * this value should be about 4.615 ms (a bit greater) as this is the scheduling interval */ + elapsed_us = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 + + (tv_now.tv_usec - tv_clock->tv_usec); + + /* not so good somehow a lot of time passed between two timer callbacks */ + if (elapsed_us > 2 *FRAME_DURATION_uS) + LOGP(DL1P, LOGL_NOTICE, "vbts_fn_timer_cb after %d us\n", elapsed_us); + + /* schedule the current frame/s (fn = frame number) + * this loop will be called at least once, but can also be executed + * multiple times if more than one frame duration (4615us) passed till the last callback */ + while (elapsed_us > FRAME_DURATION_uS / 2) { + const struct timeval tv_frame = { + .tv_sec = 0, + .tv_usec = FRAME_DURATION_uS, + }; + timeradd(tv_clock, &tv_frame, tv_clock); + /* increment the frame number in the BTS model instance */ + btsb->vbts.last_fn = (btsb->vbts.last_fn + 1) % GSM_HYPERFRAME; + vbts_sched_fn(bts, btsb->vbts.last_fn); + elapsed_us -= FRAME_DURATION_uS; + } + + /* re-schedule the timer */ + /* timer is set to frame duration - elapsed time to guarantee that this cb method will be + * periodically executed every 4.615ms */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS - elapsed_us); +} + +int vbts_sched_start(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + + LOGP(DL1P, LOGL_NOTICE, "starting VBTS scheduler\n"); + + memset(&btsb->vbts.fn_timer, 0, sizeof(btsb->vbts.fn_timer)); + btsb->vbts.fn_timer.cb = vbts_fn_timer_cb; + btsb->vbts.fn_timer.data = bts; + + gettimeofday(&btsb->vbts.tv_clock, NULL); + /* trigger the first timer after 4615us (a frame duration) */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS); + + return 0; +} diff --git a/src/osmo-bts-virtual/virtual_um.c b/src/osmo-bts-virtual/virtual_um.c new file mode 100644 index 0000000..e6b9615 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.c @@ -0,0 +1,92 @@ +/* Routines for a Virtual Um interface over GSMTAP/UDP */ + +/* (C) 2015 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 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 "osmo_mcast_sock.h" +#include "virtual_um.h" +#include + +/** + * Virtual UM interface file descriptor callback. + * Should be called by select.c when the fd is ready for reading. + */ +static int virt_um_fd_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct virt_um_inst *vui = ofd->data; + + if (what & BSC_FD_READ) { + struct msgb *msg = msgb_alloc(VIRT_UM_MSGB_SIZE, "Virtual UM Rx"); + int rc; + + /* read message from fd into message buffer */ + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + if (rc > 0) { + msgb_put(msg, rc); + msg->l1h = msgb_data(msg); + /* call the l1 callback function for a received msg */ + vui->recv_cb(vui, msg); + } else { + /* FIXME: this kind of error handling might be a bit harsh */ + vui->recv_cb(vui, NULL); + osmo_fd_close(ofd); + } + } + + return 0; +} + +struct virt_um_inst *virt_um_init(void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) +{ + struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, + rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->recv_cb = recv_cb; + + return vui; + +} + +void virt_um_destroy(struct virt_um_inst *vui) +{ + mcast_bidir_sock_close(vui->mcast_sock); + talloc_free(vui); +} + +/** + * Write msg to to multicast socket and free msg afterwards + */ +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg) +{ + int rc; + + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), + msgb_length(msg)); + msgb_free(msg); + + return rc; +} diff --git a/src/osmo-bts-virtual/virtual_um.h b/src/osmo-bts-virtual/virtual_um.h new file mode 100644 index 0000000..6e7c384 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include "osmo_mcast_sock.h" + +#define VIRT_UM_MSGB_SIZE 256 +#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ +#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ + +struct virt_um_inst { + void *priv; + struct mcast_bidir_sock *mcast_sock; + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); +}; + +struct virt_um_inst *virt_um_init( + void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); + +void virt_um_destroy(struct virt_um_inst *vui); + +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg); diff --git a/src/osmo-bts-virtual/virtualbts_vty.c b/src/osmo-bts-virtual/virtualbts_vty.c new file mode 100644 index 0000000..45c1086 --- /dev/null +++ b/src/osmo-bts-virtual/virtualbts_vty.c @@ -0,0 +1,185 @@ +/* VTY interface for virtual OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * 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 +#include +#include +#include "virtual_um.h" + +#define TRX_STR "Transceiver related commands\n" "TRX number\n" + +#define SHOW_TRX_STR \ + SHOW_STR \ + TRX_STR + +static struct gsm_bts *vty_bts; + +void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) +{ +} + +void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) +{ +} + +void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) +{ +} + +void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) +{ + if (plink->u.virt.mcast_dev) + vty_out(vty, " virtual-um net-device %s%s", + plink->u.virt.mcast_dev, VTY_NEWLINE); + if (strcmp(plink->u.virt.ms_mcast_group, DEFAULT_BTS_MCAST_GROUP)) + vty_out(vty, " virtual-um ms-multicast-group %s%s", + plink->u.virt.ms_mcast_group, VTY_NEWLINE); + if (plink->u.virt.ms_mcast_port) + vty_out(vty, " virtual-um ms-udp-port %u%s", + plink->u.virt.ms_mcast_port, VTY_NEWLINE); + if (strcmp(plink->u.virt.bts_mcast_group, DEFAULT_MS_MCAST_GROUP)) + vty_out(vty, " virtual-um bts-multicast-group %s%s", + plink->u.virt.bts_mcast_group, VTY_NEWLINE); + if (plink->u.virt.bts_mcast_port) + vty_out(vty, " virtual-um bts-udp-port %u%s", + plink->u.virt.bts_mcast_port, VTY_NEWLINE); + +} + +#define VUM_STR "Virtual Um layer\n" + +DEFUN(cfg_phy_ms_mcast_group, cfg_phy_ms_mcast_group_cmd, + "virtual-um ms-multicast-group GROUP", + VUM_STR "Configure the MS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.ms_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_ms_mcast_port, cfg_phy_ms_mcast_port_cmd, + "virtual-um ms-udp-port <0-65535>", + VUM_STR "Configure the MS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.ms_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_group, cfg_phy_bts_mcast_group_cmd, + "virtual-um bts-multicast-group GROUP", + VUM_STR "Configure the BTS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.bts_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_port, cfg_phy_bts_mcast_port_cmd, + "virtual-um bts-udp-port <0-65535>", + VUM_STR "Configure the BTS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.bts_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_mcast_dev, cfg_phy_mcast_dev_cmd, + "virtual-um net-device NETDEV", + VUM_STR "Configure the network device\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.mcast_dev, argv[0]); + + return CMD_SUCCESS; +} + +int bts_model_vty_init(struct gsm_bts *bts) +{ + vty_bts = bts; + + install_element(PHY_NODE, &cfg_phy_ms_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_ms_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_mcast_dev_cmd); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1bf7670975b1e367c1c62983020865a043542622 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 16:49:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 16:49:31 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Added example configurations for openbsc and osmobts. In-Reply-To: References: Message-ID: VIRT-PHY: Added example configurations for openbsc and osmobts. Change-Id: I368d4a378e20028603b09825eee766abb9195774 --- M Makefile.am A doc/examples/virtual/openbsc-virtual.cfg A doc/examples/virtual/osmobts-virtual.cfg 3 files changed, 216 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/3243/2 diff --git a/Makefile.am b/Makefile.am index 0f85151..942825f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,9 @@ contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmobts-mgr.cfg \ + doc/examples/virtual/openbsc-virtual.cfg \ + doc/examples/virtual/osmobts-virtual.cfg \ + doc/examples/virtual/osmobts-virtual-log-disabled.cfg \ README.md @RELMAKE@ diff --git a/doc/examples/virtual/openbsc-virtual.cfg b/doc/examples/virtual/openbsc-virtual.cfg new file mode 100644 index 0000000..8044fa8 --- /dev/null +++ b/doc/examples/virtual/openbsc-virtual.cfg @@ -0,0 +1,151 @@ +! +! OpenBSC (0.15.0.629-34f0-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 0 + logging print category 1 + logging timestamp 1 + logging level all info + logging level rll notice + logging level cc notice + logging level mm debug + logging level rr notice + logging level rsl notice + logging level nm info + logging level mncc notice + logging level pag notice + logging level meas notice + logging level sccp notice + logging level msc notice + logging level mgcp notice + logging level ho notice + logging level db notice + logging level ref notice + logging level gprs debug + logging level ns info + logging level bssgp debug + logging level llc debug + logging level sndcp debug + logging level nat notice + logging level ctrl notice + logging level smpp debug + logging level filter debug + logging level ranap debug + logging level sua debug + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats notice + logging level lgsup notice + logging level loap notice +! +stats interval 5 +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +network + network country code 262 + mobile network code 42 + short name OpenBSC + long name OpenBSC + auth policy accept-all + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + neci 1 + paging any use tch 0 + rrlp mode ms-based + mm info 1 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + timer t3101 10 + timer t3103 0 + timer t3105 0 + timer t3107 0 + timer t3109 4 + timer t3111 0 + timer t3113 60 + timer t3115 0 + timer t3117 0 + timer t3119 0 + timer t3122 10 + timer t3141 0 + subscriber-keep-in-ram 0 + bts 0 + type sysmobts + band DCS1800 + cell_identity 6969 + location_area_code 1 + base_station_id_code 63 + ms max power 0 + cell reselection hysteresis 4 + rxlev access min 0 + periodic location update 30 + radio-link-timeout 32 + channel allocator descending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + ip.access unit_id 6969 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode automatic + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 666 + nominal power 0 + max_power_red 0 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config SDCCH8 + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +mncc-int + default-codec tch-f fr + default-codec tch-h hr +nitb + subscriber-create-on-demand + subscriber-create-on-demand random 1 24 + assign-tmsi diff --git a/doc/examples/virtual/osmobts-virtual.cfg b/doc/examples/virtual/osmobts-virtual.cfg new file mode 100644 index 0000000..5526e08 --- /dev/null +++ b/doc/examples/virtual/osmobts-virtual.cfg @@ -0,0 +1,62 @@ +! +! OsmoBTS (0.4.0.216-bc49-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 0 + logging color 0 + logging print category 1 + logging timestamp 0 + logging level all everything + logging level rsl info + logging level oml info + logging level rll notice + logging level rr notice + logging level meas notice + logging level pag info + logging level l1c info + logging level l1p info + logging level dsp error + logging level pcu notice + logging level ho debug + logging level trx notice + logging level loop notice + logging level abis debug + logging level rtp notice + logging level sum error + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats error +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +phy 0 + instance 0 +bts 0 + band DCS1800 + ipa unit-id 6969 0 + oml remote-ip 127.0.0.1 + rtp jitter-buffer 100 + paging queue-size 200 + paging lifetime 0 + uplink-power-target -75 + min-qual-rach 50 + min-qual-norm -5 + trx 0 + power-ramp max-initial 23000 mdBm + power-ramp step-size 2000 mdB + power-ramp step-interval 1 + ms-power-control dsp + phy 0 instance 0 -- To view, visit https://gerrit.osmocom.org/3243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I368d4a378e20028603b09825eee766abb9195774 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 18:52:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 18:52:15 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Initial check-in of a new virtual BTS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3242 to look at the new patch set (#3). VIRT-PHY: Initial check-in of a new virtual BTS This patch adds a virtual physical layer designed to simulate the Um air interface between BTS and MS. It does so by encapsulating MAC blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP streams, both in uplink and in downlink. The purpose of this is enable testing without any radio hardware or related licenses. OsmocomBB has recently received as similar patch-set, adding a virty_phy executable that can be run on a PC instead of the classic 'layer1' firmware on a real phone. Using GSMTAP means that one can use unmodified wireshark to decode the messages exchanged on the virtual Um layer Change-Id: I1bf7670975b1e367c1c62983020865a043542622 --- M .gitignore M configure.ac M include/osmo-bts/gsm_data.h M include/osmo-bts/phy_link.h M src/Makefile.am A src/osmo-bts-virtual/Makefile.am A src/osmo-bts-virtual/bts_model.c A src/osmo-bts-virtual/l1_if.c A src/osmo-bts-virtual/l1_if.h A src/osmo-bts-virtual/main.c A src/osmo-bts-virtual/osmo_mcast_sock.c A src/osmo-bts-virtual/osmo_mcast_sock.h A src/osmo-bts-virtual/scheduler_virtbts.c A src/osmo-bts-virtual/virtual_um.c A src/osmo-bts-virtual/virtual_um.h A src/osmo-bts-virtual/virtualbts_vty.c 16 files changed, 1,890 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/3242/3 diff --git a/.gitignore b/.gitignore index 19ca274..a8c0ece 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ src/osmo-bts-octphy/osmo-bts-octphy +src/osmo-bts-virtual/osmo-bts-virtual + tests/atconfig tests/package.m4 tests/agch/agch_test diff --git a/configure.ac b/configure.ac index 64231b3..0ceb8eb 100644 --- a/configure.ac +++ b/configure.ac @@ -178,6 +178,7 @@ AC_OUTPUT( src/Makefile src/common/Makefile + src/osmo-bts-virtual/Makefile src/osmo-bts-sysmo/Makefile src/osmo-bts-litecell15/Makefile src/osmo-bts-trx/Makefile diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index c513b27..aeac4b2 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -114,6 +114,12 @@ struct { char *sock_path; } pcu; + + struct { + uint32_t last_fn; + struct timeval tv_clock; + struct osmo_timer_list fn_timer; + } vbts; }; enum lchan_ciph_state { diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4c7ff34..d8d3c6b 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -10,11 +10,13 @@ #include "btsconfig.h" struct gsm_bts_trx; +struct virt_um_inst; enum phy_link_type { PHY_LINK_T_NONE, PHY_LINK_T_SYSMOBTS, PHY_LINK_T_OSMOTRX, + PHY_LINK_T_VIRTUAL, }; enum phy_link_state { @@ -46,6 +48,14 @@ uint32_t clock_advance; uint32_t rts_advance; } osmotrx; + struct { + char *mcast_dev; /* Network device for multicast */ + char *bts_mcast_group; /* BTS are listening to this group */ + uint16_t bts_mcast_port; + char *ms_mcast_group; /* MS are listening to this group */ + uint16_t ms_mcast_port; + struct virt_um_inst *virt_um; + } virt; struct { /* MAC address of the PHY */ struct sockaddr_ll phy_addr; @@ -99,6 +109,9 @@ bool sw_act_reported; } osmotrx; struct { + struct l1sched_trx sched; + } virt; + struct { /* logical transceiver number within one PHY */ uint32_t trx_id; /* trx lock state variable */ diff --git a/src/Makefile.am b/src/Makefile.am index e7610fe..4f3f760 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = common +SUBDIRS = common osmo-bts-virtual if ENABLE_SYSMOBTS SUBDIRS += osmo-bts-sysmo diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am new file mode 100644 index 0000000..30069d4 --- /dev/null +++ b/src/osmo-bts-virtual/Makefile.am @@ -0,0 +1,10 @@ +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -Iinclude +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) + +noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h + +bin_PROGRAMS = osmo-bts-virtual + +osmo_bts_virtual_SOURCES = main.c bts_model.c virtualbts_vty.c scheduler_virtbts.c l1_if.c virtual_um.c osmo_mcast_sock.c +osmo_bts_virtual_LDADD = $(top_builddir)/src/common/libbts.a $(top_builddir)/src/common/libl1sched.a $(COMMON_LDADD) diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c new file mode 100644 index 0000000..5293cc3 --- /dev/null +++ b/src/osmo-bts-virtual/bts_model.c @@ -0,0 +1,169 @@ +/* (C) 2015 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 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 + +/* TODO: check if dummy method is sufficient, else implement */ +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return -1; +} + +/* TODO: check if dummy method is sufficient, else implement */ +int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr, + int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) +{ + return -1; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, + struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +static uint8_t vbts_set_bts(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx; + uint8_t tn; + + llist_for_each_entry(trx, &bts->trx_list, list) { + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); + oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OK); + + for (tn = 0; tn < TRX_NR_TS; tn++) + oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); + + /* report availability of trx to the bts. this will trigger the rsl connection */ + oml_mo_tx_sw_act_rep(&trx->mo); + oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + } + return 0; +} + +static uint8_t vbts_set_trx(struct gsm_bts_trx *trx) +{ + return 0; +} + +static uint8_t vbts_set_ts(struct gsm_bts_trx_ts *ts) +{ + struct phy_instance *pinst = trx_phy_instance(ts->trx); + int rc; + + rc = trx_sched_set_pchan(&pinst->u.virt.sched, ts->nr, ts->pchan); + if (rc) + return NM_NACK_RES_NOTAVAIL; + + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, + struct tlv_parsed *new_attr, int kind, void *obj) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + int cause = 0; + + switch (foh->msg_type) { + case NM_MT_SET_BTS_ATTR: + cause = vbts_set_bts(obj); + break; + case NM_MT_SET_RADIO_ATTR: + cause = vbts_set_trx(obj); + break; + case NM_MT_SET_CHAN_ATTR: + cause = vbts_set_ts(obj); + break; + } + return oml_fom_ack_nack(msg, cause); +} + +/* MO: TS 12.21 Managed Object */ +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + int rc; + + switch (mo->obj_class) { + case NM_OC_RADIO_CARRIER: + case NM_OC_CHANNEL: + case NM_OC_SITE_MANAGER: + case NM_OC_BASEB_TRANSC: + case NM_OC_BTS: + oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); + rc = oml_mo_opstart_ack(mo); + break; + /* TODO: gprs support */ + case NM_OC_GPRS_NSE: + case NM_OC_GPRS_CELL: + case NM_OC_GPRS_NSVC: + default: + rc = oml_mo_opstart_nack(mo, NM_NACK_OBJCLASS_NOTSUPP); + } + return rc; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, + void *obj, uint8_t adm_state) +{ + mo->nm_state.administrative = adm_state; + return oml_mo_statechg_ack(mo); +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + + +int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) +{ + return 0; +} + +int bts_model_ctrl_cmds_install(struct gsm_bts *bts) +{ + return 0; +} diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c new file mode 100644 index 0000000..a931916 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.c @@ -0,0 +1,465 @@ +/* Virtual BTS layer 1 primitive handling and interface + * + * Copyright (C) 2015-2017 Harald Welte + * Copyright (C) 2017 Sebastian Stumpf + * + * 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +extern int vbts_sched_start(struct gsm_bts *bts); + +static struct phy_instance *phy_instance_by_arfcn(struct phy_link *plink, uint16_t arfcn) +{ + struct phy_instance *pinst; + + llist_for_each_entry(pinst, &plink->instances, list) { + if (pinst->trx && pinst->trx->arfcn == arfcn) + return pinst; + } + + return NULL; +} + +/** + * Callback to handle incoming messages from the MS. + * The incoming message should be GSM_TAP encapsulated. + * TODO: implement all channels + */ +static void virt_um_rcv_cb(struct virt_um_inst *vui, struct msgb *msg) +{ + struct phy_link *plink = (struct phy_link *)vui->priv; + struct gsmtap_hdr *gh = msgb_l1(msg); + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the cell we currently camp on */ + uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ + uint8_t signal_dbm = gh->signal_dbm; /* signal strength in dBm */ + //uint8_t snr = gh->snr_db; /* signal noise ratio in dB */ + uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ + uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ + struct phy_instance *pinst; + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + /* get rid of l1 gsmtap hdr */ + msg->l2h = msgb_pull(msg, sizeof(*gh)); + + /* convert gsmtap chan to RSL chan and link id */ + chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); + chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + + /* ... or not uplink */ + if (!(arfcn & GSMTAP_ARFCN_F_UPLINK)) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - no uplink flag\n"); + goto nomessage; + } + + /* Generally ignore all msgs that are either not received with the right ARFCN... */ + pinst = phy_instance_by_arfcn(plink, arfcn & GSMTAP_ARFCN_MASK); + if (!pinst) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - msg ARFCN=%d not part of BTS\n", + arfcn & GSMTAP_ARFCN_MASK); + goto nomessage; + } + + /* switch case with removed ACCH flag */ + switch ((gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH) & 0xff) { + case GSMTAP_CHANNEL_RACH: + /* generate primitive for upper layer + * see 04.08 - 3.3.1.3.1: the IMMEDIATE_ASSIGNMENT coming back from the network has to be + * sent with the same ra reference as in the CHANNEL_REQUEST that was received */ + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_RACH, PRIM_OP_INDICATION, msg); + + l1sap.u.rach_ind.chan_nr = chan_nr; + /* TODO: 11bit RACH */ + l1sap.u.rach_ind.ra = msgb_pull_u8(msg); /* directly after gh hdr comes ra */ + l1sap.u.rach_ind.acc_delay = 0; /* probably not used in virt um */ + l1sap.u.rach_ind.is_11bit = 0; + l1sap.u.rach_ind.fn = fn; + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_NONE; /* FIXME: what comes here */ + break; + case GSMTAP_CHANNEL_TCH_F: + case GSMTAP_CHANNEL_TCH_H: +#if 0 + /* TODO: handle voice messages */ + if (!facch && ! tch_acch) { + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, msg); + } +#endif + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_DATA, + PRIM_OP_INDICATION, msg); + l1sap.u.data.chan_nr = chan_nr; + l1sap.u.data.link_id = link_id; + l1sap.u.data.fn = fn; + l1sap.u.data.rssi = 0; /* Radio Signal Strength Indicator. Best -> 0 */ + l1sap.u.data.ber10k = 0; /* Bit Error Rate in 0.01%. Best -> 0 */ + l1sap.u.data.ta_offs_qbits = 0; /* Burst time of arrival in quarter bits. Probably used for Timing Advance calc. Best -> 0 */ + l1sap.u.data.lqual_cb = 10 * signal_dbm; /* Link quality in centiBel = 10 * dB. */ + l1sap.u.data.pdch_presence_info = PRES_INFO_UNKNOWN; + break; + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type downlink only!\n"); + goto nomessage; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type not supported!\n"); + goto nomessage; + default: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type unknown\n"); + goto nomessage; + } + + /* forward primitive, forwarded msg will not be freed */ +#warning "we cannot just pass a l1sap primitive on the stack!!!" + l1sap_up(pinst->trx, &l1sap); + DEBUGP(DL1P, "Message forwarded to layer 2.\n"); + return; + +nomessage: + talloc_free(msg); +} + +/* called by common part once OML link is established */ +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +/* called by bts_main to initialize physical link */ +int bts_model_phy_link_open(struct phy_link *plink) +{ + struct phy_instance *pinst; + + //OSMO_ASSERT(plink->type == PHY_LINK_T_VIRTUAL); + + if (plink->u.virt.virt_um) + virt_um_destroy(plink->u.virt.virt_um); + + phy_link_state_set(plink, PHY_LINK_CONNECTING); + + if (!plink->u.virt.bts_mcast_group) + plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; + + if (!plink->u.virt.bts_mcast_port) + plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; + + if (!plink->u.virt.ms_mcast_group) + plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; + + if (!plink->u.virt.ms_mcast_port) + plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; + + plink->u.virt.virt_um = virt_um_init(plink, plink->u.virt.ms_mcast_group, plink->u.virt.ms_mcast_port, + plink->u.virt.bts_mcast_group, plink->u.virt.bts_mcast_port, + virt_um_rcv_cb); + /* set back reference to plink */ + plink->u.virt.virt_um->priv = plink; + if (!plink->u.virt.virt_um) { + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + return -1; + } + + /* iterate over list of PHY instances and initialize the scheduler */ + llist_for_each_entry(pinst, &plink->instances, list) { + trx_sched_init(&pinst->u.virt.sched, pinst->trx); + /* Only start the scheduler for the transceiver on C0. + * If we have multiple tranceivers, CCCH is always on C0 + * and has to be auto active */ + /* Other TRX are activated via OML by a PRIM_INFO_MODIFY + * / PRIM_INFO_ACTIVATE */ + if (pinst->trx && pinst->trx == pinst->trx->bts->c0) { + vbts_sched_start(pinst->trx->bts); + /* init lapdm layer 3 callback for the trx on timeslot 0 == BCCH */ + lchan_init_lapdm(&pinst->trx->ts[0].lchan[CCCH_LCHAN]); + /* FIXME: This is probably the wrong location to set the CCCH to active... the OML link def. needs to be reworked and fixed. */ + pinst->trx->ts[0].lchan[CCCH_LCHAN].rel_act_kind = LCHAN_REL_ACT_OML; + lchan_set_state(&pinst->trx->ts[0].lchan[CCCH_LCHAN], LCHAN_S_ACTIVE); + } + } + + /* this will automatically update the MO state of all associated TRX objects */ + phy_link_state_set(plink, PHY_LINK_CONNECTED); + + return 0; +} + + +/* + * primitive handling + */ + +/* enable ciphering */ +static int l1if_set_ciphering(struct gsm_lchan *lchan, uint8_t chan_nr, int downlink) +{ + struct gsm_bts_trx *trx = lchan->ts->trx; + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + + /* ciphering already enabled in both directions */ + if (lchan->ciph_state == LCHAN_CIPH_RXTX_CONF) + return -EINVAL; + + if (!downlink) { + /* set uplink */ + trx_sched_set_cipher(sched, chan_nr, 0, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RX_CONF; + } else { + /* set downlink and also set uplink, if not already */ + if (lchan->ciph_state != LCHAN_CIPH_RX_CONF) { + trx_sched_set_cipher(sched, chan_nr, 0, + lchan->encr.alg_id - 1, lchan->encr.key, + lchan->encr.key_len); + } + trx_sched_set_cipher(sched, chan_nr, 1, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + } + + return 0; +} + +static int mph_info_chan_confirm(struct gsm_bts_trx *trx, uint8_t chan_nr, + enum osmo_mph_info_type type, uint8_t cause) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_CONFIRM, + NULL); + l1sap.u.info.type = type; + l1sap.u.info.u.act_cnf.chan_nr = chan_nr; + l1sap.u.info.u.act_cnf.cause = cause; + + return l1sap_up(trx, &l1sap); +} + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap.u.info.type = PRIM_INFO_TIME; + l1sap.u.info.u.time_ind.fn = fn; + + if (!bts->c0) + return -EINVAL; + + return l1sap_up(bts->c0, &l1sap); +} + + +static void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, + float ber, float rssi) +{ + memset(l1sap, 0, sizeof(*l1sap)); + osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap->u.info.type = PRIM_INFO_MEAS; + l1sap->u.info.u.meas_ind.chan_nr = chan_nr; + l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4); + l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000); + l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1); +} + +int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, + int n_errors, int n_bits_total, float rssi, float toa) +{ + struct gsm_lchan *lchan = &trx->ts[tn].lchan[l1sap_chan2ss(chan_nr)]; + struct osmo_phsap_prim l1sap; + /* 100% BER is n_bits_total is 0 */ + float ber = n_bits_total==0 ? 1.0 : (float)n_errors / (float)n_bits_total; + + LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS pwr=%ddBm rssi=%.1f dBFS " + "ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n", + gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), + rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); + + l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi); + + return l1sap_up(trx, &l1sap); +} + + + +/* primitive from common part */ +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + struct msgb *msg = l1sap->oph.msg; + uint8_t chan_nr; + uint8_t tn, ss; + int rc = 0; + struct gsm_lchan *lchan; + + switch (OSMO_PRIM_HDR(&l1sap->oph)) { + case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_ph_data_req(sched, l1sap); + case OSMO_PRIM(PRIM_TCH, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_tch_req(sched, l1sap); + case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_REQUEST): + switch (l1sap->u.info.type) { + case PRIM_INFO_ACT_CIPH: + chan_nr = l1sap->u.info.u.ciph_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + if (l1sap->u.info.u.ciph_req.uplink) + l1if_set_ciphering(lchan, chan_nr, 0); + if (l1sap->u.info.u.ciph_req.downlink) + l1if_set_ciphering(lchan, chan_nr, 1); + break; + case PRIM_INFO_ACTIVATE: + case PRIM_INFO_DEACTIVATE: + case PRIM_INFO_MODIFY: + chan_nr = l1sap->u.info.u.act_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + /* we receive a channel activation request from the BSC, + * e.g. as a response to a channel req on RACH */ + if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot activate" + " chan_nr 0x%02x\n", chan_nr); + break; + } + /* activate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_DEDIC, 1); + /* activate associated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_SACCH, 1); + /* set mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + (lchan->ho.active == 1)); + /* init lapdm */ + lchan_init_lapdm(lchan); + /* set lchan active */ + lchan_set_state(lchan, LCHAN_S_ACTIVE); + /* set initial ciphering */ + l1if_set_ciphering(lchan, chan_nr, 0); + l1if_set_ciphering(lchan, chan_nr, 1); + if (lchan->encr.alg_id) + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + else + lchan->ciph_state = LCHAN_CIPH_NONE; + + /* confirm */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_ACTIVATE, 0); + break; + } + if (l1sap->u.info.type == PRIM_INFO_MODIFY) { + /* change mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + 0); + break; + } + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot deactivate " + "chan_nr 0x%02x\n", chan_nr); + break; + } + /* deactivate associated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x40, 0); + if (!l1sap->u.info.u.act_req.sacch_only) { + /* set lchan inactive */ + lchan_set_state(lchan, LCHAN_S_NONE); + /* deactivate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x00, 0); + /* confirm only on dedicated channel */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_DEACTIVATE, 0); + lchan->ciph_state = 0; /* FIXME: do this in common/\*.c */ + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown MPH-INFO.req %d\n", + l1sap->u.info.type); + rc = -EINVAL; + goto done; + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d\n", + l1sap->oph.primitive, l1sap->oph.operation); + rc = -EINVAL; + goto done; + } + +done: + if (msg) + msgb_free(msg); + return rc; +} diff --git a/src/osmo-bts-virtual/l1_if.h b/src/osmo-bts-virtual/l1_if.h new file mode 100644 index 0000000..6a843b3 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +#include "virtual_um.h" + +struct vbts_l1h { + struct gsm_bts_trx *trx; + struct l1sched_trx l1s; + struct virt_um_inst *virt_um; +}; + +struct vbts_l1h *l1if_open(struct gsm_bts_trx *trx); +void l1if_close(struct vbts_l1h *l1h); +void l1if_reset(struct vbts_l1h *l1h); + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn); + +int vbts_sched_start(struct gsm_bts *bts); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c new file mode 100644 index 0000000..6ceeaec --- /dev/null +++ b/src/osmo-bts-virtual/main.c @@ -0,0 +1,126 @@ +/* Main program for Virtual OsmoBTS */ + +/* (C) 2015 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 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +/* dummy, since no direct dsp support */ +uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb; + + btsb = bts_role_bts(bts); + btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + + bts_model_vty_init(bts); + + return 0; +} + +void bts_model_print_help() +{ +} + +int bts_model_handle_options(int argc, char **argv) +{ + int num_errors = 0; + + while (1) { + int option_idx = 0, c; + static const struct option long_options[] = { + /* specific to this hardware */ + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "", + long_options, &option_idx); + if (c == -1) + break; + + switch (c) { + default: + num_errors++; + break; + } + } + + return num_errors; +} + +void bts_model_abis_close(struct gsm_bts *bts) +{ + /* for now, we simply terminate the program and re-spawn */ + bts_shutdown(bts, "Abis close"); +} + +void bts_model_phy_link_set_defaults(struct phy_link *plink) +{ +} + +void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) +{ +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} + +int main(int argc, char **argv) +{ + return bts_main(argc, argv); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.c b/src/osmo-bts-virtual/osmo_mcast_sock.c new file mode 100644 index 0000000..f092a73 --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.c @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "osmo_mcast_sock.h" + +/* server socket is what we use for transmission. It is not subscribed + * to a multicast group or locally bound, but it is just a normal UDP + * socket that's connected to the remote mcast group + port */ +int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, + uint16_t tx_mcast_port, bool loopback) +{ + int rc; + unsigned int flags = OSMO_SOCK_F_CONNECT; + + if (!loopback) + flags |= OSMO_SOCK_F_NO_MCAST_LOOP; + + /* setup mcast server socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + tx_mcast_group, tx_mcast_port, flags); + if (rc < 0) { + perror("Failed to create Multicast Server Socket"); + return rc; + } + + return 0; +} + +/* the client socket is what we use for reception. It is a UDP socket + * that's bound to the GSMTAP UDP port and subscribed to the respective + * multicast group */ +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + int rc; + + ofd->cb = fd_rx_cb; + ofd->when = BSC_FD_READ; + ofd->data = osmo_fd_data; + + /* Create mcast client socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + NULL, mcast_port, OSMO_SOCK_F_BIND|OSMO_SOCK_F_NO_MCAST_ALL); + if (rc < 0) { + perror("Could not create mcast client socket"); + return rc; + } + + /* Configure and join the multicast group */ + rc = osmo_sock_mcast_subscribe(ofd->fd, mcast_group); + if (rc < 0) { + perror("Failed to join to mcast goup"); + osmo_fd_close(ofd); + return rc; + } + + return 0; +} + +struct mcast_bidir_sock * +mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_bidir_sock *bidir_sock = talloc(ctx, struct mcast_bidir_sock); + int rc; + + if (!bidir_sock) + return NULL; + + rc = mcast_client_sock_setup(&bidir_sock->rx_ofd, rx_mcast_group, rx_mcast_port, + fd_rx_cb, osmo_fd_data); + if (rc < 0) { + talloc_free(bidir_sock); + return NULL; + } + rc = mcast_server_sock_setup(&bidir_sock->tx_ofd, tx_mcast_group, tx_mcast_port, loopback); + if (rc < 0) { + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); + return NULL; + } + return bidir_sock; + +} + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, + unsigned int data_len) +{ + return send(bidir_sock->tx_ofd.fd, data, data_len, 0); +} + +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len) +{ + return recv(bidir_sock->rx_ofd.fd, buf, buf_len, 0); +} + +void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) +{ + osmo_fd_close(&bidir_sock->tx_ofd); + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.h b/src/osmo-bts-virtual/osmo_mcast_sock.h new file mode 100644 index 0000000..aa2013c --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include +#include + +struct mcast_bidir_sock { + struct osmo_fd tx_ofd; + struct osmo_fd rx_ofd; +}; + +struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx, + const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group, + uint16_t tx_mcast_port, bool loopback); + +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, unsigned int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len); +void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); + diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c new file mode 100644 index 0000000..4b4def7 --- /dev/null +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -0,0 +1,633 @@ +/* Scheduler worker functiosn for Virtua OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * + * 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 +#include "virtual_um.h" +#include "l1_if.h" + +static const char *gsmtap_hdr_stringify(const struct gsmtap_hdr *gh) +{ + static char buf[256]; + snprintf(buf, sizeof(buf), "(ARFCN=%u, ts=%u, ss=%u, type=%u/%u)", + gh->arfcn & GSMTAP_ARFCN_MASK, gh->timeslot, gh->sub_slot, gh->type, gh->sub_type); + return buf; +} + +/** + * Send a message over the virtual um interface. + * This will at first wrap the msg with a GSMTAP header and then write it to the declared multicast socket. + * TODO: we might want to remove unused argument uint8_t tn + */ +static void tx_to_virt_um(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, struct msgb *msg) +{ + const struct trx_chan_desc *chdesc = &trx_chan_desc[chan]; + struct msgb *outmsg; /* msg to send with gsmtap header prepended */ + uint16_t arfcn = l1t->trx->arfcn; /* ARFCN of the tranceiver the message is send with */ + uint8_t signal_dbm = 63; /* signal strength, 63 is best */ + uint8_t snr = 63; /* signal noise ratio, 63 is best */ + uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ + uint8_t data_len = msgb_l2len(msg); /* length of data */ + uint8_t rsl_chantype; /* RSL chan type (TS 08.58, 9.3.1) */ + uint8_t subslot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot; /* TDMA timeslot to send in (0-7) */ + uint8_t gsmtap_chantype; /* the GSMTAP channel */ + + rsl_dec_chan_nr(chdesc->chan_nr, &rsl_chantype, &subslot, ×lot); + /* in Osmocom, AGCH is only sent on ccch block 0. no idea why. this seems to cause false GSMTAP channel + * types for agch and pch. */ + if (rsl_chantype == RSL_CHAN_PCH_AGCH && L1SAP_FN2CCCHBLOCK(fn) == 0) + gsmtap_chantype = GSMTAP_CHANNEL_PCH; + else + gsmtap_chantype = chantype_rsl2gsmtap(rsl_chantype, chdesc->link_id); /* the logical channel type */ + + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chantype, subslot, fn, signal_dbm, snr, data, data_len); + if (outmsg) { + struct phy_instance *pinst = trx_phy_instance(l1t->trx); + struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); + + if (virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg) == -1) + LOGP(DL1P, LOGL_ERROR, "%s GSMTAP msg could not send to virtual Um\n", gsmtap_hdr_stringify(gh)); + else + DEBUGP(DL1C, "%s Sending GSMTAP message to virtual Um\n", gsmtap_hdr_stringify(gh)); + } else + LOGP(DL1C, LOGL_ERROR, "GSMTAP msg could not be created!\n"); + + /* free incoming message */ + msgb_free(msg); +} + +/* + * TX on downlink + */ + +/* an IDLE burst returns nothing. on C0 it is replaced by dummy burst */ +ubit_t *tx_idle_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_fcch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_sch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg; + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + /* check validity of message */ + if (msgb_l2len(msg) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg)); + /* free message */ + msgb_free(msg); + return NULL; + } + + /* transmit the msg received on dl from bsc to layer1 (virt Um) */ + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +ubit_t *tx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg = NULL; /* make GCC happy */ + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +static void tx_tch_common(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, struct msgb **_msg_tch, + struct msgb **_msg_facch, int codec_mode_request) +{ + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct msgb *msg1, *msg2, *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + uint8_t rsl_cmode = chan_state->rsl_cmode; + uint8_t tch_mode = chan_state->tch_mode; + struct osmo_phsap_prim *l1sap; +#if 0 + /* handle loss detection of received TCH frames */ + if (rsl_cmode == RSL_CMOD_SPD_SPEECH + && ++(chan_state->lost) > 5) { + uint8_t tch_data[GSM_FR_BYTES]; + int len; + + LOGP(DL1P, LOGL_NOTICE, "Missing TCH bursts detected, sending " + "BFI for %s\n", trx_chan_desc[chan].name); + + /* indicate bad frame */ + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + tch_data[0] = 0x70; /* F = 0, FT = 111 */ + memset(tch_data + 1, 0, 14); + len = 15; + break; + } + memset(tch_data, 0, GSM_FR_BYTES); + len = GSM_FR_BYTES; + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode1; + memset(tch_data, 0, GSM_EFR_BYTES); + len = GSM_EFR_BYTES; + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ + len = amr_compose_payload(tch_data, + chan_state->codec[chan_state->dl_cmr], + chan_state->codec[chan_state->dl_ft], 1); + if (len < 2) + break; + memset(tch_data + 2, 0, len - 2); + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + break; + default: +inval_mode1: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + len = 0; + } + if (len) + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + } +#endif + + /* get frame and unlink from queue */ + msg1 = _sched_dequeue_prim(l1t, tn, fn, chan); + msg2 = _sched_dequeue_prim(l1t, tn, fn, chan); + if (msg1) { + l1sap = msgb_l1sap_prim(msg1); + if (l1sap->oph.primitive == PRIM_TCH) { + msg_tch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "TCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_facch = msg2; + } + } else { + msg_facch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive != PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "FACCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_tch = msg2; + } + } + } else if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) + msg_tch = msg2; + else + msg_facch = msg2; + } + + /* check validity of message */ + if (msg_facch && msgb_l2len(msg_facch) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg_facch)); + /* free message */ + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* check validity of message, get AMR ft and cmr */ + if (!msg_facch && msg_tch) { + int len; +#if 0 + uint8_t bfi, cmr_codec, ft_codec; + int cmr, ft, i; +#endif + + if (rsl_cmode != RSL_CMOD_SPD_SPEECH) { + LOGP(DL1P, LOGL_NOTICE, "%s Dropping speech frame, " + "because we are not in speech mode trx=%u " + "ts=%u at fn=%u.\n", trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + len = 15; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] & 0xf0) != 0x00) { + LOGP(DL1P, LOGL_NOTICE, "%s " + "Transmitting 'bad " + "HR frame' trx=%u ts=%u at " + "fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + } + len = GSM_FR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xd) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "FR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode2; + len = GSM_EFR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xc) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "EFR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ +#if 0 + len = amr_decompose_payload(msg_tch->l2h, + msgb_l2len(msg_tch), &cmr_codec, &ft_codec, + &bfi); + cmr = -1; + ft = -1; + for (i = 0; i < chan_state->codecs; i++) { + if (chan_state->codec[i] == cmr_codec) + cmr = i; + if (chan_state->codec[i] == ft_codec) + ft = i; + } + if (cmr >= 0) { /* new request */ + chan_state->dl_cmr = cmr; + /* disable AMR loop */ + trx_loop_amr_set(chan_state, 0); + } else { + /* enable AMR loop */ + trx_loop_amr_set(chan_state, 1); + } + if (ft < 0) { + LOGP(DL1P, LOGL_ERROR, "%s Codec (FT = %d) " + " of RTP frame not in list. " + "trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + if (codec_mode_request && chan_state->dl_ft != ft) { + LOGP(DL1P, LOGL_NOTICE, "%s Codec (FT = %d) " + " of RTP cannot be changed now, but in " + "next frame. trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + chan_state->dl_ft = ft; + if (bfi) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "AMR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } +#else + LOGP(DL1P, LOGL_ERROR, "AMR not supported!\n"); + goto free_bad_msg; +#endif + break; + default: +inval_mode2: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + goto free_bad_msg; + } + if (len < 0) { + LOGP(DL1P, LOGL_ERROR, "Cannot send invalid AMR " + "payload\n"); + goto free_bad_msg; + } + if (msgb_l2len(msg_tch) != len) { + LOGP(DL1P, LOGL_ERROR, "Cannot send payload with " + "invalid length! (expecing %d, received %d)\n", + len, msgb_l2len(msg_tch)); +free_bad_msg: + /* free message */ + msgb_free(msg_tch); + msg_tch = NULL; + goto send_frame; + } + } + +send_frame: + *_msg_tch = msg_tch; + *_msg_facch = msg_facch; +} + +ubit_t *tx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + + if (bid > 0) + return NULL; + + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* no message at all */ + if (!msg_tch && !msg_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + + return NULL; +} + +ubit_t *tx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + //uint8_t tch_mode = chan_state->tch_mode; + + /* send burst, if we already got a frame */ + if (bid > 0) + return NULL; + + /* get TCH and/or FACCH */ + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* check for FACCH alignment */ + if (msg_facch && ((((fn + 4) % 26) >> 2) & 1)) { + LOGP(DL1P, LOGL_ERROR, "%s Cannot transmit FACCH starting on " + "even frames, please fix RTS!\n", + trx_chan_desc[chan].name); + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* no message at all */ + if (!msg_tch && !msg_facch && !chan_state->dl_ongoing_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + return NULL; +} + + +/*********************************************************************** + * RX on uplink (indication to upper layer) + ***********************************************************************/ + +/* we don't use those functions, as we feed the MAC frames from GSMTAP + * directly into the L1SAP, bypassing the TDMA multiplex logic oriented + * towards receiving bursts */ + +int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +/*! \brief a single burst was received by the PHY, process it */ +int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +void _sched_act_rach_det(struct l1sched_trx *l1t, uint8_t tn, uint8_t ss, int activate) +{ +} + +/*********************************************************************** + * main scheduler function + ***********************************************************************/ + +#define RTS_ADVANCE 5 /* about 20ms */ +#define FRAME_DURATION_uS 4615 + +static int vbts_sched_fn(struct gsm_bts *bts, uint32_t fn) +{ + struct gsm_bts_trx *trx; + + /* send time indication */ + /* update model with new frame number, lot of stuff happening, measurements of timeslots */ + /* saving GSM time in BTS model, and more */ + l1if_mph_time_ind(bts, fn); + + /* advance the frame number? */ + llist_for_each_entry(trx, &bts->trx_list, list) { + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *l1t = &pinst->u.virt.sched; + int tn; + uint16_t nbits; + + /* do for each of the 8 timeslots */ + for (tn = 0; tn < ARRAY_SIZE(l1t->ts); tn++) { + /* Generate RTS indication to higher layers */ + /* This will basically do 2 things (check l1_if:bts_model_l1sap_down): + * 1) Get pending messages from layer 2 (from the lapdm queue) + * 2) Process the messages + * --> Handle and process non-transparent RSL-Messages (activate channel, ) + * --> Forward transparent RSL-DATA-Messages to the ms by appending them to + * the l1-dl-queue */ + _sched_rts(l1t, tn, (fn + RTS_ADVANCE) % GSM_HYPERFRAME); + /* schedule transmit backend functions */ + /* Process data in the l1-dlqueue and forward it + * to MS */ + /* the returned bits are not used here, the routines called will directly forward their + * bits to the virt Um */ + _sched_dl_burst(l1t, tn, fn, &nbits); + } + } + + return 0; +} + +static void vbts_fn_timer_cb(void *data) +{ + struct gsm_bts *bts = data; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + struct timeval tv_now; + struct timeval *tv_clock = &btsb->vbts.tv_clock; + int32_t elapsed_us; + + gettimeofday(&tv_now, NULL); + + /* check how much time elapsed till the last timer callback call. + * this value should be about 4.615 ms (a bit greater) as this is the scheduling interval */ + elapsed_us = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 + + (tv_now.tv_usec - tv_clock->tv_usec); + + /* not so good somehow a lot of time passed between two timer callbacks */ + if (elapsed_us > 2 *FRAME_DURATION_uS) + LOGP(DL1P, LOGL_NOTICE, "vbts_fn_timer_cb after %d us\n", elapsed_us); + + /* schedule the current frame/s (fn = frame number) + * this loop will be called at least once, but can also be executed + * multiple times if more than one frame duration (4615us) passed till the last callback */ + while (elapsed_us > FRAME_DURATION_uS / 2) { + const struct timeval tv_frame = { + .tv_sec = 0, + .tv_usec = FRAME_DURATION_uS, + }; + timeradd(tv_clock, &tv_frame, tv_clock); + /* increment the frame number in the BTS model instance */ + btsb->vbts.last_fn = (btsb->vbts.last_fn + 1) % GSM_HYPERFRAME; + vbts_sched_fn(bts, btsb->vbts.last_fn); + elapsed_us -= FRAME_DURATION_uS; + } + + /* re-schedule the timer */ + /* timer is set to frame duration - elapsed time to guarantee that this cb method will be + * periodically executed every 4.615ms */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS - elapsed_us); +} + +int vbts_sched_start(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + + LOGP(DL1P, LOGL_NOTICE, "starting VBTS scheduler\n"); + + memset(&btsb->vbts.fn_timer, 0, sizeof(btsb->vbts.fn_timer)); + btsb->vbts.fn_timer.cb = vbts_fn_timer_cb; + btsb->vbts.fn_timer.data = bts; + + gettimeofday(&btsb->vbts.tv_clock, NULL); + /* trigger the first timer after 4615us (a frame duration) */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS); + + return 0; +} diff --git a/src/osmo-bts-virtual/virtual_um.c b/src/osmo-bts-virtual/virtual_um.c new file mode 100644 index 0000000..e6b9615 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.c @@ -0,0 +1,92 @@ +/* Routines for a Virtual Um interface over GSMTAP/UDP */ + +/* (C) 2015 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 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 "osmo_mcast_sock.h" +#include "virtual_um.h" +#include + +/** + * Virtual UM interface file descriptor callback. + * Should be called by select.c when the fd is ready for reading. + */ +static int virt_um_fd_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct virt_um_inst *vui = ofd->data; + + if (what & BSC_FD_READ) { + struct msgb *msg = msgb_alloc(VIRT_UM_MSGB_SIZE, "Virtual UM Rx"); + int rc; + + /* read message from fd into message buffer */ + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + if (rc > 0) { + msgb_put(msg, rc); + msg->l1h = msgb_data(msg); + /* call the l1 callback function for a received msg */ + vui->recv_cb(vui, msg); + } else { + /* FIXME: this kind of error handling might be a bit harsh */ + vui->recv_cb(vui, NULL); + osmo_fd_close(ofd); + } + } + + return 0; +} + +struct virt_um_inst *virt_um_init(void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) +{ + struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, + rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->recv_cb = recv_cb; + + return vui; + +} + +void virt_um_destroy(struct virt_um_inst *vui) +{ + mcast_bidir_sock_close(vui->mcast_sock); + talloc_free(vui); +} + +/** + * Write msg to to multicast socket and free msg afterwards + */ +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg) +{ + int rc; + + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), + msgb_length(msg)); + msgb_free(msg); + + return rc; +} diff --git a/src/osmo-bts-virtual/virtual_um.h b/src/osmo-bts-virtual/virtual_um.h new file mode 100644 index 0000000..6e7c384 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include "osmo_mcast_sock.h" + +#define VIRT_UM_MSGB_SIZE 256 +#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ +#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ + +struct virt_um_inst { + void *priv; + struct mcast_bidir_sock *mcast_sock; + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); +}; + +struct virt_um_inst *virt_um_init( + void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); + +void virt_um_destroy(struct virt_um_inst *vui); + +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg); diff --git a/src/osmo-bts-virtual/virtualbts_vty.c b/src/osmo-bts-virtual/virtualbts_vty.c new file mode 100644 index 0000000..45c1086 --- /dev/null +++ b/src/osmo-bts-virtual/virtualbts_vty.c @@ -0,0 +1,185 @@ +/* VTY interface for virtual OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * 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 +#include +#include +#include "virtual_um.h" + +#define TRX_STR "Transceiver related commands\n" "TRX number\n" + +#define SHOW_TRX_STR \ + SHOW_STR \ + TRX_STR + +static struct gsm_bts *vty_bts; + +void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) +{ +} + +void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) +{ +} + +void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) +{ +} + +void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) +{ + if (plink->u.virt.mcast_dev) + vty_out(vty, " virtual-um net-device %s%s", + plink->u.virt.mcast_dev, VTY_NEWLINE); + if (strcmp(plink->u.virt.ms_mcast_group, DEFAULT_BTS_MCAST_GROUP)) + vty_out(vty, " virtual-um ms-multicast-group %s%s", + plink->u.virt.ms_mcast_group, VTY_NEWLINE); + if (plink->u.virt.ms_mcast_port) + vty_out(vty, " virtual-um ms-udp-port %u%s", + plink->u.virt.ms_mcast_port, VTY_NEWLINE); + if (strcmp(plink->u.virt.bts_mcast_group, DEFAULT_MS_MCAST_GROUP)) + vty_out(vty, " virtual-um bts-multicast-group %s%s", + plink->u.virt.bts_mcast_group, VTY_NEWLINE); + if (plink->u.virt.bts_mcast_port) + vty_out(vty, " virtual-um bts-udp-port %u%s", + plink->u.virt.bts_mcast_port, VTY_NEWLINE); + +} + +#define VUM_STR "Virtual Um layer\n" + +DEFUN(cfg_phy_ms_mcast_group, cfg_phy_ms_mcast_group_cmd, + "virtual-um ms-multicast-group GROUP", + VUM_STR "Configure the MS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.ms_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_ms_mcast_port, cfg_phy_ms_mcast_port_cmd, + "virtual-um ms-udp-port <0-65535>", + VUM_STR "Configure the MS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.ms_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_group, cfg_phy_bts_mcast_group_cmd, + "virtual-um bts-multicast-group GROUP", + VUM_STR "Configure the BTS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.bts_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_port, cfg_phy_bts_mcast_port_cmd, + "virtual-um bts-udp-port <0-65535>", + VUM_STR "Configure the BTS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.bts_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_mcast_dev, cfg_phy_mcast_dev_cmd, + "virtual-um net-device NETDEV", + VUM_STR "Configure the network device\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.mcast_dev, argv[0]); + + return CMD_SUCCESS; +} + +int bts_model_vty_init(struct gsm_bts *bts) +{ + vty_bts = bts; + + install_element(PHY_NODE, &cfg_phy_ms_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_ms_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_mcast_dev_cmd); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1bf7670975b1e367c1c62983020865a043542622 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 18:52:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 18:52:15 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: cause BTS to terminate in case of recv()/send() on... Message-ID: Review at https://gerrit.osmocom.org/3248 VIRT-PHY: cause BTS to terminate in case of recv()/send() on udp socket returns 0 It is important that we reliably terminate the BTS in case any of the VirtPHY multicast sockets dies for whatever reason. Change-Id: I5ae3fdd7cc35fdf235550a3b8362020fdd287c13 --- M src/osmo-bts-virtual/l1_if.c M src/osmo-bts-virtual/scheduler_virtbts.c M src/osmo-bts-virtual/virtual_um.c 3 files changed, 19 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/48/3248/1 diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 36b2748..9212121 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -66,6 +66,13 @@ static void virt_um_rcv_cb(struct virt_um_inst *vui, struct msgb *msg) { struct phy_link *plink = (struct phy_link *)vui->priv; + struct phy_instance *pinst; + if (!msg) { + pinst = phy_instance_by_num(plink, 0); + bts_shutdown(pinst->trx->bts, "VirtPHY read socket died\n"); + return; + } + struct gsmtap_hdr *gh = msgb_l1(msg); uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the cell we currently camp on */ @@ -77,7 +84,6 @@ uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ - struct phy_instance *pinst; struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index 9b52864..1338ce5 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -93,9 +94,13 @@ if (outmsg) { struct phy_instance *pinst = trx_phy_instance(l1t->trx); struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); + int rc; - if (virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg) == -1) + rc = virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg); + if (rc < 0) LOGP(DL1P, LOGL_ERROR, "%s GSMTAP msg could not send to virtual Um\n", gsmtap_hdr_stringify(gh)); + else if (rc == 0) + bts_shutdown(l1t->trx->bts, "VirtPHY write socket died\n"); else DEBUGP(DL1C, "%s Sending GSMTAP message to virtual Um\n", gsmtap_hdr_stringify(gh)); } else diff --git a/src/osmo-bts-virtual/virtual_um.c b/src/osmo-bts-virtual/virtual_um.c index e6b9615..e8d4252 100644 --- a/src/osmo-bts-virtual/virtual_um.c +++ b/src/osmo-bts-virtual/virtual_um.c @@ -48,11 +48,12 @@ msg->l1h = msgb_data(msg); /* call the l1 callback function for a received msg */ vui->recv_cb(vui, msg); - } else { - /* FIXME: this kind of error handling might be a bit harsh */ + } else if (rc == 0) { vui->recv_cb(vui, NULL); osmo_fd_close(ofd); - } + } else + perror("Read from multicast socket"); + } return 0; @@ -86,6 +87,8 @@ rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), msgb_length(msg)); + if (rc < 0) + perror("Writing to multicast socket"); msgb_free(msg); return rc; -- To view, visit https://gerrit.osmocom.org/3248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ae3fdd7cc35fdf235550a3b8362020fdd287c13 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:17:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 19:17:51 +0000 Subject: [MERGED] osmo-msc[master]: jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' ...................................................................... jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' We are building with libosmo-sccp tag 'old_sua' until the new sigtran has been applied. Since osmo-iuh commit 0f88c110093935305143987638e46dc6db304a3e "migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA" osmo-iuh requires libosmo-sccp master. A similar 'old_sua' tag is in place in osmo-iuh.git, to match libosmo-sccp 'old_sua'. Do that to fix the jenkins build of --enable-iu. Change-Id: I70f731db0b74ed48ae6dd713ed4c3247222ef0de --- M contrib/jenkins.sh 1 file changed, 2 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 0021947..068ee34 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -19,6 +19,7 @@ if [ "x$IU" = "x--enable-iu" ]; then sccp_branch="old_sua" + osmo_iuh_branch="old_sua" fi osmo-build-dep.sh libosmo-abis @@ -30,7 +31,7 @@ if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh + osmo-build-dep.sh osmo-iuh $osmo_iuh_branch fi set +x -- To view, visit https://gerrit.osmocom.org/3221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I70f731db0b74ed48ae6dd713ed4c3247222ef0de Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:17:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 19:17:52 +0000 Subject: [MERGED] osmo-msc[master]: move openbsc/* to repos root In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move openbsc/* to repos root ...................................................................... move openbsc/* to repos root This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 --- R AUTHORS R COPYING R Makefile.am R README R README.vty-tests R configure.ac R contrib/a-link/sccp-split-by-con.lua R contrib/bsc-test/README R contrib/bsc-test/all_dial R contrib/bsc-test/dial.sh R contrib/bsc-test/drop-oml.sh R contrib/bsc-test/drop.sh R contrib/bsc-test/hangup R contrib/bsc-test/msc.sh R contrib/bsc_control.py R contrib/bt.py R contrib/convert_to_enum.py R contrib/ctrl2sse.py R contrib/gprs/gb-proxy-unblock-bug.py R contrib/gprs/gprs-bssgp-histogram.lua R contrib/gprs/gprs-buffer-count.lua R contrib/gprs/gprs-split-trace-by-tlli.lua R contrib/gprs/gprs-verify-nu.lua R contrib/hlr-remove-old.sql R contrib/hlrsync/hlrsync.py R contrib/ipa.py M contrib/jenkins.sh R contrib/mgcp_server.py R contrib/nat/test_regexp.c R contrib/nat/ussd_example.py R contrib/rtp/gen_rtp_header.erl R contrib/rtp/rtp_replay.st R contrib/rtp/rtp_replay_shared.st R contrib/rtp/rtp_replay_sip.st R contrib/rtp/timestamp_rtp.lua R contrib/sms/fill-hlr.st R contrib/sms/hlr-query.st R contrib/sms/sqlite-probe.tap.d R contrib/soap.py R contrib/systemd/osmo-bsc-mgcp.service R contrib/systemd/osmo-bsc.service R contrib/systemd/osmo-gbproxy.service R contrib/systemd/osmo-nitb.service R contrib/systemd/osmo-sgsn.service R contrib/testconv/Makefile R contrib/testconv/testconv_main.c R contrib/twisted_ipa.py R doc/BS11-OML.txt R doc/Makefile.am R doc/call-routing.txt R doc/channel_release.txt R doc/e1-data-model.txt R doc/examples/Makefile.am R doc/examples/osmo-bsc/osmo-bsc.cfg R doc/examples/osmo-bsc_mgcp/mgcp.cfg R doc/examples/osmo-bsc_nat/black-list.cfg R doc/examples/osmo-bsc_nat/bscs.config R doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg R doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg R doc/examples/osmo-gbproxy/osmo-gbproxy.cfg R doc/examples/osmo-gtphub/gtphub-example.txt R doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg R doc/examples/osmo-gtphub/osmo-gtphub.cfg R doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg R doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg R doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg R doc/examples/osmo-nitb/bs11/openbsc.cfg R doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg R doc/examples/osmo-nitb/nanobts/openbsc.cfg R doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg R doc/examples/osmo-nitb/rbs2308/openbsc.cfg R doc/examples/osmo-nitb/sysmobts/openbsc.cfg R doc/examples/osmo-sgsn/osmo-sgsn.cfg R doc/gsm-hopping.txt R doc/handover.txt R doc/ipa-sccp.txt R doc/oml-interface.txt R doc/osmo-nitb-data_structures.dot R doc/paging.txt R git-version-gen R include/Makefile.am R include/compat_af_isdn.h R include/mISDNif.h R include/openbsc/Makefile.am R include/openbsc/abis_nm.h R include/openbsc/abis_om2000.h R include/openbsc/abis_rsl.h R include/openbsc/arfcn_range_encode.h R include/openbsc/auth.h R include/openbsc/bsc_api.h R include/openbsc/bsc_msc.h R include/openbsc/bsc_msc_data.h R include/openbsc/bsc_msg_filter.h R include/openbsc/bsc_nat.h R include/openbsc/bsc_nat_callstats.h R include/openbsc/bsc_nat_sccp.h R include/openbsc/bsc_rll.h R include/openbsc/bsc_subscriber.h R include/openbsc/bss.h R include/openbsc/bts_ipaccess_nanobts_omlattr.h R include/openbsc/chan_alloc.h R include/openbsc/common_bsc.h R include/openbsc/common_cs.h R include/openbsc/crc24.h R include/openbsc/ctrl.h R include/openbsc/db.h R include/openbsc/debug.h R include/openbsc/e1_config.h R include/openbsc/gb_proxy.h R include/openbsc/gprs_gb_parse.h R include/openbsc/gprs_gmm.h R include/openbsc/gprs_llc.h R include/openbsc/gprs_llc_xid.h R include/openbsc/gprs_sgsn.h R include/openbsc/gprs_sndcp.h R include/openbsc/gprs_sndcp_comp.h R include/openbsc/gprs_sndcp_dcomp.h R include/openbsc/gprs_sndcp_pcomp.h R include/openbsc/gprs_sndcp_xid.h R include/openbsc/gprs_subscriber.h R include/openbsc/gprs_utils.h R include/openbsc/gsm_04_08.h R include/openbsc/gsm_04_11.h R include/openbsc/gsm_04_80.h R include/openbsc/gsm_data.h R include/openbsc/gsm_data_shared.h R include/openbsc/gsm_subscriber.h R include/openbsc/gsup_client.h R include/openbsc/gtphub.h R include/openbsc/handover.h R include/openbsc/handover_decision.h R include/openbsc/ipaccess.h R include/openbsc/iu.h R include/openbsc/meas_feed.h R include/openbsc/meas_rep.h R include/openbsc/mgcp.h R include/openbsc/mgcp_internal.h R include/openbsc/mgcp_transcode.h R include/openbsc/misdn.h R include/openbsc/mncc.h R include/openbsc/mncc_int.h R include/openbsc/nat_rewrite_trie.h R include/openbsc/network_listen.h R include/openbsc/oap_client.h R include/openbsc/openbscdefines.h R include/openbsc/osmo_bsc.h R include/openbsc/osmo_bsc_grace.h R include/openbsc/osmo_bsc_rf.h R include/openbsc/osmo_msc.h R include/openbsc/osmux.h R include/openbsc/paging.h R include/openbsc/pcu_if.h R include/openbsc/pcuif_proto.h R include/openbsc/rest_octets.h R include/openbsc/rrlp.h R include/openbsc/rs232.h R include/openbsc/rtp_proxy.h R include/openbsc/sgsn.h R include/openbsc/signal.h R include/openbsc/silent_call.h R include/openbsc/slhc.h R include/openbsc/smpp.h R include/openbsc/sms_queue.h R include/openbsc/socket.h R include/openbsc/system_information.h R include/openbsc/token_auth.h R include/openbsc/transaction.h R include/openbsc/trau_mux.h R include/openbsc/trau_upqueue.h R include/openbsc/ussd.h R include/openbsc/v42bis.h R include/openbsc/v42bis_private.h R include/openbsc/vty.h R m4/README R m4/ax_check_compile_flag.m4 R openbsc.pc.in R osmoappdesc.py R src/Makefile.am R src/gprs/.gitignore R src/gprs/Makefile.am R src/gprs/crc24.c R src/gprs/gb_proxy.c R src/gprs/gb_proxy_main.c R src/gprs/gb_proxy_patch.c R src/gprs/gb_proxy_peer.c R src/gprs/gb_proxy_tlli.c R src/gprs/gb_proxy_vty.c R src/gprs/gprs_gb_parse.c R src/gprs/gprs_gmm.c R src/gprs/gprs_llc.c R src/gprs/gprs_llc_parse.c R src/gprs/gprs_llc_vty.c R src/gprs/gprs_llc_xid.c R src/gprs/gprs_sgsn.c R src/gprs/gprs_sndcp.c R src/gprs/gprs_sndcp_comp.c R src/gprs/gprs_sndcp_dcomp.c R src/gprs/gprs_sndcp_pcomp.c R src/gprs/gprs_sndcp_vty.c R src/gprs/gprs_sndcp_xid.c R src/gprs/gprs_subscriber.c R src/gprs/gprs_utils.c R src/gprs/gtphub.c R src/gprs/gtphub_ares.c R src/gprs/gtphub_main.c R src/gprs/gtphub_sock.c R src/gprs/gtphub_vty.c R src/gprs/osmo_sgsn.cfg R src/gprs/sgsn_ares.c R src/gprs/sgsn_auth.c R src/gprs/sgsn_cdr.c R src/gprs/sgsn_ctrl.c R src/gprs/sgsn_libgtp.c R src/gprs/sgsn_main.c R src/gprs/sgsn_vty.c R src/gprs/slhc.c R src/gprs/v42bis.c R src/ipaccess/Makefile.am R src/ipaccess/abisip-find.c R src/ipaccess/ipaccess-config.c R src/ipaccess/ipaccess-firmware.c R src/ipaccess/ipaccess-proxy.c R src/ipaccess/network_listen.c R src/libbsc/Makefile.am R src/libbsc/abis_nm.c R src/libbsc/abis_nm_ipaccess.c R src/libbsc/abis_nm_vty.c R src/libbsc/abis_om2000.c R src/libbsc/abis_om2000_vty.c R src/libbsc/abis_rsl.c R src/libbsc/arfcn_range_encode.c R src/libbsc/bsc_api.c R src/libbsc/bsc_ctrl_commands.c R src/libbsc/bsc_ctrl_lookup.c R src/libbsc/bsc_dyn_ts.c R src/libbsc/bsc_init.c R src/libbsc/bsc_msc.c R src/libbsc/bsc_rf_ctrl.c R src/libbsc/bsc_rll.c R src/libbsc/bsc_subscriber.c R src/libbsc/bsc_vty.c R src/libbsc/bts_ericsson_rbs2000.c R src/libbsc/bts_init.c R src/libbsc/bts_ipaccess_nanobts.c R src/libbsc/bts_ipaccess_nanobts_omlattr.c R src/libbsc/bts_nokia_site.c R src/libbsc/bts_siemens_bs11.c R src/libbsc/bts_sysmobts.c R src/libbsc/bts_unknown.c R src/libbsc/chan_alloc.c R src/libbsc/e1_config.c R src/libbsc/gsm_04_08_utils.c R src/libbsc/gsm_04_80_utils.c R src/libbsc/handover_decision.c R src/libbsc/handover_logic.c R src/libbsc/meas_proc.c R src/libbsc/meas_rep.c R src/libbsc/net_init.c R src/libbsc/paging.c R src/libbsc/pcu_sock.c R src/libbsc/rest_octets.c R src/libbsc/system_information.c R src/libcommon-cs/Makefile.am R src/libcommon-cs/common_cs.c R src/libcommon-cs/common_cs_vty.c R src/libcommon/Makefile.am R src/libcommon/bsc_version.c R src/libcommon/common_vty.c R src/libcommon/debug.c R src/libcommon/gsm_data.c R src/libcommon/gsm_data_shared.c R src/libcommon/gsm_subscriber_base.c R src/libcommon/gsup_client.c R src/libcommon/gsup_test_client.c R src/libcommon/oap_client.c R src/libcommon/socket.c R src/libcommon/talloc_ctx.c R src/libfilter/Makefile.am R src/libfilter/bsc_msg_acc.c R src/libfilter/bsc_msg_filter.c R src/libfilter/bsc_msg_vty.c R src/libiu/Makefile.am R src/libiu/iu.c R src/libiu/iu_vty.c R src/libmgcp/Makefile.am R src/libmgcp/g711common.h R src/libmgcp/mgcp_network.c R src/libmgcp/mgcp_osmux.c R src/libmgcp/mgcp_protocol.c R src/libmgcp/mgcp_sdp.c R src/libmgcp/mgcp_transcode.c R src/libmgcp/mgcp_vty.c R src/libmsc/Makefile.am R src/libmsc/auth.c R src/libmsc/ctrl_commands.c R src/libmsc/db.c R src/libmsc/gsm_04_08.c R src/libmsc/gsm_04_11.c R src/libmsc/gsm_04_80.c R src/libmsc/gsm_subscriber.c R src/libmsc/meas_feed.c R src/libmsc/meas_feed.h R src/libmsc/mncc.c R src/libmsc/mncc_builtin.c R src/libmsc/mncc_sock.c R src/libmsc/osmo_msc.c R src/libmsc/rrlp.c R src/libmsc/silent_call.c R src/libmsc/smpp_openbsc.c R src/libmsc/smpp_smsc.c R src/libmsc/smpp_smsc.h R src/libmsc/smpp_utils.c R src/libmsc/smpp_vty.c R src/libmsc/sms_queue.c R src/libmsc/token_auth.c R src/libmsc/transaction.c R src/libmsc/ussd.c R src/libmsc/vty_interface_layer3.c R src/libtrau/Makefile.am R src/libtrau/rtp_proxy.c R src/libtrau/trau_mux.c R src/libtrau/trau_upqueue.c R src/osmo-bsc/Makefile.am R src/osmo-bsc/osmo_bsc_api.c R src/osmo-bsc/osmo_bsc_audio.c R src/osmo-bsc/osmo_bsc_bssap.c R src/osmo-bsc/osmo_bsc_ctrl.c R src/osmo-bsc/osmo_bsc_filter.c R src/osmo-bsc/osmo_bsc_grace.c R src/osmo-bsc/osmo_bsc_main.c R src/osmo-bsc/osmo_bsc_msc.c R src/osmo-bsc/osmo_bsc_sccp.c R src/osmo-bsc/osmo_bsc_vty.c R src/osmo-bsc_mgcp/Makefile.am R src/osmo-bsc_mgcp/mgcp_main.c R src/osmo-bsc_nat/Makefile.am R src/osmo-bsc_nat/bsc_filter.c R src/osmo-bsc_nat/bsc_mgcp_utils.c R src/osmo-bsc_nat/bsc_nat.c R src/osmo-bsc_nat/bsc_nat_ctrl.c R src/osmo-bsc_nat/bsc_nat_filter.c R src/osmo-bsc_nat/bsc_nat_rewrite.c R src/osmo-bsc_nat/bsc_nat_rewrite_trie.c R src/osmo-bsc_nat/bsc_nat_utils.c R src/osmo-bsc_nat/bsc_nat_vty.c R src/osmo-bsc_nat/bsc_sccp.c R src/osmo-bsc_nat/bsc_ussd.c R src/osmo-nitb/Makefile.am R src/osmo-nitb/bsc_hack.c R src/utils/Makefile.am R src/utils/bs11_config.c R src/utils/isdnsync.c R src/utils/meas_db.c R src/utils/meas_db.h R src/utils/meas_json.c R src/utils/meas_pcap2db.c R src/utils/meas_udp2db.c R src/utils/meas_vis.c R src/utils/smpp_mirror.c R tests/Makefile.am R tests/abis/Makefile.am R tests/abis/abis_test.c R tests/abis/abis_test.ok R tests/atlocal.in R tests/bsc-nat-trie/Makefile.am R tests/bsc-nat-trie/bsc_nat_trie_test.c R tests/bsc-nat-trie/bsc_nat_trie_test.ok R tests/bsc-nat-trie/prefixes.csv R tests/bsc-nat/Makefile.am R tests/bsc-nat/barr.cfg R tests/bsc-nat/barr_dup.cfg R tests/bsc-nat/bsc_data.c R tests/bsc-nat/bsc_nat_test.c R tests/bsc-nat/bsc_nat_test.ok R tests/bsc-nat/prefixes.csv R tests/bsc/Makefile.am R tests/bsc/bsc_test.c R tests/bsc/bsc_test.ok R tests/channel/Makefile.am R tests/channel/channel_test.c R tests/channel/channel_test.ok R tests/ctrl_test_runner.py R tests/db/Makefile.am R tests/db/db_test.c R tests/db/db_test.err R tests/db/db_test.ok R tests/db/hlr.sqlite3 R tests/gbproxy/Makefile.am R tests/gbproxy/gbproxy_test.c R tests/gbproxy/gbproxy_test.ok R tests/gprs/Makefile.am R tests/gprs/gprs_test.c R tests/gprs/gprs_test.ok R tests/gsm0408/Makefile.am R tests/gsm0408/gsm0408_test.c R tests/gsm0408/gsm0408_test.ok R tests/gtphub/Makefile.am R tests/gtphub/gtphub_test.c R tests/gtphub/gtphub_test.ok R tests/mgcp/Makefile.am R tests/mgcp/mgcp_test.c R tests/mgcp/mgcp_test.ok R tests/mgcp/mgcp_transcoding_test.c R tests/mgcp/mgcp_transcoding_test.ok R tests/mm_auth/Makefile.am R tests/mm_auth/mm_auth_test.c R tests/mm_auth/mm_auth_test.ok R tests/nanobts_omlattr/Makefile.am R tests/nanobts_omlattr/nanobts_omlattr_test.c R tests/nanobts_omlattr/nanobts_omlattr_test.ok R tests/oap/Makefile.am R tests/oap/oap_client_test.c R tests/oap/oap_client_test.err R tests/oap/oap_client_test.ok R tests/sgsn/Makefile.am R tests/sgsn/sgsn_test.c R tests/sgsn/sgsn_test.ok R tests/slhc/Makefile.am R tests/slhc/slhc_test.c R tests/slhc/slhc_test.ok R tests/smpp/Makefile.am R tests/smpp/smpp_test.c R tests/smpp/smpp_test.err R tests/smpp/smpp_test.ok R tests/smpp_test_runner.py R tests/sndcp_xid/Makefile.am R tests/sndcp_xid/sndcp_xid_test.c R tests/sndcp_xid/sndcp_xid_test.ok R tests/subscr/Makefile.am R tests/subscr/bsc_subscr_test.c R tests/subscr/bsc_subscr_test.err R tests/subscr/bsc_subscr_test.ok R tests/subscr/subscr_test.c R tests/subscr/subscr_test.ok R tests/testsuite.at R tests/trau/Makefile.am R tests/trau/trau_test.c R tests/trau/trau_test.ok R tests/v42bis/Makefile.am R tests/v42bis/v42bis_test.c R tests/v42bis/v42bis_test.ok R tests/vty_test_runner.py R tests/xid/Makefile.am R tests/xid/xid_test.c R tests/xid/xid_test.ok R tools/hlrstat.pl 446 files changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/AUTHORS b/AUTHORS similarity index 100% rename from openbsc/AUTHORS rename to AUTHORS diff --git a/openbsc/COPYING b/COPYING similarity index 100% rename from openbsc/COPYING rename to COPYING diff --git a/openbsc/Makefile.am b/Makefile.am similarity index 100% rename from openbsc/Makefile.am rename to Makefile.am diff --git a/openbsc/README b/README similarity index 100% rename from openbsc/README rename to README diff --git a/openbsc/README.vty-tests b/README.vty-tests similarity index 100% rename from openbsc/README.vty-tests rename to README.vty-tests diff --git a/openbsc/configure.ac b/configure.ac similarity index 100% rename from openbsc/configure.ac rename to configure.ac diff --git a/openbsc/contrib/a-link/sccp-split-by-con.lua b/contrib/a-link/sccp-split-by-con.lua similarity index 100% rename from openbsc/contrib/a-link/sccp-split-by-con.lua rename to contrib/a-link/sccp-split-by-con.lua diff --git a/openbsc/contrib/bsc-test/README b/contrib/bsc-test/README similarity index 100% rename from openbsc/contrib/bsc-test/README rename to contrib/bsc-test/README diff --git a/openbsc/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial similarity index 100% rename from openbsc/contrib/bsc-test/all_dial rename to contrib/bsc-test/all_dial diff --git a/openbsc/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh similarity index 100% rename from openbsc/contrib/bsc-test/dial.sh rename to contrib/bsc-test/dial.sh diff --git a/openbsc/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh similarity index 100% rename from openbsc/contrib/bsc-test/drop-oml.sh rename to contrib/bsc-test/drop-oml.sh diff --git a/openbsc/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh similarity index 100% rename from openbsc/contrib/bsc-test/drop.sh rename to contrib/bsc-test/drop.sh diff --git a/openbsc/contrib/bsc-test/hangup b/contrib/bsc-test/hangup similarity index 100% rename from openbsc/contrib/bsc-test/hangup rename to contrib/bsc-test/hangup diff --git a/openbsc/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh similarity index 100% rename from openbsc/contrib/bsc-test/msc.sh rename to contrib/bsc-test/msc.sh diff --git a/openbsc/contrib/bsc_control.py b/contrib/bsc_control.py similarity index 100% rename from openbsc/contrib/bsc_control.py rename to contrib/bsc_control.py diff --git a/openbsc/contrib/bt.py b/contrib/bt.py similarity index 100% rename from openbsc/contrib/bt.py rename to contrib/bt.py diff --git a/openbsc/contrib/convert_to_enum.py b/contrib/convert_to_enum.py similarity index 100% rename from openbsc/contrib/convert_to_enum.py rename to contrib/convert_to_enum.py diff --git a/openbsc/contrib/ctrl2sse.py b/contrib/ctrl2sse.py similarity index 100% rename from openbsc/contrib/ctrl2sse.py rename to contrib/ctrl2sse.py diff --git a/openbsc/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py similarity index 100% rename from openbsc/contrib/gprs/gb-proxy-unblock-bug.py rename to contrib/gprs/gb-proxy-unblock-bug.py diff --git a/openbsc/contrib/gprs/gprs-bssgp-histogram.lua b/contrib/gprs/gprs-bssgp-histogram.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-bssgp-histogram.lua rename to contrib/gprs/gprs-bssgp-histogram.lua diff --git a/openbsc/contrib/gprs/gprs-buffer-count.lua b/contrib/gprs/gprs-buffer-count.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-buffer-count.lua rename to contrib/gprs/gprs-buffer-count.lua diff --git a/openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua b/contrib/gprs/gprs-split-trace-by-tlli.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua rename to contrib/gprs/gprs-split-trace-by-tlli.lua diff --git a/openbsc/contrib/gprs/gprs-verify-nu.lua b/contrib/gprs/gprs-verify-nu.lua similarity index 100% rename from openbsc/contrib/gprs/gprs-verify-nu.lua rename to contrib/gprs/gprs-verify-nu.lua diff --git a/openbsc/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql similarity index 100% rename from openbsc/contrib/hlr-remove-old.sql rename to contrib/hlr-remove-old.sql diff --git a/openbsc/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py similarity index 100% rename from openbsc/contrib/hlrsync/hlrsync.py rename to contrib/hlrsync/hlrsync.py diff --git a/openbsc/contrib/ipa.py b/contrib/ipa.py similarity index 100% rename from openbsc/contrib/ipa.py rename to contrib/ipa.py diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 068ee34..b315b97 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -43,7 +43,6 @@ set -x cd "$base" -cd openbsc autoreconf --install --force ./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE diff --git a/openbsc/contrib/mgcp_server.py b/contrib/mgcp_server.py similarity index 100% rename from openbsc/contrib/mgcp_server.py rename to contrib/mgcp_server.py diff --git a/openbsc/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c similarity index 100% rename from openbsc/contrib/nat/test_regexp.c rename to contrib/nat/test_regexp.c diff --git a/openbsc/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py similarity index 100% rename from openbsc/contrib/nat/ussd_example.py rename to contrib/nat/ussd_example.py diff --git a/openbsc/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl similarity index 100% rename from openbsc/contrib/rtp/gen_rtp_header.erl rename to contrib/rtp/gen_rtp_header.erl diff --git a/openbsc/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay.st rename to contrib/rtp/rtp_replay.st diff --git a/openbsc/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay_shared.st rename to contrib/rtp/rtp_replay_shared.st diff --git a/openbsc/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st similarity index 100% rename from openbsc/contrib/rtp/rtp_replay_sip.st rename to contrib/rtp/rtp_replay_sip.st diff --git a/openbsc/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua similarity index 100% rename from openbsc/contrib/rtp/timestamp_rtp.lua rename to contrib/rtp/timestamp_rtp.lua diff --git a/openbsc/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st similarity index 100% rename from openbsc/contrib/sms/fill-hlr.st rename to contrib/sms/fill-hlr.st diff --git a/openbsc/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st similarity index 100% rename from openbsc/contrib/sms/hlr-query.st rename to contrib/sms/hlr-query.st diff --git a/openbsc/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d similarity index 100% rename from openbsc/contrib/sms/sqlite-probe.tap.d rename to contrib/sms/sqlite-probe.tap.d diff --git a/openbsc/contrib/soap.py b/contrib/soap.py similarity index 100% rename from openbsc/contrib/soap.py rename to contrib/soap.py diff --git a/openbsc/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service similarity index 100% rename from openbsc/contrib/systemd/osmo-bsc-mgcp.service rename to contrib/systemd/osmo-bsc-mgcp.service diff --git a/openbsc/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service similarity index 100% rename from openbsc/contrib/systemd/osmo-bsc.service rename to contrib/systemd/osmo-bsc.service diff --git a/openbsc/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service similarity index 100% rename from openbsc/contrib/systemd/osmo-gbproxy.service rename to contrib/systemd/osmo-gbproxy.service diff --git a/openbsc/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service similarity index 100% rename from openbsc/contrib/systemd/osmo-nitb.service rename to contrib/systemd/osmo-nitb.service diff --git a/openbsc/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service similarity index 100% rename from openbsc/contrib/systemd/osmo-sgsn.service rename to contrib/systemd/osmo-sgsn.service diff --git a/openbsc/contrib/testconv/Makefile b/contrib/testconv/Makefile similarity index 100% rename from openbsc/contrib/testconv/Makefile rename to contrib/testconv/Makefile diff --git a/openbsc/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c similarity index 100% rename from openbsc/contrib/testconv/testconv_main.c rename to contrib/testconv/testconv_main.c diff --git a/openbsc/contrib/twisted_ipa.py b/contrib/twisted_ipa.py similarity index 100% rename from openbsc/contrib/twisted_ipa.py rename to contrib/twisted_ipa.py diff --git a/openbsc/doc/BS11-OML.txt b/doc/BS11-OML.txt similarity index 100% rename from openbsc/doc/BS11-OML.txt rename to doc/BS11-OML.txt diff --git a/openbsc/doc/Makefile.am b/doc/Makefile.am similarity index 100% rename from openbsc/doc/Makefile.am rename to doc/Makefile.am diff --git a/openbsc/doc/call-routing.txt b/doc/call-routing.txt similarity index 100% rename from openbsc/doc/call-routing.txt rename to doc/call-routing.txt diff --git a/openbsc/doc/channel_release.txt b/doc/channel_release.txt similarity index 100% rename from openbsc/doc/channel_release.txt rename to doc/channel_release.txt diff --git a/openbsc/doc/e1-data-model.txt b/doc/e1-data-model.txt similarity index 100% rename from openbsc/doc/e1-data-model.txt rename to doc/e1-data-model.txt diff --git a/openbsc/doc/examples/Makefile.am b/doc/examples/Makefile.am similarity index 100% rename from openbsc/doc/examples/Makefile.am rename to doc/examples/Makefile.am diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg rename to doc/examples/osmo-bsc/osmo-bsc.cfg diff --git a/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg rename to doc/examples/osmo-bsc_mgcp/mgcp.cfg diff --git a/openbsc/doc/examples/osmo-bsc_nat/black-list.cfg b/doc/examples/osmo-bsc_nat/black-list.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/black-list.cfg rename to doc/examples/osmo-bsc_nat/black-list.cfg diff --git a/openbsc/doc/examples/osmo-bsc_nat/bscs.config b/doc/examples/osmo-bsc_nat/bscs.config similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/bscs.config rename to doc/examples/osmo-bsc_nat/bscs.config diff --git a/openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg rename to doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg diff --git a/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg rename to doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg diff --git a/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg rename to doc/examples/osmo-gbproxy/osmo-gbproxy.cfg diff --git a/openbsc/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/gtphub-example.txt rename to doc/examples/osmo-gtphub/gtphub-example.txt diff --git a/openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg rename to doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg diff --git a/openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg similarity index 100% rename from openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg rename to doc/examples/osmo-gtphub/osmo-gtphub.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg b/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg b/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg b/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg rename to doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg b/doc/examples/osmo-nitb/bs11/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg rename to doc/examples/osmo-nitb/bs11/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg b/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg rename to doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg b/doc/examples/osmo-nitb/nanobts/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg rename to doc/examples/osmo-nitb/nanobts/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg b/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg rename to doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg diff --git a/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg b/doc/examples/osmo-nitb/rbs2308/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg rename to doc/examples/osmo-nitb/rbs2308/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg b/doc/examples/osmo-nitb/sysmobts/openbsc.cfg similarity index 100% rename from openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg rename to doc/examples/osmo-nitb/sysmobts/openbsc.cfg diff --git a/openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg similarity index 100% rename from openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg rename to doc/examples/osmo-sgsn/osmo-sgsn.cfg diff --git a/openbsc/doc/gsm-hopping.txt b/doc/gsm-hopping.txt similarity index 100% rename from openbsc/doc/gsm-hopping.txt rename to doc/gsm-hopping.txt diff --git a/openbsc/doc/handover.txt b/doc/handover.txt similarity index 100% rename from openbsc/doc/handover.txt rename to doc/handover.txt diff --git a/openbsc/doc/ipa-sccp.txt b/doc/ipa-sccp.txt similarity index 100% rename from openbsc/doc/ipa-sccp.txt rename to doc/ipa-sccp.txt diff --git a/openbsc/doc/oml-interface.txt b/doc/oml-interface.txt similarity index 100% rename from openbsc/doc/oml-interface.txt rename to doc/oml-interface.txt diff --git a/openbsc/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot similarity index 100% rename from openbsc/doc/osmo-nitb-data_structures.dot rename to doc/osmo-nitb-data_structures.dot diff --git a/openbsc/doc/paging.txt b/doc/paging.txt similarity index 100% rename from openbsc/doc/paging.txt rename to doc/paging.txt diff --git a/openbsc/git-version-gen b/git-version-gen similarity index 100% rename from openbsc/git-version-gen rename to git-version-gen diff --git a/openbsc/include/Makefile.am b/include/Makefile.am similarity index 100% rename from openbsc/include/Makefile.am rename to include/Makefile.am diff --git a/openbsc/include/compat_af_isdn.h b/include/compat_af_isdn.h similarity index 100% rename from openbsc/include/compat_af_isdn.h rename to include/compat_af_isdn.h diff --git a/openbsc/include/mISDNif.h b/include/mISDNif.h similarity index 100% rename from openbsc/include/mISDNif.h rename to include/mISDNif.h diff --git a/openbsc/include/openbsc/Makefile.am b/include/openbsc/Makefile.am similarity index 100% rename from openbsc/include/openbsc/Makefile.am rename to include/openbsc/Makefile.am diff --git a/openbsc/include/openbsc/abis_nm.h b/include/openbsc/abis_nm.h similarity index 100% rename from openbsc/include/openbsc/abis_nm.h rename to include/openbsc/abis_nm.h diff --git a/openbsc/include/openbsc/abis_om2000.h b/include/openbsc/abis_om2000.h similarity index 100% rename from openbsc/include/openbsc/abis_om2000.h rename to include/openbsc/abis_om2000.h diff --git a/openbsc/include/openbsc/abis_rsl.h b/include/openbsc/abis_rsl.h similarity index 100% rename from openbsc/include/openbsc/abis_rsl.h rename to include/openbsc/abis_rsl.h diff --git a/openbsc/include/openbsc/arfcn_range_encode.h b/include/openbsc/arfcn_range_encode.h similarity index 100% rename from openbsc/include/openbsc/arfcn_range_encode.h rename to include/openbsc/arfcn_range_encode.h diff --git a/openbsc/include/openbsc/auth.h b/include/openbsc/auth.h similarity index 100% rename from openbsc/include/openbsc/auth.h rename to include/openbsc/auth.h diff --git a/openbsc/include/openbsc/bsc_api.h b/include/openbsc/bsc_api.h similarity index 100% rename from openbsc/include/openbsc/bsc_api.h rename to include/openbsc/bsc_api.h diff --git a/openbsc/include/openbsc/bsc_msc.h b/include/openbsc/bsc_msc.h similarity index 100% rename from openbsc/include/openbsc/bsc_msc.h rename to include/openbsc/bsc_msc.h diff --git a/openbsc/include/openbsc/bsc_msc_data.h b/include/openbsc/bsc_msc_data.h similarity index 100% rename from openbsc/include/openbsc/bsc_msc_data.h rename to include/openbsc/bsc_msc_data.h diff --git a/openbsc/include/openbsc/bsc_msg_filter.h b/include/openbsc/bsc_msg_filter.h similarity index 100% rename from openbsc/include/openbsc/bsc_msg_filter.h rename to include/openbsc/bsc_msg_filter.h diff --git a/openbsc/include/openbsc/bsc_nat.h b/include/openbsc/bsc_nat.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat.h rename to include/openbsc/bsc_nat.h diff --git a/openbsc/include/openbsc/bsc_nat_callstats.h b/include/openbsc/bsc_nat_callstats.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat_callstats.h rename to include/openbsc/bsc_nat_callstats.h diff --git a/openbsc/include/openbsc/bsc_nat_sccp.h b/include/openbsc/bsc_nat_sccp.h similarity index 100% rename from openbsc/include/openbsc/bsc_nat_sccp.h rename to include/openbsc/bsc_nat_sccp.h diff --git a/openbsc/include/openbsc/bsc_rll.h b/include/openbsc/bsc_rll.h similarity index 100% rename from openbsc/include/openbsc/bsc_rll.h rename to include/openbsc/bsc_rll.h diff --git a/openbsc/include/openbsc/bsc_subscriber.h b/include/openbsc/bsc_subscriber.h similarity index 100% rename from openbsc/include/openbsc/bsc_subscriber.h rename to include/openbsc/bsc_subscriber.h diff --git a/openbsc/include/openbsc/bss.h b/include/openbsc/bss.h similarity index 100% rename from openbsc/include/openbsc/bss.h rename to include/openbsc/bss.h diff --git a/openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/openbsc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/openbsc/bts_ipaccess_nanobts_omlattr.h diff --git a/openbsc/include/openbsc/chan_alloc.h b/include/openbsc/chan_alloc.h similarity index 100% rename from openbsc/include/openbsc/chan_alloc.h rename to include/openbsc/chan_alloc.h diff --git a/openbsc/include/openbsc/common_bsc.h b/include/openbsc/common_bsc.h similarity index 100% rename from openbsc/include/openbsc/common_bsc.h rename to include/openbsc/common_bsc.h diff --git a/openbsc/include/openbsc/common_cs.h b/include/openbsc/common_cs.h similarity index 100% rename from openbsc/include/openbsc/common_cs.h rename to include/openbsc/common_cs.h diff --git a/openbsc/include/openbsc/crc24.h b/include/openbsc/crc24.h similarity index 100% rename from openbsc/include/openbsc/crc24.h rename to include/openbsc/crc24.h diff --git a/openbsc/include/openbsc/ctrl.h b/include/openbsc/ctrl.h similarity index 100% rename from openbsc/include/openbsc/ctrl.h rename to include/openbsc/ctrl.h diff --git a/openbsc/include/openbsc/db.h b/include/openbsc/db.h similarity index 100% rename from openbsc/include/openbsc/db.h rename to include/openbsc/db.h diff --git a/openbsc/include/openbsc/debug.h b/include/openbsc/debug.h similarity index 100% rename from openbsc/include/openbsc/debug.h rename to include/openbsc/debug.h diff --git a/openbsc/include/openbsc/e1_config.h b/include/openbsc/e1_config.h similarity index 100% rename from openbsc/include/openbsc/e1_config.h rename to include/openbsc/e1_config.h diff --git a/openbsc/include/openbsc/gb_proxy.h b/include/openbsc/gb_proxy.h similarity index 100% rename from openbsc/include/openbsc/gb_proxy.h rename to include/openbsc/gb_proxy.h diff --git a/openbsc/include/openbsc/gprs_gb_parse.h b/include/openbsc/gprs_gb_parse.h similarity index 100% rename from openbsc/include/openbsc/gprs_gb_parse.h rename to include/openbsc/gprs_gb_parse.h diff --git a/openbsc/include/openbsc/gprs_gmm.h b/include/openbsc/gprs_gmm.h similarity index 100% rename from openbsc/include/openbsc/gprs_gmm.h rename to include/openbsc/gprs_gmm.h diff --git a/openbsc/include/openbsc/gprs_llc.h b/include/openbsc/gprs_llc.h similarity index 100% rename from openbsc/include/openbsc/gprs_llc.h rename to include/openbsc/gprs_llc.h diff --git a/openbsc/include/openbsc/gprs_llc_xid.h b/include/openbsc/gprs_llc_xid.h similarity index 100% rename from openbsc/include/openbsc/gprs_llc_xid.h rename to include/openbsc/gprs_llc_xid.h diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h similarity index 100% rename from openbsc/include/openbsc/gprs_sgsn.h rename to include/openbsc/gprs_sgsn.h diff --git a/openbsc/include/openbsc/gprs_sndcp.h b/include/openbsc/gprs_sndcp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp.h rename to include/openbsc/gprs_sndcp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_comp.h b/include/openbsc/gprs_sndcp_comp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_comp.h rename to include/openbsc/gprs_sndcp_comp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_dcomp.h b/include/openbsc/gprs_sndcp_dcomp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_dcomp.h rename to include/openbsc/gprs_sndcp_dcomp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_pcomp.h b/include/openbsc/gprs_sndcp_pcomp.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_pcomp.h rename to include/openbsc/gprs_sndcp_pcomp.h diff --git a/openbsc/include/openbsc/gprs_sndcp_xid.h b/include/openbsc/gprs_sndcp_xid.h similarity index 100% rename from openbsc/include/openbsc/gprs_sndcp_xid.h rename to include/openbsc/gprs_sndcp_xid.h diff --git a/openbsc/include/openbsc/gprs_subscriber.h b/include/openbsc/gprs_subscriber.h similarity index 100% rename from openbsc/include/openbsc/gprs_subscriber.h rename to include/openbsc/gprs_subscriber.h diff --git a/openbsc/include/openbsc/gprs_utils.h b/include/openbsc/gprs_utils.h similarity index 100% rename from openbsc/include/openbsc/gprs_utils.h rename to include/openbsc/gprs_utils.h diff --git a/openbsc/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_08.h rename to include/openbsc/gsm_04_08.h diff --git a/openbsc/include/openbsc/gsm_04_11.h b/include/openbsc/gsm_04_11.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_11.h rename to include/openbsc/gsm_04_11.h diff --git a/openbsc/include/openbsc/gsm_04_80.h b/include/openbsc/gsm_04_80.h similarity index 100% rename from openbsc/include/openbsc/gsm_04_80.h rename to include/openbsc/gsm_04_80.h diff --git a/openbsc/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h similarity index 100% rename from openbsc/include/openbsc/gsm_data.h rename to include/openbsc/gsm_data.h diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/include/openbsc/gsm_data_shared.h similarity index 100% rename from openbsc/include/openbsc/gsm_data_shared.h rename to include/openbsc/gsm_data_shared.h diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h similarity index 100% rename from openbsc/include/openbsc/gsm_subscriber.h rename to include/openbsc/gsm_subscriber.h diff --git a/openbsc/include/openbsc/gsup_client.h b/include/openbsc/gsup_client.h similarity index 100% rename from openbsc/include/openbsc/gsup_client.h rename to include/openbsc/gsup_client.h diff --git a/openbsc/include/openbsc/gtphub.h b/include/openbsc/gtphub.h similarity index 100% rename from openbsc/include/openbsc/gtphub.h rename to include/openbsc/gtphub.h diff --git a/openbsc/include/openbsc/handover.h b/include/openbsc/handover.h similarity index 100% rename from openbsc/include/openbsc/handover.h rename to include/openbsc/handover.h diff --git a/openbsc/include/openbsc/handover_decision.h b/include/openbsc/handover_decision.h similarity index 100% rename from openbsc/include/openbsc/handover_decision.h rename to include/openbsc/handover_decision.h diff --git a/openbsc/include/openbsc/ipaccess.h b/include/openbsc/ipaccess.h similarity index 100% rename from openbsc/include/openbsc/ipaccess.h rename to include/openbsc/ipaccess.h diff --git a/openbsc/include/openbsc/iu.h b/include/openbsc/iu.h similarity index 100% rename from openbsc/include/openbsc/iu.h rename to include/openbsc/iu.h diff --git a/openbsc/include/openbsc/meas_feed.h b/include/openbsc/meas_feed.h similarity index 100% rename from openbsc/include/openbsc/meas_feed.h rename to include/openbsc/meas_feed.h diff --git a/openbsc/include/openbsc/meas_rep.h b/include/openbsc/meas_rep.h similarity index 100% rename from openbsc/include/openbsc/meas_rep.h rename to include/openbsc/meas_rep.h diff --git a/openbsc/include/openbsc/mgcp.h b/include/openbsc/mgcp.h similarity index 100% rename from openbsc/include/openbsc/mgcp.h rename to include/openbsc/mgcp.h diff --git a/openbsc/include/openbsc/mgcp_internal.h b/include/openbsc/mgcp_internal.h similarity index 100% rename from openbsc/include/openbsc/mgcp_internal.h rename to include/openbsc/mgcp_internal.h diff --git a/openbsc/include/openbsc/mgcp_transcode.h b/include/openbsc/mgcp_transcode.h similarity index 100% rename from openbsc/include/openbsc/mgcp_transcode.h rename to include/openbsc/mgcp_transcode.h diff --git a/openbsc/include/openbsc/misdn.h b/include/openbsc/misdn.h similarity index 100% rename from openbsc/include/openbsc/misdn.h rename to include/openbsc/misdn.h diff --git a/openbsc/include/openbsc/mncc.h b/include/openbsc/mncc.h similarity index 100% rename from openbsc/include/openbsc/mncc.h rename to include/openbsc/mncc.h diff --git a/openbsc/include/openbsc/mncc_int.h b/include/openbsc/mncc_int.h similarity index 100% rename from openbsc/include/openbsc/mncc_int.h rename to include/openbsc/mncc_int.h diff --git a/openbsc/include/openbsc/nat_rewrite_trie.h b/include/openbsc/nat_rewrite_trie.h similarity index 100% rename from openbsc/include/openbsc/nat_rewrite_trie.h rename to include/openbsc/nat_rewrite_trie.h diff --git a/openbsc/include/openbsc/network_listen.h b/include/openbsc/network_listen.h similarity index 100% rename from openbsc/include/openbsc/network_listen.h rename to include/openbsc/network_listen.h diff --git a/openbsc/include/openbsc/oap_client.h b/include/openbsc/oap_client.h similarity index 100% rename from openbsc/include/openbsc/oap_client.h rename to include/openbsc/oap_client.h diff --git a/openbsc/include/openbsc/openbscdefines.h b/include/openbsc/openbscdefines.h similarity index 100% rename from openbsc/include/openbsc/openbscdefines.h rename to include/openbsc/openbscdefines.h diff --git a/openbsc/include/openbsc/osmo_bsc.h b/include/openbsc/osmo_bsc.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc.h rename to include/openbsc/osmo_bsc.h diff --git a/openbsc/include/openbsc/osmo_bsc_grace.h b/include/openbsc/osmo_bsc_grace.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc_grace.h rename to include/openbsc/osmo_bsc_grace.h diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/include/openbsc/osmo_bsc_rf.h similarity index 100% rename from openbsc/include/openbsc/osmo_bsc_rf.h rename to include/openbsc/osmo_bsc_rf.h diff --git a/openbsc/include/openbsc/osmo_msc.h b/include/openbsc/osmo_msc.h similarity index 100% rename from openbsc/include/openbsc/osmo_msc.h rename to include/openbsc/osmo_msc.h diff --git a/openbsc/include/openbsc/osmux.h b/include/openbsc/osmux.h similarity index 100% rename from openbsc/include/openbsc/osmux.h rename to include/openbsc/osmux.h diff --git a/openbsc/include/openbsc/paging.h b/include/openbsc/paging.h similarity index 100% rename from openbsc/include/openbsc/paging.h rename to include/openbsc/paging.h diff --git a/openbsc/include/openbsc/pcu_if.h b/include/openbsc/pcu_if.h similarity index 100% rename from openbsc/include/openbsc/pcu_if.h rename to include/openbsc/pcu_if.h diff --git a/openbsc/include/openbsc/pcuif_proto.h b/include/openbsc/pcuif_proto.h similarity index 100% rename from openbsc/include/openbsc/pcuif_proto.h rename to include/openbsc/pcuif_proto.h diff --git a/openbsc/include/openbsc/rest_octets.h b/include/openbsc/rest_octets.h similarity index 100% rename from openbsc/include/openbsc/rest_octets.h rename to include/openbsc/rest_octets.h diff --git a/openbsc/include/openbsc/rrlp.h b/include/openbsc/rrlp.h similarity index 100% rename from openbsc/include/openbsc/rrlp.h rename to include/openbsc/rrlp.h diff --git a/openbsc/include/openbsc/rs232.h b/include/openbsc/rs232.h similarity index 100% rename from openbsc/include/openbsc/rs232.h rename to include/openbsc/rs232.h diff --git a/openbsc/include/openbsc/rtp_proxy.h b/include/openbsc/rtp_proxy.h similarity index 100% rename from openbsc/include/openbsc/rtp_proxy.h rename to include/openbsc/rtp_proxy.h diff --git a/openbsc/include/openbsc/sgsn.h b/include/openbsc/sgsn.h similarity index 100% rename from openbsc/include/openbsc/sgsn.h rename to include/openbsc/sgsn.h diff --git a/openbsc/include/openbsc/signal.h b/include/openbsc/signal.h similarity index 100% rename from openbsc/include/openbsc/signal.h rename to include/openbsc/signal.h diff --git a/openbsc/include/openbsc/silent_call.h b/include/openbsc/silent_call.h similarity index 100% rename from openbsc/include/openbsc/silent_call.h rename to include/openbsc/silent_call.h diff --git a/openbsc/include/openbsc/slhc.h b/include/openbsc/slhc.h similarity index 100% rename from openbsc/include/openbsc/slhc.h rename to include/openbsc/slhc.h diff --git a/openbsc/include/openbsc/smpp.h b/include/openbsc/smpp.h similarity index 100% rename from openbsc/include/openbsc/smpp.h rename to include/openbsc/smpp.h diff --git a/openbsc/include/openbsc/sms_queue.h b/include/openbsc/sms_queue.h similarity index 100% rename from openbsc/include/openbsc/sms_queue.h rename to include/openbsc/sms_queue.h diff --git a/openbsc/include/openbsc/socket.h b/include/openbsc/socket.h similarity index 100% rename from openbsc/include/openbsc/socket.h rename to include/openbsc/socket.h diff --git a/openbsc/include/openbsc/system_information.h b/include/openbsc/system_information.h similarity index 100% rename from openbsc/include/openbsc/system_information.h rename to include/openbsc/system_information.h diff --git a/openbsc/include/openbsc/token_auth.h b/include/openbsc/token_auth.h similarity index 100% rename from openbsc/include/openbsc/token_auth.h rename to include/openbsc/token_auth.h diff --git a/openbsc/include/openbsc/transaction.h b/include/openbsc/transaction.h similarity index 100% rename from openbsc/include/openbsc/transaction.h rename to include/openbsc/transaction.h diff --git a/openbsc/include/openbsc/trau_mux.h b/include/openbsc/trau_mux.h similarity index 100% rename from openbsc/include/openbsc/trau_mux.h rename to include/openbsc/trau_mux.h diff --git a/openbsc/include/openbsc/trau_upqueue.h b/include/openbsc/trau_upqueue.h similarity index 100% rename from openbsc/include/openbsc/trau_upqueue.h rename to include/openbsc/trau_upqueue.h diff --git a/openbsc/include/openbsc/ussd.h b/include/openbsc/ussd.h similarity index 100% rename from openbsc/include/openbsc/ussd.h rename to include/openbsc/ussd.h diff --git a/openbsc/include/openbsc/v42bis.h b/include/openbsc/v42bis.h similarity index 100% rename from openbsc/include/openbsc/v42bis.h rename to include/openbsc/v42bis.h diff --git a/openbsc/include/openbsc/v42bis_private.h b/include/openbsc/v42bis_private.h similarity index 100% rename from openbsc/include/openbsc/v42bis_private.h rename to include/openbsc/v42bis_private.h diff --git a/openbsc/include/openbsc/vty.h b/include/openbsc/vty.h similarity index 100% rename from openbsc/include/openbsc/vty.h rename to include/openbsc/vty.h diff --git a/openbsc/m4/README b/m4/README similarity index 100% rename from openbsc/m4/README rename to m4/README diff --git a/openbsc/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 similarity index 100% rename from openbsc/m4/ax_check_compile_flag.m4 rename to m4/ax_check_compile_flag.m4 diff --git a/openbsc/openbsc.pc.in b/openbsc.pc.in similarity index 100% rename from openbsc/openbsc.pc.in rename to openbsc.pc.in diff --git a/openbsc/osmoappdesc.py b/osmoappdesc.py similarity index 100% rename from openbsc/osmoappdesc.py rename to osmoappdesc.py diff --git a/openbsc/src/Makefile.am b/src/Makefile.am similarity index 100% rename from openbsc/src/Makefile.am rename to src/Makefile.am diff --git a/openbsc/src/gprs/.gitignore b/src/gprs/.gitignore similarity index 100% rename from openbsc/src/gprs/.gitignore rename to src/gprs/.gitignore diff --git a/openbsc/src/gprs/Makefile.am b/src/gprs/Makefile.am similarity index 100% rename from openbsc/src/gprs/Makefile.am rename to src/gprs/Makefile.am diff --git a/openbsc/src/gprs/crc24.c b/src/gprs/crc24.c similarity index 100% rename from openbsc/src/gprs/crc24.c rename to src/gprs/crc24.c diff --git a/openbsc/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c similarity index 100% rename from openbsc/src/gprs/gb_proxy.c rename to src/gprs/gb_proxy.c diff --git a/openbsc/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_main.c rename to src/gprs/gb_proxy_main.c diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_patch.c rename to src/gprs/gb_proxy_patch.c diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_peer.c rename to src/gprs/gb_proxy_peer.c diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/src/gprs/gb_proxy_tlli.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_tlli.c rename to src/gprs/gb_proxy_tlli.c diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c similarity index 100% rename from openbsc/src/gprs/gb_proxy_vty.c rename to src/gprs/gb_proxy_vty.c diff --git a/openbsc/src/gprs/gprs_gb_parse.c b/src/gprs/gprs_gb_parse.c similarity index 100% rename from openbsc/src/gprs/gprs_gb_parse.c rename to src/gprs/gprs_gb_parse.c diff --git a/openbsc/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c similarity index 100% rename from openbsc/src/gprs/gprs_gmm.c rename to src/gprs/gprs_gmm.c diff --git a/openbsc/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c similarity index 100% rename from openbsc/src/gprs/gprs_llc.c rename to src/gprs/gprs_llc.c diff --git a/openbsc/src/gprs/gprs_llc_parse.c b/src/gprs/gprs_llc_parse.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_parse.c rename to src/gprs/gprs_llc_parse.c diff --git a/openbsc/src/gprs/gprs_llc_vty.c b/src/gprs/gprs_llc_vty.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_vty.c rename to src/gprs/gprs_llc_vty.c diff --git a/openbsc/src/gprs/gprs_llc_xid.c b/src/gprs/gprs_llc_xid.c similarity index 100% rename from openbsc/src/gprs/gprs_llc_xid.c rename to src/gprs/gprs_llc_xid.c diff --git a/openbsc/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c similarity index 100% rename from openbsc/src/gprs/gprs_sgsn.c rename to src/gprs/gprs_sgsn.c diff --git a/openbsc/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp.c rename to src/gprs/gprs_sndcp.c diff --git a/openbsc/src/gprs/gprs_sndcp_comp.c b/src/gprs/gprs_sndcp_comp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_comp.c rename to src/gprs/gprs_sndcp_comp.c diff --git a/openbsc/src/gprs/gprs_sndcp_dcomp.c b/src/gprs/gprs_sndcp_dcomp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_dcomp.c rename to src/gprs/gprs_sndcp_dcomp.c diff --git a/openbsc/src/gprs/gprs_sndcp_pcomp.c b/src/gprs/gprs_sndcp_pcomp.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_pcomp.c rename to src/gprs/gprs_sndcp_pcomp.c diff --git a/openbsc/src/gprs/gprs_sndcp_vty.c b/src/gprs/gprs_sndcp_vty.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_vty.c rename to src/gprs/gprs_sndcp_vty.c diff --git a/openbsc/src/gprs/gprs_sndcp_xid.c b/src/gprs/gprs_sndcp_xid.c similarity index 100% rename from openbsc/src/gprs/gprs_sndcp_xid.c rename to src/gprs/gprs_sndcp_xid.c diff --git a/openbsc/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c similarity index 100% rename from openbsc/src/gprs/gprs_subscriber.c rename to src/gprs/gprs_subscriber.c diff --git a/openbsc/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c similarity index 100% rename from openbsc/src/gprs/gprs_utils.c rename to src/gprs/gprs_utils.c diff --git a/openbsc/src/gprs/gtphub.c b/src/gprs/gtphub.c similarity index 100% rename from openbsc/src/gprs/gtphub.c rename to src/gprs/gtphub.c diff --git a/openbsc/src/gprs/gtphub_ares.c b/src/gprs/gtphub_ares.c similarity index 100% rename from openbsc/src/gprs/gtphub_ares.c rename to src/gprs/gtphub_ares.c diff --git a/openbsc/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c similarity index 100% rename from openbsc/src/gprs/gtphub_main.c rename to src/gprs/gtphub_main.c diff --git a/openbsc/src/gprs/gtphub_sock.c b/src/gprs/gtphub_sock.c similarity index 100% rename from openbsc/src/gprs/gtphub_sock.c rename to src/gprs/gtphub_sock.c diff --git a/openbsc/src/gprs/gtphub_vty.c b/src/gprs/gtphub_vty.c similarity index 100% rename from openbsc/src/gprs/gtphub_vty.c rename to src/gprs/gtphub_vty.c diff --git a/openbsc/src/gprs/osmo_sgsn.cfg b/src/gprs/osmo_sgsn.cfg similarity index 100% rename from openbsc/src/gprs/osmo_sgsn.cfg rename to src/gprs/osmo_sgsn.cfg diff --git a/openbsc/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c similarity index 100% rename from openbsc/src/gprs/sgsn_ares.c rename to src/gprs/sgsn_ares.c diff --git a/openbsc/src/gprs/sgsn_auth.c b/src/gprs/sgsn_auth.c similarity index 100% rename from openbsc/src/gprs/sgsn_auth.c rename to src/gprs/sgsn_auth.c diff --git a/openbsc/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c similarity index 100% rename from openbsc/src/gprs/sgsn_cdr.c rename to src/gprs/sgsn_cdr.c diff --git a/openbsc/src/gprs/sgsn_ctrl.c b/src/gprs/sgsn_ctrl.c similarity index 100% rename from openbsc/src/gprs/sgsn_ctrl.c rename to src/gprs/sgsn_ctrl.c diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c similarity index 100% rename from openbsc/src/gprs/sgsn_libgtp.c rename to src/gprs/sgsn_libgtp.c diff --git a/openbsc/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c similarity index 100% rename from openbsc/src/gprs/sgsn_main.c rename to src/gprs/sgsn_main.c diff --git a/openbsc/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c similarity index 100% rename from openbsc/src/gprs/sgsn_vty.c rename to src/gprs/sgsn_vty.c diff --git a/openbsc/src/gprs/slhc.c b/src/gprs/slhc.c similarity index 100% rename from openbsc/src/gprs/slhc.c rename to src/gprs/slhc.c diff --git a/openbsc/src/gprs/v42bis.c b/src/gprs/v42bis.c similarity index 100% rename from openbsc/src/gprs/v42bis.c rename to src/gprs/v42bis.c diff --git a/openbsc/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am similarity index 100% rename from openbsc/src/ipaccess/Makefile.am rename to src/ipaccess/Makefile.am diff --git a/openbsc/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c similarity index 100% rename from openbsc/src/ipaccess/abisip-find.c rename to src/ipaccess/abisip-find.c diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-config.c rename to src/ipaccess/ipaccess-config.c diff --git a/openbsc/src/ipaccess/ipaccess-firmware.c b/src/ipaccess/ipaccess-firmware.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-firmware.c rename to src/ipaccess/ipaccess-firmware.c diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c similarity index 100% rename from openbsc/src/ipaccess/ipaccess-proxy.c rename to src/ipaccess/ipaccess-proxy.c diff --git a/openbsc/src/ipaccess/network_listen.c b/src/ipaccess/network_listen.c similarity index 100% rename from openbsc/src/ipaccess/network_listen.c rename to src/ipaccess/network_listen.c diff --git a/openbsc/src/libbsc/Makefile.am b/src/libbsc/Makefile.am similarity index 100% rename from openbsc/src/libbsc/Makefile.am rename to src/libbsc/Makefile.am diff --git a/openbsc/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c similarity index 100% rename from openbsc/src/libbsc/abis_nm.c rename to src/libbsc/abis_nm.c diff --git a/openbsc/src/libbsc/abis_nm_ipaccess.c b/src/libbsc/abis_nm_ipaccess.c similarity index 100% rename from openbsc/src/libbsc/abis_nm_ipaccess.c rename to src/libbsc/abis_nm_ipaccess.c diff --git a/openbsc/src/libbsc/abis_nm_vty.c b/src/libbsc/abis_nm_vty.c similarity index 100% rename from openbsc/src/libbsc/abis_nm_vty.c rename to src/libbsc/abis_nm_vty.c diff --git a/openbsc/src/libbsc/abis_om2000.c b/src/libbsc/abis_om2000.c similarity index 100% rename from openbsc/src/libbsc/abis_om2000.c rename to src/libbsc/abis_om2000.c diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/src/libbsc/abis_om2000_vty.c similarity index 100% rename from openbsc/src/libbsc/abis_om2000_vty.c rename to src/libbsc/abis_om2000_vty.c diff --git a/openbsc/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c similarity index 100% rename from openbsc/src/libbsc/abis_rsl.c rename to src/libbsc/abis_rsl.c diff --git a/openbsc/src/libbsc/arfcn_range_encode.c b/src/libbsc/arfcn_range_encode.c similarity index 100% rename from openbsc/src/libbsc/arfcn_range_encode.c rename to src/libbsc/arfcn_range_encode.c diff --git a/openbsc/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c similarity index 100% rename from openbsc/src/libbsc/bsc_api.c rename to src/libbsc/bsc_api.c diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c similarity index 100% rename from openbsc/src/libbsc/bsc_ctrl_commands.c rename to src/libbsc/bsc_ctrl_commands.c diff --git a/openbsc/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c similarity index 100% rename from openbsc/src/libbsc/bsc_ctrl_lookup.c rename to src/libbsc/bsc_ctrl_lookup.c diff --git a/openbsc/src/libbsc/bsc_dyn_ts.c b/src/libbsc/bsc_dyn_ts.c similarity index 100% rename from openbsc/src/libbsc/bsc_dyn_ts.c rename to src/libbsc/bsc_dyn_ts.c diff --git a/openbsc/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c similarity index 100% rename from openbsc/src/libbsc/bsc_init.c rename to src/libbsc/bsc_init.c diff --git a/openbsc/src/libbsc/bsc_msc.c b/src/libbsc/bsc_msc.c similarity index 100% rename from openbsc/src/libbsc/bsc_msc.c rename to src/libbsc/bsc_msc.c diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c similarity index 100% rename from openbsc/src/libbsc/bsc_rf_ctrl.c rename to src/libbsc/bsc_rf_ctrl.c diff --git a/openbsc/src/libbsc/bsc_rll.c b/src/libbsc/bsc_rll.c similarity index 100% rename from openbsc/src/libbsc/bsc_rll.c rename to src/libbsc/bsc_rll.c diff --git a/openbsc/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c similarity index 100% rename from openbsc/src/libbsc/bsc_subscriber.c rename to src/libbsc/bsc_subscriber.c diff --git a/openbsc/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c similarity index 100% rename from openbsc/src/libbsc/bsc_vty.c rename to src/libbsc/bsc_vty.c diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/src/libbsc/bts_ericsson_rbs2000.c similarity index 100% rename from openbsc/src/libbsc/bts_ericsson_rbs2000.c rename to src/libbsc/bts_ericsson_rbs2000.c diff --git a/openbsc/src/libbsc/bts_init.c b/src/libbsc/bts_init.c similarity index 100% rename from openbsc/src/libbsc/bts_init.c rename to src/libbsc/bts_init.c diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c similarity index 100% rename from openbsc/src/libbsc/bts_ipaccess_nanobts.c rename to src/libbsc/bts_ipaccess_nanobts.c diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/src/libbsc/bts_ipaccess_nanobts_omlattr.c similarity index 100% rename from openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c rename to src/libbsc/bts_ipaccess_nanobts_omlattr.c diff --git a/openbsc/src/libbsc/bts_nokia_site.c b/src/libbsc/bts_nokia_site.c similarity index 100% rename from openbsc/src/libbsc/bts_nokia_site.c rename to src/libbsc/bts_nokia_site.c diff --git a/openbsc/src/libbsc/bts_siemens_bs11.c b/src/libbsc/bts_siemens_bs11.c similarity index 100% rename from openbsc/src/libbsc/bts_siemens_bs11.c rename to src/libbsc/bts_siemens_bs11.c diff --git a/openbsc/src/libbsc/bts_sysmobts.c b/src/libbsc/bts_sysmobts.c similarity index 100% rename from openbsc/src/libbsc/bts_sysmobts.c rename to src/libbsc/bts_sysmobts.c diff --git a/openbsc/src/libbsc/bts_unknown.c b/src/libbsc/bts_unknown.c similarity index 100% rename from openbsc/src/libbsc/bts_unknown.c rename to src/libbsc/bts_unknown.c diff --git a/openbsc/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c similarity index 100% rename from openbsc/src/libbsc/chan_alloc.c rename to src/libbsc/chan_alloc.c diff --git a/openbsc/src/libbsc/e1_config.c b/src/libbsc/e1_config.c similarity index 100% rename from openbsc/src/libbsc/e1_config.c rename to src/libbsc/e1_config.c diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c similarity index 100% rename from openbsc/src/libbsc/gsm_04_08_utils.c rename to src/libbsc/gsm_04_08_utils.c diff --git a/openbsc/src/libbsc/gsm_04_80_utils.c b/src/libbsc/gsm_04_80_utils.c similarity index 100% rename from openbsc/src/libbsc/gsm_04_80_utils.c rename to src/libbsc/gsm_04_80_utils.c diff --git a/openbsc/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c similarity index 100% rename from openbsc/src/libbsc/handover_decision.c rename to src/libbsc/handover_decision.c diff --git a/openbsc/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c similarity index 100% rename from openbsc/src/libbsc/handover_logic.c rename to src/libbsc/handover_logic.c diff --git a/openbsc/src/libbsc/meas_proc.c b/src/libbsc/meas_proc.c similarity index 100% rename from openbsc/src/libbsc/meas_proc.c rename to src/libbsc/meas_proc.c diff --git a/openbsc/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c similarity index 100% rename from openbsc/src/libbsc/meas_rep.c rename to src/libbsc/meas_rep.c diff --git a/openbsc/src/libbsc/net_init.c b/src/libbsc/net_init.c similarity index 100% rename from openbsc/src/libbsc/net_init.c rename to src/libbsc/net_init.c diff --git a/openbsc/src/libbsc/paging.c b/src/libbsc/paging.c similarity index 100% rename from openbsc/src/libbsc/paging.c rename to src/libbsc/paging.c diff --git a/openbsc/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c similarity index 100% rename from openbsc/src/libbsc/pcu_sock.c rename to src/libbsc/pcu_sock.c diff --git a/openbsc/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c similarity index 100% rename from openbsc/src/libbsc/rest_octets.c rename to src/libbsc/rest_octets.c diff --git a/openbsc/src/libbsc/system_information.c b/src/libbsc/system_information.c similarity index 100% rename from openbsc/src/libbsc/system_information.c rename to src/libbsc/system_information.c diff --git a/openbsc/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am similarity index 100% rename from openbsc/src/libcommon-cs/Makefile.am rename to src/libcommon-cs/Makefile.am diff --git a/openbsc/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c similarity index 100% rename from openbsc/src/libcommon-cs/common_cs.c rename to src/libcommon-cs/common_cs.c diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c similarity index 100% rename from openbsc/src/libcommon-cs/common_cs_vty.c rename to src/libcommon-cs/common_cs_vty.c diff --git a/openbsc/src/libcommon/Makefile.am b/src/libcommon/Makefile.am similarity index 100% rename from openbsc/src/libcommon/Makefile.am rename to src/libcommon/Makefile.am diff --git a/openbsc/src/libcommon/bsc_version.c b/src/libcommon/bsc_version.c similarity index 100% rename from openbsc/src/libcommon/bsc_version.c rename to src/libcommon/bsc_version.c diff --git a/openbsc/src/libcommon/common_vty.c b/src/libcommon/common_vty.c similarity index 100% rename from openbsc/src/libcommon/common_vty.c rename to src/libcommon/common_vty.c diff --git a/openbsc/src/libcommon/debug.c b/src/libcommon/debug.c similarity index 100% rename from openbsc/src/libcommon/debug.c rename to src/libcommon/debug.c diff --git a/openbsc/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c similarity index 100% rename from openbsc/src/libcommon/gsm_data.c rename to src/libcommon/gsm_data.c diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c similarity index 100% rename from openbsc/src/libcommon/gsm_data_shared.c rename to src/libcommon/gsm_data_shared.c diff --git a/openbsc/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c similarity index 100% rename from openbsc/src/libcommon/gsm_subscriber_base.c rename to src/libcommon/gsm_subscriber_base.c diff --git a/openbsc/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c similarity index 100% rename from openbsc/src/libcommon/gsup_client.c rename to src/libcommon/gsup_client.c diff --git a/openbsc/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c similarity index 100% rename from openbsc/src/libcommon/gsup_test_client.c rename to src/libcommon/gsup_test_client.c diff --git a/openbsc/src/libcommon/oap_client.c b/src/libcommon/oap_client.c similarity index 100% rename from openbsc/src/libcommon/oap_client.c rename to src/libcommon/oap_client.c diff --git a/openbsc/src/libcommon/socket.c b/src/libcommon/socket.c similarity index 100% rename from openbsc/src/libcommon/socket.c rename to src/libcommon/socket.c diff --git a/openbsc/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c similarity index 100% rename from openbsc/src/libcommon/talloc_ctx.c rename to src/libcommon/talloc_ctx.c diff --git a/openbsc/src/libfilter/Makefile.am b/src/libfilter/Makefile.am similarity index 100% rename from openbsc/src/libfilter/Makefile.am rename to src/libfilter/Makefile.am diff --git a/openbsc/src/libfilter/bsc_msg_acc.c b/src/libfilter/bsc_msg_acc.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_acc.c rename to src/libfilter/bsc_msg_acc.c diff --git a/openbsc/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_filter.c rename to src/libfilter/bsc_msg_filter.c diff --git a/openbsc/src/libfilter/bsc_msg_vty.c b/src/libfilter/bsc_msg_vty.c similarity index 100% rename from openbsc/src/libfilter/bsc_msg_vty.c rename to src/libfilter/bsc_msg_vty.c diff --git a/openbsc/src/libiu/Makefile.am b/src/libiu/Makefile.am similarity index 100% rename from openbsc/src/libiu/Makefile.am rename to src/libiu/Makefile.am diff --git a/openbsc/src/libiu/iu.c b/src/libiu/iu.c similarity index 100% rename from openbsc/src/libiu/iu.c rename to src/libiu/iu.c diff --git a/openbsc/src/libiu/iu_vty.c b/src/libiu/iu_vty.c similarity index 100% rename from openbsc/src/libiu/iu_vty.c rename to src/libiu/iu_vty.c diff --git a/openbsc/src/libmgcp/Makefile.am b/src/libmgcp/Makefile.am similarity index 100% rename from openbsc/src/libmgcp/Makefile.am rename to src/libmgcp/Makefile.am diff --git a/openbsc/src/libmgcp/g711common.h b/src/libmgcp/g711common.h similarity index 100% rename from openbsc/src/libmgcp/g711common.h rename to src/libmgcp/g711common.h diff --git a/openbsc/src/libmgcp/mgcp_network.c b/src/libmgcp/mgcp_network.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_network.c rename to src/libmgcp/mgcp_network.c diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/src/libmgcp/mgcp_osmux.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_osmux.c rename to src/libmgcp/mgcp_osmux.c diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/src/libmgcp/mgcp_protocol.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_protocol.c rename to src/libmgcp/mgcp_protocol.c diff --git a/openbsc/src/libmgcp/mgcp_sdp.c b/src/libmgcp/mgcp_sdp.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_sdp.c rename to src/libmgcp/mgcp_sdp.c diff --git a/openbsc/src/libmgcp/mgcp_transcode.c b/src/libmgcp/mgcp_transcode.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_transcode.c rename to src/libmgcp/mgcp_transcode.c diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/src/libmgcp/mgcp_vty.c similarity index 100% rename from openbsc/src/libmgcp/mgcp_vty.c rename to src/libmgcp/mgcp_vty.c diff --git a/openbsc/src/libmsc/Makefile.am b/src/libmsc/Makefile.am similarity index 100% rename from openbsc/src/libmsc/Makefile.am rename to src/libmsc/Makefile.am diff --git a/openbsc/src/libmsc/auth.c b/src/libmsc/auth.c similarity index 100% rename from openbsc/src/libmsc/auth.c rename to src/libmsc/auth.c diff --git a/openbsc/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c similarity index 100% rename from openbsc/src/libmsc/ctrl_commands.c rename to src/libmsc/ctrl_commands.c diff --git a/openbsc/src/libmsc/db.c b/src/libmsc/db.c similarity index 100% rename from openbsc/src/libmsc/db.c rename to src/libmsc/db.c diff --git a/openbsc/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_08.c rename to src/libmsc/gsm_04_08.c diff --git a/openbsc/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_11.c rename to src/libmsc/gsm_04_11.c diff --git a/openbsc/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c similarity index 100% rename from openbsc/src/libmsc/gsm_04_80.c rename to src/libmsc/gsm_04_80.c diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c similarity index 100% rename from openbsc/src/libmsc/gsm_subscriber.c rename to src/libmsc/gsm_subscriber.c diff --git a/openbsc/src/libmsc/meas_feed.c b/src/libmsc/meas_feed.c similarity index 100% rename from openbsc/src/libmsc/meas_feed.c rename to src/libmsc/meas_feed.c diff --git a/openbsc/src/libmsc/meas_feed.h b/src/libmsc/meas_feed.h similarity index 100% rename from openbsc/src/libmsc/meas_feed.h rename to src/libmsc/meas_feed.h diff --git a/openbsc/src/libmsc/mncc.c b/src/libmsc/mncc.c similarity index 100% rename from openbsc/src/libmsc/mncc.c rename to src/libmsc/mncc.c diff --git a/openbsc/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c similarity index 100% rename from openbsc/src/libmsc/mncc_builtin.c rename to src/libmsc/mncc_builtin.c diff --git a/openbsc/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c similarity index 100% rename from openbsc/src/libmsc/mncc_sock.c rename to src/libmsc/mncc_sock.c diff --git a/openbsc/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c similarity index 100% rename from openbsc/src/libmsc/osmo_msc.c rename to src/libmsc/osmo_msc.c diff --git a/openbsc/src/libmsc/rrlp.c b/src/libmsc/rrlp.c similarity index 100% rename from openbsc/src/libmsc/rrlp.c rename to src/libmsc/rrlp.c diff --git a/openbsc/src/libmsc/silent_call.c b/src/libmsc/silent_call.c similarity index 100% rename from openbsc/src/libmsc/silent_call.c rename to src/libmsc/silent_call.c diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c similarity index 100% rename from openbsc/src/libmsc/smpp_openbsc.c rename to src/libmsc/smpp_openbsc.c diff --git a/openbsc/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c similarity index 100% rename from openbsc/src/libmsc/smpp_smsc.c rename to src/libmsc/smpp_smsc.c diff --git a/openbsc/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h similarity index 100% rename from openbsc/src/libmsc/smpp_smsc.h rename to src/libmsc/smpp_smsc.h diff --git a/openbsc/src/libmsc/smpp_utils.c b/src/libmsc/smpp_utils.c similarity index 100% rename from openbsc/src/libmsc/smpp_utils.c rename to src/libmsc/smpp_utils.c diff --git a/openbsc/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c similarity index 100% rename from openbsc/src/libmsc/smpp_vty.c rename to src/libmsc/smpp_vty.c diff --git a/openbsc/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c similarity index 100% rename from openbsc/src/libmsc/sms_queue.c rename to src/libmsc/sms_queue.c diff --git a/openbsc/src/libmsc/token_auth.c b/src/libmsc/token_auth.c similarity index 100% rename from openbsc/src/libmsc/token_auth.c rename to src/libmsc/token_auth.c diff --git a/openbsc/src/libmsc/transaction.c b/src/libmsc/transaction.c similarity index 100% rename from openbsc/src/libmsc/transaction.c rename to src/libmsc/transaction.c diff --git a/openbsc/src/libmsc/ussd.c b/src/libmsc/ussd.c similarity index 100% rename from openbsc/src/libmsc/ussd.c rename to src/libmsc/ussd.c diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c similarity index 100% rename from openbsc/src/libmsc/vty_interface_layer3.c rename to src/libmsc/vty_interface_layer3.c diff --git a/openbsc/src/libtrau/Makefile.am b/src/libtrau/Makefile.am similarity index 100% rename from openbsc/src/libtrau/Makefile.am rename to src/libtrau/Makefile.am diff --git a/openbsc/src/libtrau/rtp_proxy.c b/src/libtrau/rtp_proxy.c similarity index 100% rename from openbsc/src/libtrau/rtp_proxy.c rename to src/libtrau/rtp_proxy.c diff --git a/openbsc/src/libtrau/trau_mux.c b/src/libtrau/trau_mux.c similarity index 100% rename from openbsc/src/libtrau/trau_mux.c rename to src/libtrau/trau_mux.c diff --git a/openbsc/src/libtrau/trau_upqueue.c b/src/libtrau/trau_upqueue.c similarity index 100% rename from openbsc/src/libtrau/trau_upqueue.c rename to src/libtrau/trau_upqueue.c diff --git a/openbsc/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc/Makefile.am rename to src/osmo-bsc/Makefile.am diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_api.c rename to src/osmo-bsc/osmo_bsc_api.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_audio.c rename to src/osmo-bsc/osmo_bsc_audio.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_bssap.c rename to src/osmo-bsc/osmo_bsc_bssap.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_ctrl.c rename to src/osmo-bsc/osmo_bsc_ctrl.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_filter.c rename to src/osmo-bsc/osmo_bsc_filter.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_grace.c rename to src/osmo-bsc/osmo_bsc_grace.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_main.c rename to src/osmo-bsc/osmo_bsc_main.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_msc.c rename to src/osmo-bsc/osmo_bsc_msc.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/src/osmo-bsc/osmo_bsc_sccp.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_sccp.c rename to src/osmo-bsc/osmo_bsc_sccp.c diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c similarity index 100% rename from openbsc/src/osmo-bsc/osmo_bsc_vty.c rename to src/osmo-bsc/osmo_bsc_vty.c diff --git a/openbsc/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc_mgcp/Makefile.am rename to src/osmo-bsc_mgcp/Makefile.am diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c similarity index 100% rename from openbsc/src/osmo-bsc_mgcp/mgcp_main.c rename to src/osmo-bsc_mgcp/mgcp_main.c diff --git a/openbsc/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am similarity index 100% rename from openbsc/src/osmo-bsc_nat/Makefile.am rename to src/osmo-bsc_nat/Makefile.am diff --git a/openbsc/src/osmo-bsc_nat/bsc_filter.c b/src/osmo-bsc_nat/bsc_filter.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_filter.c rename to src/osmo-bsc_nat/bsc_filter.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c rename to src/osmo-bsc_nat/bsc_mgcp_utils.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat.c rename to src/osmo-bsc_nat/bsc_nat.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/src/osmo-bsc_nat/bsc_nat_ctrl.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c rename to src/osmo-bsc_nat/bsc_nat_ctrl.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c b/src/osmo-bsc_nat/bsc_nat_filter.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_filter.c rename to src/osmo-bsc_nat/bsc_nat_filter.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c b/src/osmo-bsc_nat/bsc_nat_rewrite.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c rename to src/osmo-bsc_nat/bsc_nat_rewrite.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c rename to src/osmo-bsc_nat/bsc_nat_rewrite_trie.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/src/osmo-bsc_nat/bsc_nat_utils.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_utils.c rename to src/osmo-bsc_nat/bsc_nat_utils.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/src/osmo-bsc_nat/bsc_nat_vty.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_nat_vty.c rename to src/osmo-bsc_nat/bsc_nat_vty.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_sccp.c b/src/osmo-bsc_nat/bsc_sccp.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_sccp.c rename to src/osmo-bsc_nat/bsc_sccp.c diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/src/osmo-bsc_nat/bsc_ussd.c similarity index 100% rename from openbsc/src/osmo-bsc_nat/bsc_ussd.c rename to src/osmo-bsc_nat/bsc_ussd.c diff --git a/openbsc/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am similarity index 100% rename from openbsc/src/osmo-nitb/Makefile.am rename to src/osmo-nitb/Makefile.am diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/src/osmo-nitb/bsc_hack.c similarity index 100% rename from openbsc/src/osmo-nitb/bsc_hack.c rename to src/osmo-nitb/bsc_hack.c diff --git a/openbsc/src/utils/Makefile.am b/src/utils/Makefile.am similarity index 100% rename from openbsc/src/utils/Makefile.am rename to src/utils/Makefile.am diff --git a/openbsc/src/utils/bs11_config.c b/src/utils/bs11_config.c similarity index 100% rename from openbsc/src/utils/bs11_config.c rename to src/utils/bs11_config.c diff --git a/openbsc/src/utils/isdnsync.c b/src/utils/isdnsync.c similarity index 100% rename from openbsc/src/utils/isdnsync.c rename to src/utils/isdnsync.c diff --git a/openbsc/src/utils/meas_db.c b/src/utils/meas_db.c similarity index 100% rename from openbsc/src/utils/meas_db.c rename to src/utils/meas_db.c diff --git a/openbsc/src/utils/meas_db.h b/src/utils/meas_db.h similarity index 100% rename from openbsc/src/utils/meas_db.h rename to src/utils/meas_db.h diff --git a/openbsc/src/utils/meas_json.c b/src/utils/meas_json.c similarity index 100% rename from openbsc/src/utils/meas_json.c rename to src/utils/meas_json.c diff --git a/openbsc/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c similarity index 100% rename from openbsc/src/utils/meas_pcap2db.c rename to src/utils/meas_pcap2db.c diff --git a/openbsc/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c similarity index 100% rename from openbsc/src/utils/meas_udp2db.c rename to src/utils/meas_udp2db.c diff --git a/openbsc/src/utils/meas_vis.c b/src/utils/meas_vis.c similarity index 100% rename from openbsc/src/utils/meas_vis.c rename to src/utils/meas_vis.c diff --git a/openbsc/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c similarity index 100% rename from openbsc/src/utils/smpp_mirror.c rename to src/utils/smpp_mirror.c diff --git a/openbsc/tests/Makefile.am b/tests/Makefile.am similarity index 100% rename from openbsc/tests/Makefile.am rename to tests/Makefile.am diff --git a/openbsc/tests/abis/Makefile.am b/tests/abis/Makefile.am similarity index 100% rename from openbsc/tests/abis/Makefile.am rename to tests/abis/Makefile.am diff --git a/openbsc/tests/abis/abis_test.c b/tests/abis/abis_test.c similarity index 100% rename from openbsc/tests/abis/abis_test.c rename to tests/abis/abis_test.c diff --git a/openbsc/tests/abis/abis_test.ok b/tests/abis/abis_test.ok similarity index 100% rename from openbsc/tests/abis/abis_test.ok rename to tests/abis/abis_test.ok diff --git a/openbsc/tests/atlocal.in b/tests/atlocal.in similarity index 100% rename from openbsc/tests/atlocal.in rename to tests/atlocal.in diff --git a/openbsc/tests/bsc-nat-trie/Makefile.am b/tests/bsc-nat-trie/Makefile.am similarity index 100% rename from openbsc/tests/bsc-nat-trie/Makefile.am rename to tests/bsc-nat-trie/Makefile.am diff --git a/openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.c b/tests/bsc-nat-trie/bsc_nat_trie_test.c similarity index 100% rename from openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.c rename to tests/bsc-nat-trie/bsc_nat_trie_test.c diff --git a/openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.ok b/tests/bsc-nat-trie/bsc_nat_trie_test.ok similarity index 100% rename from openbsc/tests/bsc-nat-trie/bsc_nat_trie_test.ok rename to tests/bsc-nat-trie/bsc_nat_trie_test.ok diff --git a/openbsc/tests/bsc-nat-trie/prefixes.csv b/tests/bsc-nat-trie/prefixes.csv similarity index 100% rename from openbsc/tests/bsc-nat-trie/prefixes.csv rename to tests/bsc-nat-trie/prefixes.csv diff --git a/openbsc/tests/bsc-nat/Makefile.am b/tests/bsc-nat/Makefile.am similarity index 100% rename from openbsc/tests/bsc-nat/Makefile.am rename to tests/bsc-nat/Makefile.am diff --git a/openbsc/tests/bsc-nat/barr.cfg b/tests/bsc-nat/barr.cfg similarity index 100% rename from openbsc/tests/bsc-nat/barr.cfg rename to tests/bsc-nat/barr.cfg diff --git a/openbsc/tests/bsc-nat/barr_dup.cfg b/tests/bsc-nat/barr_dup.cfg similarity index 100% rename from openbsc/tests/bsc-nat/barr_dup.cfg rename to tests/bsc-nat/barr_dup.cfg diff --git a/openbsc/tests/bsc-nat/bsc_data.c b/tests/bsc-nat/bsc_data.c similarity index 100% rename from openbsc/tests/bsc-nat/bsc_data.c rename to tests/bsc-nat/bsc_data.c diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/tests/bsc-nat/bsc_nat_test.c similarity index 100% rename from openbsc/tests/bsc-nat/bsc_nat_test.c rename to tests/bsc-nat/bsc_nat_test.c diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.ok b/tests/bsc-nat/bsc_nat_test.ok similarity index 100% rename from openbsc/tests/bsc-nat/bsc_nat_test.ok rename to tests/bsc-nat/bsc_nat_test.ok diff --git a/openbsc/tests/bsc-nat/prefixes.csv b/tests/bsc-nat/prefixes.csv similarity index 100% rename from openbsc/tests/bsc-nat/prefixes.csv rename to tests/bsc-nat/prefixes.csv diff --git a/openbsc/tests/bsc/Makefile.am b/tests/bsc/Makefile.am similarity index 100% rename from openbsc/tests/bsc/Makefile.am rename to tests/bsc/Makefile.am diff --git a/openbsc/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c similarity index 100% rename from openbsc/tests/bsc/bsc_test.c rename to tests/bsc/bsc_test.c diff --git a/openbsc/tests/bsc/bsc_test.ok b/tests/bsc/bsc_test.ok similarity index 100% rename from openbsc/tests/bsc/bsc_test.ok rename to tests/bsc/bsc_test.ok diff --git a/openbsc/tests/channel/Makefile.am b/tests/channel/Makefile.am similarity index 100% rename from openbsc/tests/channel/Makefile.am rename to tests/channel/Makefile.am diff --git a/openbsc/tests/channel/channel_test.c b/tests/channel/channel_test.c similarity index 100% rename from openbsc/tests/channel/channel_test.c rename to tests/channel/channel_test.c diff --git a/openbsc/tests/channel/channel_test.ok b/tests/channel/channel_test.ok similarity index 100% rename from openbsc/tests/channel/channel_test.ok rename to tests/channel/channel_test.ok diff --git a/openbsc/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py similarity index 100% rename from openbsc/tests/ctrl_test_runner.py rename to tests/ctrl_test_runner.py diff --git a/openbsc/tests/db/Makefile.am b/tests/db/Makefile.am similarity index 100% rename from openbsc/tests/db/Makefile.am rename to tests/db/Makefile.am diff --git a/openbsc/tests/db/db_test.c b/tests/db/db_test.c similarity index 100% rename from openbsc/tests/db/db_test.c rename to tests/db/db_test.c diff --git a/openbsc/tests/db/db_test.err b/tests/db/db_test.err similarity index 100% rename from openbsc/tests/db/db_test.err rename to tests/db/db_test.err diff --git a/openbsc/tests/db/db_test.ok b/tests/db/db_test.ok similarity index 100% rename from openbsc/tests/db/db_test.ok rename to tests/db/db_test.ok diff --git a/openbsc/tests/db/hlr.sqlite3 b/tests/db/hlr.sqlite3 similarity index 100% rename from openbsc/tests/db/hlr.sqlite3 rename to tests/db/hlr.sqlite3 Binary files differ diff --git a/openbsc/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am similarity index 100% rename from openbsc/tests/gbproxy/Makefile.am rename to tests/gbproxy/Makefile.am diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c similarity index 100% rename from openbsc/tests/gbproxy/gbproxy_test.c rename to tests/gbproxy/gbproxy_test.c diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/tests/gbproxy/gbproxy_test.ok similarity index 100% rename from openbsc/tests/gbproxy/gbproxy_test.ok rename to tests/gbproxy/gbproxy_test.ok diff --git a/openbsc/tests/gprs/Makefile.am b/tests/gprs/Makefile.am similarity index 100% rename from openbsc/tests/gprs/Makefile.am rename to tests/gprs/Makefile.am diff --git a/openbsc/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c similarity index 100% rename from openbsc/tests/gprs/gprs_test.c rename to tests/gprs/gprs_test.c diff --git a/openbsc/tests/gprs/gprs_test.ok b/tests/gprs/gprs_test.ok similarity index 100% rename from openbsc/tests/gprs/gprs_test.ok rename to tests/gprs/gprs_test.ok diff --git a/openbsc/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am similarity index 100% rename from openbsc/tests/gsm0408/Makefile.am rename to tests/gsm0408/Makefile.am diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c similarity index 100% rename from openbsc/tests/gsm0408/gsm0408_test.c rename to tests/gsm0408/gsm0408_test.c diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok similarity index 100% rename from openbsc/tests/gsm0408/gsm0408_test.ok rename to tests/gsm0408/gsm0408_test.ok diff --git a/openbsc/tests/gtphub/Makefile.am b/tests/gtphub/Makefile.am similarity index 100% rename from openbsc/tests/gtphub/Makefile.am rename to tests/gtphub/Makefile.am diff --git a/openbsc/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c similarity index 100% rename from openbsc/tests/gtphub/gtphub_test.c rename to tests/gtphub/gtphub_test.c diff --git a/openbsc/tests/gtphub/gtphub_test.ok b/tests/gtphub/gtphub_test.ok similarity index 100% rename from openbsc/tests/gtphub/gtphub_test.ok rename to tests/gtphub/gtphub_test.ok diff --git a/openbsc/tests/mgcp/Makefile.am b/tests/mgcp/Makefile.am similarity index 100% rename from openbsc/tests/mgcp/Makefile.am rename to tests/mgcp/Makefile.am diff --git a/openbsc/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c similarity index 100% rename from openbsc/tests/mgcp/mgcp_test.c rename to tests/mgcp/mgcp_test.c diff --git a/openbsc/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok similarity index 100% rename from openbsc/tests/mgcp/mgcp_test.ok rename to tests/mgcp/mgcp_test.ok diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/tests/mgcp/mgcp_transcoding_test.c similarity index 100% rename from openbsc/tests/mgcp/mgcp_transcoding_test.c rename to tests/mgcp/mgcp_transcoding_test.c diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.ok b/tests/mgcp/mgcp_transcoding_test.ok similarity index 100% rename from openbsc/tests/mgcp/mgcp_transcoding_test.ok rename to tests/mgcp/mgcp_transcoding_test.ok diff --git a/openbsc/tests/mm_auth/Makefile.am b/tests/mm_auth/Makefile.am similarity index 100% rename from openbsc/tests/mm_auth/Makefile.am rename to tests/mm_auth/Makefile.am diff --git a/openbsc/tests/mm_auth/mm_auth_test.c b/tests/mm_auth/mm_auth_test.c similarity index 100% rename from openbsc/tests/mm_auth/mm_auth_test.c rename to tests/mm_auth/mm_auth_test.c diff --git a/openbsc/tests/mm_auth/mm_auth_test.ok b/tests/mm_auth/mm_auth_test.ok similarity index 100% rename from openbsc/tests/mm_auth/mm_auth_test.ok rename to tests/mm_auth/mm_auth_test.ok diff --git a/openbsc/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am similarity index 100% rename from openbsc/tests/nanobts_omlattr/Makefile.am rename to tests/nanobts_omlattr/Makefile.am diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c similarity index 100% rename from openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c rename to tests/nanobts_omlattr/nanobts_omlattr_test.c diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/tests/nanobts_omlattr/nanobts_omlattr_test.ok similarity index 100% rename from openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok rename to tests/nanobts_omlattr/nanobts_omlattr_test.ok diff --git a/openbsc/tests/oap/Makefile.am b/tests/oap/Makefile.am similarity index 100% rename from openbsc/tests/oap/Makefile.am rename to tests/oap/Makefile.am diff --git a/openbsc/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c similarity index 100% rename from openbsc/tests/oap/oap_client_test.c rename to tests/oap/oap_client_test.c diff --git a/openbsc/tests/oap/oap_client_test.err b/tests/oap/oap_client_test.err similarity index 100% rename from openbsc/tests/oap/oap_client_test.err rename to tests/oap/oap_client_test.err diff --git a/openbsc/tests/oap/oap_client_test.ok b/tests/oap/oap_client_test.ok similarity index 100% rename from openbsc/tests/oap/oap_client_test.ok rename to tests/oap/oap_client_test.ok diff --git a/openbsc/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am similarity index 100% rename from openbsc/tests/sgsn/Makefile.am rename to tests/sgsn/Makefile.am diff --git a/openbsc/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c similarity index 100% rename from openbsc/tests/sgsn/sgsn_test.c rename to tests/sgsn/sgsn_test.c diff --git a/openbsc/tests/sgsn/sgsn_test.ok b/tests/sgsn/sgsn_test.ok similarity index 100% rename from openbsc/tests/sgsn/sgsn_test.ok rename to tests/sgsn/sgsn_test.ok diff --git a/openbsc/tests/slhc/Makefile.am b/tests/slhc/Makefile.am similarity index 100% rename from openbsc/tests/slhc/Makefile.am rename to tests/slhc/Makefile.am diff --git a/openbsc/tests/slhc/slhc_test.c b/tests/slhc/slhc_test.c similarity index 100% rename from openbsc/tests/slhc/slhc_test.c rename to tests/slhc/slhc_test.c diff --git a/openbsc/tests/slhc/slhc_test.ok b/tests/slhc/slhc_test.ok similarity index 100% rename from openbsc/tests/slhc/slhc_test.ok rename to tests/slhc/slhc_test.ok diff --git a/openbsc/tests/smpp/Makefile.am b/tests/smpp/Makefile.am similarity index 100% rename from openbsc/tests/smpp/Makefile.am rename to tests/smpp/Makefile.am diff --git a/openbsc/tests/smpp/smpp_test.c b/tests/smpp/smpp_test.c similarity index 100% rename from openbsc/tests/smpp/smpp_test.c rename to tests/smpp/smpp_test.c diff --git a/openbsc/tests/smpp/smpp_test.err b/tests/smpp/smpp_test.err similarity index 100% rename from openbsc/tests/smpp/smpp_test.err rename to tests/smpp/smpp_test.err diff --git a/openbsc/tests/smpp/smpp_test.ok b/tests/smpp/smpp_test.ok similarity index 100% rename from openbsc/tests/smpp/smpp_test.ok rename to tests/smpp/smpp_test.ok diff --git a/openbsc/tests/smpp_test_runner.py b/tests/smpp_test_runner.py similarity index 100% rename from openbsc/tests/smpp_test_runner.py rename to tests/smpp_test_runner.py diff --git a/openbsc/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am similarity index 100% rename from openbsc/tests/sndcp_xid/Makefile.am rename to tests/sndcp_xid/Makefile.am diff --git a/openbsc/tests/sndcp_xid/sndcp_xid_test.c b/tests/sndcp_xid/sndcp_xid_test.c similarity index 100% rename from openbsc/tests/sndcp_xid/sndcp_xid_test.c rename to tests/sndcp_xid/sndcp_xid_test.c diff --git a/openbsc/tests/sndcp_xid/sndcp_xid_test.ok b/tests/sndcp_xid/sndcp_xid_test.ok similarity index 100% rename from openbsc/tests/sndcp_xid/sndcp_xid_test.ok rename to tests/sndcp_xid/sndcp_xid_test.ok diff --git a/openbsc/tests/subscr/Makefile.am b/tests/subscr/Makefile.am similarity index 100% rename from openbsc/tests/subscr/Makefile.am rename to tests/subscr/Makefile.am diff --git a/openbsc/tests/subscr/bsc_subscr_test.c b/tests/subscr/bsc_subscr_test.c similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.c rename to tests/subscr/bsc_subscr_test.c diff --git a/openbsc/tests/subscr/bsc_subscr_test.err b/tests/subscr/bsc_subscr_test.err similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.err rename to tests/subscr/bsc_subscr_test.err diff --git a/openbsc/tests/subscr/bsc_subscr_test.ok b/tests/subscr/bsc_subscr_test.ok similarity index 100% rename from openbsc/tests/subscr/bsc_subscr_test.ok rename to tests/subscr/bsc_subscr_test.ok diff --git a/openbsc/tests/subscr/subscr_test.c b/tests/subscr/subscr_test.c similarity index 100% rename from openbsc/tests/subscr/subscr_test.c rename to tests/subscr/subscr_test.c diff --git a/openbsc/tests/subscr/subscr_test.ok b/tests/subscr/subscr_test.ok similarity index 100% rename from openbsc/tests/subscr/subscr_test.ok rename to tests/subscr/subscr_test.ok diff --git a/openbsc/tests/testsuite.at b/tests/testsuite.at similarity index 100% rename from openbsc/tests/testsuite.at rename to tests/testsuite.at diff --git a/openbsc/tests/trau/Makefile.am b/tests/trau/Makefile.am similarity index 100% rename from openbsc/tests/trau/Makefile.am rename to tests/trau/Makefile.am diff --git a/openbsc/tests/trau/trau_test.c b/tests/trau/trau_test.c similarity index 100% rename from openbsc/tests/trau/trau_test.c rename to tests/trau/trau_test.c diff --git a/openbsc/tests/trau/trau_test.ok b/tests/trau/trau_test.ok similarity index 100% rename from openbsc/tests/trau/trau_test.ok rename to tests/trau/trau_test.ok diff --git a/openbsc/tests/v42bis/Makefile.am b/tests/v42bis/Makefile.am similarity index 100% rename from openbsc/tests/v42bis/Makefile.am rename to tests/v42bis/Makefile.am diff --git a/openbsc/tests/v42bis/v42bis_test.c b/tests/v42bis/v42bis_test.c similarity index 100% rename from openbsc/tests/v42bis/v42bis_test.c rename to tests/v42bis/v42bis_test.c diff --git a/openbsc/tests/v42bis/v42bis_test.ok b/tests/v42bis/v42bis_test.ok similarity index 100% rename from openbsc/tests/v42bis/v42bis_test.ok rename to tests/v42bis/v42bis_test.ok diff --git a/openbsc/tests/vty_test_runner.py b/tests/vty_test_runner.py similarity index 100% rename from openbsc/tests/vty_test_runner.py rename to tests/vty_test_runner.py diff --git a/openbsc/tests/xid/Makefile.am b/tests/xid/Makefile.am similarity index 100% rename from openbsc/tests/xid/Makefile.am rename to tests/xid/Makefile.am diff --git a/openbsc/tests/xid/xid_test.c b/tests/xid/xid_test.c similarity index 100% rename from openbsc/tests/xid/xid_test.c rename to tests/xid/xid_test.c diff --git a/openbsc/tests/xid/xid_test.ok b/tests/xid/xid_test.ok similarity index 100% rename from openbsc/tests/xid/xid_test.ok rename to tests/xid/xid_test.ok diff --git a/openbsc/tools/hlrstat.pl b/tools/hlrstat.pl similarity index 100% rename from openbsc/tools/hlrstat.pl rename to tools/hlrstat.pl -- To view, visit https://gerrit.osmocom.org/3188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:18:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 19:18:07 +0000 Subject: [MERGED] osmo-msc[master]: jenkins: apply rename to osmo-msc in log marker In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: apply rename to osmo-msc in log marker ...................................................................... jenkins: apply rename to osmo-msc in log marker Change-Id: I8ca9a1a8bdb5b9615df5f19f0c1017cb9383f6ee --- 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 b315b97..6650b5d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -38,7 +38,7 @@ echo echo echo -echo " =============================== openbsc ===============================" +echo " =============================== osmo-msc ===============================" echo set -x -- To view, visit https://gerrit.osmocom.org/3222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ca9a1a8bdb5b9615df5f19f0c1017cb9383f6ee Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:18:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 19:18:32 +0000 Subject: [MERGED] osmo-msc[master]: join openbsc/.gitignore with .gitignore In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: join openbsc/.gitignore with .gitignore ...................................................................... join openbsc/.gitignore with .gitignore Change-Id: Ib2120592749e85a4d13f6668e198857e3bddcf1e --- M .gitignore D openbsc/.gitignore 2 files changed, 103 insertions(+), 103 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 89bf7df..8e2c41b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,104 @@ debian/*.log +*.o +*.lo +*.a +.deps +Makefile +Makefile.in +bscconfig.h +bscconfig.h.in +openbsc.pc +src/osmo-nitb/osmo-nitb +src/osmo-bsc_mgcp/osmo-bsc_mgcp +src/osmo-bsc/osmo-bsc +src/utils/meas_vis +src/utils/meas_json +src/utils/osmo-meas-pcap2db +src/utils/osmo-meas-udp2db +src/utils/smpp_mirror +*.*~ +*.sw? +.libs +*.pyc +*.gcda +*.gcno + +#configure +aclocal.m4 +autom4te.cache/ +config.log +config.status +config.guess +config.sub +configure +compile +depcomp +install-sh +missing +stamp-h1 +libtool +ltmain.sh + +# git-version-gen magic +.tarball-version +.version + + +# apps and app data +hlr.sqlite3 +src/utils/bs11_config +src/ipaccess/ipaccess-config +src/ipaccess/abisip-find +src/ipaccess/ipaccess-firmware +src/ipaccess/ipaccess-proxy +src/utils/isdnsync +src/nat/bsc_nat +src/gprs/osmo-sgsn +src/gprs/osmo-gbproxy +src/gprs/osmo-gtphub +src/osmo-bsc_nat/osmo-bsc_nat +src/libcommon/gsup_test_client + +#tests +tests/testsuite.dir +tests/bsc-nat/bsc_nat_test +tests/bsc-nat-trie/bsc_nat_trie_test +tests/channel/channel_test +tests/db/db_test +tests/debug/debug_test +tests/gsm0408/gsm0408_test +tests/mgcp/mgcp_test +tests/sccp/sccp_test +tests/sms/sms_test +tests/timer/timer_test +tests/gprs/gprs_test +tests/gbproxy/gbproxy_test +tests/abis/abis_test +tests/si/si_test +tests/smpp/smpp_test +tests/bsc/bsc_test +tests/trau/trau_test +tests/mgcp/mgcp_transcoding_test +tests/sgsn/sgsn_test +tests/subscr/subscr_test +tests/subscr/bsc_subscr_test +tests/oap/oap_test +tests/gtphub/gtphub_test +tests/mm_auth/mm_auth_test +tests/xid/xid_test +tests/sndcp_xid/sndcp_xid_test +tests/slhc/slhc_test +tests/v42bis/v42bis_test +tests/nanobts_omlattr/nanobts_omlattr_test +tests/oap/oap_client_test + +tests/atconfig +tests/atlocal +tests/package.m4 +tests/testsuite +tests/testsuite.log + +gsn_restart +src/openbsc.cfg* +writtenconfig/ +gtphub_restart_count diff --git a/openbsc/.gitignore b/openbsc/.gitignore deleted file mode 100644 index 3dabea9..0000000 --- a/openbsc/.gitignore +++ /dev/null @@ -1,103 +0,0 @@ -*.o -*.lo -*.a -.deps -Makefile -Makefile.in -bscconfig.h -bscconfig.h.in -openbsc.pc -src/osmo-nitb/osmo-nitb -src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc -src/utils/meas_vis -src/utils/meas_json -src/utils/osmo-meas-pcap2db -src/utils/osmo-meas-udp2db -src/utils/smpp_mirror -*.*~ -*.sw? -.libs -*.pyc -*.gcda -*.gcno - -#configure -aclocal.m4 -autom4te.cache/ -config.log -config.status -config.guess -config.sub -configure -compile -depcomp -install-sh -missing -stamp-h1 -libtool -ltmain.sh - -# git-version-gen magic -.tarball-version -.version - - -# apps and app data -hlr.sqlite3 -src/utils/bs11_config -src/ipaccess/ipaccess-config -src/ipaccess/abisip-find -src/ipaccess/ipaccess-firmware -src/ipaccess/ipaccess-proxy -src/utils/isdnsync -src/nat/bsc_nat -src/gprs/osmo-sgsn -src/gprs/osmo-gbproxy -src/gprs/osmo-gtphub -src/osmo-bsc_nat/osmo-bsc_nat -src/libcommon/gsup_test_client - -#tests -tests/testsuite.dir -tests/bsc-nat/bsc_nat_test -tests/bsc-nat-trie/bsc_nat_trie_test -tests/channel/channel_test -tests/db/db_test -tests/debug/debug_test -tests/gsm0408/gsm0408_test -tests/mgcp/mgcp_test -tests/sccp/sccp_test -tests/sms/sms_test -tests/timer/timer_test -tests/gprs/gprs_test -tests/gbproxy/gbproxy_test -tests/abis/abis_test -tests/si/si_test -tests/smpp/smpp_test -tests/bsc/bsc_test -tests/trau/trau_test -tests/mgcp/mgcp_transcoding_test -tests/sgsn/sgsn_test -tests/subscr/subscr_test -tests/subscr/bsc_subscr_test -tests/oap/oap_test -tests/gtphub/gtphub_test -tests/mm_auth/mm_auth_test -tests/xid/xid_test -tests/sndcp_xid/sndcp_xid_test -tests/slhc/slhc_test -tests/v42bis/v42bis_test -tests/nanobts_omlattr/nanobts_omlattr_test -tests/oap/oap_client_test - -tests/atconfig -tests/atlocal -tests/package.m4 -tests/testsuite -tests/testsuite.log - -gsn_restart -src/openbsc.cfg* -writtenconfig/ -gtphub_restart_count -- To view, visit https://gerrit.osmocom.org/3189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib2120592749e85a4d13f6668e198857e3bddcf1e Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:18:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 19:18:32 +0000 Subject: [MERGED] osmo-msc[master]: git-version-gen: look for .git in ./, not ../ In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: git-version-gen: look for .git in ./, not ../ ...................................................................... git-version-gen: look for .git in ./, not ../ Change-Id: Ic71cfb8dde0a43325b50c75aae1e6ef3c3008501 --- M git-version-gen 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/git-version-gen b/git-version-gen index f2ad4a7..8e59c5a 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,7 +92,7 @@ if test -n "$v" then : # use $v -elif test -d ./../.git \ +elif test -d ./.git \ && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in -- To view, visit https://gerrit.osmocom.org/3190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic71cfb8dde0a43325b50c75aae1e6ef3c3008501 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:18:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 19:18:33 +0000 Subject: [MERGED] osmo-msc[master]: GPRS/IuPS: remove all 3G authentication dev hacks In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: GPRS/IuPS: remove all 3G authentication dev hacks ...................................................................... GPRS/IuPS: remove all 3G authentication dev hacks UMTS auth works now with the external OsmoHLR. Change-Id: Ie42945bb687b077fd0ee430c2711d19782151610 --- M src/gprs/gprs_gmm.c M src/libiu/iu.c 2 files changed, 2 insertions(+), 44 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 e6751db..dfec604 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1354,33 +1354,6 @@ ctx->ra = ra_id; if (ctx->ran_type == MM_CTX_T_GERAN_Gb) ctx->gb.cell_id = cid; - else if (ctx->ran_type == MM_CTX_T_UTRAN_Iu) { - /* DEVELOPMENT HACK: Our current HLR does not support 3G - * authentication tokens. A new HLR/VLR implementation is being - * developed. Until it is ready and actual milenage - * authentication is properly supported, we are hardcoding a - * fixed Ki and use 2G auth. */ - unsigned char tmp_rand[16]; - /* Ki 000102030405060708090a0b0c0d0e0f */ - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_GSM, - .algo = OSMO_AUTH_ALG_COMP128v1, - .u.gsm.ki = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, - 0x0e, 0x0f - }, - }; - /* XXX: Hack to make 3G auth work with special SIM card */ - ctx->auth_state = SGSN_AUTH_AUTHENTICATE; - - RAND_bytes(tmp_rand, 16); - - memset(&ctx->auth_triplet.vec, 0, sizeof(ctx->auth_triplet.vec)); - osmo_auth_gen_vec(&ctx->auth_triplet.vec, &auth, tmp_rand); - - ctx->auth_triplet.key_seq = 0; - } /* Update MM Context with other data */ ctx->drx_parms = drx_par; diff --git a/src/libiu/iu.c b/src/libiu/iu.c index 8ba6fa4..932b217 100644 --- a/src/libiu/iu.c +++ b/src/libiu/iu.c @@ -225,25 +225,10 @@ { struct osmo_scu_prim *prim; struct msgb *msg; - uint8_t ik[16]; - uint8_t ck[16]; - unsigned int i; - - /* C5 function to derive IK from Kc */ - for (i = 0; i < 4; i++) - ik[i] = tp->vec.kc[i] ^ tp->vec.kc[i+4]; - memcpy(ik+4, tp->vec.kc, 8); - for (i = 12; i < 16; i++) - ik[i] = ik[i-12]; - - if (send_ck) { - /* C4 function to derive CK from Kc */ - memcpy(ck, tp->vec.kc, 8); - memcpy(ck+8, tp->vec.kc, 8); - } /* create RANAP message */ - msg = ranap_new_msg_sec_mod_cmd(ik, send_ck? ck : NULL, new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg = ranap_new_msg_sec_mod_cmd(tp->vec.ik, send_ck? tp->vec.ck : NULL, + new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); msg->l2h = msg->data; /* wrap RANAP message in SCCP N-DATA.req */ prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); -- To view, visit https://gerrit.osmocom.org/3191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie42945bb687b077fd0ee430c2711d19782151610 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:18:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 19:18:33 +0000 Subject: [MERGED] osmo-msc[master]: gsup_client: allow passing a unit id to identify with HLR In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gsup_client: allow passing a unit id to identify with HLR ...................................................................... gsup_client: allow passing a unit id to identify with HLR Before, each GSUP client would contact the HLR with an identical unit id, i.e. "SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by the wrong client. Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC" and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages. Todo: also set some values instead of the zeros. Unrelated cosmetic change while editing the arguments: gsup_client_create()'s definition's oap client config arg name mismatched the one used in the declaration. Use oapc_config in both. Change-Id: I0a60681ab4a4d73e26fe8f0637447db4b6fe6eb2 --- M include/openbsc/gsup_client.h M src/gprs/gprs_subscriber.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c 4 files changed, 21 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/openbsc/gsup_client.h b/include/openbsc/gsup_client.h index a113225..4a25490 100644 --- a/include/openbsc/gsup_client.h +++ b/include/openbsc/gsup_client.h @@ -37,6 +37,8 @@ struct msgb *msg); struct gsup_client { + const char *unit_name; + struct ipa_client_conn *link; gsup_client_read_cb_t read_cb; void *data; @@ -49,10 +51,11 @@ int got_ipa_pong; }; -struct gsup_client *gsup_client_create(const char *ip_addr, +struct gsup_client *gsup_client_create(const char *unit_name, + const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oap_config); + struct oap_client_config *oapc_config); void gsup_client_destroy(struct gsup_client *gsupc); int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index 1bb5141..176583b 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -69,6 +69,7 @@ addr_str = inet_ntoa(sgi->cfg.gsup_server_addr.sin_addr); sgi->gsup_client = gsup_client_create( + "SGSN", addr_str, sgi->cfg.gsup_server_port, &gsup_read_cb, &sgi->cfg.oap); diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index de00d8d..46f25bb 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -173,9 +173,12 @@ struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); struct gsup_client *gsupc = (struct gsup_client *)link->data; int rc; - static struct ipaccess_unit ipa_dev = { - .unit_name = "SGSN" + struct ipaccess_unit ipa_dev = { + /* see gsup_client_create() on const vs non-const */ + .unit_name = (char*)gsupc->unit_name, }; + + OSMO_ASSERT(ipa_dev.unit_name); msg->l2h = &hh->data[0]; @@ -262,7 +265,8 @@ gsup_client_send_ping(gsupc); } -struct gsup_client *gsup_client_create(const char *ip_addr, +struct gsup_client *gsup_client_create(const char *unit_name, + const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, struct oap_client_config *oapc_config) @@ -273,6 +277,12 @@ gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client); OSMO_ASSERT(gsupc); + /* struct ipaccess_unit has a non-const unit_name, so let's copy to be + * able to have a non-const unit_name here as well. To not taint the + * public gsup_client API, let's store it in a const char* anyway. */ + gsupc->unit_name = talloc_strdup(gsupc, unit_name); + OSMO_ASSERT(gsupc->unit_name); + /* a NULL oapc_config will mark oap_state disabled. */ rc = oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index 8fc38d6..1b39670 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -275,8 +275,8 @@ osmo_init_logging(&gsup_test_client_log_info); - g_gc = gsup_client_create(server_host, server_port, gsupc_read_cb, - NULL); + g_gc = gsup_client_create("GSUPTEST", server_host, server_port, + gsupc_read_cb, NULL); signal(SIGINT, sig_cb); -- To view, visit https://gerrit.osmocom.org/3192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a60681ab4a4d73e26fe8f0637447db4b6fe6eb2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:18:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 19:18:33 +0000 Subject: [MERGED] osmo-msc[master]: logging: auth request: use hexdump without spaces for RAND, ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: logging: auth request: use hexdump without spaces for RAND, AUTN ...................................................................... logging: auth request: use hexdump without spaces for RAND, AUTN Change-Id: Ie16bb2c01e770914f411bfb34b523c56ea9fab81 --- 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 89108e4..fb02de2 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -909,9 +909,9 @@ struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); struct gsm48_auth_req *ar = (struct gsm48_auth_req *) msgb_put(msg, sizeof(*ar)); - DEBUGP(DMM, "-> AUTH REQ (rand = %s)\n", osmo_hexdump(rand, 16)); + DEBUGP(DMM, "-> AUTH REQ (rand = %s)\n", osmo_hexdump_nospc(rand, 16)); if (autn) - DEBUGP(DMM, " AUTH REQ (autn = %s)\n", osmo_hexdump(autn, 16)); + DEBUGP(DMM, " AUTH REQ (autn = %s)\n", osmo_hexdump_nospc(autn, 16)); msg->lchan = conn->lchan; gh->proto_discr = GSM48_PDISC_MM; -- To view, visit https://gerrit.osmocom.org/3193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie16bb2c01e770914f411bfb34b523c56ea9fab81 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:31:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:31:22 +0000 Subject: osmo-bts[master]: VIRT-PHY: Initial check-in of a new virtual BTS In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bf7670975b1e367c1c62983020865a043542622 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:32:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:32:23 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Added example configurations for openbsc and osmobts. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3243 to look at the new patch set (#4). VIRT-PHY: Added example configurations for openbsc and osmobts. Change-Id: I368d4a378e20028603b09825eee766abb9195774 --- M Makefile.am A doc/examples/virtual/openbsc-virtual.cfg A doc/examples/virtual/osmobts-virtual.cfg 3 files changed, 215 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/3243/4 diff --git a/Makefile.am b/Makefile.am index 0f85151..69d0b93 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,8 @@ contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmobts-mgr.cfg \ + doc/examples/virtual/openbsc-virtual.cfg \ + doc/examples/virtual/osmobts-virtual.cfg \ README.md @RELMAKE@ diff --git a/doc/examples/virtual/openbsc-virtual.cfg b/doc/examples/virtual/openbsc-virtual.cfg new file mode 100644 index 0000000..8044fa8 --- /dev/null +++ b/doc/examples/virtual/openbsc-virtual.cfg @@ -0,0 +1,151 @@ +! +! OpenBSC (0.15.0.629-34f0-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 0 + logging print category 1 + logging timestamp 1 + logging level all info + logging level rll notice + logging level cc notice + logging level mm debug + logging level rr notice + logging level rsl notice + logging level nm info + logging level mncc notice + logging level pag notice + logging level meas notice + logging level sccp notice + logging level msc notice + logging level mgcp notice + logging level ho notice + logging level db notice + logging level ref notice + logging level gprs debug + logging level ns info + logging level bssgp debug + logging level llc debug + logging level sndcp debug + logging level nat notice + logging level ctrl notice + logging level smpp debug + logging level filter debug + logging level ranap debug + logging level sua debug + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats notice + logging level lgsup notice + logging level loap notice +! +stats interval 5 +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +network + network country code 262 + mobile network code 42 + short name OpenBSC + long name OpenBSC + auth policy accept-all + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + neci 1 + paging any use tch 0 + rrlp mode ms-based + mm info 1 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + timer t3101 10 + timer t3103 0 + timer t3105 0 + timer t3107 0 + timer t3109 4 + timer t3111 0 + timer t3113 60 + timer t3115 0 + timer t3117 0 + timer t3119 0 + timer t3122 10 + timer t3141 0 + subscriber-keep-in-ram 0 + bts 0 + type sysmobts + band DCS1800 + cell_identity 6969 + location_area_code 1 + base_station_id_code 63 + ms max power 0 + cell reselection hysteresis 4 + rxlev access min 0 + periodic location update 30 + radio-link-timeout 32 + channel allocator descending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + ip.access unit_id 6969 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode automatic + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 666 + nominal power 0 + max_power_red 0 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config SDCCH8 + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +mncc-int + default-codec tch-f fr + default-codec tch-h hr +nitb + subscriber-create-on-demand + subscriber-create-on-demand random 1 24 + assign-tmsi diff --git a/doc/examples/virtual/osmobts-virtual.cfg b/doc/examples/virtual/osmobts-virtual.cfg new file mode 100644 index 0000000..5526e08 --- /dev/null +++ b/doc/examples/virtual/osmobts-virtual.cfg @@ -0,0 +1,62 @@ +! +! OsmoBTS (0.4.0.216-bc49-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 0 + logging color 0 + logging print category 1 + logging timestamp 0 + logging level all everything + logging level rsl info + logging level oml info + logging level rll notice + logging level rr notice + logging level meas notice + logging level pag info + logging level l1c info + logging level l1p info + logging level dsp error + logging level pcu notice + logging level ho debug + logging level trx notice + logging level loop notice + logging level abis debug + logging level rtp notice + logging level sum error + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats error +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +phy 0 + instance 0 +bts 0 + band DCS1800 + ipa unit-id 6969 0 + oml remote-ip 127.0.0.1 + rtp jitter-buffer 100 + paging queue-size 200 + paging lifetime 0 + uplink-power-target -75 + min-qual-rach 50 + min-qual-norm -5 + trx 0 + power-ramp max-initial 23000 mdBm + power-ramp step-size 2000 mdB + power-ramp step-interval 1 + ms-power-control dsp + phy 0 instance 0 -- To view, visit https://gerrit.osmocom.org/3243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I368d4a378e20028603b09825eee766abb9195774 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:33:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 13 Jul 2017 19:33:26 +0000 Subject: [PATCH] libosmo-netif[master]: rtp.c: Fix print format Message-ID: Review at https://gerrit.osmocom.org/3249 rtp.c: Fix print format Fixes compilation warning Change-Id: I0146a19bf852c9e27d265a098dc9d7a337424e10 --- M src/rtp.c 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/49/3249/1 diff --git a/src/rtp.c b/src/rtp.c index e965d85..7ac5862 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -3,6 +3,7 @@ #include #include /* for memcpy. */ #include /* for ntohs. */ +#include #include #include @@ -44,7 +45,7 @@ int osmo_rtp_handle_tx_set_sequence(struct osmo_rtp_handle *h, uint16_t seq) { - DEBUGP(DLMUX, "%s (handle=%p, seq=%hu)\n", __FUNCTION__, h, seq); + DEBUGP(DLMUX, "%s (handle=%p, seq=%"PRIu16")\n", __FUNCTION__, h, seq); h->tx.sequence = seq; @@ -53,7 +54,7 @@ int osmo_rtp_handle_tx_set_ssrc(struct osmo_rtp_handle *h, uint32_t ssrc) { - DEBUGP(DLMUX, "%s (handle=%p, seq=%hu)\n", __FUNCTION__, h, ssrc); + DEBUGP(DLMUX, "%s (handle=%p, seq=%"PRIu32")\n", __FUNCTION__, h, ssrc); h->tx.ssrc = ssrc; return 0; @@ -61,7 +62,7 @@ int osmo_rtp_handle_tx_set_timestamp(struct osmo_rtp_handle *h, uint32_t timestamp) { - DEBUGP(DLMUX, "%s (handle=%p, ts=%hu)\n", __FUNCTION__, h, timestamp); + DEBUGP(DLMUX, "%s (handle=%p, ts=%"PRIu32")\n", __FUNCTION__, h, timestamp); h->tx.timestamp = timestamp; return 0; -- To view, visit https://gerrit.osmocom.org/3249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0146a19bf852c9e27d265a098dc9d7a337424e10 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:34:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:34:24 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Initial check-in of a new virtual BTS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3242 to look at the new patch set (#4). VIRT-PHY: Initial check-in of a new virtual BTS This patch adds a virtual physical layer designed to simulate the Um air interface between BTS and MS. It does so by encapsulating MAC blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP streams, both in uplink and in downlink. The purpose of this is enable testing without any radio hardware or related licenses. OsmocomBB has recently received as similar patch-set, adding a virty_phy executable that can be run on a PC instead of the classic 'layer1' firmware on a real phone. Using GSMTAP means that one can use unmodified wireshark to decode the messages exchanged on the virtual Um layer. This code was originally started by Harald in January 2016, continued by Sebastian Stumpf in late 2016 and early 2017, and finally completed by Harald in July 2017. Change-Id: I1bf7670975b1e367c1c62983020865a043542622 --- M .gitignore M configure.ac M include/osmo-bts/gsm_data.h M include/osmo-bts/phy_link.h M src/Makefile.am A src/osmo-bts-virtual/Makefile.am A src/osmo-bts-virtual/bts_model.c A src/osmo-bts-virtual/l1_if.c A src/osmo-bts-virtual/l1_if.h A src/osmo-bts-virtual/main.c A src/osmo-bts-virtual/osmo_mcast_sock.c A src/osmo-bts-virtual/osmo_mcast_sock.h A src/osmo-bts-virtual/scheduler_virtbts.c A src/osmo-bts-virtual/virtual_um.c A src/osmo-bts-virtual/virtual_um.h A src/osmo-bts-virtual/virtualbts_vty.c 16 files changed, 1,890 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/3242/4 diff --git a/.gitignore b/.gitignore index 19ca274..a8c0ece 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ src/osmo-bts-octphy/osmo-bts-octphy +src/osmo-bts-virtual/osmo-bts-virtual + tests/atconfig tests/package.m4 tests/agch/agch_test diff --git a/configure.ac b/configure.ac index 64231b3..0ceb8eb 100644 --- a/configure.ac +++ b/configure.ac @@ -178,6 +178,7 @@ AC_OUTPUT( src/Makefile src/common/Makefile + src/osmo-bts-virtual/Makefile src/osmo-bts-sysmo/Makefile src/osmo-bts-litecell15/Makefile src/osmo-bts-trx/Makefile diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index c513b27..aeac4b2 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -114,6 +114,12 @@ struct { char *sock_path; } pcu; + + struct { + uint32_t last_fn; + struct timeval tv_clock; + struct osmo_timer_list fn_timer; + } vbts; }; enum lchan_ciph_state { diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4c7ff34..d8d3c6b 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -10,11 +10,13 @@ #include "btsconfig.h" struct gsm_bts_trx; +struct virt_um_inst; enum phy_link_type { PHY_LINK_T_NONE, PHY_LINK_T_SYSMOBTS, PHY_LINK_T_OSMOTRX, + PHY_LINK_T_VIRTUAL, }; enum phy_link_state { @@ -46,6 +48,14 @@ uint32_t clock_advance; uint32_t rts_advance; } osmotrx; + struct { + char *mcast_dev; /* Network device for multicast */ + char *bts_mcast_group; /* BTS are listening to this group */ + uint16_t bts_mcast_port; + char *ms_mcast_group; /* MS are listening to this group */ + uint16_t ms_mcast_port; + struct virt_um_inst *virt_um; + } virt; struct { /* MAC address of the PHY */ struct sockaddr_ll phy_addr; @@ -99,6 +109,9 @@ bool sw_act_reported; } osmotrx; struct { + struct l1sched_trx sched; + } virt; + struct { /* logical transceiver number within one PHY */ uint32_t trx_id; /* trx lock state variable */ diff --git a/src/Makefile.am b/src/Makefile.am index e7610fe..4f3f760 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = common +SUBDIRS = common osmo-bts-virtual if ENABLE_SYSMOBTS SUBDIRS += osmo-bts-sysmo diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am new file mode 100644 index 0000000..30069d4 --- /dev/null +++ b/src/osmo-bts-virtual/Makefile.am @@ -0,0 +1,10 @@ +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -Iinclude +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) + +noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h + +bin_PROGRAMS = osmo-bts-virtual + +osmo_bts_virtual_SOURCES = main.c bts_model.c virtualbts_vty.c scheduler_virtbts.c l1_if.c virtual_um.c osmo_mcast_sock.c +osmo_bts_virtual_LDADD = $(top_builddir)/src/common/libbts.a $(top_builddir)/src/common/libl1sched.a $(COMMON_LDADD) diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c new file mode 100644 index 0000000..5293cc3 --- /dev/null +++ b/src/osmo-bts-virtual/bts_model.c @@ -0,0 +1,169 @@ +/* (C) 2015 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 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 + +/* TODO: check if dummy method is sufficient, else implement */ +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return -1; +} + +/* TODO: check if dummy method is sufficient, else implement */ +int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr, + int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) +{ + return -1; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, + struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +static uint8_t vbts_set_bts(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx; + uint8_t tn; + + llist_for_each_entry(trx, &bts->trx_list, list) { + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); + oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OK); + + for (tn = 0; tn < TRX_NR_TS; tn++) + oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); + + /* report availability of trx to the bts. this will trigger the rsl connection */ + oml_mo_tx_sw_act_rep(&trx->mo); + oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + } + return 0; +} + +static uint8_t vbts_set_trx(struct gsm_bts_trx *trx) +{ + return 0; +} + +static uint8_t vbts_set_ts(struct gsm_bts_trx_ts *ts) +{ + struct phy_instance *pinst = trx_phy_instance(ts->trx); + int rc; + + rc = trx_sched_set_pchan(&pinst->u.virt.sched, ts->nr, ts->pchan); + if (rc) + return NM_NACK_RES_NOTAVAIL; + + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, + struct tlv_parsed *new_attr, int kind, void *obj) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + int cause = 0; + + switch (foh->msg_type) { + case NM_MT_SET_BTS_ATTR: + cause = vbts_set_bts(obj); + break; + case NM_MT_SET_RADIO_ATTR: + cause = vbts_set_trx(obj); + break; + case NM_MT_SET_CHAN_ATTR: + cause = vbts_set_ts(obj); + break; + } + return oml_fom_ack_nack(msg, cause); +} + +/* MO: TS 12.21 Managed Object */ +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + int rc; + + switch (mo->obj_class) { + case NM_OC_RADIO_CARRIER: + case NM_OC_CHANNEL: + case NM_OC_SITE_MANAGER: + case NM_OC_BASEB_TRANSC: + case NM_OC_BTS: + oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); + rc = oml_mo_opstart_ack(mo); + break; + /* TODO: gprs support */ + case NM_OC_GPRS_NSE: + case NM_OC_GPRS_CELL: + case NM_OC_GPRS_NSVC: + default: + rc = oml_mo_opstart_nack(mo, NM_NACK_OBJCLASS_NOTSUPP); + } + return rc; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, + void *obj, uint8_t adm_state) +{ + mo->nm_state.administrative = adm_state; + return oml_mo_statechg_ack(mo); +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + + +int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) +{ + return 0; +} + +int bts_model_ctrl_cmds_install(struct gsm_bts *bts) +{ + return 0; +} diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c new file mode 100644 index 0000000..a931916 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.c @@ -0,0 +1,465 @@ +/* Virtual BTS layer 1 primitive handling and interface + * + * Copyright (C) 2015-2017 Harald Welte + * Copyright (C) 2017 Sebastian Stumpf + * + * 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +extern int vbts_sched_start(struct gsm_bts *bts); + +static struct phy_instance *phy_instance_by_arfcn(struct phy_link *plink, uint16_t arfcn) +{ + struct phy_instance *pinst; + + llist_for_each_entry(pinst, &plink->instances, list) { + if (pinst->trx && pinst->trx->arfcn == arfcn) + return pinst; + } + + return NULL; +} + +/** + * Callback to handle incoming messages from the MS. + * The incoming message should be GSM_TAP encapsulated. + * TODO: implement all channels + */ +static void virt_um_rcv_cb(struct virt_um_inst *vui, struct msgb *msg) +{ + struct phy_link *plink = (struct phy_link *)vui->priv; + struct gsmtap_hdr *gh = msgb_l1(msg); + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the cell we currently camp on */ + uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ + uint8_t signal_dbm = gh->signal_dbm; /* signal strength in dBm */ + //uint8_t snr = gh->snr_db; /* signal noise ratio in dB */ + uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ + uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ + struct phy_instance *pinst; + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + /* get rid of l1 gsmtap hdr */ + msg->l2h = msgb_pull(msg, sizeof(*gh)); + + /* convert gsmtap chan to RSL chan and link id */ + chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); + chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + + /* ... or not uplink */ + if (!(arfcn & GSMTAP_ARFCN_F_UPLINK)) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - no uplink flag\n"); + goto nomessage; + } + + /* Generally ignore all msgs that are either not received with the right ARFCN... */ + pinst = phy_instance_by_arfcn(plink, arfcn & GSMTAP_ARFCN_MASK); + if (!pinst) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - msg ARFCN=%d not part of BTS\n", + arfcn & GSMTAP_ARFCN_MASK); + goto nomessage; + } + + /* switch case with removed ACCH flag */ + switch ((gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH) & 0xff) { + case GSMTAP_CHANNEL_RACH: + /* generate primitive for upper layer + * see 04.08 - 3.3.1.3.1: the IMMEDIATE_ASSIGNMENT coming back from the network has to be + * sent with the same ra reference as in the CHANNEL_REQUEST that was received */ + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_RACH, PRIM_OP_INDICATION, msg); + + l1sap.u.rach_ind.chan_nr = chan_nr; + /* TODO: 11bit RACH */ + l1sap.u.rach_ind.ra = msgb_pull_u8(msg); /* directly after gh hdr comes ra */ + l1sap.u.rach_ind.acc_delay = 0; /* probably not used in virt um */ + l1sap.u.rach_ind.is_11bit = 0; + l1sap.u.rach_ind.fn = fn; + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_NONE; /* FIXME: what comes here */ + break; + case GSMTAP_CHANNEL_TCH_F: + case GSMTAP_CHANNEL_TCH_H: +#if 0 + /* TODO: handle voice messages */ + if (!facch && ! tch_acch) { + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, msg); + } +#endif + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_DATA, + PRIM_OP_INDICATION, msg); + l1sap.u.data.chan_nr = chan_nr; + l1sap.u.data.link_id = link_id; + l1sap.u.data.fn = fn; + l1sap.u.data.rssi = 0; /* Radio Signal Strength Indicator. Best -> 0 */ + l1sap.u.data.ber10k = 0; /* Bit Error Rate in 0.01%. Best -> 0 */ + l1sap.u.data.ta_offs_qbits = 0; /* Burst time of arrival in quarter bits. Probably used for Timing Advance calc. Best -> 0 */ + l1sap.u.data.lqual_cb = 10 * signal_dbm; /* Link quality in centiBel = 10 * dB. */ + l1sap.u.data.pdch_presence_info = PRES_INFO_UNKNOWN; + break; + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type downlink only!\n"); + goto nomessage; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type not supported!\n"); + goto nomessage; + default: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type unknown\n"); + goto nomessage; + } + + /* forward primitive, forwarded msg will not be freed */ +#warning "we cannot just pass a l1sap primitive on the stack!!!" + l1sap_up(pinst->trx, &l1sap); + DEBUGP(DL1P, "Message forwarded to layer 2.\n"); + return; + +nomessage: + talloc_free(msg); +} + +/* called by common part once OML link is established */ +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +/* called by bts_main to initialize physical link */ +int bts_model_phy_link_open(struct phy_link *plink) +{ + struct phy_instance *pinst; + + //OSMO_ASSERT(plink->type == PHY_LINK_T_VIRTUAL); + + if (plink->u.virt.virt_um) + virt_um_destroy(plink->u.virt.virt_um); + + phy_link_state_set(plink, PHY_LINK_CONNECTING); + + if (!plink->u.virt.bts_mcast_group) + plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; + + if (!plink->u.virt.bts_mcast_port) + plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; + + if (!plink->u.virt.ms_mcast_group) + plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; + + if (!plink->u.virt.ms_mcast_port) + plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; + + plink->u.virt.virt_um = virt_um_init(plink, plink->u.virt.ms_mcast_group, plink->u.virt.ms_mcast_port, + plink->u.virt.bts_mcast_group, plink->u.virt.bts_mcast_port, + virt_um_rcv_cb); + /* set back reference to plink */ + plink->u.virt.virt_um->priv = plink; + if (!plink->u.virt.virt_um) { + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + return -1; + } + + /* iterate over list of PHY instances and initialize the scheduler */ + llist_for_each_entry(pinst, &plink->instances, list) { + trx_sched_init(&pinst->u.virt.sched, pinst->trx); + /* Only start the scheduler for the transceiver on C0. + * If we have multiple tranceivers, CCCH is always on C0 + * and has to be auto active */ + /* Other TRX are activated via OML by a PRIM_INFO_MODIFY + * / PRIM_INFO_ACTIVATE */ + if (pinst->trx && pinst->trx == pinst->trx->bts->c0) { + vbts_sched_start(pinst->trx->bts); + /* init lapdm layer 3 callback for the trx on timeslot 0 == BCCH */ + lchan_init_lapdm(&pinst->trx->ts[0].lchan[CCCH_LCHAN]); + /* FIXME: This is probably the wrong location to set the CCCH to active... the OML link def. needs to be reworked and fixed. */ + pinst->trx->ts[0].lchan[CCCH_LCHAN].rel_act_kind = LCHAN_REL_ACT_OML; + lchan_set_state(&pinst->trx->ts[0].lchan[CCCH_LCHAN], LCHAN_S_ACTIVE); + } + } + + /* this will automatically update the MO state of all associated TRX objects */ + phy_link_state_set(plink, PHY_LINK_CONNECTED); + + return 0; +} + + +/* + * primitive handling + */ + +/* enable ciphering */ +static int l1if_set_ciphering(struct gsm_lchan *lchan, uint8_t chan_nr, int downlink) +{ + struct gsm_bts_trx *trx = lchan->ts->trx; + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + + /* ciphering already enabled in both directions */ + if (lchan->ciph_state == LCHAN_CIPH_RXTX_CONF) + return -EINVAL; + + if (!downlink) { + /* set uplink */ + trx_sched_set_cipher(sched, chan_nr, 0, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RX_CONF; + } else { + /* set downlink and also set uplink, if not already */ + if (lchan->ciph_state != LCHAN_CIPH_RX_CONF) { + trx_sched_set_cipher(sched, chan_nr, 0, + lchan->encr.alg_id - 1, lchan->encr.key, + lchan->encr.key_len); + } + trx_sched_set_cipher(sched, chan_nr, 1, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + } + + return 0; +} + +static int mph_info_chan_confirm(struct gsm_bts_trx *trx, uint8_t chan_nr, + enum osmo_mph_info_type type, uint8_t cause) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_CONFIRM, + NULL); + l1sap.u.info.type = type; + l1sap.u.info.u.act_cnf.chan_nr = chan_nr; + l1sap.u.info.u.act_cnf.cause = cause; + + return l1sap_up(trx, &l1sap); +} + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap.u.info.type = PRIM_INFO_TIME; + l1sap.u.info.u.time_ind.fn = fn; + + if (!bts->c0) + return -EINVAL; + + return l1sap_up(bts->c0, &l1sap); +} + + +static void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, + float ber, float rssi) +{ + memset(l1sap, 0, sizeof(*l1sap)); + osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap->u.info.type = PRIM_INFO_MEAS; + l1sap->u.info.u.meas_ind.chan_nr = chan_nr; + l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4); + l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000); + l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1); +} + +int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, + int n_errors, int n_bits_total, float rssi, float toa) +{ + struct gsm_lchan *lchan = &trx->ts[tn].lchan[l1sap_chan2ss(chan_nr)]; + struct osmo_phsap_prim l1sap; + /* 100% BER is n_bits_total is 0 */ + float ber = n_bits_total==0 ? 1.0 : (float)n_errors / (float)n_bits_total; + + LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS pwr=%ddBm rssi=%.1f dBFS " + "ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n", + gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), + rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); + + l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi); + + return l1sap_up(trx, &l1sap); +} + + + +/* primitive from common part */ +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + struct msgb *msg = l1sap->oph.msg; + uint8_t chan_nr; + uint8_t tn, ss; + int rc = 0; + struct gsm_lchan *lchan; + + switch (OSMO_PRIM_HDR(&l1sap->oph)) { + case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_ph_data_req(sched, l1sap); + case OSMO_PRIM(PRIM_TCH, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_tch_req(sched, l1sap); + case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_REQUEST): + switch (l1sap->u.info.type) { + case PRIM_INFO_ACT_CIPH: + chan_nr = l1sap->u.info.u.ciph_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + if (l1sap->u.info.u.ciph_req.uplink) + l1if_set_ciphering(lchan, chan_nr, 0); + if (l1sap->u.info.u.ciph_req.downlink) + l1if_set_ciphering(lchan, chan_nr, 1); + break; + case PRIM_INFO_ACTIVATE: + case PRIM_INFO_DEACTIVATE: + case PRIM_INFO_MODIFY: + chan_nr = l1sap->u.info.u.act_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + /* we receive a channel activation request from the BSC, + * e.g. as a response to a channel req on RACH */ + if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot activate" + " chan_nr 0x%02x\n", chan_nr); + break; + } + /* activate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_DEDIC, 1); + /* activate associated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_SACCH, 1); + /* set mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + (lchan->ho.active == 1)); + /* init lapdm */ + lchan_init_lapdm(lchan); + /* set lchan active */ + lchan_set_state(lchan, LCHAN_S_ACTIVE); + /* set initial ciphering */ + l1if_set_ciphering(lchan, chan_nr, 0); + l1if_set_ciphering(lchan, chan_nr, 1); + if (lchan->encr.alg_id) + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + else + lchan->ciph_state = LCHAN_CIPH_NONE; + + /* confirm */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_ACTIVATE, 0); + break; + } + if (l1sap->u.info.type == PRIM_INFO_MODIFY) { + /* change mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + 0); + break; + } + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot deactivate " + "chan_nr 0x%02x\n", chan_nr); + break; + } + /* deactivate associated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x40, 0); + if (!l1sap->u.info.u.act_req.sacch_only) { + /* set lchan inactive */ + lchan_set_state(lchan, LCHAN_S_NONE); + /* deactivate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x00, 0); + /* confirm only on dedicated channel */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_DEACTIVATE, 0); + lchan->ciph_state = 0; /* FIXME: do this in common/\*.c */ + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown MPH-INFO.req %d\n", + l1sap->u.info.type); + rc = -EINVAL; + goto done; + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d\n", + l1sap->oph.primitive, l1sap->oph.operation); + rc = -EINVAL; + goto done; + } + +done: + if (msg) + msgb_free(msg); + return rc; +} diff --git a/src/osmo-bts-virtual/l1_if.h b/src/osmo-bts-virtual/l1_if.h new file mode 100644 index 0000000..6a843b3 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +#include "virtual_um.h" + +struct vbts_l1h { + struct gsm_bts_trx *trx; + struct l1sched_trx l1s; + struct virt_um_inst *virt_um; +}; + +struct vbts_l1h *l1if_open(struct gsm_bts_trx *trx); +void l1if_close(struct vbts_l1h *l1h); +void l1if_reset(struct vbts_l1h *l1h); + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn); + +int vbts_sched_start(struct gsm_bts *bts); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c new file mode 100644 index 0000000..6ceeaec --- /dev/null +++ b/src/osmo-bts-virtual/main.c @@ -0,0 +1,126 @@ +/* Main program for Virtual OsmoBTS */ + +/* (C) 2015 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 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +/* dummy, since no direct dsp support */ +uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb; + + btsb = bts_role_bts(bts); + btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + + bts_model_vty_init(bts); + + return 0; +} + +void bts_model_print_help() +{ +} + +int bts_model_handle_options(int argc, char **argv) +{ + int num_errors = 0; + + while (1) { + int option_idx = 0, c; + static const struct option long_options[] = { + /* specific to this hardware */ + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "", + long_options, &option_idx); + if (c == -1) + break; + + switch (c) { + default: + num_errors++; + break; + } + } + + return num_errors; +} + +void bts_model_abis_close(struct gsm_bts *bts) +{ + /* for now, we simply terminate the program and re-spawn */ + bts_shutdown(bts, "Abis close"); +} + +void bts_model_phy_link_set_defaults(struct phy_link *plink) +{ +} + +void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) +{ +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} + +int main(int argc, char **argv) +{ + return bts_main(argc, argv); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.c b/src/osmo-bts-virtual/osmo_mcast_sock.c new file mode 100644 index 0000000..f092a73 --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.c @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "osmo_mcast_sock.h" + +/* server socket is what we use for transmission. It is not subscribed + * to a multicast group or locally bound, but it is just a normal UDP + * socket that's connected to the remote mcast group + port */ +int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, + uint16_t tx_mcast_port, bool loopback) +{ + int rc; + unsigned int flags = OSMO_SOCK_F_CONNECT; + + if (!loopback) + flags |= OSMO_SOCK_F_NO_MCAST_LOOP; + + /* setup mcast server socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + tx_mcast_group, tx_mcast_port, flags); + if (rc < 0) { + perror("Failed to create Multicast Server Socket"); + return rc; + } + + return 0; +} + +/* the client socket is what we use for reception. It is a UDP socket + * that's bound to the GSMTAP UDP port and subscribed to the respective + * multicast group */ +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + int rc; + + ofd->cb = fd_rx_cb; + ofd->when = BSC_FD_READ; + ofd->data = osmo_fd_data; + + /* Create mcast client socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + NULL, mcast_port, OSMO_SOCK_F_BIND|OSMO_SOCK_F_NO_MCAST_ALL); + if (rc < 0) { + perror("Could not create mcast client socket"); + return rc; + } + + /* Configure and join the multicast group */ + rc = osmo_sock_mcast_subscribe(ofd->fd, mcast_group); + if (rc < 0) { + perror("Failed to join to mcast goup"); + osmo_fd_close(ofd); + return rc; + } + + return 0; +} + +struct mcast_bidir_sock * +mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_bidir_sock *bidir_sock = talloc(ctx, struct mcast_bidir_sock); + int rc; + + if (!bidir_sock) + return NULL; + + rc = mcast_client_sock_setup(&bidir_sock->rx_ofd, rx_mcast_group, rx_mcast_port, + fd_rx_cb, osmo_fd_data); + if (rc < 0) { + talloc_free(bidir_sock); + return NULL; + } + rc = mcast_server_sock_setup(&bidir_sock->tx_ofd, tx_mcast_group, tx_mcast_port, loopback); + if (rc < 0) { + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); + return NULL; + } + return bidir_sock; + +} + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, + unsigned int data_len) +{ + return send(bidir_sock->tx_ofd.fd, data, data_len, 0); +} + +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len) +{ + return recv(bidir_sock->rx_ofd.fd, buf, buf_len, 0); +} + +void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) +{ + osmo_fd_close(&bidir_sock->tx_ofd); + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.h b/src/osmo-bts-virtual/osmo_mcast_sock.h new file mode 100644 index 0000000..aa2013c --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include +#include + +struct mcast_bidir_sock { + struct osmo_fd tx_ofd; + struct osmo_fd rx_ofd; +}; + +struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx, + const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group, + uint16_t tx_mcast_port, bool loopback); + +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, unsigned int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len); +void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); + diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c new file mode 100644 index 0000000..4b4def7 --- /dev/null +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -0,0 +1,633 @@ +/* Scheduler worker functiosn for Virtua OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * + * 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 +#include "virtual_um.h" +#include "l1_if.h" + +static const char *gsmtap_hdr_stringify(const struct gsmtap_hdr *gh) +{ + static char buf[256]; + snprintf(buf, sizeof(buf), "(ARFCN=%u, ts=%u, ss=%u, type=%u/%u)", + gh->arfcn & GSMTAP_ARFCN_MASK, gh->timeslot, gh->sub_slot, gh->type, gh->sub_type); + return buf; +} + +/** + * Send a message over the virtual um interface. + * This will at first wrap the msg with a GSMTAP header and then write it to the declared multicast socket. + * TODO: we might want to remove unused argument uint8_t tn + */ +static void tx_to_virt_um(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, struct msgb *msg) +{ + const struct trx_chan_desc *chdesc = &trx_chan_desc[chan]; + struct msgb *outmsg; /* msg to send with gsmtap header prepended */ + uint16_t arfcn = l1t->trx->arfcn; /* ARFCN of the tranceiver the message is send with */ + uint8_t signal_dbm = 63; /* signal strength, 63 is best */ + uint8_t snr = 63; /* signal noise ratio, 63 is best */ + uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ + uint8_t data_len = msgb_l2len(msg); /* length of data */ + uint8_t rsl_chantype; /* RSL chan type (TS 08.58, 9.3.1) */ + uint8_t subslot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot; /* TDMA timeslot to send in (0-7) */ + uint8_t gsmtap_chantype; /* the GSMTAP channel */ + + rsl_dec_chan_nr(chdesc->chan_nr, &rsl_chantype, &subslot, ×lot); + /* in Osmocom, AGCH is only sent on ccch block 0. no idea why. this seems to cause false GSMTAP channel + * types for agch and pch. */ + if (rsl_chantype == RSL_CHAN_PCH_AGCH && L1SAP_FN2CCCHBLOCK(fn) == 0) + gsmtap_chantype = GSMTAP_CHANNEL_PCH; + else + gsmtap_chantype = chantype_rsl2gsmtap(rsl_chantype, chdesc->link_id); /* the logical channel type */ + + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chantype, subslot, fn, signal_dbm, snr, data, data_len); + if (outmsg) { + struct phy_instance *pinst = trx_phy_instance(l1t->trx); + struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); + + if (virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg) == -1) + LOGP(DL1P, LOGL_ERROR, "%s GSMTAP msg could not send to virtual Um\n", gsmtap_hdr_stringify(gh)); + else + DEBUGP(DL1C, "%s Sending GSMTAP message to virtual Um\n", gsmtap_hdr_stringify(gh)); + } else + LOGP(DL1C, LOGL_ERROR, "GSMTAP msg could not be created!\n"); + + /* free incoming message */ + msgb_free(msg); +} + +/* + * TX on downlink + */ + +/* an IDLE burst returns nothing. on C0 it is replaced by dummy burst */ +ubit_t *tx_idle_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_fcch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_sch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg; + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + /* check validity of message */ + if (msgb_l2len(msg) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg)); + /* free message */ + msgb_free(msg); + return NULL; + } + + /* transmit the msg received on dl from bsc to layer1 (virt Um) */ + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +ubit_t *tx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg = NULL; /* make GCC happy */ + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +static void tx_tch_common(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, struct msgb **_msg_tch, + struct msgb **_msg_facch, int codec_mode_request) +{ + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct msgb *msg1, *msg2, *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + uint8_t rsl_cmode = chan_state->rsl_cmode; + uint8_t tch_mode = chan_state->tch_mode; + struct osmo_phsap_prim *l1sap; +#if 0 + /* handle loss detection of received TCH frames */ + if (rsl_cmode == RSL_CMOD_SPD_SPEECH + && ++(chan_state->lost) > 5) { + uint8_t tch_data[GSM_FR_BYTES]; + int len; + + LOGP(DL1P, LOGL_NOTICE, "Missing TCH bursts detected, sending " + "BFI for %s\n", trx_chan_desc[chan].name); + + /* indicate bad frame */ + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + tch_data[0] = 0x70; /* F = 0, FT = 111 */ + memset(tch_data + 1, 0, 14); + len = 15; + break; + } + memset(tch_data, 0, GSM_FR_BYTES); + len = GSM_FR_BYTES; + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode1; + memset(tch_data, 0, GSM_EFR_BYTES); + len = GSM_EFR_BYTES; + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ + len = amr_compose_payload(tch_data, + chan_state->codec[chan_state->dl_cmr], + chan_state->codec[chan_state->dl_ft], 1); + if (len < 2) + break; + memset(tch_data + 2, 0, len - 2); + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + break; + default: +inval_mode1: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + len = 0; + } + if (len) + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + } +#endif + + /* get frame and unlink from queue */ + msg1 = _sched_dequeue_prim(l1t, tn, fn, chan); + msg2 = _sched_dequeue_prim(l1t, tn, fn, chan); + if (msg1) { + l1sap = msgb_l1sap_prim(msg1); + if (l1sap->oph.primitive == PRIM_TCH) { + msg_tch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "TCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_facch = msg2; + } + } else { + msg_facch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive != PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "FACCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_tch = msg2; + } + } + } else if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) + msg_tch = msg2; + else + msg_facch = msg2; + } + + /* check validity of message */ + if (msg_facch && msgb_l2len(msg_facch) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg_facch)); + /* free message */ + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* check validity of message, get AMR ft and cmr */ + if (!msg_facch && msg_tch) { + int len; +#if 0 + uint8_t bfi, cmr_codec, ft_codec; + int cmr, ft, i; +#endif + + if (rsl_cmode != RSL_CMOD_SPD_SPEECH) { + LOGP(DL1P, LOGL_NOTICE, "%s Dropping speech frame, " + "because we are not in speech mode trx=%u " + "ts=%u at fn=%u.\n", trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + len = 15; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] & 0xf0) != 0x00) { + LOGP(DL1P, LOGL_NOTICE, "%s " + "Transmitting 'bad " + "HR frame' trx=%u ts=%u at " + "fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + } + len = GSM_FR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xd) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "FR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode2; + len = GSM_EFR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xc) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "EFR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ +#if 0 + len = amr_decompose_payload(msg_tch->l2h, + msgb_l2len(msg_tch), &cmr_codec, &ft_codec, + &bfi); + cmr = -1; + ft = -1; + for (i = 0; i < chan_state->codecs; i++) { + if (chan_state->codec[i] == cmr_codec) + cmr = i; + if (chan_state->codec[i] == ft_codec) + ft = i; + } + if (cmr >= 0) { /* new request */ + chan_state->dl_cmr = cmr; + /* disable AMR loop */ + trx_loop_amr_set(chan_state, 0); + } else { + /* enable AMR loop */ + trx_loop_amr_set(chan_state, 1); + } + if (ft < 0) { + LOGP(DL1P, LOGL_ERROR, "%s Codec (FT = %d) " + " of RTP frame not in list. " + "trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + if (codec_mode_request && chan_state->dl_ft != ft) { + LOGP(DL1P, LOGL_NOTICE, "%s Codec (FT = %d) " + " of RTP cannot be changed now, but in " + "next frame. trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + chan_state->dl_ft = ft; + if (bfi) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "AMR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } +#else + LOGP(DL1P, LOGL_ERROR, "AMR not supported!\n"); + goto free_bad_msg; +#endif + break; + default: +inval_mode2: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + goto free_bad_msg; + } + if (len < 0) { + LOGP(DL1P, LOGL_ERROR, "Cannot send invalid AMR " + "payload\n"); + goto free_bad_msg; + } + if (msgb_l2len(msg_tch) != len) { + LOGP(DL1P, LOGL_ERROR, "Cannot send payload with " + "invalid length! (expecing %d, received %d)\n", + len, msgb_l2len(msg_tch)); +free_bad_msg: + /* free message */ + msgb_free(msg_tch); + msg_tch = NULL; + goto send_frame; + } + } + +send_frame: + *_msg_tch = msg_tch; + *_msg_facch = msg_facch; +} + +ubit_t *tx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + + if (bid > 0) + return NULL; + + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* no message at all */ + if (!msg_tch && !msg_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + + return NULL; +} + +ubit_t *tx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + //uint8_t tch_mode = chan_state->tch_mode; + + /* send burst, if we already got a frame */ + if (bid > 0) + return NULL; + + /* get TCH and/or FACCH */ + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* check for FACCH alignment */ + if (msg_facch && ((((fn + 4) % 26) >> 2) & 1)) { + LOGP(DL1P, LOGL_ERROR, "%s Cannot transmit FACCH starting on " + "even frames, please fix RTS!\n", + trx_chan_desc[chan].name); + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* no message at all */ + if (!msg_tch && !msg_facch && !chan_state->dl_ongoing_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + return NULL; +} + + +/*********************************************************************** + * RX on uplink (indication to upper layer) + ***********************************************************************/ + +/* we don't use those functions, as we feed the MAC frames from GSMTAP + * directly into the L1SAP, bypassing the TDMA multiplex logic oriented + * towards receiving bursts */ + +int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +/*! \brief a single burst was received by the PHY, process it */ +int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +void _sched_act_rach_det(struct l1sched_trx *l1t, uint8_t tn, uint8_t ss, int activate) +{ +} + +/*********************************************************************** + * main scheduler function + ***********************************************************************/ + +#define RTS_ADVANCE 5 /* about 20ms */ +#define FRAME_DURATION_uS 4615 + +static int vbts_sched_fn(struct gsm_bts *bts, uint32_t fn) +{ + struct gsm_bts_trx *trx; + + /* send time indication */ + /* update model with new frame number, lot of stuff happening, measurements of timeslots */ + /* saving GSM time in BTS model, and more */ + l1if_mph_time_ind(bts, fn); + + /* advance the frame number? */ + llist_for_each_entry(trx, &bts->trx_list, list) { + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *l1t = &pinst->u.virt.sched; + int tn; + uint16_t nbits; + + /* do for each of the 8 timeslots */ + for (tn = 0; tn < ARRAY_SIZE(l1t->ts); tn++) { + /* Generate RTS indication to higher layers */ + /* This will basically do 2 things (check l1_if:bts_model_l1sap_down): + * 1) Get pending messages from layer 2 (from the lapdm queue) + * 2) Process the messages + * --> Handle and process non-transparent RSL-Messages (activate channel, ) + * --> Forward transparent RSL-DATA-Messages to the ms by appending them to + * the l1-dl-queue */ + _sched_rts(l1t, tn, (fn + RTS_ADVANCE) % GSM_HYPERFRAME); + /* schedule transmit backend functions */ + /* Process data in the l1-dlqueue and forward it + * to MS */ + /* the returned bits are not used here, the routines called will directly forward their + * bits to the virt Um */ + _sched_dl_burst(l1t, tn, fn, &nbits); + } + } + + return 0; +} + +static void vbts_fn_timer_cb(void *data) +{ + struct gsm_bts *bts = data; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + struct timeval tv_now; + struct timeval *tv_clock = &btsb->vbts.tv_clock; + int32_t elapsed_us; + + gettimeofday(&tv_now, NULL); + + /* check how much time elapsed till the last timer callback call. + * this value should be about 4.615 ms (a bit greater) as this is the scheduling interval */ + elapsed_us = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 + + (tv_now.tv_usec - tv_clock->tv_usec); + + /* not so good somehow a lot of time passed between two timer callbacks */ + if (elapsed_us > 2 *FRAME_DURATION_uS) + LOGP(DL1P, LOGL_NOTICE, "vbts_fn_timer_cb after %d us\n", elapsed_us); + + /* schedule the current frame/s (fn = frame number) + * this loop will be called at least once, but can also be executed + * multiple times if more than one frame duration (4615us) passed till the last callback */ + while (elapsed_us > FRAME_DURATION_uS / 2) { + const struct timeval tv_frame = { + .tv_sec = 0, + .tv_usec = FRAME_DURATION_uS, + }; + timeradd(tv_clock, &tv_frame, tv_clock); + /* increment the frame number in the BTS model instance */ + btsb->vbts.last_fn = (btsb->vbts.last_fn + 1) % GSM_HYPERFRAME; + vbts_sched_fn(bts, btsb->vbts.last_fn); + elapsed_us -= FRAME_DURATION_uS; + } + + /* re-schedule the timer */ + /* timer is set to frame duration - elapsed time to guarantee that this cb method will be + * periodically executed every 4.615ms */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS - elapsed_us); +} + +int vbts_sched_start(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + + LOGP(DL1P, LOGL_NOTICE, "starting VBTS scheduler\n"); + + memset(&btsb->vbts.fn_timer, 0, sizeof(btsb->vbts.fn_timer)); + btsb->vbts.fn_timer.cb = vbts_fn_timer_cb; + btsb->vbts.fn_timer.data = bts; + + gettimeofday(&btsb->vbts.tv_clock, NULL); + /* trigger the first timer after 4615us (a frame duration) */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS); + + return 0; +} diff --git a/src/osmo-bts-virtual/virtual_um.c b/src/osmo-bts-virtual/virtual_um.c new file mode 100644 index 0000000..e6b9615 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.c @@ -0,0 +1,92 @@ +/* Routines for a Virtual Um interface over GSMTAP/UDP */ + +/* (C) 2015 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 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 "osmo_mcast_sock.h" +#include "virtual_um.h" +#include + +/** + * Virtual UM interface file descriptor callback. + * Should be called by select.c when the fd is ready for reading. + */ +static int virt_um_fd_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct virt_um_inst *vui = ofd->data; + + if (what & BSC_FD_READ) { + struct msgb *msg = msgb_alloc(VIRT_UM_MSGB_SIZE, "Virtual UM Rx"); + int rc; + + /* read message from fd into message buffer */ + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + if (rc > 0) { + msgb_put(msg, rc); + msg->l1h = msgb_data(msg); + /* call the l1 callback function for a received msg */ + vui->recv_cb(vui, msg); + } else { + /* FIXME: this kind of error handling might be a bit harsh */ + vui->recv_cb(vui, NULL); + osmo_fd_close(ofd); + } + } + + return 0; +} + +struct virt_um_inst *virt_um_init(void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) +{ + struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, + rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->recv_cb = recv_cb; + + return vui; + +} + +void virt_um_destroy(struct virt_um_inst *vui) +{ + mcast_bidir_sock_close(vui->mcast_sock); + talloc_free(vui); +} + +/** + * Write msg to to multicast socket and free msg afterwards + */ +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg) +{ + int rc; + + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), + msgb_length(msg)); + msgb_free(msg); + + return rc; +} diff --git a/src/osmo-bts-virtual/virtual_um.h b/src/osmo-bts-virtual/virtual_um.h new file mode 100644 index 0000000..6e7c384 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include "osmo_mcast_sock.h" + +#define VIRT_UM_MSGB_SIZE 256 +#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ +#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ + +struct virt_um_inst { + void *priv; + struct mcast_bidir_sock *mcast_sock; + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); +}; + +struct virt_um_inst *virt_um_init( + void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); + +void virt_um_destroy(struct virt_um_inst *vui); + +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg); diff --git a/src/osmo-bts-virtual/virtualbts_vty.c b/src/osmo-bts-virtual/virtualbts_vty.c new file mode 100644 index 0000000..45c1086 --- /dev/null +++ b/src/osmo-bts-virtual/virtualbts_vty.c @@ -0,0 +1,185 @@ +/* VTY interface for virtual OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * 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 +#include +#include +#include "virtual_um.h" + +#define TRX_STR "Transceiver related commands\n" "TRX number\n" + +#define SHOW_TRX_STR \ + SHOW_STR \ + TRX_STR + +static struct gsm_bts *vty_bts; + +void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) +{ +} + +void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) +{ +} + +void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) +{ +} + +void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) +{ + if (plink->u.virt.mcast_dev) + vty_out(vty, " virtual-um net-device %s%s", + plink->u.virt.mcast_dev, VTY_NEWLINE); + if (strcmp(plink->u.virt.ms_mcast_group, DEFAULT_BTS_MCAST_GROUP)) + vty_out(vty, " virtual-um ms-multicast-group %s%s", + plink->u.virt.ms_mcast_group, VTY_NEWLINE); + if (plink->u.virt.ms_mcast_port) + vty_out(vty, " virtual-um ms-udp-port %u%s", + plink->u.virt.ms_mcast_port, VTY_NEWLINE); + if (strcmp(plink->u.virt.bts_mcast_group, DEFAULT_MS_MCAST_GROUP)) + vty_out(vty, " virtual-um bts-multicast-group %s%s", + plink->u.virt.bts_mcast_group, VTY_NEWLINE); + if (plink->u.virt.bts_mcast_port) + vty_out(vty, " virtual-um bts-udp-port %u%s", + plink->u.virt.bts_mcast_port, VTY_NEWLINE); + +} + +#define VUM_STR "Virtual Um layer\n" + +DEFUN(cfg_phy_ms_mcast_group, cfg_phy_ms_mcast_group_cmd, + "virtual-um ms-multicast-group GROUP", + VUM_STR "Configure the MS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.ms_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_ms_mcast_port, cfg_phy_ms_mcast_port_cmd, + "virtual-um ms-udp-port <0-65535>", + VUM_STR "Configure the MS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.ms_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_group, cfg_phy_bts_mcast_group_cmd, + "virtual-um bts-multicast-group GROUP", + VUM_STR "Configure the BTS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.bts_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_port, cfg_phy_bts_mcast_port_cmd, + "virtual-um bts-udp-port <0-65535>", + VUM_STR "Configure the BTS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.bts_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_mcast_dev, cfg_phy_mcast_dev_cmd, + "virtual-um net-device NETDEV", + VUM_STR "Configure the network device\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.mcast_dev, argv[0]); + + return CMD_SUCCESS; +} + +int bts_model_vty_init(struct gsm_bts *bts) +{ + vty_bts = bts; + + install_element(PHY_NODE, &cfg_phy_ms_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_ms_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_mcast_dev_cmd); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1bf7670975b1e367c1c62983020865a043542622 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:34:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:34:28 +0000 Subject: osmo-bts[master]: VIRT-PHY: Initial check-in of a new virtual BTS In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bf7670975b1e367c1c62983020865a043542622 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:34:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:34:46 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-PHY: Initial check-in of a new virtual BTS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Initial check-in of a new virtual BTS ...................................................................... VIRT-PHY: Initial check-in of a new virtual BTS This patch adds a virtual physical layer designed to simulate the Um air interface between BTS and MS. It does so by encapsulating MAC blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP streams, both in uplink and in downlink. The purpose of this is enable testing without any radio hardware or related licenses. OsmocomBB has recently received as similar patch-set, adding a virty_phy executable that can be run on a PC instead of the classic 'layer1' firmware on a real phone. Using GSMTAP means that one can use unmodified wireshark to decode the messages exchanged on the virtual Um layer. This code was originally started by Harald in January 2016, continued by Sebastian Stumpf in late 2016 and early 2017, and finally completed by Harald in July 2017. Change-Id: I1bf7670975b1e367c1c62983020865a043542622 --- M .gitignore M configure.ac M include/osmo-bts/gsm_data.h M include/osmo-bts/phy_link.h M src/Makefile.am A src/osmo-bts-virtual/Makefile.am A src/osmo-bts-virtual/bts_model.c A src/osmo-bts-virtual/l1_if.c A src/osmo-bts-virtual/l1_if.h A src/osmo-bts-virtual/main.c A src/osmo-bts-virtual/osmo_mcast_sock.c A src/osmo-bts-virtual/osmo_mcast_sock.h A src/osmo-bts-virtual/scheduler_virtbts.c A src/osmo-bts-virtual/virtual_um.c A src/osmo-bts-virtual/virtual_um.h A src/osmo-bts-virtual/virtualbts_vty.c 16 files changed, 1,890 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 19ca274..a8c0ece 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ src/osmo-bts-octphy/osmo-bts-octphy +src/osmo-bts-virtual/osmo-bts-virtual + tests/atconfig tests/package.m4 tests/agch/agch_test diff --git a/configure.ac b/configure.ac index 64231b3..0ceb8eb 100644 --- a/configure.ac +++ b/configure.ac @@ -178,6 +178,7 @@ AC_OUTPUT( src/Makefile src/common/Makefile + src/osmo-bts-virtual/Makefile src/osmo-bts-sysmo/Makefile src/osmo-bts-litecell15/Makefile src/osmo-bts-trx/Makefile diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index c513b27..aeac4b2 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -114,6 +114,12 @@ struct { char *sock_path; } pcu; + + struct { + uint32_t last_fn; + struct timeval tv_clock; + struct osmo_timer_list fn_timer; + } vbts; }; enum lchan_ciph_state { diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4c7ff34..d8d3c6b 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -10,11 +10,13 @@ #include "btsconfig.h" struct gsm_bts_trx; +struct virt_um_inst; enum phy_link_type { PHY_LINK_T_NONE, PHY_LINK_T_SYSMOBTS, PHY_LINK_T_OSMOTRX, + PHY_LINK_T_VIRTUAL, }; enum phy_link_state { @@ -46,6 +48,14 @@ uint32_t clock_advance; uint32_t rts_advance; } osmotrx; + struct { + char *mcast_dev; /* Network device for multicast */ + char *bts_mcast_group; /* BTS are listening to this group */ + uint16_t bts_mcast_port; + char *ms_mcast_group; /* MS are listening to this group */ + uint16_t ms_mcast_port; + struct virt_um_inst *virt_um; + } virt; struct { /* MAC address of the PHY */ struct sockaddr_ll phy_addr; @@ -99,6 +109,9 @@ bool sw_act_reported; } osmotrx; struct { + struct l1sched_trx sched; + } virt; + struct { /* logical transceiver number within one PHY */ uint32_t trx_id; /* trx lock state variable */ diff --git a/src/Makefile.am b/src/Makefile.am index e7610fe..4f3f760 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = common +SUBDIRS = common osmo-bts-virtual if ENABLE_SYSMOBTS SUBDIRS += osmo-bts-sysmo diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am new file mode 100644 index 0000000..30069d4 --- /dev/null +++ b/src/osmo-bts-virtual/Makefile.am @@ -0,0 +1,10 @@ +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -Iinclude +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) + +noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h + +bin_PROGRAMS = osmo-bts-virtual + +osmo_bts_virtual_SOURCES = main.c bts_model.c virtualbts_vty.c scheduler_virtbts.c l1_if.c virtual_um.c osmo_mcast_sock.c +osmo_bts_virtual_LDADD = $(top_builddir)/src/common/libbts.a $(top_builddir)/src/common/libl1sched.a $(COMMON_LDADD) diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c new file mode 100644 index 0000000..5293cc3 --- /dev/null +++ b/src/osmo-bts-virtual/bts_model.c @@ -0,0 +1,169 @@ +/* (C) 2015 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 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 + +/* TODO: check if dummy method is sufficient, else implement */ +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return -1; +} + +/* TODO: check if dummy method is sufficient, else implement */ +int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr, + int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) +{ + return -1; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, + struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +static uint8_t vbts_set_bts(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx; + uint8_t tn; + + llist_for_each_entry(trx, &bts->trx_list, list) { + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); + oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OK); + + for (tn = 0; tn < TRX_NR_TS; tn++) + oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); + + /* report availability of trx to the bts. this will trigger the rsl connection */ + oml_mo_tx_sw_act_rep(&trx->mo); + oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + } + return 0; +} + +static uint8_t vbts_set_trx(struct gsm_bts_trx *trx) +{ + return 0; +} + +static uint8_t vbts_set_ts(struct gsm_bts_trx_ts *ts) +{ + struct phy_instance *pinst = trx_phy_instance(ts->trx); + int rc; + + rc = trx_sched_set_pchan(&pinst->u.virt.sched, ts->nr, ts->pchan); + if (rc) + return NM_NACK_RES_NOTAVAIL; + + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, + struct tlv_parsed *new_attr, int kind, void *obj) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + int cause = 0; + + switch (foh->msg_type) { + case NM_MT_SET_BTS_ATTR: + cause = vbts_set_bts(obj); + break; + case NM_MT_SET_RADIO_ATTR: + cause = vbts_set_trx(obj); + break; + case NM_MT_SET_CHAN_ATTR: + cause = vbts_set_ts(obj); + break; + } + return oml_fom_ack_nack(msg, cause); +} + +/* MO: TS 12.21 Managed Object */ +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + int rc; + + switch (mo->obj_class) { + case NM_OC_RADIO_CARRIER: + case NM_OC_CHANNEL: + case NM_OC_SITE_MANAGER: + case NM_OC_BASEB_TRANSC: + case NM_OC_BTS: + oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); + rc = oml_mo_opstart_ack(mo); + break; + /* TODO: gprs support */ + case NM_OC_GPRS_NSE: + case NM_OC_GPRS_CELL: + case NM_OC_GPRS_NSVC: + default: + rc = oml_mo_opstart_nack(mo, NM_NACK_OBJCLASS_NOTSUPP); + } + return rc; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, + void *obj, uint8_t adm_state) +{ + mo->nm_state.administrative = adm_state; + return oml_mo_statechg_ack(mo); +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + + +int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) +{ + return 0; +} + +int bts_model_ctrl_cmds_install(struct gsm_bts *bts) +{ + return 0; +} diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c new file mode 100644 index 0000000..a931916 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.c @@ -0,0 +1,465 @@ +/* Virtual BTS layer 1 primitive handling and interface + * + * Copyright (C) 2015-2017 Harald Welte + * Copyright (C) 2017 Sebastian Stumpf + * + * 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +extern int vbts_sched_start(struct gsm_bts *bts); + +static struct phy_instance *phy_instance_by_arfcn(struct phy_link *plink, uint16_t arfcn) +{ + struct phy_instance *pinst; + + llist_for_each_entry(pinst, &plink->instances, list) { + if (pinst->trx && pinst->trx->arfcn == arfcn) + return pinst; + } + + return NULL; +} + +/** + * Callback to handle incoming messages from the MS. + * The incoming message should be GSM_TAP encapsulated. + * TODO: implement all channels + */ +static void virt_um_rcv_cb(struct virt_um_inst *vui, struct msgb *msg) +{ + struct phy_link *plink = (struct phy_link *)vui->priv; + struct gsmtap_hdr *gh = msgb_l1(msg); + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the cell we currently camp on */ + uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ + uint8_t signal_dbm = gh->signal_dbm; /* signal strength in dBm */ + //uint8_t snr = gh->snr_db; /* signal noise ratio in dB */ + uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ + uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ + struct phy_instance *pinst; + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + /* get rid of l1 gsmtap hdr */ + msg->l2h = msgb_pull(msg, sizeof(*gh)); + + /* convert gsmtap chan to RSL chan and link id */ + chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); + chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + + /* ... or not uplink */ + if (!(arfcn & GSMTAP_ARFCN_F_UPLINK)) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - no uplink flag\n"); + goto nomessage; + } + + /* Generally ignore all msgs that are either not received with the right ARFCN... */ + pinst = phy_instance_by_arfcn(plink, arfcn & GSMTAP_ARFCN_MASK); + if (!pinst) { + LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - msg ARFCN=%d not part of BTS\n", + arfcn & GSMTAP_ARFCN_MASK); + goto nomessage; + } + + /* switch case with removed ACCH flag */ + switch ((gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH) & 0xff) { + case GSMTAP_CHANNEL_RACH: + /* generate primitive for upper layer + * see 04.08 - 3.3.1.3.1: the IMMEDIATE_ASSIGNMENT coming back from the network has to be + * sent with the same ra reference as in the CHANNEL_REQUEST that was received */ + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_RACH, PRIM_OP_INDICATION, msg); + + l1sap.u.rach_ind.chan_nr = chan_nr; + /* TODO: 11bit RACH */ + l1sap.u.rach_ind.ra = msgb_pull_u8(msg); /* directly after gh hdr comes ra */ + l1sap.u.rach_ind.acc_delay = 0; /* probably not used in virt um */ + l1sap.u.rach_ind.is_11bit = 0; + l1sap.u.rach_ind.fn = fn; + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_NONE; /* FIXME: what comes here */ + break; + case GSMTAP_CHANNEL_TCH_F: + case GSMTAP_CHANNEL_TCH_H: +#if 0 + /* TODO: handle voice messages */ + if (!facch && ! tch_acch) { + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, msg); + } +#endif + case GSMTAP_CHANNEL_SDCCH4: + case GSMTAP_CHANNEL_SDCCH8: + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_DATA, + PRIM_OP_INDICATION, msg); + l1sap.u.data.chan_nr = chan_nr; + l1sap.u.data.link_id = link_id; + l1sap.u.data.fn = fn; + l1sap.u.data.rssi = 0; /* Radio Signal Strength Indicator. Best -> 0 */ + l1sap.u.data.ber10k = 0; /* Bit Error Rate in 0.01%. Best -> 0 */ + l1sap.u.data.ta_offs_qbits = 0; /* Burst time of arrival in quarter bits. Probably used for Timing Advance calc. Best -> 0 */ + l1sap.u.data.lqual_cb = 10 * signal_dbm; /* Link quality in centiBel = 10 * dB. */ + l1sap.u.data.pdch_presence_info = PRES_INFO_UNKNOWN; + break; + case GSMTAP_CHANNEL_AGCH: + case GSMTAP_CHANNEL_PCH: + case GSMTAP_CHANNEL_BCCH: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type downlink only!\n"); + goto nomessage; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_CCCH: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type not supported!\n"); + goto nomessage; + default: + LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type unknown\n"); + goto nomessage; + } + + /* forward primitive, forwarded msg will not be freed */ +#warning "we cannot just pass a l1sap primitive on the stack!!!" + l1sap_up(pinst->trx, &l1sap); + DEBUGP(DL1P, "Message forwarded to layer 2.\n"); + return; + +nomessage: + talloc_free(msg); +} + +/* called by common part once OML link is established */ +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +/* called by bts_main to initialize physical link */ +int bts_model_phy_link_open(struct phy_link *plink) +{ + struct phy_instance *pinst; + + //OSMO_ASSERT(plink->type == PHY_LINK_T_VIRTUAL); + + if (plink->u.virt.virt_um) + virt_um_destroy(plink->u.virt.virt_um); + + phy_link_state_set(plink, PHY_LINK_CONNECTING); + + if (!plink->u.virt.bts_mcast_group) + plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; + + if (!plink->u.virt.bts_mcast_port) + plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; + + if (!plink->u.virt.ms_mcast_group) + plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; + + if (!plink->u.virt.ms_mcast_port) + plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; + + plink->u.virt.virt_um = virt_um_init(plink, plink->u.virt.ms_mcast_group, plink->u.virt.ms_mcast_port, + plink->u.virt.bts_mcast_group, plink->u.virt.bts_mcast_port, + virt_um_rcv_cb); + /* set back reference to plink */ + plink->u.virt.virt_um->priv = plink; + if (!plink->u.virt.virt_um) { + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + return -1; + } + + /* iterate over list of PHY instances and initialize the scheduler */ + llist_for_each_entry(pinst, &plink->instances, list) { + trx_sched_init(&pinst->u.virt.sched, pinst->trx); + /* Only start the scheduler for the transceiver on C0. + * If we have multiple tranceivers, CCCH is always on C0 + * and has to be auto active */ + /* Other TRX are activated via OML by a PRIM_INFO_MODIFY + * / PRIM_INFO_ACTIVATE */ + if (pinst->trx && pinst->trx == pinst->trx->bts->c0) { + vbts_sched_start(pinst->trx->bts); + /* init lapdm layer 3 callback for the trx on timeslot 0 == BCCH */ + lchan_init_lapdm(&pinst->trx->ts[0].lchan[CCCH_LCHAN]); + /* FIXME: This is probably the wrong location to set the CCCH to active... the OML link def. needs to be reworked and fixed. */ + pinst->trx->ts[0].lchan[CCCH_LCHAN].rel_act_kind = LCHAN_REL_ACT_OML; + lchan_set_state(&pinst->trx->ts[0].lchan[CCCH_LCHAN], LCHAN_S_ACTIVE); + } + } + + /* this will automatically update the MO state of all associated TRX objects */ + phy_link_state_set(plink, PHY_LINK_CONNECTED); + + return 0; +} + + +/* + * primitive handling + */ + +/* enable ciphering */ +static int l1if_set_ciphering(struct gsm_lchan *lchan, uint8_t chan_nr, int downlink) +{ + struct gsm_bts_trx *trx = lchan->ts->trx; + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + + /* ciphering already enabled in both directions */ + if (lchan->ciph_state == LCHAN_CIPH_RXTX_CONF) + return -EINVAL; + + if (!downlink) { + /* set uplink */ + trx_sched_set_cipher(sched, chan_nr, 0, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RX_CONF; + } else { + /* set downlink and also set uplink, if not already */ + if (lchan->ciph_state != LCHAN_CIPH_RX_CONF) { + trx_sched_set_cipher(sched, chan_nr, 0, + lchan->encr.alg_id - 1, lchan->encr.key, + lchan->encr.key_len); + } + trx_sched_set_cipher(sched, chan_nr, 1, lchan->encr.alg_id - 1, + lchan->encr.key, lchan->encr.key_len); + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + } + + return 0; +} + +static int mph_info_chan_confirm(struct gsm_bts_trx *trx, uint8_t chan_nr, + enum osmo_mph_info_type type, uint8_t cause) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_CONFIRM, + NULL); + l1sap.u.info.type = type; + l1sap.u.info.u.act_cnf.chan_nr = chan_nr; + l1sap.u.info.u.act_cnf.cause = cause; + + return l1sap_up(trx, &l1sap); +} + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn) +{ + struct osmo_phsap_prim l1sap; + + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap.u.info.type = PRIM_INFO_TIME; + l1sap.u.info.u.time_ind.fn = fn; + + if (!bts->c0) + return -EINVAL; + + return l1sap_up(bts->c0, &l1sap); +} + + +static void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, + float ber, float rssi) +{ + memset(l1sap, 0, sizeof(*l1sap)); + osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap->u.info.type = PRIM_INFO_MEAS; + l1sap->u.info.u.meas_ind.chan_nr = chan_nr; + l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4); + l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000); + l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1); +} + +int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, + int n_errors, int n_bits_total, float rssi, float toa) +{ + struct gsm_lchan *lchan = &trx->ts[tn].lchan[l1sap_chan2ss(chan_nr)]; + struct osmo_phsap_prim l1sap; + /* 100% BER is n_bits_total is 0 */ + float ber = n_bits_total==0 ? 1.0 : (float)n_errors / (float)n_bits_total; + + LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS pwr=%ddBm rssi=%.1f dBFS " + "ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n", + gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), + rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); + + l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi); + + return l1sap_up(trx, &l1sap); +} + + + +/* primitive from common part */ +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *sched = &pinst->u.virt.sched; + struct msgb *msg = l1sap->oph.msg; + uint8_t chan_nr; + uint8_t tn, ss; + int rc = 0; + struct gsm_lchan *lchan; + + switch (OSMO_PRIM_HDR(&l1sap->oph)) { + case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_ph_data_req(sched, l1sap); + case OSMO_PRIM(PRIM_TCH, PRIM_OP_REQUEST): + if (!msg) + break; + /* put data into scheduler's queue */ + return trx_sched_tch_req(sched, l1sap); + case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_REQUEST): + switch (l1sap->u.info.type) { + case PRIM_INFO_ACT_CIPH: + chan_nr = l1sap->u.info.u.ciph_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + if (l1sap->u.info.u.ciph_req.uplink) + l1if_set_ciphering(lchan, chan_nr, 0); + if (l1sap->u.info.u.ciph_req.downlink) + l1if_set_ciphering(lchan, chan_nr, 1); + break; + case PRIM_INFO_ACTIVATE: + case PRIM_INFO_DEACTIVATE: + case PRIM_INFO_MODIFY: + chan_nr = l1sap->u.info.u.act_req.chan_nr; + tn = L1SAP_CHAN2TS(chan_nr); + ss = l1sap_chan2ss(chan_nr); + lchan = &trx->ts[tn].lchan[ss]; + /* we receive a channel activation request from the BSC, + * e.g. as a response to a channel req on RACH */ + if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot activate" + " chan_nr 0x%02x\n", chan_nr); + break; + } + /* activate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_DEDIC, 1); + /* activate associated channel */ + trx_sched_set_lchan(sched, chan_nr, LID_SACCH, 1); + /* set mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + (lchan->ho.active == 1)); + /* init lapdm */ + lchan_init_lapdm(lchan); + /* set lchan active */ + lchan_set_state(lchan, LCHAN_S_ACTIVE); + /* set initial ciphering */ + l1if_set_ciphering(lchan, chan_nr, 0); + l1if_set_ciphering(lchan, chan_nr, 1); + if (lchan->encr.alg_id) + lchan->ciph_state = LCHAN_CIPH_RXTX_CONF; + else + lchan->ciph_state = LCHAN_CIPH_NONE; + + /* confirm */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_ACTIVATE, 0); + break; + } + if (l1sap->u.info.type == PRIM_INFO_MODIFY) { + /* change mode */ + trx_sched_set_mode(sched, chan_nr, + lchan->rsl_cmode, lchan->tch_mode, + lchan->tch.amr_mr.num_modes, + lchan->tch.amr_mr.bts_mode[0].mode, + lchan->tch.amr_mr.bts_mode[1].mode, + lchan->tch.amr_mr.bts_mode[2].mode, + lchan->tch.amr_mr.bts_mode[3].mode, + amr_get_initial_mode(lchan), + 0); + break; + } + if ((chan_nr & 0x80)) { + LOGP(DL1C, LOGL_ERROR, "Cannot deactivate " + "chan_nr 0x%02x\n", chan_nr); + break; + } + /* deactivate associated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x40, 0); + if (!l1sap->u.info.u.act_req.sacch_only) { + /* set lchan inactive */ + lchan_set_state(lchan, LCHAN_S_NONE); + /* deactivate dedicated channel */ + trx_sched_set_lchan(sched, chan_nr, 0x00, 0); + /* confirm only on dedicated channel */ + mph_info_chan_confirm(trx, chan_nr, + PRIM_INFO_DEACTIVATE, 0); + lchan->ciph_state = 0; /* FIXME: do this in common/\*.c */ + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown MPH-INFO.req %d\n", + l1sap->u.info.type); + rc = -EINVAL; + goto done; + } + break; + default: + LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d\n", + l1sap->oph.primitive, l1sap->oph.operation); + rc = -EINVAL; + goto done; + } + +done: + if (msg) + msgb_free(msg); + return rc; +} diff --git a/src/osmo-bts-virtual/l1_if.h b/src/osmo-bts-virtual/l1_if.h new file mode 100644 index 0000000..6a843b3 --- /dev/null +++ b/src/osmo-bts-virtual/l1_if.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +#include "virtual_um.h" + +struct vbts_l1h { + struct gsm_bts_trx *trx; + struct l1sched_trx l1s; + struct virt_um_inst *virt_um; +}; + +struct vbts_l1h *l1if_open(struct gsm_bts_trx *trx); +void l1if_close(struct vbts_l1h *l1h); +void l1if_reset(struct vbts_l1h *l1h); + +int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn); + +int vbts_sched_start(struct gsm_bts *bts); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c new file mode 100644 index 0000000..6ceeaec --- /dev/null +++ b/src/osmo-bts-virtual/main.c @@ -0,0 +1,126 @@ +/* Main program for Virtual OsmoBTS */ + +/* (C) 2015 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 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 +#include +#include +#include +#include +#include +#include "virtual_um.h" + +/* dummy, since no direct dsp support */ +uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb; + + btsb = bts_role_bts(bts); + btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + + bts_model_vty_init(bts); + + return 0; +} + +void bts_model_print_help() +{ +} + +int bts_model_handle_options(int argc, char **argv) +{ + int num_errors = 0; + + while (1) { + int option_idx = 0, c; + static const struct option long_options[] = { + /* specific to this hardware */ + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "", + long_options, &option_idx); + if (c == -1) + break; + + switch (c) { + default: + num_errors++; + break; + } + } + + return num_errors; +} + +void bts_model_abis_close(struct gsm_bts *bts) +{ + /* for now, we simply terminate the program and re-spawn */ + bts_shutdown(bts, "Abis close"); +} + +void bts_model_phy_link_set_defaults(struct phy_link *plink) +{ +} + +void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) +{ +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} + +int main(int argc, char **argv) +{ + return bts_main(argc, argv); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.c b/src/osmo-bts-virtual/osmo_mcast_sock.c new file mode 100644 index 0000000..f092a73 --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.c @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "osmo_mcast_sock.h" + +/* server socket is what we use for transmission. It is not subscribed + * to a multicast group or locally bound, but it is just a normal UDP + * socket that's connected to the remote mcast group + port */ +int mcast_server_sock_setup(struct osmo_fd *ofd, const char* tx_mcast_group, + uint16_t tx_mcast_port, bool loopback) +{ + int rc; + unsigned int flags = OSMO_SOCK_F_CONNECT; + + if (!loopback) + flags |= OSMO_SOCK_F_NO_MCAST_LOOP; + + /* setup mcast server socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + tx_mcast_group, tx_mcast_port, flags); + if (rc < 0) { + perror("Failed to create Multicast Server Socket"); + return rc; + } + + return 0; +} + +/* the client socket is what we use for reception. It is a UDP socket + * that's bound to the GSMTAP UDP port and subscribed to the respective + * multicast group */ +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + int rc; + + ofd->cb = fd_rx_cb; + ofd->when = BSC_FD_READ; + ofd->data = osmo_fd_data; + + /* Create mcast client socket */ + rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + NULL, mcast_port, OSMO_SOCK_F_BIND|OSMO_SOCK_F_NO_MCAST_ALL); + if (rc < 0) { + perror("Could not create mcast client socket"); + return rc; + } + + /* Configure and join the multicast group */ + rc = osmo_sock_mcast_subscribe(ofd->fd, mcast_group); + if (rc < 0) { + perror("Failed to join to mcast goup"); + osmo_fd_close(ofd); + return rc; + } + + return 0; +} + +struct mcast_bidir_sock * +mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data) +{ + struct mcast_bidir_sock *bidir_sock = talloc(ctx, struct mcast_bidir_sock); + int rc; + + if (!bidir_sock) + return NULL; + + rc = mcast_client_sock_setup(&bidir_sock->rx_ofd, rx_mcast_group, rx_mcast_port, + fd_rx_cb, osmo_fd_data); + if (rc < 0) { + talloc_free(bidir_sock); + return NULL; + } + rc = mcast_server_sock_setup(&bidir_sock->tx_ofd, tx_mcast_group, tx_mcast_port, loopback); + if (rc < 0) { + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); + return NULL; + } + return bidir_sock; + +} + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, + unsigned int data_len) +{ + return send(bidir_sock->tx_ofd.fd, data, data_len, 0); +} + +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len) +{ + return recv(bidir_sock->rx_ofd.fd, buf, buf_len, 0); +} + +void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) +{ + osmo_fd_close(&bidir_sock->tx_ofd); + osmo_fd_close(&bidir_sock->rx_ofd); + talloc_free(bidir_sock); +} diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.h b/src/osmo-bts-virtual/osmo_mcast_sock.h new file mode 100644 index 0000000..aa2013c --- /dev/null +++ b/src/osmo-bts-virtual/osmo_mcast_sock.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include +#include + +struct mcast_bidir_sock { + struct osmo_fd tx_ofd; + struct osmo_fd rx_ofd; +}; + +struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx, + const char *tx_mcast_group, uint16_t tx_mcast_port, + const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group, + uint16_t tx_mcast_port, bool loopback); + +int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port, + int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), + void *osmo_fd_data); + +int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, unsigned int data_len); +int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len); +void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock); + diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c new file mode 100644 index 0000000..4b4def7 --- /dev/null +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -0,0 +1,633 @@ +/* Scheduler worker functiosn for Virtua OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * + * 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 +#include "virtual_um.h" +#include "l1_if.h" + +static const char *gsmtap_hdr_stringify(const struct gsmtap_hdr *gh) +{ + static char buf[256]; + snprintf(buf, sizeof(buf), "(ARFCN=%u, ts=%u, ss=%u, type=%u/%u)", + gh->arfcn & GSMTAP_ARFCN_MASK, gh->timeslot, gh->sub_slot, gh->type, gh->sub_type); + return buf; +} + +/** + * Send a message over the virtual um interface. + * This will at first wrap the msg with a GSMTAP header and then write it to the declared multicast socket. + * TODO: we might want to remove unused argument uint8_t tn + */ +static void tx_to_virt_um(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, struct msgb *msg) +{ + const struct trx_chan_desc *chdesc = &trx_chan_desc[chan]; + struct msgb *outmsg; /* msg to send with gsmtap header prepended */ + uint16_t arfcn = l1t->trx->arfcn; /* ARFCN of the tranceiver the message is send with */ + uint8_t signal_dbm = 63; /* signal strength, 63 is best */ + uint8_t snr = 63; /* signal noise ratio, 63 is best */ + uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ + uint8_t data_len = msgb_l2len(msg); /* length of data */ + uint8_t rsl_chantype; /* RSL chan type (TS 08.58, 9.3.1) */ + uint8_t subslot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot; /* TDMA timeslot to send in (0-7) */ + uint8_t gsmtap_chantype; /* the GSMTAP channel */ + + rsl_dec_chan_nr(chdesc->chan_nr, &rsl_chantype, &subslot, ×lot); + /* in Osmocom, AGCH is only sent on ccch block 0. no idea why. this seems to cause false GSMTAP channel + * types for agch and pch. */ + if (rsl_chantype == RSL_CHAN_PCH_AGCH && L1SAP_FN2CCCHBLOCK(fn) == 0) + gsmtap_chantype = GSMTAP_CHANNEL_PCH; + else + gsmtap_chantype = chantype_rsl2gsmtap(rsl_chantype, chdesc->link_id); /* the logical channel type */ + + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chantype, subslot, fn, signal_dbm, snr, data, data_len); + if (outmsg) { + struct phy_instance *pinst = trx_phy_instance(l1t->trx); + struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); + + if (virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg) == -1) + LOGP(DL1P, LOGL_ERROR, "%s GSMTAP msg could not send to virtual Um\n", gsmtap_hdr_stringify(gh)); + else + DEBUGP(DL1C, "%s Sending GSMTAP message to virtual Um\n", gsmtap_hdr_stringify(gh)); + } else + LOGP(DL1C, LOGL_ERROR, "GSMTAP msg could not be created!\n"); + + /* free incoming message */ + msgb_free(msg); +} + +/* + * TX on downlink + */ + +/* an IDLE burst returns nothing. on C0 it is replaced by dummy burst */ +ubit_t *tx_idle_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_fcch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_sch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + return NULL; +} + +ubit_t *tx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg; + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + /* check validity of message */ + if (msgb_l2len(msg) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg)); + /* free message */ + msgb_free(msg); + return NULL; + } + + /* transmit the msg received on dl from bsc to layer1 (virt Um) */ + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +ubit_t *tx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg = NULL; /* make GCC happy */ + + if (bid > 0) + return NULL; + + /* get mac block from queue */ + msg = _sched_dequeue_prim(l1t, tn, fn, chan); + if (!msg) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + return NULL; + } + + tx_to_virt_um(l1t, tn, fn, chan, msg); + + return NULL; +} + +static void tx_tch_common(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, struct msgb **_msg_tch, + struct msgb **_msg_facch, int codec_mode_request) +{ + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct msgb *msg1, *msg2, *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + uint8_t rsl_cmode = chan_state->rsl_cmode; + uint8_t tch_mode = chan_state->tch_mode; + struct osmo_phsap_prim *l1sap; +#if 0 + /* handle loss detection of received TCH frames */ + if (rsl_cmode == RSL_CMOD_SPD_SPEECH + && ++(chan_state->lost) > 5) { + uint8_t tch_data[GSM_FR_BYTES]; + int len; + + LOGP(DL1P, LOGL_NOTICE, "Missing TCH bursts detected, sending " + "BFI for %s\n", trx_chan_desc[chan].name); + + /* indicate bad frame */ + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + tch_data[0] = 0x70; /* F = 0, FT = 111 */ + memset(tch_data + 1, 0, 14); + len = 15; + break; + } + memset(tch_data, 0, GSM_FR_BYTES); + len = GSM_FR_BYTES; + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode1; + memset(tch_data, 0, GSM_EFR_BYTES); + len = GSM_EFR_BYTES; + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ + len = amr_compose_payload(tch_data, + chan_state->codec[chan_state->dl_cmr], + chan_state->codec[chan_state->dl_ft], 1); + if (len < 2) + break; + memset(tch_data + 2, 0, len - 2); + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + break; + default: +inval_mode1: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + len = 0; + } + if (len) + _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + } +#endif + + /* get frame and unlink from queue */ + msg1 = _sched_dequeue_prim(l1t, tn, fn, chan); + msg2 = _sched_dequeue_prim(l1t, tn, fn, chan); + if (msg1) { + l1sap = msgb_l1sap_prim(msg1); + if (l1sap->oph.primitive == PRIM_TCH) { + msg_tch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "TCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_facch = msg2; + } + } else { + msg_facch = msg1; + if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive != PRIM_TCH) { + LOGP(DL1P, LOGL_FATAL, "FACCH twice, " + "please FIX! "); + msgb_free(msg2); + } else + msg_tch = msg2; + } + } + } else if (msg2) { + l1sap = msgb_l1sap_prim(msg2); + if (l1sap->oph.primitive == PRIM_TCH) + msg_tch = msg2; + else + msg_facch = msg2; + } + + /* check validity of message */ + if (msg_facch && msgb_l2len(msg_facch) != GSM_MACBLOCK_LEN) { + LOGP(DL1P, LOGL_FATAL, "Prim not 23 bytes, please FIX! " + "(len=%d)\n", msgb_l2len(msg_facch)); + /* free message */ + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* check validity of message, get AMR ft and cmr */ + if (!msg_facch && msg_tch) { + int len; +#if 0 + uint8_t bfi, cmr_codec, ft_codec; + int cmr, ft, i; +#endif + + if (rsl_cmode != RSL_CMOD_SPD_SPEECH) { + LOGP(DL1P, LOGL_NOTICE, "%s Dropping speech frame, " + "because we are not in speech mode trx=%u " + "ts=%u at fn=%u.\n", trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + + switch (tch_mode) { + case GSM48_CMODE_SPEECH_V1: /* FR / HR */ + if (chan != TRXC_TCHF) { /* HR */ + len = 15; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] & 0xf0) != 0x00) { + LOGP(DL1P, LOGL_NOTICE, "%s " + "Transmitting 'bad " + "HR frame' trx=%u ts=%u at " + "fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + } + len = GSM_FR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xd) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "FR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_EFR: /* EFR */ + if (chan != TRXC_TCHF) + goto inval_mode2; + len = GSM_EFR_BYTES; + if (msgb_l2len(msg_tch) >= 1 + && (msg_tch->l2h[0] >> 4) != 0xc) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "EFR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } + break; + case GSM48_CMODE_SPEECH_AMR: /* AMR */ +#if 0 + len = amr_decompose_payload(msg_tch->l2h, + msgb_l2len(msg_tch), &cmr_codec, &ft_codec, + &bfi); + cmr = -1; + ft = -1; + for (i = 0; i < chan_state->codecs; i++) { + if (chan_state->codec[i] == cmr_codec) + cmr = i; + if (chan_state->codec[i] == ft_codec) + ft = i; + } + if (cmr >= 0) { /* new request */ + chan_state->dl_cmr = cmr; + /* disable AMR loop */ + trx_loop_amr_set(chan_state, 0); + } else { + /* enable AMR loop */ + trx_loop_amr_set(chan_state, 1); + } + if (ft < 0) { + LOGP(DL1P, LOGL_ERROR, "%s Codec (FT = %d) " + " of RTP frame not in list. " + "trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + if (codec_mode_request && chan_state->dl_ft != ft) { + LOGP(DL1P, LOGL_NOTICE, "%s Codec (FT = %d) " + " of RTP cannot be changed now, but in " + "next frame. trx=%u ts=%u\n", + trx_chan_desc[chan].name, ft_codec, + l1t->trx->nr, tn); + goto free_bad_msg; + } + chan_state->dl_ft = ft; + if (bfi) { + LOGP(DL1P, LOGL_NOTICE, "%s Transmitting 'bad " + "AMR frame' trx=%u ts=%u at fn=%u.\n", + trx_chan_desc[chan].name, + l1t->trx->nr, tn, fn); + goto free_bad_msg; + } +#else + LOGP(DL1P, LOGL_ERROR, "AMR not supported!\n"); + goto free_bad_msg; +#endif + break; + default: +inval_mode2: + LOGP(DL1P, LOGL_ERROR, "TCH mode invalid, please " + "fix!\n"); + goto free_bad_msg; + } + if (len < 0) { + LOGP(DL1P, LOGL_ERROR, "Cannot send invalid AMR " + "payload\n"); + goto free_bad_msg; + } + if (msgb_l2len(msg_tch) != len) { + LOGP(DL1P, LOGL_ERROR, "Cannot send payload with " + "invalid length! (expecing %d, received %d)\n", + len, msgb_l2len(msg_tch)); +free_bad_msg: + /* free message */ + msgb_free(msg_tch); + msg_tch = NULL; + goto send_frame; + } + } + +send_frame: + *_msg_tch = msg_tch; + *_msg_facch = msg_facch; +} + +ubit_t *tx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + + if (bid > 0) + return NULL; + + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* no message at all */ + if (!msg_tch && !msg_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + + return NULL; +} + +ubit_t *tx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, uint16_t *nbits) +{ + struct msgb *msg_tch = NULL, *msg_facch = NULL; + struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan]; + //uint8_t tch_mode = chan_state->tch_mode; + + /* send burst, if we already got a frame */ + if (bid > 0) + return NULL; + + /* get TCH and/or FACCH */ + tx_tch_common(l1t, tn, fn, chan, bid, &msg_tch, &msg_facch, + (((fn + 4) % 26) >> 2) & 1); + + /* check for FACCH alignment */ + if (msg_facch && ((((fn + 4) % 26) >> 2) & 1)) { + LOGP(DL1P, LOGL_ERROR, "%s Cannot transmit FACCH starting on " + "even frames, please fix RTS!\n", + trx_chan_desc[chan].name); + msgb_free(msg_facch); + msg_facch = NULL; + } + + /* no message at all */ + if (!msg_tch && !msg_facch && !chan_state->dl_ongoing_facch) { + LOGP(DL1P, LOGL_INFO, "%s has not been served !! No prim for " + "trx=%u ts=%u at fn=%u to transmit.\n", + trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); + goto send_burst; + } + + if (msg_facch) { + tx_to_virt_um(l1t, tn, fn, chan, msg_facch); + msgb_free(msg_tch); + } else + tx_to_virt_um(l1t, tn, fn, chan, msg_tch); + +send_burst: + return NULL; +} + + +/*********************************************************************** + * RX on uplink (indication to upper layer) + ***********************************************************************/ + +/* we don't use those functions, as we feed the MAC frames from GSMTAP + * directly into the L1SAP, bypassing the TDMA multiplex logic oriented + * towards receiving bursts */ + +int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +/*! \brief a single burst was received by the PHY, process it */ +int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, + enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, + int8_t rssi, float toa) +{ + return 0; +} + +void _sched_act_rach_det(struct l1sched_trx *l1t, uint8_t tn, uint8_t ss, int activate) +{ +} + +/*********************************************************************** + * main scheduler function + ***********************************************************************/ + +#define RTS_ADVANCE 5 /* about 20ms */ +#define FRAME_DURATION_uS 4615 + +static int vbts_sched_fn(struct gsm_bts *bts, uint32_t fn) +{ + struct gsm_bts_trx *trx; + + /* send time indication */ + /* update model with new frame number, lot of stuff happening, measurements of timeslots */ + /* saving GSM time in BTS model, and more */ + l1if_mph_time_ind(bts, fn); + + /* advance the frame number? */ + llist_for_each_entry(trx, &bts->trx_list, list) { + struct phy_instance *pinst = trx_phy_instance(trx); + struct l1sched_trx *l1t = &pinst->u.virt.sched; + int tn; + uint16_t nbits; + + /* do for each of the 8 timeslots */ + for (tn = 0; tn < ARRAY_SIZE(l1t->ts); tn++) { + /* Generate RTS indication to higher layers */ + /* This will basically do 2 things (check l1_if:bts_model_l1sap_down): + * 1) Get pending messages from layer 2 (from the lapdm queue) + * 2) Process the messages + * --> Handle and process non-transparent RSL-Messages (activate channel, ) + * --> Forward transparent RSL-DATA-Messages to the ms by appending them to + * the l1-dl-queue */ + _sched_rts(l1t, tn, (fn + RTS_ADVANCE) % GSM_HYPERFRAME); + /* schedule transmit backend functions */ + /* Process data in the l1-dlqueue and forward it + * to MS */ + /* the returned bits are not used here, the routines called will directly forward their + * bits to the virt Um */ + _sched_dl_burst(l1t, tn, fn, &nbits); + } + } + + return 0; +} + +static void vbts_fn_timer_cb(void *data) +{ + struct gsm_bts *bts = data; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + struct timeval tv_now; + struct timeval *tv_clock = &btsb->vbts.tv_clock; + int32_t elapsed_us; + + gettimeofday(&tv_now, NULL); + + /* check how much time elapsed till the last timer callback call. + * this value should be about 4.615 ms (a bit greater) as this is the scheduling interval */ + elapsed_us = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 + + (tv_now.tv_usec - tv_clock->tv_usec); + + /* not so good somehow a lot of time passed between two timer callbacks */ + if (elapsed_us > 2 *FRAME_DURATION_uS) + LOGP(DL1P, LOGL_NOTICE, "vbts_fn_timer_cb after %d us\n", elapsed_us); + + /* schedule the current frame/s (fn = frame number) + * this loop will be called at least once, but can also be executed + * multiple times if more than one frame duration (4615us) passed till the last callback */ + while (elapsed_us > FRAME_DURATION_uS / 2) { + const struct timeval tv_frame = { + .tv_sec = 0, + .tv_usec = FRAME_DURATION_uS, + }; + timeradd(tv_clock, &tv_frame, tv_clock); + /* increment the frame number in the BTS model instance */ + btsb->vbts.last_fn = (btsb->vbts.last_fn + 1) % GSM_HYPERFRAME; + vbts_sched_fn(bts, btsb->vbts.last_fn); + elapsed_us -= FRAME_DURATION_uS; + } + + /* re-schedule the timer */ + /* timer is set to frame duration - elapsed time to guarantee that this cb method will be + * periodically executed every 4.615ms */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS - elapsed_us); +} + +int vbts_sched_start(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + + LOGP(DL1P, LOGL_NOTICE, "starting VBTS scheduler\n"); + + memset(&btsb->vbts.fn_timer, 0, sizeof(btsb->vbts.fn_timer)); + btsb->vbts.fn_timer.cb = vbts_fn_timer_cb; + btsb->vbts.fn_timer.data = bts; + + gettimeofday(&btsb->vbts.tv_clock, NULL); + /* trigger the first timer after 4615us (a frame duration) */ + osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS); + + return 0; +} diff --git a/src/osmo-bts-virtual/virtual_um.c b/src/osmo-bts-virtual/virtual_um.c new file mode 100644 index 0000000..e6b9615 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.c @@ -0,0 +1,92 @@ +/* Routines for a Virtual Um interface over GSMTAP/UDP */ + +/* (C) 2015 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 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 "osmo_mcast_sock.h" +#include "virtual_um.h" +#include + +/** + * Virtual UM interface file descriptor callback. + * Should be called by select.c when the fd is ready for reading. + */ +static int virt_um_fd_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct virt_um_inst *vui = ofd->data; + + if (what & BSC_FD_READ) { + struct msgb *msg = msgb_alloc(VIRT_UM_MSGB_SIZE, "Virtual UM Rx"); + int rc; + + /* read message from fd into message buffer */ + rc = mcast_bidir_sock_rx(vui->mcast_sock, msgb_data(msg), msgb_tailroom(msg)); + if (rc > 0) { + msgb_put(msg, rc); + msg->l1h = msgb_data(msg); + /* call the l1 callback function for a received msg */ + vui->recv_cb(vui, msg); + } else { + /* FIXME: this kind of error handling might be a bit harsh */ + vui->recv_cb(vui, NULL); + osmo_fd_close(ofd); + } + } + + return 0; +} + +struct virt_um_inst *virt_um_init(void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)) +{ + struct virt_um_inst *vui = talloc_zero(ctx, struct virt_um_inst); + vui->mcast_sock = mcast_bidir_sock_setup(ctx, tx_mcast_group, tx_mcast_port, + rx_mcast_group, rx_mcast_port, 1, virt_um_fd_cb, vui); + vui->recv_cb = recv_cb; + + return vui; + +} + +void virt_um_destroy(struct virt_um_inst *vui) +{ + mcast_bidir_sock_close(vui->mcast_sock); + talloc_free(vui); +} + +/** + * Write msg to to multicast socket and free msg afterwards + */ +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg) +{ + int rc; + + rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), + msgb_length(msg)); + msgb_free(msg); + + return rc; +} diff --git a/src/osmo-bts-virtual/virtual_um.h b/src/osmo-bts-virtual/virtual_um.h new file mode 100644 index 0000000..6e7c384 --- /dev/null +++ b/src/osmo-bts-virtual/virtual_um.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include "osmo_mcast_sock.h" + +#define VIRT_UM_MSGB_SIZE 256 +#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ +#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ + +struct virt_um_inst { + void *priv; + struct mcast_bidir_sock *mcast_sock; + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg); +}; + +struct virt_um_inst *virt_um_init( + void *ctx, char *tx_mcast_group, uint16_t tx_mcast_port, + char *rx_mcast_group, uint16_t rx_mcast_port, + void (*recv_cb)(struct virt_um_inst *vui, struct msgb *msg)); + +void virt_um_destroy(struct virt_um_inst *vui); + +int virt_um_write_msg(struct virt_um_inst *vui, struct msgb *msg); diff --git a/src/osmo-bts-virtual/virtualbts_vty.c b/src/osmo-bts-virtual/virtualbts_vty.c new file mode 100644 index 0000000..45c1086 --- /dev/null +++ b/src/osmo-bts-virtual/virtualbts_vty.c @@ -0,0 +1,185 @@ +/* VTY interface for virtual OsmoBTS */ + +/* (C) 2015-2017 by Harald Welte + * (C) 2017 Sebastian Stumpf + * 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 +#include +#include +#include "virtual_um.h" + +#define TRX_STR "Transceiver related commands\n" "TRX number\n" + +#define SHOW_TRX_STR \ + SHOW_STR \ + TRX_STR + +static struct gsm_bts *vty_bts; + +void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) +{ +} + +void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) +{ +} + +void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) +{ +} + +void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) +{ + if (plink->u.virt.mcast_dev) + vty_out(vty, " virtual-um net-device %s%s", + plink->u.virt.mcast_dev, VTY_NEWLINE); + if (strcmp(plink->u.virt.ms_mcast_group, DEFAULT_BTS_MCAST_GROUP)) + vty_out(vty, " virtual-um ms-multicast-group %s%s", + plink->u.virt.ms_mcast_group, VTY_NEWLINE); + if (plink->u.virt.ms_mcast_port) + vty_out(vty, " virtual-um ms-udp-port %u%s", + plink->u.virt.ms_mcast_port, VTY_NEWLINE); + if (strcmp(plink->u.virt.bts_mcast_group, DEFAULT_MS_MCAST_GROUP)) + vty_out(vty, " virtual-um bts-multicast-group %s%s", + plink->u.virt.bts_mcast_group, VTY_NEWLINE); + if (plink->u.virt.bts_mcast_port) + vty_out(vty, " virtual-um bts-udp-port %u%s", + plink->u.virt.bts_mcast_port, VTY_NEWLINE); + +} + +#define VUM_STR "Virtual Um layer\n" + +DEFUN(cfg_phy_ms_mcast_group, cfg_phy_ms_mcast_group_cmd, + "virtual-um ms-multicast-group GROUP", + VUM_STR "Configure the MS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.ms_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_ms_mcast_port, cfg_phy_ms_mcast_port_cmd, + "virtual-um ms-udp-port <0-65535>", + VUM_STR "Configure the MS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.ms_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_group, cfg_phy_bts_mcast_group_cmd, + "virtual-um bts-multicast-group GROUP", + VUM_STR "Configure the BTS multicast group\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.bts_mcast_group, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_bts_mcast_port, cfg_phy_bts_mcast_port_cmd, + "virtual-um bts-udp-port <0-65535>", + VUM_STR "Configure the BTS UDP port\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + plink->u.virt.bts_mcast_port = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_mcast_dev, cfg_phy_mcast_dev_cmd, + "virtual-um net-device NETDEV", + VUM_STR "Configure the network device\n") +{ + struct phy_link *plink = vty->index; + + if (plink->state != PHY_LINK_SHUTDOWN) { + vty_out(vty, "Can only reconfigure a PHY link that is down%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_talloc_replace_string(plink, &plink->u.virt.mcast_dev, argv[0]); + + return CMD_SUCCESS; +} + +int bts_model_vty_init(struct gsm_bts *bts) +{ + vty_bts = bts; + + install_element(PHY_NODE, &cfg_phy_ms_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_ms_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_group_cmd); + install_element(PHY_NODE, &cfg_phy_bts_mcast_port_cmd); + install_element(PHY_NODE, &cfg_phy_mcast_dev_cmd); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1bf7670975b1e367c1c62983020865a043542622 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:34:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:34:52 +0000 Subject: osmo-bts[master]: VIRT-PHY: Added example configurations for openbsc and osmobts. In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I368d4a378e20028603b09825eee766abb9195774 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:34:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:34:56 +0000 Subject: osmo-bts[master]: VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I881a1c61ea47399c9b1385fb220cd587e3593e82 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:34:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:34:59 +0000 Subject: osmo-bts[master]: VIRT-PHY: Fix handling of default values for vty configuration In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5d7f2c1dc8bc3d11db5c607b664730e4dcd58c96 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:35:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:35:14 +0000 Subject: osmo-bts[master]: VIRT-PHY: Added test option for fast hyperframe repeat. In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3adf14df5fcd8daf53363c27b3772c42d7122e9 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:35:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:35:19 +0000 Subject: osmo-bts[master]: VIRT-PHY: Use IPv4 multicast groups for private / local scope In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba1ae69f3f193a33f1da343c6562f67bd8d3557f Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:35:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:35:23 +0000 Subject: osmo-bts[master]: VIRT-PHY: cause BTS to terminate in case of recv()/send() on... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ae3fdd7cc35fdf235550a3b8362020fdd287c13 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:35:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:35:40 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: cause BTS to terminate in case of recv()/send() on... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3248 to look at the new patch set (#3). VIRT-PHY: cause BTS to terminate in case of recv()/send() on udp socket returns 0 It is important that we reliably terminate the BTS in case any of the VirtPHY multicast sockets dies for whatever reason. Change-Id: I5ae3fdd7cc35fdf235550a3b8362020fdd287c13 --- M src/osmo-bts-virtual/l1_if.c M src/osmo-bts-virtual/scheduler_virtbts.c M src/osmo-bts-virtual/virtual_um.c 3 files changed, 19 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/48/3248/3 diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 36b2748..9212121 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -66,6 +66,13 @@ static void virt_um_rcv_cb(struct virt_um_inst *vui, struct msgb *msg) { struct phy_link *plink = (struct phy_link *)vui->priv; + struct phy_instance *pinst; + if (!msg) { + pinst = phy_instance_by_num(plink, 0); + bts_shutdown(pinst->trx->bts, "VirtPHY read socket died\n"); + return; + } + struct gsmtap_hdr *gh = msgb_l1(msg); uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the cell we currently camp on */ @@ -77,7 +84,6 @@ uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ - struct phy_instance *pinst; struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index 9b52864..1338ce5 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -93,9 +94,13 @@ if (outmsg) { struct phy_instance *pinst = trx_phy_instance(l1t->trx); struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); + int rc; - if (virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg) == -1) + rc = virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg); + if (rc < 0) LOGP(DL1P, LOGL_ERROR, "%s GSMTAP msg could not send to virtual Um\n", gsmtap_hdr_stringify(gh)); + else if (rc == 0) + bts_shutdown(l1t->trx->bts, "VirtPHY write socket died\n"); else DEBUGP(DL1C, "%s Sending GSMTAP message to virtual Um\n", gsmtap_hdr_stringify(gh)); } else diff --git a/src/osmo-bts-virtual/virtual_um.c b/src/osmo-bts-virtual/virtual_um.c index e6b9615..e8d4252 100644 --- a/src/osmo-bts-virtual/virtual_um.c +++ b/src/osmo-bts-virtual/virtual_um.c @@ -48,11 +48,12 @@ msg->l1h = msgb_data(msg); /* call the l1 callback function for a received msg */ vui->recv_cb(vui, msg); - } else { - /* FIXME: this kind of error handling might be a bit harsh */ + } else if (rc == 0) { vui->recv_cb(vui, NULL); osmo_fd_close(ofd); - } + } else + perror("Read from multicast socket"); + } return 0; @@ -86,6 +87,8 @@ rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), msgb_length(msg)); + if (rc < 0) + perror("Writing to multicast socket"); msgb_free(msg); return rc; -- To view, visit https://gerrit.osmocom.org/3248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ae3fdd7cc35fdf235550a3b8362020fdd287c13 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:35:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:35:40 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Added example configurations for openbsc and osmobts. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3243 to look at the new patch set (#5). VIRT-PHY: Added example configurations for openbsc and osmobts. Change-Id: I368d4a378e20028603b09825eee766abb9195774 --- M Makefile.am A doc/examples/virtual/openbsc-virtual.cfg A doc/examples/virtual/osmobts-virtual.cfg 3 files changed, 215 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/3243/5 diff --git a/Makefile.am b/Makefile.am index 0f85151..69d0b93 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,8 @@ contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmobts-mgr.cfg \ + doc/examples/virtual/openbsc-virtual.cfg \ + doc/examples/virtual/osmobts-virtual.cfg \ README.md @RELMAKE@ diff --git a/doc/examples/virtual/openbsc-virtual.cfg b/doc/examples/virtual/openbsc-virtual.cfg new file mode 100644 index 0000000..8044fa8 --- /dev/null +++ b/doc/examples/virtual/openbsc-virtual.cfg @@ -0,0 +1,151 @@ +! +! OpenBSC (0.15.0.629-34f0-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 0 + logging print category 1 + logging timestamp 1 + logging level all info + logging level rll notice + logging level cc notice + logging level mm debug + logging level rr notice + logging level rsl notice + logging level nm info + logging level mncc notice + logging level pag notice + logging level meas notice + logging level sccp notice + logging level msc notice + logging level mgcp notice + logging level ho notice + logging level db notice + logging level ref notice + logging level gprs debug + logging level ns info + logging level bssgp debug + logging level llc debug + logging level sndcp debug + logging level nat notice + logging level ctrl notice + logging level smpp debug + logging level filter debug + logging level ranap debug + logging level sua debug + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats notice + logging level lgsup notice + logging level loap notice +! +stats interval 5 +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +network + network country code 262 + mobile network code 42 + short name OpenBSC + long name OpenBSC + auth policy accept-all + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + neci 1 + paging any use tch 0 + rrlp mode ms-based + mm info 1 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + timer t3101 10 + timer t3103 0 + timer t3105 0 + timer t3107 0 + timer t3109 4 + timer t3111 0 + timer t3113 60 + timer t3115 0 + timer t3117 0 + timer t3119 0 + timer t3122 10 + timer t3141 0 + subscriber-keep-in-ram 0 + bts 0 + type sysmobts + band DCS1800 + cell_identity 6969 + location_area_code 1 + base_station_id_code 63 + ms max power 0 + cell reselection hysteresis 4 + rxlev access min 0 + periodic location update 30 + radio-link-timeout 32 + channel allocator descending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + ip.access unit_id 6969 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode automatic + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 666 + nominal power 0 + max_power_red 0 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config SDCCH8 + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +mncc-int + default-codec tch-f fr + default-codec tch-h hr +nitb + subscriber-create-on-demand + subscriber-create-on-demand random 1 24 + assign-tmsi diff --git a/doc/examples/virtual/osmobts-virtual.cfg b/doc/examples/virtual/osmobts-virtual.cfg new file mode 100644 index 0000000..5526e08 --- /dev/null +++ b/doc/examples/virtual/osmobts-virtual.cfg @@ -0,0 +1,62 @@ +! +! OsmoBTS (0.4.0.216-bc49-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 0 + logging color 0 + logging print category 1 + logging timestamp 0 + logging level all everything + logging level rsl info + logging level oml info + logging level rll notice + logging level rr notice + logging level meas notice + logging level pag info + logging level l1c info + logging level l1p info + logging level dsp error + logging level pcu notice + logging level ho debug + logging level trx notice + logging level loop notice + logging level abis debug + logging level rtp notice + logging level sum error + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats error +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +phy 0 + instance 0 +bts 0 + band DCS1800 + ipa unit-id 6969 0 + oml remote-ip 127.0.0.1 + rtp jitter-buffer 100 + paging queue-size 200 + paging lifetime 0 + uplink-power-target -75 + min-qual-rach 50 + min-qual-norm -5 + trx 0 + power-ramp max-initial 23000 mdBm + power-ramp step-size 2000 mdB + power-ramp step-interval 1 + ms-power-control dsp + phy 0 instance 0 -- To view, visit https://gerrit.osmocom.org/3243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I368d4a378e20028603b09825eee766abb9195774 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:35:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:35:40 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3244 to look at the new patch set (#5). VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was always 0. Timeslot is not encoded in the chan_nr accessible in the channel description but was taken from there and so it was always 0. Change-Id: I881a1c61ea47399c9b1385fb220cd587e3593e82 --- M src/osmo-bts-virtual/scheduler_virtbts.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/3244/5 diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index 4b4def7..df6fbeb 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -72,6 +72,8 @@ uint8_t gsmtap_chantype; /* the GSMTAP channel */ rsl_dec_chan_nr(chdesc->chan_nr, &rsl_chantype, &subslot, ×lot); + /* the timeslot is not encoded in the chan_nr of the chdesc, and so has to be overwritten */ + timeslot = tn; /* in Osmocom, AGCH is only sent on ccch block 0. no idea why. this seems to cause false GSMTAP channel * types for agch and pch. */ if (rsl_chantype == RSL_CHAN_PCH_AGCH && L1SAP_FN2CCCHBLOCK(fn) == 0) -- To view, visit https://gerrit.osmocom.org/3244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I881a1c61ea47399c9b1385fb220cd587e3593e82 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:35:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:35:40 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Fix handling of default values for vty configuration In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3245 to look at the new patch set (#5). VIRT-PHY: Fix handling of default values for vty configuration The defaults must be set during bts_model_phy_link_set_defaults() and can then later be overridden by the vty (from the config file). They should only be written back to the file if they differ from the default settings. Change-Id: I5d7f2c1dc8bc3d11db5c607b664730e4dcd58c96 --- M src/osmo-bts-virtual/l1_if.c M src/osmo-bts-virtual/main.c M src/osmo-bts-virtual/virtualbts_vty.c 3 files changed, 6 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/3245/5 diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index a931916..36b2748 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -186,18 +186,6 @@ phy_link_state_set(plink, PHY_LINK_CONNECTING); - if (!plink->u.virt.bts_mcast_group) - plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; - - if (!plink->u.virt.bts_mcast_port) - plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; - - if (!plink->u.virt.ms_mcast_group) - plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; - - if (!plink->u.virt.ms_mcast_port) - plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; - plink->u.virt.virt_um = virt_um_init(plink, plink->u.virt.ms_mcast_group, plink->u.virt.ms_mcast_port, plink->u.virt.bts_mcast_group, plink->u.virt.bts_mcast_port, virt_um_rcv_cb); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index 6ceeaec..f1dc293 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -104,6 +104,10 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink) { + plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; + plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; + plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; + plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; } void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) diff --git a/src/osmo-bts-virtual/virtualbts_vty.c b/src/osmo-bts-virtual/virtualbts_vty.c index 45c1086..323222b 100644 --- a/src/osmo-bts-virtual/virtualbts_vty.c +++ b/src/osmo-bts-virtual/virtualbts_vty.c @@ -72,13 +72,13 @@ if (strcmp(plink->u.virt.ms_mcast_group, DEFAULT_BTS_MCAST_GROUP)) vty_out(vty, " virtual-um ms-multicast-group %s%s", plink->u.virt.ms_mcast_group, VTY_NEWLINE); - if (plink->u.virt.ms_mcast_port) + if (plink->u.virt.ms_mcast_port != DEFAULT_BTS_MCAST_PORT) vty_out(vty, " virtual-um ms-udp-port %u%s", plink->u.virt.ms_mcast_port, VTY_NEWLINE); if (strcmp(plink->u.virt.bts_mcast_group, DEFAULT_MS_MCAST_GROUP)) vty_out(vty, " virtual-um bts-multicast-group %s%s", plink->u.virt.bts_mcast_group, VTY_NEWLINE); - if (plink->u.virt.bts_mcast_port) + if (plink->u.virt.bts_mcast_port != DEFAULT_MS_MCAST_PORT) vty_out(vty, " virtual-um bts-udp-port %u%s", plink->u.virt.bts_mcast_port, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/3245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5d7f2c1dc8bc3d11db5c607b664730e4dcd58c96 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:35:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:35:40 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Added test option for fast hyperframe repeat. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3246 to look at the new patch set (#5). VIRT-PHY: Added test option for fast hyperframe repeat. Frame number will restart at 0 after each superframe (approx. 6.1 sec) if enabled. Can be enabled by preprocessor define. Change-Id: If3adf14df5fcd8daf53363c27b3772c42d7122e9 --- M src/osmo-bts-virtual/scheduler_virtbts.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/3246/5 diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index df6fbeb..9b52864 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -43,6 +43,8 @@ #include "virtual_um.h" #include "l1_if.h" +#define MODULO_HYPERFRAME 0 + static const char *gsmtap_hdr_stringify(const struct gsmtap_hdr *gh) { static char buf[256]; @@ -81,7 +83,13 @@ else gsmtap_chantype = chantype_rsl2gsmtap(rsl_chantype, chdesc->link_id); /* the logical channel type */ +#if MODULO_HYPERFRAME + /* Restart fn after every superframe (26 * 51 frames) to simulate hyperframe overflow each 6 seconds. */ + fn %= 26 * 51; +#endif + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chantype, subslot, fn, signal_dbm, snr, data, data_len); + if (outmsg) { struct phy_instance *pinst = trx_phy_instance(l1t->trx); struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); -- To view, visit https://gerrit.osmocom.org/3246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3adf14df5fcd8daf53363c27b3772c42d7122e9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 19:35:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 19:35:40 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Use IPv4 multicast groups for private / local scope In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3247 to look at the new patch set (#5). VIRT-PHY: Use IPv4 multicast groups for private / local scope The addresses in the original code make little sense: * 224.0.0.1 is "All systems on this subnet" and not routed outside the local ethernet segment * 225.0.0.1 is in a RESERVED range that shouldn't be used Change-Id: Iba1ae69f3f193a33f1da343c6562f67bd8d3557f --- M src/osmo-bts-virtual/virtual_um.h 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/3247/5 diff --git a/src/osmo-bts-virtual/virtual_um.h b/src/osmo-bts-virtual/virtual_um.h index 6e7c384..ac098dd 100644 --- a/src/osmo-bts-virtual/virtual_um.h +++ b/src/osmo-bts-virtual/virtual_um.h @@ -4,10 +4,15 @@ #include #include "osmo_mcast_sock.h" +/* We use multicast group addresses from the 239.192.0.0/14 rage, as + * those are designated by RFC2365 as "IPv4 Organization Local Scope, + * "... the space from which an organization should allocate sub- + * ranges when defining scopes for private use." */ + #define VIRT_UM_MSGB_SIZE 256 -#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_GROUP "239.193.23.1" #define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ -#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_GROUP "239.193.23.2" #define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ struct virt_um_inst { -- To view, visit https://gerrit.osmocom.org/3247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba1ae69f3f193a33f1da343c6562f67bd8d3557f Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Thu Jul 13 20:00:13 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:00:13 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5967d1562cffc_5caec8af782284883@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 103s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 103s] Makefile:671: recipe for target 'check-am' failed [ 103s] make[5]: *** [check-am] Error 2 [ 103s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 103s] Makefile:523: recipe for target 'check-recursive' failed [ 103s] make[4]: *** [check-recursive] Error 1 [ 103s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 103s] Makefile:382: recipe for target 'check-recursive' failed [ 103s] make[3]: *** [check-recursive] Error 1 [ 103s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 103s] Makefile:405: recipe for target 'check-recursive' failed [ 103s] make[2]: *** [check-recursive] Error 1 [ 103s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 103s] Makefile:696: recipe for target 'check' failed [ 103s] make[1]: *** [check] Error 2 [ 103s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 103s] dh_auto_test: make -j1 check returned exit code 2 [ 103s] debian/rules:7: recipe for target 'build' failed [ 103s] make: *** [build] Error 2 [ 103s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 103s] [ 103s] lamb25 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:00:01 UTC 2017. [ 103s] [ 103s] ### VM INTERACTION START ### [ 106s] [ 93.603631] reboot: Power down [ 106s] ### VM INTERACTION END ### [ 106s] [ 106s] lamb25 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:00:05 UTC 2017. [ 106s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:00:49 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:00:49 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5967d19189557_5caec8af782285172@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 84s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:671: recipe for target 'check-am' failed [ 84s] make[5]: *** [check-am] Error 2 [ 84s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:523: recipe for target 'check-recursive' failed [ 84s] make[4]: *** [check-recursive] Error 1 [ 84s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:382: recipe for target 'check-recursive' failed [ 84s] make[3]: *** [check-recursive] Error 1 [ 84s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 84s] Makefile:405: recipe for target 'check-recursive' failed [ 84s] make[2]: *** [check-recursive] Error 1 [ 84s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 84s] Makefile:696: recipe for target 'check' failed [ 84s] make[1]: *** [check] Error 2 [ 84s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 84s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 84s] debian/rules:7: recipe for target 'build' failed [ 84s] make: *** [build] Error 2 [ 84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 84s] [ 84s] lamb73 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:00:32 UTC 2017. [ 84s] [ 84s] ### VM INTERACTION START ### [ 87s] [ 73.761414] reboot: Power down [ 87s] ### VM INTERACTION END ### [ 87s] [ 87s] lamb73 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:00:36 UTC 2017. [ 87s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:00:49 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:00:49 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5967d191df707_5caec8af782285283@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 98s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 98s] Makefile:671: recipe for target 'check-am' failed [ 98s] make[5]: *** [check-am] Error 2 [ 98s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 98s] Makefile:523: recipe for target 'check-recursive' failed [ 98s] make[4]: *** [check-recursive] Error 1 [ 98s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 98s] Makefile:382: recipe for target 'check-recursive' failed [ 98s] make[3]: *** [check-recursive] Error 1 [ 98s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 98s] Makefile:405: recipe for target 'check-recursive' failed [ 98s] make[2]: *** [check-recursive] Error 1 [ 98s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 98s] Makefile:696: recipe for target 'check' failed [ 98s] make[1]: *** [check] Error 2 [ 98s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 98s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 98s] debian/rules:7: recipe for target 'build' failed [ 98s] make: *** [build] Error 2 [ 98s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 99s] [ 99s] lamb19 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:00:35 UTC 2017. [ 99s] [ 99s] ### VM INTERACTION START ### [ 102s] [ 87.214944] reboot: Power down [ 102s] ### VM INTERACTION END ### [ 102s] [ 102s] lamb19 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:00:39 UTC 2017. [ 102s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:01:23 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:01:23 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5967d1ac5b3f0_5caec8af7822853ae@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 82s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 82s] Makefile:671: recipe for target 'check-am' failed [ 82s] make[5]: *** [check-am] Error 2 [ 82s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 82s] Makefile:523: recipe for target 'check-recursive' failed [ 82s] make[4]: *** [check-recursive] Error 1 [ 82s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 82s] Makefile:382: recipe for target 'check-recursive' failed [ 82s] make[3]: *** [check-recursive] Error 1 [ 82s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 82s] Makefile:405: recipe for target 'check-recursive' failed [ 82s] make[2]: *** [check-recursive] Error 1 [ 82s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 82s] Makefile:696: recipe for target 'check' failed [ 82s] make[1]: *** [check] Error 2 [ 82s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 82s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 82s] debian/rules:7: recipe for target 'build' failed [ 82s] make: *** [build] Error 2 [ 82s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 82s] [ 82s] lamb52 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:01:15 UTC 2017. [ 82s] [ 82s] ### VM INTERACTION START ### [ 85s] [ 72.279932] reboot: Power down [ 85s] ### VM INTERACTION END ### [ 85s] [ 85s] lamb52 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:01:19 UTC 2017. [ 85s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:01:40 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:01:40 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5967d1acd25a7_5caec8af7822854c7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 110s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 110s] Makefile:671: recipe for target 'check-am' failed [ 110s] make[5]: *** [check-am] Error 2 [ 110s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 110s] Makefile:523: recipe for target 'check-recursive' failed [ 110s] make[4]: *** [check-recursive] Error 1 [ 110s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 110s] Makefile:382: recipe for target 'check-recursive' failed [ 110s] make[3]: *** [check-recursive] Error 1 [ 110s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 110s] Makefile:405: recipe for target 'check-recursive' failed [ 110s] make[2]: *** [check-recursive] Error 1 [ 110s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 110s] Makefile:696: recipe for target 'check' failed [ 110s] make[1]: *** [check] Error 2 [ 110s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 110s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 110s] debian/rules:7: recipe for target 'build' failed [ 110s] make: *** [build] Error 2 [ 110s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 110s] [ 110s] cloud126 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:01:18 UTC 2017. [ 110s] [ 110s] ### VM INTERACTION START ### [ 113s] [ 91.108362] reboot: Power down [ 115s] ### VM INTERACTION END ### [ 115s] [ 115s] cloud126 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:01:23 UTC 2017. [ 115s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:01:40 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:01:40 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5967d1ad73c32_5caec8af782285578@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 105s] Makefile:660: recipe for target 'check-am' failed [ 105s] make[5]: *** [check-am] Error 2 [ 105s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 105s] Makefile:512: recipe for target 'check-recursive' failed [ 105s] make[4]: *** [check-recursive] Error 1 [ 105s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 105s] Makefile:370: recipe for target 'check-recursive' failed [ 105s] make[3]: *** [check-recursive] Error 1 [ 105s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 105s] Makefile:393: recipe for target 'check-recursive' failed [ 105s] make[2]: *** [check-recursive] Error 1 [ 105s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 105s] Makefile:684: recipe for target 'check' failed [ 105s] make[1]: *** [check] Error 2 [ 105s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 105s] dh_auto_test: make -j1 check returned exit code 2 [ 105s] debian/rules:7: recipe for target 'build' failed [ 105s] make: *** [build] Error 2 [ 105s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 105s] [ 105s] wildcard3 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:01:28 UTC 2017. [ 105s] [ 105s] ### VM INTERACTION START ### [ 106s] Powering off. [ 106s] [ 84.181990] reboot: Power down [ 108s] ### VM INTERACTION END ### [ 108s] [ 108s] wildcard3 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:01:32 UTC 2017. [ 108s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:01:57 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:01:57 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5967d1cd4792b_5caec8af782285610@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 84s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:671: recipe for target 'check-am' failed [ 84s] make[5]: *** [check-am] Error 2 [ 84s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:523: recipe for target 'check-recursive' failed [ 84s] make[4]: *** [check-recursive] Error 1 [ 84s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 84s] Makefile:382: recipe for target 'check-recursive' failed [ 84s] make[3]: *** [check-recursive] Error 1 [ 84s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 84s] Makefile:405: recipe for target 'check-recursive' failed [ 84s] make[2]: *** [check-recursive] Error 1 [ 84s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 84s] Makefile:696: recipe for target 'check' failed [ 84s] make[1]: *** [check] Error 2 [ 84s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 84s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 84s] debian/rules:7: recipe for target 'build' failed [ 84s] make: *** [build] Error 2 [ 84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 84s] [ 84s] lamb19 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:01:47 UTC 2017. [ 84s] [ 84s] ### VM INTERACTION START ### [ 87s] [ 73.845407] reboot: Power down [ 87s] ### VM INTERACTION END ### [ 87s] [ 87s] lamb19 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:01:50 UTC 2017. [ 87s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:05:22 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:05:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5967d29e9253c_5caec8af78228632d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 100s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 100s] Makefile:671: recipe for target 'check-am' failed [ 100s] make[5]: *** [check-am] Error 2 [ 100s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 100s] Makefile:523: recipe for target 'check-recursive' failed [ 100s] make[4]: *** [check-recursive] Error 1 [ 100s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 100s] Makefile:382: recipe for target 'check-recursive' failed [ 100s] make[3]: *** [check-recursive] Error 1 [ 100s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 100s] Makefile:405: recipe for target 'check-recursive' failed [ 100s] make[2]: *** [check-recursive] Error 1 [ 100s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 100s] Makefile:696: recipe for target 'check' failed [ 100s] make[1]: *** [check] Error 2 [ 100s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 100s] dh_auto_test: make -j1 check returned exit code 2 [ 100s] debian/rules:7: recipe for target 'build' failed [ 100s] make: *** [build] Error 2 [ 100s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 100s] [ 100s] lamb73 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:05:05 UTC 2017. [ 100s] [ 100s] ### VM INTERACTION START ### [ 103s] [ 91.378920] reboot: Power down [ 103s] ### VM INTERACTION END ### [ 104s] [ 104s] lamb73 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:05:09 UTC 2017. [ 104s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:06:30 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:06:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5967d2dd21d41_5caec8af7822874ab@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 107s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 107s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 107s] make[4]: Nothing to be done for 'install-exec-am'. [ 107s] make[4]: Nothing to be done for 'install-data-am'. [ 107s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 107s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 107s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 107s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 107s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 107s] make[3]: Nothing to be done for 'install-exec-am'. [ 107s] make[3]: Nothing to be done for 'install-data-am'. [ 107s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 107s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 107s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 107s] dh_install -O--fail-missing [ 107s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 107s] dh_install: missing files, aborting [ 107s] debian/rules:12: recipe for target 'binary' failed [ 107s] make: *** [binary] Error 2 [ 107s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 107s] [ 107s] lamb53 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:06:10 UTC 2017. [ 107s] [ 107s] ### VM INTERACTION START ### [ 110s] [ 97.280212] reboot: Power down [ 110s] ### VM INTERACTION END ### [ 110s] [ 110s] lamb53 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:06:14 UTC 2017. [ 110s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:06:48 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:06:48 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5967d2de4067e_5caec8af7822875a8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 94s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 94s] Makefile:671: recipe for target 'check-am' failed [ 94s] make[5]: *** [check-am] Error 2 [ 94s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 94s] Makefile:523: recipe for target 'check-recursive' failed [ 94s] make[4]: *** [check-recursive] Error 1 [ 94s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 94s] Makefile:382: recipe for target 'check-recursive' failed [ 94s] make[3]: *** [check-recursive] Error 1 [ 94s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 94s] Makefile:405: recipe for target 'check-recursive' failed [ 94s] make[2]: *** [check-recursive] Error 1 [ 94s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 94s] Makefile:696: recipe for target 'check' failed [ 94s] make[1]: *** [check] Error 2 [ 94s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 94s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 94s] debian/rules:7: recipe for target 'build' failed [ 94s] make: *** [build] Error 2 [ 94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 94s] [ 94s] lamb78 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:06:38 UTC 2017. [ 94s] [ 94s] ### VM INTERACTION START ### [ 97s] [ 83.074433] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] lamb78 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:06:42 UTC 2017. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:06:48 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:06:48 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5967d2deb8b4d_5caec8af7822876dd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 122s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 122s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 122s] make[4]: Nothing to be done for 'install-exec-am'. [ 122s] make[4]: Nothing to be done for 'install-data-am'. [ 122s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 122s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 122s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 122s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 122s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 122s] make[3]: Nothing to be done for 'install-exec-am'. [ 122s] make[3]: Nothing to be done for 'install-data-am'. [ 122s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 122s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 122s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 122s] dh_install -O--fail-missing [ 122s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 122s] dh_install: missing files, aborting [ 122s] debian/rules:12: recipe for target 'binary' failed [ 122s] make: *** [binary] Error 2 [ 122s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 122s] [ 122s] lamb23 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:06:41 UTC 2017. [ 122s] [ 122s] ### VM INTERACTION START ### [ 125s] [ 112.729545] reboot: Power down [ 125s] ### VM INTERACTION END ### [ 125s] [ 125s] lamb23 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:06:45 UTC 2017. [ 125s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:07:22 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:07:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5967d3193b6ea_5caec8af782287944@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 102s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 102s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 102s] make[4]: Nothing to be done for 'install-exec-am'. [ 102s] make[4]: Nothing to be done for 'install-data-am'. [ 102s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 102s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 102s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 102s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 102s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 102s] make[3]: Nothing to be done for 'install-exec-am'. [ 102s] make[3]: Nothing to be done for 'install-data-am'. [ 102s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 102s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 102s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 102s] dh_install -O--fail-missing [ 102s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 102s] dh_install: missing files, aborting [ 102s] debian/rules:12: recipe for target 'binary' failed [ 102s] make: *** [binary] Error 2 [ 102s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 102s] [ 102s] lamb21 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:07:02 UTC 2017. [ 102s] [ 102s] ### VM INTERACTION START ### [ 105s] [ 92.601680] reboot: Power down [ 105s] ### VM INTERACTION END ### [ 105s] [ 105s] lamb21 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:07:05 UTC 2017. [ 105s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:07:22 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:07:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5967d319bbee7_5caec8af7822880d3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 108s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 108s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 108s] make[4]: Nothing to be done for 'install-exec-am'. [ 108s] make[4]: Nothing to be done for 'install-data-am'. [ 108s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 108s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 108s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 108s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 108s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 108s] make[3]: Nothing to be done for 'install-exec-am'. [ 108s] make[3]: Nothing to be done for 'install-data-am'. [ 108s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 108s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 108s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 108s] dh_install -O--fail-missing [ 108s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 108s] dh_install: missing files, aborting [ 108s] debian/rules:12: recipe for target 'binary' failed [ 108s] make: *** [binary] Error 2 [ 108s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 108s] [ 108s] lamb61 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:07:06 UTC 2017. [ 108s] [ 108s] ### VM INTERACTION START ### [ 111s] [ 98.055473] reboot: Power down [ 111s] ### VM INTERACTION END ### [ 111s] [ 111s] lamb61 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:07:10 UTC 2017. [ 111s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:07:56 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:07:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5967d3377265d_5caec8af782288915@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 120s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 120s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 120s] make[4]: Nothing to be done for 'install-exec-am'. [ 120s] make[4]: Nothing to be done for 'install-data-am'. [ 120s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 120s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 120s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 120s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 120s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 120s] make[3]: Nothing to be done for 'install-exec-am'. [ 120s] make[3]: Nothing to be done for 'install-data-am'. [ 120s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 120s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 120s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 120s] dh_install -O--fail-missing [ 120s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 120s] dh_install: missing files, aborting [ 120s] debian/rules:12: recipe for target 'binary' failed [ 120s] make: *** [binary] Error 2 [ 120s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 120s] [ 120s] lamb16 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:07:51 UTC 2017. [ 120s] [ 120s] ### VM INTERACTION START ### [ 123s] [ 108.307620] reboot: Power down [ 123s] ### VM INTERACTION END ### [ 123s] [ 123s] lamb16 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:07:54 UTC 2017. [ 123s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:08:13 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:08:13 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5967d33bd31ef_5caec8af7822900fc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 112s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 112s] make[4]: Nothing to be done for 'install-exec-am'. [ 112s] make[4]: Nothing to be done for 'install-data-am'. [ 112s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 112s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 112s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 112s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 112s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 112s] make[3]: Nothing to be done for 'install-exec-am'. [ 112s] make[3]: Nothing to be done for 'install-data-am'. [ 112s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 112s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 112s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 112s] dh_install -O--fail-missing [ 112s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 112s] dh_install: missing files, aborting [ 112s] debian/rules:12: recipe for target 'binary' failed [ 112s] make: *** [binary] Error 2 [ 112s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 112s] [ 112s] lamb71 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:07:57 UTC 2017. [ 112s] [ 112s] ### VM INTERACTION START ### [ 113s] Powering off. [ 113s] [ 99.932974] reboot: Power down [ 113s] ### VM INTERACTION END ### [ 113s] [ 113s] lamb71 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:07:59 UTC 2017. [ 113s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:08:13 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:08:13 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5967d33c5585a_5caec8af7822901a0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 135s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 135s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 135s] make[4]: Nothing to be done for 'install-exec-am'. [ 135s] make[4]: Nothing to be done for 'install-data-am'. [ 135s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 135s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 135s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 135s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 135s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 135s] make[3]: Nothing to be done for 'install-exec-am'. [ 135s] make[3]: Nothing to be done for 'install-data-am'. [ 135s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 135s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 135s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 135s] dh_install -O--fail-missing [ 135s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 135s] dh_install: missing files, aborting [ 135s] debian/rules:12: recipe for target 'binary' failed [ 135s] make: *** [binary] Error 2 [ 135s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 135s] [ 135s] cloud101 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:07:57 UTC 2017. [ 135s] [ 135s] ### VM INTERACTION START ### [ 138s] [ 115.551200] reboot: Power down [ 140s] ### VM INTERACTION END ### [ 140s] [ 140s] cloud101 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:08:02 UTC 2017. [ 140s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jul 13 20:08:13 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:08:13 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5967d33d36c66_5caec8af7822903a4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 96s] Makefile:660: recipe for target 'check-am' failed [ 96s] make[5]: *** [check-am] Error 2 [ 96s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 96s] Makefile:512: recipe for target 'check-recursive' failed [ 96s] make[4]: *** [check-recursive] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 96s] Makefile:370: recipe for target 'check-recursive' failed [ 96s] make[3]: *** [check-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 96s] Makefile:393: recipe for target 'check-recursive' failed [ 96s] make[2]: *** [check-recursive] Error 1 [ 96s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 96s] Makefile:684: recipe for target 'check' failed [ 96s] make[1]: *** [check] Error 2 [ 96s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 96s] dh_auto_test: make -j1 check returned exit code 2 [ 96s] debian/rules:7: recipe for target 'build' failed [ 96s] make: *** [build] Error 2 [ 96s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 96s] [ 96s] lamb62 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:08:08 UTC 2017. [ 96s] [ 96s] ### VM INTERACTION START ### [ 97s] Powering off. [ 97s] [ 83.525011] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] lamb62 failed "build osmo-hlr_0.0.1.20170713.dsc" at Thu Jul 13 20:08:09 UTC 2017. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:08:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 20:08:29 +0000 Subject: osmo-msc[master]: Add libvlr implementation In-Reply-To: References: Message-ID: Patch Set 4: (3 comments) https://gerrit.osmocom.org/#/c/3194/4/src/libvlr/vlr_access_req_fsm.c File src/libvlr/vlr_access_req_fsm.c: Line 416: if (res) { > we have an OSMO_ASSERT(res) above, and then a runtime if (res) here. Eithe agreed https://gerrit.osmocom.org/#/c/3194/4/src/libvlr/vlr_auth_fsm.c File src/libvlr/vlr_auth_fsm.c: Line 552: .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTH_FAILED), > What I dislike about OSMO_STRINGIFY is that the log output gets unneccessar My reason to use it is that when I find a "made up" name like 'AUTH_FAILED' in a log, it is cumbersome to find the related FSM code. I really want to have the full state / event name in the log, so that I can directly search for it using ctags and grepping the files. It is often hard enough figure out how an FSM works, i.e. to sort out the relation of involved events and states. The combination of two things often made it impossibly hard for me to correlate the log output with what the code does: (1) having to keep in mind the mapping from "made up" names to event/state constants adds one step of indirection to each FSM detail, and (2) if two completely unrelated FSMs have similar or identical "made up" names, it is very easy to end up in the completely wrong area of code, often in the middle of almost figuring things out. I lost my train of thought a lot because of these issues when first reading the VLR code, hence my urgent desire for exact 1:1 names. I understand that from a perspective of administering a system, the shorter name may be easier to parse, but from a perspective of working with the code, the constants' complete names in the log make reading the situation infinitely easier. We could go for a dual approach, adding human readable names *as well as* the exact constants' names, and switch on and off printing the full constants depending on some debug flag? The LOGPFSM like macros could check for the log subsystem's logging level and include the full constant's name if it is below DEBUG -- but actually hard to do for separate logging targets with distinct logging levels. I guess it would rather be a compile time decision. Another idea would be to make the names of the constants more human readable where needed, so that we can keep the 1:1 relation. Would also be nice to pick up the constants' names without having to OSMO_STRINGIFY() them explicitly, but I guess that would take quite some macro magic. https://gerrit.osmocom.org/#/c/3194/4/src/libvlr/vlr_lu_fsm.c File src/libvlr/vlr_lu_fsm.c: Line 984: if (1) { // FIXME > a more verbose description of the FIXME would make sense. I don't really k Neither do I (IIRC it is code I took over from your initial patch). At first glance it seems that _start_lu_main() is sufficient, because as seen in the msc_vlr tests the VLR does send an IMEI id request when net->vlr->cfg.check_imei_rqd == true. However, no code path sends an IMEISV request. It seems this wants to make sure we always have an IMEISV, not only an IMEI. Also, I believe we want to set net->vlr->cfg.check_imei_rqd to true by default, not the case currently. ... possibly, make check_imei an enum to reflect {don't ask, ask for IMEI, ask for IMEISV}? ..... Ok, the investigation has now made me write the basis for a more concise FIXME text here, I suppose. -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From admin at opensuse.org Thu Jul 13 20:13:56 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 13 Jul 2017 20:13:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5967d49c68b04_5caec8af7822932d5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 76s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 76s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 76s] make[4]: Nothing to be done for 'install-exec-am'. [ 76s] make[4]: Nothing to be done for 'install-data-am'. [ 76s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 76s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 76s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 76s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 76s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 76s] make[3]: Nothing to be done for 'install-exec-am'. [ 76s] make[3]: Nothing to be done for 'install-data-am'. [ 76s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 76s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 76s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 76s] dh_install -O--fail-missing [ 76s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 76s] dh_install: missing files, aborting [ 76s] debian/rules:12: recipe for target 'binary' failed [ 76s] make: *** [binary] Error 2 [ 76s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 76s] [ 76s] build78 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:13:41 UTC 2017. [ 76s] [ 76s] ### VM INTERACTION START ### [ 79s] [ 70.150756] reboot: Power down [ 79s] ### VM INTERACTION END ### [ 79s] [ 79s] build78 failed "build osmo-bts_0.5.0.20170713.dsc" at Thu Jul 13 20:13:45 UTC 2017. [ 79s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:23:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 13 Jul 2017 20:23:15 +0000 Subject: osmo-msc[master]: join openbsc/.gitignore with .gitignore In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3189/3/.gitignore File .gitignore: Line 64: tests/bsc-nat/bsc_nat_test > most of these can be replaced with tests/*/*_test true. I have added a commit to collapse them, to be submitted later. -- To view, visit https://gerrit.osmocom.org/3189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib2120592749e85a4d13f6668e198857e3bddcf1e Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:26:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 13 Jul 2017 20:26:38 +0000 Subject: [PATCH] libosmo-abis[master]: configure.ac: Fix RTP_SIGNAL_PTR_CAST config in FreeBSD build Message-ID: Review at https://gerrit.osmocom.org/3250 configure.ac: Fix RTP_SIGNAL_PTR_CAST config in FreeBSD build Move function definition to the first argument of AC_LANG_PROGRAM (prologue) instead of the second (body). Content of the body is writen into the main() function of the file being compiled, while prologue is writen before it. Compiler from FreeBSD build host doesn't like definitions inside the main function, it fails with the following error: conftest.c:28:73: error: function definition is not allowed here As the compilation test fails, unsigned int is used instead of void*, which doesn't match the current headers in the current build, and then a warning (or error with -Werror) is printed. Change-Id: I83fc3997e5067b499bf43cea4ff953604d6cbeae --- M configure.ac 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/50/3250/1 diff --git a/configure.ac b/configure.ac index 9b62f3e..0686f64 100644 --- a/configure.ac +++ b/configure.ac @@ -79,8 +79,9 @@ CFLAGS="$CFLAGS $ORTP_CFLAGS" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[#include ]], - [[void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; } rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]] + [[#include + void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; }]], + [[rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]] )], [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(void*)(arg)], [rtp_session_signal_connect requires pointer parameter])], -- To view, visit https://gerrit.osmocom.org/3250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83fc3997e5067b499bf43cea4ff953604d6cbeae Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:55:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:55:15 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-PHY: Use IPv4 multicast groups for private / local scope In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Use IPv4 multicast groups for private / local scope ...................................................................... VIRT-PHY: Use IPv4 multicast groups for private / local scope The addresses in the original code make little sense: * 224.0.0.1 is "All systems on this subnet" and not routed outside the local ethernet segment * 225.0.0.1 is in a RESERVED range that shouldn't be used Change-Id: Iba1ae69f3f193a33f1da343c6562f67bd8d3557f --- M src/osmo-bts-virtual/virtual_um.h 1 file changed, 7 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-virtual/virtual_um.h b/src/osmo-bts-virtual/virtual_um.h index 6e7c384..ac098dd 100644 --- a/src/osmo-bts-virtual/virtual_um.h +++ b/src/osmo-bts-virtual/virtual_um.h @@ -4,10 +4,15 @@ #include #include "osmo_mcast_sock.h" +/* We use multicast group addresses from the 239.192.0.0/14 rage, as + * those are designated by RFC2365 as "IPv4 Organization Local Scope, + * "... the space from which an organization should allocate sub- + * ranges when defining scopes for private use." */ + #define VIRT_UM_MSGB_SIZE 256 -#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_GROUP "239.193.23.1" #define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ -#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_GROUP "239.193.23.2" #define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ struct virt_um_inst { -- To view, visit https://gerrit.osmocom.org/3247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba1ae69f3f193a33f1da343c6562f67bd8d3557f Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:55:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:55:16 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-PHY: Fix handling of default values for vty configuration In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Fix handling of default values for vty configuration ...................................................................... VIRT-PHY: Fix handling of default values for vty configuration The defaults must be set during bts_model_phy_link_set_defaults() and can then later be overridden by the vty (from the config file). They should only be written back to the file if they differ from the default settings. Change-Id: I5d7f2c1dc8bc3d11db5c607b664730e4dcd58c96 --- M src/osmo-bts-virtual/l1_if.c M src/osmo-bts-virtual/main.c M src/osmo-bts-virtual/virtualbts_vty.c 3 files changed, 6 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index a931916..36b2748 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -186,18 +186,6 @@ phy_link_state_set(plink, PHY_LINK_CONNECTING); - if (!plink->u.virt.bts_mcast_group) - plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; - - if (!plink->u.virt.bts_mcast_port) - plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; - - if (!plink->u.virt.ms_mcast_group) - plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; - - if (!plink->u.virt.ms_mcast_port) - plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; - plink->u.virt.virt_um = virt_um_init(plink, plink->u.virt.ms_mcast_group, plink->u.virt.ms_mcast_port, plink->u.virt.bts_mcast_group, plink->u.virt.bts_mcast_port, virt_um_rcv_cb); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index 6ceeaec..f1dc293 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -104,6 +104,10 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink) { + plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; + plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; + plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; + plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; } void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) diff --git a/src/osmo-bts-virtual/virtualbts_vty.c b/src/osmo-bts-virtual/virtualbts_vty.c index 45c1086..323222b 100644 --- a/src/osmo-bts-virtual/virtualbts_vty.c +++ b/src/osmo-bts-virtual/virtualbts_vty.c @@ -72,13 +72,13 @@ if (strcmp(plink->u.virt.ms_mcast_group, DEFAULT_BTS_MCAST_GROUP)) vty_out(vty, " virtual-um ms-multicast-group %s%s", plink->u.virt.ms_mcast_group, VTY_NEWLINE); - if (plink->u.virt.ms_mcast_port) + if (plink->u.virt.ms_mcast_port != DEFAULT_BTS_MCAST_PORT) vty_out(vty, " virtual-um ms-udp-port %u%s", plink->u.virt.ms_mcast_port, VTY_NEWLINE); if (strcmp(plink->u.virt.bts_mcast_group, DEFAULT_MS_MCAST_GROUP)) vty_out(vty, " virtual-um bts-multicast-group %s%s", plink->u.virt.bts_mcast_group, VTY_NEWLINE); - if (plink->u.virt.bts_mcast_port) + if (plink->u.virt.bts_mcast_port != DEFAULT_MS_MCAST_PORT) vty_out(vty, " virtual-um bts-udp-port %u%s", plink->u.virt.bts_mcast_port, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/3245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5d7f2c1dc8bc3d11db5c607b664730e4dcd58c96 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:55:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:55:16 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was always 0. ...................................................................... VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was always 0. Timeslot is not encoded in the chan_nr accessible in the channel description but was taken from there and so it was always 0. Change-Id: I881a1c61ea47399c9b1385fb220cd587e3593e82 --- M src/osmo-bts-virtual/scheduler_virtbts.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index 4b4def7..df6fbeb 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -72,6 +72,8 @@ uint8_t gsmtap_chantype; /* the GSMTAP channel */ rsl_dec_chan_nr(chdesc->chan_nr, &rsl_chantype, &subslot, ×lot); + /* the timeslot is not encoded in the chan_nr of the chdesc, and so has to be overwritten */ + timeslot = tn; /* in Osmocom, AGCH is only sent on ccch block 0. no idea why. this seems to cause false GSMTAP channel * types for agch and pch. */ if (rsl_chantype == RSL_CHAN_PCH_AGCH && L1SAP_FN2CCCHBLOCK(fn) == 0) -- To view, visit https://gerrit.osmocom.org/3244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I881a1c61ea47399c9b1385fb220cd587e3593e82 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:55:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:55:17 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-PHY: Added test option for fast hyperframe repeat. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Added test option for fast hyperframe repeat. ...................................................................... VIRT-PHY: Added test option for fast hyperframe repeat. Frame number will restart at 0 after each superframe (approx. 6.1 sec) if enabled. Can be enabled by preprocessor define. Change-Id: If3adf14df5fcd8daf53363c27b3772c42d7122e9 --- M src/osmo-bts-virtual/scheduler_virtbts.c 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index df6fbeb..9b52864 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -43,6 +43,8 @@ #include "virtual_um.h" #include "l1_if.h" +#define MODULO_HYPERFRAME 0 + static const char *gsmtap_hdr_stringify(const struct gsmtap_hdr *gh) { static char buf[256]; @@ -81,7 +83,13 @@ else gsmtap_chantype = chantype_rsl2gsmtap(rsl_chantype, chdesc->link_id); /* the logical channel type */ +#if MODULO_HYPERFRAME + /* Restart fn after every superframe (26 * 51 frames) to simulate hyperframe overflow each 6 seconds. */ + fn %= 26 * 51; +#endif + outmsg = gsmtap_makemsg(arfcn, timeslot, gsmtap_chantype, subslot, fn, signal_dbm, snr, data, data_len); + if (outmsg) { struct phy_instance *pinst = trx_phy_instance(l1t->trx); struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); -- To view, visit https://gerrit.osmocom.org/3246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3adf14df5fcd8daf53363c27b3772c42d7122e9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:55:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:55:17 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-PHY: Added example configurations for openbsc and osmobts. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Added example configurations for openbsc and osmobts. ...................................................................... VIRT-PHY: Added example configurations for openbsc and osmobts. Change-Id: I368d4a378e20028603b09825eee766abb9195774 --- M Makefile.am A doc/examples/virtual/openbsc-virtual.cfg A doc/examples/virtual/osmobts-virtual.cfg 3 files changed, 215 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 0f85151..69d0b93 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,8 @@ contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmobts-mgr.cfg \ + doc/examples/virtual/openbsc-virtual.cfg \ + doc/examples/virtual/osmobts-virtual.cfg \ README.md @RELMAKE@ diff --git a/doc/examples/virtual/openbsc-virtual.cfg b/doc/examples/virtual/openbsc-virtual.cfg new file mode 100644 index 0000000..8044fa8 --- /dev/null +++ b/doc/examples/virtual/openbsc-virtual.cfg @@ -0,0 +1,151 @@ +! +! OpenBSC (0.15.0.629-34f0-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 0 + logging print category 1 + logging timestamp 1 + logging level all info + logging level rll notice + logging level cc notice + logging level mm debug + logging level rr notice + logging level rsl notice + logging level nm info + logging level mncc notice + logging level pag notice + logging level meas notice + logging level sccp notice + logging level msc notice + logging level mgcp notice + logging level ho notice + logging level db notice + logging level ref notice + logging level gprs debug + logging level ns info + logging level bssgp debug + logging level llc debug + logging level sndcp debug + logging level nat notice + logging level ctrl notice + logging level smpp debug + logging level filter debug + logging level ranap debug + logging level sua debug + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats notice + logging level lgsup notice + logging level loap notice +! +stats interval 5 +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +network + network country code 262 + mobile network code 42 + short name OpenBSC + long name OpenBSC + auth policy accept-all + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + neci 1 + paging any use tch 0 + rrlp mode ms-based + mm info 1 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + timer t3101 10 + timer t3103 0 + timer t3105 0 + timer t3107 0 + timer t3109 4 + timer t3111 0 + timer t3113 60 + timer t3115 0 + timer t3117 0 + timer t3119 0 + timer t3122 10 + timer t3141 0 + subscriber-keep-in-ram 0 + bts 0 + type sysmobts + band DCS1800 + cell_identity 6969 + location_area_code 1 + base_station_id_code 63 + ms max power 0 + cell reselection hysteresis 4 + rxlev access min 0 + periodic location update 30 + radio-link-timeout 32 + channel allocator descending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + ip.access unit_id 6969 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode automatic + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 666 + nominal power 0 + max_power_red 0 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config SDCCH8 + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +mncc-int + default-codec tch-f fr + default-codec tch-h hr +nitb + subscriber-create-on-demand + subscriber-create-on-demand random 1 24 + assign-tmsi diff --git a/doc/examples/virtual/osmobts-virtual.cfg b/doc/examples/virtual/osmobts-virtual.cfg new file mode 100644 index 0000000..5526e08 --- /dev/null +++ b/doc/examples/virtual/osmobts-virtual.cfg @@ -0,0 +1,62 @@ +! +! OsmoBTS (0.4.0.216-bc49-dirty) configuration saved from vty +!! +! +log stderr + logging filter all 0 + logging color 0 + logging print category 1 + logging timestamp 0 + logging level all everything + logging level rsl info + logging level oml info + logging level rll notice + logging level rr notice + logging level meas notice + logging level pag info + logging level l1c info + logging level l1p info + logging level dsp error + logging level pcu notice + logging level ho debug + logging level trx notice + logging level loop notice + logging level abis debug + logging level rtp notice + logging level sum error + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp notice + logging level lstats error +! +line vty + no login +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +phy 0 + instance 0 +bts 0 + band DCS1800 + ipa unit-id 6969 0 + oml remote-ip 127.0.0.1 + rtp jitter-buffer 100 + paging queue-size 200 + paging lifetime 0 + uplink-power-target -75 + min-qual-rach 50 + min-qual-norm -5 + trx 0 + power-ramp max-initial 23000 mdBm + power-ramp step-size 2000 mdB + power-ramp step-interval 1 + ms-power-control dsp + phy 0 instance 0 -- To view, visit https://gerrit.osmocom.org/3243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I368d4a378e20028603b09825eee766abb9195774 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: BastusIII Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:55:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:55:17 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-PHY: cause BTS to terminate in case of recv()/send() on... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: cause BTS to terminate in case of recv()/send() on udp socket returns 0 ...................................................................... VIRT-PHY: cause BTS to terminate in case of recv()/send() on udp socket returns 0 It is important that we reliably terminate the BTS in case any of the VirtPHY multicast sockets dies for whatever reason. Change-Id: I5ae3fdd7cc35fdf235550a3b8362020fdd287c13 --- M src/osmo-bts-virtual/l1_if.c M src/osmo-bts-virtual/scheduler_virtbts.c M src/osmo-bts-virtual/virtual_um.c 3 files changed, 19 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 36b2748..9212121 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -66,6 +66,13 @@ static void virt_um_rcv_cb(struct virt_um_inst *vui, struct msgb *msg) { struct phy_link *plink = (struct phy_link *)vui->priv; + struct phy_instance *pinst; + if (!msg) { + pinst = phy_instance_by_num(plink, 0); + bts_shutdown(pinst->trx->bts, "VirtPHY read socket died\n"); + return; + } + struct gsmtap_hdr *gh = msgb_l1(msg); uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the cell we currently camp on */ @@ -77,7 +84,6 @@ uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ - struct phy_instance *pinst; struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index 9b52864..1338ce5 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -93,9 +94,13 @@ if (outmsg) { struct phy_instance *pinst = trx_phy_instance(l1t->trx); struct gsmtap_hdr *gh = (struct gsmtap_hdr *)msgb_data(outmsg); + int rc; - if (virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg) == -1) + rc = virt_um_write_msg(pinst->phy_link->u.virt.virt_um, outmsg); + if (rc < 0) LOGP(DL1P, LOGL_ERROR, "%s GSMTAP msg could not send to virtual Um\n", gsmtap_hdr_stringify(gh)); + else if (rc == 0) + bts_shutdown(l1t->trx->bts, "VirtPHY write socket died\n"); else DEBUGP(DL1C, "%s Sending GSMTAP message to virtual Um\n", gsmtap_hdr_stringify(gh)); } else diff --git a/src/osmo-bts-virtual/virtual_um.c b/src/osmo-bts-virtual/virtual_um.c index e6b9615..e8d4252 100644 --- a/src/osmo-bts-virtual/virtual_um.c +++ b/src/osmo-bts-virtual/virtual_um.c @@ -48,11 +48,12 @@ msg->l1h = msgb_data(msg); /* call the l1 callback function for a received msg */ vui->recv_cb(vui, msg); - } else { - /* FIXME: this kind of error handling might be a bit harsh */ + } else if (rc == 0) { vui->recv_cb(vui, NULL); osmo_fd_close(ofd); - } + } else + perror("Read from multicast socket"); + } return 0; @@ -86,6 +87,8 @@ rc = mcast_bidir_sock_tx(vui->mcast_sock, msgb_data(msg), msgb_length(msg)); + if (rc < 0) + perror("Writing to multicast socket"); msgb_free(msg); return rc; -- To view, visit https://gerrit.osmocom.org/3248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ae3fdd7cc35fdf235550a3b8362020fdd287c13 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:56:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:56:07 +0000 Subject: libosmo-abis[master]: configure.ac: Fix RTP_SIGNAL_PTR_CAST config in FreeBSD build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83fc3997e5067b499bf43cea4ff953604d6cbeae Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:56:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:56:10 +0000 Subject: [MERGED] libosmo-abis[master]: configure.ac: Fix RTP_SIGNAL_PTR_CAST config in FreeBSD build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Fix RTP_SIGNAL_PTR_CAST config in FreeBSD build ...................................................................... configure.ac: Fix RTP_SIGNAL_PTR_CAST config in FreeBSD build Move function definition to the first argument of AC_LANG_PROGRAM (prologue) instead of the second (body). Content of the body is writen into the main() function of the file being compiled, while prologue is writen before it. Compiler from FreeBSD build host doesn't like definitions inside the main function, it fails with the following error: conftest.c:28:73: error: function definition is not allowed here As the compilation test fails, unsigned int is used instead of void*, which doesn't match the current headers in the current build, and then a warning (or error with -Werror) is printed. Change-Id: I83fc3997e5067b499bf43cea4ff953604d6cbeae --- M configure.ac 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 9b62f3e..0686f64 100644 --- a/configure.ac +++ b/configure.ac @@ -79,8 +79,9 @@ CFLAGS="$CFLAGS $ORTP_CFLAGS" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[#include ]], - [[void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; } rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]] + [[#include + void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; }]], + [[rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]] )], [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(void*)(arg)], [rtp_session_signal_connect requires pointer parameter])], -- To view, visit https://gerrit.osmocom.org/3250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83fc3997e5067b499bf43cea4ff953604d6cbeae Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:56:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:56:10 +0000 Subject: [MERGED] libosmo-abis[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: contrib: Enable -Werror by default ...................................................................... contrib: Enable -Werror by default Change-Id: I065b18dd6c4f7616f981aa4273e68e23825a7294 --- 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 88eda80..769d5a7 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -32,7 +32,7 @@ set -x autoreconf --install --force -./configure --enable-sanitize +./configure --enable-sanitize CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I065b18dd6c4f7616f981aa4273e68e23825a7294 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:56:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:56:34 +0000 Subject: libosmo-netif[master]: rtp.c: Fix print format In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0146a19bf852c9e27d265a098dc9d7a337424e10 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:56:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:56:38 +0000 Subject: [MERGED] libosmo-netif[master]: rtp.c: Fix print format In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rtp.c: Fix print format ...................................................................... rtp.c: Fix print format Fixes compilation warning Change-Id: I0146a19bf852c9e27d265a098dc9d7a337424e10 --- M src/rtp.c 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/rtp.c b/src/rtp.c index e965d85..7ac5862 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -3,6 +3,7 @@ #include #include /* for memcpy. */ #include /* for ntohs. */ +#include #include #include @@ -44,7 +45,7 @@ int osmo_rtp_handle_tx_set_sequence(struct osmo_rtp_handle *h, uint16_t seq) { - DEBUGP(DLMUX, "%s (handle=%p, seq=%hu)\n", __FUNCTION__, h, seq); + DEBUGP(DLMUX, "%s (handle=%p, seq=%"PRIu16")\n", __FUNCTION__, h, seq); h->tx.sequence = seq; @@ -53,7 +54,7 @@ int osmo_rtp_handle_tx_set_ssrc(struct osmo_rtp_handle *h, uint32_t ssrc) { - DEBUGP(DLMUX, "%s (handle=%p, seq=%hu)\n", __FUNCTION__, h, ssrc); + DEBUGP(DLMUX, "%s (handle=%p, seq=%"PRIu32")\n", __FUNCTION__, h, ssrc); h->tx.ssrc = ssrc; return 0; @@ -61,7 +62,7 @@ int osmo_rtp_handle_tx_set_timestamp(struct osmo_rtp_handle *h, uint32_t timestamp) { - DEBUGP(DLMUX, "%s (handle=%p, ts=%hu)\n", __FUNCTION__, h, timestamp); + DEBUGP(DLMUX, "%s (handle=%p, ts=%"PRIu32")\n", __FUNCTION__, h, timestamp); h->tx.timestamp = timestamp; return 0; -- To view, visit https://gerrit.osmocom.org/3249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0146a19bf852c9e27d265a098dc9d7a337424e10 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 13 20:56:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 20:56:39 +0000 Subject: [MERGED] libosmo-netif[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: contrib: Enable -Werror by default ...................................................................... contrib: Enable -Werror by default Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified Holger Freyther: Looks good to me, but someone else must approve diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 5bb1020..2231efc 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -35,7 +35,7 @@ set -x autoreconf --install --force -./configure +./configure CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 13 21:53:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 13 Jul 2017 21:53:23 +0000 Subject: openbsc[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 14 07:55:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 07:55:19 +0000 Subject: [MERGED] openbsc[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: check for missing result of rate_ctr_group_alloc() ...................................................................... check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. RelateD: OS#2361 Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 --- M openbsc/src/gprs/gb_proxy.c M openbsc/src/gprs/gb_proxy_peer.c M openbsc/src/gprs/gprs_sgsn.c M openbsc/src/libbsc/net_init.c M openbsc/src/libcommon-cs/common_cs.c 5 files changed, 32 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/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index d95139f..3603e14 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -1431,6 +1431,10 @@ INIT_LLIST_HEAD(&cfg->bts_peers); cfg->ctrg = rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0); + if (!cfg->ctrg) { + LOGP(DGPRS, LOGL_ERROR, "Cannot allocate global counter group!\n"); + return -1; + } clock_gettime(CLOCK_REALTIME, &tp); return 0; diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/openbsc/src/gprs/gb_proxy_peer.c index 5365ff0..8909687 100644 --- a/openbsc/src/gprs/gb_proxy_peer.c +++ b/openbsc/src/gprs/gb_proxy_peer.c @@ -177,6 +177,10 @@ peer->bvci = bvci; peer->ctrg = rate_ctr_group_alloc(peer, &peer_ctrg_desc, bvci); + if (!peer->ctrg) { + talloc_free(peer); + return NULL; + } peer->cfg = cfg; llist_add(&peer->list, &cfg->bts_peers); diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index fbea5b9..3c363bc 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -129,6 +129,7 @@ void sgsn_rate_ctr_init() { sgsn->rate_ctrs = rate_ctr_group_alloc(tall_bsc_ctx, &sgsn_ctrg_desc, 0); + OSMO_ASSERT(sgsn->rate_ctrs); } /* look-up an SGSN MM context based on Iu UE context (struct ue_conn_ctx)*/ @@ -229,6 +230,11 @@ LOGMMCTXP(LOGL_DEBUG, ctx, "Allocated with %s cipher.\n", get_value_string(gprs_cipher_names, ctx->ciph_algo)); ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, tlli); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } INIT_LLIST_HEAD(&ctx->pdp_list); llist_add(&ctx->list, &sgsn_mm_ctxts); @@ -252,6 +258,11 @@ ctx->pmm_state = PMM_DETACHED; ctx->auth_triplet.key_seq = GSM_KEY_SEQ_INVAL; ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, 0); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } /* Need to get RAID from IU conn */ ctx->ra = ctx->iu.ue_ctx->ra_id; @@ -379,6 +390,11 @@ pdp->mm = mm; pdp->nsapi = nsapi; pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi); + if (!pdp->ctrg) { + LOGPDPCTXP(LOGL_ERROR, pdp, "Error allocation counter group\n"); + talloc_free(pdp); + return NULL; + } llist_add(&pdp->list, &mm->pdp_list); llist_add(&pdp->g_list, &sgsn_pdp_ctxts); diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index bc5ed35..4dfc258 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -61,6 +61,10 @@ /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); + if (!net->bsc_ctrs) { + talloc_free(net); + return NULL; + } gsm_net_update_ctype(net); diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 7905802..d299427 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -75,6 +75,10 @@ /* init statistics */ net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); + if (!net->msc_ctrs) { + talloc_free(net); + return NULL; + } net->active_calls = osmo_counter_alloc("msc.active_calls"); net->mncc_recv = mncc_recv; -- To view, visit https://gerrit.osmocom.org/3184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jul 14 09:14:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 14 Jul 2017 09:14:38 +0000 Subject: osmo-hlr[master]: Another attempt at fixing .deb In-Reply-To: References: Message-ID: Patch Set 1: I can't reproduce it on my machine directly. I can reproduce it using "osc build" but to test the fix I've got to substitute .dsc and .tar.gz used by osc. I don't know yet how to do it - will have to digg through documentation later on. If someone is willing to help with this - would be great. -- To view, visit https://gerrit.osmocom.org/3225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9e3f31622efae132b25683c54ce09c83ce43415 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr 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 Jul 14 10:29:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 14 Jul 2017 10:29:34 +0000 Subject: [PATCH] osmo-bts[master]: Fix .deb build Message-ID: Review at https://gerrit.osmocom.org/3251 Fix .deb build Recent introduction of VIRT-PHY broke .deb build. Fix it by installing osmo-bts-virtual as part of Debian package. Change-Id: I1ca7eb51019247eb95c6bac752d6e2c4406ce5a2 --- M debian/osmo-bts-trx.install 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/51/3251/1 diff --git a/debian/osmo-bts-trx.install b/debian/osmo-bts-trx.install index 92d524c..5c34bef 100644 --- a/debian/osmo-bts-trx.install +++ b/debian/osmo-bts-trx.install @@ -1 +1,2 @@ usr/bin/osmo-bts-trx +usr/bin/osmo-bts-virtual -- To view, visit https://gerrit.osmocom.org/3251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1ca7eb51019247eb95c6bac752d6e2c4406ce5a2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jul 14 12:12:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 14 Jul 2017 12:12:31 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add trx-calibration to example config Message-ID: Review at https://gerrit.osmocom.org/3252 lc15: add trx-calibration to example config Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b Related: SYS#3722 --- M doc/examples/litecell15/osmo-bts.cfg 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/3252/1 diff --git a/doc/examples/litecell15/osmo-bts.cfg b/doc/examples/litecell15/osmo-bts.cfg index 4eb9f29..485075a 100644 --- a/doc/examples/litecell15/osmo-bts.cfg +++ b/doc/examples/litecell15/osmo-bts.cfg @@ -30,8 +30,10 @@ ! phy 0 instance 0 + trx-calibration-path /mnt/rom/factory/calib phy 1 instance 0 + trx-calibration-path /mnt/rom/factory/calib bts 0 band 1800 ipa unit-id 1500 0 -- To view, visit https://gerrit.osmocom.org/3252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jul 14 12:22:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 14 Jul 2017 12:22:11 +0000 Subject: [PATCH] osmo-bts[master]: Cleanup example config files Message-ID: Review at https://gerrit.osmocom.org/3253 Cleanup example config files * remove deprecated everything log level * remove copy-pasted sysmobts-mgr.cfg from root directory Change-Id: I8f392991097267665e9094189d24e7cf94a5d5d2 Related: OS#71 --- M doc/examples/litecell15/lc15bts-mgr.cfg M doc/examples/litecell15/osmo-bts.cfg M doc/examples/octphy/osmo-bts-trx2dsp1.cfg M doc/examples/octphy/osmo-bts.cfg M doc/examples/sysmo/osmo-bts.cfg M doc/examples/sysmo/sysmobts-mgr.cfg D doc/examples/sysmobts-mgr.cfg M doc/examples/trx/osmo-bts.cfg M doc/examples/virtual/osmobts-virtual.cfg 9 files changed, 0 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/3253/1 diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index e7c9926..750dc36 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -7,7 +7,6 @@ logging color 1 logging print category 0 logging timestamp 0 - logging level all everything logging level temp info logging level fw info logging level find info diff --git a/doc/examples/litecell15/osmo-bts.cfg b/doc/examples/litecell15/osmo-bts.cfg index 4eb9f29..e38428a 100644 --- a/doc/examples/litecell15/osmo-bts.cfg +++ b/doc/examples/litecell15/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/octphy/osmo-bts-trx2dsp1.cfg b/doc/examples/octphy/osmo-bts-trx2dsp1.cfg index 48db79d..3406e07 100644 --- a/doc/examples/octphy/osmo-bts-trx2dsp1.cfg +++ b/doc/examples/octphy/osmo-bts-trx2dsp1.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/octphy/osmo-bts.cfg b/doc/examples/octphy/osmo-bts.cfg index 4f27c8d..c729d1a 100644 --- a/doc/examples/octphy/osmo-bts.cfg +++ b/doc/examples/octphy/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/sysmo/osmo-bts.cfg b/doc/examples/sysmo/osmo-bts.cfg index 35142f7..87dfae0 100644 --- a/doc/examples/sysmo/osmo-bts.cfg +++ b/doc/examples/sysmo/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/sysmo/sysmobts-mgr.cfg b/doc/examples/sysmo/sysmobts-mgr.cfg index 3b28d78..0cb1d8c 100644 --- a/doc/examples/sysmo/sysmobts-mgr.cfg +++ b/doc/examples/sysmo/sysmobts-mgr.cfg @@ -6,7 +6,6 @@ logging filter all 1 logging color 1 logging timestamp 0 - logging level all everything logging level temp info logging level fw info logging level find info diff --git a/doc/examples/sysmobts-mgr.cfg b/doc/examples/sysmobts-mgr.cfg deleted file mode 100644 index 3b28d78..0000000 --- a/doc/examples/sysmobts-mgr.cfg +++ /dev/null @@ -1,24 +0,0 @@ -! -! SysmoMgr (0.3.0.141-33e5) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all everything - logging level temp info - logging level fw info - logging level find info - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -sysmobts-mgr diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg index e455540..c267fd0 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl notice logging level oml notice logging level rll notice diff --git a/doc/examples/virtual/osmobts-virtual.cfg b/doc/examples/virtual/osmobts-virtual.cfg index 5526e08..fa22316 100644 --- a/doc/examples/virtual/osmobts-virtual.cfg +++ b/doc/examples/virtual/osmobts-virtual.cfg @@ -7,7 +7,6 @@ logging color 0 logging print category 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice -- To view, visit https://gerrit.osmocom.org/3253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f392991097267665e9094189d24e7cf94a5d5d2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jul 14 12:30:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 14 Jul 2017 12:30:19 +0000 Subject: [PATCH] osmo-bts[master]: Cleanup example config files In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3253 to look at the new patch set (#2). Cleanup example config files * remove deprecated everything log level * remove copy-pasted sysmobts-mgr.cfg from root directory Change-Id: I8f392991097267665e9094189d24e7cf94a5d5d2 Related: OS#71 --- M Makefile.am M doc/examples/litecell15/lc15bts-mgr.cfg M doc/examples/litecell15/osmo-bts.cfg M doc/examples/octphy/osmo-bts-trx2dsp1.cfg M doc/examples/octphy/osmo-bts.cfg M doc/examples/sysmo/osmo-bts.cfg M doc/examples/sysmo/sysmobts-mgr.cfg D doc/examples/sysmobts-mgr.cfg M doc/examples/trx/osmo-bts.cfg M doc/examples/virtual/osmobts-virtual.cfg 10 files changed, 1 insertion(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/3253/2 diff --git a/Makefile.am b/Makefile.am index 69d0b93..5c1add6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ contrib/sysmobts-calib/sysmobts-layer1.c \ contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ - doc/examples/sysmobts-mgr.cfg \ + doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ doc/examples/virtual/osmobts-virtual.cfg \ README.md diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index e7c9926..750dc36 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -7,7 +7,6 @@ logging color 1 logging print category 0 logging timestamp 0 - logging level all everything logging level temp info logging level fw info logging level find info diff --git a/doc/examples/litecell15/osmo-bts.cfg b/doc/examples/litecell15/osmo-bts.cfg index 4eb9f29..e38428a 100644 --- a/doc/examples/litecell15/osmo-bts.cfg +++ b/doc/examples/litecell15/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/octphy/osmo-bts-trx2dsp1.cfg b/doc/examples/octphy/osmo-bts-trx2dsp1.cfg index 48db79d..3406e07 100644 --- a/doc/examples/octphy/osmo-bts-trx2dsp1.cfg +++ b/doc/examples/octphy/osmo-bts-trx2dsp1.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/octphy/osmo-bts.cfg b/doc/examples/octphy/osmo-bts.cfg index 4f27c8d..c729d1a 100644 --- a/doc/examples/octphy/osmo-bts.cfg +++ b/doc/examples/octphy/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/sysmo/osmo-bts.cfg b/doc/examples/sysmo/osmo-bts.cfg index 35142f7..87dfae0 100644 --- a/doc/examples/sysmo/osmo-bts.cfg +++ b/doc/examples/sysmo/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/sysmo/sysmobts-mgr.cfg b/doc/examples/sysmo/sysmobts-mgr.cfg index 3b28d78..0cb1d8c 100644 --- a/doc/examples/sysmo/sysmobts-mgr.cfg +++ b/doc/examples/sysmo/sysmobts-mgr.cfg @@ -6,7 +6,6 @@ logging filter all 1 logging color 1 logging timestamp 0 - logging level all everything logging level temp info logging level fw info logging level find info diff --git a/doc/examples/sysmobts-mgr.cfg b/doc/examples/sysmobts-mgr.cfg deleted file mode 100644 index 3b28d78..0000000 --- a/doc/examples/sysmobts-mgr.cfg +++ /dev/null @@ -1,24 +0,0 @@ -! -! SysmoMgr (0.3.0.141-33e5) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all everything - logging level temp info - logging level fw info - logging level find info - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -sysmobts-mgr diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg index e455540..c267fd0 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl notice logging level oml notice logging level rll notice diff --git a/doc/examples/virtual/osmobts-virtual.cfg b/doc/examples/virtual/osmobts-virtual.cfg index 5526e08..fa22316 100644 --- a/doc/examples/virtual/osmobts-virtual.cfg +++ b/doc/examples/virtual/osmobts-virtual.cfg @@ -7,7 +7,6 @@ logging color 0 logging print category 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice -- To view, visit https://gerrit.osmocom.org/3253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8f392991097267665e9094189d24e7cf94a5d5d2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:08:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:08:23 +0000 Subject: [PATCH] libosmocore[master]: IPAC manufacture-defined measurement pre-processing definitions 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/812 to look at the new patch set (#2). IPAC manufacture-defined measurement pre-processing definitions Change-Id: Ie1853697f4cff5ff98654fa1cae6c68e28a0076b --- M include/osmocom/gsm/protocol/gsm_08_58.h M src/gsm/rsl.c 2 files changed, 127 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/812/2 diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index bc70b93..f6451bb 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -169,6 +169,9 @@ RSL_MT_IPAC_DISC_MUX = 0x56, RSL_MT_IPAC_DISC_MUX_ACK, RSL_MT_IPAC_DISC_MUX_NACK, + RSL_MT_IPAC_MEAS_PREPROC_DFT = 0x60, /*Extented Common Channel Management */ + RSL_MT_IPAC_HO_CAN_ENQ = 0x61, + RSL_MT_IPAC_HO_CAN_RES = 0x62, RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */ RSL_MT_IPAC_CRCX_ACK, RSL_MT_IPAC_CRCX_NACK, @@ -315,6 +318,42 @@ #define RSL_IE_ERIC_T3115 0xfd #define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe #define RSL_IE_ERIC_FULL_NCH_INFO 0xff + +/* IPAC MEAS_PREPROC AVERAGING METHOD */ +enum { + IPAC_UNWEIGHTED_AVE = 0, + IPAC_WEIGHTED_AVE, + IPAC_MEDIAN_AVE +}; + +/* IPAC MEAS_PREPROC AVERAGING PARAMID */ +enum { + IPAC_RXLEV_AVE = 0, + IPAC_RXQUAL_AVE, + IPAC_MS_BTS_DIS_AVE +}; + +/* IPAC MEAS_PREPROC HO CAUSES */ +enum { + IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01, + IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H, + IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H, + IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H, + IPAC_HO_RQD_CAUSE_RXLEV_UL_IH, + IPAC_HO_RQD_CAUSE_RXLEV_DL_IH, + IPAC_HO_RQD_CAUSE_MAX_MS_RANGE, + IPAC_HO_RQD_CAUSE_POWER_BUDGET, + IPAC_HO_RQD_CAUSE_ENQUIRY, + IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED, + IPAC_HO_RQD_CAUSE_NORMAL3G, + IPAC_HO_RQD_CAUSE_EMERGENCY3G, + IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G, + IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN, + IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION, + IPAC_HO_RQD_CAUSE_LOAD_PROMOTION, + IPAC_HO_RQD_CAUSE_LOAD_DEMOTION, + IPAC_HO_RQD_CAUSE_MAX, +}; /* Chapter 9.3.1 */ #define RSL_CHAN_NR_MASK 0xf8 @@ -625,6 +664,89 @@ RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13, RSL_IPAC_EIE_MASTER_KEY = 0x14, RSL_IPAC_EIE_MASTER_SALT = 0x15, + /* additional IPAC measurement pre-processing related IEI */ + RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16, + RSL_IPAC_EIE_3G_HO_PARAM = 0x17, + RSL_IPAC_EIE_3G_NCELL_LIST = 0x18, + RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a, + RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b, + +}; + +struct ipac_preproc_ave_cfg { + uint8_t h_reqave:5, + param_id:2, + reserved:1; + uint8_t h_reqt:5, + ave_method:3; +}__attribute__ ((packed)); + +struct ipac_preproc_ho_thresh { + uint8_t l_rxlev_ul_h:6, + reserved_l_rxlev_ul:2; + uint8_t l_rxlev_dl_h:6, + reserved_l_rxlev_dl:2; + uint8_t rxlev_ul_ih:6, + reserved_rxlev_ul:2; + uint8_t rxlev_dl_ih:6, + reserved_rxlev_dl:2; + uint8_t l_rxqual_ul_h:3, + reserved_rxlqual_ul:1, + l_rxqual_dl_h:3, + reserved_rxqual_dl:1; + uint8_t ms_range_max:6, + reserved_ms_range:2; +}__attribute__ ((packed)); + +struct ipac_preproc_ho_comp { + uint8_t p5:5, + reserved_p5:3; + uint8_t n5:5, + reserved_n5:3; + uint8_t p6:5, + reserved_p6:3; + uint8_t n6:5, + reserved_n6:3; + uint8_t p7:5, + reserved_p7:3; + uint8_t n7:5, + reserved_n7:3; + uint8_t p8:5, + reserved_p8:3; + uint8_t n8:5, + reserved_n8:3; + uint8_t ho_interval:5, + reserved_ho:3; + uint8_t reserved; + +}__attribute__ ((packed)); + +struct ipac_preproc_ho_candidates { + uint8_t bsic:6, + reserved0:2; + uint8_t bcch_freq:5, + ba_used:1, + s:1, + reserved1:1; +}__attribute__ ((packed)); + +struct ipac_preproc_ncell_dflts { + uint8_t rxlev_min_def:6, + reserved_rxlev_min_def:2; + uint8_t ho_margin_def:5, + reserved_ho_margin_def:3; + uint8_t ms_txpwr_max_def:5, + reserved_ms_txpwr_max_def:3; +}__attribute__ ((packed)); + +struct ipac_preproc_cfg { + uint8_t meas_rep_mode; + uint32_t meas_mode_flags; + struct ipac_preproc_ave_cfg ms_ave_cfg[3]; + struct ipac_preproc_ave_cfg ave_cfg; + struct ipac_preproc_ho_thresh ho_thresh; + struct ipac_preproc_ho_comp ho_comp; + struct ipac_preproc_ncell_dflts ncell_dflts; }; /*! @} */ diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index e33ea10..aeab1aa 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -561,6 +561,11 @@ [RSL_IPAC_EIE_NCELL_LIST_EXT] = { TLV_TYPE_TLV }, [RSL_IPAC_EIE_MASTER_KEY] = { TLV_TYPE_TLV }, [RSL_IPAC_EIE_MASTER_SALT] = { TLV_TYPE_TLV }, + [RSL_IPAC_EIE_MEAS_TRANS_RES] = {TLV_TYPE_TV}, + [RSL_IPAC_EIE_3G_HO_PARAM] = { TLV_TYPE_TLV }, + [RSL_IPAC_EIE_3G_NCELL_LIST] = { TLV_TYPE_TLV }, + [RSL_IPAC_EIE_SDCCH_CTL_PARAM] = { TLV_TYPE_TV }, + [RSL_IPAC_EIE_AMR_CONV_THRESH] = { TLV_TYPE_FIXED, 9 }, }, }; -- To view, visit https://gerrit.osmocom.org/812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie1853697f4cff5ff98654fa1cae6c68e28a0076b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:08:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:08:25 +0000 Subject: [PATCH] libosmocore[master]: LC15: Enable string for IPAC RSL direct retry Message-ID: Review at https://gerrit.osmocom.org/3254 LC15: Enable string for IPAC RSL direct retry Change-Id: I3e69fba0e21e181d28baee90e95f57216f2617af --- M src/gsm/rsl.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/3254/1 diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index aeab1aa..83097fd 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -380,6 +380,7 @@ { RSL_MT_IPAC_DLCX, "IPAC_DLCX" }, { RSL_MT_IPAC_DLCX_ACK, "IPAC_DLCX_ACK" }, { RSL_MT_IPAC_DLCX_NACK, "IPAC_DLCX_NACK" }, + { RSL_MT_IPAC_DIR_RETR_ENQ, "IPAC_DIR_RETR_ENQ" }, { 0, NULL } }; -- To view, visit https://gerrit.osmocom.org/3254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e69fba0e21e181d28baee90e95f57216f2617af Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:08:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:08:25 +0000 Subject: [PATCH] libosmocore[master]: LC15: Add IPAC Directed Retry Enquiry data structure Message-ID: Review at https://gerrit.osmocom.org/3255 LC15: Add IPAC Directed Retry Enquiry data structure Change-Id: I8d2746eefe1f22dba5b19636ebc9444e458fc802 --- M include/osmocom/gsm/protocol/gsm_08_58.h 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/3255/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index f6451bb..f0094a3 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -739,6 +739,12 @@ reserved_ms_txpwr_max_def:3; }__attribute__ ((packed)); +struct ipac_preproc_ho_ctl_param { + uint8_t sdcch_ho_gsm:1, + sdcch_ho_umts:1, + reserved:6; +}__attribute__ ((packed)); + struct ipac_preproc_cfg { uint8_t meas_rep_mode; uint32_t meas_mode_flags; @@ -747,6 +753,7 @@ struct ipac_preproc_ho_thresh ho_thresh; struct ipac_preproc_ho_comp ho_comp; struct ipac_preproc_ncell_dflts ncell_dflts; + struct ipac_preproc_ho_ctl_param ho_ctl_param; }; /*! @} */ -- To view, visit https://gerrit.osmocom.org/3255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d2746eefe1f22dba5b19636ebc9444e458fc802 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:08:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:08:25 +0000 Subject: [PATCH] libosmocore[master]: LC15: add NM measurement type to standard attribute list Message-ID: Review at https://gerrit.osmocom.org/3256 LC15: add NM measurement type to standard attribute list Change-Id: I320b379429aaf0f7351aed5e4f72a481cc268c05 --- M src/gsm/abis_nm.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/56/3256/1 diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 2ad1945..7207fb9 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -580,6 +580,7 @@ [NM_ATT_HW_CONF_CHG] = { TLV_TYPE_TL16V }, [NM_ATT_OUTST_ALARM] = { TLV_TYPE_TV }, [NM_ATT_MEAS_RES] = { TLV_TYPE_TL16V }, + [NM_ATT_MEAS_TYPE] = { TLV_TYPE_TV }, }, }; -- To view, visit https://gerrit.osmocom.org/3256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I320b379429aaf0f7351aed5e4f72a481cc268c05 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:08:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:08:25 +0000 Subject: [PATCH] libosmocore[master]: Fix LAPD UA msgb memory leak. Message-ID: Review at https://gerrit.osmocom.org/3257 Fix LAPD UA msgb memory leak. Change-Id: Ia4f0606810e00aa6f1779d11893e4acc01976f9a --- M src/gsm/lapd_core.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/3257/1 diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 166bf9a..f510a76 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -305,6 +305,9 @@ /* reset to IDLE state */ void lapd_dl_reset(struct lapd_datalink *dl) { + LOGP(DLLAPD, LOGL_INFO, "Resetting LAPDm instance\n"); + /* enter idle state (and remove eventual cont_res) */ + lapd_dl_newstate(dl, LAPD_STATE_IDLE); /* flush buffer */ lapd_dl_flush_tx(dl); lapd_dl_flush_send(dl); -- To view, visit https://gerrit.osmocom.org/3257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia4f0606810e00aa6f1779d11893e4acc01976f9a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:08:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:08:26 +0000 Subject: [PATCH] libosmocore[master]: Fix malformed Abis/RSL messages Message-ID: Review at https://gerrit.osmocom.org/3258 Fix malformed Abis/RSL messages Change-Id: Ibb116214e8b1798d65a8b0917150496a3c14f344 --- M src/gsm/lapdm.c 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/3258/1 diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index db950a6..b1107c8 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -419,6 +419,12 @@ rll_msg = RSL_MT_EST_IND; break; case OSMO_PRIM(PRIM_DL_EST, PRIM_OP_CONFIRM): + if (dp->oph.msg && dp->oph.msg->len == 0) { + /* omit L3 info by freeing message */ + msgb_free(dp->oph.msg); + dp->oph.msg = NULL; + } + rll_msg = RSL_MT_EST_CONF; break; case OSMO_PRIM(PRIM_DL_DATA, PRIM_OP_INDICATION): @@ -427,9 +433,21 @@ case OSMO_PRIM(PRIM_DL_UNIT_DATA, PRIM_OP_INDICATION): return send_rslms_rll_l3_ui(mctx, dp->oph.msg); case OSMO_PRIM(PRIM_DL_REL, PRIM_OP_INDICATION): + if (dp->oph.msg && dp->oph.msg->len == 0) { + /* omit L3 info by freeing message */ + msgb_free(dp->oph.msg); + dp->oph.msg = NULL; + } + rll_msg = RSL_MT_REL_IND; break; case OSMO_PRIM(PRIM_DL_REL, PRIM_OP_CONFIRM): + if (dp->oph.msg && dp->oph.msg->len == 0) { + /* omit L3 info by freeing message */ + msgb_free(dp->oph.msg); + dp->oph.msg = NULL; + } + rll_msg = RSL_MT_REL_CONF; break; case OSMO_PRIM(PRIM_DL_SUSP, PRIM_OP_CONFIRM): -- To view, visit https://gerrit.osmocom.org/3258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb116214e8b1798d65a8b0917150496a3c14f344 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:16:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:16:11 +0000 Subject: libosmocore[master]: LC15: Enable string for IPAC RSL direct retry In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e69fba0e21e181d28baee90e95f57216f2617af Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:16:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:16:21 +0000 Subject: libosmocore[master]: IPAC manufacture-defined measurement pre-processing definitions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie1853697f4cff5ff98654fa1cae6c68e28a0076b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:16:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:16:24 +0000 Subject: libosmocore[master]: LC15: Add IPAC Directed Retry Enquiry data structure In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d2746eefe1f22dba5b19636ebc9444e458fc802 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:16:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:16:31 +0000 Subject: libosmocore[master]: LC15: add NM measurement type to standard attribute list In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I320b379429aaf0f7351aed5e4f72a481cc268c05 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:19:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:19:17 +0000 Subject: libosmocore[master]: Fix malformed Abis/RSL messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3258/1/src/gsm/lapdm.c File src/gsm/lapdm.c: Line 422: if (dp->oph.msg && dp->oph.msg->len == 0) { we introduce three identical copies of the related code. A function should be introudced for this, and that function be called three times from related places. -- To view, visit https://gerrit.osmocom.org/3258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibb116214e8b1798d65a8b0917150496a3c14f344 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:19:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:19:40 +0000 Subject: [MERGED] libosmocore[master]: LC15: add NM measurement type to standard attribute list In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LC15: add NM measurement type to standard attribute list ...................................................................... LC15: add NM measurement type to standard attribute list Change-Id: I320b379429aaf0f7351aed5e4f72a481cc268c05 --- M src/gsm/abis_nm.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 2ad1945..7207fb9 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -580,6 +580,7 @@ [NM_ATT_HW_CONF_CHG] = { TLV_TYPE_TL16V }, [NM_ATT_OUTST_ALARM] = { TLV_TYPE_TV }, [NM_ATT_MEAS_RES] = { TLV_TYPE_TL16V }, + [NM_ATT_MEAS_TYPE] = { TLV_TYPE_TV }, }, }; -- To view, visit https://gerrit.osmocom.org/3256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I320b379429aaf0f7351aed5e4f72a481cc268c05 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:19:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:19:42 +0000 Subject: [MERGED] libosmocore[master]: LC15: Add IPAC Directed Retry Enquiry data structure In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LC15: Add IPAC Directed Retry Enquiry data structure ...................................................................... LC15: Add IPAC Directed Retry Enquiry data structure Change-Id: I8d2746eefe1f22dba5b19636ebc9444e458fc802 --- M include/osmocom/gsm/protocol/gsm_08_58.h 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index f6451bb..f0094a3 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -739,6 +739,12 @@ reserved_ms_txpwr_max_def:3; }__attribute__ ((packed)); +struct ipac_preproc_ho_ctl_param { + uint8_t sdcch_ho_gsm:1, + sdcch_ho_umts:1, + reserved:6; +}__attribute__ ((packed)); + struct ipac_preproc_cfg { uint8_t meas_rep_mode; uint32_t meas_mode_flags; @@ -747,6 +753,7 @@ struct ipac_preproc_ho_thresh ho_thresh; struct ipac_preproc_ho_comp ho_comp; struct ipac_preproc_ncell_dflts ncell_dflts; + struct ipac_preproc_ho_ctl_param ho_ctl_param; }; /*! @} */ -- To view, visit https://gerrit.osmocom.org/3255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8d2746eefe1f22dba5b19636ebc9444e458fc802 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:19:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:19:42 +0000 Subject: [MERGED] libosmocore[master]: IPAC manufacture-defined measurement pre-processing definitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: IPAC manufacture-defined measurement pre-processing definitions ...................................................................... IPAC manufacture-defined measurement pre-processing definitions Change-Id: Ie1853697f4cff5ff98654fa1cae6c68e28a0076b --- M include/osmocom/gsm/protocol/gsm_08_58.h M src/gsm/rsl.c 2 files changed, 127 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index bc70b93..f6451bb 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -169,6 +169,9 @@ RSL_MT_IPAC_DISC_MUX = 0x56, RSL_MT_IPAC_DISC_MUX_ACK, RSL_MT_IPAC_DISC_MUX_NACK, + RSL_MT_IPAC_MEAS_PREPROC_DFT = 0x60, /*Extented Common Channel Management */ + RSL_MT_IPAC_HO_CAN_ENQ = 0x61, + RSL_MT_IPAC_HO_CAN_RES = 0x62, RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */ RSL_MT_IPAC_CRCX_ACK, RSL_MT_IPAC_CRCX_NACK, @@ -315,6 +318,42 @@ #define RSL_IE_ERIC_T3115 0xfd #define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe #define RSL_IE_ERIC_FULL_NCH_INFO 0xff + +/* IPAC MEAS_PREPROC AVERAGING METHOD */ +enum { + IPAC_UNWEIGHTED_AVE = 0, + IPAC_WEIGHTED_AVE, + IPAC_MEDIAN_AVE +}; + +/* IPAC MEAS_PREPROC AVERAGING PARAMID */ +enum { + IPAC_RXLEV_AVE = 0, + IPAC_RXQUAL_AVE, + IPAC_MS_BTS_DIS_AVE +}; + +/* IPAC MEAS_PREPROC HO CAUSES */ +enum { + IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01, + IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H, + IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H, + IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H, + IPAC_HO_RQD_CAUSE_RXLEV_UL_IH, + IPAC_HO_RQD_CAUSE_RXLEV_DL_IH, + IPAC_HO_RQD_CAUSE_MAX_MS_RANGE, + IPAC_HO_RQD_CAUSE_POWER_BUDGET, + IPAC_HO_RQD_CAUSE_ENQUIRY, + IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED, + IPAC_HO_RQD_CAUSE_NORMAL3G, + IPAC_HO_RQD_CAUSE_EMERGENCY3G, + IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G, + IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN, + IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION, + IPAC_HO_RQD_CAUSE_LOAD_PROMOTION, + IPAC_HO_RQD_CAUSE_LOAD_DEMOTION, + IPAC_HO_RQD_CAUSE_MAX, +}; /* Chapter 9.3.1 */ #define RSL_CHAN_NR_MASK 0xf8 @@ -625,6 +664,89 @@ RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13, RSL_IPAC_EIE_MASTER_KEY = 0x14, RSL_IPAC_EIE_MASTER_SALT = 0x15, + /* additional IPAC measurement pre-processing related IEI */ + RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16, + RSL_IPAC_EIE_3G_HO_PARAM = 0x17, + RSL_IPAC_EIE_3G_NCELL_LIST = 0x18, + RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a, + RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b, + +}; + +struct ipac_preproc_ave_cfg { + uint8_t h_reqave:5, + param_id:2, + reserved:1; + uint8_t h_reqt:5, + ave_method:3; +}__attribute__ ((packed)); + +struct ipac_preproc_ho_thresh { + uint8_t l_rxlev_ul_h:6, + reserved_l_rxlev_ul:2; + uint8_t l_rxlev_dl_h:6, + reserved_l_rxlev_dl:2; + uint8_t rxlev_ul_ih:6, + reserved_rxlev_ul:2; + uint8_t rxlev_dl_ih:6, + reserved_rxlev_dl:2; + uint8_t l_rxqual_ul_h:3, + reserved_rxlqual_ul:1, + l_rxqual_dl_h:3, + reserved_rxqual_dl:1; + uint8_t ms_range_max:6, + reserved_ms_range:2; +}__attribute__ ((packed)); + +struct ipac_preproc_ho_comp { + uint8_t p5:5, + reserved_p5:3; + uint8_t n5:5, + reserved_n5:3; + uint8_t p6:5, + reserved_p6:3; + uint8_t n6:5, + reserved_n6:3; + uint8_t p7:5, + reserved_p7:3; + uint8_t n7:5, + reserved_n7:3; + uint8_t p8:5, + reserved_p8:3; + uint8_t n8:5, + reserved_n8:3; + uint8_t ho_interval:5, + reserved_ho:3; + uint8_t reserved; + +}__attribute__ ((packed)); + +struct ipac_preproc_ho_candidates { + uint8_t bsic:6, + reserved0:2; + uint8_t bcch_freq:5, + ba_used:1, + s:1, + reserved1:1; +}__attribute__ ((packed)); + +struct ipac_preproc_ncell_dflts { + uint8_t rxlev_min_def:6, + reserved_rxlev_min_def:2; + uint8_t ho_margin_def:5, + reserved_ho_margin_def:3; + uint8_t ms_txpwr_max_def:5, + reserved_ms_txpwr_max_def:3; +}__attribute__ ((packed)); + +struct ipac_preproc_cfg { + uint8_t meas_rep_mode; + uint32_t meas_mode_flags; + struct ipac_preproc_ave_cfg ms_ave_cfg[3]; + struct ipac_preproc_ave_cfg ave_cfg; + struct ipac_preproc_ho_thresh ho_thresh; + struct ipac_preproc_ho_comp ho_comp; + struct ipac_preproc_ncell_dflts ncell_dflts; }; /*! @} */ diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index e33ea10..aeab1aa 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -561,6 +561,11 @@ [RSL_IPAC_EIE_NCELL_LIST_EXT] = { TLV_TYPE_TLV }, [RSL_IPAC_EIE_MASTER_KEY] = { TLV_TYPE_TLV }, [RSL_IPAC_EIE_MASTER_SALT] = { TLV_TYPE_TLV }, + [RSL_IPAC_EIE_MEAS_TRANS_RES] = {TLV_TYPE_TV}, + [RSL_IPAC_EIE_3G_HO_PARAM] = { TLV_TYPE_TLV }, + [RSL_IPAC_EIE_3G_NCELL_LIST] = { TLV_TYPE_TLV }, + [RSL_IPAC_EIE_SDCCH_CTL_PARAM] = { TLV_TYPE_TV }, + [RSL_IPAC_EIE_AMR_CONV_THRESH] = { TLV_TYPE_FIXED, 9 }, }, }; -- To view, visit https://gerrit.osmocom.org/812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1853697f4cff5ff98654fa1cae6c68e28a0076b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jul 14 14:19:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 14:19:42 +0000 Subject: [MERGED] libosmocore[master]: LC15: Enable string for IPAC RSL direct retry In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LC15: Enable string for IPAC RSL direct retry ...................................................................... LC15: Enable string for IPAC RSL direct retry Change-Id: I3e69fba0e21e181d28baee90e95f57216f2617af --- M src/gsm/rsl.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index aeab1aa..83097fd 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -380,6 +380,7 @@ { RSL_MT_IPAC_DLCX, "IPAC_DLCX" }, { RSL_MT_IPAC_DLCX_ACK, "IPAC_DLCX_ACK" }, { RSL_MT_IPAC_DLCX_NACK, "IPAC_DLCX_NACK" }, + { RSL_MT_IPAC_DIR_RETR_ENQ, "IPAC_DIR_RETR_ENQ" }, { 0, NULL } }; -- To view, visit https://gerrit.osmocom.org/3254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e69fba0e21e181d28baee90e95f57216f2617af Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From admin at opensuse.org Fri Jul 14 20:01:21 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:01:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5969232012d7d_393a40af882770a3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 111s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 111s] Makefile:671: recipe for target 'check-am' failed [ 111s] make[5]: *** [check-am] Error 2 [ 111s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 111s] Makefile:523: recipe for target 'check-recursive' failed [ 111s] make[4]: *** [check-recursive] Error 1 [ 111s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 111s] Makefile:382: recipe for target 'check-recursive' failed [ 111s] make[3]: *** [check-recursive] Error 1 [ 111s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 111s] Makefile:405: recipe for target 'check-recursive' failed [ 111s] make[2]: *** [check-recursive] Error 1 [ 111s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 111s] Makefile:696: recipe for target 'check' failed [ 111s] make[1]: *** [check] Error 2 [ 111s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 111s] dh_auto_test: make -j1 check returned exit code 2 [ 111s] debian/rules:7: recipe for target 'build' failed [ 111s] make: *** [build] Error 2 [ 111s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 111s] [ 111s] lamb55 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:01:12 UTC 2017. [ 111s] [ 111s] ### VM INTERACTION START ### [ 114s] [ 101.605532] reboot: Power down [ 114s] ### VM INTERACTION END ### [ 114s] [ 114s] lamb55 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:01:16 UTC 2017. [ 114s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:01:38 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:01:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5969233aa26a6_393a40af88277148@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 78s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 78s] Makefile:671: recipe for target 'check-am' failed [ 78s] make[5]: *** [check-am] Error 2 [ 78s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 78s] Makefile:523: recipe for target 'check-recursive' failed [ 78s] make[4]: *** [check-recursive] Error 1 [ 78s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 78s] Makefile:382: recipe for target 'check-recursive' failed [ 78s] make[3]: *** [check-recursive] Error 1 [ 78s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 78s] Makefile:405: recipe for target 'check-recursive' failed [ 78s] make[2]: *** [check-recursive] Error 1 [ 78s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 78s] Makefile:696: recipe for target 'check' failed [ 78s] make[1]: *** [check] Error 2 [ 78s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 78s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 78s] debian/rules:7: recipe for target 'build' failed [ 78s] make: *** [build] Error 2 [ 78s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 78s] [ 78s] lamb73 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:01:25 UTC 2017. [ 78s] [ 78s] ### VM INTERACTION START ### [ 82s] [ 69.497461] reboot: Power down [ 82s] ### VM INTERACTION END ### [ 82s] [ 82s] lamb73 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:01:29 UTC 2017. [ 82s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:01:38 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:01:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5969233b444b4_393a40af8827729f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 82s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 82s] Makefile:671: recipe for target 'check-am' failed [ 82s] make[5]: *** [check-am] Error 2 [ 82s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 82s] Makefile:523: recipe for target 'check-recursive' failed [ 82s] make[4]: *** [check-recursive] Error 1 [ 82s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 82s] Makefile:382: recipe for target 'check-recursive' failed [ 82s] make[3]: *** [check-recursive] Error 1 [ 82s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 82s] Makefile:405: recipe for target 'check-recursive' failed [ 82s] make[2]: *** [check-recursive] Error 1 [ 82s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 82s] Makefile:696: recipe for target 'check' failed [ 82s] make[1]: *** [check] Error 2 [ 82s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 82s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 82s] debian/rules:7: recipe for target 'build' failed [ 82s] make: *** [build] Error 2 [ 82s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 82s] [ 82s] lamb15 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:01:32 UTC 2017. [ 82s] [ 82s] ### VM INTERACTION START ### [ 85s] [ 72.531621] reboot: Power down [ 85s] ### VM INTERACTION END ### [ 85s] [ 85s] lamb15 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:01:35 UTC 2017. [ 85s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:01:55 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:01:55 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5969233c4369f_393a40af88277376@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 99s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 99s] Makefile:671: recipe for target 'check-am' failed [ 99s] make[5]: *** [check-am] Error 2 [ 99s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 99s] Makefile:523: recipe for target 'check-recursive' failed [ 99s] make[4]: *** [check-recursive] Error 1 [ 99s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 99s] Makefile:382: recipe for target 'check-recursive' failed [ 99s] make[3]: *** [check-recursive] Error 1 [ 99s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 99s] Makefile:405: recipe for target 'check-recursive' failed [ 99s] make[2]: *** [check-recursive] Error 1 [ 99s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 99s] Makefile:696: recipe for target 'check' failed [ 99s] make[1]: *** [check] Error 2 [ 99s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 99s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 99s] debian/rules:7: recipe for target 'build' failed [ 99s] make: *** [build] Error 2 [ 99s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 99s] [ 99s] lamb11 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:01:49 UTC 2017. [ 99s] [ 99s] ### VM INTERACTION START ### [ 102s] [ 88.805704] reboot: Power down [ 102s] ### VM INTERACTION END ### [ 102s] [ 102s] lamb11 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:01:52 UTC 2017. [ 102s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:02:12 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:02:12 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5969235ab7797_393a40af882774c7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 166s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 166s] Makefile:671: recipe for target 'check-am' failed [ 166s] make[5]: *** [check-am] Error 2 [ 166s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 166s] Makefile:523: recipe for target 'check-recursive' failed [ 166s] make[4]: *** [check-recursive] Error 1 [ 166s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 166s] Makefile:382: recipe for target 'check-recursive' failed [ 166s] make[3]: *** [check-recursive] Error 1 [ 166s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 166s] Makefile:405: recipe for target 'check-recursive' failed [ 166s] make[2]: *** [check-recursive] Error 1 [ 166s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 166s] Makefile:696: recipe for target 'check' failed [ 166s] make[1]: *** [check] Error 2 [ 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:7: recipe for target 'build' failed [ 166s] make: *** [build] Error 2 [ 166s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 166s] [ 166s] wildcard2 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:02:02 UTC 2017. [ 166s] [ 166s] ### VM INTERACTION START ### [ 170s] [ 91.987008] reboot: Power down [ 171s] ### VM INTERACTION END ### [ 171s] [ 171s] wildcard2 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:02:07 UTC 2017. [ 171s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:02:47 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:02:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <596923765f75b_393a40af882775bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 119s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 119s] Makefile:671: recipe for target 'check-am' failed [ 119s] make[5]: *** [check-am] Error 2 [ 119s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 119s] Makefile:523: recipe for target 'check-recursive' failed [ 119s] make[4]: *** [check-recursive] Error 1 [ 119s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 119s] Makefile:382: recipe for target 'check-recursive' failed [ 119s] make[3]: *** [check-recursive] Error 1 [ 119s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 119s] Makefile:405: recipe for target 'check-recursive' failed [ 119s] make[2]: *** [check-recursive] Error 1 [ 119s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 119s] Makefile:696: recipe for target 'check' failed [ 119s] make[1]: *** [check] Error 2 [ 119s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 119s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 119s] debian/rules:7: recipe for target 'build' failed [ 119s] make: *** [build] Error 2 [ 119s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 119s] [ 119s] cloud137 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:02:34 UTC 2017. [ 119s] [ 119s] ### VM INTERACTION START ### [ 122s] [ 98.860899] reboot: Power down [ 124s] ### VM INTERACTION END ### [ 124s] [ 124s] cloud137 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:02:40 UTC 2017. [ 124s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:03:38 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:03:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <596923b0ace53_393a40af882778fe@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 96s] Makefile:660: recipe for target 'check-am' failed [ 96s] make[5]: *** [check-am] Error 2 [ 96s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 96s] Makefile:512: recipe for target 'check-recursive' failed [ 96s] make[4]: *** [check-recursive] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 96s] Makefile:370: recipe for target 'check-recursive' failed [ 96s] make[3]: *** [check-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 96s] Makefile:393: recipe for target 'check-recursive' failed [ 96s] make[2]: *** [check-recursive] Error 1 [ 96s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 96s] Makefile:684: recipe for target 'check' failed [ 96s] make[1]: *** [check] Error 2 [ 96s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 96s] dh_auto_test: make -j1 check returned exit code 2 [ 96s] debian/rules:7: recipe for target 'build' failed [ 96s] make: *** [build] Error 2 [ 96s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 96s] [ 96s] lamb07 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:03:23 UTC 2017. [ 96s] [ 96s] ### VM INTERACTION START ### [ 97s] Powering off. [ 97s] [ 83.483007] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] lamb07 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:03:25 UTC 2017. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:03:38 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:03:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/i586 In-Reply-To: References: Message-ID: <596923b146a89_393a40af882779a6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 101s] Makefile:660: recipe for target 'check-am' failed [ 101s] make[5]: *** [check-am] Error 2 [ 101s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 101s] Makefile:512: recipe for target 'check-recursive' failed [ 101s] make[4]: *** [check-recursive] Error 1 [ 101s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 101s] Makefile:370: recipe for target 'check-recursive' failed [ 101s] make[3]: *** [check-recursive] Error 1 [ 101s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 101s] Makefile:393: recipe for target 'check-recursive' failed [ 101s] make[2]: *** [check-recursive] Error 1 [ 101s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 101s] Makefile:684: recipe for target 'check' failed [ 101s] make[1]: *** [check] Error 2 [ 101s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 101s] dh_auto_test: make -j1 check returned exit code 2 [ 101s] debian/rules:7: recipe for target 'build' failed [ 101s] make: *** [build] Error 2 [ 101s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 101s] [ 101s] lamb04 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:03:25 UTC 2017. [ 101s] [ 101s] ### VM INTERACTION START ### [ 103s] Powering off. [ 103s] [ 89.223140] reboot: Power down [ 103s] ### VM INTERACTION END ### [ 103s] [ 103s] lamb04 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:03:27 UTC 2017. [ 103s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:05:05 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:05:05 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5969240bb08fd_393a40af882782ba@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 96s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 96s] Makefile:671: recipe for target 'check-am' failed [ 96s] make[5]: *** [check-am] Error 2 [ 96s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 96s] Makefile:523: recipe for target 'check-recursive' failed [ 96s] make[4]: *** [check-recursive] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 96s] Makefile:382: recipe for target 'check-recursive' failed [ 96s] make[3]: *** [check-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 96s] Makefile:405: recipe for target 'check-recursive' failed [ 96s] make[2]: *** [check-recursive] Error 1 [ 96s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 96s] Makefile:696: recipe for target 'check' failed [ 96s] make[1]: *** [check] Error 2 [ 96s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 96s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 96s] debian/rules:7: recipe for target 'build' failed [ 96s] make: *** [build] Error 2 [ 96s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 96s] [ 96s] lamb21 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:04:52 UTC 2017. [ 96s] [ 96s] ### VM INTERACTION START ### [ 99s] [ 85.050650] reboot: Power down [ 99s] ### VM INTERACTION END ### [ 99s] [ 99s] lamb21 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:04:56 UTC 2017. [ 99s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:05:39 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:05:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5969242b5066d_393a40af882784c2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 105s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 105s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 105s] make[4]: Nothing to be done for 'install-exec-am'. [ 105s] make[4]: Nothing to be done for 'install-data-am'. [ 105s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 105s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 105s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 105s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 105s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 105s] make[3]: Nothing to be done for 'install-exec-am'. [ 105s] make[3]: Nothing to be done for 'install-data-am'. [ 105s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 105s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 105s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 105s] dh_install -O--fail-missing [ 105s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 105s] dh_install: missing files, aborting [ 105s] debian/rules:12: recipe for target 'binary' failed [ 105s] make: *** [binary] Error 2 [ 105s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 105s] [ 105s] lamb63 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:05:31 UTC 2017. [ 105s] [ 105s] ### VM INTERACTION START ### [ 108s] [ 95.941620] reboot: Power down [ 109s] ### VM INTERACTION END ### [ 109s] [ 109s] lamb63 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:05:35 UTC 2017. [ 109s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:06:13 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:06:13 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59692446b5deb_393a40af8827855e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 139s] make[6]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 139s] Makefile:671: recipe for target 'check-am' failed [ 139s] make[5]: *** [check-am] Error 2 [ 139s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 139s] Makefile:523: recipe for target 'check-recursive' failed [ 139s] make[4]: *** [check-recursive] Error 1 [ 139s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests/auc' [ 139s] Makefile:382: recipe for target 'check-recursive' failed [ 139s] make[3]: *** [check-recursive] Error 1 [ 139s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 139s] Makefile:405: recipe for target 'check-recursive' failed [ 139s] make[2]: *** [check-recursive] Error 1 [ 139s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 139s] Makefile:696: recipe for target 'check' failed [ 139s] make[1]: *** [check] Error 2 [ 139s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 139s] dh_auto_test: make -j1 check returned exit code 2 [ 139s] debian/rules:7: recipe for target 'build' failed [ 139s] make: *** [build] Error 2 [ 139s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 139s] [ 139s] cloud136 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:06:02 UTC 2017. [ 139s] [ 139s] ### VM INTERACTION START ### [ 142s] [ 120.409600] reboot: Power down [ 144s] ### VM INTERACTION END ### [ 144s] [ 144s] cloud136 failed "build osmo-hlr_0.0.1.20170714.dsc" at Fri Jul 14 20:06:07 UTC 2017. [ 144s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:07:56 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:07:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <596924a3dc8da_393a40af88278838@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 133s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 133s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 133s] make[4]: Nothing to be done for 'install-exec-am'. [ 133s] make[4]: Nothing to be done for 'install-data-am'. [ 133s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 133s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 133s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 133s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 133s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 133s] make[3]: Nothing to be done for 'install-exec-am'. [ 133s] make[3]: Nothing to be done for 'install-data-am'. [ 133s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 133s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 133s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 133s] dh_install -O--fail-missing [ 133s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 133s] dh_install: missing files, aborting [ 133s] debian/rules:12: recipe for target 'binary' failed [ 133s] make: *** [binary] Error 2 [ 133s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 133s] [ 133s] build30 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:07:43 UTC 2017. [ 133s] [ 133s] ### VM INTERACTION START ### [ 136s] [ 112.102474] reboot: Power down [ 138s] ### VM INTERACTION END ### [ 138s] [ 138s] build30 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:07:48 UTC 2017. [ 138s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:08:31 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:08:31 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <596924c4904cf_393a40af8827914d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 111s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 111s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 111s] make[4]: Nothing to be done for 'install-exec-am'. [ 111s] make[4]: Nothing to be done for 'install-data-am'. [ 111s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 111s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 111s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 111s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 111s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 111s] make[3]: Nothing to be done for 'install-exec-am'. [ 111s] make[3]: Nothing to be done for 'install-data-am'. [ 111s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 111s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 111s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 111s] dh_install -O--fail-missing [ 111s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 111s] dh_install: missing files, aborting [ 111s] debian/rules:12: recipe for target 'binary' failed [ 111s] make: *** [binary] Error 2 [ 111s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 111s] [ 111s] lamb70 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:08:10 UTC 2017. [ 111s] [ 111s] ### VM INTERACTION START ### [ 114s] [ 100.645643] reboot: Power down [ 114s] ### VM INTERACTION END ### [ 114s] [ 114s] lamb70 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:08:13 UTC 2017. [ 114s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:08:48 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:08:48 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/i586 In-Reply-To: References: Message-ID: <596924df322b8_393a40af882792bf@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 85s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 85s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 85s] make[4]: Nothing to be done for 'install-exec-am'. [ 85s] make[4]: Nothing to be done for 'install-data-am'. [ 85s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 85s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 85s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 85s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 85s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 85s] make[3]: Nothing to be done for 'install-exec-am'. [ 85s] make[3]: Nothing to be done for 'install-data-am'. [ 85s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 85s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 85s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 85s] dh_install -O--fail-missing [ 85s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 85s] dh_install: missing files, aborting [ 85s] debian/rules:12: recipe for target 'binary' failed [ 85s] make: *** [binary] Error 2 [ 85s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 85s] [ 85s] build82 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:08:33 UTC 2017. [ 85s] [ 85s] ### VM INTERACTION START ### [ 88s] [ 78.631013] reboot: Power down [ 89s] ### VM INTERACTION END ### [ 89s] [ 89s] build82 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:08:37 UTC 2017. [ 89s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:09:39 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:09:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5969251b49f8e_393a40af88279644@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 124s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 124s] make[4]: Nothing to be done for 'install-exec-am'. [ 124s] make[4]: Nothing to be done for 'install-data-am'. [ 124s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 124s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 124s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 124s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 124s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 124s] make[3]: Nothing to be done for 'install-exec-am'. [ 124s] make[3]: Nothing to be done for 'install-data-am'. [ 124s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 124s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 124s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 124s] dh_install -O--fail-missing [ 124s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 124s] dh_install: missing files, aborting [ 124s] debian/rules:12: recipe for target 'binary' failed [ 124s] make: *** [binary] Error 2 [ 124s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 124s] [ 124s] lamb68 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:09:28 UTC 2017. [ 124s] [ 124s] ### VM INTERACTION START ### [ 126s] Powering off. [ 126s] [ 112.263968] reboot: Power down [ 126s] ### VM INTERACTION END ### [ 126s] [ 126s] lamb68 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:09:30 UTC 2017. [ 126s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:09:56 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:09:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5969251d5a2f4_393a40af8827979e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 139s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 139s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 139s] make[4]: Nothing to be done for 'install-exec-am'. [ 139s] make[4]: Nothing to be done for 'install-data-am'. [ 139s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 139s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 139s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 139s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 139s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 139s] make[3]: Nothing to be done for 'install-exec-am'. [ 139s] make[3]: Nothing to be done for 'install-data-am'. [ 139s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 139s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 139s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 139s] dh_install -O--fail-missing [ 139s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 139s] dh_install: missing files, aborting [ 139s] debian/rules:12: recipe for target 'binary' failed [ 139s] make: *** [binary] Error 2 [ 139s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 139s] [ 139s] cloud112 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:09:41 UTC 2017. [ 139s] [ 139s] ### VM INTERACTION START ### [ 142s] [ 117.870075] reboot: Power down [ 144s] ### VM INTERACTION END ### [ 144s] [ 144s] cloud112 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:09:47 UTC 2017. [ 144s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:11:38 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:11:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59692591ec291_393a40af8827994d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 128s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 128s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 128s] make[4]: Nothing to be done for 'install-exec-am'. [ 128s] make[4]: Nothing to be done for 'install-data-am'. [ 128s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 128s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 128s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 128s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 128s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 128s] make[3]: Nothing to be done for 'install-exec-am'. [ 128s] make[3]: Nothing to be done for 'install-data-am'. [ 128s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 128s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 128s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 128s] dh_install -O--fail-missing [ 128s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 128s] dh_install: missing files, aborting [ 128s] debian/rules:12: recipe for target 'binary' failed [ 128s] make: *** [binary] Error 2 [ 128s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 128s] [ 128s] lamb01 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:11:18 UTC 2017. [ 128s] [ 128s] ### VM INTERACTION START ### [ 131s] [ 117.163288] reboot: Power down [ 131s] ### VM INTERACTION END ### [ 131s] [ 131s] lamb01 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:11:22 UTC 2017. [ 131s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 14 20:13:55 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 14 Jul 2017 20:13:55 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5969260997c84_393a40af88280226@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 175s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 175s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 175s] make[4]: Nothing to be done for 'install-exec-am'. [ 175s] make[4]: Nothing to be done for 'install-data-am'. [ 175s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 175s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 175s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 175s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 175s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 175s] make[3]: Nothing to be done for 'install-exec-am'. [ 175s] make[3]: Nothing to be done for 'install-data-am'. [ 175s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 175s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 175s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 175s] dh_install -O--fail-missing [ 175s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 175s] dh_install: missing files, aborting [ 175s] debian/rules:12: recipe for target 'binary' failed [ 175s] make: *** [binary] Error 2 [ 175s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 175s] [ 175s] cloud107 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:13:38 UTC 2017. [ 175s] [ 175s] ### VM INTERACTION START ### [ 178s] [ 155.155220] reboot: Power down [ 178s] ### VM INTERACTION END ### [ 178s] [ 178s] cloud107 failed "build osmo-bts_0.5.0.20170714.dsc" at Fri Jul 14 20:13:41 UTC 2017. [ 178s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 14 22:13:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 22:13:55 +0000 Subject: osmo-bts[master]: Fix .deb build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 why is osmo-bts-virtual part of osmo-bts-trx? Why not treat it similar to every other BTS model we support? if osmo-bts-trx has a separate sub-package, then so should osmo-bts-virtual. -- To view, visit https://gerrit.osmocom.org/3251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ca7eb51019247eb95c6bac752d6e2c4406ce5a2 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 Jul 14 22:14:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 22:14:05 +0000 Subject: osmo-hlr[master]: Another attempt at fixing .deb In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9e3f31622efae132b25683c54ce09c83ce43415 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 14 22:14:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 22:14:08 +0000 Subject: [MERGED] osmo-hlr[master]: Another attempt at fixing .deb In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Another attempt at fixing .deb ...................................................................... Another attempt at fixing .deb The previous efforts have failed: python3 does not supply /usr/bin/python symlink. Let's use python-minimal dependency. Change-Id: If9e3f31622efae132b25683c54ce09c83ce43415 --- M debian/control M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 571c24e..0ff3801 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python3, + python-minimal, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index acc0f7d..b01a797 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # FIXME: use python3 once buildslaves are updated. # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/3225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If9e3f31622efae132b25683c54ce09c83ce43415 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: daniel Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jul 14 22:14:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 22:14:55 +0000 Subject: osmo-bts[master]: Cleanup example config files In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f392991097267665e9094189d24e7cf94a5d5d2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 14 22:15:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 14 Jul 2017 22:15:03 +0000 Subject: [MERGED] osmo-bts[master]: Cleanup example config files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Cleanup example config files ...................................................................... Cleanup example config files * remove deprecated everything log level * remove copy-pasted sysmobts-mgr.cfg from root directory Change-Id: I8f392991097267665e9094189d24e7cf94a5d5d2 Related: OS#71 --- M Makefile.am M doc/examples/litecell15/lc15bts-mgr.cfg M doc/examples/litecell15/osmo-bts.cfg M doc/examples/octphy/osmo-bts-trx2dsp1.cfg M doc/examples/octphy/osmo-bts.cfg M doc/examples/sysmo/osmo-bts.cfg M doc/examples/sysmo/sysmobts-mgr.cfg D doc/examples/sysmobts-mgr.cfg M doc/examples/trx/osmo-bts.cfg M doc/examples/virtual/osmobts-virtual.cfg 10 files changed, 1 insertion(+), 33 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 69d0b93..5c1add6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ contrib/sysmobts-calib/sysmobts-layer1.c \ contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ - doc/examples/sysmobts-mgr.cfg \ + doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ doc/examples/virtual/osmobts-virtual.cfg \ README.md diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index e7c9926..750dc36 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -7,7 +7,6 @@ logging color 1 logging print category 0 logging timestamp 0 - logging level all everything logging level temp info logging level fw info logging level find info diff --git a/doc/examples/litecell15/osmo-bts.cfg b/doc/examples/litecell15/osmo-bts.cfg index 4eb9f29..e38428a 100644 --- a/doc/examples/litecell15/osmo-bts.cfg +++ b/doc/examples/litecell15/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/octphy/osmo-bts-trx2dsp1.cfg b/doc/examples/octphy/osmo-bts-trx2dsp1.cfg index 48db79d..3406e07 100644 --- a/doc/examples/octphy/osmo-bts-trx2dsp1.cfg +++ b/doc/examples/octphy/osmo-bts-trx2dsp1.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/octphy/osmo-bts.cfg b/doc/examples/octphy/osmo-bts.cfg index 4f27c8d..c729d1a 100644 --- a/doc/examples/octphy/osmo-bts.cfg +++ b/doc/examples/octphy/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/sysmo/osmo-bts.cfg b/doc/examples/sysmo/osmo-bts.cfg index 35142f7..87dfae0 100644 --- a/doc/examples/sysmo/osmo-bts.cfg +++ b/doc/examples/sysmo/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice diff --git a/doc/examples/sysmo/sysmobts-mgr.cfg b/doc/examples/sysmo/sysmobts-mgr.cfg index 3b28d78..0cb1d8c 100644 --- a/doc/examples/sysmo/sysmobts-mgr.cfg +++ b/doc/examples/sysmo/sysmobts-mgr.cfg @@ -6,7 +6,6 @@ logging filter all 1 logging color 1 logging timestamp 0 - logging level all everything logging level temp info logging level fw info logging level find info diff --git a/doc/examples/sysmobts-mgr.cfg b/doc/examples/sysmobts-mgr.cfg deleted file mode 100644 index 3b28d78..0000000 --- a/doc/examples/sysmobts-mgr.cfg +++ /dev/null @@ -1,24 +0,0 @@ -! -! SysmoMgr (0.3.0.141-33e5) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all everything - logging level temp info - logging level fw info - logging level find info - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -sysmobts-mgr diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg index e455540..c267fd0 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -5,7 +5,6 @@ log stderr logging color 1 logging timestamp 0 - logging level all everything logging level rsl notice logging level oml notice logging level rll notice diff --git a/doc/examples/virtual/osmobts-virtual.cfg b/doc/examples/virtual/osmobts-virtual.cfg index 5526e08..fa22316 100644 --- a/doc/examples/virtual/osmobts-virtual.cfg +++ b/doc/examples/virtual/osmobts-virtual.cfg @@ -7,7 +7,6 @@ logging color 0 logging print category 1 logging timestamp 0 - logging level all everything logging level rsl info logging level oml info logging level rll notice -- To view, visit https://gerrit.osmocom.org/3253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f392991097267665e9094189d24e7cf94a5d5d2 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 Sat Jul 15 10:20:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 15 Jul 2017 10:20:32 +0000 Subject: osmo-bts[master]: Fix .deb build In-Reply-To: References: Message-ID: Patch Set 1: So far we've only packaged osmo-bts-trx but not other models as those are useless without proper hw anyway. I'll split it off into separate package in next revision. -- To view, visit https://gerrit.osmocom.org/3251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ca7eb51019247eb95c6bac752d6e2c4406ce5a2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 15 14:35:13 2017 From: gerrit-no-reply at lists.osmocom.org (allesklar2) Date: Sat, 15 Jul 2017 14:35:13 +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 (#2). 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_sync.c M src/phy/tetra_burst_sync.h M src/tetra-rx.c M src/tetra_common.h M src/tetra_gsmtap.c 11 files changed, 464 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/17/2817/2 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_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..e4b88ad 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: 2 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 Sat Jul 15 14:36:24 2017 From: gerrit-no-reply at lists.osmocom.org (allesklar2) Date: Sat, 15 Jul 2017 14:36:24 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support: In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) > Patch Set 2: Published edit on patch set 1. https://gerrit.osmocom.org/#/c/2817/1/src/conv_enc_test.c File src/conv_enc_test.c: PS1, Line 53: void dp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned int len, void *priv) : { : } > Just a hint: you can use grep to find, where this During the development I have oriented to TMO and the function tp_sap_udata_ind() is also empty. I suspect that these functions must exist in order to preserve the independence from the MAC Layer. Since the function is specified in lower_mac_layer and is defined as extern in tetra_burst.h, it must be listed as a dummy at this point. Does this make sense for you? -- 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: 2 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 Gerrit-HasComments: Yes From admin at opensuse.org Sat Jul 15 20:03:18 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 15 Jul 2017 20:03:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <596a7523261ba_393a40af88362770@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 148s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 148s] make[4]: Nothing to be done for 'install-exec-am'. [ 148s] make[4]: Nothing to be done for 'install-data-am'. [ 148s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 148s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 148s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 148s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 148s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 148s] make[3]: Nothing to be done for 'install-exec-am'. [ 148s] make[3]: Nothing to be done for 'install-data-am'. [ 148s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 148s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 148s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 148s] dh_install -O--fail-missing [ 148s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 148s] dh_install: missing files, aborting [ 148s] debian/rules:12: recipe for target 'binary' failed [ 148s] make: *** [binary] Error 2 [ 148s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 148s] [ 148s] cloud113 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:03:07 UTC 2017. [ 148s] [ 148s] ### VM INTERACTION START ### [ 149s] Powering off. [ 149s] [ 125.404377] reboot: Power down [ 150s] ### VM INTERACTION END ### [ 150s] [ 150s] cloud113 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:03:10 UTC 2017. [ 150s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 15 20:04:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 15 Jul 2017 20:04:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <596a75605032c_393a40af88362869@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 105s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 105s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 105s] make[4]: Nothing to be done for 'install-exec-am'. [ 105s] make[4]: Nothing to be done for 'install-data-am'. [ 105s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 105s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 105s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 105s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 105s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 105s] make[3]: Nothing to be done for 'install-exec-am'. [ 105s] make[3]: Nothing to be done for 'install-data-am'. [ 105s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 105s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 105s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 105s] dh_install -O--fail-missing [ 105s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 105s] dh_install: missing files, aborting [ 105s] debian/rules:12: recipe for target 'binary' failed [ 105s] make: *** [binary] Error 2 [ 105s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 105s] [ 105s] lamb13 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:04:11 UTC 2017. [ 105s] [ 105s] ### VM INTERACTION START ### [ 108s] [ 95.168649] reboot: Power down [ 108s] ### VM INTERACTION END ### [ 108s] [ 108s] lamb13 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:04:15 UTC 2017. [ 108s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 15 20:04:44 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 15 Jul 2017 20:04:44 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <596a7561146c1_393a40af883631f4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 116s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 116s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 116s] make[4]: Nothing to be done for 'install-exec-am'. [ 116s] make[4]: Nothing to be done for 'install-data-am'. [ 116s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 116s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 116s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 116s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 116s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 116s] make[3]: Nothing to be done for 'install-exec-am'. [ 116s] make[3]: Nothing to be done for 'install-data-am'. [ 116s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 116s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 116s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 116s] dh_install -O--fail-missing [ 116s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 116s] dh_install: missing files, aborting [ 116s] debian/rules:12: recipe for target 'binary' failed [ 116s] make: *** [binary] Error 2 [ 116s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 116s] [ 116s] lamb06 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:04:29 UTC 2017. [ 116s] [ 116s] ### VM INTERACTION START ### [ 119s] [ 104.451254] reboot: Power down [ 119s] ### VM INTERACTION END ### [ 119s] [ 119s] lamb06 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:04:32 UTC 2017. [ 119s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 15 20:06:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 15 Jul 2017 20:06:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <596a75d6b9515_393a40af8836348b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 107s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 107s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 107s] make[4]: Nothing to be done for 'install-exec-am'. [ 107s] make[4]: Nothing to be done for 'install-data-am'. [ 107s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 107s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 107s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 107s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 107s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 107s] make[3]: Nothing to be done for 'install-exec-am'. [ 107s] make[3]: Nothing to be done for 'install-data-am'. [ 107s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 107s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 107s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 107s] dh_install -O--fail-missing [ 107s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 107s] dh_install: missing files, aborting [ 107s] debian/rules:12: recipe for target 'binary' failed [ 107s] make: *** [binary] Error 2 [ 107s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 107s] [ 107s] lamb24 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:06:22 UTC 2017. [ 107s] [ 107s] ### VM INTERACTION START ### [ 110s] [ 97.304227] reboot: Power down [ 110s] ### VM INTERACTION END ### [ 110s] [ 110s] lamb24 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:06:25 UTC 2017. [ 110s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 15 20:07:18 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 15 Jul 2017 20:07:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/i586 In-Reply-To: References: Message-ID: <596a76144cb2d_393a40af883636e7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 157s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 157s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 157s] make[4]: Nothing to be done for 'install-exec-am'. [ 157s] make[4]: Nothing to be done for 'install-data-am'. [ 157s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 157s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 157s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 157s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 157s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 157s] make[3]: Nothing to be done for 'install-exec-am'. [ 157s] make[3]: Nothing to be done for 'install-data-am'. [ 157s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 157s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 157s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 157s] dh_install -O--fail-missing [ 157s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 157s] dh_install: missing files, aborting [ 157s] debian/rules:12: recipe for target 'binary' failed [ 157s] make: *** [binary] Error 2 [ 157s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 157s] [ 157s] cloud127 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:07:04 UTC 2017. [ 157s] [ 158s] ### VM INTERACTION START ### [ 161s] [ 132.669493] reboot: Power down [ 162s] ### VM INTERACTION END ### [ 162s] [ 162s] cloud127 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:07:09 UTC 2017. [ 162s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 15 20:08:44 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 15 Jul 2017 20:08:44 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <596a764ca3f0c_393a40af8836377a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 133s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 133s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 133s] make[4]: Nothing to be done for 'install-exec-am'. [ 133s] make[4]: Nothing to be done for 'install-data-am'. [ 133s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 133s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 133s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 133s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 133s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 133s] make[3]: Nothing to be done for 'install-exec-am'. [ 133s] make[3]: Nothing to be done for 'install-data-am'. [ 133s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 133s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 133s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 133s] dh_install -O--fail-missing [ 133s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 133s] dh_install: missing files, aborting [ 133s] debian/rules:12: recipe for target 'binary' failed [ 133s] make: *** [binary] Error 2 [ 133s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 133s] [ 133s] wildcard2 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:08:31 UTC 2017. [ 133s] [ 133s] ### VM INTERACTION START ### [ 136s] [ 113.274935] reboot: Power down [ 138s] ### VM INTERACTION END ### [ 138s] [ 138s] wildcard2 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:08:37 UTC 2017. [ 138s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 15 20:08:44 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 15 Jul 2017 20:08:44 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <596a764ce0e7a_393a40af883638e0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 103s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 103s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 103s] make[4]: Nothing to be done for 'install-exec-am'. [ 103s] make[4]: Nothing to be done for 'install-data-am'. [ 103s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 103s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 103s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 103s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 103s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 103s] make[3]: Nothing to be done for 'install-exec-am'. [ 103s] make[3]: Nothing to be done for 'install-data-am'. [ 103s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 103s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 103s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 103s] dh_install -O--fail-missing [ 103s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 103s] dh_install: missing files, aborting [ 103s] debian/rules:12: recipe for target 'binary' failed [ 103s] make: *** [binary] Error 2 [ 103s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 103s] [ 103s] lamb13 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:08:34 UTC 2017. [ 103s] [ 103s] ### VM INTERACTION START ### [ 106s] [ 92.435085] reboot: Power down [ 106s] ### VM INTERACTION END ### [ 106s] [ 106s] lamb13 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:08:37 UTC 2017. [ 106s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 15 20:09:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 15 Jul 2017 20:09:01 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <596a766b7c79d_393a40af883639bc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 135s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 135s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 135s] make[4]: Nothing to be done for 'install-exec-am'. [ 135s] make[4]: Nothing to be done for 'install-data-am'. [ 135s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 135s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 135s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 135s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 135s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 135s] make[3]: Nothing to be done for 'install-exec-am'. [ 135s] make[3]: Nothing to be done for 'install-data-am'. [ 135s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 135s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 135s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 135s] dh_install -O--fail-missing [ 135s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 135s] dh_install: missing files, aborting [ 135s] debian/rules:12: recipe for target 'binary' failed [ 135s] make: *** [binary] Error 2 [ 135s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 135s] [ 135s] cloud125 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:08:41 UTC 2017. [ 135s] [ 135s] ### VM INTERACTION START ### [ 138s] [ 116.862065] reboot: Power down [ 139s] ### VM INTERACTION END ### [ 139s] [ 139s] cloud125 failed "build osmo-bts_0.5.0.20170715.dsc" at Sat Jul 15 20:08:46 UTC 2017. [ 139s] -- 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 Jul 15 20:36:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 15 Jul 2017 20:36:45 +0000 Subject: [PATCH] osmo-bts[master]: Ensure we don't send dummy UI frames on BCCH for TC=5 Message-ID: Review at https://gerrit.osmocom.org/3259 Ensure we don't send dummy UI frames on BCCH for TC=5 When no SI 2bis, nor 2ter, nor 2quater is in use, then the code in bts_sysinfo_get() will return null, causing the transmission of a dummy frame (0303012B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B) instead of a system information message. This is - at least - very odd and might not be backed by the specification. We should simply send any other system information message instead of sending a frame that does not have a valid SI header. While 030301 might be a valid, empty UI frame on a DCCH, it is not a valid frame for the BCCH, where the header is structured differently. In fact, bts_sysinfo_get() should never return NULL and always return a valid BCCH message. This bug was found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo/Test.ttcn Change-Id: Ifeaed27d1d7ba9994fb8ce67d660648bcc8efece Closes: OS#2365 --- M src/common/sysinfo.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/59/3259/1 diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 9276c7b..cf86380 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -129,6 +129,10 @@ else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return get_si2q_inc_index(bts); + + /* simply send SI2 if we have nothing else to send */ + else + return GSM_BTS_SI(bts, SYSINFO_TYPE_2); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); @@ -136,7 +140,9 @@ return GSM_BTS_SI(bts, SYSINFO_TYPE_4); } - return NULL; + /* this should never bve reached. We must transmit a BCCH + * message on the normal BCCH in all cases. */ + OSMO_ASSERT(0); } uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg) -- To view, visit https://gerrit.osmocom.org/3259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifeaed27d1d7ba9994fb8ce67d660648bcc8efece Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 15 20:44:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 15 Jul 2017 20:44:47 +0000 Subject: osmo-bts[master]: Ensure we don't send dummy UI frames on BCCH for TC=5 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeaed27d1d7ba9994fb8ce67d660648bcc8efece Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 15 20:44:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 15 Jul 2017 20:44:49 +0000 Subject: [MERGED] osmo-bts[master]: Ensure we don't send dummy UI frames on BCCH for TC=5 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Ensure we don't send dummy UI frames on BCCH for TC=5 ...................................................................... Ensure we don't send dummy UI frames on BCCH for TC=5 When no SI 2bis, nor 2ter, nor 2quater is in use, then the code in bts_sysinfo_get() will return null, causing the transmission of a dummy frame (0303012B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B) instead of a system information message. This is - at least - very odd and might not be backed by the specification. We should simply send any other system information message instead of sending a frame that does not have a valid SI header. While 030301 might be a valid, empty UI frame on a DCCH, it is not a valid frame for the BCCH, where the header is structured differently. In fact, bts_sysinfo_get() should never return NULL and always return a valid BCCH message. This bug was found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo/Test.ttcn Change-Id: Ifeaed27d1d7ba9994fb8ce67d660648bcc8efece Closes: OS#2365 --- M src/common/sysinfo.c 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 9276c7b..cf86380 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -129,6 +129,10 @@ else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return get_si2q_inc_index(bts); + + /* simply send SI2 if we have nothing else to send */ + else + return GSM_BTS_SI(bts, SYSINFO_TYPE_2); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); @@ -136,7 +140,9 @@ return GSM_BTS_SI(bts, SYSINFO_TYPE_4); } - return NULL; + /* this should never bve reached. We must transmit a BCCH + * message on the normal BCCH in all cases. */ + OSMO_ASSERT(0); } uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg) -- To view, visit https://gerrit.osmocom.org/3259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifeaed27d1d7ba9994fb8ce67d660648bcc8efece Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 15 20:50:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 15 Jul 2017 20:50:01 +0000 Subject: [PATCH] libosmocore[master]: extend osmo_sysinfo_type with missing SYSINFO_TYPE Message-ID: Review at https://gerrit.osmocom.org/3260 extend osmo_sysinfo_type with missing SYSINFO_TYPE The list should now be complete up to Releae 14 Change-Id: I693cabe1a3b00a8c4198f7a4a1c647c5d7dc6c41 --- M include/osmocom/gsm/sysinfo.h 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/3260/1 diff --git a/include/osmocom/gsm/sysinfo.h b/include/osmocom/gsm/sysinfo.h index 8e26f99..11bb268 100644 --- a/include/osmocom/gsm/sysinfo.h +++ b/include/osmocom/gsm/sysinfo.h @@ -36,7 +36,12 @@ SYSINFO_TYPE_5ter, SYSINFO_TYPE_EMO, SYSINFO_TYPE_MEAS_INFO, - /* FIXME all the various bis and ter */ + SYSINFO_TYPE_13alt, + SYSINFO_TYPE_15, + SYSINFO_TYPE_2n, + SYSINFO_TYPE_21, + SYSINFO_TYPE_22, + SYSINFO_TYPE_23, _MAX_SYSINFO_TYPE }; -- To view, visit https://gerrit.osmocom.org/3260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I693cabe1a3b00a8c4198f7a4a1c647c5d7dc6c41 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 15 20:55:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 15 Jul 2017 20:55:29 +0000 Subject: [PATCH] openbsc[master]: Fix regression causing loss of static system-information mes... Message-ID: Review at https://gerrit.osmocom.org/3261 Fix regression causing loss of static system-information messages In commit 8b1a2f8cd7a81c6b8c7cdb0963dcf89de7c46100 we started to initialize bts->si_valid to 0. This means we are skipping the manually configured static system information. Instead, we have to initialize bts->si_valid to bts->si_mode_static, i.e. start with those that are static and not to be auto-generated. Found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Closes: #2367 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/61/3261/1 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index ead21b4..1547255 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -139,7 +139,7 @@ bts->si_common.cell_sel_par.neci = bts->network->neci; /* Zero, forget the state of the SIs */ - bts->si_valid = 0; + bts->si_valid = bts->si_mode_static; /* First, we determine which of the SI messages we actually need */ -- To view, visit https://gerrit.osmocom.org/3261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 15 21:31:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 15 Jul 2017 21:31:35 +0000 Subject: [PATCH] openbsc[master]: Fix regression causing loss of static system-information mes... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3261 to look at the new patch set (#2). Fix regression causing loss of static system-information messages In commit 8b1a2f8cd7a81c6b8c7cdb0963dcf89de7c46100 we started to initialize bts->si_valid to 0. This means we are skipping the manually configured static system information. Instead, we have to initialize bts->si_valid to bts->si_mode_static, i.e. start with those that are static and not to be auto-generated. Found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Closes: #2367 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/61/3261/2 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index ead21b4..c17e4a7 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -138,8 +138,8 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; - /* Zero, forget the state of the SIs */ - bts->si_valid = 0; + /* Zero/forget the state of the dynamically computed SIs, leeping the static ones */ + bts->si_valid = bts->si_mode_static; /* First, we determine which of the SI messages we actually need */ -- To view, visit https://gerrit.osmocom.org/3261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 15 21:31:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 15 Jul 2017 21:31:36 +0000 Subject: [PATCH] openbsc[master]: gsm_bts_trx_set_system_infos(): Disable non-existing SI Message-ID: Review at https://gerrit.osmocom.org/3262 gsm_bts_trx_set_system_infos(): Disable non-existing SI If we previously had a given SI present/active, we must send a zero-length BCCH FILLING for that SI type to the BTS to stop it from further transmitting this SI. Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Closes: OS#2368 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/3262/1 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index c17e4a7..20d82a9 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -192,9 +192,13 @@ for (n = 0; n < n_si; n++) { i = gen_si[n]; + /* if we don't currently have this SI, we send a zero-length + * RSL BCCH FILLING / SACCH FILLING * in order to deactivate + * the SI, in case it might have previously been active */ if (!GSM_BTS_HAS_SI(bts, i)) - continue; - rc = rsl_si(trx, i, si_len[i]); + rc = rsl_si(trx, i, 0); + else + rc = rsl_si(trx, i, si_len[i]); if (rc < 0) return rc; } -- To view, visit https://gerrit.osmocom.org/3262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 15 21:58:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 15 Jul 2017 21:58:27 +0000 Subject: [PATCH] openbsc[master]: gsm_bts_trx_set_system_infos(): Disable non-existing SI In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3262 to look at the new patch set (#2). gsm_bts_trx_set_system_infos(): Disable non-existing SI If we previously had a given SI present/active, we must send a zero-length BCCH FILLING for that SI type to the BTS to stop it from further transmitting this SI. Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Closes: OS#2368 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 17 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/3262/2 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index c17e4a7..36531d2 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -103,8 +103,11 @@ struct gsm_bts *bts = trx->bts; int rc, j; - DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), - osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + if (si_len) { + DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), + osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + } else + DEBUGP(DRR, "SI%s: OFF\n", get_value_string(osmo_sitype_strs, i)); switch (i) { case SYSINFO_TYPE_5: @@ -112,14 +115,18 @@ case SYSINFO_TYPE_5ter: case SYSINFO_TYPE_6: rc = rsl_sacch_filling(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; case SYSINFO_TYPE_2quater: + if (si_len == 0) { + rc = rsl_bcch_info(trx, i, NULL, 0); + break; + } for (j = 0; j <= bts->si2q_count; j++) rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); break; default: - rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(trx, i, si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; } @@ -192,9 +199,13 @@ for (n = 0; n < n_si; n++) { i = gen_si[n]; + /* if we don't currently have this SI, we send a zero-length + * RSL BCCH FILLING / SACCH FILLING * in order to deactivate + * the SI, in case it might have previously been active */ if (!GSM_BTS_HAS_SI(bts, i)) - continue; - rc = rsl_si(trx, i, si_len[i]); + rc = rsl_si(trx, i, 0); + else + rc = rsl_si(trx, i, si_len[i]); if (rc < 0) return rc; } -- To view, visit https://gerrit.osmocom.org/3262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 15 21:58:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 15 Jul 2017 21:58:28 +0000 Subject: [PATCH] openbsc[master]: RSL: Allow disabling of BCCH/SACCH filling for given SI type Message-ID: Review at https://gerrit.osmocom.org/3263 RSL: Allow disabling of BCCH/SACCH filling for given SI type If we want to instruct the BTS to stop sending a given SI, we must be able to send the respective BCCH INFO / SACCH FILLING with a header but without any L3 data IE. This patch enables the related functions to do this whenever their data argument points to NULL. Change-Id: I88b85614951a108574f05db3b706884afe7e87a9 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/63/3263/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 6ae790f..f537cf2 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -245,12 +245,14 @@ && type == RSL_SYSTEM_INFO_13) { /* Ericsson proprietary encoding of SI13 */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, RSL_ERIC_SYSTEM_INFO_13); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); msgb_tv_put(msg, RSL_IE_ERIC_BCCH_MAPPING, 0x00); } else { /* Normal encoding */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); } msg->dst = trx->rsl_link; @@ -269,7 +271,8 @@ ch->msg_type = RSL_MT_SACCH_FILL; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = trx->rsl_link; @@ -288,7 +291,8 @@ dh->chan_nr = chan_nr; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = lchan->ts->trx->rsl_link; -- To view, visit https://gerrit.osmocom.org/3263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88b85614951a108574f05db3b706884afe7e87a9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Sun Jul 16 19:53:48 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 19:53:48 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <596bc460b5863_393a40af884380ad@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 223s] | This file was extended by libosmocore config.st[ 206.232123] serial8250: too much work for irq4 [ 223s] atus 0.9.6.20170716, which was [ 223s] | generated by GNU Autoconf 2.69. Invocation command line was [ 223s] | [ 223s] | CONFIG_FILES = [ 223s] | CONFIG_HEADERS = [ 223s] | CONFIG_LINKS = [ 223s] | CONFIG_COMMANDS = [ 223s] | $ ./config.status Doxyfile.core [ 223s] | [ 223s] | on build33 [ 223s] | [ 223s] | config.status:1171: creating Doxyfile.core [ 223s] [ 223s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 223s] make[1]: *** [override_dh_auto_test] Error 1 [ 223s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 223s] debian/rules:15: recipe for target 'build' failed [ 223s] make: *** [build] Error 2 [ 223s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 223s] [ 223s] build33 failed "build libosmocore_0.9.6.20170716.dsc" at Sun Jul 16 19:53:36 UTC 2017. [ 223s] [ 223s] ### VM INTERACTION START ### [ 226s] [ 209.514128] reboot: Power down [ 228s] ### VM INTERACTION END ### [ 228s] [ 228s] build33 failed "build libosmocore_0.9.6.20170716.dsc" at Sun Jul 16 19:53:41 UTC 2017. [ 228s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 16 19:54:07 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 19:54:07 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <596bc46134f92_393a40af884381ce@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 202s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 202s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 202s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 202s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 202s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 202s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 202s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 202s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 202s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 202s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 202s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 202s] -Success [ 202s] ./testsuite.at:63: exit code was 132, expected 0 [ 202s] 10. testsuite.at:60: 10. coding (testsuite.at:60): FAILED (testsuite.at:63) [ 202s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 202s] make[1]: *** [override_dh_auto_test] Error 1 [ 202s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 202s] debian/rules:15: recipe for target 'build' failed [ 202s] make: *** [build] Error 2 [ 202s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 202s] [ 202s] cumulus3 failed "build libosmocore_0.9.6.20170716.dsc" at Sun Jul 16 19:53:45 UTC 2017. [ 202s] [ 202s] ### VM INTERACTION START ### [ 205s] [ 190.723642] reboot: Power down [ 205s] ### VM INTERACTION END ### [ 205s] [ 205s] cumulus3 failed "build libosmocore_0.9.6.20170716.dsc" at Sun Jul 16 19:53:49 UTC 2017. [ 205s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 16 20:02:58 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 20:02:58 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <596bc67f301dd_393a40af8843865f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 135s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 135s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 135s] make[4]: Nothing to be done for 'install-exec-am'. [ 135s] make[4]: Nothing to be done for 'install-data-am'. [ 135s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 135s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 135s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 135s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 135s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 135s] make[3]: Nothing to be done for 'install-exec-am'. [ 135s] make[3]: Nothing to be done for 'install-data-am'. [ 135s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 135s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 135s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 135s] dh_install -O--fail-missing [ 135s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 135s] dh_install: missing files, aborting [ 135s] debian/rules:12: recipe for target 'binary' failed [ 135s] make: *** [binary] Error 2 [ 135s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 135s] [ 135s] cloud106 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:02:43 UTC 2017. [ 135s] [ 135s] ### VM INTERACTION START ### [ 138s] [ 117.308097] reboot: Power down [ 140s] ### VM INTERACTION END ### [ 140s] [ 140s] cloud106 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:02:48 UTC 2017. [ 140s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 16 20:04:41 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 20:04:41 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <596bc6f3eed67_393a40af8843872@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 103s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 103s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 103s] make[4]: Nothing to be done for 'install-exec-am'. [ 103s] make[4]: Nothing to be done for 'install-data-am'. [ 103s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 103s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 103s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 103s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 103s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 103s] make[3]: Nothing to be done for 'install-exec-am'. [ 103s] make[3]: Nothing to be done for 'install-data-am'. [ 103s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 103s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 103s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 103s] dh_install -O--fail-missing [ 103s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 103s] dh_install: missing files, aborting [ 103s] debian/rules:12: recipe for target 'binary' failed [ 103s] make: *** [binary] Error 2 [ 103s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 103s] [ 103s] lamb09 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:04:35 UTC 2017. [ 103s] [ 103s] ### VM INTERACTION START ### [ 106s] [ 93.148721] reboot: Power down [ 106s] ### VM INTERACTION END ### [ 106s] [ 106s] lamb09 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:04:39 UTC 2017. [ 106s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 16 20:05:32 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 20:05:32 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <596bc7147c6d4_393a40af88439159@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 122s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 122s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 122s] make[4]: Nothing to be done for 'install-exec-am'. [ 122s] make[4]: Nothing to be done for 'install-data-am'. [ 122s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 122s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 122s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 122s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 122s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 122s] make[3]: Nothing to be done for 'install-exec-am'. [ 122s] make[3]: Nothing to be done for 'install-data-am'. [ 122s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 122s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 122s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 122s] dh_install -O--fail-missing [ 122s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 122s] dh_install: missing files, aborting [ 122s] debian/rules:12: recipe for target 'binary' failed [ 122s] make: *** [binary] Error 2 [ 122s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 122s] [ 122s] build32 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:05:16 UTC 2017. [ 122s] [ 122s] ### VM INTERACTION START ### [ 125s] [ 107.999558] reboot: Power down [ 126s] ### VM INTERACTION END ### [ 126s] [ 126s] build32 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:05:19 UTC 2017. [ 126s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 16 20:06:23 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 20:06:23 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <596bc74ddf277_393a40af8843954a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 152s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 152s] make[4]: Nothing to be done for 'install-exec-am'. [ 152s] make[4]: Nothing to be done for 'install-data-am'. [ 152s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 152s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 152s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 152s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 152s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 152s] make[3]: Nothing to be done for 'install-exec-am'. [ 152s] make[3]: Nothing to be done for 'install-data-am'. [ 152s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 152s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 152s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 152s] dh_install -O--fail-missing [ 152s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 152s] dh_install: missing files, aborting [ 152s] debian/rules:12: recipe for target 'binary' failed [ 152s] make: *** [binary] Error 2 [ 152s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 152s] [ 152s] cloud103 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:06:16 UTC 2017. [ 152s] [ 152s] ### VM INTERACTION START ### [ 153s] Powering off. [ 153s] [ 129.000862] reboot: Power down [ 155s] ### VM INTERACTION END ### [ 155s] [ 155s] cloud103 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:06:20 UTC 2017. [ 155s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 16 20:06:40 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 20:06:40 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <596bc76c6fb46_393a40af884396ac@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 77s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 77s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 77s] make[4]: Nothing to be done for 'install-exec-am'. [ 77s] make[4]: Nothing to be done for 'install-data-am'. [ 77s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 77s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 77s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 77s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 77s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 77s] make[3]: Nothing to be done for 'install-exec-am'. [ 77s] make[3]: Nothing to be done for 'install-data-am'. [ 77s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 77s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 77s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 77s] dh_install -O--fail-missing [ 77s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 77s] dh_install: missing files, aborting [ 77s] debian/rules:12: recipe for target 'binary' failed [ 77s] make: *** [binary] Error 2 [ 77s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 77s] [ 77s] build77 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:06:31 UTC 2017. [ 77s] [ 77s] ### VM INTERACTION START ### [ 80s] [ 70.520716] reboot: Power down [ 80s] ### VM INTERACTION END ### [ 80s] [ 80s] build77 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:06:34 UTC 2017. [ 80s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 16 20:07:31 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 20:07:31 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <596bc78b1d682_393a40af884397b5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 134s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 134s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 134s] make[4]: Nothing to be done for 'install-exec-am'. [ 134s] make[4]: Nothing to be done for 'install-data-am'. [ 134s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 134s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 134s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 134s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 134s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 134s] make[3]: Nothing to be done for 'install-exec-am'. [ 134s] make[3]: Nothing to be done for 'install-data-am'. [ 134s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 134s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 134s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 134s] dh_install -O--fail-missing [ 134s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 134s] dh_install: missing files, aborting [ 134s] debian/rules:12: recipe for target 'binary' failed [ 134s] make: *** [binary] Error 2 [ 134s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 134s] [ 134s] cloud119 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:07:20 UTC 2017. [ 134s] [ 134s] ### VM INTERACTION START ### [ 137s] [ 115.794092] reboot: Power down [ 139s] ### VM INTERACTION END ### [ 139s] [ 139s] cloud119 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:07:25 UTC 2017. [ 139s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 16 20:08:07 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 20:08:07 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <596bc7aa300e1_393a40af884400b2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 153s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 153s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 153s] make[4]: Nothing to be done for 'install-exec-am'. [ 153s] make[4]: Nothing to be done for 'install-data-am'. [ 153s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 153s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 153s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 153s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 153s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 153s] make[3]: Nothing to be done for 'install-exec-am'. [ 153s] make[3]: Nothing to be done for 'install-data-am'. [ 153s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 153s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 153s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 153s] dh_install -O--fail-missing [ 153s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 153s] dh_install: missing files, aborting [ 153s] debian/rules:12: recipe for target 'binary' failed [ 153s] make: *** [binary] Error 2 [ 153s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 153s] [ 153s] cloud124 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:08:01 UTC 2017. [ 153s] [ 153s] ### VM INTERACTION START ### [ 156s] [ 135.073859] reboot: Power down [ 158s] ### VM INTERACTION END ### [ 158s] [ 158s] cloud124 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:08:06 UTC 2017. [ 158s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 16 20:12:07 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 16 Jul 2017 20:12:07 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/i586 In-Reply-To: References: Message-ID: <596bc8992f637_393a40af88440274@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 121s] make[3]: Entering directory '/usr/src/packages/BUILD/tests' [ 121s] make[4]: Entering directory '/usr/src/packages/BUILD/tests' [ 121s] make[4]: Nothing to be done for 'install-exec-am'. [ 121s] make[4]: Nothing to be done for 'install-data-am'. [ 121s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 121s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 121s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 121s] make[2]: Entering directory '/usr/src/packages/BUILD' [ 121s] make[3]: Entering directory '/usr/src/packages/BUILD' [ 121s] make[3]: Nothing to be done for 'install-exec-am'. [ 121s] make[3]: Nothing to be done for 'install-data-am'. [ 121s] make[3]: Leaving directory '/usr/src/packages/BUILD' [ 121s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 121s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 121s] dh_install -O--fail-missing [ 121s] dh_install: usr/bin/osmo-bts-virtual exists in debian/tmp but is not installed to anywhere [ 121s] dh_install: missing files, aborting [ 121s] debian/rules:12: recipe for target 'binary' failed [ 121s] make: *** [binary] Error 2 [ 121s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 121s] [ 121s] lamb66 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:11:50 UTC 2017. [ 121s] [ 121s] ### VM INTERACTION START ### [ 124s] [ 108.984168] reboot: Power down [ 124s] ### VM INTERACTION END ### [ 124s] [ 124s] lamb66 failed "build osmo-bts_0.5.0.20170716.dsc" at Sun Jul 16 20:11:54 UTC 2017. [ 124s] -- 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 Jul 16 21:12:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 16 Jul 2017 21:12:49 +0000 Subject: openbsc[master]: Fix regression causing loss of static system-information mes... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 16 21:13:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 16 Jul 2017 21:13:24 +0000 Subject: openbsc[master]: RSL: Allow disabling of BCCH/SACCH filling for given SI type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I88b85614951a108574f05db3b706884afe7e87a9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 16 21:13:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 16 Jul 2017 21:13:26 +0000 Subject: [MERGED] openbsc[master]: RSL: Allow disabling of BCCH/SACCH filling for given SI type In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RSL: Allow disabling of BCCH/SACCH filling for given SI type ...................................................................... RSL: Allow disabling of BCCH/SACCH filling for given SI type If we want to instruct the BTS to stop sending a given SI, we must be able to send the respective BCCH INFO / SACCH FILLING with a header but without any L3 data IE. This patch enables the related functions to do this whenever their data argument points to NULL. Change-Id: I88b85614951a108574f05db3b706884afe7e87a9 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 8 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 6ae790f..f537cf2 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -245,12 +245,14 @@ && type == RSL_SYSTEM_INFO_13) { /* Ericsson proprietary encoding of SI13 */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, RSL_ERIC_SYSTEM_INFO_13); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); msgb_tv_put(msg, RSL_IE_ERIC_BCCH_MAPPING, 0x00); } else { /* Normal encoding */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); } msg->dst = trx->rsl_link; @@ -269,7 +271,8 @@ ch->msg_type = RSL_MT_SACCH_FILL; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = trx->rsl_link; @@ -288,7 +291,8 @@ dh->chan_nr = chan_nr; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = lchan->ts->trx->rsl_link; -- To view, visit https://gerrit.osmocom.org/3263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I88b85614951a108574f05db3b706884afe7e87a9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 16 21:13:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 16 Jul 2017 21:13:29 +0000 Subject: [MERGED] openbsc[master]: Fix regression causing loss of static system-information mes... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix regression causing loss of static system-information messages ...................................................................... Fix regression causing loss of static system-information messages In commit 8b1a2f8cd7a81c6b8c7cdb0963dcf89de7c46100 we started to initialize bts->si_valid to 0. This means we are skipping the manually configured static system information. Instead, we have to initialize bts->si_valid to bts->si_mode_static, i.e. start with those that are static and not to be auto-generated. Found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Closes: #2367 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index ead21b4..c17e4a7 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -138,8 +138,8 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; - /* Zero, forget the state of the SIs */ - bts->si_valid = 0; + /* Zero/forget the state of the dynamically computed SIs, leeping the static ones */ + bts->si_valid = bts->si_mode_static; /* First, we determine which of the SI messages we actually need */ -- To view, visit https://gerrit.osmocom.org/3261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 16 21:14:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 16 Jul 2017 21:14:28 +0000 Subject: libosmocore[master]: extend osmo_sysinfo_type with missing SYSINFO_TYPE In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I693cabe1a3b00a8c4198f7a4a1c647c5d7dc6c41 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 16 21:14:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 16 Jul 2017 21:14:55 +0000 Subject: [MERGED] libosmocore[master]: extend osmo_sysinfo_type with missing SYSINFO_TYPE In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: extend osmo_sysinfo_type with missing SYSINFO_TYPE ...................................................................... extend osmo_sysinfo_type with missing SYSINFO_TYPE The list should now be complete up to Releae 14 Change-Id: I693cabe1a3b00a8c4198f7a4a1c647c5d7dc6c41 --- M include/osmocom/gsm/sysinfo.h 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/sysinfo.h b/include/osmocom/gsm/sysinfo.h index 8e26f99..11bb268 100644 --- a/include/osmocom/gsm/sysinfo.h +++ b/include/osmocom/gsm/sysinfo.h @@ -36,7 +36,12 @@ SYSINFO_TYPE_5ter, SYSINFO_TYPE_EMO, SYSINFO_TYPE_MEAS_INFO, - /* FIXME all the various bis and ter */ + SYSINFO_TYPE_13alt, + SYSINFO_TYPE_15, + SYSINFO_TYPE_2n, + SYSINFO_TYPE_21, + SYSINFO_TYPE_22, + SYSINFO_TYPE_23, _MAX_SYSINFO_TYPE }; -- To view, visit https://gerrit.osmocom.org/3260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I693cabe1a3b00a8c4198f7a4a1c647c5d7dc6c41 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 16 21:15:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 16 Jul 2017 21:15:12 +0000 Subject: osmo-bts[master]: Fix .deb build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ca7eb51019247eb95c6bac752d6e2c4406ce5a2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 16 21:15:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 16 Jul 2017 21:15:37 +0000 Subject: [MERGED] osmo-bts[master]: Fix .deb build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix .deb build ...................................................................... Fix .deb build Recent introduction of VIRT-PHY broke .deb build. Fix it by installing osmo-bts-virtual as part of Debian package. Change-Id: I1ca7eb51019247eb95c6bac752d6e2c4406ce5a2 --- M debian/osmo-bts-trx.install 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-bts-trx.install b/debian/osmo-bts-trx.install index 92d524c..5c34bef 100644 --- a/debian/osmo-bts-trx.install +++ b/debian/osmo-bts-trx.install @@ -1 +1,2 @@ usr/bin/osmo-bts-trx +usr/bin/osmo-bts-virtual -- To view, visit https://gerrit.osmocom.org/3251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1ca7eb51019247eb95c6bac752d6e2c4406ce5a2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jul 17 09:35:59 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 17 Jul 2017 09:35:59 +0000 Subject: [PATCH] libosmo-sccp[master]: cosmetic: fixup comment Message-ID: Review at https://gerrit.osmocom.org/3264 cosmetic: fixup comment Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d --- M src/osmo_ss7_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/64/3264/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b06f554..685df29 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1195,7 +1195,7 @@ return CMD_SUCCESS; } -/* Create a new addressbook entry and switch nodes */ +/* Delet an addressbook entry */ DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, "no sccp-address NAME", NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") -- To view, visit https://gerrit.osmocom.org/3264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 17 09:36:00 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 17 Jul 2017 09:36:00 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: enable global addressbook search Message-ID: Review at https://gerrit.osmocom.org/3265 sccp: enable global addressbook search The sccp-addressbook only allows defining addresses for a specific ss7 instance. It is not possible to use an sscp-address, that is defined in the one ss7 instance in another ss7 instance. Add a second global list where all sscp-addresses are added, regardless on which instance they are defined. Fixup the search functions so that they search the global list when the ss7 instance pointer is set to NULL Change-Id: I5acc1e5abc3b3081149a9f476038e4e53d23b763 --- M src/osmo_ss7_vty.c 1 file changed, 35 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/65/3265/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 685df29..17e0644 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -934,6 +934,7 @@ /* SCCP addressbook */ struct osmo_sccp_addr_entry { struct llist_head list; + struct llist_head list_global; struct osmo_ss7_instance *inst; char name[512]; struct osmo_sccp_addr addr; @@ -951,22 +952,35 @@ 1, }; +/* A global list that holds all addressbook entries at once + * (see also .cfg in struct osmo_ss7_instance) */ +LLIST_HEAD(sccp_address_book_global); + /* Pick an SCCP address entry from the addressbook by its name */ -struct osmo_sccp_addr_entry *addr_entry_by_name(const char *name, - const struct osmo_ss7_instance - *inst) +static struct osmo_sccp_addr_entry +*addr_entry_by_name(const char *name, const struct osmo_ss7_instance *inst) { struct osmo_sccp_addr_entry *entry; - llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { - if (strcmp(entry->name, name) == 0) - return entry; + + if (inst == NULL) { + llist_for_each_entry(entry, &sccp_address_book_global, + list_global) { + if (strcmp(entry->name, name) == 0) + return entry; + } + } else { + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) + return entry; + } } + return NULL; } /*! \brief Lookup an SCCP address from the addressbook by its name. * \param[in] lookup-name of the address to lookup - * \param[in] ss7 instance + * \param[in] ss7 instance (NULL to search global) * \returns SCCP address; NULL on error */ struct osmo_sccp_addr *osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance @@ -983,15 +997,23 @@ /*! \brief Reverse lookup the lookup-name of a specified SCCP address. * \param[in] name of the address to lookup - * \param[in] ss7 instance + * \param[in] ss7 instance (NULL to search global) * \returns char pointer to the lookup-name; NULL on error */ char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, const struct osmo_ss7_instance *ss7) { struct osmo_sccp_addr_entry *entry; - llist_for_each_entry(entry, &ss7->cfg.sccp_address_book, list) { - if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) - return entry->name; + + if (ss7 == NULL) { + llist_for_each_entry(entry, &sccp_address_book_global, list_global) { + if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) + return entry->name; + } + } else { + llist_for_each_entry(entry, &ss7->cfg.sccp_address_book, list) { + if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) + return entry->name; + } } return NULL; @@ -1185,6 +1207,7 @@ entry = talloc_zero(inst, struct osmo_sccp_addr_entry); osmo_strlcpy(entry->name, name, sizeof(entry->name)); llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + llist_add_tail(&entry->list_global, &sccp_address_book_global); entry->addr.ri = OSMO_SCCP_RI_SSN_PC; } @@ -1207,6 +1230,7 @@ entry = addr_entry_by_name(name, inst); if (entry) { llist_del(&entry->list); + llist_del(&entry->list_global); talloc_free(entry); } else { vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/3265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5acc1e5abc3b3081149a9f476038e4e53d23b763 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jul 17 12:43:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 17 Jul 2017 12:43:46 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: osmo-gsm-tester: jenkins fixes: install JDK, SSH instructions Message-ID: Review at https://gerrit.osmocom.org/3266 osmo-gsm-tester: jenkins fixes: install JDK, SSH instructions Add instructions to install Java JDK for jenkins build slave. Minor fixes to SSH key instructions. Change-Id: Ib2c1adc2ddee3be016e4d253451593b19dbe133a --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/66/3266/1 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index b703498..0c69dcd 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -64,6 +64,15 @@ useradd -m jenkins ---- +==== Install Java on Main Unit + +To be able to launch the Jenkins build slave, a Java RE must be available on +the main unit. For example: + +---- +apt-get install default-jdk +---- + ==== Allow SSH Access from Jenkins Master Create an SSH keypair to be used for login on the osmo-gsm-tester. This may be @@ -73,6 +82,7 @@ ---- # su jenkins +$ mkdir -p /usr/local/jenkins/keys $ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/jenkins/.ssh/id_rsa): /usr/local/jenkins/keys/osmo-gsm-tester-rnd @@ -122,7 +132,7 @@ ---- su jenkins main_unit_ip=10.9.8.7 -ssh jenkins@$main_unit_ip +ssh -i /usr/local/jenkins/keys/osmo-gsm-tester-rnd jenkins@$main_unit_ip exit ---- -- To view, visit https://gerrit.osmocom.org/3266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2c1adc2ddee3be016e4d253451593b19dbe133a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 17 15:39:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 17 Jul 2017 15:39:34 +0000 Subject: [PATCH] osmo-bts[master]: Unify *.service files Message-ID: Review at https://gerrit.osmocom.org/3267 Unify *.service files * unify description * provide common BTS-independent aliases Change-Id: Ia067dc5b0bdef07b90ab57f89e8ba6b2a794eb4a --- M contrib/osmo-bts-lc15.service M contrib/osmo-bts-sysmo.service M contrib/sysmobts-mgr.service 3 files changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/3267/1 diff --git a/contrib/osmo-bts-lc15.service b/contrib/osmo-bts-lc15.service index a30d50f..ab7def8 100644 --- a/contrib/osmo-bts-lc15.service +++ b/contrib/osmo-bts-lc15.service @@ -18,3 +18,4 @@ [Install] WantedBy=multi-user.target +Alias=osmo-bts.service diff --git a/contrib/osmo-bts-sysmo.service b/contrib/osmo-bts-sysmo.service index bbb2bef..65b1f00 100644 --- a/contrib/osmo-bts-sysmo.service +++ b/contrib/osmo-bts-sysmo.service @@ -1,5 +1,5 @@ [Unit] -Description=sysmocom sysmoBTS +Description=osmo-bts for sysmocom sysmoBTS [Service] Type=simple @@ -18,3 +18,4 @@ [Install] WantedBy=multi-user.target Alias=sysmobts.service +Alias=osmo-bts.service diff --git a/contrib/sysmobts-mgr.service b/contrib/sysmobts-mgr.service index 182e306..151c821 100644 --- a/contrib/sysmobts-mgr.service +++ b/contrib/sysmobts-mgr.service @@ -1,5 +1,5 @@ [Unit] -Description=sysmocom %p manager +Description=osmo-bts manager for %p [Service] Type=simple @@ -9,4 +9,4 @@ [Install] WantedBy=multi-user.target - +Alias=osmo-bts-mgr.service -- To view, visit https://gerrit.osmocom.org/3267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia067dc5b0bdef07b90ab57f89e8ba6b2a794eb4a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jul 17 15:39:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 17 Jul 2017 15:39:34 +0000 Subject: [PATCH] osmo-bts[master]: lc15: cleanup board parameters reading Message-ID: Review at https://gerrit.osmocom.org/3268 lc15: cleanup board parameters reading * move common code into separate function * print error similar to parameter reading code Change-Id: Icf3285d7bb921d212cb8945e835be2c81189fb87 Related: SYS#3679 --- M src/osmo-bts-litecell15/misc/lc15bts_bid.c 1 file changed, 25 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/68/3268/1 diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index 06a126a..ba2037a 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -24,12 +24,13 @@ #include #include #include +#include #include "lc15bts_bid.h" #define BOARD_REV_SYSFS "/var/lc15/platform/revision" #define BOARD_OPT_SYSFS "/var/lc15/platform/option" - + static const int option_type_mask[_NUM_OPTION_TYPES] = { [LC15BTS_OPTION_OCXO] = 0x07, [LC15BTS_OPTION_FPGA] = 0x03, @@ -72,6 +73,21 @@ static int board_rev = -1; static int board_option = -1; +static inline bool read_board(const char *src, const char *spec, void *dst) +{ + FILE *fp = fopen(src, "r"); + if (!fp) { + fprintf(stderr, "Failed to open %s due to '%s' error\n", src, strerror(errno)); + return false; + } + + if (fscanf(fp, spec, dst) != 1) { + fclose(fp); + fprintf(stderr, "Failed to read %s due to '%s' error\n", src, strerror(errno)); + return false; + } + fclose(fp); +} int lc15bts_rev_get(void) { @@ -82,14 +98,8 @@ return board_rev; } - fp = fopen(BOARD_REV_SYSFS, "r"); - if (fp == NULL) return -1; - - if (fscanf(fp, "%c", &rev) != 1) { - fclose( fp ); - return -1; - } - fclose(fp); + if (!read_board(BOARD_REV_SYSFS, "%c", &rev)) + return -1; board_rev = rev; return board_rev; @@ -99,22 +109,15 @@ { FILE *fp; int opt; + bool rc; + if (board_option != -1) + return board_option; - if (board_option == -1) { - fp = fopen(BOARD_OPT_SYSFS, "r"); - if (fp == NULL) { - return -1; - } - - if (fscanf(fp, "%X", &opt) != 1) { - fclose( fp ); - return -1; - } - fclose(fp); + if (!read_board(BOARD_OPT_SYSFS, "%X", &opt)) + return -1; - board_option = opt; - } + board_option = opt; return board_option; } -- To view, visit https://gerrit.osmocom.org/3268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf3285d7bb921d212cb8945e835be2c81189fb87 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jul 17 17:56:34 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 17 Jul 2017 17:56:34 +0000 Subject: [PATCH] libosmocore[master]: Test commit to see if gerrit still triggers... Message-ID: Review at https://gerrit.osmocom.org/3269 Test commit to see if gerrit still triggers... Change-Id: Icfb83fe42d4e0b1dd693307ca97796bbfa017130 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/69/3269/1 -- To view, visit https://gerrit.osmocom.org/3269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icfb83fe42d4e0b1dd693307ca97796bbfa017130 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Mon Jul 17 18:26:16 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 17 Jul 2017 18:26:16 +0000 Subject: [ABANDON] libosmocore[master]: Test commit to see if gerrit still triggers... In-Reply-To: References: Message-ID: Holger Freyther has abandoned this change. Change subject: Test commit to see if gerrit still triggers... ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Icfb83fe42d4e0b1dd693307ca97796bbfa017130 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 17 21:24:40 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 17 Jul 2017 21:24:40 +0000 Subject: libosmocore[master]: Fix malformed Abis/RSL messages In-Reply-To: References: Message-ID: Patch Set 1: Looks like the same patch as https://gerrit.osmocom.org/#/c/266/. I had hoped that a company selling BTS with our software could be motivated to fix a testcase error. ;) -- To view, visit https://gerrit.osmocom.org/3258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibb116214e8b1798d65a8b0917150496a3c14f344 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 17 21:55:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 17 Jul 2017 21:55:39 +0000 Subject: openbsc[master]: gsm_bts_trx_set_system_infos(): Disable non-existing SI In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 17 21:55:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 17 Jul 2017 21:55:41 +0000 Subject: [MERGED] openbsc[master]: gsm_bts_trx_set_system_infos(): Disable non-existing SI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm_bts_trx_set_system_infos(): Disable non-existing SI ...................................................................... gsm_bts_trx_set_system_infos(): Disable non-existing SI If we previously had a given SI present/active, we must send a zero-length BCCH FILLING for that SI type to the BTS to stop it from further transmitting this SI. Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Closes: OS#2368 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 17 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index c17e4a7..36531d2 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -103,8 +103,11 @@ struct gsm_bts *bts = trx->bts; int rc, j; - DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), - osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + if (si_len) { + DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), + osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + } else + DEBUGP(DRR, "SI%s: OFF\n", get_value_string(osmo_sitype_strs, i)); switch (i) { case SYSINFO_TYPE_5: @@ -112,14 +115,18 @@ case SYSINFO_TYPE_5ter: case SYSINFO_TYPE_6: rc = rsl_sacch_filling(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; case SYSINFO_TYPE_2quater: + if (si_len == 0) { + rc = rsl_bcch_info(trx, i, NULL, 0); + break; + } for (j = 0; j <= bts->si2q_count; j++) rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); break; default: - rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(trx, i, si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; } @@ -192,9 +199,13 @@ for (n = 0; n < n_si; n++) { i = gen_si[n]; + /* if we don't currently have this SI, we send a zero-length + * RSL BCCH FILLING / SACCH FILLING * in order to deactivate + * the SI, in case it might have previously been active */ if (!GSM_BTS_HAS_SI(bts, i)) - continue; - rc = rsl_si(trx, i, si_len[i]); + rc = rsl_si(trx, i, 0); + else + rc = rsl_si(trx, i, si_len[i]); if (rc < 0) return rc; } -- To view, visit https://gerrit.osmocom.org/3262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 17 22:04:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 17 Jul 2017 22:04:35 +0000 Subject: [PATCH] openbsc[master]: gtphob: check for missing result of rate_ctr_group_alloc() Message-ID: Review at https://gerrit.osmocom.org/3270 gtphob: check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. The recent change (Id I7dad4a4d52fe05f6b990359841b4408df5990e21) seems to have missed one instance, so let's follow-up. Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Related: OS#2361 --- M openbsc/src/gprs/gtphub.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3270/1 diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 211018b..5e7520e 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -2708,6 +2708,10 @@ pp->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx, >phub_ctrg_io_desc, 0); + if (!pp->counters_io) { + talloc_free(pp); + return NULL; + } llist_add(&pp->entry, &a->ports); -- To view, visit https://gerrit.osmocom.org/3270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jul 18 07:59:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 07:59:41 +0000 Subject: libosmo-sccp[master]: cosmetic: fixup comment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3264/1/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 1198: /* Delet an addressbook entry */ Delete -- To view, visit https://gerrit.osmocom.org/3264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 18 08:08:17 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 18 Jul 2017 08:08:17 +0000 Subject: [PATCH] libosmo-sccp[master]: cosmetic: fixup comment 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/3264 to look at the new patch set (#2). cosmetic: fixup comment Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d --- M src/osmo_ss7_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/64/3264/2 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b06f554..a2f520b 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1195,7 +1195,7 @@ return CMD_SUCCESS; } -/* Create a new addressbook entry and switch nodes */ +/* Delete an addressbook entry */ DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, "no sccp-address NAME", NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") -- To view, visit https://gerrit.osmocom.org/3264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 18 09:23:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 09:23:20 +0000 Subject: libosmo-sccp[master]: cosmetic: fixup comment In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 09:28:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 09:28:47 +0000 Subject: openbsc[master]: gtphob: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c 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 Tue Jul 18 09:28:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 09:28:49 +0000 Subject: [MERGED] openbsc[master]: gtphob: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtphob: check for missing result of rate_ctr_group_alloc() ...................................................................... gtphob: check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. The recent change (Id I7dad4a4d52fe05f6b990359841b4408df5990e21) seems to have missed one instance, so let's follow-up. Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Related: OS#2361 --- M openbsc/src/gprs/gtphub.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 211018b..5e7520e 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -2708,6 +2708,10 @@ pp->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx, >phub_ctrg_io_desc, 0); + if (!pp->counters_io) { + talloc_free(pp); + return NULL; + } llist_add(&pp->entry, &a->ports); -- To view, visit https://gerrit.osmocom.org/3270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c 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 Tue Jul 18 09:31:22 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 18 Jul 2017 09:31:22 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: command to set local ip of ASP Message-ID: Review at https://gerrit.osmocom.org/3271 vty: command to set local ip of ASP The local ip of an ASP can not be set, while the same is possible for the remote ip. Add VTY command to set the local ip of an ASP Change-Id: I115b87b08bdc4b07772b7afb9c25bc713e79945a --- M src/osmo_ss7_vty.c 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/71/3271/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b06f554..e79ca20 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -563,6 +563,16 @@ return CMD_SUCCESS; } +DEFUN(asp_local_ip, asp_local_ip_cmd, + "local-ip A.B.C.D", + "Specify Local IP Address of ASP\n" + "Local IP Address of ASP\n") +{ + struct osmo_ss7_asp *asp = vty->index; + osmo_talloc_replace_string(asp, &asp->cfg.local.host, argv[0]); + return CMD_SUCCESS; +} + DEFUN(asp_qos_clas, asp_qos_class_cmd, "qos-class <0-255>", "Specify QoS Class of ASP\n" @@ -1611,6 +1621,7 @@ install_element(L_CS7_NODE, &no_cs7_asp_cmd); install_element(L_CS7_ASP_NODE, &cfg_description_cmd); install_element(L_CS7_ASP_NODE, &asp_remote_ip_cmd); + install_element(L_CS7_ASP_NODE, &asp_local_ip_cmd); install_element(L_CS7_ASP_NODE, &asp_qos_class_cmd); install_element(L_CS7_ASP_NODE, &asp_block_cmd); install_element(L_CS7_ASP_NODE, &asp_shutdown_cmd); -- To view, visit https://gerrit.osmocom.org/3271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I115b87b08bdc4b07772b7afb9c25bc713e79945a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Jul 18 11:00:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 18 Jul 2017 11:00:57 +0000 Subject: libosmocore[master]: add DLMGCP logging category for libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 2: > I really would prefer not to have a system-installed library with a > "stable" API for MGCP based on the existing code. The alternative is to copy the previous internal libmgcp around. We would have copies in osmo-mgw, osmo-msc and osmo-bsc. osmo-msc uses MGCP client code that is separate from the main MGCP-GW implementation. Moving the MGCP client code to osmo-msc is still fairly reasonable. But when we want to also couple an MGCP-GW with each BSC, we also need that same code in osmo-bsc. osmo-bsc_nat is so far in osmo-bsc.git and makes extensive use of the libmgcp code. Copying that would be a large bit of code dup between osmo-mgw.git and osmo-bsc.git. Does it make sense to move osmo-bsc_nat to osmo-mgw.git?? I guess not, given the shared code with osmo-bsc. So far I tend to like having a separate library for X to avoid code dup, and you seem to be rather opposed to exposing API. We need to agree on a strategy. Are we really forced to keep the APIs "stable"? If yes, does it really hurt that much to do so? Is code dup less trouble? -- To view, visit https://gerrit.osmocom.org/3181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09c587e2d59472cbde852d467d457254746d9e67 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 11:42:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 11:42:14 +0000 Subject: [PATCH] osmo-bts[master]: lc15: cleanup board parameters reading In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3268 to look at the new patch set (#2). lc15: cleanup board parameters reading * move common code into separate function * print error similar to parameter reading code Change-Id: Icf3285d7bb921d212cb8945e835be2c81189fb87 Related: SYS#3728 --- M src/osmo-bts-litecell15/misc/lc15bts_bid.c 1 file changed, 25 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/68/3268/2 diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index 06a126a..ba2037a 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -24,12 +24,13 @@ #include #include #include +#include #include "lc15bts_bid.h" #define BOARD_REV_SYSFS "/var/lc15/platform/revision" #define BOARD_OPT_SYSFS "/var/lc15/platform/option" - + static const int option_type_mask[_NUM_OPTION_TYPES] = { [LC15BTS_OPTION_OCXO] = 0x07, [LC15BTS_OPTION_FPGA] = 0x03, @@ -72,6 +73,21 @@ static int board_rev = -1; static int board_option = -1; +static inline bool read_board(const char *src, const char *spec, void *dst) +{ + FILE *fp = fopen(src, "r"); + if (!fp) { + fprintf(stderr, "Failed to open %s due to '%s' error\n", src, strerror(errno)); + return false; + } + + if (fscanf(fp, spec, dst) != 1) { + fclose(fp); + fprintf(stderr, "Failed to read %s due to '%s' error\n", src, strerror(errno)); + return false; + } + fclose(fp); +} int lc15bts_rev_get(void) { @@ -82,14 +98,8 @@ return board_rev; } - fp = fopen(BOARD_REV_SYSFS, "r"); - if (fp == NULL) return -1; - - if (fscanf(fp, "%c", &rev) != 1) { - fclose( fp ); - return -1; - } - fclose(fp); + if (!read_board(BOARD_REV_SYSFS, "%c", &rev)) + return -1; board_rev = rev; return board_rev; @@ -99,22 +109,15 @@ { FILE *fp; int opt; + bool rc; + if (board_option != -1) + return board_option; - if (board_option == -1) { - fp = fopen(BOARD_OPT_SYSFS, "r"); - if (fp == NULL) { - return -1; - } - - if (fscanf(fp, "%X", &opt) != 1) { - fclose( fp ); - return -1; - } - fclose(fp); + if (!read_board(BOARD_OPT_SYSFS, "%X", &opt)) + return -1; - board_option = opt; - } + board_option = opt; return board_option; } -- To view, visit https://gerrit.osmocom.org/3268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf3285d7bb921d212cb8945e835be2c81189fb87 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 Tue Jul 18 12:05:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 12:05:49 +0000 Subject: [PATCH] osmo-bts[master]: lc15-mgr: update parameter write Message-ID: Review at https://gerrit.osmocom.org/3272 lc15-mgr: update parameter write Better match upstream lc15 code: * fsync on parameter write * use runtime dir for parameter storage Change-Id: Iac150bf2ebffc5fa9544b0f3b19cd647996fc8b6 Related: SYS#3728 --- M contrib/sysmobts-mgr.service M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h 3 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/72/3272/1 diff --git a/contrib/sysmobts-mgr.service b/contrib/sysmobts-mgr.service index 182e306..f5e244e 100644 --- a/contrib/sysmobts-mgr.service +++ b/contrib/sysmobts-mgr.service @@ -9,4 +9,3 @@ [Install] WantedBy=multi-user.target - diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index ab3e96b..13b0080 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -130,6 +130,8 @@ fclose(fp); return -EIO; } + + fsync(fp); fclose(fp); return 0; } @@ -161,6 +163,7 @@ rc = fwrite(buf, 1, size, fp); + fsync(fp); fclose(fp); return rc; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index b9fe740..dd869d3 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -4,7 +4,7 @@ #include #define FACTORY_ROM_PATH "/mnt/rom/factory" -#define USER_ROM_PATH "/mnt/rom/user" +#define USER_ROM_PATH "/mnt/storage/var/run/lc15bts-mgr" enum lc15bts_par { LC15BTS_PAR_TEMP_SUPPLY_MAX, -- To view, visit https://gerrit.osmocom.org/3272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac150bf2ebffc5fa9544b0f3b19cd647996fc8b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:08:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 12:08:53 +0000 Subject: [PATCH] osmo-bts[master]: lc15-mgr: update parameter read/write In-Reply-To: References: Message-ID: lc15-mgr: update parameter read/write Better match upstream lc15 code: * fsync on parameter write * use permanent storage directly for parameters Change-Id: Iac150bf2ebffc5fa9544b0f3b19cd647996fc8b6 Related: SYS#3728 --- M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h 2 files changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/72/3272/2 diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index ab3e96b..13b0080 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -130,6 +130,8 @@ fclose(fp); return -EIO; } + + fsync(fp); fclose(fp); return 0; } @@ -161,6 +163,7 @@ rc = fwrite(buf, 1, size, fp); + fsync(fp); fclose(fp); return rc; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index b9fe740..dd869d3 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -4,7 +4,7 @@ #include #define FACTORY_ROM_PATH "/mnt/rom/factory" -#define USER_ROM_PATH "/mnt/rom/user" +#define USER_ROM_PATH "/mnt/storage/var/run/lc15bts-mgr" enum lc15bts_par { LC15BTS_PAR_TEMP_SUPPLY_MAX, -- To view, visit https://gerrit.osmocom.org/3272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iac150bf2ebffc5fa9544b0f3b19cd647996fc8b6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:12:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 12:12:32 +0000 Subject: osmo-bts[master]: lc15: cleanup board parameters reading In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf3285d7bb921d212cb8945e835be2c81189fb87 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 Tue Jul 18 12:12:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 12:12:44 +0000 Subject: osmo-bts[master]: Unify *.service files In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia067dc5b0bdef07b90ab57f89e8ba6b2a794eb4a 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 Tue Jul 18 12:13:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 12:13:17 +0000 Subject: osmo-bts[master]: lc15-mgr: update parameter read/write In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac150bf2ebffc5fa9544b0f3b19cd647996fc8b6 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 Tue Jul 18 12:14:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 12:14:43 +0000 Subject: osmo-bts[master]: lc15-mgr: update parameter read/write In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3272/2//COMMIT_MSG Commit Message: Line 9: Better match upstream lc15 code: actually, it's not uptream. we are upstream. We match close r to the vendor fork from of a vendor who doesn't seem to care to merge his changes upstream :/ -- To view, visit https://gerrit.osmocom.org/3272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac150bf2ebffc5fa9544b0f3b19cd647996fc8b6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:15:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 12:15:54 +0000 Subject: osmo-bts[master]: lc15: add trx-calibration to example config In-Reply-To: References: Message-ID: Patch Set 1: Note: we use this as a default config for corresponding image. -- To view, visit https://gerrit.osmocom.org/3252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:16:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 12:16:13 +0000 Subject: [MERGED] osmo-bts[master]: Unify *.service files In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Unify *.service files ...................................................................... Unify *.service files * unify description * provide common BTS-independent aliases Change-Id: Ia067dc5b0bdef07b90ab57f89e8ba6b2a794eb4a --- M contrib/osmo-bts-lc15.service M contrib/osmo-bts-sysmo.service M contrib/sysmobts-mgr.service 3 files changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/osmo-bts-lc15.service b/contrib/osmo-bts-lc15.service index a30d50f..ab7def8 100644 --- a/contrib/osmo-bts-lc15.service +++ b/contrib/osmo-bts-lc15.service @@ -18,3 +18,4 @@ [Install] WantedBy=multi-user.target +Alias=osmo-bts.service diff --git a/contrib/osmo-bts-sysmo.service b/contrib/osmo-bts-sysmo.service index bbb2bef..65b1f00 100644 --- a/contrib/osmo-bts-sysmo.service +++ b/contrib/osmo-bts-sysmo.service @@ -1,5 +1,5 @@ [Unit] -Description=sysmocom sysmoBTS +Description=osmo-bts for sysmocom sysmoBTS [Service] Type=simple @@ -18,3 +18,4 @@ [Install] WantedBy=multi-user.target Alias=sysmobts.service +Alias=osmo-bts.service diff --git a/contrib/sysmobts-mgr.service b/contrib/sysmobts-mgr.service index 182e306..151c821 100644 --- a/contrib/sysmobts-mgr.service +++ b/contrib/sysmobts-mgr.service @@ -1,5 +1,5 @@ [Unit] -Description=sysmocom %p manager +Description=osmo-bts manager for %p [Service] Type=simple @@ -9,4 +9,4 @@ [Install] WantedBy=multi-user.target - +Alias=osmo-bts-mgr.service -- To view, visit https://gerrit.osmocom.org/3267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia067dc5b0bdef07b90ab57f89e8ba6b2a794eb4a 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: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:16:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 12:16:14 +0000 Subject: [MERGED] osmo-bts[master]: lc15: cleanup board parameters reading In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: lc15: cleanup board parameters reading ...................................................................... lc15: cleanup board parameters reading * move common code into separate function * print error similar to parameter reading code Change-Id: Icf3285d7bb921d212cb8945e835be2c81189fb87 Related: SYS#3728 --- M src/osmo-bts-litecell15/misc/lc15bts_bid.c 1 file changed, 25 insertions(+), 22 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index 06a126a..ba2037a 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -24,12 +24,13 @@ #include #include #include +#include #include "lc15bts_bid.h" #define BOARD_REV_SYSFS "/var/lc15/platform/revision" #define BOARD_OPT_SYSFS "/var/lc15/platform/option" - + static const int option_type_mask[_NUM_OPTION_TYPES] = { [LC15BTS_OPTION_OCXO] = 0x07, [LC15BTS_OPTION_FPGA] = 0x03, @@ -72,6 +73,21 @@ static int board_rev = -1; static int board_option = -1; +static inline bool read_board(const char *src, const char *spec, void *dst) +{ + FILE *fp = fopen(src, "r"); + if (!fp) { + fprintf(stderr, "Failed to open %s due to '%s' error\n", src, strerror(errno)); + return false; + } + + if (fscanf(fp, spec, dst) != 1) { + fclose(fp); + fprintf(stderr, "Failed to read %s due to '%s' error\n", src, strerror(errno)); + return false; + } + fclose(fp); +} int lc15bts_rev_get(void) { @@ -82,14 +98,8 @@ return board_rev; } - fp = fopen(BOARD_REV_SYSFS, "r"); - if (fp == NULL) return -1; - - if (fscanf(fp, "%c", &rev) != 1) { - fclose( fp ); - return -1; - } - fclose(fp); + if (!read_board(BOARD_REV_SYSFS, "%c", &rev)) + return -1; board_rev = rev; return board_rev; @@ -99,22 +109,15 @@ { FILE *fp; int opt; + bool rc; + if (board_option != -1) + return board_option; - if (board_option == -1) { - fp = fopen(BOARD_OPT_SYSFS, "r"); - if (fp == NULL) { - return -1; - } - - if (fscanf(fp, "%X", &opt) != 1) { - fclose( fp ); - return -1; - } - fclose(fp); + if (!read_board(BOARD_OPT_SYSFS, "%X", &opt)) + return -1; - board_option = opt; - } + board_option = opt; return board_option; } -- To view, visit https://gerrit.osmocom.org/3268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf3285d7bb921d212cb8945e835be2c81189fb87 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:17:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 12:17:26 +0000 Subject: libosmo-sccp[master]: vty: command to set local ip of ASP In-Reply-To: References: Message-ID: Patch Set 1: please clarify when/how this is used. The existing VTY interface is designed to be compatible with the Cisco ITP. The specification of the local IP address (on a SG/STP) is done at the time you bind the given M3UA or SUA listener process, see xua_local_ip_cmd Is this command intended to be used in ASP-client mode? If yes, please state it here. Also, it probably would not work in SG/STP mode, so we should make sure not to offer/install it in that case? -- To view, visit https://gerrit.osmocom.org/3271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I115b87b08bdc4b07772b7afb9c25bc713e79945a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Jul 18 12:20:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 12:20:20 +0000 Subject: libosmo-sccp[master]: vty: make addressbook available for _sg and _asp In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 5 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:20:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 12:20:53 +0000 Subject: libosmo-sccp[master]: vty: make addressbook available for _sg and _asp In-Reply-To: References: Message-ID: Patch Set 5: waiting for neels to see if his comments are adressed. The global list for globally unique name lookup will be a separate patch, or what is the plan here? -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 5 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:21:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 12:21:13 +0000 Subject: osmo-gsm-manuals[master]: osmo-gsm-tester: jenkins fixes: install JDK, SSH instructions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib2c1adc2ddee3be016e4d253451593b19dbe133a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:21:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 12:21:14 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: osmo-gsm-tester: jenkins fixes: install JDK, SSH instructions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-gsm-tester: jenkins fixes: install JDK, SSH instructions ...................................................................... osmo-gsm-tester: jenkins fixes: install JDK, SSH instructions Add instructions to install Java JDK for jenkins build slave. Minor fixes to SSH key instructions. Change-Id: Ib2c1adc2ddee3be016e4d253451593b19dbe133a --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 11 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index b703498..0c69dcd 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -64,6 +64,15 @@ useradd -m jenkins ---- +==== Install Java on Main Unit + +To be able to launch the Jenkins build slave, a Java RE must be available on +the main unit. For example: + +---- +apt-get install default-jdk +---- + ==== Allow SSH Access from Jenkins Master Create an SSH keypair to be used for login on the osmo-gsm-tester. This may be @@ -73,6 +82,7 @@ ---- # su jenkins +$ mkdir -p /usr/local/jenkins/keys $ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/jenkins/.ssh/id_rsa): /usr/local/jenkins/keys/osmo-gsm-tester-rnd @@ -122,7 +132,7 @@ ---- su jenkins main_unit_ip=10.9.8.7 -ssh jenkins@$main_unit_ip +ssh -i /usr/local/jenkins/keys/osmo-gsm-tester-rnd jenkins@$main_unit_ip exit ---- -- To view, visit https://gerrit.osmocom.org/3266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib2c1adc2ddee3be016e4d253451593b19dbe133a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 18 12:49:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 12:49:50 +0000 Subject: [MERGED] osmo-bts[master]: lc15-mgr: update parameter read/write In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: lc15-mgr: update parameter read/write ...................................................................... lc15-mgr: update parameter read/write Better match upstream lc15 code: * fsync on parameter write * use permanent storage directly for parameters Change-Id: Iac150bf2ebffc5fa9544b0f3b19cd647996fc8b6 Related: SYS#3728 --- M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h 2 files changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index ab3e96b..13b0080 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -130,6 +130,8 @@ fclose(fp); return -EIO; } + + fsync(fp); fclose(fp); return 0; } @@ -161,6 +163,7 @@ rc = fwrite(buf, 1, size, fp); + fsync(fp); fclose(fp); return rc; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index b9fe740..dd869d3 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -4,7 +4,7 @@ #include #define FACTORY_ROM_PATH "/mnt/rom/factory" -#define USER_ROM_PATH "/mnt/rom/user" +#define USER_ROM_PATH "/mnt/storage/var/run/lc15bts-mgr" enum lc15bts_par { LC15BTS_PAR_TEMP_SUPPLY_MAX, -- To view, visit https://gerrit.osmocom.org/3272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac150bf2ebffc5fa9544b0f3b19cd647996fc8b6 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: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Jul 18 13:23:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 13:23:39 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr: Describe requirement to recieve all PH-DATA.ind events Message-ID: Review at https://gerrit.osmocom.org/3273 rtp-amr: Describe requirement to recieve all PH-DATA.ind events Change-Id: I4a78b3398c36a8107fa1809ba9b89235980f0e4f --- M OsmoBTS/rtp-amr-docinfo.xml M OsmoBTS/rtp-amr.adoc 2 files changed, 59 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/73/3273/1 diff --git a/OsmoBTS/rtp-amr-docinfo.xml b/OsmoBTS/rtp-amr-docinfo.xml index fe5d681..3f4de8d 100644 --- a/OsmoBTS/rtp-amr-docinfo.xml +++ b/OsmoBTS/rtp-amr-docinfo.xml @@ -15,6 +15,14 @@ FSM added + + 3 + July 2017 + PE + + Add section and update sequence charts to describe requirement to receive all PH-DATA.ind events + + diff --git a/OsmoBTS/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc index 982a5af..5f0f803 100644 --- a/OsmoBTS/rtp-amr.adoc +++ b/OsmoBTS/rtp-amr.adoc @@ -14,6 +14,22 @@ === TCH/AFS Uplink (MS to Network) +==== TCH/AFS Uplink: Initial Assumptions + +When a call is established, the BTS expects PH-DATA.ind (TCH) events to be +triggered by BTS-PHY at regular intervals and none of them being lost, even if +the MS is not transmitting at that time due to DTX. This requirement is +important as upper layers rely on this timing to update the RTP source clock at +a correct pace. Given an event from BTS-PHY is lost, the RTP source clock will +drift and this may be seen as steady increase of delay over time from the +receiver point of view. + +In the case of Nutaq GSM PHY and API, option fBFILevel is set to a ridiculously +low value -200 to ensure all indications are notified to upper layers, even if +no meaningful payload is available at that time. In this case, an empty payload +is delivered from PHY-BTS to BTS, which updates the clock without sending any +RTP packet. + ==== TCH/AFS Uplink: During Talk-Spurt During a talk-spurt, the system behaves identical to a system without @@ -83,14 +99,14 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU2"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; @@ -133,7 +149,7 @@ ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -147,49 +163,49 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -242,14 +258,14 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; @@ -333,14 +349,14 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH frame)"]; ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH frame)"]; ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of FACCH frame)"]; ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of FACCH frame)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5 of FACCH frame + sub-block 1 of SID First frame)"]; @@ -734,7 +750,7 @@ ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -772,11 +788,11 @@ ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -786,36 +802,36 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -864,17 +880,17 @@ ms -x phy [label="Suppressed L1 burst"]; ms -x phy [label="Suppressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; @@ -916,7 +932,7 @@ ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N+2 + sub-block 1 of speech frame N+3)"]; @@ -948,17 +964,17 @@ ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_UPD_INH + sub-block 1 of speech frame N)", id="SFU1"]; ms => phy [label="L1 burst (block 2 of SID_UPD_INH + sub-block 2 of speech frame N)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; @@ -985,17 +1001,17 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH/H)"]; ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH/H)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3+4 of FACCH/H)"]; ms => phy [label="L1 burst (sub-block 5+6 of FACCH/H)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 7 of FACCH/H + sub-block 1 of SID_FIRST_P1)"]; @@ -1007,7 +1023,7 @@ ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1 + block 1 of SID_FIRST_P2)"]; ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1 + block 2 of SID_FIRST_P2)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; -- To view, visit https://gerrit.osmocom.org/3273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a78b3398c36a8107fa1809ba9b89235980f0e4f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 18 13:23:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 13:23:40 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr: Fix typo and trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/3274 rtp-amr: Fix typo and trailing whitespace Change-Id: I8efda2387e0e5e95700b070dab8f8dd427fa562d --- M OsmoBTS/rtp-amr.adoc 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/74/3274/1 diff --git a/OsmoBTS/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc index 5f0f803..4da2e1b 100644 --- a/OsmoBTS/rtp-amr.adoc +++ b/OsmoBTS/rtp-amr.adoc @@ -1,7 +1,7 @@ = AMR-RTP in Combination with DTX The purpose of this document is to describe the sometimes quite -intricate interactions between a MS, the BTS-PHY and the BTS softare +intricate interactions between a MS, the BTS-PHY and the BTS software in case of AMR (Adaptive Multi Rate) codec and DTX (Discontinuous Transmission). @@ -760,7 +760,7 @@ } ---- -ULSF1:: Only SID_FIRST_P1 contains information so it must be the only one transmitted over RTP. +ULSF1:: Only SID_FIRST_P1 contains information so it must be the only one transmitted over RTP. NOTE:: It has been observed that not all phones transmit SID_FIRST_P2 so the PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2 is not guaranteed to be sent to the BTS. -- To view, visit https://gerrit.osmocom.org/3274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8efda2387e0e5e95700b070dab8f8dd427fa562d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 18 13:29:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 13:29:59 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr: Describe requirement to recieve all PH-DATA.ind events In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3273/1/OsmoBTS/rtp-amr.adoc File OsmoBTS/rtp-amr.adoc: Line 27: In the case of Nutaq GSM PHY and API, option fBFILevel is set to a ridiculously I think it's better to refer to BTS models explicitly instead of company name as it's less confusing. -- To view, visit https://gerrit.osmocom.org/3273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a78b3398c36a8107fa1809ba9b89235980f0e4f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 18 13:32:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 13:32:05 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr: Describe requirement to recieve all PH-DATA.ind events In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3273/1/OsmoBTS/rtp-amr.adoc File OsmoBTS/rtp-amr.adoc: Line 27: In the case of Nutaq GSM PHY and API, option fBFILevel is set to a ridiculously > I think it's better to refer to BTS models explicitly instead of company na I'm using this here because these terms are already being used 2 paragraphs above, in order to show I'm talking about the same example: "It is written with the OsmoBTS implementation and the Nutaq GSM PHY API in mind, but should more or less be applicable to any GSM BTS PHY or any BTS software implementation, assuming it uses RTP on the back-haul towards the MGW." -- To view, visit https://gerrit.osmocom.org/3273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a78b3398c36a8107fa1809ba9b89235980f0e4f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 18 14:09:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 18 Jul 2017 14:09:51 +0000 Subject: osmo-gsm-tester[master]: Improve SMPP supported features and test coverage In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (5 comments) marking -1 for some of the comments; Really close to a +2. https://gerrit.osmocom.org/#/c/3129/3/src/osmo_gsm_tester/esme.py File src/osmo_gsm_tester/esme.py: Line 98: lambda pdu: self.dbg('message sent unhandled resp:', pdu.sequence) ) clarify ... "message we are sending contains an unhandled response"? can't figure out what this means. Line 116: def message_received_handler(self, pdu, *args): might be good to indicate that this is not part of the intended testing API but an internal handler, by prepending an underscore to the name? Line 126: self.log('FIXME: wait_receipt disabled because receipts are not received, see OsmoNITB #2353') hmm, we don't have an expected-to-fail mechanism yet. this would qualify to be an xfail... Line 166: def process_pdus_pending(self, pdu, **kwargs): public API or internal? https://gerrit.osmocom.org/#/c/3129/3/suites/aoip_smpp/esme_ms_sms_storeforward.py File suites/aoip_smpp/esme_ms_sms_storeforward.py: Line 52: wait(esme.receipt_was_received, umref) ...like with xfail: wait(emse.receipt_was_received, umref, timeout=30) but we don't have an xfail yet. Generally we will often need an xfail of sorts. Not necessarily in this patch, just thinking because it's the first time this shows up. -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 18 14:20:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 14:20:47 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr: Describe requirement to recieve all PH-DATA.ind events In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a78b3398c36a8107fa1809ba9b89235980f0e4f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Tue Jul 18 14:20:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 14:20:49 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: rtp-amr: Describe requirement to recieve all PH-DATA.ind events In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rtp-amr: Describe requirement to recieve all PH-DATA.ind events ...................................................................... rtp-amr: Describe requirement to recieve all PH-DATA.ind events Change-Id: I4a78b3398c36a8107fa1809ba9b89235980f0e4f --- M OsmoBTS/rtp-amr-docinfo.xml M OsmoBTS/rtp-amr.adoc 2 files changed, 59 insertions(+), 35 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/rtp-amr-docinfo.xml b/OsmoBTS/rtp-amr-docinfo.xml index fe5d681..3f4de8d 100644 --- a/OsmoBTS/rtp-amr-docinfo.xml +++ b/OsmoBTS/rtp-amr-docinfo.xml @@ -15,6 +15,14 @@ FSM added + + 3 + July 2017 + PE + + Add section and update sequence charts to describe requirement to receive all PH-DATA.ind events + + diff --git a/OsmoBTS/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc index 982a5af..5f0f803 100644 --- a/OsmoBTS/rtp-amr.adoc +++ b/OsmoBTS/rtp-amr.adoc @@ -14,6 +14,22 @@ === TCH/AFS Uplink (MS to Network) +==== TCH/AFS Uplink: Initial Assumptions + +When a call is established, the BTS expects PH-DATA.ind (TCH) events to be +triggered by BTS-PHY at regular intervals and none of them being lost, even if +the MS is not transmitting at that time due to DTX. This requirement is +important as upper layers rely on this timing to update the RTP source clock at +a correct pace. Given an event from BTS-PHY is lost, the RTP source clock will +drift and this may be seen as steady increase of delay over time from the +receiver point of view. + +In the case of Nutaq GSM PHY and API, option fBFILevel is set to a ridiculously +low value -200 to ensure all indications are notified to upper layers, even if +no meaningful payload is available at that time. In this case, an empty payload +is delivered from PHY-BTS to BTS, which updates the clock without sending any +RTP packet. + ==== TCH/AFS Uplink: During Talk-Spurt During a talk-spurt, the system behaves identical to a system without @@ -83,14 +99,14 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU2"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; @@ -133,7 +149,7 @@ ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -147,49 +163,49 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -242,14 +258,14 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; @@ -333,14 +349,14 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH frame)"]; ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH frame)"]; ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of FACCH frame)"]; ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of FACCH frame)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5 of FACCH frame + sub-block 1 of SID First frame)"]; @@ -734,7 +750,7 @@ ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -772,11 +788,11 @@ ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -786,36 +802,36 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; @@ -864,17 +880,17 @@ ms -x phy [label="Suppressed L1 burst"]; ms -x phy [label="Suppressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; @@ -916,7 +932,7 @@ ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N+2 + sub-block 1 of speech frame N+3)"]; @@ -948,17 +964,17 @@ ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_UPD_INH + sub-block 1 of speech frame N)", id="SFU1"]; ms => phy [label="L1 burst (block 2 of SID_UPD_INH + sub-block 2 of speech frame N)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; @@ -985,17 +1001,17 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH/H)"]; ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH/H)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 3+4 of FACCH/H)"]; ms => phy [label="L1 burst (sub-block 5+6 of FACCH/H)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 7 of FACCH/H + sub-block 1 of SID_FIRST_P1)"]; @@ -1007,7 +1023,7 @@ ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1 + block 1 of SID_FIRST_P2)"]; ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1 + block 2 of SID_FIRST_P2)"]; - phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + phy => bts [label="PH-DATA.ind with empty payload"]; bts -x mgw [label="Suppressed RTP frame"]; ms -x phy [label="Supressed L1 burst"]; -- To view, visit https://gerrit.osmocom.org/3273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a78b3398c36a8107fa1809ba9b89235980f0e4f Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 18 14:20:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 14:20:56 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr: Fix typo and trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8efda2387e0e5e95700b070dab8f8dd427fa562d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 18 14:23:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 18 Jul 2017 14:23:32 +0000 Subject: libosmocore[master]: add DLMGCP logging category for libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 2: We've talked with the result that we're going to have an libosmo-mgcp-legacy library clearly marked as such, to keep the namespace open for new development of the osmo-mgw. I still need a logging category for it = I'd still like to add this DLMGCP category. -- To view, visit https://gerrit.osmocom.org/3181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09c587e2d59472cbde852d467d457254746d9e67 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 14:30:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 14:30:22 +0000 Subject: libosmocore[master]: add DLMGCP logging category for libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09c587e2d59472cbde852d467d457254746d9e67 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 14:30:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 14:30:33 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: rtp-amr: Fix typo and trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rtp-amr: Fix typo and trailing whitespace ...................................................................... rtp-amr: Fix typo and trailing whitespace Change-Id: I8efda2387e0e5e95700b070dab8f8dd427fa562d --- M OsmoBTS/rtp-amr.adoc 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc index 5f0f803..4da2e1b 100644 --- a/OsmoBTS/rtp-amr.adoc +++ b/OsmoBTS/rtp-amr.adoc @@ -1,7 +1,7 @@ = AMR-RTP in Combination with DTX The purpose of this document is to describe the sometimes quite -intricate interactions between a MS, the BTS-PHY and the BTS softare +intricate interactions between a MS, the BTS-PHY and the BTS software in case of AMR (Adaptive Multi Rate) codec and DTX (Discontinuous Transmission). @@ -760,7 +760,7 @@ } ---- -ULSF1:: Only SID_FIRST_P1 contains information so it must be the only one transmitted over RTP. +ULSF1:: Only SID_FIRST_P1 contains information so it must be the only one transmitted over RTP. NOTE:: It has been observed that not all phones transmit SID_FIRST_P2 so the PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2 is not guaranteed to be sent to the BTS. -- To view, visit https://gerrit.osmocom.org/3274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8efda2387e0e5e95700b070dab8f8dd427fa562d Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals 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 Jul 18 15:22:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 15:22:40 +0000 Subject: [PATCH] osmo-bts[master]: lc15: fix BTS revision and hw options Message-ID: Review at https://gerrit.osmocom.org/3275 lc15: fix BTS revision and hw options * remove typo in logging * add missing return statement * fix compilation warnings * add detailed logging for supported GSM band and related errors Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 Related: SYS#3728 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/misc/lc15bts_bid.c 2 files changed, 15 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/3275/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index b82a7c6..3f42624 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1369,7 +1369,7 @@ fl1h->hw_info.fpga_version[1] = sic->fpgaVersion.minor; fl1h->hw_info.fpga_version[2] = sic->fpgaVersion.build; - LOGP(DL1C, LOGL_INFO, "DSP v%u.%u.%u, FPGA v%u.%u.%u\nn", + LOGP(DL1C, LOGL_INFO, "DSP v%u.%u.%u, FPGA v%u.%u.%u\n", sic->dspVersion.major, sic->dspVersion.minor, sic->dspVersion.build, sic->fpgaVersion.major, sic->fpgaVersion.minor, sic->fpgaVersion.build); @@ -1468,18 +1468,24 @@ int rc; rc = lc15bts_rev_get(); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS revision: %d\n", rc); return rc; + } fl1h->hw_info.ver_major = rc; rc = lc15bts_model_get(); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS model: %d\n", rc); return rc; + } fl1h->hw_info.ver_minor = rc; rc = lc15bts_option_get(LC15BTS_OPTION_BAND); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS_OPTION_BAND: %d\n", rc); return rc; + } switch (rc) { case LC15BTS_BAND_850: @@ -1495,8 +1501,12 @@ fl1h->hw_info.band_support = GSM_BAND_1900; break; default: + LOGP(DL1C, LOGL_ERROR, "Unexpected LC15BTS_BAND value: %d\n", rc); return -1; } + + LOGP(DL1C, LOGL_DEBUG, "BTS hw support band %s\n", gsm_band_name(fl1h->hw_info.band_support)); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index ba2037a..7f278bf 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -87,11 +87,11 @@ return false; } fclose(fp); + return true; } int lc15bts_rev_get(void) { - FILE *fp; char rev; if (board_rev != -1) { @@ -107,9 +107,7 @@ int lc15bts_model_get(void) { - FILE *fp; int opt; - bool rc; if (board_option != -1) return board_option; -- To view, visit https://gerrit.osmocom.org/3275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jul 18 15:27:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 15:27:32 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: all manuals: Move date and release from center head to right... Message-ID: Review at https://gerrit.osmocom.org/3276 all manuals: Move date and release from center head to right foot Otherwise long doc titles (top left) run on top of release and date making it impossible to read any of them correctly. Change-Id: I685a981a5cfd82214d1d654aa1553a844c2af157 --- M build/custom-dblatex.sty 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/76/3276/1 diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty index 41e7c70..606b9ab 100644 --- a/build/custom-dblatex.sty +++ b/build/custom-dblatex.sty @@ -77,7 +77,8 @@ % left footer \def\DBKpublisher{} -\def\releasebox{\DBKreleaseinfo, \DBKdate} +\def\releasebox{} +\rfoot[]{\DBKreleaseinfo, \DBKdate} \def\maketitle{ \DBKcover -- To view, visit https://gerrit.osmocom.org/3276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I685a981a5cfd82214d1d654aa1553a844c2af157 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 18 15:29:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 15:29:13 +0000 Subject: osmo-gsm-manuals[master]: all manuals: Move date and release from center head to right... In-Reply-To: References: Message-ID: Patch Set 1: Next nice change would be to swap places of right foot (release+date) with right header (page number). However, I spent some time trying to find how to replace the content of the right header (with \rhead and similar) but I was unable to change it. -- To view, visit https://gerrit.osmocom.org/3276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I685a981a5cfd82214d1d654aa1553a844c2af157 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 16:46:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 16:46:38 +0000 Subject: osmo-bts[master]: lc15: fix BTS revision and hw options In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3275/1/src/osmo-bts-litecell15/l1_if.c File src/osmo-bts-litecell15/l1_if.c: Line 1508: LOGP(DL1C, LOGL_DEBUG, "BTS hw support band %s\n", gsm_band_name(fl1h->hw_info.band_support)); If it's not called that often, it's probably a good idea to use INFO level. Also print then the other options you are fetching here. Maybe create a function to print the fl1h structure? -- To view, visit https://gerrit.osmocom.org/3275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 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 Tue Jul 18 16:59:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 16:59:54 +0000 Subject: [PATCH] osmo-bts[master]: lc15: port lc15bts-mgr changes Message-ID: Review at https://gerrit.osmocom.org/3277 lc15: port lc15bts-mgr changes Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Related: SYS#3679 --- M doc/examples/litecell15/lc15bts-mgr.cfg M include/osmo-bts/phy_link.h M src/common/Makefile.am M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/hw_misc.c A src/osmo-bts-litecell15/misc/lc15bts_bts.c A src/osmo-bts-litecell15/misc/lc15bts_bts.h M src/osmo-bts-litecell15/misc/lc15bts_clock.c A src/osmo-bts-litecell15/misc/lc15bts_led.c A src/osmo-bts-litecell15/misc/lc15bts_led.h M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.h M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c M src/osmo-bts-litecell15/misc/lc15bts_misc.c M src/osmo-bts-litecell15/misc/lc15bts_misc.h M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h M src/osmo-bts-litecell15/misc/lc15bts_power.c M src/osmo-bts-litecell15/misc/lc15bts_power.h M src/osmo-bts-litecell15/misc/lc15bts_temp.c M src/osmo-bts-litecell15/misc/lc15bts_temp.h 22 files changed, 2,013 insertions(+), 410 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/77/3277/1 diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index 750dc36..c7d0a79 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -25,39 +25,19 @@ no login ! lc15bts-mgr - limits supply - threshold warning 60 - threshold critical 78 - limits soc - threshold warning 60 - threshold critical 78 - limits fpga - threshold warning 60 - threshold critical 78 - limits logrf - threshold warning 60 - threshold critical 78 - limits tx0 - threshold warning 60 - threshold critical 78 - limits tx1 - threshold warning 60 - threshold critical 78 - limits pa0 - threshold warning 60 - threshold critical 78 - limits pa1 - threshold warning 60 - threshold critical 78 - actions normal - pa0-on - pa1-on - bts-service-on - actions warn - no pa0-off - no pa1-off - no bts-service-off - actions critical - pa0-off - pa1-off - no bts-service-off + limits supply_volt + threshold warning min 17500 + threshold critical min 19000 + limits tx0_vswr + threshold warning max 3 + limits tx1_vswr + threshold warning max 3 + limits supply_pwr + threshold warning max 110 + threshold critical max 120 + limits pa0_pwr + threshold warning max 50 + threshold critical max 60 + limits pa1_pwr + threshold warning max 50 + threshold critical max 60 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index d8d3c6b..3d4bf91 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -124,6 +124,12 @@ int minTxPower; int maxTxPower; struct lc15l1_hdl *hdl; + uint8_t max_cell_size; /* 0:166 qbits*/ + uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ + uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ + uint8_t dsp_alive_period; /* DSP alive timer period */ + uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ + uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ } lc15; } u; }; diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..d104c48 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -2,6 +2,10 @@ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) +if ENABLE_LC15BTS +AM_CFLAGS += -DENABLE_LC15BTS +endif + noinst_LIBRARIES = libbts.a libl1sched.a libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \ rsl.c vty.c paging.c measurement.c amr.c lchan.c \ diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 3026e96..7920df4 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -4,7 +4,9 @@ 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/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h \ +AM_CFLAGS += -DENABLE_LC15BTS + +EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h misc/lc15bts_led.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ misc/lc15bts_bid.h misc/lc15bts_nl.h \ hw_misc.h l1_if.h l1_transp.h lc15bts.h oml_router.h utils.h @@ -25,9 +27,11 @@ misc/lc15bts_mgr_vty.c \ misc/lc15bts_mgr_nl.c \ misc/lc15bts_mgr_temp.c \ - misc/lc15bts_mgr_calib.c + misc/lc15bts_mgr_calib.c \ + misc/lc15bts_led.c \ + misc/lc15bts_bts.c -lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(COMMON_LDADD) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) diff --git a/src/osmo-bts-litecell15/hw_misc.c b/src/osmo-bts-litecell15/hw_misc.c index 49232b2..9f070bb 100644 --- a/src/osmo-bts-litecell15/hw_misc.c +++ b/src/osmo-bts-litecell15/hw_misc.c @@ -69,6 +69,7 @@ rc = write(fd, cmd[0] ? "1" : "0", 2); if (rc != 2) { + close(fd); return -1; } close(fd); @@ -79,6 +80,7 @@ rc = write(fd, cmd[1] ? "1" : "0", 2); if (rc != 2) { + close(fd); return -1; } close(fd); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bts.c b/src/osmo-bts-litecell15/misc/lc15bts_bts.c new file mode 100644 index 0000000..0343e93 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_bts.c @@ -0,0 +1,131 @@ +/* Copyright (C) 2016 by NuRAN Wireless + * + * 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 "lc15bts_mgr.h" +#include "lc15bts_bts.h" + +static int check_eth_status(char *dev_name) +{ + int fd, rc; + struct ifreq ifr; + + fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); + if (fd < 0) + return fd; + + memset(&ifr, 0, sizeof(ifr)); + memcpy(&ifr.ifr_name, dev_name, sizeof(ifr.ifr_name)); + rc = ioctl(fd, SIOCGIFFLAGS, &ifr); + close(fd); + + if (rc < 0) + return rc; + + if ((ifr.ifr_flags & IFF_UP) && (ifr.ifr_flags & IFF_RUNNING)) + return 0; + + return 1; +} + +void check_bts_led_pattern(uint8_t *led) +{ + FILE *fp; + char str[64] = "\0"; + int rc; + + /* check for existing of BTS state file */ + if ((fp = fopen("/var/run/osmo-bts/state", "r")) == NULL) { + led[BLINK_PATTERN_INIT] = 1; + return; + } + + /* check Ethernet interface status */ + rc = check_eth_status("eth0"); + if (rc > 0) { + LOGP(DTEMP, LOGL_DEBUG,"External link is DOWN\n"); + led[BLINK_PATTERN_EXT_LINK_MALFUNC] = 1; + fclose(fp); + return; + } + + /* check for BTS is still alive */ + if (system("pidof osmo-bts-lc15 > /dev/null")) { + LOGP(DTEMP, LOGL_DEBUG,"BTS process has stopped\n"); + led[BLINK_PATTERN_INT_PROC_MALFUNC] = 1; + fclose(fp); + return; + } + + /* check for BTS state */ + while (fgets(str, 64, fp) != NULL) { + LOGP(DTEMP, LOGL_DEBUG,"BTS state is %s\n", (strstr(str, "ABIS DOWN") != NULL) ? "DOWN" : "UP"); + if (strstr(str, "ABIS DOWN") != NULL) + led[BLINK_PATTERN_INT_PROC_MALFUNC] = 1; + } + fclose(fp); + + return; +} + +int check_sensor_led_pattern( struct lc15bts_mgr_instance *mgr, uint8_t *led) +{ + if(mgr->alarms.temp_high == 1) + led[BLINK_PATTERN_TEMP_HIGH] = 1; + + if(mgr->alarms.temp_max == 1) + led[BLINK_PATTERN_TEMP_MAX] = 1; + + if(mgr->alarms.supply_low == 1) + led[BLINK_PATTERN_SUPPLY_VOLT_LOW] = 1; + + if(mgr->alarms.supply_min == 1) + led[BLINK_PATTERN_SUPPLY_VOLT_MIN] = 1; + + if(mgr->alarms.vswr_high == 1) + led[BLINK_PATTERN_VSWR_HIGH] = 1; + + if(mgr->alarms.vswr_max == 1) + led[BLINK_PATTERN_VSWR_MAX] = 1; + + if(mgr->alarms.supply_pwr_high == 1) + led[BLINK_PATTERN_SUPPLY_PWR_HIGH] = 1; + + if(mgr->alarms.supply_pwr_max == 1) + led[BLINK_PATTERN_SUPPLY_PWR_MAX] = 1; + + if(mgr->alarms.supply_pwr_max2 == 1) + led[BLINK_PATTERN_SUPPLY_PWR_MAX2] = 1; + + if(mgr->alarms.pa_pwr_high == 1) + led[BLINK_PATTERN_PA_PWR_HIGH] = 1; + + if(mgr->alarms.pa_pwr_max == 1) + led[BLINK_PATTERN_PA_PWR_MAX] = 1; + + if(mgr->alarms.gps_fix_lost == 1) + led[BLINK_PATTERN_GPS_FIX_LOST] = 1; + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bts.h b/src/osmo-bts-litecell15/misc/lc15bts_bts.h new file mode 100644 index 0000000..3918b87 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_bts.h @@ -0,0 +1,21 @@ +#ifndef _LC15BTS_BTS_H_ +#define _LC15BTS_BTS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* public function prototypes */ +void check_bts_led_pattern(uint8_t *led); +int check_sensor_led_pattern( struct lc15bts_mgr_instance *mgr, uint8_t *led); + +#endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_clock.c b/src/osmo-bts-litecell15/misc/lc15bts_clock.c index f4df5d3..7170149 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_clock.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_clock.c @@ -100,9 +100,6 @@ int lc15bts_clock_err_open(void) { - int rc; - int fault; - if (clkerr_fd_err < 0) { clkerr_fd_err = open(CLKERR_ERR_SYSFS, O_RDONLY); if (clkerr_fd_err < 0) { @@ -149,26 +146,6 @@ lc15bts_clock_err_close(); return clkerr_fd_reset; } - } - - rc = sysfs_write_str(clkerr_fd_refresh, "once"); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } - - rc = sysfs_read_val(clkerr_fd_fault, &fault); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } - - if (fault) { - rc = sysfs_write_val(clkerr_fd_reset, 1); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } } return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_led.c b/src/osmo-bts-litecell15/misc/lc15bts_led.c new file mode 100644 index 0000000..603e0fb --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_led.c @@ -0,0 +1,333 @@ +/* Copyright (C) 2016 by NuRAN Wireless + * + * 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 "lc15bts_led.h" +#include "lc15bts_bts.h" +#include +#include + +static struct lc15bts_led led_entries[] = { + { + .name = "led0", + .fullname = "led red", + .path = "/var/lc15/leds/led0/brightness" + }, + { + .name = "led1", + .fullname = "led green", + .path = "/var/lc15/leds/led1/brightness" + } +}; + +static const struct value_string lc15bts_led_strs[] = { + { LC15BTS_LED_RED, "LED red" }, + { LC15BTS_LED_GREEN, "LED green" }, + { LC15BTS_LED_ORANGE, "LED orange" }, + { LC15BTS_LED_OFF, "LED off" }, + { 0, NULL } +}; + +static uint8_t led_priority[] = { + BLINK_PATTERN_INIT, + BLINK_PATTERN_INT_PROC_MALFUNC, + BLINK_PATTERN_SUPPLY_PWR_MAX, + BLINK_PATTERN_PA_PWR_MAX, + BLINK_PATTERN_VSWR_MAX, + BLINK_PATTERN_SUPPLY_VOLT_MIN, + BLINK_PATTERN_TEMP_MAX, + BLINK_PATTERN_SUPPLY_PWR_MAX2, + BLINK_PATTERN_EXT_LINK_MALFUNC, + BLINK_PATTERN_SUPPLY_VOLT_LOW, + BLINK_PATTERN_TEMP_HIGH, + BLINK_PATTERN_VSWR_HIGH, + BLINK_PATTERN_SUPPLY_PWR_HIGH, + BLINK_PATTERN_PA_PWR_HIGH, + BLINK_PATTERN_GPS_FIX_LOST, + BLINK_PATTERN_NORMAL +}; + + +char *blink_pattern_command[] = BLINK_PATTERN_COMMAND; + +static int lc15bts_led_write(char *path, char *str) +{ + int fd; + + if ((fd = open(path, O_WRONLY)) == -1) + { + return 0; + } + + write(fd, str, strlen(str)+1); + close(fd); + return 1; +} + +static void led_set_red() +{ + lc15bts_led_write(led_entries[0].path, "1"); + lc15bts_led_write(led_entries[1].path, "0"); +} + +static void led_set_green() +{ + lc15bts_led_write(led_entries[0].path, "0"); + lc15bts_led_write(led_entries[1].path, "1"); +} + +static void led_set_orange() +{ + lc15bts_led_write(led_entries[0].path, "1"); + lc15bts_led_write(led_entries[1].path, "1"); +} + +static void led_set_off() +{ + lc15bts_led_write(led_entries[0].path, "0"); + lc15bts_led_write(led_entries[1].path, "0"); +} + +static void led_sleep( struct lc15bts_mgr_instance *mgr, struct lc15bts_led_timer *led_timer, void (*led_timer_cb)(void *_data)) { + /* Cancel any pending timer */ + osmo_timer_del(&led_timer->timer); + /* Start LED timer */ + led_timer->timer.cb = led_timer_cb; + led_timer->timer.data = mgr; + mgr->lc15bts_leds.active_timer = led_timer->idx; + osmo_timer_schedule(&led_timer->timer, led_timer->param.sleep_sec, led_timer->param.sleep_usec); + LOGP(DTEMP, LOGL_DEBUG,"%s timer scheduled for %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_timer->idx), + led_timer->param.sleep_sec, + led_timer->param.sleep_usec); + + switch (led_timer->idx) { + case LC15BTS_LED_RED: + led_set_red(); + break; + case LC15BTS_LED_GREEN: + led_set_green(); + break; + case LC15BTS_LED_ORANGE: + led_set_orange(); + break; + case LC15BTS_LED_OFF: + led_set_off(); + break; + default: + led_set_off(); + } +} + +static void led_sleep_cb(void *_data) { + struct lc15bts_mgr_instance *mgr = _data; + struct lc15bts_led_timer_list *led_list; + + /* make sure the timer list is not empty */ + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + llist_for_each_entry(led_list, &mgr->lc15bts_leds.list, list) { + if (led_list->led_timer.idx == mgr->lc15bts_leds.active_timer) { + LOGP(DTEMP, LOGL_DEBUG,"Delete expired %s timer %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + /* Delete current timer */ + osmo_timer_del(&led_list->led_timer.timer); + /* Rotate the timer list */ + llist_move_tail(led_list, &mgr->lc15bts_leds.list); + break; + } + } + + /* Execute next timer */ + led_list = llist_first_entry(&mgr->lc15bts_leds.list, struct lc15bts_led_timer_list, list); + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Execute %s timer %d sec + %d usec, total entries=%d\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec, + llist_count(&mgr->lc15bts_leds.list)); + + led_sleep(mgr, &led_list->led_timer, led_sleep_cb); + } + +} + +static void delete_led_timer_entries(struct lc15bts_mgr_instance *mgr) +{ + struct lc15bts_led_timer_list *led_list, *led_list2; + + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + llist_for_each_entry_safe(led_list, led_list2, &mgr->lc15bts_leds.list, list) { + /* Delete the timer in list */ + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Delete %s timer entry from list, %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + /* Delete current timer */ + osmo_timer_del(&led_list->led_timer.timer); + llist_del(&led_list->list); + talloc_free(led_list); + } + } + return; +} + +static int add_led_timer_entry(struct lc15bts_mgr_instance *mgr, char *cmdstr) +{ + double sec, int_sec, frac_sec; + struct lc15bts_sleep_time led_param; + + led_param.sleep_sec = 0; + led_param.sleep_usec = 0; + + if (strstr(cmdstr, "set red") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_RED; + else if (strstr(cmdstr, "set green") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_GREEN; + else if (strstr(cmdstr, "set orange") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_ORANGE; + else if (strstr(cmdstr, "set off") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_OFF; + else if (strstr(cmdstr, "sleep") != NULL) { + sec = atof(cmdstr + 6); + /* split time into integer and fractional of seconds */ + frac_sec = modf(sec, &int_sec) * 1000000.0; + led_param.sleep_sec = (int)int_sec; + led_param.sleep_usec = (int)frac_sec; + + if ((mgr->lc15bts_leds.led_idx >= LC15BTS_LED_RED) && (mgr->lc15bts_leds.led_idx < _LC15BTS_LED_MAX)) { + struct lc15bts_led_timer_list *led_list; + + /* allocate timer entry */ + led_list = talloc_zero(tall_mgr_ctx, struct lc15bts_led_timer_list); + if (led_list) { + led_list->led_timer.idx = mgr->lc15bts_leds.led_idx; + led_list->led_timer.param.sleep_sec = led_param.sleep_sec; + led_list->led_timer.param.sleep_usec = led_param.sleep_usec; + llist_add_tail(&led_list->list, &mgr->lc15bts_leds.list); + + LOGP(DTEMP, LOGL_DEBUG,"Add %s timer to list, %d sec + %d usec, total entries=%d\n", + get_value_string(lc15bts_led_strs, mgr->lc15bts_leds.led_idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec, + llist_count(&mgr->lc15bts_leds.list)); + } + } + } else + return -1; + + return 0; +} + +static int parse_led_pattern(char *pattern, struct lc15bts_mgr_instance *mgr) +{ + char str[1024]; + char *pstr; + char *sep; + int rc = 0; + + strcpy(str, pattern); + pstr = str; + while ((sep = strsep(&pstr, ";")) != NULL) { + rc = add_led_timer_entry(mgr, sep); + if (rc < 0) { + break; + } + + } + return rc; +} + +/*** led interface ***/ + +void led_set(struct lc15bts_mgr_instance *mgr, int pattern_id) +{ + int rc; + struct lc15bts_led_timer_list *led_list; + + if (pattern_id > BLINK_PATTERN_MAX_ITEM - 1) { + LOGP(DTEMP, LOGL_ERROR, "Invalid LED pattern : %d. LED pattern must be between %d..%d\n", + pattern_id, + BLINK_PATTERN_POWER_ON, + BLINK_PATTERN_MAX_ITEM - 1); + return; + } + if (pattern_id == mgr->lc15bts_leds.last_pattern_id) + return; + + mgr->lc15bts_leds.last_pattern_id = pattern_id; + + LOGP(DTEMP, LOGL_NOTICE, "blink pattern command : %d\n", pattern_id); + LOGP(DTEMP, LOGL_NOTICE, "%s\n", blink_pattern_command[pattern_id]); + + /* Empty existing LED timer in the list */ + delete_led_timer_entries(mgr); + + /* parse LED pattern */ + rc = parse_led_pattern(blink_pattern_command[pattern_id], mgr); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR,"LED pattern not found or invalid LED pattern\n"); + return; + } + + /* make sure the timer list is not empty */ + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + /* Start the first LED timer in the list */ + led_list = llist_first_entry(&mgr->lc15bts_leds.list, struct lc15bts_led_timer_list, list); + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Execute timer %s for %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + led_sleep(mgr, &led_list->led_timer, led_sleep_cb); + } + +} + +void select_led_pattern(struct lc15bts_mgr_instance *mgr) +{ + int i; + uint8_t led[BLINK_PATTERN_MAX_ITEM] = {0}; + + /* set normal LED pattern at first */ + led[BLINK_PATTERN_NORMAL] = 1; + + /* check on-board sensors for new LED pattern */ + check_sensor_led_pattern(mgr, led); + + /* check BTS status for new LED pattern */ + check_bts_led_pattern(led); + + /* check by priority */ + for (i = 0; i < sizeof(led_priority)/sizeof(uint8_t); i++) { + if(led[led_priority[i]] == 1) { + led_set(mgr, led_priority[i]); + break; + } + } +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_led.h b/src/osmo-bts-litecell15/misc/lc15bts_led.h new file mode 100644 index 0000000..b6d9d28 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_led.h @@ -0,0 +1,22 @@ +#ifndef _LC15BTS_LED_H +#define _LC15BTS_LED_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "lc15bts_mgr.h" + +/* public function prototypes */ +void led_set(struct lc15bts_mgr_instance *mgr, int pattern_id); + +void select_led_pattern(struct lc15bts_mgr_instance *mgr); + +#endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index 3a7d3a1..51a05f9 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -46,13 +46,14 @@ #include "misc/lc15bts_par.h" #include "misc/lc15bts_bid.h" #include "misc/lc15bts_power.h" +#include "lc15bts_led.h" static int no_rom_write = 0; static int daemonize = 0; void *tall_mgr_ctx; /* every 6 hours means 365*4 = 1460 rom writes per year (max) */ -#define TEMP_TIMER_SECS (6 * 3600) +#define SENSOR_TIMER_SECS (6 * 3600) /* every 1 hours means 365*24 = 8760 rom writes per year (max) */ #define HOURS_TIMER_SECS (1 * 3600) @@ -62,54 +63,106 @@ static struct lc15bts_mgr_instance manager = { .config_file = "lc15bts-mgr.cfg", .temp = { - .supply_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .supply_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .soc_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .soc_temp_limit = { + .thresh_warn_max = 95, + .thresh_crit_max = 100, + .thresh_warn_min = -40, }, - .fpga_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .fpga_temp_limit = { + .thresh_warn_max = 95, + .thresh_crit_max = 100, + .thresh_warn_min = -40, }, - .logrf_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .rmsdet_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .ocxo_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .ocxo_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .tx0_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .tx0_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -20, }, - .tx1_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .tx1_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -20, }, - .pa0_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .pa0_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .pa1_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .pa1_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, + } + }, + .volt = { + .supply_volt_limit = { + .thresh_warn_max = 30000, + .thresh_crit_max = 30500, + .thresh_warn_min = 19000, + .thresh_crit_min = 17500, + } + }, + .pwr = { + .supply_pwr_limit = { + .thresh_warn_max = 110, + .thresh_crit_max = 120, }, + .pa0_pwr_limit = { + .thresh_warn_max = 50, + .thresh_crit_max = 60, + }, + .pa1_pwr_limit = { + .thresh_warn_max = 50, + .thresh_crit_max = 60, + } + }, + .vswr = { + .tx0_vswr_limit = { + .thresh_warn_max = 3000, + .thresh_crit_max = 5000, + }, + .tx1_vswr_limit = { + .thresh_warn_max = 3000, + .thresh_crit_max = 5000, + } + }, + .gps = { + .gps_fix_limit = { + .thresh_warn_max = 7, + } + }, + .state = { + .action_norm = SENSOR_ACT_NORM_PA0_ON | SENSOR_ACT_NORM_PA1_ON, .action_warn = 0, - .action_crit = TEMP_ACT_PA0_OFF | TEMP_ACT_PA1_OFF, + .action_crit = 0, + .action_comb = 0, .state = STATE_NORMAL, } }; -static struct osmo_timer_list temp_timer; -static void check_temp_timer_cb(void *unused) +static struct osmo_timer_list sensor_timer; +static void check_sensor_timer_cb(void *unused) { lc15bts_check_temp(no_rom_write); - - osmo_timer_schedule(&temp_timer, TEMP_TIMER_SECS, 0); + lc15bts_check_power(no_rom_write); + lc15bts_check_vswr(no_rom_write); + osmo_timer_schedule(&sensor_timer, SENSOR_TIMER_SECS, 0); + /* TODO checks if lc15bts_check_temp/lc15bts_check_power/lc15bts_check_vswr went ok */ } static struct osmo_timer_list hours_timer; @@ -118,6 +171,7 @@ lc15bts_update_hours(no_rom_write); osmo_timer_schedule(&hours_timer, HOURS_TIMER_SECS, 0); + /* TODO: validates if lc15bts_update_hours went correctly */ } static void print_help(void) @@ -169,6 +223,8 @@ switch (signal) { case SIGINT: lc15bts_check_temp(no_rom_write); + lc15bts_check_power(no_rom_write); + lc15bts_check_vswr(no_rom_write); lc15bts_update_hours(no_rom_write); exit(0); break; @@ -207,6 +263,12 @@ .color = "\033[1;37m", .enabled = 1, .loglevel = LOGL_INFO, }, + [DSWD] = { + .name = "DSWD", + .description = "Software Watchdog", + .color = "\033[1;37m", + .enabled = 1, .loglevel = LOGL_INFO, + }, }; static const struct log_info mgr_log_info = { @@ -223,7 +285,6 @@ int main(int argc, char **argv) { int rc; - tall_mgr_ctx = talloc_named_const(NULL, 1, "bts manager"); msgb_talloc_ctx_init(tall_mgr_ctx, 0); @@ -253,9 +314,12 @@ exit(1); } + INIT_LLIST_HEAD(&manager.lc15bts_leds.list); + INIT_LLIST_HEAD(&manager.alarms.list); + /* start temperature check timer */ - temp_timer.cb = check_temp_timer_cb; - check_temp_timer_cb(NULL); + sensor_timer.cb = check_sensor_timer_cb; + check_sensor_timer_cb(NULL); /* start operational hours timer */ hours_timer.cb = hours_timer_cb; @@ -271,14 +335,13 @@ if (rc < 0) { exit(3); } - /* handle broadcast messages for ipaccess-find */ if (lc15bts_mgr_nl_init() != 0) exit(3); - /* Initialize the temperature control */ - lc15bts_mgr_temp_init(&manager); + /* Initialize the sensor control */ + lc15bts_mgr_sensor_init(&manager); if (lc15bts_mgr_calib_init(&manager) != 0) exit(3); @@ -290,7 +353,6 @@ exit(1); } } - while (1) { log_reset_context(); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h index 98bd701..4bfbdbc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h @@ -9,38 +9,100 @@ #include +#define LC15BTS_SENSOR_TIMER_DURATION 60 +#define LC15BTS_PREVENT_TIMER_DURATION 15 * 60 +#define LC15BTS_PREVENT_TIMER_SHORT_DURATION 5 * 60 +#define LC15BTS_PREVENT_TIMER_NONE 0 +#define LC15BTS_PREVENT_RETRY INT_MAX - 1 + +enum BLINK_PATTERN { + BLINK_PATTERN_POWER_ON = 0, //hardware set + BLINK_PATTERN_INIT, + BLINK_PATTERN_NORMAL, + BLINK_PATTERN_EXT_LINK_MALFUNC, + BLINK_PATTERN_INT_PROC_MALFUNC, + BLINK_PATTERN_SUPPLY_VOLT_LOW, + BLINK_PATTERN_SUPPLY_VOLT_MIN, + BLINK_PATTERN_VSWR_HIGH, + BLINK_PATTERN_VSWR_MAX, + BLINK_PATTERN_TEMP_HIGH, + BLINK_PATTERN_TEMP_MAX, + BLINK_PATTERN_SUPPLY_PWR_HIGH, + BLINK_PATTERN_SUPPLY_PWR_MAX, + BLINK_PATTERN_SUPPLY_PWR_MAX2, + BLINK_PATTERN_PA_PWR_HIGH, + BLINK_PATTERN_PA_PWR_MAX, + BLINK_PATTERN_GPS_FIX_LOST, + BLINK_PATTERN_MAX_ITEM +}; + +#define BLINK_PATTERN_COMMAND {\ + "set red; sleep 5.0",\ + "set orange; sleep 5.0",\ + "set green; sleep 2.5; set off; sleep 2.5",\ + "set red; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 2.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5 ",\ + "set green; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set orange; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5 ",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set orange; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ +} + enum { DTEMP, DFW, DFIND, DCALIB, + DSWD, }; // TODO NTQD: Define new actions like reducing output power, limit ARM core speed, shutdown second TRX/PA, ... enum { #if 0 - TEMP_ACT_PWR_CONTRL = 0x1, + SENSOR_ACT_PWR_CONTRL = 0x1, #endif - TEMP_ACT_PA0_OFF = 0x2, - TEMP_ACT_PA1_OFF = 0x4, - TEMP_ACT_BTS_SRV_OFF = 0x10, + SENSOR_ACT_PA0_OFF = 0x2, + SENSOR_ACT_PA1_OFF = 0x4, + SENSOR_ACT_BTS_SRV_OFF = 0x10, }; /* actions only for normal state */ enum { #if 0 - TEMP_ACT_NORM_PW_CONTRL = 0x1, + SENSOR_ACT_NORM_PW_CONTRL = 0x1, #endif - TEMP_ACT_NORM_PA0_ON = 0x2, - TEMP_ACT_NORM_PA1_ON = 0x4, - TEMP_ACT_NORM_BTS_SRV_ON= 0x10, + SENSOR_ACT_NORM_PA0_ON = 0x2, + SENSOR_ACT_NORM_PA1_ON = 0x4, + SENSOR_ACT_NORM_BTS_SRV_ON= 0x10, }; -enum lc15bts_temp_state { +enum lc15bts_sensor_state { STATE_NORMAL, /* Everything is fine */ STATE_WARNING_HYST, /* Go back to normal next? */ STATE_WARNING, /* We are above the warning threshold */ STATE_CRITICAL, /* We have an issue. Wait for below warning */ +}; + +enum lc15bts_leds_name { + LC15BTS_LED_RED = 0, + LC15BTS_LED_GREEN, + LC15BTS_LED_ORANGE, + LC15BTS_LED_OFF, + _LC15BTS_LED_MAX +}; + +struct lc15bts_led{ + char *name; + char *fullname; + char *path; }; /** @@ -49,8 +111,52 @@ * severe that an action will be taken. */ struct lc15bts_temp_limit { - int thresh_warn; - int thresh_crit; + int thresh_warn_max; + int thresh_crit_max; + int thresh_warn_min; +}; + +struct lc15bts_volt_limit { + int thresh_warn_max; + int thresh_crit_max; + int thresh_warn_min; + int thresh_crit_min; +}; + +struct lc15bts_pwr_limit { + int thresh_warn_max; + int thresh_crit_max; +}; + +struct lc15bts_vswr_limit { + int thresh_warn_max; + int thresh_crit_max; +}; + +struct lc15bts_gps_fix_limit { + int thresh_warn_max; +}; + +struct lc15bts_sleep_time { + int sleep_sec; + int sleep_usec; +}; + +struct lc15bts_led_timer { + uint8_t idx; + struct osmo_timer_list timer; + struct lc15bts_sleep_time param; +}; + +struct lc15bts_led_timer_list { + struct llist_head list; + struct lc15bts_led_timer led_timer; +}; + +struct lc15bts_preventive_list { + struct llist_head list; + struct lc15bts_sleep_time param; + int action_flag; }; enum mgr_vty_node { @@ -59,55 +165,258 @@ ACT_NORM_NODE, ACT_WARN_NODE, ACT_CRIT_NODE, - LIMIT_SUPPLY_NODE, + LIMIT_SUPPLY_TEMP_NODE, LIMIT_SOC_NODE, LIMIT_FPGA_NODE, - LIMIT_LOGRF_NODE, + LIMIT_RMSDET_NODE, LIMIT_OCXO_NODE, - LIMIT_TX0_NODE, - LIMIT_TX1_NODE, - LIMIT_PA0_NODE, - LIMIT_PA1_NODE, + LIMIT_TX0_TEMP_NODE, + LIMIT_TX1_TEMP_NODE, + LIMIT_PA0_TEMP_NODE, + LIMIT_PA1_TEMP_NODE, + LIMIT_SUPPLY_VOLT_NODE, + LIMIT_TX0_VSWR_NODE, + LIMIT_TX1_VSWR_NODE, + LIMIT_SUPPLY_PWR_NODE, + LIMIT_PA0_PWR_NODE, + LIMIT_PA1_PWR_NODE, + LIMIT_GPS_FIX_NODE, +}; + +enum mgr_vty_limit_type { + MGR_LIMIT_TYPE_TEMP = 0, + MGR_LIMIT_TYPE_VOLT, + MGR_LIMIT_TYPE_VSWR, + MGR_LIMIT_TYPE_PWR, + _MGR_LIMIT_TYPE_MAX, }; struct lc15bts_mgr_instance { const char *config_file; struct { + struct lc15bts_temp_limit supply_temp_limit; + struct lc15bts_temp_limit soc_temp_limit; + struct lc15bts_temp_limit fpga_temp_limit; + struct lc15bts_temp_limit rmsdet_temp_limit; + struct lc15bts_temp_limit ocxo_temp_limit; + struct lc15bts_temp_limit tx0_temp_limit; + struct lc15bts_temp_limit tx1_temp_limit; + struct lc15bts_temp_limit pa0_temp_limit; + struct lc15bts_temp_limit pa1_temp_limit; + } temp; + + struct { + struct lc15bts_volt_limit supply_volt_limit; + } volt; + + struct { + struct lc15bts_pwr_limit supply_pwr_limit; + struct lc15bts_pwr_limit pa0_pwr_limit; + struct lc15bts_pwr_limit pa1_pwr_limit; + } pwr; + + struct { + struct lc15bts_vswr_limit tx0_vswr_limit; + struct lc15bts_vswr_limit tx1_vswr_limit; + int tx0_last_vswr; + int tx1_last_vswr; + } vswr; + + struct { + struct lc15bts_gps_fix_limit gps_fix_limit; + time_t last_update; + } gps; + + struct { int action_norm; int action_warn; int action_crit; + int action_comb; - enum lc15bts_temp_state state; - - struct lc15bts_temp_limit supply_limit; - struct lc15bts_temp_limit soc_limit; - struct lc15bts_temp_limit fpga_limit; - struct lc15bts_temp_limit logrf_limit; - struct lc15bts_temp_limit ocxo_limit; - struct lc15bts_temp_limit tx0_limit; - struct lc15bts_temp_limit tx1_limit; - struct lc15bts_temp_limit pa0_limit; - struct lc15bts_temp_limit pa1_limit; - } temp; + enum lc15bts_sensor_state state; + } state; struct { int state; int calib_from_loop; struct osmo_timer_list calib_timeout; } calib; + + struct { + int state; + int swd_from_loop; + unsigned long long int swd_events; + unsigned long long int swd_events_cache; + unsigned long long int swd_eventmasks; + int num_events; + struct osmo_timer_list swd_timeout; + } swd; + + struct { + uint8_t led_idx; + uint8_t last_pattern_id; + uint8_t active_timer; + struct llist_head list; + } lc15bts_leds; + + struct { + int is_up; + uint32_t last_seqno; + struct osmo_timer_list recon_timer; + struct ipa_client_conn *bts_conn; + uint32_t crit_flags; + uint32_t warn_flags; + } lc15bts_ctrl; + + struct lc15bts_alarms { + int temp_high; + int temp_max; + int supply_low; + int supply_min; + int vswr_high; + int vswr_max; + int supply_pwr_high; + int supply_pwr_max; + int supply_pwr_max2; + int pa_pwr_high; + int pa_pwr_max; + int gps_fix_lost; + struct llist_head list; + struct osmo_timer_list preventive_timer; + int preventive_duration; + int preventive_retry; + } alarms; + +}; + +enum lc15bts_mgr_fail_evt_rep_crit_sig { + /* Critical alarms */ + S_MGR_TEMP_SUPPLY_CRIT_MAX_ALARM = (1 << 0), + S_MGR_TEMP_SOC_CRIT_MAX_ALARM = (1 << 1), + S_MGR_TEMP_FPGA_CRIT_MAX_ALARM = (1 << 2), + S_MGR_TEMP_RMS_DET_CRIT_MAX_ALARM = (1 << 3), + S_MGR_TEMP_OCXO_CRIT_MAX_ALARM = (1 << 4), + S_MGR_TEMP_TRX0_CRIT_MAX_ALARM = (1 << 5), + S_MGR_TEMP_TRX1_CRIT_MAX_ALARM = (1 << 6), + S_MGR_TEMP_PA0_CRIT_MAX_ALARM = (1 << 7), + S_MGR_TEMP_PA1_CRIT_MAX_ALARM = (1 << 8), + S_MGR_SUPPLY_CRIT_MAX_ALARM = (1 << 9), + S_MGR_SUPPLY_CRIT_MIN_ALARM = (1 << 10), + S_MGR_VSWR0_CRIT_MAX_ALARM = (1 << 11), + S_MGR_VSWR1_CRIT_MAX_ALARM = (1 << 12), + S_MGR_PWR_SUPPLY_CRIT_MAX_ALARM = (1 << 13), + S_MGR_PWR_PA0_CRIT_MAX_ALARM = (1 << 14), + S_MGR_PWR_PA1_CRIT_MAX_ALARM = (1 << 15), + _S_MGR_CRIT_ALARM_MAX, +}; + +enum lc15bts_mgr_fail_evt_rep_warn_sig { + /* Warning alarms */ + S_MGR_TEMP_SUPPLY_WARN_MIN_ALARM = (1 << 0), + S_MGR_TEMP_SUPPLY_WARN_MAX_ALARM = (1 << 2), + S_MGR_TEMP_SOC_WARN_MIN_ALARM = (1 << 3), + S_MGR_TEMP_SOC_WARN_MAX_ALARM = (1 << 4), + S_MGR_TEMP_FPGA_WARN_MIN_ALARM = (1 << 5), + S_MGR_TEMP_FPGA_WARN_MAX_ALARM = (1 << 6), + S_MGR_TEMP_RMS_DET_WARN_MIN_ALARM = (1 << 7), + S_MGR_TEMP_RMS_DET_WARN_MAX_ALARM = (1 << 8), + S_MGR_TEMP_OCXO_WARN_MIN_ALARM = (1 << 9), + S_MGR_TEMP_OCXO_WARN_MAX_ALARM = (1 << 10), + S_MGR_TEMP_TRX0_WARN_MIN_ALARM = (1 << 11), + S_MGR_TEMP_TRX0_WARN_MAX_ALARM = (1 << 12), + S_MGR_TEMP_TRX1_WARN_MIN_ALARM = (1 << 13), + S_MGR_TEMP_TRX1_WARN_MAX_ALARM = (1 << 14), + S_MGR_TEMP_PA0_WARN_MIN_ALARM = (1 << 15), + S_MGR_TEMP_PA0_WARN_MAX_ALARM = (1 << 16), + S_MGR_TEMP_PA1_WARN_MIN_ALARM = (1 << 17), + S_MGR_TEMP_PA1_WARN_MAX_ALARM = (1 << 18), + S_MGR_SUPPLY_WARN_MIN_ALARM = (1 << 19), + S_MGR_SUPPLY_WARN_MAX_ALARM = (1 << 20), + S_MGR_VSWR0_WARN_MAX_ALARM = (1 << 21), + S_MGR_VSWR1_WARN_MAX_ALARM = (1 << 22), + S_MGR_PWR_SUPPLY_WARN_MAX_ALARM = (1 << 23), + S_MGR_PWR_PA0_WARN_MAX_ALARM = (1 << 24), + S_MGR_PWR_PA1_WARN_MAX_ALARM = (1 << 25), + S_MGR_GPS_FIX_WARN_ALARM = (1 << 26), + _S_MGR_WARN_ALARM_MAX, +}; + +enum lc15bts_mgr_failure_event_causes { + /* Critical causes */ + NM_EVT_CAUSE_CRIT_TEMP_SUPPLY_MAX_FAIL = 0x4100, + NM_EVT_CAUSE_CRIT_TEMP_FPGA_MAX_FAIL = 0x4101, + NM_EVT_CAUSE_CRIT_TEMP_SOC_MAX_FAIL = 0x4102, + NM_EVT_CAUSE_CRIT_TEMP_RMS_DET_MAX_FAIL = 0x4103, + NM_EVT_CAUSE_CRIT_TEMP_OCXO_MAX_FAIL = 0x4104, + NM_EVT_CAUSE_CRIT_TEMP_TRX0_MAX_FAIL = 0x4105, + NM_EVT_CAUSE_CRIT_TEMP_TRX1_MAX_FAIL = 0x4106, + NM_EVT_CAUSE_CRIT_TEMP_PA0_MAX_FAIL = 0x4107, + NM_EVT_CAUSE_CRIT_TEMP_PA1_MAX_FAIL = 0x4108, + NM_EVT_CAUSE_CRIT_SUPPLY_MAX_FAIL = 0x4109, + NM_EVT_CAUSE_CRIT_SUPPLY_MIN_FAIL = 0x410A, + NM_EVT_CAUSE_CRIT_VSWR0_MAX_FAIL = 0x410B, + NM_EVT_CAUSE_CRIT_VSWR1_MAX_FAIL = 0x410C, + NM_EVT_CAUSE_CRIT_PWR_SUPPLY_MAX_FAIL = 0x410D, + NM_EVT_CAUSE_CRIT_PWR_PA0_MAX_FAIL = 0x410E, + NM_EVT_CAUSE_CRIT_PWR_PA1_MAX_FAIL = 0x410F, + /* Warning causes */ + NM_EVT_CAUSE_WARN_TEMP_SUPPLY_LOW_FAIL = 0x4400, + NM_EVT_CAUSE_WARN_TEMP_SUPPLY_HIGH_FAIL = 0x4401, + NM_EVT_CAUSE_WARN_TEMP_FPGA_LOW_FAIL = 0x4402, + NM_EVT_CAUSE_WARN_TEMP_FPGA_HIGH_FAIL = 0x4403, + NM_EVT_CAUSE_WARN_TEMP_SOC_LOW_FAIL = 0x4404, + NM_EVT_CAUSE_WARN_TEMP_SOC_HIGH_FAIL = 0x4405, + NM_EVT_CAUSE_WARN_TEMP_RMS_DET_LOW_FAIL = 0x4406, + NM_EVT_CAUSE_WARN_TEMP_RMS_DET_HIGH_FAIL= 0x4407, + NM_EVT_CAUSE_WARN_TEMP_OCXO_LOW_FAIL = 0x4408, + NM_EVT_CAUSE_WARN_TEMP_OCXO_HIGH_FAIL = 0x4409, + NM_EVT_CAUSE_WARN_TEMP_TRX0_LOW_FAIL = 0x440A, + NM_EVT_CAUSE_WARN_TEMP_TRX0_HIGH_FAIL = 0x440B, + NM_EVT_CAUSE_WARN_TEMP_TRX1_LOW_FAIL = 0x440C, + NM_EVT_CAUSE_WARN_TEMP_TRX1_HIGH_FAIL = 0x440D, + NM_EVT_CAUSE_WARN_TEMP_PA0_LOW_FAIL = 0x440E, + NM_EVT_CAUSE_WARN_TEMP_PA0_HIGH_FAIL = 0x440F, + NM_EVT_CAUSE_WARN_TEMP_PA1_LOW_FAIL = 0x4410, + NM_EVT_CAUSE_WARN_TEMP_PA1_HIGH_FAIL = 0x4411, + NM_EVT_CAUSE_WARN_SUPPLY_LOW_FAIL = 0x4412, + NM_EVT_CAUSE_WARN_SUPPLY_HIGH_FAIL = 0x4413, + NM_EVT_CAUSE_WARN_VSWR0_HIGH_FAIL = 0x4414, + NM_EVT_CAUSE_WANR_VSWR1_HIGH_FAIL = 0x4415, + NM_EVT_CAUSE_WARN_PWR_SUPPLY_HIGH_FAIL = 0x4416, + NM_EVT_CAUSE_WARN_PWR_PA0_HIGH_FAIL = 0x4417, + NM_EVT_CAUSE_WARN_PWR_PA1_HIGH_FAIL = 0x4418, + NM_EVT_CAUSE_WARN_GPS_FIX_FAIL = 0x4419, +}; + +/* This defines the list of notification events for systemd service watchdog. + all these events must be notified in a certain service defined timeslot + or the service (this app) would be restarted (only if related systemd service + unit file has WatchdogSec!=0). + WARNING: swd events must begin with event 0. Last events must be + SWD_LAST (max 64 events in this list). +*/ +enum mgr_swd_events { + SWD_MAINLOOP = 0, + SWD_CHECK_SENSOR, + SWD_UPDATE_HOURS, + SWD_CHECK_TEMP_SENSOR, + SWD_CHECK_LED_CTRL, + SWD_CHECK_CALIB, + SWD_CHECK_BTS_CONNECTION, + SWD_LAST }; int lc15bts_mgr_vty_init(void); int lc15bts_mgr_parse_config(struct lc15bts_mgr_instance *mgr); int lc15bts_mgr_nl_init(void); -int lc15bts_mgr_temp_init(struct lc15bts_mgr_instance *mgr); -const char *lc15bts_mgr_temp_get_state(enum lc15bts_temp_state state); - +int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr); +const char *lc15bts_mgr_sensor_get_state(enum lc15bts_sensor_state state); int lc15bts_mgr_calib_init(struct lc15bts_mgr_instance *mgr); +int lc15bts_mgr_control_init(struct lc15bts_mgr_instance *mgr); int lc15bts_mgr_calib_run(struct lc15bts_mgr_instance *mgr); - +void lc15bts_mgr_dispatch_alarm(struct lc15bts_mgr_instance *mgr, const int cause, const char *key, const char *text); extern void *tall_mgr_ctx; #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 042fc87..9d2dfec 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -22,19 +22,22 @@ * along with this program. If not, see . * */ - +#include #include "misc/lc15bts_mgr.h" #include "misc/lc15bts_misc.h" #include "misc/lc15bts_temp.h" #include "misc/lc15bts_power.h" +#include "misc/lc15bts_led.h" +#include "limits.h" #include #include #include +#include -static struct lc15bts_mgr_instance *s_mgr; -static struct osmo_timer_list temp_ctrl_timer; +struct lc15bts_mgr_instance *s_mgr; +static struct osmo_timer_list sensor_ctrl_timer; static const struct value_string state_names[] = { { STATE_NORMAL, "NORMAL" }, @@ -44,12 +47,12 @@ { 0, NULL } }; -const char *lc15bts_mgr_temp_get_state(enum lc15bts_temp_state state) +const char *lc15bts_mgr_sensor_get_state(enum lc15bts_sensor_state state) { return get_value_string(state_names, state); } -static int next_state(enum lc15bts_temp_state current_state, int critical, int warning) +static int next_state(enum lc15bts_sensor_state current_state, int critical, int warning) { int next_state = -1; switch (current_state) { @@ -85,7 +88,7 @@ static void handle_normal_actions(int actions) { /* switch on the PA */ - if (actions & TEMP_ACT_NORM_PA0_ON) { + if (actions & SENSOR_ACT_NORM_PA0_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA0, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch on the PA #0\n"); @@ -95,7 +98,7 @@ } } - if (actions & TEMP_ACT_NORM_PA1_ON) { + if (actions & SENSOR_ACT_NORM_PA1_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch on the PA #1\n"); @@ -105,7 +108,7 @@ } } - if (actions & TEMP_ACT_NORM_BTS_SRV_ON) { + if (actions & SENSOR_ACT_NORM_BTS_SRV_ON) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch on the BTS service\n"); /* @@ -120,7 +123,7 @@ static void handle_actions(int actions) { /* switch off the PA */ - if (actions & TEMP_ACT_PA1_OFF) { + if (actions & SENSOR_ACT_PA1_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch off the PA #1. Stop BTS?\n"); @@ -130,7 +133,7 @@ } } - if (actions & TEMP_ACT_PA0_OFF) { + if (actions & SENSOR_ACT_PA0_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA0, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch off the PA #0. Stop BTS?\n"); @@ -140,7 +143,7 @@ } } - if (actions & TEMP_ACT_BTS_SRV_OFF) { + if (actions & SENSOR_ACT_BTS_SRV_OFF) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch off the BTS service\n"); /* @@ -161,36 +164,36 @@ */ static void execute_normal_act(struct lc15bts_mgr_instance *manager) { - LOGP(DTEMP, LOGL_NOTICE, "System is back to normal temperature.\n"); - handle_normal_actions(manager->temp.action_norm); + LOGP(DTEMP, LOGL_NOTICE, "System is back to normal state.\n"); + handle_normal_actions(manager->state.action_norm); } static void execute_warning_act(struct lc15bts_mgr_instance *manager) { - LOGP(DTEMP, LOGL_NOTICE, "System has reached temperature warning.\n"); - handle_actions(manager->temp.action_warn); + LOGP(DTEMP, LOGL_NOTICE, "System has reached warning state.\n"); + handle_actions(manager->state.action_warn); } static void execute_critical_act(struct lc15bts_mgr_instance *manager) { LOGP(DTEMP, LOGL_NOTICE, "System has reached critical warning.\n"); - handle_actions(manager->temp.action_crit); + handle_actions(manager->state.action_crit); } -static void lc15bts_mgr_temp_handle(struct lc15bts_mgr_instance *manager, +static void lc15bts_mgr_sensor_handle(struct lc15bts_mgr_instance *manager, int critical, int warning) { - int new_state = next_state(manager->temp.state, critical, warning); + int new_state = next_state(manager->state.state, critical, warning); /* Nothing changed */ if (new_state < 0) return; LOGP(DTEMP, LOGL_NOTICE, "Moving from state %s to %s.\n", - get_value_string(state_names, manager->temp.state), + get_value_string(state_names, manager->state.state), get_value_string(state_names, new_state)); - manager->temp.state = new_state; - switch (manager->temp.state) { + manager->state.state = new_state; + switch (manager->state.state) { case STATE_NORMAL: execute_normal_act(manager); break; @@ -206,163 +209,168 @@ }; } -static void temp_ctrl_check() +static void sensor_ctrl_check(struct lc15bts_mgr_instance *mgr) { int rc; + int temp = 0; int warn_thresh_passed = 0; int crit_thresh_passed = 0; LOGP(DTEMP, LOGL_DEBUG, "Going to check the temperature.\n"); /* Read the current supply temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY); + rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the supply temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.supply_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.supply_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.supply_limit.thresh_crit) + if (temp > mgr->temp.supply_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "Supply temperature is: %d\n", temp); } /* Read the current SoC temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SOC); + rc = lc15bts_temp_get(LC15BTS_TEMP_SOC, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the SoC temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.soc_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.soc_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.soc_limit.thresh_crit) + if (temp > mgr->temp.soc_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "SoC temperature is: %d\n", temp); } /* Read the current fpga temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA); + rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the fpga temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.fpga_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.fpga_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.fpga_limit.thresh_crit) + if (temp > mgr->temp.fpga_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "FPGA temperature is: %d\n", temp); } - /* Read the current RF log detector temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_LOGRF); + /* Read the current RMS detector temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_RMSDET, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the RF log detector temperature. rc=%d\n", rc); + "Failed to read the RMS detector temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.logrf_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.rmsdet_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.logrf_limit.thresh_crit) + if (temp > mgr->temp.rmsdet_temp_limit.thresh_crit_max) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "RF log detector temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "RMS detector temperature is: %d\n", temp); } /* Read the current OCXO temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO); + rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the OCXO temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.ocxo_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.ocxo_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.ocxo_limit.thresh_crit) + if (temp > mgr->temp.ocxo_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "OCXO temperature is: %d\n", temp); } - /* Read the current TX #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX0); + /* Read the current TX #0 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX0, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.tx0_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.tx0_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx0_limit.thresh_crit) + if (temp > mgr->temp.tx0_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "TX #0 temperature is: %d\n", temp); } - /* Read the current TX #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX1); + /* Read the current TX #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX1, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #1 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.tx1_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.tx1_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx1_limit.thresh_crit) + if (temp > mgr->temp.tx1_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "TX #1 temperature is: %d\n", temp); } - /* Read the current PA #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA0); + /* Read the current PA #0 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA0, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa0_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.pa0_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa0_limit.thresh_crit) + if (temp > mgr->temp.pa0_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #0 temperature is: %d\n", temp); } - /* Read the current PA #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA1); + /* Read the current PA #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA1, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #1 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa1_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.pa1_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa1_limit.thresh_crit) + if (temp > mgr->temp.pa1_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #1 temperature is: %d\n", temp); } - lc15bts_mgr_temp_handle(s_mgr, crit_thresh_passed, warn_thresh_passed); + lc15bts_mgr_sensor_handle(mgr, crit_thresh_passed, warn_thresh_passed); } -static void temp_ctrl_check_cb(void *unused) +static void sensor_ctrl_check_cb(void *_data) { - temp_ctrl_check(); - /* Check every two minutes? XXX make it configurable! */ - osmo_timer_schedule(&temp_ctrl_timer, 2 * 60, 0); + struct lc15bts_mgr_instance *mgr = _data; + sensor_ctrl_check(mgr); + /* Check every minute? XXX make it configurable! */ + osmo_timer_schedule(&sensor_ctrl_timer, LC15BTS_SENSOR_TIMER_DURATION, 0); + LOGP(DTEMP, LOGL_DEBUG,"Check sensors timer expired\n"); + /* TODO: do we want to notify if some sensors could not be read? */ } -int lc15bts_mgr_temp_init(struct lc15bts_mgr_instance *mgr) +int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr) { s_mgr = mgr; - temp_ctrl_timer.cb = temp_ctrl_check_cb; - temp_ctrl_check_cb(NULL); + sensor_ctrl_timer.cb = sensor_ctrl_check_cb; + sensor_ctrl_timer.data = s_mgr; + sensor_ctrl_check_cb(s_mgr); return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index 280c9c7..b96349e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -43,6 +44,7 @@ #include "lc15bts_mgr.h" #include "lc15bts_temp.h" #include "lc15bts_power.h" +#include "lc15bts_led.h" #include "btsconfig.h" static struct lc15bts_mgr_instance *s_mgr; @@ -64,15 +66,21 @@ case ACT_NORM_NODE: case ACT_WARN_NODE: case ACT_CRIT_NODE: - case LIMIT_SUPPLY_NODE: + case LIMIT_SUPPLY_TEMP_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_LOGRF_NODE: + case LIMIT_RMSDET_NODE: case LIMIT_OCXO_NODE: - case LIMIT_TX0_NODE: - case LIMIT_TX1_NODE: - case LIMIT_PA0_NODE: - case LIMIT_PA1_NODE: + case LIMIT_TX0_TEMP_NODE: + case LIMIT_TX1_TEMP_NODE: + case LIMIT_PA0_TEMP_NODE: + case LIMIT_PA1_TEMP_NODE: + case LIMIT_SUPPLY_VOLT_NODE: + case LIMIT_TX0_VSWR_NODE: + case LIMIT_TX1_VSWR_NODE: + case LIMIT_SUPPLY_PWR_NODE: + case LIMIT_PA0_PWR_NODE: + case LIMIT_PA1_PWR_NODE: vty->node = MGR_NODE; break; default: @@ -88,15 +96,21 @@ case ACT_NORM_NODE: case ACT_WARN_NODE: case ACT_CRIT_NODE: - case LIMIT_SUPPLY_NODE: + case LIMIT_SUPPLY_TEMP_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_LOGRF_NODE: + case LIMIT_RMSDET_NODE: case LIMIT_OCXO_NODE: - case LIMIT_TX0_NODE: - case LIMIT_TX1_NODE: - case LIMIT_PA0_NODE: - case LIMIT_PA1_NODE: + case LIMIT_TX0_TEMP_NODE: + case LIMIT_TX1_TEMP_NODE: + case LIMIT_PA0_TEMP_NODE: + case LIMIT_PA1_TEMP_NODE: + case LIMIT_SUPPLY_VOLT_NODE: + case LIMIT_TX0_VSWR_NODE: + case LIMIT_TX1_VSWR_NODE: + case LIMIT_SUPPLY_PWR_NODE: + case LIMIT_PA0_PWR_NODE: + case LIMIT_PA1_PWR_NODE: return 1; default: return 0; @@ -122,25 +136,25 @@ static struct cmd_node act_norm_node = { ACT_NORM_NODE, - "%s(action-normal)# ", + "%s(actions-normal)# ", 1, }; static struct cmd_node act_warn_node = { ACT_WARN_NODE, - "%s(action-warn)# ", + "%s(actions-warn)# ", 1, }; static struct cmd_node act_crit_node = { ACT_CRIT_NODE, - "%s(action-critical)# ", + "%s(actions-critical)# ", 1, }; -static struct cmd_node limit_supply_node = { - LIMIT_SUPPLY_NODE, - "%s(limit-supply)# ", +static struct cmd_node limit_supply_temp_node = { + LIMIT_SUPPLY_TEMP_NODE, + "%s(limit-supply-temp)# ", 1, }; @@ -156,9 +170,9 @@ 1, }; -static struct cmd_node limit_logrf_node = { - LIMIT_LOGRF_NODE, - "%s(limit-logrf)# ", +static struct cmd_node limit_rmsdet_node = { + LIMIT_RMSDET_NODE, + "%s(limit-rmsdet)# ", 1, }; @@ -168,24 +182,60 @@ 1, }; -static struct cmd_node limit_tx0_node = { - LIMIT_TX0_NODE, - "%s(limit-tx0)# ", +static struct cmd_node limit_tx0_temp_node = { + LIMIT_TX0_TEMP_NODE, + "%s(limit-tx0-temp)# ", 1, }; -static struct cmd_node limit_tx1_node = { - LIMIT_TX1_NODE, - "%s(limit-tx1)# ", +static struct cmd_node limit_tx1_temp_node = { + LIMIT_TX1_TEMP_NODE, + "%s(limit-tx1-temp)# ", 1, }; -static struct cmd_node limit_pa0_node = { - LIMIT_PA0_NODE, - "%s(limit-pa0)# ", +static struct cmd_node limit_pa0_temp_node = { + LIMIT_PA0_TEMP_NODE, + "%s(limit-pa0-temp)# ", 1, }; -static struct cmd_node limit_pa1_node = { - LIMIT_PA1_NODE, - "%s(limit-pa1)# ", +static struct cmd_node limit_pa1_temp_node = { + LIMIT_PA1_TEMP_NODE, + "%s(limit-pa1-temp)# ", + 1, +}; +static struct cmd_node limit_supply_volt_node = { + LIMIT_SUPPLY_VOLT_NODE, + "%s(limit-supply-volt)# ", + 1, +}; +static struct cmd_node limit_tx0_vswr_node = { + LIMIT_TX0_VSWR_NODE, + "%s(limit-tx0-vswr)# ", + 1, +}; +static struct cmd_node limit_tx1_vswr_node = { + LIMIT_TX1_VSWR_NODE, + "%s(limit-tx1-vswr)# ", + 1, +}; +static struct cmd_node limit_supply_pwr_node = { + LIMIT_SUPPLY_PWR_NODE, + "%s(limit-supply-pwr)# ", + 1, +}; +static struct cmd_node limit_pa0_pwr_node = { + LIMIT_PA0_PWR_NODE, + "%s(limit-pa0-pwr)# ", + 1, +}; +static struct cmd_node limit_pa1_pwr_node = { + LIMIT_PA1_PWR_NODE, + "%s(limit-pa1-pwr)# ", + 1, +}; + +static struct cmd_node limit_gps_fix_node = { + LIMIT_GPS_FIX_NODE, + "%s(limit-gps-fix)# ", 1, }; @@ -197,55 +247,68 @@ return CMD_SUCCESS; } -static void write_temp_limit(struct vty *vty, const char *name, - struct lc15bts_temp_limit *limit) +static void write_volt_limit(struct vty *vty, const char *name, + struct lc15bts_volt_limit *limit) { vty_out(vty, " %s%s", name, VTY_NEWLINE); - vty_out(vty, " threshold warning %d%s", - limit->thresh_warn, VTY_NEWLINE); - vty_out(vty, " threshold critical %d%s", - limit->thresh_crit, VTY_NEWLINE); + vty_out(vty, " threshold warning min %d%s", + limit->thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " threshold critical min %d%s", + limit->thresh_crit_min, VTY_NEWLINE); +} + +static void write_vswr_limit(struct vty *vty, const char *name, + struct lc15bts_vswr_limit *limit) +{ + vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " threshold warning max %d%s", + limit->thresh_warn_max, VTY_NEWLINE); +} + +static void write_pwr_limit(struct vty *vty, const char *name, + struct lc15bts_pwr_limit *limit) +{ + vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " threshold warning max %d%s", + limit->thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " threshold critical max %d%s", + limit->thresh_crit_max, VTY_NEWLINE); } static void write_norm_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); vty_out(vty, " %spa0-on%s", - (actions & TEMP_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-on%s", - (actions & TEMP_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-on%s", - (actions & TEMP_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); } static void write_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); vty_out(vty, " %spa0-off%s", - (actions & TEMP_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-off%s", - (actions & TEMP_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-off%s", - (actions & TEMP_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); } static int config_write_mgr(struct vty *vty) { vty_out(vty, "lc15bts-mgr%s", VTY_NEWLINE); - write_temp_limit(vty, "limits supply", &s_mgr->temp.supply_limit); - write_temp_limit(vty, "limits soc", &s_mgr->temp.soc_limit); - write_temp_limit(vty, "limits fpga", &s_mgr->temp.fpga_limit); - write_temp_limit(vty, "limits logrf", &s_mgr->temp.logrf_limit); - write_temp_limit(vty, "limits ocxo", &s_mgr->temp.ocxo_limit); - write_temp_limit(vty, "limits tx0", &s_mgr->temp.tx0_limit); - write_temp_limit(vty, "limits tx1", &s_mgr->temp.tx1_limit); - write_temp_limit(vty, "limits pa0", &s_mgr->temp.pa0_limit); - write_temp_limit(vty, "limits pa1", &s_mgr->temp.pa1_limit); + write_volt_limit(vty, "limits supply_volt", &s_mgr->volt.supply_volt_limit); + write_pwr_limit(vty, "limits supply_pwr", &s_mgr->pwr.supply_pwr_limit); + write_vswr_limit(vty, "limits tx0_vswr", &s_mgr->vswr.tx0_vswr_limit); + write_vswr_limit(vty, "limits tx1_vswr", &s_mgr->vswr.tx1_vswr_limit); - write_norm_action(vty, "actions normal", s_mgr->temp.action_norm); - write_action(vty, "actions warn", s_mgr->temp.action_warn); - write_action(vty, "actions critical", s_mgr->temp.action_crit); + write_norm_action(vty, "actions normal", s_mgr->state.action_norm); + write_action(vty, "actions warn", s_mgr->state.action_warn); + write_action(vty, "actions critical", s_mgr->state.action_crit); return CMD_SUCCESS; } @@ -255,7 +318,7 @@ return CMD_SUCCESS; } -#define CFG_LIMIT(name, expl, switch_to, variable) \ +#define CFG_LIMIT_TEMP(name, expl, switch_to, variable) \ DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ "limits " #name, \ "Configure Limits\n" expl) \ @@ -265,32 +328,123 @@ return CMD_SUCCESS; \ } -CFG_LIMIT(supply, "SUPPLY\n", LIMIT_SUPPLY_NODE, supply_limit) -CFG_LIMIT(soc, "SOC\n", LIMIT_SOC_NODE, soc_limit) -CFG_LIMIT(fpga, "FPGA\n", LIMIT_FPGA_NODE, fpga_limit) -CFG_LIMIT(logrf, "LOGRF\n", LIMIT_LOGRF_NODE, logrf_limit) -CFG_LIMIT(ocxo, "OCXO\n", LIMIT_OCXO_NODE, ocxo_limit) -CFG_LIMIT(tx0, "TX0\n", LIMIT_TX0_NODE, tx0_limit) -CFG_LIMIT(tx1, "TX1\n", LIMIT_TX1_NODE, tx1_limit) -CFG_LIMIT(pa0, "PA0\n", LIMIT_PA0_NODE, pa0_limit) -CFG_LIMIT(pa1, "PA1\n", LIMIT_PA1_NODE, pa1_limit) -#undef CFG_LIMIT +CFG_LIMIT_TEMP(supply_temp, "SUPPLY TEMP\n", LIMIT_SUPPLY_TEMP_NODE, supply_temp_limit) +CFG_LIMIT_TEMP(soc_temp, "SOC TEMP\n", LIMIT_SOC_NODE, soc_temp_limit) +CFG_LIMIT_TEMP(fpga_temp, "FPGA TEMP\n", LIMIT_FPGA_NODE, fpga_temp_limit) +CFG_LIMIT_TEMP(rmsdet_temp, "RMSDET TEMP\n", LIMIT_RMSDET_NODE, rmsdet_temp_limit) +CFG_LIMIT_TEMP(ocxo_temp, "OCXO TEMP\n", LIMIT_OCXO_NODE, ocxo_temp_limit) +CFG_LIMIT_TEMP(tx0_temp, "TX0 TEMP\n", LIMIT_TX0_TEMP_NODE, tx0_temp_limit) +CFG_LIMIT_TEMP(tx1_temp, "TX1 TEMP\n", LIMIT_TX1_TEMP_NODE, tx1_temp_limit) +CFG_LIMIT_TEMP(pa0_temp, "PA0 TEMP\n", LIMIT_PA0_TEMP_NODE, pa0_temp_limit) +CFG_LIMIT_TEMP(pa1_temp, "PA1 TEMP\n", LIMIT_PA1_TEMP_NODE, pa1_temp_limit) +#undef CFG_LIMIT_TEMP -DEFUN(cfg_limit_warning, cfg_thresh_warning_cmd, - "threshold warning <0-200>", +#define CFG_LIMIT_VOLT(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->volt.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_VOLT(supply_volt, "SUPPLY VOLT\n", LIMIT_SUPPLY_VOLT_NODE, supply_volt_limit) +#undef CFG_LIMIT_VOLT + +#define CFG_LIMIT_VSWR(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->vswr.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_VSWR(tx0_vswr, "TX0 VSWR\n", LIMIT_TX0_VSWR_NODE, tx0_vswr_limit) +CFG_LIMIT_VSWR(tx1_vswr, "TX1 VSWR\n", LIMIT_TX1_VSWR_NODE, tx1_vswr_limit) +#undef CFG_LIMIT_VSWR + +#define CFG_LIMIT_PWR(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->pwr.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_PWR(supply_pwr, "SUPPLY PWR\n", LIMIT_SUPPLY_PWR_NODE, supply_pwr_limit) +CFG_LIMIT_PWR(pa0_pwr, "PA0 PWR\n", LIMIT_PA0_PWR_NODE, pa0_pwr_limit) +CFG_LIMIT_PWR(pa1_pwr, "PA1 PWR\n", LIMIT_PA1_PWR_NODE, pa1_pwr_limit) +#undef CFG_LIMIT_PWR + +#define CFG_LIMIT_GPS_FIX(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->gps.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_GPS_FIX(gps_fix, "GPS FIX\n", LIMIT_GPS_FIX_NODE, gps_fix_limit) +#undef CFG_LIMIT_GPS_FIX + +DEFUN(cfg_limit_volt_warn_min, cfg_thresh_volt_warn_min_cmd, + "threshold warning min <0-48000>", "Threshold to reach\n" "Warning level\n" "Range\n") { - struct lc15bts_temp_limit *limit = vty->index; - limit->thresh_warn = atoi(argv[0]); + struct lc15bts_volt_limit *limit = vty->index; + limit->thresh_warn_min = atoi(argv[0]); return CMD_SUCCESS; } -DEFUN(cfg_limit_crit, cfg_thresh_crit_cmd, - "threshold critical <0-200>", - "Threshold to reach\n" "Severe level\n" "Range\n") +DEFUN(cfg_limit_volt_crit_min, cfg_thresh_volt_crit_min_cmd, + "threshold critical min <0-48000>", + "Threshold to reach\n" "Critical level\n" "Range\n") { - struct lc15bts_temp_limit *limit = vty->index; - limit->thresh_crit = atoi(argv[0]); + struct lc15bts_volt_limit *limit = vty->index; + limit->thresh_crit_min = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_vswr_warn_max, cfg_thresh_vswr_warn_max_cmd, + "threshold warning max <1000-200000>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_vswr_limit *limit = vty->index; + limit->thresh_warn_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_vswr_crit_max, cfg_thresh_vswr_crit_max_cmd, + "threshold critical max <1000-200000>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_vswr_limit *limit = vty->index; + limit->thresh_crit_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_pwr_warn_max, cfg_thresh_pwr_warn_max_cmd, + "threshold warning max <0-200>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_pwr_limit *limit = vty->index; + limit->thresh_warn_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_pwr_crit_max, cfg_thresh_pwr_crit_max_cmd, + "threshold critical max <0-200>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_pwr_limit *limit = vty->index; + limit->thresh_crit_max = atoi(argv[0]); return CMD_SUCCESS; } @@ -300,7 +454,7 @@ "Configure Actions\n" expl) \ { \ vty->node = switch_to; \ - vty->index = &s_mgr->temp.variable; \ + vty->index = &s_mgr->state.variable; \ return CMD_SUCCESS; \ } CFG_ACTION(normal, "Normal Actions\n", ACT_NORM_NODE, action_norm) @@ -313,7 +467,7 @@ "Switch the Power Amplifier #0 on\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_PA0_ON; + *action |= SENSOR_ACT_NORM_PA0_ON; return CMD_SUCCESS; } @@ -322,7 +476,7 @@ NO_STR "Switch the Power Amplifieri #0 on\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA0_ON; + *action &= ~SENSOR_ACT_NORM_PA0_ON; return CMD_SUCCESS; } @@ -331,7 +485,7 @@ "Switch the Power Amplifier #1 on\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_PA1_ON; + *action |= SENSOR_ACT_NORM_PA1_ON; return CMD_SUCCESS; } @@ -340,7 +494,7 @@ NO_STR "Switch the Power Amplifieri #1 on\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA1_ON; + *action &= ~SENSOR_ACT_NORM_PA1_ON; return CMD_SUCCESS; } @@ -349,7 +503,7 @@ "Start the systemd lc15bts.service\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_BTS_SRV_ON; + *action |= SENSOR_ACT_NORM_BTS_SRV_ON; return CMD_SUCCESS; } @@ -358,7 +512,7 @@ NO_STR "Start the systemd lc15bts.service\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_BTS_SRV_ON; + *action &= ~SENSOR_ACT_NORM_BTS_SRV_ON; return CMD_SUCCESS; } @@ -367,7 +521,7 @@ "Switch the Power Amplifier #0 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA0_OFF; + *action |= SENSOR_ACT_PA0_OFF; return CMD_SUCCESS; } @@ -376,7 +530,7 @@ NO_STR "Do not switch off the Power Amplifier #0\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA0_OFF; + *action &= ~SENSOR_ACT_PA0_OFF; return CMD_SUCCESS; } @@ -385,7 +539,7 @@ "Switch the Power Amplifier #1 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA1_OFF; + *action |= SENSOR_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -394,7 +548,7 @@ NO_STR "Do not switch off the Power Amplifier #1\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA1_OFF; + *action &= ~SENSOR_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -403,7 +557,7 @@ "Stop the systemd lc15bts.service\n") { int *action = vty->index; - *action |= TEMP_ACT_BTS_SRV_OFF; + *action |= SENSOR_ACT_BTS_SRV_OFF; return CMD_SUCCESS; } @@ -412,71 +566,173 @@ NO_STR "Stop the systemd lc15bts.service\n") { int *action = vty->index; - *action &= ~TEMP_ACT_BTS_SRV_OFF; + *action &= ~SENSOR_ACT_BTS_SRV_OFF; return CMD_SUCCESS; } DEFUN(show_mgr, show_mgr_cmd, "show manager", SHOW_STR "Display information about the manager") { + int temp, volt, current, power, vswr; + vty_out(vty, "Warning alarm flags: 0x%08x%s", + s_mgr->lc15bts_ctrl.warn_flags, VTY_NEWLINE); + vty_out(vty, "Critical alarm flags: 0x%08x%s", + s_mgr->lc15bts_ctrl.crit_flags, VTY_NEWLINE); + vty_out(vty, "Preventive action retried: %d%s", + s_mgr->alarms.preventive_retry, VTY_NEWLINE); vty_out(vty, "Temperature control state: %s%s", - lc15bts_mgr_temp_get_state(s_mgr->temp.state), VTY_NEWLINE); + lc15bts_mgr_sensor_get_state(s_mgr->state.state), VTY_NEWLINE); vty_out(vty, "Current Temperatures%s", VTY_NEWLINE); - vty_out(vty, " Main Supply : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SUPPLY) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, &temp); + vty_out(vty, " Main Supply : %4.2f Celcius%s", + temp/ 1000.0f, VTY_NEWLINE); - vty_out(vty, " SoC : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SOC) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SOC, &temp); + vty_out(vty, " SoC : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " FPGA : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_FPGA) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_FPGA, &temp); + vty_out(vty, " FPGA : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " LogRF : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_LOGRF) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_RMSDET, &temp); + vty_out(vty, " RMSDet : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " OCXO : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_OCXO) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_OCXO, &temp); + vty_out(vty, " OCXO : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 0 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX0) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX0, &temp); + vty_out(vty, " TX 0 : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 1 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX1) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX1, &temp); + vty_out(vty, " TX 1 : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Power Amp #0: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA0) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA0, &temp); + vty_out(vty, " Power Amp #0: %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Power Amp #1: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA1) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA1, &temp); + vty_out(vty, " Power Amp #1: %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); vty_out(vty, "Power Status%s", VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Main Supply : ON [%6.2f Vdc, %4.2f A, %6.2f W]%s", - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Power Amp #0: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_get(LC15BTS_POWER_PA0) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Power Amp #1: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_get(LC15BTS_POWER_PA1) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + vty_out(vty, "VSWR Status%s", VTY_NEWLINE); + lc15bts_vswr_get(LC15BTS_VSWR_TX0, &vswr); + vty_out(vty, " VSWR TX 0: %f %s", + vswr / 1000.0f, + VTY_NEWLINE); + lc15bts_vswr_get(LC15BTS_VSWR_TX1, &vswr); + vty_out(vty, " VSWR TX 1: %f %s", + vswr / 1000.0f, + VTY_NEWLINE); + + return CMD_SUCCESS; +} + +DEFUN(show_thresh, show_thresh_cmd, "show thresholds", + SHOW_STR "Display information about the thresholds") +{ + vty_out(vty, "Temperature limits (Celsius)%s", VTY_NEWLINE); + vty_out(vty, " Main supply%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.supply_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.supply_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.supply_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " SoC%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.soc_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.soc_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.soc_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " FPGA%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.fpga_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.fpga_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.fpga_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " RMSDet%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " OCXO%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " TX0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.tx0_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.tx0_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.tx0_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " TX1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.tx1_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.tx1_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.tx1_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " PA0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.pa0_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.pa0_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.pa0_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " PA1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.pa1_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.pa1_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.pa1_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, "Power limits%s", VTY_NEWLINE); + vty_out(vty, " Main supply (mV)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->volt.supply_volt_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->volt.supply_volt_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->volt.supply_volt_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " Critical min : %d%s",s_mgr->volt.supply_volt_limit.thresh_crit_min, VTY_NEWLINE); + vty_out(vty, " Main supply power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.supply_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.supply_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " PA0 power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.pa0_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.pa0_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " PA1 power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.pa1_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.pa1_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, "VSWR limits%s", VTY_NEWLINE); + vty_out(vty, " TX0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->vswr.tx0_vswr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->vswr.tx0_vswr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " TX1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->vswr.tx1_vswr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->vswr.tx1_vswr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, "Days since last GPS 3D fix%s", VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->gps.gps_fix_limit.thresh_warn_max, VTY_NEWLINE); return CMD_SUCCESS; } @@ -493,10 +749,153 @@ return CMD_SUCCESS; } -static void register_limit(int limit) +DEFUN(set_led_pattern, set_led_pattern_cmd, + "set led pattern <0-255>", + "Set LED pattern\n" + "Set LED pattern for debugging purpose only. This pattern will be overridden after 60 seconds by LED pattern of actual system state\n") { - install_element(limit, &cfg_thresh_warning_cmd); - install_element(limit, &cfg_thresh_crit_cmd); + int pattern_id = atoi(argv[0]); + + if ((pattern_id < 0) || (pattern_id > BLINK_PATTERN_MAX_ITEM)) { + vty_out(vty, "%%Invalid LED pattern ID. It must be in range of %d..%d %s", 0, BLINK_PATTERN_MAX_ITEM - 1, VTY_NEWLINE); + return CMD_WARNING; + } + + led_set(s_mgr, pattern_id); + return CMD_SUCCESS; +} + +DEFUN(force_mgr_state, force_mgr_state_cmd, + "force manager state <0-255>", + "Force BTS manager state\n" + "Force BTS manager state for debugging purpose only\n") +{ + int state = atoi(argv[0]); + + if ((state < 0) || (state > STATE_CRITICAL)) { + vty_out(vty, "%%Invalid BTS manager state. It must be in range of %d..%d %s", 0, STATE_CRITICAL, VTY_NEWLINE); + return CMD_WARNING; + } + + s_mgr->state.state = state; + return CMD_SUCCESS; +} + +#define LIMIT_TEMP(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_temp_##name##_##variable, limit_temp_##name##_##variable##_cmd, \ + "limit temp " #name " " #criticity " " #min_max " <-200-200>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->temp.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_warn_min, warning, min) +#undef LIMIT_TEMP + +#define LIMIT_VOLT(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_volt_##name##_##variable, limit_volt_##name##_##variable##_cmd, \ + "limit " #name " " #criticity " " #min_max " <0-48000>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->volt.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_warn_max, warning, max) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_crit_max, critical, max) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_warn_min, warning, min) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_crit_min, critical, min) +#undef LIMIT_VOLT + +#define LIMIT_PWR(name, limit, expl, variable, criticity, min_max) \ + DEFUN(limit_pwr_##name##_##variable, limit_pwr_##name##_##variable##_cmd, \ + "limit power " #name " " #criticity " " #min_max " <0-200>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->pwr.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_PWR(supply, supply_pwr_limit, "SUPPLY PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(supply, supply_pwr_limit, "SUPPLY PWR\n", thresh_crit_max, critical, max) +LIMIT_PWR(pa0, pa0_pwr_limit, "PA0 PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(pa0, pa0_pwr_limit, "PA0 PWR\n", thresh_crit_max, critical, max) +LIMIT_PWR(pa1, pa1_pwr_limit, "PA1 PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(pa1, pa1_pwr_limit, "PA1 PWR\n", thresh_crit_max, critical, max) +#undef LIMIT_PWR + +#define LIMIT_VSWR(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_vswr_##name##_##variable, limit_vswr_##name##_##variable##_cmd, \ + "limit vswr " #name " " #criticity " " #min_max " <1000-200000>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->vswr.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_VSWR(tx0, tx0_vswr_limit, "TX0 VSWR\n", thresh_warn_max, warning, max) +LIMIT_VSWR(tx0, tx0_vswr_limit, "TX0 VSWR\n", thresh_crit_max, critical, max) +LIMIT_VSWR(tx1, tx1_vswr_limit, "TX1 VSWR\n", thresh_warn_max, warning, max) +LIMIT_VSWR(tx1, tx1_vswr_limit, "TX1 VSWR\n", thresh_crit_max, critical, max) +#undef LIMIT_VSWR + +#define LIMIT_GPSFIX(limit, expl, variable, criticity, min_max) \ +DEFUN(limit_gpsfix_##variable, limit_gpsfix_##variable##_cmd, \ + "limit gpsfix " #criticity " " #min_max " <0-365>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->gps.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_GPSFIX(gps_fix_limit, "GPS FIX\n", thresh_warn_max, warning, max) +#undef LIMIT_GPSFIX + +static void register_limit(int limit, uint32_t unit) +{ + switch (unit) { + case MGR_LIMIT_TYPE_VOLT: + install_element(limit, &cfg_thresh_volt_warn_min_cmd); + install_element(limit, &cfg_thresh_volt_crit_min_cmd); + break; + case MGR_LIMIT_TYPE_VSWR: + install_element(limit, &cfg_thresh_vswr_warn_max_cmd); + install_element(limit, &cfg_thresh_vswr_crit_max_cmd); + break; + case MGR_LIMIT_TYPE_PWR: + install_element(limit, &cfg_thresh_pwr_warn_max_cmd); + install_element(limit, &cfg_thresh_pwr_crit_max_cmd); + break; + default: + break; + } } static void register_normal_action(int act) @@ -519,11 +918,62 @@ install_element(act, &cfg_no_action_bts_srv_off_cmd); } +static void register_hidden_commands() +{ + install_element(ENABLE_NODE, &limit_temp_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_supply_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_warn_min_cmd); + + install_element(ENABLE_NODE, &limit_volt_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_crit_min_cmd); + + install_element(ENABLE_NODE, &limit_pwr_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa1_thresh_crit_max_cmd); + + install_element(ENABLE_NODE, &limit_vswr_tx0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx1_thresh_crit_max_cmd); + + install_element(ENABLE_NODE, &limit_gpsfix_thresh_warn_max_cmd); +} + int lc15bts_mgr_vty_init(void) { vty_init(&vty_info); install_element_ve(&show_mgr_cmd); + install_element_ve(&show_thresh_cmd); install_element(ENABLE_NODE, &calibrate_clock_cmd); @@ -532,50 +982,73 @@ vty_install_default(MGR_NODE); /* install the limit nodes */ - install_node(&limit_supply_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_supply_cmd); - register_limit(LIMIT_SUPPLY_NODE); - vty_install_default(LIMIT_SUPPLY_NODE); + install_node(&limit_supply_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_temp_cmd); + vty_install_default(LIMIT_SUPPLY_TEMP_NODE); install_node(&limit_soc_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_soc_cmd); - register_limit(LIMIT_SOC_NODE); + install_element(MGR_NODE, &cfg_limit_soc_temp_cmd); vty_install_default(LIMIT_SOC_NODE); install_node(&limit_fpga_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_fpga_cmd); - register_limit(LIMIT_FPGA_NODE); + install_element(MGR_NODE, &cfg_limit_fpga_temp_cmd); vty_install_default(LIMIT_FPGA_NODE); - install_node(&limit_logrf_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_logrf_cmd); - register_limit(LIMIT_LOGRF_NODE); - vty_install_default(LIMIT_LOGRF_NODE); + install_node(&limit_rmsdet_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_rmsdet_temp_cmd); + vty_install_default(LIMIT_RMSDET_NODE); install_node(&limit_ocxo_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_ocxo_cmd); - register_limit(LIMIT_OCXO_NODE); + install_element(MGR_NODE, &cfg_limit_ocxo_temp_cmd); vty_install_default(LIMIT_OCXO_NODE); - install_node(&limit_tx0_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx0_cmd); - register_limit(LIMIT_TX0_NODE); - vty_install_default(LIMIT_TX0_NODE); + install_node(&limit_tx0_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_temp_cmd); + vty_install_default(LIMIT_TX0_TEMP_NODE); - install_node(&limit_tx1_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx1_cmd); - register_limit(LIMIT_TX1_NODE); - vty_install_default(LIMIT_TX1_NODE); + install_node(&limit_tx1_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx1_temp_cmd); + vty_install_default(LIMIT_TX1_TEMP_NODE); - install_node(&limit_pa0_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa0_cmd); - register_limit(LIMIT_PA0_NODE); - vty_install_default(LIMIT_PA0_NODE); + install_node(&limit_pa0_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_temp_cmd); + vty_install_default(LIMIT_PA0_TEMP_NODE); - install_node(&limit_pa1_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa1_cmd); - register_limit(LIMIT_PA1_NODE); - vty_install_default(LIMIT_PA1_NODE); + install_node(&limit_pa1_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa1_temp_cmd); + vty_install_default(LIMIT_PA1_TEMP_NODE); + + install_node(&limit_supply_volt_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_volt_cmd); + register_limit(LIMIT_SUPPLY_VOLT_NODE, MGR_LIMIT_TYPE_VOLT); + vty_install_default(LIMIT_SUPPLY_VOLT_NODE); + + install_node(&limit_tx0_vswr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_vswr_cmd); + register_limit(LIMIT_TX0_VSWR_NODE, MGR_LIMIT_TYPE_VSWR); + vty_install_default(LIMIT_TX0_VSWR_NODE); + + install_node(&limit_tx1_vswr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx1_vswr_cmd); + register_limit(LIMIT_TX1_VSWR_NODE, MGR_LIMIT_TYPE_VSWR); + vty_install_default(LIMIT_TX1_VSWR_NODE); + + install_node(&limit_supply_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_pwr_cmd); + register_limit(LIMIT_SUPPLY_PWR_NODE, MGR_LIMIT_TYPE_PWR); + vty_install_default(LIMIT_SUPPLY_PWR_NODE); + + install_node(&limit_pa0_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_pwr_cmd); + vty_install_default(LIMIT_PA0_PWR_NODE); + + install_node(&limit_pa1_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa1_pwr_cmd); + vty_install_default(LIMIT_PA1_PWR_NODE); + + install_node(&limit_gps_fix_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_gps_fix_cmd); + vty_install_default(LIMIT_GPS_FIX_NODE); /* install the normal node */ install_node(&act_norm_node, config_write_dummy); @@ -593,6 +1066,12 @@ register_action(ACT_CRIT_NODE); vty_install_default(ACT_CRIT_NODE); + /* install LED pattern command for debugging purpose */ + install_element_ve(&set_led_pattern_cmd); + install_element_ve(&force_mgr_state_cmd); + + register_hidden_commands(); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c index fa59b7c..2cedc5d 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c @@ -41,11 +41,13 @@ #include #include +#include "lc15bts_mgr.h" #include "btsconfig.h" #include "lc15bts_misc.h" #include "lc15bts_par.h" #include "lc15bts_mgr.h" #include "lc15bts_temp.h" +#include "lc15bts_power.h" /********************************************************************* * Temperature handling @@ -58,52 +60,111 @@ enum lc15bts_par ee_par; } temp_data[] = { { - .name = "supply", + .name = "supply_temp", .has_max = 1, .sensor = LC15BTS_TEMP_SUPPLY, .ee_par = LC15BTS_PAR_TEMP_SUPPLY_MAX, }, { - .name = "soc", + .name = "soc_temp", .has_max = 0, .sensor = LC15BTS_TEMP_SOC, .ee_par = LC15BTS_PAR_TEMP_SOC_MAX, }, { - .name = "fpga", + .name = "fpga_temp", .has_max = 0, .sensor = LC15BTS_TEMP_FPGA, .ee_par = LC15BTS_PAR_TEMP_FPGA_MAX, }, { - .name = "logrf", + .name = "rmsdet_temp", .has_max = 1, - .sensor = LC15BTS_TEMP_LOGRF, - .ee_par = LC15BTS_PAR_TEMP_LOGRF_MAX, + .sensor = LC15BTS_TEMP_RMSDET, + .ee_par = LC15BTS_PAR_TEMP_RMSDET_MAX, }, { - .name = "ocxo", + .name = "ocxo_temp", .has_max = 1, .sensor = LC15BTS_TEMP_OCXO, .ee_par = LC15BTS_PAR_TEMP_OCXO_MAX, }, { - .name = "tx0", + .name = "tx0_temp", .has_max = 0, .sensor = LC15BTS_TEMP_TX0, .ee_par = LC15BTS_PAR_TEMP_TX0_MAX, }, { - .name = "tx1", + .name = "tx1_temp", .has_max = 0, .sensor = LC15BTS_TEMP_TX1, .ee_par = LC15BTS_PAR_TEMP_TX1_MAX, }, { - .name = "pa0", + .name = "pa0_temp", .has_max = 1, .sensor = LC15BTS_TEMP_PA0, .ee_par = LC15BTS_PAR_TEMP_PA0_MAX, }, { - .name = "pa1", + .name = "pa1_temp", .has_max = 1, .sensor = LC15BTS_TEMP_PA1, .ee_par = LC15BTS_PAR_TEMP_PA1_MAX, } +}; + +static const struct { + const char *name; + int has_max; + enum lc15bts_power_source sensor_source; + enum lc15bts_power_type sensor_type; + enum lc15bts_par ee_par; +} power_data[] = { + { + .name = "supply_volt", + .has_max = 1, + .sensor_source = LC15BTS_POWER_SUPPLY, + .sensor_type = LC15BTS_POWER_VOLTAGE, + .ee_par = LC15BTS_PAR_VOLT_SUPPLY_MAX, + }, { + .name = "supply_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_SUPPLY, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_SUPPLY_MAX, + }, { + .name = "pa0_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_PA0, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_PA0_MAX, + }, { + .name = "pa1_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_PA1, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_PA1_MAX, + } +}; + +static const struct { + const char *name; + int has_max; + enum lc15bts_vswr_sensor sensor; + enum lc15bts_par ee_par; +} vswr_data[] = { + { + .name = "tx0_vswr", + .has_max = 0, + .sensor = LC15BTS_VSWR_TX0, + .ee_par = LC15BTS_PAR_VSWR_TX0_MAX, + }, { + .name = "tx1_vswr", + .has_max = 0, + .sensor = LC15BTS_VSWR_TX1, + .ee_par = LC15BTS_PAR_VSWR_TX1_MAX, + } +}; + +static const struct value_string power_unit_strs[] = { + { LC15BTS_POWER_POWER, "W" }, + { LC15BTS_POWER_VOLTAGE, "V" }, + { 0, NULL } }; void lc15bts_check_temp(int no_rom_write) @@ -117,7 +178,7 @@ rc = lc15bts_par_get_int(tall_mgr_ctx, temp_data[i].ee_par, &ret); temp_old[i] = ret * 1000; - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor); + lc15bts_temp_get(temp_data[i].sensor, &temp_cur[i]); if (temp_cur[i] < 0 && temp_cur[i] > -1000) { LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d): unexpected value %d\n", temp_data[i].sensor, temp_cur[i]); @@ -143,6 +204,91 @@ } } +void lc15bts_check_power(int no_rom_write) +{ + int power_old[ARRAY_SIZE(power_data)]; + int power_cur[ARRAY_SIZE(power_data)]; + int i, rc; + int div_ratio; + + for (i = 0; i < ARRAY_SIZE(power_data); i++) { + int ret; + rc = lc15bts_par_get_int(tall_mgr_ctx, power_data[i].ee_par, &ret); + switch(power_data[i].sensor_type) { + case LC15BTS_POWER_VOLTAGE: + div_ratio = 1000; + break; + case LC15BTS_POWER_POWER: + div_ratio = 1000000; + break; + default: + div_ratio = 1000; + } + power_old[i] = ret * div_ratio; + + lc15bts_power_sensor_get(power_data[i].sensor_source, power_data[i].sensor_type, &power_cur[i]); + if (power_cur[i] < 0 && power_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading power (%d) (%d)\n", power_data[i].sensor_source, + power_data[i].sensor_type); + continue; + } + LOGP(DTEMP, LOGL_DEBUG, "Current %s power: %d.%d %s\n", + power_data[i].name, power_cur[i]/div_ratio, power_cur[i]%div_ratio, + get_value_string(power_unit_strs, power_data[i].sensor_type)); + + if (power_cur[i] > power_old[i]) { + LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " + "power: %d.%d %s\n", power_data[i].name, + power_cur[i]/div_ratio, power_cur[i]%div_ratio, + get_value_string(power_unit_strs, power_data[i].sensor_type)); + + if (!no_rom_write) { + rc = lc15bts_par_set_int(tall_mgr_ctx, power_data[i].ee_par, power_cur[i]/div_ratio); + if (rc < 0) + LOGP(DTEMP, LOGL_ERROR, "error writing new %s " + "max power %d (%s)\n", power_data[i].name, + rc, strerror(errno)); + } + } + } +} + +void lc15bts_check_vswr(int no_rom_write) +{ + int vswr_old[ARRAY_SIZE(vswr_data)]; + int vswr_cur[ARRAY_SIZE(vswr_data)]; + int i, rc; + + for (i = 0; i < ARRAY_SIZE(vswr_data); i++) { + int ret; + rc = lc15bts_par_get_int(tall_mgr_ctx, vswr_data[i].ee_par, &ret); + vswr_old[i] = ret * 1000; + + lc15bts_vswr_get(vswr_data[i].sensor, &vswr_cur[i]); + if (vswr_cur[i] < 0 && vswr_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading vswr (%d)\n", vswr_data[i].sensor); + continue; + } + + LOGP(DTEMP, LOGL_DEBUG, "Current %s vswr: %d.%d\n", + vswr_data[i].name, vswr_cur[i]/1000, vswr_cur[i]%1000); + + if (vswr_cur[i] > vswr_old[i]) { + LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " + "vswr: %d.%d C\n", vswr_data[i].name, + vswr_cur[i]/1000, vswr_old[i]%1000); + + if (!no_rom_write) { + rc = lc15bts_par_set_int(tall_mgr_ctx, vswr_data[i].ee_par, vswr_cur[i]/1000); + if (rc < 0) + LOGP(DTEMP, LOGL_ERROR, "error writing new %s " + "max vswr %d (%s)\n", vswr_data[i].name, + rc, strerror(errno)); + } + } + } +} + /********************************************************************* * Hours handling *********************************************************************/ diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.h b/src/osmo-bts-litecell15/misc/lc15bts_misc.h index 4c3a862..79e9e68 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.h @@ -4,6 +4,8 @@ #include void lc15bts_check_temp(int no_rom_write); +void lc15bts_check_power(int no_rom_write); +void lc15bts_check_vswr(int no_rom_write); int lc15bts_update_hours(int no_rom_write); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index 13b0080..75314a4 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -43,12 +43,19 @@ { LC15BTS_PAR_TEMP_SUPPLY_MAX, "temp-supply-max" }, { LC15BTS_PAR_TEMP_SOC_MAX, "temp-soc-max" }, { LC15BTS_PAR_TEMP_FPGA_MAX, "temp-fpga-max" }, - { LC15BTS_PAR_TEMP_LOGRF_MAX, "temp-logrf-max" }, + { LC15BTS_PAR_TEMP_RMSDET_MAX, "temp-rmsdet-max" }, { LC15BTS_PAR_TEMP_OCXO_MAX, "temp-ocxo-max" }, { LC15BTS_PAR_TEMP_TX0_MAX, "temp-tx0-max" }, { LC15BTS_PAR_TEMP_TX1_MAX, "temp-tx1-max" }, { LC15BTS_PAR_TEMP_PA0_MAX, "temp-pa0-max" }, { LC15BTS_PAR_TEMP_PA1_MAX, "temp-pa1-max" }, + { LC15BTS_PAR_VOLT_SUPPLY_MAX, "volt-supply-max" }, + { LC15BTS_PAR_PWR_SUPPLY_MAX, "pwr-supply-max" }, + { LC15BTS_PAR_PWR_PA0_MAX, "pwr-pa0-max" }, + { LC15BTS_PAR_PWR_PA1_MAX, "pwr-pa1-max" }, + { LC15BTS_PAR_VSWR_TX0_MAX, "vswr-tx0-max" }, + { LC15BTS_PAR_VSWR_TX1_MAX, "vswr-tx1-max" }, + { LC15BTS_PAR_GPS_FIX, "gps-fix" }, { LC15BTS_PAR_SERNR, "serial-nr" }, { LC15BTS_PAR_HOURS, "hours-running" }, { LC15BTS_PAR_BOOTS, "boot-count" }, @@ -60,17 +67,23 @@ { switch (par) { case LC15BTS_PAR_TEMP_SUPPLY_MAX: - case LC15BTS_PAR_TEMP_SOC_MAX: - case LC15BTS_PAR_TEMP_FPGA_MAX: - case LC15BTS_PAR_TEMP_LOGRF_MAX: - case LC15BTS_PAR_TEMP_OCXO_MAX: - case LC15BTS_PAR_TEMP_TX0_MAX: - case LC15BTS_PAR_TEMP_TX1_MAX: - case LC15BTS_PAR_TEMP_PA0_MAX: - case LC15BTS_PAR_TEMP_PA1_MAX: + case LC15BTS_PAR_TEMP_SOC_MAX: + case LC15BTS_PAR_TEMP_FPGA_MAX: + case LC15BTS_PAR_TEMP_RMSDET_MAX: + case LC15BTS_PAR_TEMP_OCXO_MAX: + case LC15BTS_PAR_TEMP_TX0_MAX: + case LC15BTS_PAR_TEMP_TX1_MAX: + case LC15BTS_PAR_TEMP_PA0_MAX: + case LC15BTS_PAR_TEMP_PA1_MAX: + case LC15BTS_PAR_VOLT_SUPPLY_MAX: + case LC15BTS_PAR_VSWR_TX0_MAX: + case LC15BTS_PAR_VSWR_TX1_MAX: case LC15BTS_PAR_SERNR: case LC15BTS_PAR_HOURS: case LC15BTS_PAR_BOOTS: + case LC15BTS_PAR_PWR_SUPPLY_MAX: + case LC15BTS_PAR_PWR_PA0_MAX: + case LC15BTS_PAR_PWR_PA1_MAX: return 1; default: return 0; @@ -168,3 +181,52 @@ return rc; } + +int lc15bts_par_get_gps_fix(time_t *ret) +{ + char fpath[PATH_MAX]; + FILE *fp; + int rc; + + snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, LC15BTS_PAR_GPS_FIX)); + fpath[sizeof(fpath)-1] = '\0'; + + fp = fopen(fpath, "r"); + if (fp == NULL) { + return -errno; + } + + rc = fscanf(fp, "%lld", (long long *)ret); + if (rc != 1) { + fclose(fp); + return -EIO; + } + fclose(fp); + + return 0; +} + +int lc15bts_par_set_gps_fix(time_t val) +{ + char fpath[PATH_MAX]; + FILE *fp; + int rc; + + snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, LC15BTS_PAR_GPS_FIX)); + fpath[sizeof(fpath)-1] = '\0'; + + fp = fopen(fpath, "w"); + if (fp == NULL) { + return -errno; + } + + rc = fprintf(fp, "%lld", (long long)val); + if (rc < 0) { + fclose(fp); + return -EIO; + } + fsync(fp); + fclose(fp); + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index dd869d3..217ae5f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -10,12 +10,19 @@ LC15BTS_PAR_TEMP_SUPPLY_MAX, LC15BTS_PAR_TEMP_SOC_MAX, LC15BTS_PAR_TEMP_FPGA_MAX, - LC15BTS_PAR_TEMP_LOGRF_MAX, + LC15BTS_PAR_TEMP_RMSDET_MAX, LC15BTS_PAR_TEMP_OCXO_MAX, LC15BTS_PAR_TEMP_TX0_MAX, LC15BTS_PAR_TEMP_TX1_MAX, LC15BTS_PAR_TEMP_PA0_MAX, LC15BTS_PAR_TEMP_PA1_MAX, + LC15BTS_PAR_VOLT_SUPPLY_MAX, + LC15BTS_PAR_PWR_SUPPLY_MAX, + LC15BTS_PAR_PWR_PA0_MAX, + LC15BTS_PAR_PWR_PA1_MAX, + LC15BTS_PAR_VSWR_TX0_MAX, + LC15BTS_PAR_VSWR_TX1_MAX, + LC15BTS_PAR_GPS_FIX, LC15BTS_PAR_SERNR, LC15BTS_PAR_HOURS, LC15BTS_PAR_BOOTS, @@ -31,5 +38,7 @@ int lc15bts_par_set_buf(void *ctx, enum lc15bts_par par, const uint8_t *buf, unsigned int size); int lc15bts_par_is_int(enum lc15bts_par par); +int lc15bts_par_get_gps_fix(time_t *ret); +int lc15bts_par_set_gps_fix(time_t val); #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.c b/src/osmo-bts-litecell15/misc/lc15bts_power.c index 5b01d36..1a37d8e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.c @@ -39,7 +39,7 @@ }; static const char *power_sensor_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/pa-supply/", + [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/main-supply/", [LC15BTS_POWER_PA0] = "/var/lc15/pwr-sense/pa0/", [LC15BTS_POWER_PA1] = "/var/lc15/pwr-sense/pa1/", }; @@ -52,7 +52,8 @@ int lc15bts_power_sensor_get( enum lc15bts_power_source source, - enum lc15bts_power_type type) + enum lc15bts_power_type type, + int *power) { char buf[PATH_MAX]; char pwrstr[10]; @@ -82,8 +83,8 @@ return -EIO; } close(fd); - - return atoi(pwrstr); + *power = atoi(pwrstr); + return 0; } @@ -171,3 +172,39 @@ return retVal; } + +static const char *vswr_devs[_NUM_VSWR_SENSORS] = { + [LC15BTS_VSWR_TX0] = "/var/lc15/vswr/tx0/vswr", + [LC15BTS_VSWR_TX1] = "/var/lc15/vswr/tx1/vswr", +}; + +int lc15bts_vswr_get(enum lc15bts_vswr_sensor sensor, int *vswr) +{ + char buf[PATH_MAX]; + char vswrstr[8]; + int fd, rc; + + if (sensor < 0 || sensor >= _NUM_VSWR_SENSORS) + return -EINVAL; + + snprintf(buf, sizeof(buf)-1, "%s", vswr_devs[sensor]); + buf[sizeof(buf)-1] = '\0'; + + fd = open(buf, O_RDONLY); + if (fd < 0) + return fd; + + rc = read(fd, vswrstr, sizeof(vswrstr)); + vswrstr[sizeof(vswrstr)-1] = '\0'; + if (rc < 0) { + close(fd); + return rc; + } + if (rc == 0) { + close(fd); + return -EIO; + } + close(fd); + *vswr = atoi(vswrstr); + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.h b/src/osmo-bts-litecell15/misc/lc15bts_power.h index 8963b76..b48cfdc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.h @@ -17,7 +17,8 @@ int lc15bts_power_sensor_get( enum lc15bts_power_source source, - enum lc15bts_power_type type); + enum lc15bts_power_type type, + int *volt); int lc15bts_power_set( enum lc15bts_power_source source, @@ -26,4 +27,12 @@ int lc15bts_power_get( enum lc15bts_power_source source); +enum lc15bts_vswr_sensor { + LC15BTS_VSWR_TX0, + LC15BTS_VSWR_TX1, + _NUM_VSWR_SENSORS +}; + +int lc15bts_vswr_get(enum lc15bts_vswr_sensor sensor, int *vswr); + #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_temp.c index aa35854..45602dc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.c @@ -29,20 +29,19 @@ #include "lc15bts_temp.h" - static const char *temp_devs[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/pa-supply/temp", - [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", - [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", - [LC15BTS_TEMP_LOGRF] = "/var/lc15/temp/logrf/temp", - [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", - [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", - [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", - [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", - [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", + [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/main-supply/temp", + [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", + [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", + [LC15BTS_TEMP_RMSDET] = "/var/lc15/temp/rmsdet/temp", + [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", + [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", + [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", + [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", + [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor) +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, int *temp) { char buf[PATH_MAX]; char tempstr[8]; @@ -69,7 +68,7 @@ return -EIO; } close(fd); - - return atoi(tempstr); + *temp = atoi(tempstr); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.h b/src/osmo-bts-litecell15/misc/lc15bts_temp.h index aca8fe2..35d81f1 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.h @@ -5,7 +5,7 @@ LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_SOC, LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_LOGRF, + LC15BTS_TEMP_RMSDET, LC15BTS_TEMP_OCXO, LC15BTS_TEMP_TX0, LC15BTS_TEMP_TX1, @@ -22,6 +22,7 @@ _NUM_TEMP_TYPES }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor); +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, int *temp); + #endif -- To view, visit https://gerrit.osmocom.org/3277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:04:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 17:04:04 +0000 Subject: osmo-bts[master]: lc15: fix BTS revision and hw options In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3275/1/src/osmo-bts-litecell15/l1_if.c File src/osmo-bts-litecell15/l1_if.c: Line 1508: LOGP(DL1C, LOGL_DEBUG, "BTS hw support band %s\n", gsm_band_name(fl1h->hw_info.band_support)); > If it's not called that often, it's probably a good idea to use INFO level. dsp and fpga version are already printed by other code. Or what do you have in mind? -- To view, visit https://gerrit.osmocom.org/3275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 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: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:04:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 17:04:20 +0000 Subject: [PATCH] osmo-bts[master]: lc15: fix BTS revision and hw options In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3275 to look at the new patch set (#2). lc15: fix BTS revision and hw options * remove typo in logging * add missing return statement * fix compilation warnings * add detailed logging for supported GSM band and related errors Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 Related: SYS#3728 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/misc/lc15bts_bid.c 2 files changed, 15 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/3275/2 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index b82a7c6..cb3efab 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1369,7 +1369,7 @@ fl1h->hw_info.fpga_version[1] = sic->fpgaVersion.minor; fl1h->hw_info.fpga_version[2] = sic->fpgaVersion.build; - LOGP(DL1C, LOGL_INFO, "DSP v%u.%u.%u, FPGA v%u.%u.%u\nn", + LOGP(DL1C, LOGL_INFO, "DSP v%u.%u.%u, FPGA v%u.%u.%u\n", sic->dspVersion.major, sic->dspVersion.minor, sic->dspVersion.build, sic->fpgaVersion.major, sic->fpgaVersion.minor, sic->fpgaVersion.build); @@ -1468,18 +1468,24 @@ int rc; rc = lc15bts_rev_get(); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS revision: %d\n", rc); return rc; + } fl1h->hw_info.ver_major = rc; rc = lc15bts_model_get(); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS model: %d\n", rc); return rc; + } fl1h->hw_info.ver_minor = rc; rc = lc15bts_option_get(LC15BTS_OPTION_BAND); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS_OPTION_BAND: %d\n", rc); return rc; + } switch (rc) { case LC15BTS_BAND_850: @@ -1495,8 +1501,12 @@ fl1h->hw_info.band_support = GSM_BAND_1900; break; default: + LOGP(DL1C, LOGL_ERROR, "Unexpected LC15BTS_BAND value: %d\n", rc); return -1; } + + LOGP(DL1C, LOGL_INFO, "BTS hw support band %s\n", gsm_band_name(fl1h->hw_info.band_support)); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index ba2037a..7f278bf 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -87,11 +87,11 @@ return false; } fclose(fp); + return true; } int lc15bts_rev_get(void) { - FILE *fp; char rev; if (board_rev != -1) { @@ -107,9 +107,7 @@ int lc15bts_model_get(void) { - FILE *fp; int opt; - bool rc; if (board_option != -1) return board_option; -- To view, visit https://gerrit.osmocom.org/3275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 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 From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:06:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 17:06:34 +0000 Subject: osmo-bts[master]: lc15: fix BTS revision and hw options In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3275/1/src/osmo-bts-litecell15/l1_if.c File src/osmo-bts-litecell15/l1_if.c: Line 1508: LOGP(DL1C, LOGL_DEBUG, "BTS hw support band %s\n", gsm_band_name(fl1h->hw_info.band_support)); > dsp and fpga version are already printed by other code. Or what do you have Does it make sense to print BAND in the same place as the others then? As all this info seems to come from the same place, it would make sense to print it together, but otherwise it's fine. Change it to INFO then :) -- To view, visit https://gerrit.osmocom.org/3275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 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: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:09:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 17:09:41 +0000 Subject: [PATCH] osmo-bts[master]: lc15: port lc15bts-mgr changes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3277 to look at the new patch set (#2). lc15: port lc15bts-mgr changes Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Related: SYS#3679 --- M doc/examples/litecell15/lc15bts-mgr.cfg M include/osmo-bts/phy_link.h M src/common/Makefile.am M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/hw_misc.c A src/osmo-bts-litecell15/misc/lc15bts_bts.c A src/osmo-bts-litecell15/misc/lc15bts_bts.h M src/osmo-bts-litecell15/misc/lc15bts_clock.c A src/osmo-bts-litecell15/misc/lc15bts_led.c A src/osmo-bts-litecell15/misc/lc15bts_led.h M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.h M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c M src/osmo-bts-litecell15/misc/lc15bts_misc.c M src/osmo-bts-litecell15/misc/lc15bts_misc.h M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h M src/osmo-bts-litecell15/misc/lc15bts_power.c M src/osmo-bts-litecell15/misc/lc15bts_power.h M src/osmo-bts-litecell15/misc/lc15bts_temp.c M src/osmo-bts-litecell15/misc/lc15bts_temp.h 22 files changed, 2,014 insertions(+), 411 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/77/3277/2 diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index 750dc36..c7d0a79 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -25,39 +25,19 @@ no login ! lc15bts-mgr - limits supply - threshold warning 60 - threshold critical 78 - limits soc - threshold warning 60 - threshold critical 78 - limits fpga - threshold warning 60 - threshold critical 78 - limits logrf - threshold warning 60 - threshold critical 78 - limits tx0 - threshold warning 60 - threshold critical 78 - limits tx1 - threshold warning 60 - threshold critical 78 - limits pa0 - threshold warning 60 - threshold critical 78 - limits pa1 - threshold warning 60 - threshold critical 78 - actions normal - pa0-on - pa1-on - bts-service-on - actions warn - no pa0-off - no pa1-off - no bts-service-off - actions critical - pa0-off - pa1-off - no bts-service-off + limits supply_volt + threshold warning min 17500 + threshold critical min 19000 + limits tx0_vswr + threshold warning max 3 + limits tx1_vswr + threshold warning max 3 + limits supply_pwr + threshold warning max 110 + threshold critical max 120 + limits pa0_pwr + threshold warning max 50 + threshold critical max 60 + limits pa1_pwr + threshold warning max 50 + threshold critical max 60 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index d8d3c6b..3d4bf91 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -124,6 +124,12 @@ int minTxPower; int maxTxPower; struct lc15l1_hdl *hdl; + uint8_t max_cell_size; /* 0:166 qbits*/ + uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ + uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ + uint8_t dsp_alive_period; /* DSP alive timer period */ + uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ + uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ } lc15; } u; }; diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..d104c48 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -2,6 +2,10 @@ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) +if ENABLE_LC15BTS +AM_CFLAGS += -DENABLE_LC15BTS +endif + noinst_LIBRARIES = libbts.a libl1sched.a libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \ rsl.c vty.c paging.c measurement.c amr.c lchan.c \ diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 3026e96..90e6c46 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -4,9 +4,11 @@ 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/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h \ +AM_CFLAGS += -DENABLE_LC15BTS + +EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h misc/lc15bts_led.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ - misc/lc15bts_bid.h misc/lc15bts_nl.h \ + misc/lc15bts_bid.h misc/lc15bts_nl.h misc/lc15bts_bts.h \ hw_misc.h l1_if.h l1_transp.h lc15bts.h oml_router.h utils.h bin_PROGRAMS = osmo-bts-lc15 lc15bts-mgr lc15bts-util @@ -25,9 +27,11 @@ misc/lc15bts_mgr_vty.c \ misc/lc15bts_mgr_nl.c \ misc/lc15bts_mgr_temp.c \ - misc/lc15bts_mgr_calib.c + misc/lc15bts_mgr_calib.c \ + misc/lc15bts_led.c \ + misc/lc15bts_bts.c -lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(COMMON_LDADD) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) diff --git a/src/osmo-bts-litecell15/hw_misc.c b/src/osmo-bts-litecell15/hw_misc.c index 49232b2..9f070bb 100644 --- a/src/osmo-bts-litecell15/hw_misc.c +++ b/src/osmo-bts-litecell15/hw_misc.c @@ -69,6 +69,7 @@ rc = write(fd, cmd[0] ? "1" : "0", 2); if (rc != 2) { + close(fd); return -1; } close(fd); @@ -79,6 +80,7 @@ rc = write(fd, cmd[1] ? "1" : "0", 2); if (rc != 2) { + close(fd); return -1; } close(fd); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bts.c b/src/osmo-bts-litecell15/misc/lc15bts_bts.c new file mode 100644 index 0000000..0343e93 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_bts.c @@ -0,0 +1,131 @@ +/* Copyright (C) 2016 by NuRAN Wireless + * + * 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 "lc15bts_mgr.h" +#include "lc15bts_bts.h" + +static int check_eth_status(char *dev_name) +{ + int fd, rc; + struct ifreq ifr; + + fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); + if (fd < 0) + return fd; + + memset(&ifr, 0, sizeof(ifr)); + memcpy(&ifr.ifr_name, dev_name, sizeof(ifr.ifr_name)); + rc = ioctl(fd, SIOCGIFFLAGS, &ifr); + close(fd); + + if (rc < 0) + return rc; + + if ((ifr.ifr_flags & IFF_UP) && (ifr.ifr_flags & IFF_RUNNING)) + return 0; + + return 1; +} + +void check_bts_led_pattern(uint8_t *led) +{ + FILE *fp; + char str[64] = "\0"; + int rc; + + /* check for existing of BTS state file */ + if ((fp = fopen("/var/run/osmo-bts/state", "r")) == NULL) { + led[BLINK_PATTERN_INIT] = 1; + return; + } + + /* check Ethernet interface status */ + rc = check_eth_status("eth0"); + if (rc > 0) { + LOGP(DTEMP, LOGL_DEBUG,"External link is DOWN\n"); + led[BLINK_PATTERN_EXT_LINK_MALFUNC] = 1; + fclose(fp); + return; + } + + /* check for BTS is still alive */ + if (system("pidof osmo-bts-lc15 > /dev/null")) { + LOGP(DTEMP, LOGL_DEBUG,"BTS process has stopped\n"); + led[BLINK_PATTERN_INT_PROC_MALFUNC] = 1; + fclose(fp); + return; + } + + /* check for BTS state */ + while (fgets(str, 64, fp) != NULL) { + LOGP(DTEMP, LOGL_DEBUG,"BTS state is %s\n", (strstr(str, "ABIS DOWN") != NULL) ? "DOWN" : "UP"); + if (strstr(str, "ABIS DOWN") != NULL) + led[BLINK_PATTERN_INT_PROC_MALFUNC] = 1; + } + fclose(fp); + + return; +} + +int check_sensor_led_pattern( struct lc15bts_mgr_instance *mgr, uint8_t *led) +{ + if(mgr->alarms.temp_high == 1) + led[BLINK_PATTERN_TEMP_HIGH] = 1; + + if(mgr->alarms.temp_max == 1) + led[BLINK_PATTERN_TEMP_MAX] = 1; + + if(mgr->alarms.supply_low == 1) + led[BLINK_PATTERN_SUPPLY_VOLT_LOW] = 1; + + if(mgr->alarms.supply_min == 1) + led[BLINK_PATTERN_SUPPLY_VOLT_MIN] = 1; + + if(mgr->alarms.vswr_high == 1) + led[BLINK_PATTERN_VSWR_HIGH] = 1; + + if(mgr->alarms.vswr_max == 1) + led[BLINK_PATTERN_VSWR_MAX] = 1; + + if(mgr->alarms.supply_pwr_high == 1) + led[BLINK_PATTERN_SUPPLY_PWR_HIGH] = 1; + + if(mgr->alarms.supply_pwr_max == 1) + led[BLINK_PATTERN_SUPPLY_PWR_MAX] = 1; + + if(mgr->alarms.supply_pwr_max2 == 1) + led[BLINK_PATTERN_SUPPLY_PWR_MAX2] = 1; + + if(mgr->alarms.pa_pwr_high == 1) + led[BLINK_PATTERN_PA_PWR_HIGH] = 1; + + if(mgr->alarms.pa_pwr_max == 1) + led[BLINK_PATTERN_PA_PWR_MAX] = 1; + + if(mgr->alarms.gps_fix_lost == 1) + led[BLINK_PATTERN_GPS_FIX_LOST] = 1; + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bts.h b/src/osmo-bts-litecell15/misc/lc15bts_bts.h new file mode 100644 index 0000000..3918b87 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_bts.h @@ -0,0 +1,21 @@ +#ifndef _LC15BTS_BTS_H_ +#define _LC15BTS_BTS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* public function prototypes */ +void check_bts_led_pattern(uint8_t *led); +int check_sensor_led_pattern( struct lc15bts_mgr_instance *mgr, uint8_t *led); + +#endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_clock.c b/src/osmo-bts-litecell15/misc/lc15bts_clock.c index f4df5d3..7170149 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_clock.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_clock.c @@ -100,9 +100,6 @@ int lc15bts_clock_err_open(void) { - int rc; - int fault; - if (clkerr_fd_err < 0) { clkerr_fd_err = open(CLKERR_ERR_SYSFS, O_RDONLY); if (clkerr_fd_err < 0) { @@ -149,26 +146,6 @@ lc15bts_clock_err_close(); return clkerr_fd_reset; } - } - - rc = sysfs_write_str(clkerr_fd_refresh, "once"); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } - - rc = sysfs_read_val(clkerr_fd_fault, &fault); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } - - if (fault) { - rc = sysfs_write_val(clkerr_fd_reset, 1); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } } return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_led.c b/src/osmo-bts-litecell15/misc/lc15bts_led.c new file mode 100644 index 0000000..603e0fb --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_led.c @@ -0,0 +1,333 @@ +/* Copyright (C) 2016 by NuRAN Wireless + * + * 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 "lc15bts_led.h" +#include "lc15bts_bts.h" +#include +#include + +static struct lc15bts_led led_entries[] = { + { + .name = "led0", + .fullname = "led red", + .path = "/var/lc15/leds/led0/brightness" + }, + { + .name = "led1", + .fullname = "led green", + .path = "/var/lc15/leds/led1/brightness" + } +}; + +static const struct value_string lc15bts_led_strs[] = { + { LC15BTS_LED_RED, "LED red" }, + { LC15BTS_LED_GREEN, "LED green" }, + { LC15BTS_LED_ORANGE, "LED orange" }, + { LC15BTS_LED_OFF, "LED off" }, + { 0, NULL } +}; + +static uint8_t led_priority[] = { + BLINK_PATTERN_INIT, + BLINK_PATTERN_INT_PROC_MALFUNC, + BLINK_PATTERN_SUPPLY_PWR_MAX, + BLINK_PATTERN_PA_PWR_MAX, + BLINK_PATTERN_VSWR_MAX, + BLINK_PATTERN_SUPPLY_VOLT_MIN, + BLINK_PATTERN_TEMP_MAX, + BLINK_PATTERN_SUPPLY_PWR_MAX2, + BLINK_PATTERN_EXT_LINK_MALFUNC, + BLINK_PATTERN_SUPPLY_VOLT_LOW, + BLINK_PATTERN_TEMP_HIGH, + BLINK_PATTERN_VSWR_HIGH, + BLINK_PATTERN_SUPPLY_PWR_HIGH, + BLINK_PATTERN_PA_PWR_HIGH, + BLINK_PATTERN_GPS_FIX_LOST, + BLINK_PATTERN_NORMAL +}; + + +char *blink_pattern_command[] = BLINK_PATTERN_COMMAND; + +static int lc15bts_led_write(char *path, char *str) +{ + int fd; + + if ((fd = open(path, O_WRONLY)) == -1) + { + return 0; + } + + write(fd, str, strlen(str)+1); + close(fd); + return 1; +} + +static void led_set_red() +{ + lc15bts_led_write(led_entries[0].path, "1"); + lc15bts_led_write(led_entries[1].path, "0"); +} + +static void led_set_green() +{ + lc15bts_led_write(led_entries[0].path, "0"); + lc15bts_led_write(led_entries[1].path, "1"); +} + +static void led_set_orange() +{ + lc15bts_led_write(led_entries[0].path, "1"); + lc15bts_led_write(led_entries[1].path, "1"); +} + +static void led_set_off() +{ + lc15bts_led_write(led_entries[0].path, "0"); + lc15bts_led_write(led_entries[1].path, "0"); +} + +static void led_sleep( struct lc15bts_mgr_instance *mgr, struct lc15bts_led_timer *led_timer, void (*led_timer_cb)(void *_data)) { + /* Cancel any pending timer */ + osmo_timer_del(&led_timer->timer); + /* Start LED timer */ + led_timer->timer.cb = led_timer_cb; + led_timer->timer.data = mgr; + mgr->lc15bts_leds.active_timer = led_timer->idx; + osmo_timer_schedule(&led_timer->timer, led_timer->param.sleep_sec, led_timer->param.sleep_usec); + LOGP(DTEMP, LOGL_DEBUG,"%s timer scheduled for %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_timer->idx), + led_timer->param.sleep_sec, + led_timer->param.sleep_usec); + + switch (led_timer->idx) { + case LC15BTS_LED_RED: + led_set_red(); + break; + case LC15BTS_LED_GREEN: + led_set_green(); + break; + case LC15BTS_LED_ORANGE: + led_set_orange(); + break; + case LC15BTS_LED_OFF: + led_set_off(); + break; + default: + led_set_off(); + } +} + +static void led_sleep_cb(void *_data) { + struct lc15bts_mgr_instance *mgr = _data; + struct lc15bts_led_timer_list *led_list; + + /* make sure the timer list is not empty */ + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + llist_for_each_entry(led_list, &mgr->lc15bts_leds.list, list) { + if (led_list->led_timer.idx == mgr->lc15bts_leds.active_timer) { + LOGP(DTEMP, LOGL_DEBUG,"Delete expired %s timer %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + /* Delete current timer */ + osmo_timer_del(&led_list->led_timer.timer); + /* Rotate the timer list */ + llist_move_tail(led_list, &mgr->lc15bts_leds.list); + break; + } + } + + /* Execute next timer */ + led_list = llist_first_entry(&mgr->lc15bts_leds.list, struct lc15bts_led_timer_list, list); + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Execute %s timer %d sec + %d usec, total entries=%d\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec, + llist_count(&mgr->lc15bts_leds.list)); + + led_sleep(mgr, &led_list->led_timer, led_sleep_cb); + } + +} + +static void delete_led_timer_entries(struct lc15bts_mgr_instance *mgr) +{ + struct lc15bts_led_timer_list *led_list, *led_list2; + + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + llist_for_each_entry_safe(led_list, led_list2, &mgr->lc15bts_leds.list, list) { + /* Delete the timer in list */ + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Delete %s timer entry from list, %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + /* Delete current timer */ + osmo_timer_del(&led_list->led_timer.timer); + llist_del(&led_list->list); + talloc_free(led_list); + } + } + return; +} + +static int add_led_timer_entry(struct lc15bts_mgr_instance *mgr, char *cmdstr) +{ + double sec, int_sec, frac_sec; + struct lc15bts_sleep_time led_param; + + led_param.sleep_sec = 0; + led_param.sleep_usec = 0; + + if (strstr(cmdstr, "set red") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_RED; + else if (strstr(cmdstr, "set green") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_GREEN; + else if (strstr(cmdstr, "set orange") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_ORANGE; + else if (strstr(cmdstr, "set off") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_OFF; + else if (strstr(cmdstr, "sleep") != NULL) { + sec = atof(cmdstr + 6); + /* split time into integer and fractional of seconds */ + frac_sec = modf(sec, &int_sec) * 1000000.0; + led_param.sleep_sec = (int)int_sec; + led_param.sleep_usec = (int)frac_sec; + + if ((mgr->lc15bts_leds.led_idx >= LC15BTS_LED_RED) && (mgr->lc15bts_leds.led_idx < _LC15BTS_LED_MAX)) { + struct lc15bts_led_timer_list *led_list; + + /* allocate timer entry */ + led_list = talloc_zero(tall_mgr_ctx, struct lc15bts_led_timer_list); + if (led_list) { + led_list->led_timer.idx = mgr->lc15bts_leds.led_idx; + led_list->led_timer.param.sleep_sec = led_param.sleep_sec; + led_list->led_timer.param.sleep_usec = led_param.sleep_usec; + llist_add_tail(&led_list->list, &mgr->lc15bts_leds.list); + + LOGP(DTEMP, LOGL_DEBUG,"Add %s timer to list, %d sec + %d usec, total entries=%d\n", + get_value_string(lc15bts_led_strs, mgr->lc15bts_leds.led_idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec, + llist_count(&mgr->lc15bts_leds.list)); + } + } + } else + return -1; + + return 0; +} + +static int parse_led_pattern(char *pattern, struct lc15bts_mgr_instance *mgr) +{ + char str[1024]; + char *pstr; + char *sep; + int rc = 0; + + strcpy(str, pattern); + pstr = str; + while ((sep = strsep(&pstr, ";")) != NULL) { + rc = add_led_timer_entry(mgr, sep); + if (rc < 0) { + break; + } + + } + return rc; +} + +/*** led interface ***/ + +void led_set(struct lc15bts_mgr_instance *mgr, int pattern_id) +{ + int rc; + struct lc15bts_led_timer_list *led_list; + + if (pattern_id > BLINK_PATTERN_MAX_ITEM - 1) { + LOGP(DTEMP, LOGL_ERROR, "Invalid LED pattern : %d. LED pattern must be between %d..%d\n", + pattern_id, + BLINK_PATTERN_POWER_ON, + BLINK_PATTERN_MAX_ITEM - 1); + return; + } + if (pattern_id == mgr->lc15bts_leds.last_pattern_id) + return; + + mgr->lc15bts_leds.last_pattern_id = pattern_id; + + LOGP(DTEMP, LOGL_NOTICE, "blink pattern command : %d\n", pattern_id); + LOGP(DTEMP, LOGL_NOTICE, "%s\n", blink_pattern_command[pattern_id]); + + /* Empty existing LED timer in the list */ + delete_led_timer_entries(mgr); + + /* parse LED pattern */ + rc = parse_led_pattern(blink_pattern_command[pattern_id], mgr); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR,"LED pattern not found or invalid LED pattern\n"); + return; + } + + /* make sure the timer list is not empty */ + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + /* Start the first LED timer in the list */ + led_list = llist_first_entry(&mgr->lc15bts_leds.list, struct lc15bts_led_timer_list, list); + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Execute timer %s for %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + led_sleep(mgr, &led_list->led_timer, led_sleep_cb); + } + +} + +void select_led_pattern(struct lc15bts_mgr_instance *mgr) +{ + int i; + uint8_t led[BLINK_PATTERN_MAX_ITEM] = {0}; + + /* set normal LED pattern at first */ + led[BLINK_PATTERN_NORMAL] = 1; + + /* check on-board sensors for new LED pattern */ + check_sensor_led_pattern(mgr, led); + + /* check BTS status for new LED pattern */ + check_bts_led_pattern(led); + + /* check by priority */ + for (i = 0; i < sizeof(led_priority)/sizeof(uint8_t); i++) { + if(led[led_priority[i]] == 1) { + led_set(mgr, led_priority[i]); + break; + } + } +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_led.h b/src/osmo-bts-litecell15/misc/lc15bts_led.h new file mode 100644 index 0000000..b6d9d28 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_led.h @@ -0,0 +1,22 @@ +#ifndef _LC15BTS_LED_H +#define _LC15BTS_LED_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "lc15bts_mgr.h" + +/* public function prototypes */ +void led_set(struct lc15bts_mgr_instance *mgr, int pattern_id); + +void select_led_pattern(struct lc15bts_mgr_instance *mgr); + +#endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index 3a7d3a1..51a05f9 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -46,13 +46,14 @@ #include "misc/lc15bts_par.h" #include "misc/lc15bts_bid.h" #include "misc/lc15bts_power.h" +#include "lc15bts_led.h" static int no_rom_write = 0; static int daemonize = 0; void *tall_mgr_ctx; /* every 6 hours means 365*4 = 1460 rom writes per year (max) */ -#define TEMP_TIMER_SECS (6 * 3600) +#define SENSOR_TIMER_SECS (6 * 3600) /* every 1 hours means 365*24 = 8760 rom writes per year (max) */ #define HOURS_TIMER_SECS (1 * 3600) @@ -62,54 +63,106 @@ static struct lc15bts_mgr_instance manager = { .config_file = "lc15bts-mgr.cfg", .temp = { - .supply_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .supply_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .soc_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .soc_temp_limit = { + .thresh_warn_max = 95, + .thresh_crit_max = 100, + .thresh_warn_min = -40, }, - .fpga_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .fpga_temp_limit = { + .thresh_warn_max = 95, + .thresh_crit_max = 100, + .thresh_warn_min = -40, }, - .logrf_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .rmsdet_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .ocxo_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .ocxo_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .tx0_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .tx0_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -20, }, - .tx1_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .tx1_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -20, }, - .pa0_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .pa0_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .pa1_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .pa1_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, + } + }, + .volt = { + .supply_volt_limit = { + .thresh_warn_max = 30000, + .thresh_crit_max = 30500, + .thresh_warn_min = 19000, + .thresh_crit_min = 17500, + } + }, + .pwr = { + .supply_pwr_limit = { + .thresh_warn_max = 110, + .thresh_crit_max = 120, }, + .pa0_pwr_limit = { + .thresh_warn_max = 50, + .thresh_crit_max = 60, + }, + .pa1_pwr_limit = { + .thresh_warn_max = 50, + .thresh_crit_max = 60, + } + }, + .vswr = { + .tx0_vswr_limit = { + .thresh_warn_max = 3000, + .thresh_crit_max = 5000, + }, + .tx1_vswr_limit = { + .thresh_warn_max = 3000, + .thresh_crit_max = 5000, + } + }, + .gps = { + .gps_fix_limit = { + .thresh_warn_max = 7, + } + }, + .state = { + .action_norm = SENSOR_ACT_NORM_PA0_ON | SENSOR_ACT_NORM_PA1_ON, .action_warn = 0, - .action_crit = TEMP_ACT_PA0_OFF | TEMP_ACT_PA1_OFF, + .action_crit = 0, + .action_comb = 0, .state = STATE_NORMAL, } }; -static struct osmo_timer_list temp_timer; -static void check_temp_timer_cb(void *unused) +static struct osmo_timer_list sensor_timer; +static void check_sensor_timer_cb(void *unused) { lc15bts_check_temp(no_rom_write); - - osmo_timer_schedule(&temp_timer, TEMP_TIMER_SECS, 0); + lc15bts_check_power(no_rom_write); + lc15bts_check_vswr(no_rom_write); + osmo_timer_schedule(&sensor_timer, SENSOR_TIMER_SECS, 0); + /* TODO checks if lc15bts_check_temp/lc15bts_check_power/lc15bts_check_vswr went ok */ } static struct osmo_timer_list hours_timer; @@ -118,6 +171,7 @@ lc15bts_update_hours(no_rom_write); osmo_timer_schedule(&hours_timer, HOURS_TIMER_SECS, 0); + /* TODO: validates if lc15bts_update_hours went correctly */ } static void print_help(void) @@ -169,6 +223,8 @@ switch (signal) { case SIGINT: lc15bts_check_temp(no_rom_write); + lc15bts_check_power(no_rom_write); + lc15bts_check_vswr(no_rom_write); lc15bts_update_hours(no_rom_write); exit(0); break; @@ -207,6 +263,12 @@ .color = "\033[1;37m", .enabled = 1, .loglevel = LOGL_INFO, }, + [DSWD] = { + .name = "DSWD", + .description = "Software Watchdog", + .color = "\033[1;37m", + .enabled = 1, .loglevel = LOGL_INFO, + }, }; static const struct log_info mgr_log_info = { @@ -223,7 +285,6 @@ int main(int argc, char **argv) { int rc; - tall_mgr_ctx = talloc_named_const(NULL, 1, "bts manager"); msgb_talloc_ctx_init(tall_mgr_ctx, 0); @@ -253,9 +314,12 @@ exit(1); } + INIT_LLIST_HEAD(&manager.lc15bts_leds.list); + INIT_LLIST_HEAD(&manager.alarms.list); + /* start temperature check timer */ - temp_timer.cb = check_temp_timer_cb; - check_temp_timer_cb(NULL); + sensor_timer.cb = check_sensor_timer_cb; + check_sensor_timer_cb(NULL); /* start operational hours timer */ hours_timer.cb = hours_timer_cb; @@ -271,14 +335,13 @@ if (rc < 0) { exit(3); } - /* handle broadcast messages for ipaccess-find */ if (lc15bts_mgr_nl_init() != 0) exit(3); - /* Initialize the temperature control */ - lc15bts_mgr_temp_init(&manager); + /* Initialize the sensor control */ + lc15bts_mgr_sensor_init(&manager); if (lc15bts_mgr_calib_init(&manager) != 0) exit(3); @@ -290,7 +353,6 @@ exit(1); } } - while (1) { log_reset_context(); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h index 98bd701..4bfbdbc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h @@ -9,38 +9,100 @@ #include +#define LC15BTS_SENSOR_TIMER_DURATION 60 +#define LC15BTS_PREVENT_TIMER_DURATION 15 * 60 +#define LC15BTS_PREVENT_TIMER_SHORT_DURATION 5 * 60 +#define LC15BTS_PREVENT_TIMER_NONE 0 +#define LC15BTS_PREVENT_RETRY INT_MAX - 1 + +enum BLINK_PATTERN { + BLINK_PATTERN_POWER_ON = 0, //hardware set + BLINK_PATTERN_INIT, + BLINK_PATTERN_NORMAL, + BLINK_PATTERN_EXT_LINK_MALFUNC, + BLINK_PATTERN_INT_PROC_MALFUNC, + BLINK_PATTERN_SUPPLY_VOLT_LOW, + BLINK_PATTERN_SUPPLY_VOLT_MIN, + BLINK_PATTERN_VSWR_HIGH, + BLINK_PATTERN_VSWR_MAX, + BLINK_PATTERN_TEMP_HIGH, + BLINK_PATTERN_TEMP_MAX, + BLINK_PATTERN_SUPPLY_PWR_HIGH, + BLINK_PATTERN_SUPPLY_PWR_MAX, + BLINK_PATTERN_SUPPLY_PWR_MAX2, + BLINK_PATTERN_PA_PWR_HIGH, + BLINK_PATTERN_PA_PWR_MAX, + BLINK_PATTERN_GPS_FIX_LOST, + BLINK_PATTERN_MAX_ITEM +}; + +#define BLINK_PATTERN_COMMAND {\ + "set red; sleep 5.0",\ + "set orange; sleep 5.0",\ + "set green; sleep 2.5; set off; sleep 2.5",\ + "set red; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 2.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5 ",\ + "set green; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set orange; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5 ",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set orange; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ +} + enum { DTEMP, DFW, DFIND, DCALIB, + DSWD, }; // TODO NTQD: Define new actions like reducing output power, limit ARM core speed, shutdown second TRX/PA, ... enum { #if 0 - TEMP_ACT_PWR_CONTRL = 0x1, + SENSOR_ACT_PWR_CONTRL = 0x1, #endif - TEMP_ACT_PA0_OFF = 0x2, - TEMP_ACT_PA1_OFF = 0x4, - TEMP_ACT_BTS_SRV_OFF = 0x10, + SENSOR_ACT_PA0_OFF = 0x2, + SENSOR_ACT_PA1_OFF = 0x4, + SENSOR_ACT_BTS_SRV_OFF = 0x10, }; /* actions only for normal state */ enum { #if 0 - TEMP_ACT_NORM_PW_CONTRL = 0x1, + SENSOR_ACT_NORM_PW_CONTRL = 0x1, #endif - TEMP_ACT_NORM_PA0_ON = 0x2, - TEMP_ACT_NORM_PA1_ON = 0x4, - TEMP_ACT_NORM_BTS_SRV_ON= 0x10, + SENSOR_ACT_NORM_PA0_ON = 0x2, + SENSOR_ACT_NORM_PA1_ON = 0x4, + SENSOR_ACT_NORM_BTS_SRV_ON= 0x10, }; -enum lc15bts_temp_state { +enum lc15bts_sensor_state { STATE_NORMAL, /* Everything is fine */ STATE_WARNING_HYST, /* Go back to normal next? */ STATE_WARNING, /* We are above the warning threshold */ STATE_CRITICAL, /* We have an issue. Wait for below warning */ +}; + +enum lc15bts_leds_name { + LC15BTS_LED_RED = 0, + LC15BTS_LED_GREEN, + LC15BTS_LED_ORANGE, + LC15BTS_LED_OFF, + _LC15BTS_LED_MAX +}; + +struct lc15bts_led{ + char *name; + char *fullname; + char *path; }; /** @@ -49,8 +111,52 @@ * severe that an action will be taken. */ struct lc15bts_temp_limit { - int thresh_warn; - int thresh_crit; + int thresh_warn_max; + int thresh_crit_max; + int thresh_warn_min; +}; + +struct lc15bts_volt_limit { + int thresh_warn_max; + int thresh_crit_max; + int thresh_warn_min; + int thresh_crit_min; +}; + +struct lc15bts_pwr_limit { + int thresh_warn_max; + int thresh_crit_max; +}; + +struct lc15bts_vswr_limit { + int thresh_warn_max; + int thresh_crit_max; +}; + +struct lc15bts_gps_fix_limit { + int thresh_warn_max; +}; + +struct lc15bts_sleep_time { + int sleep_sec; + int sleep_usec; +}; + +struct lc15bts_led_timer { + uint8_t idx; + struct osmo_timer_list timer; + struct lc15bts_sleep_time param; +}; + +struct lc15bts_led_timer_list { + struct llist_head list; + struct lc15bts_led_timer led_timer; +}; + +struct lc15bts_preventive_list { + struct llist_head list; + struct lc15bts_sleep_time param; + int action_flag; }; enum mgr_vty_node { @@ -59,55 +165,258 @@ ACT_NORM_NODE, ACT_WARN_NODE, ACT_CRIT_NODE, - LIMIT_SUPPLY_NODE, + LIMIT_SUPPLY_TEMP_NODE, LIMIT_SOC_NODE, LIMIT_FPGA_NODE, - LIMIT_LOGRF_NODE, + LIMIT_RMSDET_NODE, LIMIT_OCXO_NODE, - LIMIT_TX0_NODE, - LIMIT_TX1_NODE, - LIMIT_PA0_NODE, - LIMIT_PA1_NODE, + LIMIT_TX0_TEMP_NODE, + LIMIT_TX1_TEMP_NODE, + LIMIT_PA0_TEMP_NODE, + LIMIT_PA1_TEMP_NODE, + LIMIT_SUPPLY_VOLT_NODE, + LIMIT_TX0_VSWR_NODE, + LIMIT_TX1_VSWR_NODE, + LIMIT_SUPPLY_PWR_NODE, + LIMIT_PA0_PWR_NODE, + LIMIT_PA1_PWR_NODE, + LIMIT_GPS_FIX_NODE, +}; + +enum mgr_vty_limit_type { + MGR_LIMIT_TYPE_TEMP = 0, + MGR_LIMIT_TYPE_VOLT, + MGR_LIMIT_TYPE_VSWR, + MGR_LIMIT_TYPE_PWR, + _MGR_LIMIT_TYPE_MAX, }; struct lc15bts_mgr_instance { const char *config_file; struct { + struct lc15bts_temp_limit supply_temp_limit; + struct lc15bts_temp_limit soc_temp_limit; + struct lc15bts_temp_limit fpga_temp_limit; + struct lc15bts_temp_limit rmsdet_temp_limit; + struct lc15bts_temp_limit ocxo_temp_limit; + struct lc15bts_temp_limit tx0_temp_limit; + struct lc15bts_temp_limit tx1_temp_limit; + struct lc15bts_temp_limit pa0_temp_limit; + struct lc15bts_temp_limit pa1_temp_limit; + } temp; + + struct { + struct lc15bts_volt_limit supply_volt_limit; + } volt; + + struct { + struct lc15bts_pwr_limit supply_pwr_limit; + struct lc15bts_pwr_limit pa0_pwr_limit; + struct lc15bts_pwr_limit pa1_pwr_limit; + } pwr; + + struct { + struct lc15bts_vswr_limit tx0_vswr_limit; + struct lc15bts_vswr_limit tx1_vswr_limit; + int tx0_last_vswr; + int tx1_last_vswr; + } vswr; + + struct { + struct lc15bts_gps_fix_limit gps_fix_limit; + time_t last_update; + } gps; + + struct { int action_norm; int action_warn; int action_crit; + int action_comb; - enum lc15bts_temp_state state; - - struct lc15bts_temp_limit supply_limit; - struct lc15bts_temp_limit soc_limit; - struct lc15bts_temp_limit fpga_limit; - struct lc15bts_temp_limit logrf_limit; - struct lc15bts_temp_limit ocxo_limit; - struct lc15bts_temp_limit tx0_limit; - struct lc15bts_temp_limit tx1_limit; - struct lc15bts_temp_limit pa0_limit; - struct lc15bts_temp_limit pa1_limit; - } temp; + enum lc15bts_sensor_state state; + } state; struct { int state; int calib_from_loop; struct osmo_timer_list calib_timeout; } calib; + + struct { + int state; + int swd_from_loop; + unsigned long long int swd_events; + unsigned long long int swd_events_cache; + unsigned long long int swd_eventmasks; + int num_events; + struct osmo_timer_list swd_timeout; + } swd; + + struct { + uint8_t led_idx; + uint8_t last_pattern_id; + uint8_t active_timer; + struct llist_head list; + } lc15bts_leds; + + struct { + int is_up; + uint32_t last_seqno; + struct osmo_timer_list recon_timer; + struct ipa_client_conn *bts_conn; + uint32_t crit_flags; + uint32_t warn_flags; + } lc15bts_ctrl; + + struct lc15bts_alarms { + int temp_high; + int temp_max; + int supply_low; + int supply_min; + int vswr_high; + int vswr_max; + int supply_pwr_high; + int supply_pwr_max; + int supply_pwr_max2; + int pa_pwr_high; + int pa_pwr_max; + int gps_fix_lost; + struct llist_head list; + struct osmo_timer_list preventive_timer; + int preventive_duration; + int preventive_retry; + } alarms; + +}; + +enum lc15bts_mgr_fail_evt_rep_crit_sig { + /* Critical alarms */ + S_MGR_TEMP_SUPPLY_CRIT_MAX_ALARM = (1 << 0), + S_MGR_TEMP_SOC_CRIT_MAX_ALARM = (1 << 1), + S_MGR_TEMP_FPGA_CRIT_MAX_ALARM = (1 << 2), + S_MGR_TEMP_RMS_DET_CRIT_MAX_ALARM = (1 << 3), + S_MGR_TEMP_OCXO_CRIT_MAX_ALARM = (1 << 4), + S_MGR_TEMP_TRX0_CRIT_MAX_ALARM = (1 << 5), + S_MGR_TEMP_TRX1_CRIT_MAX_ALARM = (1 << 6), + S_MGR_TEMP_PA0_CRIT_MAX_ALARM = (1 << 7), + S_MGR_TEMP_PA1_CRIT_MAX_ALARM = (1 << 8), + S_MGR_SUPPLY_CRIT_MAX_ALARM = (1 << 9), + S_MGR_SUPPLY_CRIT_MIN_ALARM = (1 << 10), + S_MGR_VSWR0_CRIT_MAX_ALARM = (1 << 11), + S_MGR_VSWR1_CRIT_MAX_ALARM = (1 << 12), + S_MGR_PWR_SUPPLY_CRIT_MAX_ALARM = (1 << 13), + S_MGR_PWR_PA0_CRIT_MAX_ALARM = (1 << 14), + S_MGR_PWR_PA1_CRIT_MAX_ALARM = (1 << 15), + _S_MGR_CRIT_ALARM_MAX, +}; + +enum lc15bts_mgr_fail_evt_rep_warn_sig { + /* Warning alarms */ + S_MGR_TEMP_SUPPLY_WARN_MIN_ALARM = (1 << 0), + S_MGR_TEMP_SUPPLY_WARN_MAX_ALARM = (1 << 2), + S_MGR_TEMP_SOC_WARN_MIN_ALARM = (1 << 3), + S_MGR_TEMP_SOC_WARN_MAX_ALARM = (1 << 4), + S_MGR_TEMP_FPGA_WARN_MIN_ALARM = (1 << 5), + S_MGR_TEMP_FPGA_WARN_MAX_ALARM = (1 << 6), + S_MGR_TEMP_RMS_DET_WARN_MIN_ALARM = (1 << 7), + S_MGR_TEMP_RMS_DET_WARN_MAX_ALARM = (1 << 8), + S_MGR_TEMP_OCXO_WARN_MIN_ALARM = (1 << 9), + S_MGR_TEMP_OCXO_WARN_MAX_ALARM = (1 << 10), + S_MGR_TEMP_TRX0_WARN_MIN_ALARM = (1 << 11), + S_MGR_TEMP_TRX0_WARN_MAX_ALARM = (1 << 12), + S_MGR_TEMP_TRX1_WARN_MIN_ALARM = (1 << 13), + S_MGR_TEMP_TRX1_WARN_MAX_ALARM = (1 << 14), + S_MGR_TEMP_PA0_WARN_MIN_ALARM = (1 << 15), + S_MGR_TEMP_PA0_WARN_MAX_ALARM = (1 << 16), + S_MGR_TEMP_PA1_WARN_MIN_ALARM = (1 << 17), + S_MGR_TEMP_PA1_WARN_MAX_ALARM = (1 << 18), + S_MGR_SUPPLY_WARN_MIN_ALARM = (1 << 19), + S_MGR_SUPPLY_WARN_MAX_ALARM = (1 << 20), + S_MGR_VSWR0_WARN_MAX_ALARM = (1 << 21), + S_MGR_VSWR1_WARN_MAX_ALARM = (1 << 22), + S_MGR_PWR_SUPPLY_WARN_MAX_ALARM = (1 << 23), + S_MGR_PWR_PA0_WARN_MAX_ALARM = (1 << 24), + S_MGR_PWR_PA1_WARN_MAX_ALARM = (1 << 25), + S_MGR_GPS_FIX_WARN_ALARM = (1 << 26), + _S_MGR_WARN_ALARM_MAX, +}; + +enum lc15bts_mgr_failure_event_causes { + /* Critical causes */ + NM_EVT_CAUSE_CRIT_TEMP_SUPPLY_MAX_FAIL = 0x4100, + NM_EVT_CAUSE_CRIT_TEMP_FPGA_MAX_FAIL = 0x4101, + NM_EVT_CAUSE_CRIT_TEMP_SOC_MAX_FAIL = 0x4102, + NM_EVT_CAUSE_CRIT_TEMP_RMS_DET_MAX_FAIL = 0x4103, + NM_EVT_CAUSE_CRIT_TEMP_OCXO_MAX_FAIL = 0x4104, + NM_EVT_CAUSE_CRIT_TEMP_TRX0_MAX_FAIL = 0x4105, + NM_EVT_CAUSE_CRIT_TEMP_TRX1_MAX_FAIL = 0x4106, + NM_EVT_CAUSE_CRIT_TEMP_PA0_MAX_FAIL = 0x4107, + NM_EVT_CAUSE_CRIT_TEMP_PA1_MAX_FAIL = 0x4108, + NM_EVT_CAUSE_CRIT_SUPPLY_MAX_FAIL = 0x4109, + NM_EVT_CAUSE_CRIT_SUPPLY_MIN_FAIL = 0x410A, + NM_EVT_CAUSE_CRIT_VSWR0_MAX_FAIL = 0x410B, + NM_EVT_CAUSE_CRIT_VSWR1_MAX_FAIL = 0x410C, + NM_EVT_CAUSE_CRIT_PWR_SUPPLY_MAX_FAIL = 0x410D, + NM_EVT_CAUSE_CRIT_PWR_PA0_MAX_FAIL = 0x410E, + NM_EVT_CAUSE_CRIT_PWR_PA1_MAX_FAIL = 0x410F, + /* Warning causes */ + NM_EVT_CAUSE_WARN_TEMP_SUPPLY_LOW_FAIL = 0x4400, + NM_EVT_CAUSE_WARN_TEMP_SUPPLY_HIGH_FAIL = 0x4401, + NM_EVT_CAUSE_WARN_TEMP_FPGA_LOW_FAIL = 0x4402, + NM_EVT_CAUSE_WARN_TEMP_FPGA_HIGH_FAIL = 0x4403, + NM_EVT_CAUSE_WARN_TEMP_SOC_LOW_FAIL = 0x4404, + NM_EVT_CAUSE_WARN_TEMP_SOC_HIGH_FAIL = 0x4405, + NM_EVT_CAUSE_WARN_TEMP_RMS_DET_LOW_FAIL = 0x4406, + NM_EVT_CAUSE_WARN_TEMP_RMS_DET_HIGH_FAIL= 0x4407, + NM_EVT_CAUSE_WARN_TEMP_OCXO_LOW_FAIL = 0x4408, + NM_EVT_CAUSE_WARN_TEMP_OCXO_HIGH_FAIL = 0x4409, + NM_EVT_CAUSE_WARN_TEMP_TRX0_LOW_FAIL = 0x440A, + NM_EVT_CAUSE_WARN_TEMP_TRX0_HIGH_FAIL = 0x440B, + NM_EVT_CAUSE_WARN_TEMP_TRX1_LOW_FAIL = 0x440C, + NM_EVT_CAUSE_WARN_TEMP_TRX1_HIGH_FAIL = 0x440D, + NM_EVT_CAUSE_WARN_TEMP_PA0_LOW_FAIL = 0x440E, + NM_EVT_CAUSE_WARN_TEMP_PA0_HIGH_FAIL = 0x440F, + NM_EVT_CAUSE_WARN_TEMP_PA1_LOW_FAIL = 0x4410, + NM_EVT_CAUSE_WARN_TEMP_PA1_HIGH_FAIL = 0x4411, + NM_EVT_CAUSE_WARN_SUPPLY_LOW_FAIL = 0x4412, + NM_EVT_CAUSE_WARN_SUPPLY_HIGH_FAIL = 0x4413, + NM_EVT_CAUSE_WARN_VSWR0_HIGH_FAIL = 0x4414, + NM_EVT_CAUSE_WANR_VSWR1_HIGH_FAIL = 0x4415, + NM_EVT_CAUSE_WARN_PWR_SUPPLY_HIGH_FAIL = 0x4416, + NM_EVT_CAUSE_WARN_PWR_PA0_HIGH_FAIL = 0x4417, + NM_EVT_CAUSE_WARN_PWR_PA1_HIGH_FAIL = 0x4418, + NM_EVT_CAUSE_WARN_GPS_FIX_FAIL = 0x4419, +}; + +/* This defines the list of notification events for systemd service watchdog. + all these events must be notified in a certain service defined timeslot + or the service (this app) would be restarted (only if related systemd service + unit file has WatchdogSec!=0). + WARNING: swd events must begin with event 0. Last events must be + SWD_LAST (max 64 events in this list). +*/ +enum mgr_swd_events { + SWD_MAINLOOP = 0, + SWD_CHECK_SENSOR, + SWD_UPDATE_HOURS, + SWD_CHECK_TEMP_SENSOR, + SWD_CHECK_LED_CTRL, + SWD_CHECK_CALIB, + SWD_CHECK_BTS_CONNECTION, + SWD_LAST }; int lc15bts_mgr_vty_init(void); int lc15bts_mgr_parse_config(struct lc15bts_mgr_instance *mgr); int lc15bts_mgr_nl_init(void); -int lc15bts_mgr_temp_init(struct lc15bts_mgr_instance *mgr); -const char *lc15bts_mgr_temp_get_state(enum lc15bts_temp_state state); - +int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr); +const char *lc15bts_mgr_sensor_get_state(enum lc15bts_sensor_state state); int lc15bts_mgr_calib_init(struct lc15bts_mgr_instance *mgr); +int lc15bts_mgr_control_init(struct lc15bts_mgr_instance *mgr); int lc15bts_mgr_calib_run(struct lc15bts_mgr_instance *mgr); - +void lc15bts_mgr_dispatch_alarm(struct lc15bts_mgr_instance *mgr, const int cause, const char *key, const char *text); extern void *tall_mgr_ctx; #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 042fc87..9d2dfec 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -22,19 +22,22 @@ * along with this program. If not, see . * */ - +#include #include "misc/lc15bts_mgr.h" #include "misc/lc15bts_misc.h" #include "misc/lc15bts_temp.h" #include "misc/lc15bts_power.h" +#include "misc/lc15bts_led.h" +#include "limits.h" #include #include #include +#include -static struct lc15bts_mgr_instance *s_mgr; -static struct osmo_timer_list temp_ctrl_timer; +struct lc15bts_mgr_instance *s_mgr; +static struct osmo_timer_list sensor_ctrl_timer; static const struct value_string state_names[] = { { STATE_NORMAL, "NORMAL" }, @@ -44,12 +47,12 @@ { 0, NULL } }; -const char *lc15bts_mgr_temp_get_state(enum lc15bts_temp_state state) +const char *lc15bts_mgr_sensor_get_state(enum lc15bts_sensor_state state) { return get_value_string(state_names, state); } -static int next_state(enum lc15bts_temp_state current_state, int critical, int warning) +static int next_state(enum lc15bts_sensor_state current_state, int critical, int warning) { int next_state = -1; switch (current_state) { @@ -85,7 +88,7 @@ static void handle_normal_actions(int actions) { /* switch on the PA */ - if (actions & TEMP_ACT_NORM_PA0_ON) { + if (actions & SENSOR_ACT_NORM_PA0_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA0, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch on the PA #0\n"); @@ -95,7 +98,7 @@ } } - if (actions & TEMP_ACT_NORM_PA1_ON) { + if (actions & SENSOR_ACT_NORM_PA1_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch on the PA #1\n"); @@ -105,7 +108,7 @@ } } - if (actions & TEMP_ACT_NORM_BTS_SRV_ON) { + if (actions & SENSOR_ACT_NORM_BTS_SRV_ON) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch on the BTS service\n"); /* @@ -120,7 +123,7 @@ static void handle_actions(int actions) { /* switch off the PA */ - if (actions & TEMP_ACT_PA1_OFF) { + if (actions & SENSOR_ACT_PA1_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch off the PA #1. Stop BTS?\n"); @@ -130,7 +133,7 @@ } } - if (actions & TEMP_ACT_PA0_OFF) { + if (actions & SENSOR_ACT_PA0_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA0, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch off the PA #0. Stop BTS?\n"); @@ -140,7 +143,7 @@ } } - if (actions & TEMP_ACT_BTS_SRV_OFF) { + if (actions & SENSOR_ACT_BTS_SRV_OFF) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch off the BTS service\n"); /* @@ -161,36 +164,36 @@ */ static void execute_normal_act(struct lc15bts_mgr_instance *manager) { - LOGP(DTEMP, LOGL_NOTICE, "System is back to normal temperature.\n"); - handle_normal_actions(manager->temp.action_norm); + LOGP(DTEMP, LOGL_NOTICE, "System is back to normal state.\n"); + handle_normal_actions(manager->state.action_norm); } static void execute_warning_act(struct lc15bts_mgr_instance *manager) { - LOGP(DTEMP, LOGL_NOTICE, "System has reached temperature warning.\n"); - handle_actions(manager->temp.action_warn); + LOGP(DTEMP, LOGL_NOTICE, "System has reached warning state.\n"); + handle_actions(manager->state.action_warn); } static void execute_critical_act(struct lc15bts_mgr_instance *manager) { LOGP(DTEMP, LOGL_NOTICE, "System has reached critical warning.\n"); - handle_actions(manager->temp.action_crit); + handle_actions(manager->state.action_crit); } -static void lc15bts_mgr_temp_handle(struct lc15bts_mgr_instance *manager, +static void lc15bts_mgr_sensor_handle(struct lc15bts_mgr_instance *manager, int critical, int warning) { - int new_state = next_state(manager->temp.state, critical, warning); + int new_state = next_state(manager->state.state, critical, warning); /* Nothing changed */ if (new_state < 0) return; LOGP(DTEMP, LOGL_NOTICE, "Moving from state %s to %s.\n", - get_value_string(state_names, manager->temp.state), + get_value_string(state_names, manager->state.state), get_value_string(state_names, new_state)); - manager->temp.state = new_state; - switch (manager->temp.state) { + manager->state.state = new_state; + switch (manager->state.state) { case STATE_NORMAL: execute_normal_act(manager); break; @@ -206,163 +209,168 @@ }; } -static void temp_ctrl_check() +static void sensor_ctrl_check(struct lc15bts_mgr_instance *mgr) { int rc; + int temp = 0; int warn_thresh_passed = 0; int crit_thresh_passed = 0; LOGP(DTEMP, LOGL_DEBUG, "Going to check the temperature.\n"); /* Read the current supply temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY); + rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the supply temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.supply_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.supply_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.supply_limit.thresh_crit) + if (temp > mgr->temp.supply_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "Supply temperature is: %d\n", temp); } /* Read the current SoC temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SOC); + rc = lc15bts_temp_get(LC15BTS_TEMP_SOC, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the SoC temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.soc_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.soc_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.soc_limit.thresh_crit) + if (temp > mgr->temp.soc_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "SoC temperature is: %d\n", temp); } /* Read the current fpga temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA); + rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the fpga temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.fpga_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.fpga_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.fpga_limit.thresh_crit) + if (temp > mgr->temp.fpga_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "FPGA temperature is: %d\n", temp); } - /* Read the current RF log detector temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_LOGRF); + /* Read the current RMS detector temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_RMSDET, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the RF log detector temperature. rc=%d\n", rc); + "Failed to read the RMS detector temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.logrf_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.rmsdet_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.logrf_limit.thresh_crit) + if (temp > mgr->temp.rmsdet_temp_limit.thresh_crit_max) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "RF log detector temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "RMS detector temperature is: %d\n", temp); } /* Read the current OCXO temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO); + rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the OCXO temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.ocxo_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.ocxo_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.ocxo_limit.thresh_crit) + if (temp > mgr->temp.ocxo_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "OCXO temperature is: %d\n", temp); } - /* Read the current TX #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX0); + /* Read the current TX #0 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX0, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.tx0_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.tx0_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx0_limit.thresh_crit) + if (temp > mgr->temp.tx0_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "TX #0 temperature is: %d\n", temp); } - /* Read the current TX #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX1); + /* Read the current TX #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX1, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #1 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.tx1_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.tx1_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx1_limit.thresh_crit) + if (temp > mgr->temp.tx1_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "TX #1 temperature is: %d\n", temp); } - /* Read the current PA #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA0); + /* Read the current PA #0 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA0, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa0_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.pa0_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa0_limit.thresh_crit) + if (temp > mgr->temp.pa0_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #0 temperature is: %d\n", temp); } - /* Read the current PA #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA1); + /* Read the current PA #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA1, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #1 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa1_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.pa1_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa1_limit.thresh_crit) + if (temp > mgr->temp.pa1_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #1 temperature is: %d\n", temp); } - lc15bts_mgr_temp_handle(s_mgr, crit_thresh_passed, warn_thresh_passed); + lc15bts_mgr_sensor_handle(mgr, crit_thresh_passed, warn_thresh_passed); } -static void temp_ctrl_check_cb(void *unused) +static void sensor_ctrl_check_cb(void *_data) { - temp_ctrl_check(); - /* Check every two minutes? XXX make it configurable! */ - osmo_timer_schedule(&temp_ctrl_timer, 2 * 60, 0); + struct lc15bts_mgr_instance *mgr = _data; + sensor_ctrl_check(mgr); + /* Check every minute? XXX make it configurable! */ + osmo_timer_schedule(&sensor_ctrl_timer, LC15BTS_SENSOR_TIMER_DURATION, 0); + LOGP(DTEMP, LOGL_DEBUG,"Check sensors timer expired\n"); + /* TODO: do we want to notify if some sensors could not be read? */ } -int lc15bts_mgr_temp_init(struct lc15bts_mgr_instance *mgr) +int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr) { s_mgr = mgr; - temp_ctrl_timer.cb = temp_ctrl_check_cb; - temp_ctrl_check_cb(NULL); + sensor_ctrl_timer.cb = sensor_ctrl_check_cb; + sensor_ctrl_timer.data = s_mgr; + sensor_ctrl_check_cb(s_mgr); return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index 280c9c7..b96349e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -43,6 +44,7 @@ #include "lc15bts_mgr.h" #include "lc15bts_temp.h" #include "lc15bts_power.h" +#include "lc15bts_led.h" #include "btsconfig.h" static struct lc15bts_mgr_instance *s_mgr; @@ -64,15 +66,21 @@ case ACT_NORM_NODE: case ACT_WARN_NODE: case ACT_CRIT_NODE: - case LIMIT_SUPPLY_NODE: + case LIMIT_SUPPLY_TEMP_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_LOGRF_NODE: + case LIMIT_RMSDET_NODE: case LIMIT_OCXO_NODE: - case LIMIT_TX0_NODE: - case LIMIT_TX1_NODE: - case LIMIT_PA0_NODE: - case LIMIT_PA1_NODE: + case LIMIT_TX0_TEMP_NODE: + case LIMIT_TX1_TEMP_NODE: + case LIMIT_PA0_TEMP_NODE: + case LIMIT_PA1_TEMP_NODE: + case LIMIT_SUPPLY_VOLT_NODE: + case LIMIT_TX0_VSWR_NODE: + case LIMIT_TX1_VSWR_NODE: + case LIMIT_SUPPLY_PWR_NODE: + case LIMIT_PA0_PWR_NODE: + case LIMIT_PA1_PWR_NODE: vty->node = MGR_NODE; break; default: @@ -88,15 +96,21 @@ case ACT_NORM_NODE: case ACT_WARN_NODE: case ACT_CRIT_NODE: - case LIMIT_SUPPLY_NODE: + case LIMIT_SUPPLY_TEMP_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_LOGRF_NODE: + case LIMIT_RMSDET_NODE: case LIMIT_OCXO_NODE: - case LIMIT_TX0_NODE: - case LIMIT_TX1_NODE: - case LIMIT_PA0_NODE: - case LIMIT_PA1_NODE: + case LIMIT_TX0_TEMP_NODE: + case LIMIT_TX1_TEMP_NODE: + case LIMIT_PA0_TEMP_NODE: + case LIMIT_PA1_TEMP_NODE: + case LIMIT_SUPPLY_VOLT_NODE: + case LIMIT_TX0_VSWR_NODE: + case LIMIT_TX1_VSWR_NODE: + case LIMIT_SUPPLY_PWR_NODE: + case LIMIT_PA0_PWR_NODE: + case LIMIT_PA1_PWR_NODE: return 1; default: return 0; @@ -122,25 +136,25 @@ static struct cmd_node act_norm_node = { ACT_NORM_NODE, - "%s(action-normal)# ", + "%s(actions-normal)# ", 1, }; static struct cmd_node act_warn_node = { ACT_WARN_NODE, - "%s(action-warn)# ", + "%s(actions-warn)# ", 1, }; static struct cmd_node act_crit_node = { ACT_CRIT_NODE, - "%s(action-critical)# ", + "%s(actions-critical)# ", 1, }; -static struct cmd_node limit_supply_node = { - LIMIT_SUPPLY_NODE, - "%s(limit-supply)# ", +static struct cmd_node limit_supply_temp_node = { + LIMIT_SUPPLY_TEMP_NODE, + "%s(limit-supply-temp)# ", 1, }; @@ -156,9 +170,9 @@ 1, }; -static struct cmd_node limit_logrf_node = { - LIMIT_LOGRF_NODE, - "%s(limit-logrf)# ", +static struct cmd_node limit_rmsdet_node = { + LIMIT_RMSDET_NODE, + "%s(limit-rmsdet)# ", 1, }; @@ -168,24 +182,60 @@ 1, }; -static struct cmd_node limit_tx0_node = { - LIMIT_TX0_NODE, - "%s(limit-tx0)# ", +static struct cmd_node limit_tx0_temp_node = { + LIMIT_TX0_TEMP_NODE, + "%s(limit-tx0-temp)# ", 1, }; -static struct cmd_node limit_tx1_node = { - LIMIT_TX1_NODE, - "%s(limit-tx1)# ", +static struct cmd_node limit_tx1_temp_node = { + LIMIT_TX1_TEMP_NODE, + "%s(limit-tx1-temp)# ", 1, }; -static struct cmd_node limit_pa0_node = { - LIMIT_PA0_NODE, - "%s(limit-pa0)# ", +static struct cmd_node limit_pa0_temp_node = { + LIMIT_PA0_TEMP_NODE, + "%s(limit-pa0-temp)# ", 1, }; -static struct cmd_node limit_pa1_node = { - LIMIT_PA1_NODE, - "%s(limit-pa1)# ", +static struct cmd_node limit_pa1_temp_node = { + LIMIT_PA1_TEMP_NODE, + "%s(limit-pa1-temp)# ", + 1, +}; +static struct cmd_node limit_supply_volt_node = { + LIMIT_SUPPLY_VOLT_NODE, + "%s(limit-supply-volt)# ", + 1, +}; +static struct cmd_node limit_tx0_vswr_node = { + LIMIT_TX0_VSWR_NODE, + "%s(limit-tx0-vswr)# ", + 1, +}; +static struct cmd_node limit_tx1_vswr_node = { + LIMIT_TX1_VSWR_NODE, + "%s(limit-tx1-vswr)# ", + 1, +}; +static struct cmd_node limit_supply_pwr_node = { + LIMIT_SUPPLY_PWR_NODE, + "%s(limit-supply-pwr)# ", + 1, +}; +static struct cmd_node limit_pa0_pwr_node = { + LIMIT_PA0_PWR_NODE, + "%s(limit-pa0-pwr)# ", + 1, +}; +static struct cmd_node limit_pa1_pwr_node = { + LIMIT_PA1_PWR_NODE, + "%s(limit-pa1-pwr)# ", + 1, +}; + +static struct cmd_node limit_gps_fix_node = { + LIMIT_GPS_FIX_NODE, + "%s(limit-gps-fix)# ", 1, }; @@ -197,55 +247,68 @@ return CMD_SUCCESS; } -static void write_temp_limit(struct vty *vty, const char *name, - struct lc15bts_temp_limit *limit) +static void write_volt_limit(struct vty *vty, const char *name, + struct lc15bts_volt_limit *limit) { vty_out(vty, " %s%s", name, VTY_NEWLINE); - vty_out(vty, " threshold warning %d%s", - limit->thresh_warn, VTY_NEWLINE); - vty_out(vty, " threshold critical %d%s", - limit->thresh_crit, VTY_NEWLINE); + vty_out(vty, " threshold warning min %d%s", + limit->thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " threshold critical min %d%s", + limit->thresh_crit_min, VTY_NEWLINE); +} + +static void write_vswr_limit(struct vty *vty, const char *name, + struct lc15bts_vswr_limit *limit) +{ + vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " threshold warning max %d%s", + limit->thresh_warn_max, VTY_NEWLINE); +} + +static void write_pwr_limit(struct vty *vty, const char *name, + struct lc15bts_pwr_limit *limit) +{ + vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " threshold warning max %d%s", + limit->thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " threshold critical max %d%s", + limit->thresh_crit_max, VTY_NEWLINE); } static void write_norm_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); vty_out(vty, " %spa0-on%s", - (actions & TEMP_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-on%s", - (actions & TEMP_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-on%s", - (actions & TEMP_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); } static void write_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); vty_out(vty, " %spa0-off%s", - (actions & TEMP_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-off%s", - (actions & TEMP_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-off%s", - (actions & TEMP_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); } static int config_write_mgr(struct vty *vty) { vty_out(vty, "lc15bts-mgr%s", VTY_NEWLINE); - write_temp_limit(vty, "limits supply", &s_mgr->temp.supply_limit); - write_temp_limit(vty, "limits soc", &s_mgr->temp.soc_limit); - write_temp_limit(vty, "limits fpga", &s_mgr->temp.fpga_limit); - write_temp_limit(vty, "limits logrf", &s_mgr->temp.logrf_limit); - write_temp_limit(vty, "limits ocxo", &s_mgr->temp.ocxo_limit); - write_temp_limit(vty, "limits tx0", &s_mgr->temp.tx0_limit); - write_temp_limit(vty, "limits tx1", &s_mgr->temp.tx1_limit); - write_temp_limit(vty, "limits pa0", &s_mgr->temp.pa0_limit); - write_temp_limit(vty, "limits pa1", &s_mgr->temp.pa1_limit); + write_volt_limit(vty, "limits supply_volt", &s_mgr->volt.supply_volt_limit); + write_pwr_limit(vty, "limits supply_pwr", &s_mgr->pwr.supply_pwr_limit); + write_vswr_limit(vty, "limits tx0_vswr", &s_mgr->vswr.tx0_vswr_limit); + write_vswr_limit(vty, "limits tx1_vswr", &s_mgr->vswr.tx1_vswr_limit); - write_norm_action(vty, "actions normal", s_mgr->temp.action_norm); - write_action(vty, "actions warn", s_mgr->temp.action_warn); - write_action(vty, "actions critical", s_mgr->temp.action_crit); + write_norm_action(vty, "actions normal", s_mgr->state.action_norm); + write_action(vty, "actions warn", s_mgr->state.action_warn); + write_action(vty, "actions critical", s_mgr->state.action_crit); return CMD_SUCCESS; } @@ -255,7 +318,7 @@ return CMD_SUCCESS; } -#define CFG_LIMIT(name, expl, switch_to, variable) \ +#define CFG_LIMIT_TEMP(name, expl, switch_to, variable) \ DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ "limits " #name, \ "Configure Limits\n" expl) \ @@ -265,32 +328,123 @@ return CMD_SUCCESS; \ } -CFG_LIMIT(supply, "SUPPLY\n", LIMIT_SUPPLY_NODE, supply_limit) -CFG_LIMIT(soc, "SOC\n", LIMIT_SOC_NODE, soc_limit) -CFG_LIMIT(fpga, "FPGA\n", LIMIT_FPGA_NODE, fpga_limit) -CFG_LIMIT(logrf, "LOGRF\n", LIMIT_LOGRF_NODE, logrf_limit) -CFG_LIMIT(ocxo, "OCXO\n", LIMIT_OCXO_NODE, ocxo_limit) -CFG_LIMIT(tx0, "TX0\n", LIMIT_TX0_NODE, tx0_limit) -CFG_LIMIT(tx1, "TX1\n", LIMIT_TX1_NODE, tx1_limit) -CFG_LIMIT(pa0, "PA0\n", LIMIT_PA0_NODE, pa0_limit) -CFG_LIMIT(pa1, "PA1\n", LIMIT_PA1_NODE, pa1_limit) -#undef CFG_LIMIT +CFG_LIMIT_TEMP(supply_temp, "SUPPLY TEMP\n", LIMIT_SUPPLY_TEMP_NODE, supply_temp_limit) +CFG_LIMIT_TEMP(soc_temp, "SOC TEMP\n", LIMIT_SOC_NODE, soc_temp_limit) +CFG_LIMIT_TEMP(fpga_temp, "FPGA TEMP\n", LIMIT_FPGA_NODE, fpga_temp_limit) +CFG_LIMIT_TEMP(rmsdet_temp, "RMSDET TEMP\n", LIMIT_RMSDET_NODE, rmsdet_temp_limit) +CFG_LIMIT_TEMP(ocxo_temp, "OCXO TEMP\n", LIMIT_OCXO_NODE, ocxo_temp_limit) +CFG_LIMIT_TEMP(tx0_temp, "TX0 TEMP\n", LIMIT_TX0_TEMP_NODE, tx0_temp_limit) +CFG_LIMIT_TEMP(tx1_temp, "TX1 TEMP\n", LIMIT_TX1_TEMP_NODE, tx1_temp_limit) +CFG_LIMIT_TEMP(pa0_temp, "PA0 TEMP\n", LIMIT_PA0_TEMP_NODE, pa0_temp_limit) +CFG_LIMIT_TEMP(pa1_temp, "PA1 TEMP\n", LIMIT_PA1_TEMP_NODE, pa1_temp_limit) +#undef CFG_LIMIT_TEMP -DEFUN(cfg_limit_warning, cfg_thresh_warning_cmd, - "threshold warning <0-200>", +#define CFG_LIMIT_VOLT(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->volt.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_VOLT(supply_volt, "SUPPLY VOLT\n", LIMIT_SUPPLY_VOLT_NODE, supply_volt_limit) +#undef CFG_LIMIT_VOLT + +#define CFG_LIMIT_VSWR(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->vswr.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_VSWR(tx0_vswr, "TX0 VSWR\n", LIMIT_TX0_VSWR_NODE, tx0_vswr_limit) +CFG_LIMIT_VSWR(tx1_vswr, "TX1 VSWR\n", LIMIT_TX1_VSWR_NODE, tx1_vswr_limit) +#undef CFG_LIMIT_VSWR + +#define CFG_LIMIT_PWR(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->pwr.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_PWR(supply_pwr, "SUPPLY PWR\n", LIMIT_SUPPLY_PWR_NODE, supply_pwr_limit) +CFG_LIMIT_PWR(pa0_pwr, "PA0 PWR\n", LIMIT_PA0_PWR_NODE, pa0_pwr_limit) +CFG_LIMIT_PWR(pa1_pwr, "PA1 PWR\n", LIMIT_PA1_PWR_NODE, pa1_pwr_limit) +#undef CFG_LIMIT_PWR + +#define CFG_LIMIT_GPS_FIX(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->gps.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_GPS_FIX(gps_fix, "GPS FIX\n", LIMIT_GPS_FIX_NODE, gps_fix_limit) +#undef CFG_LIMIT_GPS_FIX + +DEFUN(cfg_limit_volt_warn_min, cfg_thresh_volt_warn_min_cmd, + "threshold warning min <0-48000>", "Threshold to reach\n" "Warning level\n" "Range\n") { - struct lc15bts_temp_limit *limit = vty->index; - limit->thresh_warn = atoi(argv[0]); + struct lc15bts_volt_limit *limit = vty->index; + limit->thresh_warn_min = atoi(argv[0]); return CMD_SUCCESS; } -DEFUN(cfg_limit_crit, cfg_thresh_crit_cmd, - "threshold critical <0-200>", - "Threshold to reach\n" "Severe level\n" "Range\n") +DEFUN(cfg_limit_volt_crit_min, cfg_thresh_volt_crit_min_cmd, + "threshold critical min <0-48000>", + "Threshold to reach\n" "Critical level\n" "Range\n") { - struct lc15bts_temp_limit *limit = vty->index; - limit->thresh_crit = atoi(argv[0]); + struct lc15bts_volt_limit *limit = vty->index; + limit->thresh_crit_min = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_vswr_warn_max, cfg_thresh_vswr_warn_max_cmd, + "threshold warning max <1000-200000>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_vswr_limit *limit = vty->index; + limit->thresh_warn_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_vswr_crit_max, cfg_thresh_vswr_crit_max_cmd, + "threshold critical max <1000-200000>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_vswr_limit *limit = vty->index; + limit->thresh_crit_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_pwr_warn_max, cfg_thresh_pwr_warn_max_cmd, + "threshold warning max <0-200>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_pwr_limit *limit = vty->index; + limit->thresh_warn_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_pwr_crit_max, cfg_thresh_pwr_crit_max_cmd, + "threshold critical max <0-200>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_pwr_limit *limit = vty->index; + limit->thresh_crit_max = atoi(argv[0]); return CMD_SUCCESS; } @@ -300,7 +454,7 @@ "Configure Actions\n" expl) \ { \ vty->node = switch_to; \ - vty->index = &s_mgr->temp.variable; \ + vty->index = &s_mgr->state.variable; \ return CMD_SUCCESS; \ } CFG_ACTION(normal, "Normal Actions\n", ACT_NORM_NODE, action_norm) @@ -313,7 +467,7 @@ "Switch the Power Amplifier #0 on\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_PA0_ON; + *action |= SENSOR_ACT_NORM_PA0_ON; return CMD_SUCCESS; } @@ -322,7 +476,7 @@ NO_STR "Switch the Power Amplifieri #0 on\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA0_ON; + *action &= ~SENSOR_ACT_NORM_PA0_ON; return CMD_SUCCESS; } @@ -331,7 +485,7 @@ "Switch the Power Amplifier #1 on\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_PA1_ON; + *action |= SENSOR_ACT_NORM_PA1_ON; return CMD_SUCCESS; } @@ -340,7 +494,7 @@ NO_STR "Switch the Power Amplifieri #1 on\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA1_ON; + *action &= ~SENSOR_ACT_NORM_PA1_ON; return CMD_SUCCESS; } @@ -349,7 +503,7 @@ "Start the systemd lc15bts.service\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_BTS_SRV_ON; + *action |= SENSOR_ACT_NORM_BTS_SRV_ON; return CMD_SUCCESS; } @@ -358,7 +512,7 @@ NO_STR "Start the systemd lc15bts.service\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_BTS_SRV_ON; + *action &= ~SENSOR_ACT_NORM_BTS_SRV_ON; return CMD_SUCCESS; } @@ -367,7 +521,7 @@ "Switch the Power Amplifier #0 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA0_OFF; + *action |= SENSOR_ACT_PA0_OFF; return CMD_SUCCESS; } @@ -376,7 +530,7 @@ NO_STR "Do not switch off the Power Amplifier #0\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA0_OFF; + *action &= ~SENSOR_ACT_PA0_OFF; return CMD_SUCCESS; } @@ -385,7 +539,7 @@ "Switch the Power Amplifier #1 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA1_OFF; + *action |= SENSOR_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -394,7 +548,7 @@ NO_STR "Do not switch off the Power Amplifier #1\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA1_OFF; + *action &= ~SENSOR_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -403,7 +557,7 @@ "Stop the systemd lc15bts.service\n") { int *action = vty->index; - *action |= TEMP_ACT_BTS_SRV_OFF; + *action |= SENSOR_ACT_BTS_SRV_OFF; return CMD_SUCCESS; } @@ -412,71 +566,173 @@ NO_STR "Stop the systemd lc15bts.service\n") { int *action = vty->index; - *action &= ~TEMP_ACT_BTS_SRV_OFF; + *action &= ~SENSOR_ACT_BTS_SRV_OFF; return CMD_SUCCESS; } DEFUN(show_mgr, show_mgr_cmd, "show manager", SHOW_STR "Display information about the manager") { + int temp, volt, current, power, vswr; + vty_out(vty, "Warning alarm flags: 0x%08x%s", + s_mgr->lc15bts_ctrl.warn_flags, VTY_NEWLINE); + vty_out(vty, "Critical alarm flags: 0x%08x%s", + s_mgr->lc15bts_ctrl.crit_flags, VTY_NEWLINE); + vty_out(vty, "Preventive action retried: %d%s", + s_mgr->alarms.preventive_retry, VTY_NEWLINE); vty_out(vty, "Temperature control state: %s%s", - lc15bts_mgr_temp_get_state(s_mgr->temp.state), VTY_NEWLINE); + lc15bts_mgr_sensor_get_state(s_mgr->state.state), VTY_NEWLINE); vty_out(vty, "Current Temperatures%s", VTY_NEWLINE); - vty_out(vty, " Main Supply : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SUPPLY) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, &temp); + vty_out(vty, " Main Supply : %4.2f Celcius%s", + temp/ 1000.0f, VTY_NEWLINE); - vty_out(vty, " SoC : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SOC) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SOC, &temp); + vty_out(vty, " SoC : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " FPGA : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_FPGA) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_FPGA, &temp); + vty_out(vty, " FPGA : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " LogRF : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_LOGRF) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_RMSDET, &temp); + vty_out(vty, " RMSDet : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " OCXO : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_OCXO) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_OCXO, &temp); + vty_out(vty, " OCXO : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 0 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX0) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX0, &temp); + vty_out(vty, " TX 0 : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 1 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX1) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX1, &temp); + vty_out(vty, " TX 1 : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Power Amp #0: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA0) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA0, &temp); + vty_out(vty, " Power Amp #0: %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Power Amp #1: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA1) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA1, &temp); + vty_out(vty, " Power Amp #1: %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); vty_out(vty, "Power Status%s", VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Main Supply : ON [%6.2f Vdc, %4.2f A, %6.2f W]%s", - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Power Amp #0: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_get(LC15BTS_POWER_PA0) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Power Amp #1: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_get(LC15BTS_POWER_PA1) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + vty_out(vty, "VSWR Status%s", VTY_NEWLINE); + lc15bts_vswr_get(LC15BTS_VSWR_TX0, &vswr); + vty_out(vty, " VSWR TX 0: %f %s", + vswr / 1000.0f, + VTY_NEWLINE); + lc15bts_vswr_get(LC15BTS_VSWR_TX1, &vswr); + vty_out(vty, " VSWR TX 1: %f %s", + vswr / 1000.0f, + VTY_NEWLINE); + + return CMD_SUCCESS; +} + +DEFUN(show_thresh, show_thresh_cmd, "show thresholds", + SHOW_STR "Display information about the thresholds") +{ + vty_out(vty, "Temperature limits (Celsius)%s", VTY_NEWLINE); + vty_out(vty, " Main supply%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.supply_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.supply_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.supply_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " SoC%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.soc_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.soc_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.soc_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " FPGA%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.fpga_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.fpga_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.fpga_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " RMSDet%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " OCXO%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " TX0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.tx0_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.tx0_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.tx0_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " TX1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.tx1_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.tx1_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.tx1_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " PA0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.pa0_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.pa0_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.pa0_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " PA1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.pa1_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.pa1_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.pa1_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, "Power limits%s", VTY_NEWLINE); + vty_out(vty, " Main supply (mV)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->volt.supply_volt_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->volt.supply_volt_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->volt.supply_volt_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " Critical min : %d%s",s_mgr->volt.supply_volt_limit.thresh_crit_min, VTY_NEWLINE); + vty_out(vty, " Main supply power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.supply_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.supply_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " PA0 power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.pa0_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.pa0_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " PA1 power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.pa1_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.pa1_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, "VSWR limits%s", VTY_NEWLINE); + vty_out(vty, " TX0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->vswr.tx0_vswr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->vswr.tx0_vswr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " TX1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->vswr.tx1_vswr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->vswr.tx1_vswr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, "Days since last GPS 3D fix%s", VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->gps.gps_fix_limit.thresh_warn_max, VTY_NEWLINE); return CMD_SUCCESS; } @@ -493,10 +749,153 @@ return CMD_SUCCESS; } -static void register_limit(int limit) +DEFUN(set_led_pattern, set_led_pattern_cmd, + "set led pattern <0-255>", + "Set LED pattern\n" + "Set LED pattern for debugging purpose only. This pattern will be overridden after 60 seconds by LED pattern of actual system state\n") { - install_element(limit, &cfg_thresh_warning_cmd); - install_element(limit, &cfg_thresh_crit_cmd); + int pattern_id = atoi(argv[0]); + + if ((pattern_id < 0) || (pattern_id > BLINK_PATTERN_MAX_ITEM)) { + vty_out(vty, "%%Invalid LED pattern ID. It must be in range of %d..%d %s", 0, BLINK_PATTERN_MAX_ITEM - 1, VTY_NEWLINE); + return CMD_WARNING; + } + + led_set(s_mgr, pattern_id); + return CMD_SUCCESS; +} + +DEFUN(force_mgr_state, force_mgr_state_cmd, + "force manager state <0-255>", + "Force BTS manager state\n" + "Force BTS manager state for debugging purpose only\n") +{ + int state = atoi(argv[0]); + + if ((state < 0) || (state > STATE_CRITICAL)) { + vty_out(vty, "%%Invalid BTS manager state. It must be in range of %d..%d %s", 0, STATE_CRITICAL, VTY_NEWLINE); + return CMD_WARNING; + } + + s_mgr->state.state = state; + return CMD_SUCCESS; +} + +#define LIMIT_TEMP(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_temp_##name##_##variable, limit_temp_##name##_##variable##_cmd, \ + "limit temp " #name " " #criticity " " #min_max " <-200-200>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->temp.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_warn_min, warning, min) +#undef LIMIT_TEMP + +#define LIMIT_VOLT(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_volt_##name##_##variable, limit_volt_##name##_##variable##_cmd, \ + "limit " #name " " #criticity " " #min_max " <0-48000>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->volt.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_warn_max, warning, max) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_crit_max, critical, max) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_warn_min, warning, min) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_crit_min, critical, min) +#undef LIMIT_VOLT + +#define LIMIT_PWR(name, limit, expl, variable, criticity, min_max) \ + DEFUN(limit_pwr_##name##_##variable, limit_pwr_##name##_##variable##_cmd, \ + "limit power " #name " " #criticity " " #min_max " <0-200>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->pwr.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_PWR(supply, supply_pwr_limit, "SUPPLY PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(supply, supply_pwr_limit, "SUPPLY PWR\n", thresh_crit_max, critical, max) +LIMIT_PWR(pa0, pa0_pwr_limit, "PA0 PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(pa0, pa0_pwr_limit, "PA0 PWR\n", thresh_crit_max, critical, max) +LIMIT_PWR(pa1, pa1_pwr_limit, "PA1 PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(pa1, pa1_pwr_limit, "PA1 PWR\n", thresh_crit_max, critical, max) +#undef LIMIT_PWR + +#define LIMIT_VSWR(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_vswr_##name##_##variable, limit_vswr_##name##_##variable##_cmd, \ + "limit vswr " #name " " #criticity " " #min_max " <1000-200000>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->vswr.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_VSWR(tx0, tx0_vswr_limit, "TX0 VSWR\n", thresh_warn_max, warning, max) +LIMIT_VSWR(tx0, tx0_vswr_limit, "TX0 VSWR\n", thresh_crit_max, critical, max) +LIMIT_VSWR(tx1, tx1_vswr_limit, "TX1 VSWR\n", thresh_warn_max, warning, max) +LIMIT_VSWR(tx1, tx1_vswr_limit, "TX1 VSWR\n", thresh_crit_max, critical, max) +#undef LIMIT_VSWR + +#define LIMIT_GPSFIX(limit, expl, variable, criticity, min_max) \ +DEFUN(limit_gpsfix_##variable, limit_gpsfix_##variable##_cmd, \ + "limit gpsfix " #criticity " " #min_max " <0-365>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->gps.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_GPSFIX(gps_fix_limit, "GPS FIX\n", thresh_warn_max, warning, max) +#undef LIMIT_GPSFIX + +static void register_limit(int limit, uint32_t unit) +{ + switch (unit) { + case MGR_LIMIT_TYPE_VOLT: + install_element(limit, &cfg_thresh_volt_warn_min_cmd); + install_element(limit, &cfg_thresh_volt_crit_min_cmd); + break; + case MGR_LIMIT_TYPE_VSWR: + install_element(limit, &cfg_thresh_vswr_warn_max_cmd); + install_element(limit, &cfg_thresh_vswr_crit_max_cmd); + break; + case MGR_LIMIT_TYPE_PWR: + install_element(limit, &cfg_thresh_pwr_warn_max_cmd); + install_element(limit, &cfg_thresh_pwr_crit_max_cmd); + break; + default: + break; + } } static void register_normal_action(int act) @@ -519,11 +918,62 @@ install_element(act, &cfg_no_action_bts_srv_off_cmd); } +static void register_hidden_commands() +{ + install_element(ENABLE_NODE, &limit_temp_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_supply_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_warn_min_cmd); + + install_element(ENABLE_NODE, &limit_volt_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_crit_min_cmd); + + install_element(ENABLE_NODE, &limit_pwr_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa1_thresh_crit_max_cmd); + + install_element(ENABLE_NODE, &limit_vswr_tx0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx1_thresh_crit_max_cmd); + + install_element(ENABLE_NODE, &limit_gpsfix_thresh_warn_max_cmd); +} + int lc15bts_mgr_vty_init(void) { vty_init(&vty_info); install_element_ve(&show_mgr_cmd); + install_element_ve(&show_thresh_cmd); install_element(ENABLE_NODE, &calibrate_clock_cmd); @@ -532,50 +982,73 @@ vty_install_default(MGR_NODE); /* install the limit nodes */ - install_node(&limit_supply_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_supply_cmd); - register_limit(LIMIT_SUPPLY_NODE); - vty_install_default(LIMIT_SUPPLY_NODE); + install_node(&limit_supply_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_temp_cmd); + vty_install_default(LIMIT_SUPPLY_TEMP_NODE); install_node(&limit_soc_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_soc_cmd); - register_limit(LIMIT_SOC_NODE); + install_element(MGR_NODE, &cfg_limit_soc_temp_cmd); vty_install_default(LIMIT_SOC_NODE); install_node(&limit_fpga_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_fpga_cmd); - register_limit(LIMIT_FPGA_NODE); + install_element(MGR_NODE, &cfg_limit_fpga_temp_cmd); vty_install_default(LIMIT_FPGA_NODE); - install_node(&limit_logrf_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_logrf_cmd); - register_limit(LIMIT_LOGRF_NODE); - vty_install_default(LIMIT_LOGRF_NODE); + install_node(&limit_rmsdet_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_rmsdet_temp_cmd); + vty_install_default(LIMIT_RMSDET_NODE); install_node(&limit_ocxo_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_ocxo_cmd); - register_limit(LIMIT_OCXO_NODE); + install_element(MGR_NODE, &cfg_limit_ocxo_temp_cmd); vty_install_default(LIMIT_OCXO_NODE); - install_node(&limit_tx0_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx0_cmd); - register_limit(LIMIT_TX0_NODE); - vty_install_default(LIMIT_TX0_NODE); + install_node(&limit_tx0_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_temp_cmd); + vty_install_default(LIMIT_TX0_TEMP_NODE); - install_node(&limit_tx1_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx1_cmd); - register_limit(LIMIT_TX1_NODE); - vty_install_default(LIMIT_TX1_NODE); + install_node(&limit_tx1_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx1_temp_cmd); + vty_install_default(LIMIT_TX1_TEMP_NODE); - install_node(&limit_pa0_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa0_cmd); - register_limit(LIMIT_PA0_NODE); - vty_install_default(LIMIT_PA0_NODE); + install_node(&limit_pa0_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_temp_cmd); + vty_install_default(LIMIT_PA0_TEMP_NODE); - install_node(&limit_pa1_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa1_cmd); - register_limit(LIMIT_PA1_NODE); - vty_install_default(LIMIT_PA1_NODE); + install_node(&limit_pa1_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa1_temp_cmd); + vty_install_default(LIMIT_PA1_TEMP_NODE); + + install_node(&limit_supply_volt_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_volt_cmd); + register_limit(LIMIT_SUPPLY_VOLT_NODE, MGR_LIMIT_TYPE_VOLT); + vty_install_default(LIMIT_SUPPLY_VOLT_NODE); + + install_node(&limit_tx0_vswr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_vswr_cmd); + register_limit(LIMIT_TX0_VSWR_NODE, MGR_LIMIT_TYPE_VSWR); + vty_install_default(LIMIT_TX0_VSWR_NODE); + + install_node(&limit_tx1_vswr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx1_vswr_cmd); + register_limit(LIMIT_TX1_VSWR_NODE, MGR_LIMIT_TYPE_VSWR); + vty_install_default(LIMIT_TX1_VSWR_NODE); + + install_node(&limit_supply_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_pwr_cmd); + register_limit(LIMIT_SUPPLY_PWR_NODE, MGR_LIMIT_TYPE_PWR); + vty_install_default(LIMIT_SUPPLY_PWR_NODE); + + install_node(&limit_pa0_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_pwr_cmd); + vty_install_default(LIMIT_PA0_PWR_NODE); + + install_node(&limit_pa1_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa1_pwr_cmd); + vty_install_default(LIMIT_PA1_PWR_NODE); + + install_node(&limit_gps_fix_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_gps_fix_cmd); + vty_install_default(LIMIT_GPS_FIX_NODE); /* install the normal node */ install_node(&act_norm_node, config_write_dummy); @@ -593,6 +1066,12 @@ register_action(ACT_CRIT_NODE); vty_install_default(ACT_CRIT_NODE); + /* install LED pattern command for debugging purpose */ + install_element_ve(&set_led_pattern_cmd); + install_element_ve(&force_mgr_state_cmd); + + register_hidden_commands(); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c index fa59b7c..2cedc5d 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c @@ -41,11 +41,13 @@ #include #include +#include "lc15bts_mgr.h" #include "btsconfig.h" #include "lc15bts_misc.h" #include "lc15bts_par.h" #include "lc15bts_mgr.h" #include "lc15bts_temp.h" +#include "lc15bts_power.h" /********************************************************************* * Temperature handling @@ -58,52 +60,111 @@ enum lc15bts_par ee_par; } temp_data[] = { { - .name = "supply", + .name = "supply_temp", .has_max = 1, .sensor = LC15BTS_TEMP_SUPPLY, .ee_par = LC15BTS_PAR_TEMP_SUPPLY_MAX, }, { - .name = "soc", + .name = "soc_temp", .has_max = 0, .sensor = LC15BTS_TEMP_SOC, .ee_par = LC15BTS_PAR_TEMP_SOC_MAX, }, { - .name = "fpga", + .name = "fpga_temp", .has_max = 0, .sensor = LC15BTS_TEMP_FPGA, .ee_par = LC15BTS_PAR_TEMP_FPGA_MAX, }, { - .name = "logrf", + .name = "rmsdet_temp", .has_max = 1, - .sensor = LC15BTS_TEMP_LOGRF, - .ee_par = LC15BTS_PAR_TEMP_LOGRF_MAX, + .sensor = LC15BTS_TEMP_RMSDET, + .ee_par = LC15BTS_PAR_TEMP_RMSDET_MAX, }, { - .name = "ocxo", + .name = "ocxo_temp", .has_max = 1, .sensor = LC15BTS_TEMP_OCXO, .ee_par = LC15BTS_PAR_TEMP_OCXO_MAX, }, { - .name = "tx0", + .name = "tx0_temp", .has_max = 0, .sensor = LC15BTS_TEMP_TX0, .ee_par = LC15BTS_PAR_TEMP_TX0_MAX, }, { - .name = "tx1", + .name = "tx1_temp", .has_max = 0, .sensor = LC15BTS_TEMP_TX1, .ee_par = LC15BTS_PAR_TEMP_TX1_MAX, }, { - .name = "pa0", + .name = "pa0_temp", .has_max = 1, .sensor = LC15BTS_TEMP_PA0, .ee_par = LC15BTS_PAR_TEMP_PA0_MAX, }, { - .name = "pa1", + .name = "pa1_temp", .has_max = 1, .sensor = LC15BTS_TEMP_PA1, .ee_par = LC15BTS_PAR_TEMP_PA1_MAX, } +}; + +static const struct { + const char *name; + int has_max; + enum lc15bts_power_source sensor_source; + enum lc15bts_power_type sensor_type; + enum lc15bts_par ee_par; +} power_data[] = { + { + .name = "supply_volt", + .has_max = 1, + .sensor_source = LC15BTS_POWER_SUPPLY, + .sensor_type = LC15BTS_POWER_VOLTAGE, + .ee_par = LC15BTS_PAR_VOLT_SUPPLY_MAX, + }, { + .name = "supply_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_SUPPLY, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_SUPPLY_MAX, + }, { + .name = "pa0_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_PA0, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_PA0_MAX, + }, { + .name = "pa1_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_PA1, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_PA1_MAX, + } +}; + +static const struct { + const char *name; + int has_max; + enum lc15bts_vswr_sensor sensor; + enum lc15bts_par ee_par; +} vswr_data[] = { + { + .name = "tx0_vswr", + .has_max = 0, + .sensor = LC15BTS_VSWR_TX0, + .ee_par = LC15BTS_PAR_VSWR_TX0_MAX, + }, { + .name = "tx1_vswr", + .has_max = 0, + .sensor = LC15BTS_VSWR_TX1, + .ee_par = LC15BTS_PAR_VSWR_TX1_MAX, + } +}; + +static const struct value_string power_unit_strs[] = { + { LC15BTS_POWER_POWER, "W" }, + { LC15BTS_POWER_VOLTAGE, "V" }, + { 0, NULL } }; void lc15bts_check_temp(int no_rom_write) @@ -117,7 +178,7 @@ rc = lc15bts_par_get_int(tall_mgr_ctx, temp_data[i].ee_par, &ret); temp_old[i] = ret * 1000; - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor); + lc15bts_temp_get(temp_data[i].sensor, &temp_cur[i]); if (temp_cur[i] < 0 && temp_cur[i] > -1000) { LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d): unexpected value %d\n", temp_data[i].sensor, temp_cur[i]); @@ -143,6 +204,91 @@ } } +void lc15bts_check_power(int no_rom_write) +{ + int power_old[ARRAY_SIZE(power_data)]; + int power_cur[ARRAY_SIZE(power_data)]; + int i, rc; + int div_ratio; + + for (i = 0; i < ARRAY_SIZE(power_data); i++) { + int ret; + rc = lc15bts_par_get_int(tall_mgr_ctx, power_data[i].ee_par, &ret); + switch(power_data[i].sensor_type) { + case LC15BTS_POWER_VOLTAGE: + div_ratio = 1000; + break; + case LC15BTS_POWER_POWER: + div_ratio = 1000000; + break; + default: + div_ratio = 1000; + } + power_old[i] = ret * div_ratio; + + lc15bts_power_sensor_get(power_data[i].sensor_source, power_data[i].sensor_type, &power_cur[i]); + if (power_cur[i] < 0 && power_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading power (%d) (%d)\n", power_data[i].sensor_source, + power_data[i].sensor_type); + continue; + } + LOGP(DTEMP, LOGL_DEBUG, "Current %s power: %d.%d %s\n", + power_data[i].name, power_cur[i]/div_ratio, power_cur[i]%div_ratio, + get_value_string(power_unit_strs, power_data[i].sensor_type)); + + if (power_cur[i] > power_old[i]) { + LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " + "power: %d.%d %s\n", power_data[i].name, + power_cur[i]/div_ratio, power_cur[i]%div_ratio, + get_value_string(power_unit_strs, power_data[i].sensor_type)); + + if (!no_rom_write) { + rc = lc15bts_par_set_int(tall_mgr_ctx, power_data[i].ee_par, power_cur[i]/div_ratio); + if (rc < 0) + LOGP(DTEMP, LOGL_ERROR, "error writing new %s " + "max power %d (%s)\n", power_data[i].name, + rc, strerror(errno)); + } + } + } +} + +void lc15bts_check_vswr(int no_rom_write) +{ + int vswr_old[ARRAY_SIZE(vswr_data)]; + int vswr_cur[ARRAY_SIZE(vswr_data)]; + int i, rc; + + for (i = 0; i < ARRAY_SIZE(vswr_data); i++) { + int ret; + rc = lc15bts_par_get_int(tall_mgr_ctx, vswr_data[i].ee_par, &ret); + vswr_old[i] = ret * 1000; + + lc15bts_vswr_get(vswr_data[i].sensor, &vswr_cur[i]); + if (vswr_cur[i] < 0 && vswr_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading vswr (%d)\n", vswr_data[i].sensor); + continue; + } + + LOGP(DTEMP, LOGL_DEBUG, "Current %s vswr: %d.%d\n", + vswr_data[i].name, vswr_cur[i]/1000, vswr_cur[i]%1000); + + if (vswr_cur[i] > vswr_old[i]) { + LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " + "vswr: %d.%d C\n", vswr_data[i].name, + vswr_cur[i]/1000, vswr_old[i]%1000); + + if (!no_rom_write) { + rc = lc15bts_par_set_int(tall_mgr_ctx, vswr_data[i].ee_par, vswr_cur[i]/1000); + if (rc < 0) + LOGP(DTEMP, LOGL_ERROR, "error writing new %s " + "max vswr %d (%s)\n", vswr_data[i].name, + rc, strerror(errno)); + } + } + } +} + /********************************************************************* * Hours handling *********************************************************************/ diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.h b/src/osmo-bts-litecell15/misc/lc15bts_misc.h index 4c3a862..79e9e68 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.h @@ -4,6 +4,8 @@ #include void lc15bts_check_temp(int no_rom_write); +void lc15bts_check_power(int no_rom_write); +void lc15bts_check_vswr(int no_rom_write); int lc15bts_update_hours(int no_rom_write); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index 13b0080..75314a4 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -43,12 +43,19 @@ { LC15BTS_PAR_TEMP_SUPPLY_MAX, "temp-supply-max" }, { LC15BTS_PAR_TEMP_SOC_MAX, "temp-soc-max" }, { LC15BTS_PAR_TEMP_FPGA_MAX, "temp-fpga-max" }, - { LC15BTS_PAR_TEMP_LOGRF_MAX, "temp-logrf-max" }, + { LC15BTS_PAR_TEMP_RMSDET_MAX, "temp-rmsdet-max" }, { LC15BTS_PAR_TEMP_OCXO_MAX, "temp-ocxo-max" }, { LC15BTS_PAR_TEMP_TX0_MAX, "temp-tx0-max" }, { LC15BTS_PAR_TEMP_TX1_MAX, "temp-tx1-max" }, { LC15BTS_PAR_TEMP_PA0_MAX, "temp-pa0-max" }, { LC15BTS_PAR_TEMP_PA1_MAX, "temp-pa1-max" }, + { LC15BTS_PAR_VOLT_SUPPLY_MAX, "volt-supply-max" }, + { LC15BTS_PAR_PWR_SUPPLY_MAX, "pwr-supply-max" }, + { LC15BTS_PAR_PWR_PA0_MAX, "pwr-pa0-max" }, + { LC15BTS_PAR_PWR_PA1_MAX, "pwr-pa1-max" }, + { LC15BTS_PAR_VSWR_TX0_MAX, "vswr-tx0-max" }, + { LC15BTS_PAR_VSWR_TX1_MAX, "vswr-tx1-max" }, + { LC15BTS_PAR_GPS_FIX, "gps-fix" }, { LC15BTS_PAR_SERNR, "serial-nr" }, { LC15BTS_PAR_HOURS, "hours-running" }, { LC15BTS_PAR_BOOTS, "boot-count" }, @@ -60,17 +67,23 @@ { switch (par) { case LC15BTS_PAR_TEMP_SUPPLY_MAX: - case LC15BTS_PAR_TEMP_SOC_MAX: - case LC15BTS_PAR_TEMP_FPGA_MAX: - case LC15BTS_PAR_TEMP_LOGRF_MAX: - case LC15BTS_PAR_TEMP_OCXO_MAX: - case LC15BTS_PAR_TEMP_TX0_MAX: - case LC15BTS_PAR_TEMP_TX1_MAX: - case LC15BTS_PAR_TEMP_PA0_MAX: - case LC15BTS_PAR_TEMP_PA1_MAX: + case LC15BTS_PAR_TEMP_SOC_MAX: + case LC15BTS_PAR_TEMP_FPGA_MAX: + case LC15BTS_PAR_TEMP_RMSDET_MAX: + case LC15BTS_PAR_TEMP_OCXO_MAX: + case LC15BTS_PAR_TEMP_TX0_MAX: + case LC15BTS_PAR_TEMP_TX1_MAX: + case LC15BTS_PAR_TEMP_PA0_MAX: + case LC15BTS_PAR_TEMP_PA1_MAX: + case LC15BTS_PAR_VOLT_SUPPLY_MAX: + case LC15BTS_PAR_VSWR_TX0_MAX: + case LC15BTS_PAR_VSWR_TX1_MAX: case LC15BTS_PAR_SERNR: case LC15BTS_PAR_HOURS: case LC15BTS_PAR_BOOTS: + case LC15BTS_PAR_PWR_SUPPLY_MAX: + case LC15BTS_PAR_PWR_PA0_MAX: + case LC15BTS_PAR_PWR_PA1_MAX: return 1; default: return 0; @@ -168,3 +181,52 @@ return rc; } + +int lc15bts_par_get_gps_fix(time_t *ret) +{ + char fpath[PATH_MAX]; + FILE *fp; + int rc; + + snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, LC15BTS_PAR_GPS_FIX)); + fpath[sizeof(fpath)-1] = '\0'; + + fp = fopen(fpath, "r"); + if (fp == NULL) { + return -errno; + } + + rc = fscanf(fp, "%lld", (long long *)ret); + if (rc != 1) { + fclose(fp); + return -EIO; + } + fclose(fp); + + return 0; +} + +int lc15bts_par_set_gps_fix(time_t val) +{ + char fpath[PATH_MAX]; + FILE *fp; + int rc; + + snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, LC15BTS_PAR_GPS_FIX)); + fpath[sizeof(fpath)-1] = '\0'; + + fp = fopen(fpath, "w"); + if (fp == NULL) { + return -errno; + } + + rc = fprintf(fp, "%lld", (long long)val); + if (rc < 0) { + fclose(fp); + return -EIO; + } + fsync(fp); + fclose(fp); + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index dd869d3..217ae5f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -10,12 +10,19 @@ LC15BTS_PAR_TEMP_SUPPLY_MAX, LC15BTS_PAR_TEMP_SOC_MAX, LC15BTS_PAR_TEMP_FPGA_MAX, - LC15BTS_PAR_TEMP_LOGRF_MAX, + LC15BTS_PAR_TEMP_RMSDET_MAX, LC15BTS_PAR_TEMP_OCXO_MAX, LC15BTS_PAR_TEMP_TX0_MAX, LC15BTS_PAR_TEMP_TX1_MAX, LC15BTS_PAR_TEMP_PA0_MAX, LC15BTS_PAR_TEMP_PA1_MAX, + LC15BTS_PAR_VOLT_SUPPLY_MAX, + LC15BTS_PAR_PWR_SUPPLY_MAX, + LC15BTS_PAR_PWR_PA0_MAX, + LC15BTS_PAR_PWR_PA1_MAX, + LC15BTS_PAR_VSWR_TX0_MAX, + LC15BTS_PAR_VSWR_TX1_MAX, + LC15BTS_PAR_GPS_FIX, LC15BTS_PAR_SERNR, LC15BTS_PAR_HOURS, LC15BTS_PAR_BOOTS, @@ -31,5 +38,7 @@ int lc15bts_par_set_buf(void *ctx, enum lc15bts_par par, const uint8_t *buf, unsigned int size); int lc15bts_par_is_int(enum lc15bts_par par); +int lc15bts_par_get_gps_fix(time_t *ret); +int lc15bts_par_set_gps_fix(time_t val); #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.c b/src/osmo-bts-litecell15/misc/lc15bts_power.c index 5b01d36..1a37d8e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.c @@ -39,7 +39,7 @@ }; static const char *power_sensor_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/pa-supply/", + [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/main-supply/", [LC15BTS_POWER_PA0] = "/var/lc15/pwr-sense/pa0/", [LC15BTS_POWER_PA1] = "/var/lc15/pwr-sense/pa1/", }; @@ -52,7 +52,8 @@ int lc15bts_power_sensor_get( enum lc15bts_power_source source, - enum lc15bts_power_type type) + enum lc15bts_power_type type, + int *power) { char buf[PATH_MAX]; char pwrstr[10]; @@ -82,8 +83,8 @@ return -EIO; } close(fd); - - return atoi(pwrstr); + *power = atoi(pwrstr); + return 0; } @@ -171,3 +172,39 @@ return retVal; } + +static const char *vswr_devs[_NUM_VSWR_SENSORS] = { + [LC15BTS_VSWR_TX0] = "/var/lc15/vswr/tx0/vswr", + [LC15BTS_VSWR_TX1] = "/var/lc15/vswr/tx1/vswr", +}; + +int lc15bts_vswr_get(enum lc15bts_vswr_sensor sensor, int *vswr) +{ + char buf[PATH_MAX]; + char vswrstr[8]; + int fd, rc; + + if (sensor < 0 || sensor >= _NUM_VSWR_SENSORS) + return -EINVAL; + + snprintf(buf, sizeof(buf)-1, "%s", vswr_devs[sensor]); + buf[sizeof(buf)-1] = '\0'; + + fd = open(buf, O_RDONLY); + if (fd < 0) + return fd; + + rc = read(fd, vswrstr, sizeof(vswrstr)); + vswrstr[sizeof(vswrstr)-1] = '\0'; + if (rc < 0) { + close(fd); + return rc; + } + if (rc == 0) { + close(fd); + return -EIO; + } + close(fd); + *vswr = atoi(vswrstr); + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.h b/src/osmo-bts-litecell15/misc/lc15bts_power.h index 8963b76..b48cfdc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.h @@ -17,7 +17,8 @@ int lc15bts_power_sensor_get( enum lc15bts_power_source source, - enum lc15bts_power_type type); + enum lc15bts_power_type type, + int *volt); int lc15bts_power_set( enum lc15bts_power_source source, @@ -26,4 +27,12 @@ int lc15bts_power_get( enum lc15bts_power_source source); +enum lc15bts_vswr_sensor { + LC15BTS_VSWR_TX0, + LC15BTS_VSWR_TX1, + _NUM_VSWR_SENSORS +}; + +int lc15bts_vswr_get(enum lc15bts_vswr_sensor sensor, int *vswr); + #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_temp.c index aa35854..45602dc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.c @@ -29,20 +29,19 @@ #include "lc15bts_temp.h" - static const char *temp_devs[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/pa-supply/temp", - [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", - [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", - [LC15BTS_TEMP_LOGRF] = "/var/lc15/temp/logrf/temp", - [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", - [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", - [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", - [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", - [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", + [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/main-supply/temp", + [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", + [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", + [LC15BTS_TEMP_RMSDET] = "/var/lc15/temp/rmsdet/temp", + [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", + [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", + [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", + [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", + [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor) +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, int *temp) { char buf[PATH_MAX]; char tempstr[8]; @@ -69,7 +68,7 @@ return -EIO; } close(fd); - - return atoi(tempstr); + *temp = atoi(tempstr); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.h b/src/osmo-bts-litecell15/misc/lc15bts_temp.h index aca8fe2..35d81f1 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.h @@ -5,7 +5,7 @@ LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_SOC, LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_LOGRF, + LC15BTS_TEMP_RMSDET, LC15BTS_TEMP_OCXO, LC15BTS_TEMP_TX0, LC15BTS_TEMP_TX1, @@ -22,6 +22,7 @@ _NUM_TEMP_TYPES }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor); +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, int *temp); + #endif -- To view, visit https://gerrit.osmocom.org/3277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:16:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 17:16:46 +0000 Subject: [PATCH] openbsc[master]: bsc_vty: Add VTY command to test CTRL TRAP feature Message-ID: Review at https://gerrit.osmocom.org/3278 bsc_vty: Add VTY command to test CTRL TRAP feature Using this new command (introduced in OsmoBSC + OsmoNITB), you can simulate the generation of TRAP events for testin purposes. start the control interface monitor as an example client program: ./openbsc/contrib/bsc_control.py -m -d localhost -p 4249 then start OsmoBSC or OsmoNITB, telnet to the VTY and enter 'enable' mode and issue the following (example) command: ctrl-interface generate-trap my.foo.var 2342 As a result, on the bsc_control.py you will see: Got message: TRAP 0 my.foo.var 2342 Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/78/3278/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 91a90c1..6472e9d 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -4122,6 +4123,20 @@ rsl_ipacc_mdcx(lchan, ntohl(ia.s_addr), port, 0); return CMD_SUCCESS; } + +DEFUN(ctrl_trap, ctrl_trap_cmd, + "ctrl-interface generate-trap TRAP VALUE", + "Commands related to the CTRL Interface\n" + "Generate a TRAP for test purpose\n" + "Identity/Name of the TRAP variable\n" + "Value of the TRAP variable\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + + ctrl_cmd_send_trap(net->ctrl, argv[0], (char *) argv[1]); + return CMD_SUCCESS; +} + extern int bsc_vty_init_extra(void); int bsc_vty_init(struct gsm_network *network) @@ -4325,6 +4340,7 @@ install_element(ENABLE_NODE, &lchan_act_cmd); install_element(ENABLE_NODE, &lchan_mdcx_cmd); install_element(ENABLE_NODE, &smscb_cmd_cmd); + install_element(ENABLE_NODE, &ctrl_trap_cmd); abis_nm_vty_init(); abis_om2k_vty_init(); -- To view, visit https://gerrit.osmocom.org/3278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:18:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 17:18:15 +0000 Subject: osmo-bts[master]: lc15: fix BTS revision and hw options In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:18:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 18 Jul 2017 17:18:59 +0000 Subject: osmo-bts[master]: lc15: add trx-calibration to example config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b 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: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:22:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 18 Jul 2017 17:22:47 +0000 Subject: [PATCH] osmo-bts[master]: lc15: make default config usable 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/3252 to look at the new patch set (#2). lc15: make default config usable * add trx-calibration path * change GSM band to 900 Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b Related: SYS#3722 --- M doc/examples/litecell15/osmo-bts.cfg 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/3252/2 diff --git a/doc/examples/litecell15/osmo-bts.cfg b/doc/examples/litecell15/osmo-bts.cfg index 4eb9f29..de81587 100644 --- a/doc/examples/litecell15/osmo-bts.cfg +++ b/doc/examples/litecell15/osmo-bts.cfg @@ -30,10 +30,12 @@ ! phy 0 instance 0 + trx-calibration-path /mnt/rom/factory/calib phy 1 instance 0 + trx-calibration-path /mnt/rom/factory/calib bts 0 - band 1800 + band 900 ipa unit-id 1500 0 oml remote-ip 192.168.234.185 trx 0 -- To view, visit https://gerrit.osmocom.org/3252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b 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 From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:27:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 18 Jul 2017 17:27:26 +0000 Subject: [PATCH] osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client* N... 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/3187 to look at the new patch set (#2). move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client* NOT FOR MERGE *** NOT FOR MERGE: use SCCP address book: the libsccp address book code is currently in flux, will follow in the next patch set when pmaier is ready with it *** To help split openbsc.git to separate MSC and SGSN repositories, place the common Iu interface related code here in libosmo-ranap. Also apply various improvements while moving (from intermittent code review). The code depends on libosmo-ranap tightly. One reason to want this separate from libosmo-ranap could be that it uses libosmo-sigtran, accepting an sccp instance. However, including in libosmo-ranap is the simplest way to go. The osmo-iuh build depends on libosmo-sigtran anyway because of OsmoHNBGW, and all current users of libosmo-ranap also naturally link libosmo-sigtran already. Apply prefix ranap_iu_ and RANAP_IU_ to allow smooth transition from the openbsc.git iu_ to the libranap ranap_iu_ implementations. Prune unneeded #include statements. Instead of sccp_addr, store an rnc pointer in the ue_conn_ctx. To facilitate, also: - Move iu_rnc struct to iu_client.h (as ranap_iu_rnc). - Instead of sccp_addr, pass rnc to ue_conn_ctx_alloc(). - Pass a local struct new_ue_conn_ctx containing the sccp_addr and conn_id up the RANAP handling stack in case of an InitialUE message. - Separate the InitialUE message handling from cn_ranap_handle_co(), by moving to new and separate cn_ranap_handle_co_initial(), so we can still pass a looked-up ue_conn_ctx to all other cn_ranap_handle_co() code paths. - Allocate the ue_conn_ctx only in ranap_handle_co_initial_ue(), not as early as before. Note that we are not actually ever using the rnc pointer now present in ue_conn_ctx. It could be used for more concise paging, to first page only the RNC where we last saw the subscriber. So far we page all matching LAC/RACs. Tweak error logging: use __func__ instead of writing the function names as string constants. In iu_client_vty.c: - Move the asn.1 debug commands from logging over to the iu node. They are not specific to the logging target. They could qualify for an entirely separate 'asn1' root node, but for simplicity place under 'iu'. - Add the 'asn1' commands to ranap_iu_vty_config_write(), so far missing. - remove the legacy "net." from a VTY error message, it is not known which name the parent node of 'iu' has. Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 --- M include/osmocom/ranap/Makefile.am A include/osmocom/ranap/iu_client.h M src/Makefile.am A src/iu_client.c A src/iu_client_vty.c 5 files changed, 999 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/87/3187/2 diff --git a/include/osmocom/ranap/Makefile.am b/include/osmocom/ranap/Makefile.am index 0f83e03..1606928 100644 --- a/include/osmocom/ranap/Makefile.am +++ b/include/osmocom/ranap/Makefile.am @@ -12,6 +12,7 @@ ranap_common_cn.h \ ranap_msg_factory.h \ iu_helpers.h \ + iu_client.h \ RANAP_AccuracyFulfilmentIndicator.h \ RANAP_AllocationOrRetentionPriority.h \ RANAP_AlternativeRABConfigurationRequest.h \ diff --git a/include/osmocom/ranap/iu_client.h b/include/osmocom/ranap/iu_client.h new file mode 100644 index 0000000..873b2d2 --- /dev/null +++ b/include/osmocom/ranap/iu_client.h @@ -0,0 +1,74 @@ +#pragma once + +#include + +#include +#include +#include + +struct msgb; +struct osmo_auth_vector; + +struct RANAP_RAB_SetupOrModifiedItemIEs_s; +struct RANAP_Cause; + +struct ranap_iu_rnc; + +/* Debugging switches from asn1c and osmo-iuh */ +extern int asn_debug; +extern int asn1_xer_print; + +enum ranap_nsap_addr_enc { + RANAP_NSAP_ADDR_ENC_X213, + RANAP_NSAP_ADDR_ENC_V4RAW, +}; + +struct ranap_ue_conn_ctx { + struct llist_head list; + struct ranap_iu_rnc *rnc; + uint32_t conn_id; + int integrity_active; + struct gprs_ra_id ra_id; + enum ranap_nsap_addr_enc rab_assign_addr_enc; +}; + +enum ranap_iu_event_type { + RANAP_IU_EVENT_RAB_ASSIGN, + RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, + RANAP_IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ + RANAP_IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ +}; + +extern const struct value_string ranap_iu_event_type_names[]; +static inline const char *ranap_iu_event_type_str(enum ranap_iu_event_type e) +{ + return get_value_string(ranap_iu_event_type_names, e); +} + +/* Implementations of iu_recv_cb_t shall find the ranap_ue_conn_ctx in msg->dst. */ +typedef int (* ranap_iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, + uint16_t *sai); + +typedef int (* ranap_iu_event_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, + enum ranap_iu_event_type type, void *data); + +typedef int (* ranap_iu_rab_ass_resp_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id, + struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb); + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc); +int ranap_iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/src/Makefile.am b/src/Makefile.am index bb1ebbd..48918b0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,7 +54,7 @@ libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \ - ranap_common_cn.c + ranap_common_cn.c iu_client.c iu_client_vty.c # build the actual HomeNodeB gateway # diff --git a/src/iu_client.c b/src/iu_client.c new file mode 100644 index 0000000..83ed276 --- /dev/null +++ b/src/iu_client.c @@ -0,0 +1,783 @@ +/* Common parts of IuCS and IuPS interfaces implementation */ + +/* (C) 2016-2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the + * PLMN identity is a BCD representation of the MCC and MNC. + * See iu_grnc_id_parse(). */ +struct iu_grnc_id { + uint16_t mcc; + uint16_t mnc; + uint16_t rnc_id; +}; + +/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has + * called us and is currently reachable at the given osmo_sccp_addr. So, when we + * know a LAC for a subscriber, we can page it at the RNC matching that LAC or + * RAC. An HNB-GW typically presents itself as if it were a single RNC, even + * though it may have several RNCs in hNodeBs connected to it. Those will then + * share the same RNC id, which they actually receive and adopt from the HNB-GW + * in the HNBAP HNB REGISTER ACCEPT message. */ +struct ranap_iu_rnc { + struct llist_head entry; + + uint16_t rnc_id; + uint16_t lac; /* Location Area Code (used for CS and PS) */ + uint8_t rac; /* Routing Area Code (used for PS only) */ + struct osmo_sccp_addr sccp_addr; +}; + +void *talloc_iu_ctx; +void *talloc_asn1_ctx; + +/* Implement the extern asn_debug from libasn1c to indicate whether to print + * asn.1 debug messages (see libasn1c). */ +int asn_debug = 0; + +/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary + * code decoded and encoded during Iu communication should be logged to stderr + * (see asn.1 generated code in osmo-iuh). */ +int asn1_xer_print = 0; + +ranap_iu_recv_cb_t global_iu_recv_cb = NULL; +ranap_iu_event_cb_t global_iu_event_cb = NULL; +int iu_log_subsystem = 0; + +#define LOGPIU(level, fmt, args...) \ + LOGP(iu_log_subsystem, level, fmt, ## args) + +static LLIST_HEAD(ue_conn_ctx_list); +static LLIST_HEAD(rnc_list); + +static struct osmo_sccp_instance *g_sccp; +static struct osmo_sccp_user *g_scu; + +const struct value_string ranap_iu_event_type_names[] = { + OSMO_VALUE_STRING(RANAP_IU_EVENT_RAB_ASSIGN), + OSMO_VALUE_STRING(RANAP_IU_EVENT_SECURITY_MODE_COMPLETE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_IU_RELEASE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_LINK_INVALIDATED), + { 0, NULL } +}; + +static struct ranap_ue_conn_ctx *ue_conn_ctx_alloc(struct ranap_iu_rnc *rnc, uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ranap_ue_conn_ctx); + + ctx->rnc = rnc; + ctx->conn_id = conn_id; + llist_add(&ctx->list, &ue_conn_ctx_list); + + return ctx; +} + +static struct ranap_ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx; + + llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { + if (ctx->conn_id == conn_id) + return ctx; + } + return NULL; +} + +static struct ranap_iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, + struct osmo_sccp_addr *addr) +{ + struct ranap_iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct ranap_iu_rnc); + + rnc->rnc_id = rnc_id; + rnc->lac = lac; + rnc->rac = rac; + rnc->sccp_addr = *addr; + llist_add(&rnc->entry, &rnc_list); + + LOGPIU(LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + + return rnc; +} + +static struct ranap_iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, + uint8_t rac, struct osmo_sccp_addr *addr) +{ + struct ranap_iu_rnc *rnc; + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->rnc_id != rnc_id) + continue; + + /* We have this RNC Id registered already. Make sure that the + * details match. */ + + /* TODO should a mismatch be an error? */ + if (rnc->lac != lac || rnc->rac != rac) + LOGPIU(LOGL_NOTICE, "RNC %d changes its details:" + " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", + rnc->rnc_id, rnc->lac, rnc->rac, + lac, rac); + rnc->lac = lac; + rnc->rac = rac; + + if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) + LOGPIU(LOGL_NOTICE, "RNC %d on New SCCP Addr %s" + " (LAC=%d RAC=%d)\n", + rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); + rnc->sccp_addr = *addr; + return rnc; + } + + /* Not found, make a new one. */ + return iu_rnc_alloc(rnc_id, lac, rac, addr); +} + +/*********************************************************************** + * RANAP handling + ***********************************************************************/ + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) +{ + struct osmo_scu_prim *prim; + + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ue_ctx->conn_id; + osmo_prim_init(&prim->oph, + SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, + msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id) +{ + /* FIXME */ + return -1; +} + +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key) +{ + struct osmo_scu_prim *prim; + struct msgb *msg; + + /* create RANAP message */ + msg = ranap_new_msg_sec_mod_cmd(vec->ik, send_ck? vec->ck : NULL, + new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg->l2h = msg->data; + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + + return 0; +} + +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_common_id(imsi); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +static int iu_grnc_id_parse(struct iu_grnc_id *dst, struct RANAP_GlobalRNC_ID *src) +{ + /* The size is coming from arbitrary sender, check it gracefully */ + if (src->pLMNidentity.size != 3) { + LOGPIU(LOGL_ERROR, "Invalid PLMN Identity size:" + " should be 3, is %d\n", src->pLMNidentity.size); + return -1; + } + gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], + &dst->mcc, &dst->mnc); + dst->rnc_id = (uint16_t)src->rNC_ID; + return 0; +} + +#if 0 + -- not used at present -- +static int iu_grnc_id_compose(struct iu_grnc_id *src, struct RANAP_GlobalRNC_ID *dst) +{ + /* The caller must ensure proper size */ + OSMO_ASSERT(dst->pLMNidentity.size == 3); + gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], + src->mcc, src->mnc); + dst->rNC_ID = src->rnc_id; + return 0; +} +#endif + +struct new_ue_conn_ctx { + struct osmo_sccp_addr sccp_addr; + uint32_t conn_id; +}; + +static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) +{ + struct new_ue_conn_ctx *new_ctx = ctx; + struct gprs_ra_id ra_id; + struct iu_grnc_id grnc_id; + uint16_t sai; + struct ranap_ue_conn_ctx *ue; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + struct ranap_iu_rnc *rnc; + + if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + + if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { + ra_id.rac = asn1str_to_u8(&ies->rac); + } + + if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { + LOGPIU(LOGL_ERROR, + "Failed to parse RANAP Global-RNC-ID IE\n"); + return -1; + } + + sai = asn1str_to_u16(&ies->sai.sAC); + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ + rnc = iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &new_ctx->sccp_addr); + + ue = ue_conn_ctx_alloc(rnc, new_ctx->conn_id); + OSMO_ASSERT(ue); + ue->ra_id = ra_id; + + /* Feed into the MM layer */ + msg->dst = ue; + global_iu_recv_cb(msg, &ra_id, &sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) +{ + struct gprs_ra_id _ra_id, *ra_id = NULL; + uint16_t _sai, *sai = NULL; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { + if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + ra_id = &_ra_id; + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { + _ra_id.rac = asn1str_to_u8(&ies->rac); + } + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { + _sai = asn1str_to_u16(&ies->sai.sAC); + sai = &_sai; + } + } + + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Feed into the MM/CC/SMS-CP layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, ra_id, sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +int ranap_iu_tx(struct msgb *msg_nas, uint8_t sapi) +{ + struct ranap_ue_conn_ctx *uectx = msg_nas->dst; + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); + msgb_free(msg_nas); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +/* Send Iu Release for the given UE connection. + * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise + * the provided cause. */ +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + static const struct RANAP_Cause default_cause = { + .present = RANAP_Cause_PR_radioNetwork, + .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, + }; + + if (!cause) + cause = &default_cause; + + msg = ranap_new_msg_iu_rel_cmd(cause); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ctx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +static int ranap_handle_co_iu_rel_req(struct ranap_ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) +{ + LOGPIU(LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); + ranap_iu_tx_release(ctx, &ies->cause); + return 0; +} + +static int ranap_handle_co_rab_ass_resp(struct ranap_ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) +{ + int rc = -1; + + LOGPIU(LOGL_INFO, + "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); + if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { + /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ + RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; + RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; + + rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); + if (rc) { + LOGPIU(LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); + return rc; + } + + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_RAB_ASSIGN, &setup_ies); + + ranap_free_rab_setupormodifieditemies(&setup_ies); + } + /* FIXME: handle RAB Ass failure? */ + + return rc; +} + +static void cn_ranap_handle_co_initial(void *ctx, ranap_message *message) +{ + int rc; + + LOGPIU(LOGL_NOTICE, "handle_co_initial(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + if (message->direction != RANAP_RANAP_PDU_PR_initiatingMessage + || message->procedureCode != RANAP_ProcedureCode_id_InitialUE_Message) { + LOGPIU(LOGL_ERROR, "Expected direction 'InitiatingMessage'," + " procedureCode 'InitialUE_Message', instead got %u and %u\n", + message->direction, message->procedureCode); + rc = -1; + } + else + rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +/* Entry point for connection-oriented RANAP message */ +static void cn_ranap_handle_co(void *ctx, ranap_message *message) +{ + int rc; + + LOGPIU(LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_InitialUE_Message: + LOGPIU(LOGL_ERROR, "Got InitialUE_Message but this is not a new conn\n"); + rc = -1; + break; + case RANAP_ProcedureCode_id_DirectTransfer: + rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + case RANAP_ProcedureCode_id_Iu_ReleaseRequest: + /* Iu Release Request */ + rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_SecurityModeControl: + /* Security Mode Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, NULL); + break; + case RANAP_ProcedureCode_id_Iu_Release: + /* Iu Release Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_IU_RELEASE, NULL); + if (rc) { + LOGPIU(LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", + rc); + } + break; + default: + LOGPIU(LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_outcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_RAB_Assignment: + /* RAB Assignment Response */ + rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + default: + LOGPIU(LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) +{ + /* FIXME: send reset response */ + return -1; +} + +static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +/* Entry point for connection-less RANAP message */ +static void cn_ranap_handle_cl(void *ctx, ranap_message *message) +{ + int rc; + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_Reset: + /* received reset.req, send reset.resp */ + rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + default: + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + case RANAP_RANAP_PDU_PR_outcome: + default: + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +/*********************************************************************** + * Paging + ***********************************************************************/ + +struct osmo_sccp_addr local_sccp_addr = { + .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, + .ri = OSMO_SCCP_RI_SSN_PC, + .ssn = OSMO_SCCP_SSN_RANAP, + .pc = 1, +}; + +/* Send a paging command down a given SCCP User. tmsi and paging_cause are + * optional and may be passed NULL and 0, respectively, to disable their use. + * See enum RANAP_PagingCause. + * + * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, + * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ +static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, + const char *imsi, const uint32_t *tmsi, + bool is_ps, uint32_t paging_cause) +{ + struct msgb *msg; + msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); + msg->l2h = msg->data; + osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); + return 0; +} + +static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, + uint16_t lac, uint8_t rac, bool is_ps) +{ + struct ranap_iu_rnc *rnc; + int pagings_sent = 0; + + if (tmsi_or_ptimsi) { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use %s %x)\n", + is_ps? "IuPS" : "IuCS", + imsi, + is_ps? "PTMSI" : "TMSI", + *tmsi_or_ptimsi); + } else { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use IMSI)\n", + is_ps? "IuPS" : "IuCS", + imsi + ); + } + + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->lac != lac) + continue; + if (is_ps && rnc->rac != rac) + continue; + + /* Found a match! */ + if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) + == 0) { + LOGPIU(LOGL_DEBUG, + "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", + is_ps? "IuPS" : "IuCS", + imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); + pagings_sent ++; + } + } + + /* Some logging... */ + if (pagings_sent > 0) { + LOGPIU(LOGL_DEBUG, + "%s: %d RNCs were paged for IMSI %s.\n", + is_ps? "IuPS" : "IuCS", + pagings_sent, imsi); + } + else { + if (is_ps) { + LOGPIU(LOGL_ERROR, "IuPS: Found no RNC to page for" + " LAC %d RAC %d (would have paged IMSI %s)\n", + lac, rac, imsi); + } + else { + LOGPIU(LOGL_ERROR, "IuCS: Found no RNC to page for" + " LAC %d (would have paged IMSI %s)\n", + lac, imsi); + } + } + + return pagings_sent; +} + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +{ + return iu_page(imsi, tmsi, lac, 0, false); +} + +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +{ + return iu_page(imsi, ptmsi, lac, rac, true); +} + + +/*********************************************************************** + * + ***********************************************************************/ + +int tx_unitdata(struct osmo_sccp_user *scu); +int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); + +struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); +struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); + +static struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) +{ + struct msgb *msg = msgb_alloc(1024, "conn_resp"); + struct osmo_scu_prim *prim; + + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_CONNECT, + PRIM_OP_RESPONSE, msg); + memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); + return &prim->oph; +} + +static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) +{ + struct osmo_sccp_user *scu = _scu; + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct osmo_prim_hdr *resp = NULL; + int rc; + struct ranap_ue_conn_ctx *ue; + struct new_ue_conn_ctx new_ctx = {}; + + LOGPIU(LOGL_DEBUG, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + + switch (OSMO_PRIM_HDR(oph)) { + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): + /* confirmation of outbound connection */ + rc = -1; + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): + /* indication of new inbound connection request*/ + LOGPIU(LOGL_DEBUG, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); + if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ + !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { + LOGPIU(LOGL_NOTICE, + "Received invalid N-CONNECT.ind\n"); + return 0; + } + new_ctx.sccp_addr = prim->u.connect.calling_addr; + new_ctx.conn_id = prim->u.connect.conn_id; + /* first ensure the local SCCP socket is ACTIVE */ + resp = make_conn_resp(&prim->u.connect); + osmo_sccp_user_sap_down(scu, resp); + /* then handle the RANAP payload */ + rc = ranap_cn_rx_co(cn_ranap_handle_co_initial, &new_ctx, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): + /* indication of disconnect */ + LOGPIU(LOGL_DEBUG, "N-DISCONNECT.ind(%u)\n", + prim->u.disconnect.conn_id); + ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): + /* connection-oriented data received */ + LOGPIU(LOGL_DEBUG, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + /* resolve UE context */ + ue = ue_conn_ctx_find(prim->u.data.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): + /* connection-less data received */ + LOGPIU(LOGL_DEBUG, "N-UNITDATA.ind(%s)\n", + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + rc = ranap_cn_rx_cl(cn_ranap_handle_cl, scu, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + default: + rc = -1; + break; + } + + msgb_free(oph->msg); + return rc; +} + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb) +{ + iu_log_subsystem = log_subsystem; + talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); + talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); + + global_iu_recv_cb = iu_recv_cb; + global_iu_event_cb = iu_event_cb; + g_sccp = sccp; + g_scu = osmo_sccp_user_bind(g_sccp, sccp_user_name, sccp_sap_up, OSMO_SCCP_SSN_RANAP); + + return 0; +} + diff --git a/src/iu_client_vty.c b/src/iu_client_vty.c new file mode 100644 index 0000000..b809b2a --- /dev/null +++ b/src/iu_client_vty.c @@ -0,0 +1,140 @@ +/* OpenBSC Iu related interface to quagga VTY */ +/* (C) 2016 by sysmocom s.m.f.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include +#include + +#include + +static enum ranap_nsap_addr_enc *g_rab_assign_addr_enc = NULL; + +DEFUN(cfg_iu_asn1_debug, + cfg_iu_asn1_debug_cmd, + "asn1 debug (1|0)", + "ASN.1 settings\n" + "Enable ASN.1 debug messages\n" + "Log ASN.1 debug messages to stderr\n" + "Do not log ASN.1 debug messages to stderr\n") +{ + asn_debug = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_iu_asn1_xer_print, + cfg_iu_asn1_xer_print_cmd, + "asn1 xer-print (1|0)", + "ASN.1 settings\n" + "Log human readable representations of all ASN.1 messages to stderr\n" + "Log XML representation of all ASN.1 messages to stderr\n" + "Do not log decoded ASN.1 messages to stderr\n") +{ + asn1_xer_print = atoi(argv[0]); + return CMD_SUCCESS; +} + +#define IU_STR "Iu interface protocol options\n" +DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, + "iu rab-assign-addr-enc (x213|v4raw)", + IU_STR + "Choose RAB Assignment's Transport Layer Address encoding\n" + "ITU-T X.213 compliant address encoding (default)\n" + "32bit length raw IPv4 address (for ip.access nano3G)\n") +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if (strcmp(argv[0], "v4raw") == 0) + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_V4RAW; + else + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_X213; + return CMD_SUCCESS; +} + +extern struct osmo_sccp_addr local_sccp_addr; + +DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, + "iu local-address point-code PC", + IU_STR "Local SCCP Address\n") +{ + local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; + local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; + local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); + + return CMD_SUCCESS; +} + +/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ + +int ranap_iu_vty_config_write(struct vty *vty, const char *indent) +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + switch (*g_rab_assign_addr_enc) { + case RANAP_NSAP_ADDR_ENC_V4RAW: + vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, + VTY_NEWLINE); + break; + case RANAP_NSAP_ADDR_ENC_X213: + /* default value, no need to write anything */ + break; + default: + LOGP(0, LOGL_ERROR, "Invalid value for" + " iu.rab_assign_addr_enc: %d\n", + *g_rab_assign_addr_enc); + return CMD_WARNING; + } + + vty_out(vty, "%siu local-address point-code %s%s", indent, + osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); + + if (asn_debug) + vty_out(vty, "%sasn1 debug 1%s", indent, VTY_NEWLINE); + + if (asn1_xer_print) + vty_out(vty, "%sasn1 xer-print 1%s", indent, VTY_NEWLINE); + + return CMD_SUCCESS; +} + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc) +{ + g_rab_assign_addr_enc = rab_assign_addr_enc; + + install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); + install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); + + /* Technically, these are global ASN.1 settings and not necessarily limited to the Iu interface. + * Practically, only Iu users will use ASN.1 in Osmocom programs -- at least so far. So it is + * easiest to have these commands under 'iu'. */ + install_element(iu_parent_node, &cfg_iu_asn1_debug_cmd); + install_element(iu_parent_node, &cfg_iu_asn1_xer_print_cmd); +} -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh 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 Jul 18 17:29:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 17:29:46 +0000 Subject: osmo-bts[master]: lc15: fix BTS revision and hw options In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:29:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 17:29:50 +0000 Subject: [MERGED] osmo-bts[master]: lc15: fix BTS revision and hw options In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: fix BTS revision and hw options ...................................................................... lc15: fix BTS revision and hw options * remove typo in logging * add missing return statement * fix compilation warnings * add detailed logging for supported GSM band and related errors Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 Related: SYS#3728 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/misc/lc15bts_bid.c 2 files changed, 15 insertions(+), 7 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index b82a7c6..cb3efab 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1369,7 +1369,7 @@ fl1h->hw_info.fpga_version[1] = sic->fpgaVersion.minor; fl1h->hw_info.fpga_version[2] = sic->fpgaVersion.build; - LOGP(DL1C, LOGL_INFO, "DSP v%u.%u.%u, FPGA v%u.%u.%u\nn", + LOGP(DL1C, LOGL_INFO, "DSP v%u.%u.%u, FPGA v%u.%u.%u\n", sic->dspVersion.major, sic->dspVersion.minor, sic->dspVersion.build, sic->fpgaVersion.major, sic->fpgaVersion.minor, sic->fpgaVersion.build); @@ -1468,18 +1468,24 @@ int rc; rc = lc15bts_rev_get(); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS revision: %d\n", rc); return rc; + } fl1h->hw_info.ver_major = rc; rc = lc15bts_model_get(); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS model: %d\n", rc); return rc; + } fl1h->hw_info.ver_minor = rc; rc = lc15bts_option_get(LC15BTS_OPTION_BAND); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS_OPTION_BAND: %d\n", rc); return rc; + } switch (rc) { case LC15BTS_BAND_850: @@ -1495,8 +1501,12 @@ fl1h->hw_info.band_support = GSM_BAND_1900; break; default: + LOGP(DL1C, LOGL_ERROR, "Unexpected LC15BTS_BAND value: %d\n", rc); return -1; } + + LOGP(DL1C, LOGL_INFO, "BTS hw support band %s\n", gsm_band_name(fl1h->hw_info.band_support)); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index ba2037a..7f278bf 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -87,11 +87,11 @@ return false; } fclose(fp); + return true; } int lc15bts_rev_get(void) { - FILE *fp; char rev; if (board_rev != -1) { @@ -107,9 +107,7 @@ int lc15bts_model_get(void) { - FILE *fp; int opt; - bool rc; if (board_option != -1) return board_option; -- To view, visit https://gerrit.osmocom.org/3275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 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 From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:30:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 17:30:06 +0000 Subject: osmo-bts[master]: lc15: make default config usable In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:30:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 17:30:07 +0000 Subject: [MERGED] osmo-bts[master]: lc15: make default config usable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: make default config usable ...................................................................... lc15: make default config usable * add trx-calibration path * change GSM band to 900 Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b Related: SYS#3722 --- M doc/examples/litecell15/osmo-bts.cfg 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/litecell15/osmo-bts.cfg b/doc/examples/litecell15/osmo-bts.cfg index e38428a..3036283 100644 --- a/doc/examples/litecell15/osmo-bts.cfg +++ b/doc/examples/litecell15/osmo-bts.cfg @@ -29,10 +29,12 @@ ! phy 0 instance 0 + trx-calibration-path /mnt/rom/factory/calib phy 1 instance 0 + trx-calibration-path /mnt/rom/factory/calib bts 0 - band 1800 + band 900 ipa unit-id 1500 0 oml remote-ip 192.168.234.185 trx 0 -- To view, visit https://gerrit.osmocom.org/3252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b 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: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:34:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 18 Jul 2017 17:34:26 +0000 Subject: osmo-bts[master]: lc15: port lc15bts-mgr changes In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3277/2//COMMIT_MSG Commit Message: Line 6: port from where? Which changes from which branch of which repository, up to which point (git commit ID) are included in this patch? THis information is what we will need later on to forward-port other related changes. It's sad enough that the respective vendor doesn't actively submit related changes upstream. What's the summary of those changes? -- To view, visit https://gerrit.osmocom.org/3277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: jfdionne Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 18 17:35:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 18 Jul 2017 17:35:47 +0000 Subject: osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client* N... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3187/2/include/osmocom/ranap/iu_client.h File include/osmocom/ranap/iu_client.h: Line 31: struct gprs_ra_id ra_id; I decided to keep the gprs_ra_id. It is named such because it contains a rac on top of the usual circuit-switched mcc, mnc, lac. It comes from libosmocore's gsm48.h, so the scope is general enough, and been there since 2010. osmo_routing_area_id is identically suitable but it's not really worth having the patches only for dropping the 'gprs_' name. -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh 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 Wed Jul 19 09:51:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 19 Jul 2017 09:51:40 +0000 Subject: [PATCH] osmo-bts[master]: lc15: port lc15bts-mgr changes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3277 to look at the new patch set (#4). lc15: port lc15bts-mgr changes That's mostly changes related to lc15bts-mgr from https://gitlab.com/nrw_noa/osmo-bts branch nrw/litecell15 based on eb5b7f80510b603579f7af6d7d5ead296c2fa260 commit. I wanted to incorporate vty and hardcoded paths changes so we can use it from this point without major backward-incompatible changes as a base for future ports. Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Related: SYS#3679 --- M doc/examples/litecell15/lc15bts-mgr.cfg M include/osmo-bts/phy_link.h M src/common/Makefile.am M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/hw_misc.c A src/osmo-bts-litecell15/misc/lc15bts_bts.c A src/osmo-bts-litecell15/misc/lc15bts_bts.h M src/osmo-bts-litecell15/misc/lc15bts_clock.c A src/osmo-bts-litecell15/misc/lc15bts_led.c A src/osmo-bts-litecell15/misc/lc15bts_led.h M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.h M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c M src/osmo-bts-litecell15/misc/lc15bts_misc.c M src/osmo-bts-litecell15/misc/lc15bts_misc.h M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h M src/osmo-bts-litecell15/misc/lc15bts_power.c M src/osmo-bts-litecell15/misc/lc15bts_power.h M src/osmo-bts-litecell15/misc/lc15bts_temp.c M src/osmo-bts-litecell15/misc/lc15bts_temp.h 22 files changed, 2,014 insertions(+), 411 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/77/3277/4 diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index 750dc36..c7d0a79 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -25,39 +25,19 @@ no login ! lc15bts-mgr - limits supply - threshold warning 60 - threshold critical 78 - limits soc - threshold warning 60 - threshold critical 78 - limits fpga - threshold warning 60 - threshold critical 78 - limits logrf - threshold warning 60 - threshold critical 78 - limits tx0 - threshold warning 60 - threshold critical 78 - limits tx1 - threshold warning 60 - threshold critical 78 - limits pa0 - threshold warning 60 - threshold critical 78 - limits pa1 - threshold warning 60 - threshold critical 78 - actions normal - pa0-on - pa1-on - bts-service-on - actions warn - no pa0-off - no pa1-off - no bts-service-off - actions critical - pa0-off - pa1-off - no bts-service-off + limits supply_volt + threshold warning min 17500 + threshold critical min 19000 + limits tx0_vswr + threshold warning max 3 + limits tx1_vswr + threshold warning max 3 + limits supply_pwr + threshold warning max 110 + threshold critical max 120 + limits pa0_pwr + threshold warning max 50 + threshold critical max 60 + limits pa1_pwr + threshold warning max 50 + threshold critical max 60 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index d8d3c6b..3d4bf91 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -124,6 +124,12 @@ int minTxPower; int maxTxPower; struct lc15l1_hdl *hdl; + uint8_t max_cell_size; /* 0:166 qbits*/ + uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ + uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ + uint8_t dsp_alive_period; /* DSP alive timer period */ + uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ + uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ } lc15; } u; }; diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..d104c48 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -2,6 +2,10 @@ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) +if ENABLE_LC15BTS +AM_CFLAGS += -DENABLE_LC15BTS +endif + noinst_LIBRARIES = libbts.a libl1sched.a libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \ rsl.c vty.c paging.c measurement.c amr.c lchan.c \ diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 3026e96..90e6c46 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -4,9 +4,11 @@ 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/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h \ +AM_CFLAGS += -DENABLE_LC15BTS + +EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h misc/lc15bts_led.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ - misc/lc15bts_bid.h misc/lc15bts_nl.h \ + misc/lc15bts_bid.h misc/lc15bts_nl.h misc/lc15bts_bts.h \ hw_misc.h l1_if.h l1_transp.h lc15bts.h oml_router.h utils.h bin_PROGRAMS = osmo-bts-lc15 lc15bts-mgr lc15bts-util @@ -25,9 +27,11 @@ misc/lc15bts_mgr_vty.c \ misc/lc15bts_mgr_nl.c \ misc/lc15bts_mgr_temp.c \ - misc/lc15bts_mgr_calib.c + misc/lc15bts_mgr_calib.c \ + misc/lc15bts_led.c \ + misc/lc15bts_bts.c -lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(COMMON_LDADD) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) diff --git a/src/osmo-bts-litecell15/hw_misc.c b/src/osmo-bts-litecell15/hw_misc.c index 49232b2..9f070bb 100644 --- a/src/osmo-bts-litecell15/hw_misc.c +++ b/src/osmo-bts-litecell15/hw_misc.c @@ -69,6 +69,7 @@ rc = write(fd, cmd[0] ? "1" : "0", 2); if (rc != 2) { + close(fd); return -1; } close(fd); @@ -79,6 +80,7 @@ rc = write(fd, cmd[1] ? "1" : "0", 2); if (rc != 2) { + close(fd); return -1; } close(fd); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bts.c b/src/osmo-bts-litecell15/misc/lc15bts_bts.c new file mode 100644 index 0000000..0343e93 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_bts.c @@ -0,0 +1,131 @@ +/* Copyright (C) 2016 by NuRAN Wireless + * + * 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 "lc15bts_mgr.h" +#include "lc15bts_bts.h" + +static int check_eth_status(char *dev_name) +{ + int fd, rc; + struct ifreq ifr; + + fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); + if (fd < 0) + return fd; + + memset(&ifr, 0, sizeof(ifr)); + memcpy(&ifr.ifr_name, dev_name, sizeof(ifr.ifr_name)); + rc = ioctl(fd, SIOCGIFFLAGS, &ifr); + close(fd); + + if (rc < 0) + return rc; + + if ((ifr.ifr_flags & IFF_UP) && (ifr.ifr_flags & IFF_RUNNING)) + return 0; + + return 1; +} + +void check_bts_led_pattern(uint8_t *led) +{ + FILE *fp; + char str[64] = "\0"; + int rc; + + /* check for existing of BTS state file */ + if ((fp = fopen("/var/run/osmo-bts/state", "r")) == NULL) { + led[BLINK_PATTERN_INIT] = 1; + return; + } + + /* check Ethernet interface status */ + rc = check_eth_status("eth0"); + if (rc > 0) { + LOGP(DTEMP, LOGL_DEBUG,"External link is DOWN\n"); + led[BLINK_PATTERN_EXT_LINK_MALFUNC] = 1; + fclose(fp); + return; + } + + /* check for BTS is still alive */ + if (system("pidof osmo-bts-lc15 > /dev/null")) { + LOGP(DTEMP, LOGL_DEBUG,"BTS process has stopped\n"); + led[BLINK_PATTERN_INT_PROC_MALFUNC] = 1; + fclose(fp); + return; + } + + /* check for BTS state */ + while (fgets(str, 64, fp) != NULL) { + LOGP(DTEMP, LOGL_DEBUG,"BTS state is %s\n", (strstr(str, "ABIS DOWN") != NULL) ? "DOWN" : "UP"); + if (strstr(str, "ABIS DOWN") != NULL) + led[BLINK_PATTERN_INT_PROC_MALFUNC] = 1; + } + fclose(fp); + + return; +} + +int check_sensor_led_pattern( struct lc15bts_mgr_instance *mgr, uint8_t *led) +{ + if(mgr->alarms.temp_high == 1) + led[BLINK_PATTERN_TEMP_HIGH] = 1; + + if(mgr->alarms.temp_max == 1) + led[BLINK_PATTERN_TEMP_MAX] = 1; + + if(mgr->alarms.supply_low == 1) + led[BLINK_PATTERN_SUPPLY_VOLT_LOW] = 1; + + if(mgr->alarms.supply_min == 1) + led[BLINK_PATTERN_SUPPLY_VOLT_MIN] = 1; + + if(mgr->alarms.vswr_high == 1) + led[BLINK_PATTERN_VSWR_HIGH] = 1; + + if(mgr->alarms.vswr_max == 1) + led[BLINK_PATTERN_VSWR_MAX] = 1; + + if(mgr->alarms.supply_pwr_high == 1) + led[BLINK_PATTERN_SUPPLY_PWR_HIGH] = 1; + + if(mgr->alarms.supply_pwr_max == 1) + led[BLINK_PATTERN_SUPPLY_PWR_MAX] = 1; + + if(mgr->alarms.supply_pwr_max2 == 1) + led[BLINK_PATTERN_SUPPLY_PWR_MAX2] = 1; + + if(mgr->alarms.pa_pwr_high == 1) + led[BLINK_PATTERN_PA_PWR_HIGH] = 1; + + if(mgr->alarms.pa_pwr_max == 1) + led[BLINK_PATTERN_PA_PWR_MAX] = 1; + + if(mgr->alarms.gps_fix_lost == 1) + led[BLINK_PATTERN_GPS_FIX_LOST] = 1; + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bts.h b/src/osmo-bts-litecell15/misc/lc15bts_bts.h new file mode 100644 index 0000000..3918b87 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_bts.h @@ -0,0 +1,21 @@ +#ifndef _LC15BTS_BTS_H_ +#define _LC15BTS_BTS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* public function prototypes */ +void check_bts_led_pattern(uint8_t *led); +int check_sensor_led_pattern( struct lc15bts_mgr_instance *mgr, uint8_t *led); + +#endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_clock.c b/src/osmo-bts-litecell15/misc/lc15bts_clock.c index f4df5d3..7170149 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_clock.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_clock.c @@ -100,9 +100,6 @@ int lc15bts_clock_err_open(void) { - int rc; - int fault; - if (clkerr_fd_err < 0) { clkerr_fd_err = open(CLKERR_ERR_SYSFS, O_RDONLY); if (clkerr_fd_err < 0) { @@ -149,26 +146,6 @@ lc15bts_clock_err_close(); return clkerr_fd_reset; } - } - - rc = sysfs_write_str(clkerr_fd_refresh, "once"); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } - - rc = sysfs_read_val(clkerr_fd_fault, &fault); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } - - if (fault) { - rc = sysfs_write_val(clkerr_fd_reset, 1); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } } return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_led.c b/src/osmo-bts-litecell15/misc/lc15bts_led.c new file mode 100644 index 0000000..603e0fb --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_led.c @@ -0,0 +1,333 @@ +/* Copyright (C) 2016 by NuRAN Wireless + * + * 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 "lc15bts_led.h" +#include "lc15bts_bts.h" +#include +#include + +static struct lc15bts_led led_entries[] = { + { + .name = "led0", + .fullname = "led red", + .path = "/var/lc15/leds/led0/brightness" + }, + { + .name = "led1", + .fullname = "led green", + .path = "/var/lc15/leds/led1/brightness" + } +}; + +static const struct value_string lc15bts_led_strs[] = { + { LC15BTS_LED_RED, "LED red" }, + { LC15BTS_LED_GREEN, "LED green" }, + { LC15BTS_LED_ORANGE, "LED orange" }, + { LC15BTS_LED_OFF, "LED off" }, + { 0, NULL } +}; + +static uint8_t led_priority[] = { + BLINK_PATTERN_INIT, + BLINK_PATTERN_INT_PROC_MALFUNC, + BLINK_PATTERN_SUPPLY_PWR_MAX, + BLINK_PATTERN_PA_PWR_MAX, + BLINK_PATTERN_VSWR_MAX, + BLINK_PATTERN_SUPPLY_VOLT_MIN, + BLINK_PATTERN_TEMP_MAX, + BLINK_PATTERN_SUPPLY_PWR_MAX2, + BLINK_PATTERN_EXT_LINK_MALFUNC, + BLINK_PATTERN_SUPPLY_VOLT_LOW, + BLINK_PATTERN_TEMP_HIGH, + BLINK_PATTERN_VSWR_HIGH, + BLINK_PATTERN_SUPPLY_PWR_HIGH, + BLINK_PATTERN_PA_PWR_HIGH, + BLINK_PATTERN_GPS_FIX_LOST, + BLINK_PATTERN_NORMAL +}; + + +char *blink_pattern_command[] = BLINK_PATTERN_COMMAND; + +static int lc15bts_led_write(char *path, char *str) +{ + int fd; + + if ((fd = open(path, O_WRONLY)) == -1) + { + return 0; + } + + write(fd, str, strlen(str)+1); + close(fd); + return 1; +} + +static void led_set_red() +{ + lc15bts_led_write(led_entries[0].path, "1"); + lc15bts_led_write(led_entries[1].path, "0"); +} + +static void led_set_green() +{ + lc15bts_led_write(led_entries[0].path, "0"); + lc15bts_led_write(led_entries[1].path, "1"); +} + +static void led_set_orange() +{ + lc15bts_led_write(led_entries[0].path, "1"); + lc15bts_led_write(led_entries[1].path, "1"); +} + +static void led_set_off() +{ + lc15bts_led_write(led_entries[0].path, "0"); + lc15bts_led_write(led_entries[1].path, "0"); +} + +static void led_sleep( struct lc15bts_mgr_instance *mgr, struct lc15bts_led_timer *led_timer, void (*led_timer_cb)(void *_data)) { + /* Cancel any pending timer */ + osmo_timer_del(&led_timer->timer); + /* Start LED timer */ + led_timer->timer.cb = led_timer_cb; + led_timer->timer.data = mgr; + mgr->lc15bts_leds.active_timer = led_timer->idx; + osmo_timer_schedule(&led_timer->timer, led_timer->param.sleep_sec, led_timer->param.sleep_usec); + LOGP(DTEMP, LOGL_DEBUG,"%s timer scheduled for %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_timer->idx), + led_timer->param.sleep_sec, + led_timer->param.sleep_usec); + + switch (led_timer->idx) { + case LC15BTS_LED_RED: + led_set_red(); + break; + case LC15BTS_LED_GREEN: + led_set_green(); + break; + case LC15BTS_LED_ORANGE: + led_set_orange(); + break; + case LC15BTS_LED_OFF: + led_set_off(); + break; + default: + led_set_off(); + } +} + +static void led_sleep_cb(void *_data) { + struct lc15bts_mgr_instance *mgr = _data; + struct lc15bts_led_timer_list *led_list; + + /* make sure the timer list is not empty */ + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + llist_for_each_entry(led_list, &mgr->lc15bts_leds.list, list) { + if (led_list->led_timer.idx == mgr->lc15bts_leds.active_timer) { + LOGP(DTEMP, LOGL_DEBUG,"Delete expired %s timer %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + /* Delete current timer */ + osmo_timer_del(&led_list->led_timer.timer); + /* Rotate the timer list */ + llist_move_tail(led_list, &mgr->lc15bts_leds.list); + break; + } + } + + /* Execute next timer */ + led_list = llist_first_entry(&mgr->lc15bts_leds.list, struct lc15bts_led_timer_list, list); + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Execute %s timer %d sec + %d usec, total entries=%d\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec, + llist_count(&mgr->lc15bts_leds.list)); + + led_sleep(mgr, &led_list->led_timer, led_sleep_cb); + } + +} + +static void delete_led_timer_entries(struct lc15bts_mgr_instance *mgr) +{ + struct lc15bts_led_timer_list *led_list, *led_list2; + + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + llist_for_each_entry_safe(led_list, led_list2, &mgr->lc15bts_leds.list, list) { + /* Delete the timer in list */ + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Delete %s timer entry from list, %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + /* Delete current timer */ + osmo_timer_del(&led_list->led_timer.timer); + llist_del(&led_list->list); + talloc_free(led_list); + } + } + return; +} + +static int add_led_timer_entry(struct lc15bts_mgr_instance *mgr, char *cmdstr) +{ + double sec, int_sec, frac_sec; + struct lc15bts_sleep_time led_param; + + led_param.sleep_sec = 0; + led_param.sleep_usec = 0; + + if (strstr(cmdstr, "set red") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_RED; + else if (strstr(cmdstr, "set green") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_GREEN; + else if (strstr(cmdstr, "set orange") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_ORANGE; + else if (strstr(cmdstr, "set off") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_OFF; + else if (strstr(cmdstr, "sleep") != NULL) { + sec = atof(cmdstr + 6); + /* split time into integer and fractional of seconds */ + frac_sec = modf(sec, &int_sec) * 1000000.0; + led_param.sleep_sec = (int)int_sec; + led_param.sleep_usec = (int)frac_sec; + + if ((mgr->lc15bts_leds.led_idx >= LC15BTS_LED_RED) && (mgr->lc15bts_leds.led_idx < _LC15BTS_LED_MAX)) { + struct lc15bts_led_timer_list *led_list; + + /* allocate timer entry */ + led_list = talloc_zero(tall_mgr_ctx, struct lc15bts_led_timer_list); + if (led_list) { + led_list->led_timer.idx = mgr->lc15bts_leds.led_idx; + led_list->led_timer.param.sleep_sec = led_param.sleep_sec; + led_list->led_timer.param.sleep_usec = led_param.sleep_usec; + llist_add_tail(&led_list->list, &mgr->lc15bts_leds.list); + + LOGP(DTEMP, LOGL_DEBUG,"Add %s timer to list, %d sec + %d usec, total entries=%d\n", + get_value_string(lc15bts_led_strs, mgr->lc15bts_leds.led_idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec, + llist_count(&mgr->lc15bts_leds.list)); + } + } + } else + return -1; + + return 0; +} + +static int parse_led_pattern(char *pattern, struct lc15bts_mgr_instance *mgr) +{ + char str[1024]; + char *pstr; + char *sep; + int rc = 0; + + strcpy(str, pattern); + pstr = str; + while ((sep = strsep(&pstr, ";")) != NULL) { + rc = add_led_timer_entry(mgr, sep); + if (rc < 0) { + break; + } + + } + return rc; +} + +/*** led interface ***/ + +void led_set(struct lc15bts_mgr_instance *mgr, int pattern_id) +{ + int rc; + struct lc15bts_led_timer_list *led_list; + + if (pattern_id > BLINK_PATTERN_MAX_ITEM - 1) { + LOGP(DTEMP, LOGL_ERROR, "Invalid LED pattern : %d. LED pattern must be between %d..%d\n", + pattern_id, + BLINK_PATTERN_POWER_ON, + BLINK_PATTERN_MAX_ITEM - 1); + return; + } + if (pattern_id == mgr->lc15bts_leds.last_pattern_id) + return; + + mgr->lc15bts_leds.last_pattern_id = pattern_id; + + LOGP(DTEMP, LOGL_NOTICE, "blink pattern command : %d\n", pattern_id); + LOGP(DTEMP, LOGL_NOTICE, "%s\n", blink_pattern_command[pattern_id]); + + /* Empty existing LED timer in the list */ + delete_led_timer_entries(mgr); + + /* parse LED pattern */ + rc = parse_led_pattern(blink_pattern_command[pattern_id], mgr); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR,"LED pattern not found or invalid LED pattern\n"); + return; + } + + /* make sure the timer list is not empty */ + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + /* Start the first LED timer in the list */ + led_list = llist_first_entry(&mgr->lc15bts_leds.list, struct lc15bts_led_timer_list, list); + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Execute timer %s for %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + led_sleep(mgr, &led_list->led_timer, led_sleep_cb); + } + +} + +void select_led_pattern(struct lc15bts_mgr_instance *mgr) +{ + int i; + uint8_t led[BLINK_PATTERN_MAX_ITEM] = {0}; + + /* set normal LED pattern at first */ + led[BLINK_PATTERN_NORMAL] = 1; + + /* check on-board sensors for new LED pattern */ + check_sensor_led_pattern(mgr, led); + + /* check BTS status for new LED pattern */ + check_bts_led_pattern(led); + + /* check by priority */ + for (i = 0; i < sizeof(led_priority)/sizeof(uint8_t); i++) { + if(led[led_priority[i]] == 1) { + led_set(mgr, led_priority[i]); + break; + } + } +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_led.h b/src/osmo-bts-litecell15/misc/lc15bts_led.h new file mode 100644 index 0000000..b6d9d28 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_led.h @@ -0,0 +1,22 @@ +#ifndef _LC15BTS_LED_H +#define _LC15BTS_LED_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "lc15bts_mgr.h" + +/* public function prototypes */ +void led_set(struct lc15bts_mgr_instance *mgr, int pattern_id); + +void select_led_pattern(struct lc15bts_mgr_instance *mgr); + +#endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index 3a7d3a1..51a05f9 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -46,13 +46,14 @@ #include "misc/lc15bts_par.h" #include "misc/lc15bts_bid.h" #include "misc/lc15bts_power.h" +#include "lc15bts_led.h" static int no_rom_write = 0; static int daemonize = 0; void *tall_mgr_ctx; /* every 6 hours means 365*4 = 1460 rom writes per year (max) */ -#define TEMP_TIMER_SECS (6 * 3600) +#define SENSOR_TIMER_SECS (6 * 3600) /* every 1 hours means 365*24 = 8760 rom writes per year (max) */ #define HOURS_TIMER_SECS (1 * 3600) @@ -62,54 +63,106 @@ static struct lc15bts_mgr_instance manager = { .config_file = "lc15bts-mgr.cfg", .temp = { - .supply_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .supply_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .soc_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .soc_temp_limit = { + .thresh_warn_max = 95, + .thresh_crit_max = 100, + .thresh_warn_min = -40, }, - .fpga_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .fpga_temp_limit = { + .thresh_warn_max = 95, + .thresh_crit_max = 100, + .thresh_warn_min = -40, }, - .logrf_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .rmsdet_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .ocxo_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .ocxo_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .tx0_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .tx0_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -20, }, - .tx1_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .tx1_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -20, }, - .pa0_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .pa0_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .pa1_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .pa1_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, + } + }, + .volt = { + .supply_volt_limit = { + .thresh_warn_max = 30000, + .thresh_crit_max = 30500, + .thresh_warn_min = 19000, + .thresh_crit_min = 17500, + } + }, + .pwr = { + .supply_pwr_limit = { + .thresh_warn_max = 110, + .thresh_crit_max = 120, }, + .pa0_pwr_limit = { + .thresh_warn_max = 50, + .thresh_crit_max = 60, + }, + .pa1_pwr_limit = { + .thresh_warn_max = 50, + .thresh_crit_max = 60, + } + }, + .vswr = { + .tx0_vswr_limit = { + .thresh_warn_max = 3000, + .thresh_crit_max = 5000, + }, + .tx1_vswr_limit = { + .thresh_warn_max = 3000, + .thresh_crit_max = 5000, + } + }, + .gps = { + .gps_fix_limit = { + .thresh_warn_max = 7, + } + }, + .state = { + .action_norm = SENSOR_ACT_NORM_PA0_ON | SENSOR_ACT_NORM_PA1_ON, .action_warn = 0, - .action_crit = TEMP_ACT_PA0_OFF | TEMP_ACT_PA1_OFF, + .action_crit = 0, + .action_comb = 0, .state = STATE_NORMAL, } }; -static struct osmo_timer_list temp_timer; -static void check_temp_timer_cb(void *unused) +static struct osmo_timer_list sensor_timer; +static void check_sensor_timer_cb(void *unused) { lc15bts_check_temp(no_rom_write); - - osmo_timer_schedule(&temp_timer, TEMP_TIMER_SECS, 0); + lc15bts_check_power(no_rom_write); + lc15bts_check_vswr(no_rom_write); + osmo_timer_schedule(&sensor_timer, SENSOR_TIMER_SECS, 0); + /* TODO checks if lc15bts_check_temp/lc15bts_check_power/lc15bts_check_vswr went ok */ } static struct osmo_timer_list hours_timer; @@ -118,6 +171,7 @@ lc15bts_update_hours(no_rom_write); osmo_timer_schedule(&hours_timer, HOURS_TIMER_SECS, 0); + /* TODO: validates if lc15bts_update_hours went correctly */ } static void print_help(void) @@ -169,6 +223,8 @@ switch (signal) { case SIGINT: lc15bts_check_temp(no_rom_write); + lc15bts_check_power(no_rom_write); + lc15bts_check_vswr(no_rom_write); lc15bts_update_hours(no_rom_write); exit(0); break; @@ -207,6 +263,12 @@ .color = "\033[1;37m", .enabled = 1, .loglevel = LOGL_INFO, }, + [DSWD] = { + .name = "DSWD", + .description = "Software Watchdog", + .color = "\033[1;37m", + .enabled = 1, .loglevel = LOGL_INFO, + }, }; static const struct log_info mgr_log_info = { @@ -223,7 +285,6 @@ int main(int argc, char **argv) { int rc; - tall_mgr_ctx = talloc_named_const(NULL, 1, "bts manager"); msgb_talloc_ctx_init(tall_mgr_ctx, 0); @@ -253,9 +314,12 @@ exit(1); } + INIT_LLIST_HEAD(&manager.lc15bts_leds.list); + INIT_LLIST_HEAD(&manager.alarms.list); + /* start temperature check timer */ - temp_timer.cb = check_temp_timer_cb; - check_temp_timer_cb(NULL); + sensor_timer.cb = check_sensor_timer_cb; + check_sensor_timer_cb(NULL); /* start operational hours timer */ hours_timer.cb = hours_timer_cb; @@ -271,14 +335,13 @@ if (rc < 0) { exit(3); } - /* handle broadcast messages for ipaccess-find */ if (lc15bts_mgr_nl_init() != 0) exit(3); - /* Initialize the temperature control */ - lc15bts_mgr_temp_init(&manager); + /* Initialize the sensor control */ + lc15bts_mgr_sensor_init(&manager); if (lc15bts_mgr_calib_init(&manager) != 0) exit(3); @@ -290,7 +353,6 @@ exit(1); } } - while (1) { log_reset_context(); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h index 98bd701..4bfbdbc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h @@ -9,38 +9,100 @@ #include +#define LC15BTS_SENSOR_TIMER_DURATION 60 +#define LC15BTS_PREVENT_TIMER_DURATION 15 * 60 +#define LC15BTS_PREVENT_TIMER_SHORT_DURATION 5 * 60 +#define LC15BTS_PREVENT_TIMER_NONE 0 +#define LC15BTS_PREVENT_RETRY INT_MAX - 1 + +enum BLINK_PATTERN { + BLINK_PATTERN_POWER_ON = 0, //hardware set + BLINK_PATTERN_INIT, + BLINK_PATTERN_NORMAL, + BLINK_PATTERN_EXT_LINK_MALFUNC, + BLINK_PATTERN_INT_PROC_MALFUNC, + BLINK_PATTERN_SUPPLY_VOLT_LOW, + BLINK_PATTERN_SUPPLY_VOLT_MIN, + BLINK_PATTERN_VSWR_HIGH, + BLINK_PATTERN_VSWR_MAX, + BLINK_PATTERN_TEMP_HIGH, + BLINK_PATTERN_TEMP_MAX, + BLINK_PATTERN_SUPPLY_PWR_HIGH, + BLINK_PATTERN_SUPPLY_PWR_MAX, + BLINK_PATTERN_SUPPLY_PWR_MAX2, + BLINK_PATTERN_PA_PWR_HIGH, + BLINK_PATTERN_PA_PWR_MAX, + BLINK_PATTERN_GPS_FIX_LOST, + BLINK_PATTERN_MAX_ITEM +}; + +#define BLINK_PATTERN_COMMAND {\ + "set red; sleep 5.0",\ + "set orange; sleep 5.0",\ + "set green; sleep 2.5; set off; sleep 2.5",\ + "set red; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 2.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5 ",\ + "set green; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set orange; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5 ",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set orange; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ +} + enum { DTEMP, DFW, DFIND, DCALIB, + DSWD, }; // TODO NTQD: Define new actions like reducing output power, limit ARM core speed, shutdown second TRX/PA, ... enum { #if 0 - TEMP_ACT_PWR_CONTRL = 0x1, + SENSOR_ACT_PWR_CONTRL = 0x1, #endif - TEMP_ACT_PA0_OFF = 0x2, - TEMP_ACT_PA1_OFF = 0x4, - TEMP_ACT_BTS_SRV_OFF = 0x10, + SENSOR_ACT_PA0_OFF = 0x2, + SENSOR_ACT_PA1_OFF = 0x4, + SENSOR_ACT_BTS_SRV_OFF = 0x10, }; /* actions only for normal state */ enum { #if 0 - TEMP_ACT_NORM_PW_CONTRL = 0x1, + SENSOR_ACT_NORM_PW_CONTRL = 0x1, #endif - TEMP_ACT_NORM_PA0_ON = 0x2, - TEMP_ACT_NORM_PA1_ON = 0x4, - TEMP_ACT_NORM_BTS_SRV_ON= 0x10, + SENSOR_ACT_NORM_PA0_ON = 0x2, + SENSOR_ACT_NORM_PA1_ON = 0x4, + SENSOR_ACT_NORM_BTS_SRV_ON= 0x10, }; -enum lc15bts_temp_state { +enum lc15bts_sensor_state { STATE_NORMAL, /* Everything is fine */ STATE_WARNING_HYST, /* Go back to normal next? */ STATE_WARNING, /* We are above the warning threshold */ STATE_CRITICAL, /* We have an issue. Wait for below warning */ +}; + +enum lc15bts_leds_name { + LC15BTS_LED_RED = 0, + LC15BTS_LED_GREEN, + LC15BTS_LED_ORANGE, + LC15BTS_LED_OFF, + _LC15BTS_LED_MAX +}; + +struct lc15bts_led{ + char *name; + char *fullname; + char *path; }; /** @@ -49,8 +111,52 @@ * severe that an action will be taken. */ struct lc15bts_temp_limit { - int thresh_warn; - int thresh_crit; + int thresh_warn_max; + int thresh_crit_max; + int thresh_warn_min; +}; + +struct lc15bts_volt_limit { + int thresh_warn_max; + int thresh_crit_max; + int thresh_warn_min; + int thresh_crit_min; +}; + +struct lc15bts_pwr_limit { + int thresh_warn_max; + int thresh_crit_max; +}; + +struct lc15bts_vswr_limit { + int thresh_warn_max; + int thresh_crit_max; +}; + +struct lc15bts_gps_fix_limit { + int thresh_warn_max; +}; + +struct lc15bts_sleep_time { + int sleep_sec; + int sleep_usec; +}; + +struct lc15bts_led_timer { + uint8_t idx; + struct osmo_timer_list timer; + struct lc15bts_sleep_time param; +}; + +struct lc15bts_led_timer_list { + struct llist_head list; + struct lc15bts_led_timer led_timer; +}; + +struct lc15bts_preventive_list { + struct llist_head list; + struct lc15bts_sleep_time param; + int action_flag; }; enum mgr_vty_node { @@ -59,55 +165,258 @@ ACT_NORM_NODE, ACT_WARN_NODE, ACT_CRIT_NODE, - LIMIT_SUPPLY_NODE, + LIMIT_SUPPLY_TEMP_NODE, LIMIT_SOC_NODE, LIMIT_FPGA_NODE, - LIMIT_LOGRF_NODE, + LIMIT_RMSDET_NODE, LIMIT_OCXO_NODE, - LIMIT_TX0_NODE, - LIMIT_TX1_NODE, - LIMIT_PA0_NODE, - LIMIT_PA1_NODE, + LIMIT_TX0_TEMP_NODE, + LIMIT_TX1_TEMP_NODE, + LIMIT_PA0_TEMP_NODE, + LIMIT_PA1_TEMP_NODE, + LIMIT_SUPPLY_VOLT_NODE, + LIMIT_TX0_VSWR_NODE, + LIMIT_TX1_VSWR_NODE, + LIMIT_SUPPLY_PWR_NODE, + LIMIT_PA0_PWR_NODE, + LIMIT_PA1_PWR_NODE, + LIMIT_GPS_FIX_NODE, +}; + +enum mgr_vty_limit_type { + MGR_LIMIT_TYPE_TEMP = 0, + MGR_LIMIT_TYPE_VOLT, + MGR_LIMIT_TYPE_VSWR, + MGR_LIMIT_TYPE_PWR, + _MGR_LIMIT_TYPE_MAX, }; struct lc15bts_mgr_instance { const char *config_file; struct { + struct lc15bts_temp_limit supply_temp_limit; + struct lc15bts_temp_limit soc_temp_limit; + struct lc15bts_temp_limit fpga_temp_limit; + struct lc15bts_temp_limit rmsdet_temp_limit; + struct lc15bts_temp_limit ocxo_temp_limit; + struct lc15bts_temp_limit tx0_temp_limit; + struct lc15bts_temp_limit tx1_temp_limit; + struct lc15bts_temp_limit pa0_temp_limit; + struct lc15bts_temp_limit pa1_temp_limit; + } temp; + + struct { + struct lc15bts_volt_limit supply_volt_limit; + } volt; + + struct { + struct lc15bts_pwr_limit supply_pwr_limit; + struct lc15bts_pwr_limit pa0_pwr_limit; + struct lc15bts_pwr_limit pa1_pwr_limit; + } pwr; + + struct { + struct lc15bts_vswr_limit tx0_vswr_limit; + struct lc15bts_vswr_limit tx1_vswr_limit; + int tx0_last_vswr; + int tx1_last_vswr; + } vswr; + + struct { + struct lc15bts_gps_fix_limit gps_fix_limit; + time_t last_update; + } gps; + + struct { int action_norm; int action_warn; int action_crit; + int action_comb; - enum lc15bts_temp_state state; - - struct lc15bts_temp_limit supply_limit; - struct lc15bts_temp_limit soc_limit; - struct lc15bts_temp_limit fpga_limit; - struct lc15bts_temp_limit logrf_limit; - struct lc15bts_temp_limit ocxo_limit; - struct lc15bts_temp_limit tx0_limit; - struct lc15bts_temp_limit tx1_limit; - struct lc15bts_temp_limit pa0_limit; - struct lc15bts_temp_limit pa1_limit; - } temp; + enum lc15bts_sensor_state state; + } state; struct { int state; int calib_from_loop; struct osmo_timer_list calib_timeout; } calib; + + struct { + int state; + int swd_from_loop; + unsigned long long int swd_events; + unsigned long long int swd_events_cache; + unsigned long long int swd_eventmasks; + int num_events; + struct osmo_timer_list swd_timeout; + } swd; + + struct { + uint8_t led_idx; + uint8_t last_pattern_id; + uint8_t active_timer; + struct llist_head list; + } lc15bts_leds; + + struct { + int is_up; + uint32_t last_seqno; + struct osmo_timer_list recon_timer; + struct ipa_client_conn *bts_conn; + uint32_t crit_flags; + uint32_t warn_flags; + } lc15bts_ctrl; + + struct lc15bts_alarms { + int temp_high; + int temp_max; + int supply_low; + int supply_min; + int vswr_high; + int vswr_max; + int supply_pwr_high; + int supply_pwr_max; + int supply_pwr_max2; + int pa_pwr_high; + int pa_pwr_max; + int gps_fix_lost; + struct llist_head list; + struct osmo_timer_list preventive_timer; + int preventive_duration; + int preventive_retry; + } alarms; + +}; + +enum lc15bts_mgr_fail_evt_rep_crit_sig { + /* Critical alarms */ + S_MGR_TEMP_SUPPLY_CRIT_MAX_ALARM = (1 << 0), + S_MGR_TEMP_SOC_CRIT_MAX_ALARM = (1 << 1), + S_MGR_TEMP_FPGA_CRIT_MAX_ALARM = (1 << 2), + S_MGR_TEMP_RMS_DET_CRIT_MAX_ALARM = (1 << 3), + S_MGR_TEMP_OCXO_CRIT_MAX_ALARM = (1 << 4), + S_MGR_TEMP_TRX0_CRIT_MAX_ALARM = (1 << 5), + S_MGR_TEMP_TRX1_CRIT_MAX_ALARM = (1 << 6), + S_MGR_TEMP_PA0_CRIT_MAX_ALARM = (1 << 7), + S_MGR_TEMP_PA1_CRIT_MAX_ALARM = (1 << 8), + S_MGR_SUPPLY_CRIT_MAX_ALARM = (1 << 9), + S_MGR_SUPPLY_CRIT_MIN_ALARM = (1 << 10), + S_MGR_VSWR0_CRIT_MAX_ALARM = (1 << 11), + S_MGR_VSWR1_CRIT_MAX_ALARM = (1 << 12), + S_MGR_PWR_SUPPLY_CRIT_MAX_ALARM = (1 << 13), + S_MGR_PWR_PA0_CRIT_MAX_ALARM = (1 << 14), + S_MGR_PWR_PA1_CRIT_MAX_ALARM = (1 << 15), + _S_MGR_CRIT_ALARM_MAX, +}; + +enum lc15bts_mgr_fail_evt_rep_warn_sig { + /* Warning alarms */ + S_MGR_TEMP_SUPPLY_WARN_MIN_ALARM = (1 << 0), + S_MGR_TEMP_SUPPLY_WARN_MAX_ALARM = (1 << 2), + S_MGR_TEMP_SOC_WARN_MIN_ALARM = (1 << 3), + S_MGR_TEMP_SOC_WARN_MAX_ALARM = (1 << 4), + S_MGR_TEMP_FPGA_WARN_MIN_ALARM = (1 << 5), + S_MGR_TEMP_FPGA_WARN_MAX_ALARM = (1 << 6), + S_MGR_TEMP_RMS_DET_WARN_MIN_ALARM = (1 << 7), + S_MGR_TEMP_RMS_DET_WARN_MAX_ALARM = (1 << 8), + S_MGR_TEMP_OCXO_WARN_MIN_ALARM = (1 << 9), + S_MGR_TEMP_OCXO_WARN_MAX_ALARM = (1 << 10), + S_MGR_TEMP_TRX0_WARN_MIN_ALARM = (1 << 11), + S_MGR_TEMP_TRX0_WARN_MAX_ALARM = (1 << 12), + S_MGR_TEMP_TRX1_WARN_MIN_ALARM = (1 << 13), + S_MGR_TEMP_TRX1_WARN_MAX_ALARM = (1 << 14), + S_MGR_TEMP_PA0_WARN_MIN_ALARM = (1 << 15), + S_MGR_TEMP_PA0_WARN_MAX_ALARM = (1 << 16), + S_MGR_TEMP_PA1_WARN_MIN_ALARM = (1 << 17), + S_MGR_TEMP_PA1_WARN_MAX_ALARM = (1 << 18), + S_MGR_SUPPLY_WARN_MIN_ALARM = (1 << 19), + S_MGR_SUPPLY_WARN_MAX_ALARM = (1 << 20), + S_MGR_VSWR0_WARN_MAX_ALARM = (1 << 21), + S_MGR_VSWR1_WARN_MAX_ALARM = (1 << 22), + S_MGR_PWR_SUPPLY_WARN_MAX_ALARM = (1 << 23), + S_MGR_PWR_PA0_WARN_MAX_ALARM = (1 << 24), + S_MGR_PWR_PA1_WARN_MAX_ALARM = (1 << 25), + S_MGR_GPS_FIX_WARN_ALARM = (1 << 26), + _S_MGR_WARN_ALARM_MAX, +}; + +enum lc15bts_mgr_failure_event_causes { + /* Critical causes */ + NM_EVT_CAUSE_CRIT_TEMP_SUPPLY_MAX_FAIL = 0x4100, + NM_EVT_CAUSE_CRIT_TEMP_FPGA_MAX_FAIL = 0x4101, + NM_EVT_CAUSE_CRIT_TEMP_SOC_MAX_FAIL = 0x4102, + NM_EVT_CAUSE_CRIT_TEMP_RMS_DET_MAX_FAIL = 0x4103, + NM_EVT_CAUSE_CRIT_TEMP_OCXO_MAX_FAIL = 0x4104, + NM_EVT_CAUSE_CRIT_TEMP_TRX0_MAX_FAIL = 0x4105, + NM_EVT_CAUSE_CRIT_TEMP_TRX1_MAX_FAIL = 0x4106, + NM_EVT_CAUSE_CRIT_TEMP_PA0_MAX_FAIL = 0x4107, + NM_EVT_CAUSE_CRIT_TEMP_PA1_MAX_FAIL = 0x4108, + NM_EVT_CAUSE_CRIT_SUPPLY_MAX_FAIL = 0x4109, + NM_EVT_CAUSE_CRIT_SUPPLY_MIN_FAIL = 0x410A, + NM_EVT_CAUSE_CRIT_VSWR0_MAX_FAIL = 0x410B, + NM_EVT_CAUSE_CRIT_VSWR1_MAX_FAIL = 0x410C, + NM_EVT_CAUSE_CRIT_PWR_SUPPLY_MAX_FAIL = 0x410D, + NM_EVT_CAUSE_CRIT_PWR_PA0_MAX_FAIL = 0x410E, + NM_EVT_CAUSE_CRIT_PWR_PA1_MAX_FAIL = 0x410F, + /* Warning causes */ + NM_EVT_CAUSE_WARN_TEMP_SUPPLY_LOW_FAIL = 0x4400, + NM_EVT_CAUSE_WARN_TEMP_SUPPLY_HIGH_FAIL = 0x4401, + NM_EVT_CAUSE_WARN_TEMP_FPGA_LOW_FAIL = 0x4402, + NM_EVT_CAUSE_WARN_TEMP_FPGA_HIGH_FAIL = 0x4403, + NM_EVT_CAUSE_WARN_TEMP_SOC_LOW_FAIL = 0x4404, + NM_EVT_CAUSE_WARN_TEMP_SOC_HIGH_FAIL = 0x4405, + NM_EVT_CAUSE_WARN_TEMP_RMS_DET_LOW_FAIL = 0x4406, + NM_EVT_CAUSE_WARN_TEMP_RMS_DET_HIGH_FAIL= 0x4407, + NM_EVT_CAUSE_WARN_TEMP_OCXO_LOW_FAIL = 0x4408, + NM_EVT_CAUSE_WARN_TEMP_OCXO_HIGH_FAIL = 0x4409, + NM_EVT_CAUSE_WARN_TEMP_TRX0_LOW_FAIL = 0x440A, + NM_EVT_CAUSE_WARN_TEMP_TRX0_HIGH_FAIL = 0x440B, + NM_EVT_CAUSE_WARN_TEMP_TRX1_LOW_FAIL = 0x440C, + NM_EVT_CAUSE_WARN_TEMP_TRX1_HIGH_FAIL = 0x440D, + NM_EVT_CAUSE_WARN_TEMP_PA0_LOW_FAIL = 0x440E, + NM_EVT_CAUSE_WARN_TEMP_PA0_HIGH_FAIL = 0x440F, + NM_EVT_CAUSE_WARN_TEMP_PA1_LOW_FAIL = 0x4410, + NM_EVT_CAUSE_WARN_TEMP_PA1_HIGH_FAIL = 0x4411, + NM_EVT_CAUSE_WARN_SUPPLY_LOW_FAIL = 0x4412, + NM_EVT_CAUSE_WARN_SUPPLY_HIGH_FAIL = 0x4413, + NM_EVT_CAUSE_WARN_VSWR0_HIGH_FAIL = 0x4414, + NM_EVT_CAUSE_WANR_VSWR1_HIGH_FAIL = 0x4415, + NM_EVT_CAUSE_WARN_PWR_SUPPLY_HIGH_FAIL = 0x4416, + NM_EVT_CAUSE_WARN_PWR_PA0_HIGH_FAIL = 0x4417, + NM_EVT_CAUSE_WARN_PWR_PA1_HIGH_FAIL = 0x4418, + NM_EVT_CAUSE_WARN_GPS_FIX_FAIL = 0x4419, +}; + +/* This defines the list of notification events for systemd service watchdog. + all these events must be notified in a certain service defined timeslot + or the service (this app) would be restarted (only if related systemd service + unit file has WatchdogSec!=0). + WARNING: swd events must begin with event 0. Last events must be + SWD_LAST (max 64 events in this list). +*/ +enum mgr_swd_events { + SWD_MAINLOOP = 0, + SWD_CHECK_SENSOR, + SWD_UPDATE_HOURS, + SWD_CHECK_TEMP_SENSOR, + SWD_CHECK_LED_CTRL, + SWD_CHECK_CALIB, + SWD_CHECK_BTS_CONNECTION, + SWD_LAST }; int lc15bts_mgr_vty_init(void); int lc15bts_mgr_parse_config(struct lc15bts_mgr_instance *mgr); int lc15bts_mgr_nl_init(void); -int lc15bts_mgr_temp_init(struct lc15bts_mgr_instance *mgr); -const char *lc15bts_mgr_temp_get_state(enum lc15bts_temp_state state); - +int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr); +const char *lc15bts_mgr_sensor_get_state(enum lc15bts_sensor_state state); int lc15bts_mgr_calib_init(struct lc15bts_mgr_instance *mgr); +int lc15bts_mgr_control_init(struct lc15bts_mgr_instance *mgr); int lc15bts_mgr_calib_run(struct lc15bts_mgr_instance *mgr); - +void lc15bts_mgr_dispatch_alarm(struct lc15bts_mgr_instance *mgr, const int cause, const char *key, const char *text); extern void *tall_mgr_ctx; #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 042fc87..9d2dfec 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -22,19 +22,22 @@ * along with this program. If not, see . * */ - +#include #include "misc/lc15bts_mgr.h" #include "misc/lc15bts_misc.h" #include "misc/lc15bts_temp.h" #include "misc/lc15bts_power.h" +#include "misc/lc15bts_led.h" +#include "limits.h" #include #include #include +#include -static struct lc15bts_mgr_instance *s_mgr; -static struct osmo_timer_list temp_ctrl_timer; +struct lc15bts_mgr_instance *s_mgr; +static struct osmo_timer_list sensor_ctrl_timer; static const struct value_string state_names[] = { { STATE_NORMAL, "NORMAL" }, @@ -44,12 +47,12 @@ { 0, NULL } }; -const char *lc15bts_mgr_temp_get_state(enum lc15bts_temp_state state) +const char *lc15bts_mgr_sensor_get_state(enum lc15bts_sensor_state state) { return get_value_string(state_names, state); } -static int next_state(enum lc15bts_temp_state current_state, int critical, int warning) +static int next_state(enum lc15bts_sensor_state current_state, int critical, int warning) { int next_state = -1; switch (current_state) { @@ -85,7 +88,7 @@ static void handle_normal_actions(int actions) { /* switch on the PA */ - if (actions & TEMP_ACT_NORM_PA0_ON) { + if (actions & SENSOR_ACT_NORM_PA0_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA0, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch on the PA #0\n"); @@ -95,7 +98,7 @@ } } - if (actions & TEMP_ACT_NORM_PA1_ON) { + if (actions & SENSOR_ACT_NORM_PA1_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch on the PA #1\n"); @@ -105,7 +108,7 @@ } } - if (actions & TEMP_ACT_NORM_BTS_SRV_ON) { + if (actions & SENSOR_ACT_NORM_BTS_SRV_ON) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch on the BTS service\n"); /* @@ -120,7 +123,7 @@ static void handle_actions(int actions) { /* switch off the PA */ - if (actions & TEMP_ACT_PA1_OFF) { + if (actions & SENSOR_ACT_PA1_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch off the PA #1. Stop BTS?\n"); @@ -130,7 +133,7 @@ } } - if (actions & TEMP_ACT_PA0_OFF) { + if (actions & SENSOR_ACT_PA0_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA0, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch off the PA #0. Stop BTS?\n"); @@ -140,7 +143,7 @@ } } - if (actions & TEMP_ACT_BTS_SRV_OFF) { + if (actions & SENSOR_ACT_BTS_SRV_OFF) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch off the BTS service\n"); /* @@ -161,36 +164,36 @@ */ static void execute_normal_act(struct lc15bts_mgr_instance *manager) { - LOGP(DTEMP, LOGL_NOTICE, "System is back to normal temperature.\n"); - handle_normal_actions(manager->temp.action_norm); + LOGP(DTEMP, LOGL_NOTICE, "System is back to normal state.\n"); + handle_normal_actions(manager->state.action_norm); } static void execute_warning_act(struct lc15bts_mgr_instance *manager) { - LOGP(DTEMP, LOGL_NOTICE, "System has reached temperature warning.\n"); - handle_actions(manager->temp.action_warn); + LOGP(DTEMP, LOGL_NOTICE, "System has reached warning state.\n"); + handle_actions(manager->state.action_warn); } static void execute_critical_act(struct lc15bts_mgr_instance *manager) { LOGP(DTEMP, LOGL_NOTICE, "System has reached critical warning.\n"); - handle_actions(manager->temp.action_crit); + handle_actions(manager->state.action_crit); } -static void lc15bts_mgr_temp_handle(struct lc15bts_mgr_instance *manager, +static void lc15bts_mgr_sensor_handle(struct lc15bts_mgr_instance *manager, int critical, int warning) { - int new_state = next_state(manager->temp.state, critical, warning); + int new_state = next_state(manager->state.state, critical, warning); /* Nothing changed */ if (new_state < 0) return; LOGP(DTEMP, LOGL_NOTICE, "Moving from state %s to %s.\n", - get_value_string(state_names, manager->temp.state), + get_value_string(state_names, manager->state.state), get_value_string(state_names, new_state)); - manager->temp.state = new_state; - switch (manager->temp.state) { + manager->state.state = new_state; + switch (manager->state.state) { case STATE_NORMAL: execute_normal_act(manager); break; @@ -206,163 +209,168 @@ }; } -static void temp_ctrl_check() +static void sensor_ctrl_check(struct lc15bts_mgr_instance *mgr) { int rc; + int temp = 0; int warn_thresh_passed = 0; int crit_thresh_passed = 0; LOGP(DTEMP, LOGL_DEBUG, "Going to check the temperature.\n"); /* Read the current supply temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY); + rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the supply temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.supply_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.supply_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.supply_limit.thresh_crit) + if (temp > mgr->temp.supply_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "Supply temperature is: %d\n", temp); } /* Read the current SoC temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SOC); + rc = lc15bts_temp_get(LC15BTS_TEMP_SOC, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the SoC temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.soc_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.soc_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.soc_limit.thresh_crit) + if (temp > mgr->temp.soc_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "SoC temperature is: %d\n", temp); } /* Read the current fpga temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA); + rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the fpga temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.fpga_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.fpga_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.fpga_limit.thresh_crit) + if (temp > mgr->temp.fpga_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "FPGA temperature is: %d\n", temp); } - /* Read the current RF log detector temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_LOGRF); + /* Read the current RMS detector temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_RMSDET, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the RF log detector temperature. rc=%d\n", rc); + "Failed to read the RMS detector temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.logrf_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.rmsdet_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.logrf_limit.thresh_crit) + if (temp > mgr->temp.rmsdet_temp_limit.thresh_crit_max) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "RF log detector temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "RMS detector temperature is: %d\n", temp); } /* Read the current OCXO temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO); + rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the OCXO temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.ocxo_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.ocxo_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.ocxo_limit.thresh_crit) + if (temp > mgr->temp.ocxo_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "OCXO temperature is: %d\n", temp); } - /* Read the current TX #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX0); + /* Read the current TX #0 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX0, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.tx0_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.tx0_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx0_limit.thresh_crit) + if (temp > mgr->temp.tx0_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "TX #0 temperature is: %d\n", temp); } - /* Read the current TX #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX1); + /* Read the current TX #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX1, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #1 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.tx1_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.tx1_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx1_limit.thresh_crit) + if (temp > mgr->temp.tx1_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "TX #1 temperature is: %d\n", temp); } - /* Read the current PA #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA0); + /* Read the current PA #0 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA0, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa0_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.pa0_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa0_limit.thresh_crit) + if (temp > mgr->temp.pa0_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #0 temperature is: %d\n", temp); } - /* Read the current PA #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA1); + /* Read the current PA #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA1, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #1 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa1_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.pa1_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa1_limit.thresh_crit) + if (temp > mgr->temp.pa1_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #1 temperature is: %d\n", temp); } - lc15bts_mgr_temp_handle(s_mgr, crit_thresh_passed, warn_thresh_passed); + lc15bts_mgr_sensor_handle(mgr, crit_thresh_passed, warn_thresh_passed); } -static void temp_ctrl_check_cb(void *unused) +static void sensor_ctrl_check_cb(void *_data) { - temp_ctrl_check(); - /* Check every two minutes? XXX make it configurable! */ - osmo_timer_schedule(&temp_ctrl_timer, 2 * 60, 0); + struct lc15bts_mgr_instance *mgr = _data; + sensor_ctrl_check(mgr); + /* Check every minute? XXX make it configurable! */ + osmo_timer_schedule(&sensor_ctrl_timer, LC15BTS_SENSOR_TIMER_DURATION, 0); + LOGP(DTEMP, LOGL_DEBUG,"Check sensors timer expired\n"); + /* TODO: do we want to notify if some sensors could not be read? */ } -int lc15bts_mgr_temp_init(struct lc15bts_mgr_instance *mgr) +int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr) { s_mgr = mgr; - temp_ctrl_timer.cb = temp_ctrl_check_cb; - temp_ctrl_check_cb(NULL); + sensor_ctrl_timer.cb = sensor_ctrl_check_cb; + sensor_ctrl_timer.data = s_mgr; + sensor_ctrl_check_cb(s_mgr); return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index 280c9c7..b96349e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -43,6 +44,7 @@ #include "lc15bts_mgr.h" #include "lc15bts_temp.h" #include "lc15bts_power.h" +#include "lc15bts_led.h" #include "btsconfig.h" static struct lc15bts_mgr_instance *s_mgr; @@ -64,15 +66,21 @@ case ACT_NORM_NODE: case ACT_WARN_NODE: case ACT_CRIT_NODE: - case LIMIT_SUPPLY_NODE: + case LIMIT_SUPPLY_TEMP_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_LOGRF_NODE: + case LIMIT_RMSDET_NODE: case LIMIT_OCXO_NODE: - case LIMIT_TX0_NODE: - case LIMIT_TX1_NODE: - case LIMIT_PA0_NODE: - case LIMIT_PA1_NODE: + case LIMIT_TX0_TEMP_NODE: + case LIMIT_TX1_TEMP_NODE: + case LIMIT_PA0_TEMP_NODE: + case LIMIT_PA1_TEMP_NODE: + case LIMIT_SUPPLY_VOLT_NODE: + case LIMIT_TX0_VSWR_NODE: + case LIMIT_TX1_VSWR_NODE: + case LIMIT_SUPPLY_PWR_NODE: + case LIMIT_PA0_PWR_NODE: + case LIMIT_PA1_PWR_NODE: vty->node = MGR_NODE; break; default: @@ -88,15 +96,21 @@ case ACT_NORM_NODE: case ACT_WARN_NODE: case ACT_CRIT_NODE: - case LIMIT_SUPPLY_NODE: + case LIMIT_SUPPLY_TEMP_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_LOGRF_NODE: + case LIMIT_RMSDET_NODE: case LIMIT_OCXO_NODE: - case LIMIT_TX0_NODE: - case LIMIT_TX1_NODE: - case LIMIT_PA0_NODE: - case LIMIT_PA1_NODE: + case LIMIT_TX0_TEMP_NODE: + case LIMIT_TX1_TEMP_NODE: + case LIMIT_PA0_TEMP_NODE: + case LIMIT_PA1_TEMP_NODE: + case LIMIT_SUPPLY_VOLT_NODE: + case LIMIT_TX0_VSWR_NODE: + case LIMIT_TX1_VSWR_NODE: + case LIMIT_SUPPLY_PWR_NODE: + case LIMIT_PA0_PWR_NODE: + case LIMIT_PA1_PWR_NODE: return 1; default: return 0; @@ -122,25 +136,25 @@ static struct cmd_node act_norm_node = { ACT_NORM_NODE, - "%s(action-normal)# ", + "%s(actions-normal)# ", 1, }; static struct cmd_node act_warn_node = { ACT_WARN_NODE, - "%s(action-warn)# ", + "%s(actions-warn)# ", 1, }; static struct cmd_node act_crit_node = { ACT_CRIT_NODE, - "%s(action-critical)# ", + "%s(actions-critical)# ", 1, }; -static struct cmd_node limit_supply_node = { - LIMIT_SUPPLY_NODE, - "%s(limit-supply)# ", +static struct cmd_node limit_supply_temp_node = { + LIMIT_SUPPLY_TEMP_NODE, + "%s(limit-supply-temp)# ", 1, }; @@ -156,9 +170,9 @@ 1, }; -static struct cmd_node limit_logrf_node = { - LIMIT_LOGRF_NODE, - "%s(limit-logrf)# ", +static struct cmd_node limit_rmsdet_node = { + LIMIT_RMSDET_NODE, + "%s(limit-rmsdet)# ", 1, }; @@ -168,24 +182,60 @@ 1, }; -static struct cmd_node limit_tx0_node = { - LIMIT_TX0_NODE, - "%s(limit-tx0)# ", +static struct cmd_node limit_tx0_temp_node = { + LIMIT_TX0_TEMP_NODE, + "%s(limit-tx0-temp)# ", 1, }; -static struct cmd_node limit_tx1_node = { - LIMIT_TX1_NODE, - "%s(limit-tx1)# ", +static struct cmd_node limit_tx1_temp_node = { + LIMIT_TX1_TEMP_NODE, + "%s(limit-tx1-temp)# ", 1, }; -static struct cmd_node limit_pa0_node = { - LIMIT_PA0_NODE, - "%s(limit-pa0)# ", +static struct cmd_node limit_pa0_temp_node = { + LIMIT_PA0_TEMP_NODE, + "%s(limit-pa0-temp)# ", 1, }; -static struct cmd_node limit_pa1_node = { - LIMIT_PA1_NODE, - "%s(limit-pa1)# ", +static struct cmd_node limit_pa1_temp_node = { + LIMIT_PA1_TEMP_NODE, + "%s(limit-pa1-temp)# ", + 1, +}; +static struct cmd_node limit_supply_volt_node = { + LIMIT_SUPPLY_VOLT_NODE, + "%s(limit-supply-volt)# ", + 1, +}; +static struct cmd_node limit_tx0_vswr_node = { + LIMIT_TX0_VSWR_NODE, + "%s(limit-tx0-vswr)# ", + 1, +}; +static struct cmd_node limit_tx1_vswr_node = { + LIMIT_TX1_VSWR_NODE, + "%s(limit-tx1-vswr)# ", + 1, +}; +static struct cmd_node limit_supply_pwr_node = { + LIMIT_SUPPLY_PWR_NODE, + "%s(limit-supply-pwr)# ", + 1, +}; +static struct cmd_node limit_pa0_pwr_node = { + LIMIT_PA0_PWR_NODE, + "%s(limit-pa0-pwr)# ", + 1, +}; +static struct cmd_node limit_pa1_pwr_node = { + LIMIT_PA1_PWR_NODE, + "%s(limit-pa1-pwr)# ", + 1, +}; + +static struct cmd_node limit_gps_fix_node = { + LIMIT_GPS_FIX_NODE, + "%s(limit-gps-fix)# ", 1, }; @@ -197,55 +247,68 @@ return CMD_SUCCESS; } -static void write_temp_limit(struct vty *vty, const char *name, - struct lc15bts_temp_limit *limit) +static void write_volt_limit(struct vty *vty, const char *name, + struct lc15bts_volt_limit *limit) { vty_out(vty, " %s%s", name, VTY_NEWLINE); - vty_out(vty, " threshold warning %d%s", - limit->thresh_warn, VTY_NEWLINE); - vty_out(vty, " threshold critical %d%s", - limit->thresh_crit, VTY_NEWLINE); + vty_out(vty, " threshold warning min %d%s", + limit->thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " threshold critical min %d%s", + limit->thresh_crit_min, VTY_NEWLINE); +} + +static void write_vswr_limit(struct vty *vty, const char *name, + struct lc15bts_vswr_limit *limit) +{ + vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " threshold warning max %d%s", + limit->thresh_warn_max, VTY_NEWLINE); +} + +static void write_pwr_limit(struct vty *vty, const char *name, + struct lc15bts_pwr_limit *limit) +{ + vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " threshold warning max %d%s", + limit->thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " threshold critical max %d%s", + limit->thresh_crit_max, VTY_NEWLINE); } static void write_norm_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); vty_out(vty, " %spa0-on%s", - (actions & TEMP_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-on%s", - (actions & TEMP_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-on%s", - (actions & TEMP_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); } static void write_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); vty_out(vty, " %spa0-off%s", - (actions & TEMP_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-off%s", - (actions & TEMP_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-off%s", - (actions & TEMP_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); } static int config_write_mgr(struct vty *vty) { vty_out(vty, "lc15bts-mgr%s", VTY_NEWLINE); - write_temp_limit(vty, "limits supply", &s_mgr->temp.supply_limit); - write_temp_limit(vty, "limits soc", &s_mgr->temp.soc_limit); - write_temp_limit(vty, "limits fpga", &s_mgr->temp.fpga_limit); - write_temp_limit(vty, "limits logrf", &s_mgr->temp.logrf_limit); - write_temp_limit(vty, "limits ocxo", &s_mgr->temp.ocxo_limit); - write_temp_limit(vty, "limits tx0", &s_mgr->temp.tx0_limit); - write_temp_limit(vty, "limits tx1", &s_mgr->temp.tx1_limit); - write_temp_limit(vty, "limits pa0", &s_mgr->temp.pa0_limit); - write_temp_limit(vty, "limits pa1", &s_mgr->temp.pa1_limit); + write_volt_limit(vty, "limits supply_volt", &s_mgr->volt.supply_volt_limit); + write_pwr_limit(vty, "limits supply_pwr", &s_mgr->pwr.supply_pwr_limit); + write_vswr_limit(vty, "limits tx0_vswr", &s_mgr->vswr.tx0_vswr_limit); + write_vswr_limit(vty, "limits tx1_vswr", &s_mgr->vswr.tx1_vswr_limit); - write_norm_action(vty, "actions normal", s_mgr->temp.action_norm); - write_action(vty, "actions warn", s_mgr->temp.action_warn); - write_action(vty, "actions critical", s_mgr->temp.action_crit); + write_norm_action(vty, "actions normal", s_mgr->state.action_norm); + write_action(vty, "actions warn", s_mgr->state.action_warn); + write_action(vty, "actions critical", s_mgr->state.action_crit); return CMD_SUCCESS; } @@ -255,7 +318,7 @@ return CMD_SUCCESS; } -#define CFG_LIMIT(name, expl, switch_to, variable) \ +#define CFG_LIMIT_TEMP(name, expl, switch_to, variable) \ DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ "limits " #name, \ "Configure Limits\n" expl) \ @@ -265,32 +328,123 @@ return CMD_SUCCESS; \ } -CFG_LIMIT(supply, "SUPPLY\n", LIMIT_SUPPLY_NODE, supply_limit) -CFG_LIMIT(soc, "SOC\n", LIMIT_SOC_NODE, soc_limit) -CFG_LIMIT(fpga, "FPGA\n", LIMIT_FPGA_NODE, fpga_limit) -CFG_LIMIT(logrf, "LOGRF\n", LIMIT_LOGRF_NODE, logrf_limit) -CFG_LIMIT(ocxo, "OCXO\n", LIMIT_OCXO_NODE, ocxo_limit) -CFG_LIMIT(tx0, "TX0\n", LIMIT_TX0_NODE, tx0_limit) -CFG_LIMIT(tx1, "TX1\n", LIMIT_TX1_NODE, tx1_limit) -CFG_LIMIT(pa0, "PA0\n", LIMIT_PA0_NODE, pa0_limit) -CFG_LIMIT(pa1, "PA1\n", LIMIT_PA1_NODE, pa1_limit) -#undef CFG_LIMIT +CFG_LIMIT_TEMP(supply_temp, "SUPPLY TEMP\n", LIMIT_SUPPLY_TEMP_NODE, supply_temp_limit) +CFG_LIMIT_TEMP(soc_temp, "SOC TEMP\n", LIMIT_SOC_NODE, soc_temp_limit) +CFG_LIMIT_TEMP(fpga_temp, "FPGA TEMP\n", LIMIT_FPGA_NODE, fpga_temp_limit) +CFG_LIMIT_TEMP(rmsdet_temp, "RMSDET TEMP\n", LIMIT_RMSDET_NODE, rmsdet_temp_limit) +CFG_LIMIT_TEMP(ocxo_temp, "OCXO TEMP\n", LIMIT_OCXO_NODE, ocxo_temp_limit) +CFG_LIMIT_TEMP(tx0_temp, "TX0 TEMP\n", LIMIT_TX0_TEMP_NODE, tx0_temp_limit) +CFG_LIMIT_TEMP(tx1_temp, "TX1 TEMP\n", LIMIT_TX1_TEMP_NODE, tx1_temp_limit) +CFG_LIMIT_TEMP(pa0_temp, "PA0 TEMP\n", LIMIT_PA0_TEMP_NODE, pa0_temp_limit) +CFG_LIMIT_TEMP(pa1_temp, "PA1 TEMP\n", LIMIT_PA1_TEMP_NODE, pa1_temp_limit) +#undef CFG_LIMIT_TEMP -DEFUN(cfg_limit_warning, cfg_thresh_warning_cmd, - "threshold warning <0-200>", +#define CFG_LIMIT_VOLT(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->volt.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_VOLT(supply_volt, "SUPPLY VOLT\n", LIMIT_SUPPLY_VOLT_NODE, supply_volt_limit) +#undef CFG_LIMIT_VOLT + +#define CFG_LIMIT_VSWR(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->vswr.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_VSWR(tx0_vswr, "TX0 VSWR\n", LIMIT_TX0_VSWR_NODE, tx0_vswr_limit) +CFG_LIMIT_VSWR(tx1_vswr, "TX1 VSWR\n", LIMIT_TX1_VSWR_NODE, tx1_vswr_limit) +#undef CFG_LIMIT_VSWR + +#define CFG_LIMIT_PWR(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->pwr.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_PWR(supply_pwr, "SUPPLY PWR\n", LIMIT_SUPPLY_PWR_NODE, supply_pwr_limit) +CFG_LIMIT_PWR(pa0_pwr, "PA0 PWR\n", LIMIT_PA0_PWR_NODE, pa0_pwr_limit) +CFG_LIMIT_PWR(pa1_pwr, "PA1 PWR\n", LIMIT_PA1_PWR_NODE, pa1_pwr_limit) +#undef CFG_LIMIT_PWR + +#define CFG_LIMIT_GPS_FIX(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->gps.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_GPS_FIX(gps_fix, "GPS FIX\n", LIMIT_GPS_FIX_NODE, gps_fix_limit) +#undef CFG_LIMIT_GPS_FIX + +DEFUN(cfg_limit_volt_warn_min, cfg_thresh_volt_warn_min_cmd, + "threshold warning min <0-48000>", "Threshold to reach\n" "Warning level\n" "Range\n") { - struct lc15bts_temp_limit *limit = vty->index; - limit->thresh_warn = atoi(argv[0]); + struct lc15bts_volt_limit *limit = vty->index; + limit->thresh_warn_min = atoi(argv[0]); return CMD_SUCCESS; } -DEFUN(cfg_limit_crit, cfg_thresh_crit_cmd, - "threshold critical <0-200>", - "Threshold to reach\n" "Severe level\n" "Range\n") +DEFUN(cfg_limit_volt_crit_min, cfg_thresh_volt_crit_min_cmd, + "threshold critical min <0-48000>", + "Threshold to reach\n" "Critical level\n" "Range\n") { - struct lc15bts_temp_limit *limit = vty->index; - limit->thresh_crit = atoi(argv[0]); + struct lc15bts_volt_limit *limit = vty->index; + limit->thresh_crit_min = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_vswr_warn_max, cfg_thresh_vswr_warn_max_cmd, + "threshold warning max <1000-200000>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_vswr_limit *limit = vty->index; + limit->thresh_warn_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_vswr_crit_max, cfg_thresh_vswr_crit_max_cmd, + "threshold critical max <1000-200000>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_vswr_limit *limit = vty->index; + limit->thresh_crit_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_pwr_warn_max, cfg_thresh_pwr_warn_max_cmd, + "threshold warning max <0-200>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_pwr_limit *limit = vty->index; + limit->thresh_warn_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_pwr_crit_max, cfg_thresh_pwr_crit_max_cmd, + "threshold critical max <0-200>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_pwr_limit *limit = vty->index; + limit->thresh_crit_max = atoi(argv[0]); return CMD_SUCCESS; } @@ -300,7 +454,7 @@ "Configure Actions\n" expl) \ { \ vty->node = switch_to; \ - vty->index = &s_mgr->temp.variable; \ + vty->index = &s_mgr->state.variable; \ return CMD_SUCCESS; \ } CFG_ACTION(normal, "Normal Actions\n", ACT_NORM_NODE, action_norm) @@ -313,7 +467,7 @@ "Switch the Power Amplifier #0 on\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_PA0_ON; + *action |= SENSOR_ACT_NORM_PA0_ON; return CMD_SUCCESS; } @@ -322,7 +476,7 @@ NO_STR "Switch the Power Amplifieri #0 on\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA0_ON; + *action &= ~SENSOR_ACT_NORM_PA0_ON; return CMD_SUCCESS; } @@ -331,7 +485,7 @@ "Switch the Power Amplifier #1 on\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_PA1_ON; + *action |= SENSOR_ACT_NORM_PA1_ON; return CMD_SUCCESS; } @@ -340,7 +494,7 @@ NO_STR "Switch the Power Amplifieri #1 on\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA1_ON; + *action &= ~SENSOR_ACT_NORM_PA1_ON; return CMD_SUCCESS; } @@ -349,7 +503,7 @@ "Start the systemd lc15bts.service\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_BTS_SRV_ON; + *action |= SENSOR_ACT_NORM_BTS_SRV_ON; return CMD_SUCCESS; } @@ -358,7 +512,7 @@ NO_STR "Start the systemd lc15bts.service\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_BTS_SRV_ON; + *action &= ~SENSOR_ACT_NORM_BTS_SRV_ON; return CMD_SUCCESS; } @@ -367,7 +521,7 @@ "Switch the Power Amplifier #0 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA0_OFF; + *action |= SENSOR_ACT_PA0_OFF; return CMD_SUCCESS; } @@ -376,7 +530,7 @@ NO_STR "Do not switch off the Power Amplifier #0\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA0_OFF; + *action &= ~SENSOR_ACT_PA0_OFF; return CMD_SUCCESS; } @@ -385,7 +539,7 @@ "Switch the Power Amplifier #1 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA1_OFF; + *action |= SENSOR_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -394,7 +548,7 @@ NO_STR "Do not switch off the Power Amplifier #1\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA1_OFF; + *action &= ~SENSOR_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -403,7 +557,7 @@ "Stop the systemd lc15bts.service\n") { int *action = vty->index; - *action |= TEMP_ACT_BTS_SRV_OFF; + *action |= SENSOR_ACT_BTS_SRV_OFF; return CMD_SUCCESS; } @@ -412,71 +566,173 @@ NO_STR "Stop the systemd lc15bts.service\n") { int *action = vty->index; - *action &= ~TEMP_ACT_BTS_SRV_OFF; + *action &= ~SENSOR_ACT_BTS_SRV_OFF; return CMD_SUCCESS; } DEFUN(show_mgr, show_mgr_cmd, "show manager", SHOW_STR "Display information about the manager") { + int temp, volt, current, power, vswr; + vty_out(vty, "Warning alarm flags: 0x%08x%s", + s_mgr->lc15bts_ctrl.warn_flags, VTY_NEWLINE); + vty_out(vty, "Critical alarm flags: 0x%08x%s", + s_mgr->lc15bts_ctrl.crit_flags, VTY_NEWLINE); + vty_out(vty, "Preventive action retried: %d%s", + s_mgr->alarms.preventive_retry, VTY_NEWLINE); vty_out(vty, "Temperature control state: %s%s", - lc15bts_mgr_temp_get_state(s_mgr->temp.state), VTY_NEWLINE); + lc15bts_mgr_sensor_get_state(s_mgr->state.state), VTY_NEWLINE); vty_out(vty, "Current Temperatures%s", VTY_NEWLINE); - vty_out(vty, " Main Supply : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SUPPLY) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, &temp); + vty_out(vty, " Main Supply : %4.2f Celcius%s", + temp/ 1000.0f, VTY_NEWLINE); - vty_out(vty, " SoC : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SOC) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SOC, &temp); + vty_out(vty, " SoC : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " FPGA : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_FPGA) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_FPGA, &temp); + vty_out(vty, " FPGA : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " LogRF : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_LOGRF) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_RMSDET, &temp); + vty_out(vty, " RMSDet : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " OCXO : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_OCXO) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_OCXO, &temp); + vty_out(vty, " OCXO : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 0 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX0) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX0, &temp); + vty_out(vty, " TX 0 : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 1 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX1) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX1, &temp); + vty_out(vty, " TX 1 : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Power Amp #0: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA0) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA0, &temp); + vty_out(vty, " Power Amp #0: %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Power Amp #1: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA1) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA1, &temp); + vty_out(vty, " Power Amp #1: %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); vty_out(vty, "Power Status%s", VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Main Supply : ON [%6.2f Vdc, %4.2f A, %6.2f W]%s", - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Power Amp #0: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_get(LC15BTS_POWER_PA0) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Power Amp #1: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_get(LC15BTS_POWER_PA1) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + vty_out(vty, "VSWR Status%s", VTY_NEWLINE); + lc15bts_vswr_get(LC15BTS_VSWR_TX0, &vswr); + vty_out(vty, " VSWR TX 0: %f %s", + vswr / 1000.0f, + VTY_NEWLINE); + lc15bts_vswr_get(LC15BTS_VSWR_TX1, &vswr); + vty_out(vty, " VSWR TX 1: %f %s", + vswr / 1000.0f, + VTY_NEWLINE); + + return CMD_SUCCESS; +} + +DEFUN(show_thresh, show_thresh_cmd, "show thresholds", + SHOW_STR "Display information about the thresholds") +{ + vty_out(vty, "Temperature limits (Celsius)%s", VTY_NEWLINE); + vty_out(vty, " Main supply%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.supply_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.supply_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.supply_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " SoC%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.soc_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.soc_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.soc_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " FPGA%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.fpga_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.fpga_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.fpga_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " RMSDet%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " OCXO%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " TX0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.tx0_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.tx0_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.tx0_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " TX1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.tx1_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.tx1_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.tx1_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " PA0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.pa0_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.pa0_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.pa0_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " PA1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.pa1_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.pa1_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.pa1_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, "Power limits%s", VTY_NEWLINE); + vty_out(vty, " Main supply (mV)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->volt.supply_volt_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->volt.supply_volt_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->volt.supply_volt_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " Critical min : %d%s",s_mgr->volt.supply_volt_limit.thresh_crit_min, VTY_NEWLINE); + vty_out(vty, " Main supply power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.supply_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.supply_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " PA0 power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.pa0_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.pa0_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " PA1 power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.pa1_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.pa1_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, "VSWR limits%s", VTY_NEWLINE); + vty_out(vty, " TX0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->vswr.tx0_vswr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->vswr.tx0_vswr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " TX1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->vswr.tx1_vswr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->vswr.tx1_vswr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, "Days since last GPS 3D fix%s", VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->gps.gps_fix_limit.thresh_warn_max, VTY_NEWLINE); return CMD_SUCCESS; } @@ -493,10 +749,153 @@ return CMD_SUCCESS; } -static void register_limit(int limit) +DEFUN(set_led_pattern, set_led_pattern_cmd, + "set led pattern <0-255>", + "Set LED pattern\n" + "Set LED pattern for debugging purpose only. This pattern will be overridden after 60 seconds by LED pattern of actual system state\n") { - install_element(limit, &cfg_thresh_warning_cmd); - install_element(limit, &cfg_thresh_crit_cmd); + int pattern_id = atoi(argv[0]); + + if ((pattern_id < 0) || (pattern_id > BLINK_PATTERN_MAX_ITEM)) { + vty_out(vty, "%%Invalid LED pattern ID. It must be in range of %d..%d %s", 0, BLINK_PATTERN_MAX_ITEM - 1, VTY_NEWLINE); + return CMD_WARNING; + } + + led_set(s_mgr, pattern_id); + return CMD_SUCCESS; +} + +DEFUN(force_mgr_state, force_mgr_state_cmd, + "force manager state <0-255>", + "Force BTS manager state\n" + "Force BTS manager state for debugging purpose only\n") +{ + int state = atoi(argv[0]); + + if ((state < 0) || (state > STATE_CRITICAL)) { + vty_out(vty, "%%Invalid BTS manager state. It must be in range of %d..%d %s", 0, STATE_CRITICAL, VTY_NEWLINE); + return CMD_WARNING; + } + + s_mgr->state.state = state; + return CMD_SUCCESS; +} + +#define LIMIT_TEMP(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_temp_##name##_##variable, limit_temp_##name##_##variable##_cmd, \ + "limit temp " #name " " #criticity " " #min_max " <-200-200>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->temp.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_warn_min, warning, min) +#undef LIMIT_TEMP + +#define LIMIT_VOLT(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_volt_##name##_##variable, limit_volt_##name##_##variable##_cmd, \ + "limit " #name " " #criticity " " #min_max " <0-48000>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->volt.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_warn_max, warning, max) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_crit_max, critical, max) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_warn_min, warning, min) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_crit_min, critical, min) +#undef LIMIT_VOLT + +#define LIMIT_PWR(name, limit, expl, variable, criticity, min_max) \ + DEFUN(limit_pwr_##name##_##variable, limit_pwr_##name##_##variable##_cmd, \ + "limit power " #name " " #criticity " " #min_max " <0-200>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->pwr.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_PWR(supply, supply_pwr_limit, "SUPPLY PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(supply, supply_pwr_limit, "SUPPLY PWR\n", thresh_crit_max, critical, max) +LIMIT_PWR(pa0, pa0_pwr_limit, "PA0 PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(pa0, pa0_pwr_limit, "PA0 PWR\n", thresh_crit_max, critical, max) +LIMIT_PWR(pa1, pa1_pwr_limit, "PA1 PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(pa1, pa1_pwr_limit, "PA1 PWR\n", thresh_crit_max, critical, max) +#undef LIMIT_PWR + +#define LIMIT_VSWR(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_vswr_##name##_##variable, limit_vswr_##name##_##variable##_cmd, \ + "limit vswr " #name " " #criticity " " #min_max " <1000-200000>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->vswr.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_VSWR(tx0, tx0_vswr_limit, "TX0 VSWR\n", thresh_warn_max, warning, max) +LIMIT_VSWR(tx0, tx0_vswr_limit, "TX0 VSWR\n", thresh_crit_max, critical, max) +LIMIT_VSWR(tx1, tx1_vswr_limit, "TX1 VSWR\n", thresh_warn_max, warning, max) +LIMIT_VSWR(tx1, tx1_vswr_limit, "TX1 VSWR\n", thresh_crit_max, critical, max) +#undef LIMIT_VSWR + +#define LIMIT_GPSFIX(limit, expl, variable, criticity, min_max) \ +DEFUN(limit_gpsfix_##variable, limit_gpsfix_##variable##_cmd, \ + "limit gpsfix " #criticity " " #min_max " <0-365>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->gps.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_GPSFIX(gps_fix_limit, "GPS FIX\n", thresh_warn_max, warning, max) +#undef LIMIT_GPSFIX + +static void register_limit(int limit, uint32_t unit) +{ + switch (unit) { + case MGR_LIMIT_TYPE_VOLT: + install_element(limit, &cfg_thresh_volt_warn_min_cmd); + install_element(limit, &cfg_thresh_volt_crit_min_cmd); + break; + case MGR_LIMIT_TYPE_VSWR: + install_element(limit, &cfg_thresh_vswr_warn_max_cmd); + install_element(limit, &cfg_thresh_vswr_crit_max_cmd); + break; + case MGR_LIMIT_TYPE_PWR: + install_element(limit, &cfg_thresh_pwr_warn_max_cmd); + install_element(limit, &cfg_thresh_pwr_crit_max_cmd); + break; + default: + break; + } } static void register_normal_action(int act) @@ -519,11 +918,62 @@ install_element(act, &cfg_no_action_bts_srv_off_cmd); } +static void register_hidden_commands() +{ + install_element(ENABLE_NODE, &limit_temp_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_supply_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_warn_min_cmd); + + install_element(ENABLE_NODE, &limit_volt_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_crit_min_cmd); + + install_element(ENABLE_NODE, &limit_pwr_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa1_thresh_crit_max_cmd); + + install_element(ENABLE_NODE, &limit_vswr_tx0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx1_thresh_crit_max_cmd); + + install_element(ENABLE_NODE, &limit_gpsfix_thresh_warn_max_cmd); +} + int lc15bts_mgr_vty_init(void) { vty_init(&vty_info); install_element_ve(&show_mgr_cmd); + install_element_ve(&show_thresh_cmd); install_element(ENABLE_NODE, &calibrate_clock_cmd); @@ -532,50 +982,73 @@ vty_install_default(MGR_NODE); /* install the limit nodes */ - install_node(&limit_supply_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_supply_cmd); - register_limit(LIMIT_SUPPLY_NODE); - vty_install_default(LIMIT_SUPPLY_NODE); + install_node(&limit_supply_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_temp_cmd); + vty_install_default(LIMIT_SUPPLY_TEMP_NODE); install_node(&limit_soc_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_soc_cmd); - register_limit(LIMIT_SOC_NODE); + install_element(MGR_NODE, &cfg_limit_soc_temp_cmd); vty_install_default(LIMIT_SOC_NODE); install_node(&limit_fpga_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_fpga_cmd); - register_limit(LIMIT_FPGA_NODE); + install_element(MGR_NODE, &cfg_limit_fpga_temp_cmd); vty_install_default(LIMIT_FPGA_NODE); - install_node(&limit_logrf_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_logrf_cmd); - register_limit(LIMIT_LOGRF_NODE); - vty_install_default(LIMIT_LOGRF_NODE); + install_node(&limit_rmsdet_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_rmsdet_temp_cmd); + vty_install_default(LIMIT_RMSDET_NODE); install_node(&limit_ocxo_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_ocxo_cmd); - register_limit(LIMIT_OCXO_NODE); + install_element(MGR_NODE, &cfg_limit_ocxo_temp_cmd); vty_install_default(LIMIT_OCXO_NODE); - install_node(&limit_tx0_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx0_cmd); - register_limit(LIMIT_TX0_NODE); - vty_install_default(LIMIT_TX0_NODE); + install_node(&limit_tx0_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_temp_cmd); + vty_install_default(LIMIT_TX0_TEMP_NODE); - install_node(&limit_tx1_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx1_cmd); - register_limit(LIMIT_TX1_NODE); - vty_install_default(LIMIT_TX1_NODE); + install_node(&limit_tx1_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx1_temp_cmd); + vty_install_default(LIMIT_TX1_TEMP_NODE); - install_node(&limit_pa0_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa0_cmd); - register_limit(LIMIT_PA0_NODE); - vty_install_default(LIMIT_PA0_NODE); + install_node(&limit_pa0_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_temp_cmd); + vty_install_default(LIMIT_PA0_TEMP_NODE); - install_node(&limit_pa1_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa1_cmd); - register_limit(LIMIT_PA1_NODE); - vty_install_default(LIMIT_PA1_NODE); + install_node(&limit_pa1_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa1_temp_cmd); + vty_install_default(LIMIT_PA1_TEMP_NODE); + + install_node(&limit_supply_volt_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_volt_cmd); + register_limit(LIMIT_SUPPLY_VOLT_NODE, MGR_LIMIT_TYPE_VOLT); + vty_install_default(LIMIT_SUPPLY_VOLT_NODE); + + install_node(&limit_tx0_vswr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_vswr_cmd); + register_limit(LIMIT_TX0_VSWR_NODE, MGR_LIMIT_TYPE_VSWR); + vty_install_default(LIMIT_TX0_VSWR_NODE); + + install_node(&limit_tx1_vswr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx1_vswr_cmd); + register_limit(LIMIT_TX1_VSWR_NODE, MGR_LIMIT_TYPE_VSWR); + vty_install_default(LIMIT_TX1_VSWR_NODE); + + install_node(&limit_supply_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_pwr_cmd); + register_limit(LIMIT_SUPPLY_PWR_NODE, MGR_LIMIT_TYPE_PWR); + vty_install_default(LIMIT_SUPPLY_PWR_NODE); + + install_node(&limit_pa0_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_pwr_cmd); + vty_install_default(LIMIT_PA0_PWR_NODE); + + install_node(&limit_pa1_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa1_pwr_cmd); + vty_install_default(LIMIT_PA1_PWR_NODE); + + install_node(&limit_gps_fix_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_gps_fix_cmd); + vty_install_default(LIMIT_GPS_FIX_NODE); /* install the normal node */ install_node(&act_norm_node, config_write_dummy); @@ -593,6 +1066,12 @@ register_action(ACT_CRIT_NODE); vty_install_default(ACT_CRIT_NODE); + /* install LED pattern command for debugging purpose */ + install_element_ve(&set_led_pattern_cmd); + install_element_ve(&force_mgr_state_cmd); + + register_hidden_commands(); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c index fa59b7c..2cedc5d 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c @@ -41,11 +41,13 @@ #include #include +#include "lc15bts_mgr.h" #include "btsconfig.h" #include "lc15bts_misc.h" #include "lc15bts_par.h" #include "lc15bts_mgr.h" #include "lc15bts_temp.h" +#include "lc15bts_power.h" /********************************************************************* * Temperature handling @@ -58,52 +60,111 @@ enum lc15bts_par ee_par; } temp_data[] = { { - .name = "supply", + .name = "supply_temp", .has_max = 1, .sensor = LC15BTS_TEMP_SUPPLY, .ee_par = LC15BTS_PAR_TEMP_SUPPLY_MAX, }, { - .name = "soc", + .name = "soc_temp", .has_max = 0, .sensor = LC15BTS_TEMP_SOC, .ee_par = LC15BTS_PAR_TEMP_SOC_MAX, }, { - .name = "fpga", + .name = "fpga_temp", .has_max = 0, .sensor = LC15BTS_TEMP_FPGA, .ee_par = LC15BTS_PAR_TEMP_FPGA_MAX, }, { - .name = "logrf", + .name = "rmsdet_temp", .has_max = 1, - .sensor = LC15BTS_TEMP_LOGRF, - .ee_par = LC15BTS_PAR_TEMP_LOGRF_MAX, + .sensor = LC15BTS_TEMP_RMSDET, + .ee_par = LC15BTS_PAR_TEMP_RMSDET_MAX, }, { - .name = "ocxo", + .name = "ocxo_temp", .has_max = 1, .sensor = LC15BTS_TEMP_OCXO, .ee_par = LC15BTS_PAR_TEMP_OCXO_MAX, }, { - .name = "tx0", + .name = "tx0_temp", .has_max = 0, .sensor = LC15BTS_TEMP_TX0, .ee_par = LC15BTS_PAR_TEMP_TX0_MAX, }, { - .name = "tx1", + .name = "tx1_temp", .has_max = 0, .sensor = LC15BTS_TEMP_TX1, .ee_par = LC15BTS_PAR_TEMP_TX1_MAX, }, { - .name = "pa0", + .name = "pa0_temp", .has_max = 1, .sensor = LC15BTS_TEMP_PA0, .ee_par = LC15BTS_PAR_TEMP_PA0_MAX, }, { - .name = "pa1", + .name = "pa1_temp", .has_max = 1, .sensor = LC15BTS_TEMP_PA1, .ee_par = LC15BTS_PAR_TEMP_PA1_MAX, } +}; + +static const struct { + const char *name; + int has_max; + enum lc15bts_power_source sensor_source; + enum lc15bts_power_type sensor_type; + enum lc15bts_par ee_par; +} power_data[] = { + { + .name = "supply_volt", + .has_max = 1, + .sensor_source = LC15BTS_POWER_SUPPLY, + .sensor_type = LC15BTS_POWER_VOLTAGE, + .ee_par = LC15BTS_PAR_VOLT_SUPPLY_MAX, + }, { + .name = "supply_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_SUPPLY, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_SUPPLY_MAX, + }, { + .name = "pa0_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_PA0, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_PA0_MAX, + }, { + .name = "pa1_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_PA1, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_PA1_MAX, + } +}; + +static const struct { + const char *name; + int has_max; + enum lc15bts_vswr_sensor sensor; + enum lc15bts_par ee_par; +} vswr_data[] = { + { + .name = "tx0_vswr", + .has_max = 0, + .sensor = LC15BTS_VSWR_TX0, + .ee_par = LC15BTS_PAR_VSWR_TX0_MAX, + }, { + .name = "tx1_vswr", + .has_max = 0, + .sensor = LC15BTS_VSWR_TX1, + .ee_par = LC15BTS_PAR_VSWR_TX1_MAX, + } +}; + +static const struct value_string power_unit_strs[] = { + { LC15BTS_POWER_POWER, "W" }, + { LC15BTS_POWER_VOLTAGE, "V" }, + { 0, NULL } }; void lc15bts_check_temp(int no_rom_write) @@ -117,7 +178,7 @@ rc = lc15bts_par_get_int(tall_mgr_ctx, temp_data[i].ee_par, &ret); temp_old[i] = ret * 1000; - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor); + lc15bts_temp_get(temp_data[i].sensor, &temp_cur[i]); if (temp_cur[i] < 0 && temp_cur[i] > -1000) { LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d): unexpected value %d\n", temp_data[i].sensor, temp_cur[i]); @@ -143,6 +204,91 @@ } } +void lc15bts_check_power(int no_rom_write) +{ + int power_old[ARRAY_SIZE(power_data)]; + int power_cur[ARRAY_SIZE(power_data)]; + int i, rc; + int div_ratio; + + for (i = 0; i < ARRAY_SIZE(power_data); i++) { + int ret; + rc = lc15bts_par_get_int(tall_mgr_ctx, power_data[i].ee_par, &ret); + switch(power_data[i].sensor_type) { + case LC15BTS_POWER_VOLTAGE: + div_ratio = 1000; + break; + case LC15BTS_POWER_POWER: + div_ratio = 1000000; + break; + default: + div_ratio = 1000; + } + power_old[i] = ret * div_ratio; + + lc15bts_power_sensor_get(power_data[i].sensor_source, power_data[i].sensor_type, &power_cur[i]); + if (power_cur[i] < 0 && power_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading power (%d) (%d)\n", power_data[i].sensor_source, + power_data[i].sensor_type); + continue; + } + LOGP(DTEMP, LOGL_DEBUG, "Current %s power: %d.%d %s\n", + power_data[i].name, power_cur[i]/div_ratio, power_cur[i]%div_ratio, + get_value_string(power_unit_strs, power_data[i].sensor_type)); + + if (power_cur[i] > power_old[i]) { + LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " + "power: %d.%d %s\n", power_data[i].name, + power_cur[i]/div_ratio, power_cur[i]%div_ratio, + get_value_string(power_unit_strs, power_data[i].sensor_type)); + + if (!no_rom_write) { + rc = lc15bts_par_set_int(tall_mgr_ctx, power_data[i].ee_par, power_cur[i]/div_ratio); + if (rc < 0) + LOGP(DTEMP, LOGL_ERROR, "error writing new %s " + "max power %d (%s)\n", power_data[i].name, + rc, strerror(errno)); + } + } + } +} + +void lc15bts_check_vswr(int no_rom_write) +{ + int vswr_old[ARRAY_SIZE(vswr_data)]; + int vswr_cur[ARRAY_SIZE(vswr_data)]; + int i, rc; + + for (i = 0; i < ARRAY_SIZE(vswr_data); i++) { + int ret; + rc = lc15bts_par_get_int(tall_mgr_ctx, vswr_data[i].ee_par, &ret); + vswr_old[i] = ret * 1000; + + lc15bts_vswr_get(vswr_data[i].sensor, &vswr_cur[i]); + if (vswr_cur[i] < 0 && vswr_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading vswr (%d)\n", vswr_data[i].sensor); + continue; + } + + LOGP(DTEMP, LOGL_DEBUG, "Current %s vswr: %d.%d\n", + vswr_data[i].name, vswr_cur[i]/1000, vswr_cur[i]%1000); + + if (vswr_cur[i] > vswr_old[i]) { + LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " + "vswr: %d.%d C\n", vswr_data[i].name, + vswr_cur[i]/1000, vswr_old[i]%1000); + + if (!no_rom_write) { + rc = lc15bts_par_set_int(tall_mgr_ctx, vswr_data[i].ee_par, vswr_cur[i]/1000); + if (rc < 0) + LOGP(DTEMP, LOGL_ERROR, "error writing new %s " + "max vswr %d (%s)\n", vswr_data[i].name, + rc, strerror(errno)); + } + } + } +} + /********************************************************************* * Hours handling *********************************************************************/ diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.h b/src/osmo-bts-litecell15/misc/lc15bts_misc.h index 4c3a862..79e9e68 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.h @@ -4,6 +4,8 @@ #include void lc15bts_check_temp(int no_rom_write); +void lc15bts_check_power(int no_rom_write); +void lc15bts_check_vswr(int no_rom_write); int lc15bts_update_hours(int no_rom_write); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index 13b0080..75314a4 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -43,12 +43,19 @@ { LC15BTS_PAR_TEMP_SUPPLY_MAX, "temp-supply-max" }, { LC15BTS_PAR_TEMP_SOC_MAX, "temp-soc-max" }, { LC15BTS_PAR_TEMP_FPGA_MAX, "temp-fpga-max" }, - { LC15BTS_PAR_TEMP_LOGRF_MAX, "temp-logrf-max" }, + { LC15BTS_PAR_TEMP_RMSDET_MAX, "temp-rmsdet-max" }, { LC15BTS_PAR_TEMP_OCXO_MAX, "temp-ocxo-max" }, { LC15BTS_PAR_TEMP_TX0_MAX, "temp-tx0-max" }, { LC15BTS_PAR_TEMP_TX1_MAX, "temp-tx1-max" }, { LC15BTS_PAR_TEMP_PA0_MAX, "temp-pa0-max" }, { LC15BTS_PAR_TEMP_PA1_MAX, "temp-pa1-max" }, + { LC15BTS_PAR_VOLT_SUPPLY_MAX, "volt-supply-max" }, + { LC15BTS_PAR_PWR_SUPPLY_MAX, "pwr-supply-max" }, + { LC15BTS_PAR_PWR_PA0_MAX, "pwr-pa0-max" }, + { LC15BTS_PAR_PWR_PA1_MAX, "pwr-pa1-max" }, + { LC15BTS_PAR_VSWR_TX0_MAX, "vswr-tx0-max" }, + { LC15BTS_PAR_VSWR_TX1_MAX, "vswr-tx1-max" }, + { LC15BTS_PAR_GPS_FIX, "gps-fix" }, { LC15BTS_PAR_SERNR, "serial-nr" }, { LC15BTS_PAR_HOURS, "hours-running" }, { LC15BTS_PAR_BOOTS, "boot-count" }, @@ -60,17 +67,23 @@ { switch (par) { case LC15BTS_PAR_TEMP_SUPPLY_MAX: - case LC15BTS_PAR_TEMP_SOC_MAX: - case LC15BTS_PAR_TEMP_FPGA_MAX: - case LC15BTS_PAR_TEMP_LOGRF_MAX: - case LC15BTS_PAR_TEMP_OCXO_MAX: - case LC15BTS_PAR_TEMP_TX0_MAX: - case LC15BTS_PAR_TEMP_TX1_MAX: - case LC15BTS_PAR_TEMP_PA0_MAX: - case LC15BTS_PAR_TEMP_PA1_MAX: + case LC15BTS_PAR_TEMP_SOC_MAX: + case LC15BTS_PAR_TEMP_FPGA_MAX: + case LC15BTS_PAR_TEMP_RMSDET_MAX: + case LC15BTS_PAR_TEMP_OCXO_MAX: + case LC15BTS_PAR_TEMP_TX0_MAX: + case LC15BTS_PAR_TEMP_TX1_MAX: + case LC15BTS_PAR_TEMP_PA0_MAX: + case LC15BTS_PAR_TEMP_PA1_MAX: + case LC15BTS_PAR_VOLT_SUPPLY_MAX: + case LC15BTS_PAR_VSWR_TX0_MAX: + case LC15BTS_PAR_VSWR_TX1_MAX: case LC15BTS_PAR_SERNR: case LC15BTS_PAR_HOURS: case LC15BTS_PAR_BOOTS: + case LC15BTS_PAR_PWR_SUPPLY_MAX: + case LC15BTS_PAR_PWR_PA0_MAX: + case LC15BTS_PAR_PWR_PA1_MAX: return 1; default: return 0; @@ -168,3 +181,52 @@ return rc; } + +int lc15bts_par_get_gps_fix(time_t *ret) +{ + char fpath[PATH_MAX]; + FILE *fp; + int rc; + + snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, LC15BTS_PAR_GPS_FIX)); + fpath[sizeof(fpath)-1] = '\0'; + + fp = fopen(fpath, "r"); + if (fp == NULL) { + return -errno; + } + + rc = fscanf(fp, "%lld", (long long *)ret); + if (rc != 1) { + fclose(fp); + return -EIO; + } + fclose(fp); + + return 0; +} + +int lc15bts_par_set_gps_fix(time_t val) +{ + char fpath[PATH_MAX]; + FILE *fp; + int rc; + + snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, LC15BTS_PAR_GPS_FIX)); + fpath[sizeof(fpath)-1] = '\0'; + + fp = fopen(fpath, "w"); + if (fp == NULL) { + return -errno; + } + + rc = fprintf(fp, "%lld", (long long)val); + if (rc < 0) { + fclose(fp); + return -EIO; + } + fsync(fp); + fclose(fp); + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index dd869d3..217ae5f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -10,12 +10,19 @@ LC15BTS_PAR_TEMP_SUPPLY_MAX, LC15BTS_PAR_TEMP_SOC_MAX, LC15BTS_PAR_TEMP_FPGA_MAX, - LC15BTS_PAR_TEMP_LOGRF_MAX, + LC15BTS_PAR_TEMP_RMSDET_MAX, LC15BTS_PAR_TEMP_OCXO_MAX, LC15BTS_PAR_TEMP_TX0_MAX, LC15BTS_PAR_TEMP_TX1_MAX, LC15BTS_PAR_TEMP_PA0_MAX, LC15BTS_PAR_TEMP_PA1_MAX, + LC15BTS_PAR_VOLT_SUPPLY_MAX, + LC15BTS_PAR_PWR_SUPPLY_MAX, + LC15BTS_PAR_PWR_PA0_MAX, + LC15BTS_PAR_PWR_PA1_MAX, + LC15BTS_PAR_VSWR_TX0_MAX, + LC15BTS_PAR_VSWR_TX1_MAX, + LC15BTS_PAR_GPS_FIX, LC15BTS_PAR_SERNR, LC15BTS_PAR_HOURS, LC15BTS_PAR_BOOTS, @@ -31,5 +38,7 @@ int lc15bts_par_set_buf(void *ctx, enum lc15bts_par par, const uint8_t *buf, unsigned int size); int lc15bts_par_is_int(enum lc15bts_par par); +int lc15bts_par_get_gps_fix(time_t *ret); +int lc15bts_par_set_gps_fix(time_t val); #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.c b/src/osmo-bts-litecell15/misc/lc15bts_power.c index 5b01d36..1a37d8e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.c @@ -39,7 +39,7 @@ }; static const char *power_sensor_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/pa-supply/", + [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/main-supply/", [LC15BTS_POWER_PA0] = "/var/lc15/pwr-sense/pa0/", [LC15BTS_POWER_PA1] = "/var/lc15/pwr-sense/pa1/", }; @@ -52,7 +52,8 @@ int lc15bts_power_sensor_get( enum lc15bts_power_source source, - enum lc15bts_power_type type) + enum lc15bts_power_type type, + int *power) { char buf[PATH_MAX]; char pwrstr[10]; @@ -82,8 +83,8 @@ return -EIO; } close(fd); - - return atoi(pwrstr); + *power = atoi(pwrstr); + return 0; } @@ -171,3 +172,39 @@ return retVal; } + +static const char *vswr_devs[_NUM_VSWR_SENSORS] = { + [LC15BTS_VSWR_TX0] = "/var/lc15/vswr/tx0/vswr", + [LC15BTS_VSWR_TX1] = "/var/lc15/vswr/tx1/vswr", +}; + +int lc15bts_vswr_get(enum lc15bts_vswr_sensor sensor, int *vswr) +{ + char buf[PATH_MAX]; + char vswrstr[8]; + int fd, rc; + + if (sensor < 0 || sensor >= _NUM_VSWR_SENSORS) + return -EINVAL; + + snprintf(buf, sizeof(buf)-1, "%s", vswr_devs[sensor]); + buf[sizeof(buf)-1] = '\0'; + + fd = open(buf, O_RDONLY); + if (fd < 0) + return fd; + + rc = read(fd, vswrstr, sizeof(vswrstr)); + vswrstr[sizeof(vswrstr)-1] = '\0'; + if (rc < 0) { + close(fd); + return rc; + } + if (rc == 0) { + close(fd); + return -EIO; + } + close(fd); + *vswr = atoi(vswrstr); + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.h b/src/osmo-bts-litecell15/misc/lc15bts_power.h index 8963b76..b48cfdc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.h @@ -17,7 +17,8 @@ int lc15bts_power_sensor_get( enum lc15bts_power_source source, - enum lc15bts_power_type type); + enum lc15bts_power_type type, + int *volt); int lc15bts_power_set( enum lc15bts_power_source source, @@ -26,4 +27,12 @@ int lc15bts_power_get( enum lc15bts_power_source source); +enum lc15bts_vswr_sensor { + LC15BTS_VSWR_TX0, + LC15BTS_VSWR_TX1, + _NUM_VSWR_SENSORS +}; + +int lc15bts_vswr_get(enum lc15bts_vswr_sensor sensor, int *vswr); + #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_temp.c index aa35854..45602dc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.c @@ -29,20 +29,19 @@ #include "lc15bts_temp.h" - static const char *temp_devs[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/pa-supply/temp", - [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", - [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", - [LC15BTS_TEMP_LOGRF] = "/var/lc15/temp/logrf/temp", - [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", - [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", - [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", - [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", - [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", + [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/main-supply/temp", + [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", + [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", + [LC15BTS_TEMP_RMSDET] = "/var/lc15/temp/rmsdet/temp", + [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", + [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", + [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", + [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", + [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor) +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, int *temp) { char buf[PATH_MAX]; char tempstr[8]; @@ -69,7 +68,7 @@ return -EIO; } close(fd); - - return atoi(tempstr); + *temp = atoi(tempstr); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.h b/src/osmo-bts-litecell15/misc/lc15bts_temp.h index aca8fe2..35d81f1 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.h @@ -5,7 +5,7 @@ LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_SOC, LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_LOGRF, + LC15BTS_TEMP_RMSDET, LC15BTS_TEMP_OCXO, LC15BTS_TEMP_TX0, LC15BTS_TEMP_TX1, @@ -22,6 +22,7 @@ _NUM_TEMP_TYPES }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor); +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, int *temp); + #endif -- To view, visit https://gerrit.osmocom.org/3277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: jfdionne From gerrit-no-reply at lists.osmocom.org Wed Jul 19 09:53:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 19 Jul 2017 09:53:40 +0000 Subject: openbsc[master]: bsc_vty: Add VTY command to test CTRL TRAP feature In-Reply-To: References: Message-ID: Patch Set 1: Can we make it part of libosmoctrl so it's automatically available to all projects using it? -- To view, visit https://gerrit.osmocom.org/3278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 19 10:03:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 10:03:50 +0000 Subject: openbsc[master]: bsc_vty: Add VTY command to test CTRL TRAP feature In-Reply-To: References: Message-ID: Patch Set 1: No, we cannot. Generating a trap requires us to know the ctrl_handle, which is returned to whoever creates a control interface instance. The only way to solve this would be to keep a library-internal list of all control interface instances that have been allocated, and then iterate over the list to dispatch the command to all control interface instances. Alternatively, we could restrict the number of control interface instances of any application to '1' and keep a static pointer to that inside the library to generate the trap. Etiher way, it would be quite a change to the semantics of how the API works right now, so I went for the straight-forward approach. -- To view, visit https://gerrit.osmocom.org/3278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 19 10:52:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 10:52:30 +0000 Subject: osmo-bts[master]: lc15: port lc15bts-mgr changes In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: jfdionne Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 19 10:52:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 10:52:36 +0000 Subject: openbsc[master]: bsc_vty: Add VTY command to test CTRL TRAP feature In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 19 10:52:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 10:52:39 +0000 Subject: [MERGED] openbsc[master]: bsc_vty: Add VTY command to test CTRL TRAP feature In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc_vty: Add VTY command to test CTRL TRAP feature ...................................................................... bsc_vty: Add VTY command to test CTRL TRAP feature Using this new command (introduced in OsmoBSC + OsmoNITB), you can simulate the generation of TRAP events for testin purposes. start the control interface monitor as an example client program: ./openbsc/contrib/bsc_control.py -m -d localhost -p 4249 then start OsmoBSC or OsmoNITB, telnet to the VTY and enter 'enable' mode and issue the following (example) command: ctrl-interface generate-trap my.foo.var 2342 As a result, on the bsc_control.py you will see: Got message: TRAP 0 my.foo.var 2342 Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 91a90c1..6472e9d 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -4122,6 +4123,20 @@ rsl_ipacc_mdcx(lchan, ntohl(ia.s_addr), port, 0); return CMD_SUCCESS; } + +DEFUN(ctrl_trap, ctrl_trap_cmd, + "ctrl-interface generate-trap TRAP VALUE", + "Commands related to the CTRL Interface\n" + "Generate a TRAP for test purpose\n" + "Identity/Name of the TRAP variable\n" + "Value of the TRAP variable\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + + ctrl_cmd_send_trap(net->ctrl, argv[0], (char *) argv[1]); + return CMD_SUCCESS; +} + extern int bsc_vty_init_extra(void); int bsc_vty_init(struct gsm_network *network) @@ -4325,6 +4340,7 @@ install_element(ENABLE_NODE, &lchan_act_cmd); install_element(ENABLE_NODE, &lchan_mdcx_cmd); install_element(ENABLE_NODE, &smscb_cmd_cmd); + install_element(ENABLE_NODE, &ctrl_trap_cmd); abis_nm_vty_init(); abis_om2k_vty_init(); -- To view, visit https://gerrit.osmocom.org/3278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jul 19 10:52:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 10:52:41 +0000 Subject: [MERGED] osmo-bts[master]: lc15: port lc15bts-mgr changes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: port lc15bts-mgr changes ...................................................................... lc15: port lc15bts-mgr changes That's mostly changes related to lc15bts-mgr from https://gitlab.com/nrw_noa/osmo-bts branch nrw/litecell15 based on eb5b7f80510b603579f7af6d7d5ead296c2fa260 commit. I wanted to incorporate vty and hardcoded paths changes so we can use it from this point without major backward-incompatible changes as a base for future ports. Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Related: SYS#3679 --- M doc/examples/litecell15/lc15bts-mgr.cfg M include/osmo-bts/phy_link.h M src/common/Makefile.am M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/hw_misc.c A src/osmo-bts-litecell15/misc/lc15bts_bts.c A src/osmo-bts-litecell15/misc/lc15bts_bts.h M src/osmo-bts-litecell15/misc/lc15bts_clock.c A src/osmo-bts-litecell15/misc/lc15bts_led.c A src/osmo-bts-litecell15/misc/lc15bts_led.h M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.h M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c M src/osmo-bts-litecell15/misc/lc15bts_misc.c M src/osmo-bts-litecell15/misc/lc15bts_misc.h M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h M src/osmo-bts-litecell15/misc/lc15bts_power.c M src/osmo-bts-litecell15/misc/lc15bts_power.h M src/osmo-bts-litecell15/misc/lc15bts_temp.c M src/osmo-bts-litecell15/misc/lc15bts_temp.h 22 files changed, 2,014 insertions(+), 411 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index 750dc36..c7d0a79 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -25,39 +25,19 @@ no login ! lc15bts-mgr - limits supply - threshold warning 60 - threshold critical 78 - limits soc - threshold warning 60 - threshold critical 78 - limits fpga - threshold warning 60 - threshold critical 78 - limits logrf - threshold warning 60 - threshold critical 78 - limits tx0 - threshold warning 60 - threshold critical 78 - limits tx1 - threshold warning 60 - threshold critical 78 - limits pa0 - threshold warning 60 - threshold critical 78 - limits pa1 - threshold warning 60 - threshold critical 78 - actions normal - pa0-on - pa1-on - bts-service-on - actions warn - no pa0-off - no pa1-off - no bts-service-off - actions critical - pa0-off - pa1-off - no bts-service-off + limits supply_volt + threshold warning min 17500 + threshold critical min 19000 + limits tx0_vswr + threshold warning max 3 + limits tx1_vswr + threshold warning max 3 + limits supply_pwr + threshold warning max 110 + threshold critical max 120 + limits pa0_pwr + threshold warning max 50 + threshold critical max 60 + limits pa1_pwr + threshold warning max 50 + threshold critical max 60 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index d8d3c6b..3d4bf91 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -124,6 +124,12 @@ int minTxPower; int maxTxPower; struct lc15l1_hdl *hdl; + uint8_t max_cell_size; /* 0:166 qbits*/ + uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ + uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ + uint8_t dsp_alive_period; /* DSP alive timer period */ + uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ + uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ } lc15; } u; }; diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..d104c48 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -2,6 +2,10 @@ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) +if ENABLE_LC15BTS +AM_CFLAGS += -DENABLE_LC15BTS +endif + noinst_LIBRARIES = libbts.a libl1sched.a libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \ rsl.c vty.c paging.c measurement.c amr.c lchan.c \ diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 3026e96..90e6c46 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -4,9 +4,11 @@ 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/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h \ +AM_CFLAGS += -DENABLE_LC15BTS + +EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h misc/lc15bts_led.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ - misc/lc15bts_bid.h misc/lc15bts_nl.h \ + misc/lc15bts_bid.h misc/lc15bts_nl.h misc/lc15bts_bts.h \ hw_misc.h l1_if.h l1_transp.h lc15bts.h oml_router.h utils.h bin_PROGRAMS = osmo-bts-lc15 lc15bts-mgr lc15bts-util @@ -25,9 +27,11 @@ misc/lc15bts_mgr_vty.c \ misc/lc15bts_mgr_nl.c \ misc/lc15bts_mgr_temp.c \ - misc/lc15bts_mgr_calib.c + misc/lc15bts_mgr_calib.c \ + misc/lc15bts_led.c \ + misc/lc15bts_bts.c -lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(COMMON_LDADD) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) diff --git a/src/osmo-bts-litecell15/hw_misc.c b/src/osmo-bts-litecell15/hw_misc.c index 49232b2..9f070bb 100644 --- a/src/osmo-bts-litecell15/hw_misc.c +++ b/src/osmo-bts-litecell15/hw_misc.c @@ -69,6 +69,7 @@ rc = write(fd, cmd[0] ? "1" : "0", 2); if (rc != 2) { + close(fd); return -1; } close(fd); @@ -79,6 +80,7 @@ rc = write(fd, cmd[1] ? "1" : "0", 2); if (rc != 2) { + close(fd); return -1; } close(fd); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bts.c b/src/osmo-bts-litecell15/misc/lc15bts_bts.c new file mode 100644 index 0000000..0343e93 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_bts.c @@ -0,0 +1,131 @@ +/* Copyright (C) 2016 by NuRAN Wireless + * + * 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 "lc15bts_mgr.h" +#include "lc15bts_bts.h" + +static int check_eth_status(char *dev_name) +{ + int fd, rc; + struct ifreq ifr; + + fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); + if (fd < 0) + return fd; + + memset(&ifr, 0, sizeof(ifr)); + memcpy(&ifr.ifr_name, dev_name, sizeof(ifr.ifr_name)); + rc = ioctl(fd, SIOCGIFFLAGS, &ifr); + close(fd); + + if (rc < 0) + return rc; + + if ((ifr.ifr_flags & IFF_UP) && (ifr.ifr_flags & IFF_RUNNING)) + return 0; + + return 1; +} + +void check_bts_led_pattern(uint8_t *led) +{ + FILE *fp; + char str[64] = "\0"; + int rc; + + /* check for existing of BTS state file */ + if ((fp = fopen("/var/run/osmo-bts/state", "r")) == NULL) { + led[BLINK_PATTERN_INIT] = 1; + return; + } + + /* check Ethernet interface status */ + rc = check_eth_status("eth0"); + if (rc > 0) { + LOGP(DTEMP, LOGL_DEBUG,"External link is DOWN\n"); + led[BLINK_PATTERN_EXT_LINK_MALFUNC] = 1; + fclose(fp); + return; + } + + /* check for BTS is still alive */ + if (system("pidof osmo-bts-lc15 > /dev/null")) { + LOGP(DTEMP, LOGL_DEBUG,"BTS process has stopped\n"); + led[BLINK_PATTERN_INT_PROC_MALFUNC] = 1; + fclose(fp); + return; + } + + /* check for BTS state */ + while (fgets(str, 64, fp) != NULL) { + LOGP(DTEMP, LOGL_DEBUG,"BTS state is %s\n", (strstr(str, "ABIS DOWN") != NULL) ? "DOWN" : "UP"); + if (strstr(str, "ABIS DOWN") != NULL) + led[BLINK_PATTERN_INT_PROC_MALFUNC] = 1; + } + fclose(fp); + + return; +} + +int check_sensor_led_pattern( struct lc15bts_mgr_instance *mgr, uint8_t *led) +{ + if(mgr->alarms.temp_high == 1) + led[BLINK_PATTERN_TEMP_HIGH] = 1; + + if(mgr->alarms.temp_max == 1) + led[BLINK_PATTERN_TEMP_MAX] = 1; + + if(mgr->alarms.supply_low == 1) + led[BLINK_PATTERN_SUPPLY_VOLT_LOW] = 1; + + if(mgr->alarms.supply_min == 1) + led[BLINK_PATTERN_SUPPLY_VOLT_MIN] = 1; + + if(mgr->alarms.vswr_high == 1) + led[BLINK_PATTERN_VSWR_HIGH] = 1; + + if(mgr->alarms.vswr_max == 1) + led[BLINK_PATTERN_VSWR_MAX] = 1; + + if(mgr->alarms.supply_pwr_high == 1) + led[BLINK_PATTERN_SUPPLY_PWR_HIGH] = 1; + + if(mgr->alarms.supply_pwr_max == 1) + led[BLINK_PATTERN_SUPPLY_PWR_MAX] = 1; + + if(mgr->alarms.supply_pwr_max2 == 1) + led[BLINK_PATTERN_SUPPLY_PWR_MAX2] = 1; + + if(mgr->alarms.pa_pwr_high == 1) + led[BLINK_PATTERN_PA_PWR_HIGH] = 1; + + if(mgr->alarms.pa_pwr_max == 1) + led[BLINK_PATTERN_PA_PWR_MAX] = 1; + + if(mgr->alarms.gps_fix_lost == 1) + led[BLINK_PATTERN_GPS_FIX_LOST] = 1; + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bts.h b/src/osmo-bts-litecell15/misc/lc15bts_bts.h new file mode 100644 index 0000000..3918b87 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_bts.h @@ -0,0 +1,21 @@ +#ifndef _LC15BTS_BTS_H_ +#define _LC15BTS_BTS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* public function prototypes */ +void check_bts_led_pattern(uint8_t *led); +int check_sensor_led_pattern( struct lc15bts_mgr_instance *mgr, uint8_t *led); + +#endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_clock.c b/src/osmo-bts-litecell15/misc/lc15bts_clock.c index f4df5d3..7170149 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_clock.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_clock.c @@ -100,9 +100,6 @@ int lc15bts_clock_err_open(void) { - int rc; - int fault; - if (clkerr_fd_err < 0) { clkerr_fd_err = open(CLKERR_ERR_SYSFS, O_RDONLY); if (clkerr_fd_err < 0) { @@ -149,26 +146,6 @@ lc15bts_clock_err_close(); return clkerr_fd_reset; } - } - - rc = sysfs_write_str(clkerr_fd_refresh, "once"); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } - - rc = sysfs_read_val(clkerr_fd_fault, &fault); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } - - if (fault) { - rc = sysfs_write_val(clkerr_fd_reset, 1); - if (rc < 0) { - lc15bts_clock_err_close(); - return rc; - } } return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_led.c b/src/osmo-bts-litecell15/misc/lc15bts_led.c new file mode 100644 index 0000000..603e0fb --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_led.c @@ -0,0 +1,333 @@ +/* Copyright (C) 2016 by NuRAN Wireless + * + * 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 "lc15bts_led.h" +#include "lc15bts_bts.h" +#include +#include + +static struct lc15bts_led led_entries[] = { + { + .name = "led0", + .fullname = "led red", + .path = "/var/lc15/leds/led0/brightness" + }, + { + .name = "led1", + .fullname = "led green", + .path = "/var/lc15/leds/led1/brightness" + } +}; + +static const struct value_string lc15bts_led_strs[] = { + { LC15BTS_LED_RED, "LED red" }, + { LC15BTS_LED_GREEN, "LED green" }, + { LC15BTS_LED_ORANGE, "LED orange" }, + { LC15BTS_LED_OFF, "LED off" }, + { 0, NULL } +}; + +static uint8_t led_priority[] = { + BLINK_PATTERN_INIT, + BLINK_PATTERN_INT_PROC_MALFUNC, + BLINK_PATTERN_SUPPLY_PWR_MAX, + BLINK_PATTERN_PA_PWR_MAX, + BLINK_PATTERN_VSWR_MAX, + BLINK_PATTERN_SUPPLY_VOLT_MIN, + BLINK_PATTERN_TEMP_MAX, + BLINK_PATTERN_SUPPLY_PWR_MAX2, + BLINK_PATTERN_EXT_LINK_MALFUNC, + BLINK_PATTERN_SUPPLY_VOLT_LOW, + BLINK_PATTERN_TEMP_HIGH, + BLINK_PATTERN_VSWR_HIGH, + BLINK_PATTERN_SUPPLY_PWR_HIGH, + BLINK_PATTERN_PA_PWR_HIGH, + BLINK_PATTERN_GPS_FIX_LOST, + BLINK_PATTERN_NORMAL +}; + + +char *blink_pattern_command[] = BLINK_PATTERN_COMMAND; + +static int lc15bts_led_write(char *path, char *str) +{ + int fd; + + if ((fd = open(path, O_WRONLY)) == -1) + { + return 0; + } + + write(fd, str, strlen(str)+1); + close(fd); + return 1; +} + +static void led_set_red() +{ + lc15bts_led_write(led_entries[0].path, "1"); + lc15bts_led_write(led_entries[1].path, "0"); +} + +static void led_set_green() +{ + lc15bts_led_write(led_entries[0].path, "0"); + lc15bts_led_write(led_entries[1].path, "1"); +} + +static void led_set_orange() +{ + lc15bts_led_write(led_entries[0].path, "1"); + lc15bts_led_write(led_entries[1].path, "1"); +} + +static void led_set_off() +{ + lc15bts_led_write(led_entries[0].path, "0"); + lc15bts_led_write(led_entries[1].path, "0"); +} + +static void led_sleep( struct lc15bts_mgr_instance *mgr, struct lc15bts_led_timer *led_timer, void (*led_timer_cb)(void *_data)) { + /* Cancel any pending timer */ + osmo_timer_del(&led_timer->timer); + /* Start LED timer */ + led_timer->timer.cb = led_timer_cb; + led_timer->timer.data = mgr; + mgr->lc15bts_leds.active_timer = led_timer->idx; + osmo_timer_schedule(&led_timer->timer, led_timer->param.sleep_sec, led_timer->param.sleep_usec); + LOGP(DTEMP, LOGL_DEBUG,"%s timer scheduled for %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_timer->idx), + led_timer->param.sleep_sec, + led_timer->param.sleep_usec); + + switch (led_timer->idx) { + case LC15BTS_LED_RED: + led_set_red(); + break; + case LC15BTS_LED_GREEN: + led_set_green(); + break; + case LC15BTS_LED_ORANGE: + led_set_orange(); + break; + case LC15BTS_LED_OFF: + led_set_off(); + break; + default: + led_set_off(); + } +} + +static void led_sleep_cb(void *_data) { + struct lc15bts_mgr_instance *mgr = _data; + struct lc15bts_led_timer_list *led_list; + + /* make sure the timer list is not empty */ + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + llist_for_each_entry(led_list, &mgr->lc15bts_leds.list, list) { + if (led_list->led_timer.idx == mgr->lc15bts_leds.active_timer) { + LOGP(DTEMP, LOGL_DEBUG,"Delete expired %s timer %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + /* Delete current timer */ + osmo_timer_del(&led_list->led_timer.timer); + /* Rotate the timer list */ + llist_move_tail(led_list, &mgr->lc15bts_leds.list); + break; + } + } + + /* Execute next timer */ + led_list = llist_first_entry(&mgr->lc15bts_leds.list, struct lc15bts_led_timer_list, list); + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Execute %s timer %d sec + %d usec, total entries=%d\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec, + llist_count(&mgr->lc15bts_leds.list)); + + led_sleep(mgr, &led_list->led_timer, led_sleep_cb); + } + +} + +static void delete_led_timer_entries(struct lc15bts_mgr_instance *mgr) +{ + struct lc15bts_led_timer_list *led_list, *led_list2; + + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + llist_for_each_entry_safe(led_list, led_list2, &mgr->lc15bts_leds.list, list) { + /* Delete the timer in list */ + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Delete %s timer entry from list, %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + /* Delete current timer */ + osmo_timer_del(&led_list->led_timer.timer); + llist_del(&led_list->list); + talloc_free(led_list); + } + } + return; +} + +static int add_led_timer_entry(struct lc15bts_mgr_instance *mgr, char *cmdstr) +{ + double sec, int_sec, frac_sec; + struct lc15bts_sleep_time led_param; + + led_param.sleep_sec = 0; + led_param.sleep_usec = 0; + + if (strstr(cmdstr, "set red") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_RED; + else if (strstr(cmdstr, "set green") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_GREEN; + else if (strstr(cmdstr, "set orange") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_ORANGE; + else if (strstr(cmdstr, "set off") != NULL) + mgr->lc15bts_leds.led_idx = LC15BTS_LED_OFF; + else if (strstr(cmdstr, "sleep") != NULL) { + sec = atof(cmdstr + 6); + /* split time into integer and fractional of seconds */ + frac_sec = modf(sec, &int_sec) * 1000000.0; + led_param.sleep_sec = (int)int_sec; + led_param.sleep_usec = (int)frac_sec; + + if ((mgr->lc15bts_leds.led_idx >= LC15BTS_LED_RED) && (mgr->lc15bts_leds.led_idx < _LC15BTS_LED_MAX)) { + struct lc15bts_led_timer_list *led_list; + + /* allocate timer entry */ + led_list = talloc_zero(tall_mgr_ctx, struct lc15bts_led_timer_list); + if (led_list) { + led_list->led_timer.idx = mgr->lc15bts_leds.led_idx; + led_list->led_timer.param.sleep_sec = led_param.sleep_sec; + led_list->led_timer.param.sleep_usec = led_param.sleep_usec; + llist_add_tail(&led_list->list, &mgr->lc15bts_leds.list); + + LOGP(DTEMP, LOGL_DEBUG,"Add %s timer to list, %d sec + %d usec, total entries=%d\n", + get_value_string(lc15bts_led_strs, mgr->lc15bts_leds.led_idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec, + llist_count(&mgr->lc15bts_leds.list)); + } + } + } else + return -1; + + return 0; +} + +static int parse_led_pattern(char *pattern, struct lc15bts_mgr_instance *mgr) +{ + char str[1024]; + char *pstr; + char *sep; + int rc = 0; + + strcpy(str, pattern); + pstr = str; + while ((sep = strsep(&pstr, ";")) != NULL) { + rc = add_led_timer_entry(mgr, sep); + if (rc < 0) { + break; + } + + } + return rc; +} + +/*** led interface ***/ + +void led_set(struct lc15bts_mgr_instance *mgr, int pattern_id) +{ + int rc; + struct lc15bts_led_timer_list *led_list; + + if (pattern_id > BLINK_PATTERN_MAX_ITEM - 1) { + LOGP(DTEMP, LOGL_ERROR, "Invalid LED pattern : %d. LED pattern must be between %d..%d\n", + pattern_id, + BLINK_PATTERN_POWER_ON, + BLINK_PATTERN_MAX_ITEM - 1); + return; + } + if (pattern_id == mgr->lc15bts_leds.last_pattern_id) + return; + + mgr->lc15bts_leds.last_pattern_id = pattern_id; + + LOGP(DTEMP, LOGL_NOTICE, "blink pattern command : %d\n", pattern_id); + LOGP(DTEMP, LOGL_NOTICE, "%s\n", blink_pattern_command[pattern_id]); + + /* Empty existing LED timer in the list */ + delete_led_timer_entries(mgr); + + /* parse LED pattern */ + rc = parse_led_pattern(blink_pattern_command[pattern_id], mgr); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR,"LED pattern not found or invalid LED pattern\n"); + return; + } + + /* make sure the timer list is not empty */ + if (llist_empty(&mgr->lc15bts_leds.list)) + return; + + /* Start the first LED timer in the list */ + led_list = llist_first_entry(&mgr->lc15bts_leds.list, struct lc15bts_led_timer_list, list); + if (led_list) { + LOGP(DTEMP, LOGL_DEBUG,"Execute timer %s for %d sec + %d usec\n", + get_value_string(lc15bts_led_strs, led_list->led_timer.idx), + led_list->led_timer.param.sleep_sec, + led_list->led_timer.param.sleep_usec); + + led_sleep(mgr, &led_list->led_timer, led_sleep_cb); + } + +} + +void select_led_pattern(struct lc15bts_mgr_instance *mgr) +{ + int i; + uint8_t led[BLINK_PATTERN_MAX_ITEM] = {0}; + + /* set normal LED pattern at first */ + led[BLINK_PATTERN_NORMAL] = 1; + + /* check on-board sensors for new LED pattern */ + check_sensor_led_pattern(mgr, led); + + /* check BTS status for new LED pattern */ + check_bts_led_pattern(led); + + /* check by priority */ + for (i = 0; i < sizeof(led_priority)/sizeof(uint8_t); i++) { + if(led[led_priority[i]] == 1) { + led_set(mgr, led_priority[i]); + break; + } + } +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_led.h b/src/osmo-bts-litecell15/misc/lc15bts_led.h new file mode 100644 index 0000000..b6d9d28 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_led.h @@ -0,0 +1,22 @@ +#ifndef _LC15BTS_LED_H +#define _LC15BTS_LED_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "lc15bts_mgr.h" + +/* public function prototypes */ +void led_set(struct lc15bts_mgr_instance *mgr, int pattern_id); + +void select_led_pattern(struct lc15bts_mgr_instance *mgr); + +#endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index 3a7d3a1..51a05f9 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -46,13 +46,14 @@ #include "misc/lc15bts_par.h" #include "misc/lc15bts_bid.h" #include "misc/lc15bts_power.h" +#include "lc15bts_led.h" static int no_rom_write = 0; static int daemonize = 0; void *tall_mgr_ctx; /* every 6 hours means 365*4 = 1460 rom writes per year (max) */ -#define TEMP_TIMER_SECS (6 * 3600) +#define SENSOR_TIMER_SECS (6 * 3600) /* every 1 hours means 365*24 = 8760 rom writes per year (max) */ #define HOURS_TIMER_SECS (1 * 3600) @@ -62,54 +63,106 @@ static struct lc15bts_mgr_instance manager = { .config_file = "lc15bts-mgr.cfg", .temp = { - .supply_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .supply_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .soc_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .soc_temp_limit = { + .thresh_warn_max = 95, + .thresh_crit_max = 100, + .thresh_warn_min = -40, }, - .fpga_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .fpga_temp_limit = { + .thresh_warn_max = 95, + .thresh_crit_max = 100, + .thresh_warn_min = -40, }, - .logrf_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .rmsdet_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .ocxo_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .ocxo_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .tx0_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .tx0_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -20, }, - .tx1_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .tx1_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -20, }, - .pa0_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .pa0_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, }, - .pa1_limit = { - .thresh_warn = 60, - .thresh_crit = 78, + .pa1_temp_limit = { + .thresh_warn_max = 80, + .thresh_crit_max = 85, + .thresh_warn_min = -40, + } + }, + .volt = { + .supply_volt_limit = { + .thresh_warn_max = 30000, + .thresh_crit_max = 30500, + .thresh_warn_min = 19000, + .thresh_crit_min = 17500, + } + }, + .pwr = { + .supply_pwr_limit = { + .thresh_warn_max = 110, + .thresh_crit_max = 120, }, + .pa0_pwr_limit = { + .thresh_warn_max = 50, + .thresh_crit_max = 60, + }, + .pa1_pwr_limit = { + .thresh_warn_max = 50, + .thresh_crit_max = 60, + } + }, + .vswr = { + .tx0_vswr_limit = { + .thresh_warn_max = 3000, + .thresh_crit_max = 5000, + }, + .tx1_vswr_limit = { + .thresh_warn_max = 3000, + .thresh_crit_max = 5000, + } + }, + .gps = { + .gps_fix_limit = { + .thresh_warn_max = 7, + } + }, + .state = { + .action_norm = SENSOR_ACT_NORM_PA0_ON | SENSOR_ACT_NORM_PA1_ON, .action_warn = 0, - .action_crit = TEMP_ACT_PA0_OFF | TEMP_ACT_PA1_OFF, + .action_crit = 0, + .action_comb = 0, .state = STATE_NORMAL, } }; -static struct osmo_timer_list temp_timer; -static void check_temp_timer_cb(void *unused) +static struct osmo_timer_list sensor_timer; +static void check_sensor_timer_cb(void *unused) { lc15bts_check_temp(no_rom_write); - - osmo_timer_schedule(&temp_timer, TEMP_TIMER_SECS, 0); + lc15bts_check_power(no_rom_write); + lc15bts_check_vswr(no_rom_write); + osmo_timer_schedule(&sensor_timer, SENSOR_TIMER_SECS, 0); + /* TODO checks if lc15bts_check_temp/lc15bts_check_power/lc15bts_check_vswr went ok */ } static struct osmo_timer_list hours_timer; @@ -118,6 +171,7 @@ lc15bts_update_hours(no_rom_write); osmo_timer_schedule(&hours_timer, HOURS_TIMER_SECS, 0); + /* TODO: validates if lc15bts_update_hours went correctly */ } static void print_help(void) @@ -169,6 +223,8 @@ switch (signal) { case SIGINT: lc15bts_check_temp(no_rom_write); + lc15bts_check_power(no_rom_write); + lc15bts_check_vswr(no_rom_write); lc15bts_update_hours(no_rom_write); exit(0); break; @@ -207,6 +263,12 @@ .color = "\033[1;37m", .enabled = 1, .loglevel = LOGL_INFO, }, + [DSWD] = { + .name = "DSWD", + .description = "Software Watchdog", + .color = "\033[1;37m", + .enabled = 1, .loglevel = LOGL_INFO, + }, }; static const struct log_info mgr_log_info = { @@ -223,7 +285,6 @@ int main(int argc, char **argv) { int rc; - tall_mgr_ctx = talloc_named_const(NULL, 1, "bts manager"); msgb_talloc_ctx_init(tall_mgr_ctx, 0); @@ -253,9 +314,12 @@ exit(1); } + INIT_LLIST_HEAD(&manager.lc15bts_leds.list); + INIT_LLIST_HEAD(&manager.alarms.list); + /* start temperature check timer */ - temp_timer.cb = check_temp_timer_cb; - check_temp_timer_cb(NULL); + sensor_timer.cb = check_sensor_timer_cb; + check_sensor_timer_cb(NULL); /* start operational hours timer */ hours_timer.cb = hours_timer_cb; @@ -271,14 +335,13 @@ if (rc < 0) { exit(3); } - /* handle broadcast messages for ipaccess-find */ if (lc15bts_mgr_nl_init() != 0) exit(3); - /* Initialize the temperature control */ - lc15bts_mgr_temp_init(&manager); + /* Initialize the sensor control */ + lc15bts_mgr_sensor_init(&manager); if (lc15bts_mgr_calib_init(&manager) != 0) exit(3); @@ -290,7 +353,6 @@ exit(1); } } - while (1) { log_reset_context(); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h index 98bd701..4bfbdbc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h @@ -9,38 +9,100 @@ #include +#define LC15BTS_SENSOR_TIMER_DURATION 60 +#define LC15BTS_PREVENT_TIMER_DURATION 15 * 60 +#define LC15BTS_PREVENT_TIMER_SHORT_DURATION 5 * 60 +#define LC15BTS_PREVENT_TIMER_NONE 0 +#define LC15BTS_PREVENT_RETRY INT_MAX - 1 + +enum BLINK_PATTERN { + BLINK_PATTERN_POWER_ON = 0, //hardware set + BLINK_PATTERN_INIT, + BLINK_PATTERN_NORMAL, + BLINK_PATTERN_EXT_LINK_MALFUNC, + BLINK_PATTERN_INT_PROC_MALFUNC, + BLINK_PATTERN_SUPPLY_VOLT_LOW, + BLINK_PATTERN_SUPPLY_VOLT_MIN, + BLINK_PATTERN_VSWR_HIGH, + BLINK_PATTERN_VSWR_MAX, + BLINK_PATTERN_TEMP_HIGH, + BLINK_PATTERN_TEMP_MAX, + BLINK_PATTERN_SUPPLY_PWR_HIGH, + BLINK_PATTERN_SUPPLY_PWR_MAX, + BLINK_PATTERN_SUPPLY_PWR_MAX2, + BLINK_PATTERN_PA_PWR_HIGH, + BLINK_PATTERN_PA_PWR_MAX, + BLINK_PATTERN_GPS_FIX_LOST, + BLINK_PATTERN_MAX_ITEM +}; + +#define BLINK_PATTERN_COMMAND {\ + "set red; sleep 5.0",\ + "set orange; sleep 5.0",\ + "set green; sleep 2.5; set off; sleep 2.5",\ + "set red; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 2.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5 ",\ + "set green; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set orange; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5 ",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set orange; sleep 2.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set red; sleep 2.5; set off; sleep 0.5; set red; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ + "set green; sleep 2.5; set off; sleep 0.5; set green; sleep 0.5; set off; sleep 0.5; set orange; sleep 0.5; set off; sleep 0.5",\ +} + enum { DTEMP, DFW, DFIND, DCALIB, + DSWD, }; // TODO NTQD: Define new actions like reducing output power, limit ARM core speed, shutdown second TRX/PA, ... enum { #if 0 - TEMP_ACT_PWR_CONTRL = 0x1, + SENSOR_ACT_PWR_CONTRL = 0x1, #endif - TEMP_ACT_PA0_OFF = 0x2, - TEMP_ACT_PA1_OFF = 0x4, - TEMP_ACT_BTS_SRV_OFF = 0x10, + SENSOR_ACT_PA0_OFF = 0x2, + SENSOR_ACT_PA1_OFF = 0x4, + SENSOR_ACT_BTS_SRV_OFF = 0x10, }; /* actions only for normal state */ enum { #if 0 - TEMP_ACT_NORM_PW_CONTRL = 0x1, + SENSOR_ACT_NORM_PW_CONTRL = 0x1, #endif - TEMP_ACT_NORM_PA0_ON = 0x2, - TEMP_ACT_NORM_PA1_ON = 0x4, - TEMP_ACT_NORM_BTS_SRV_ON= 0x10, + SENSOR_ACT_NORM_PA0_ON = 0x2, + SENSOR_ACT_NORM_PA1_ON = 0x4, + SENSOR_ACT_NORM_BTS_SRV_ON= 0x10, }; -enum lc15bts_temp_state { +enum lc15bts_sensor_state { STATE_NORMAL, /* Everything is fine */ STATE_WARNING_HYST, /* Go back to normal next? */ STATE_WARNING, /* We are above the warning threshold */ STATE_CRITICAL, /* We have an issue. Wait for below warning */ +}; + +enum lc15bts_leds_name { + LC15BTS_LED_RED = 0, + LC15BTS_LED_GREEN, + LC15BTS_LED_ORANGE, + LC15BTS_LED_OFF, + _LC15BTS_LED_MAX +}; + +struct lc15bts_led{ + char *name; + char *fullname; + char *path; }; /** @@ -49,8 +111,52 @@ * severe that an action will be taken. */ struct lc15bts_temp_limit { - int thresh_warn; - int thresh_crit; + int thresh_warn_max; + int thresh_crit_max; + int thresh_warn_min; +}; + +struct lc15bts_volt_limit { + int thresh_warn_max; + int thresh_crit_max; + int thresh_warn_min; + int thresh_crit_min; +}; + +struct lc15bts_pwr_limit { + int thresh_warn_max; + int thresh_crit_max; +}; + +struct lc15bts_vswr_limit { + int thresh_warn_max; + int thresh_crit_max; +}; + +struct lc15bts_gps_fix_limit { + int thresh_warn_max; +}; + +struct lc15bts_sleep_time { + int sleep_sec; + int sleep_usec; +}; + +struct lc15bts_led_timer { + uint8_t idx; + struct osmo_timer_list timer; + struct lc15bts_sleep_time param; +}; + +struct lc15bts_led_timer_list { + struct llist_head list; + struct lc15bts_led_timer led_timer; +}; + +struct lc15bts_preventive_list { + struct llist_head list; + struct lc15bts_sleep_time param; + int action_flag; }; enum mgr_vty_node { @@ -59,55 +165,258 @@ ACT_NORM_NODE, ACT_WARN_NODE, ACT_CRIT_NODE, - LIMIT_SUPPLY_NODE, + LIMIT_SUPPLY_TEMP_NODE, LIMIT_SOC_NODE, LIMIT_FPGA_NODE, - LIMIT_LOGRF_NODE, + LIMIT_RMSDET_NODE, LIMIT_OCXO_NODE, - LIMIT_TX0_NODE, - LIMIT_TX1_NODE, - LIMIT_PA0_NODE, - LIMIT_PA1_NODE, + LIMIT_TX0_TEMP_NODE, + LIMIT_TX1_TEMP_NODE, + LIMIT_PA0_TEMP_NODE, + LIMIT_PA1_TEMP_NODE, + LIMIT_SUPPLY_VOLT_NODE, + LIMIT_TX0_VSWR_NODE, + LIMIT_TX1_VSWR_NODE, + LIMIT_SUPPLY_PWR_NODE, + LIMIT_PA0_PWR_NODE, + LIMIT_PA1_PWR_NODE, + LIMIT_GPS_FIX_NODE, +}; + +enum mgr_vty_limit_type { + MGR_LIMIT_TYPE_TEMP = 0, + MGR_LIMIT_TYPE_VOLT, + MGR_LIMIT_TYPE_VSWR, + MGR_LIMIT_TYPE_PWR, + _MGR_LIMIT_TYPE_MAX, }; struct lc15bts_mgr_instance { const char *config_file; struct { + struct lc15bts_temp_limit supply_temp_limit; + struct lc15bts_temp_limit soc_temp_limit; + struct lc15bts_temp_limit fpga_temp_limit; + struct lc15bts_temp_limit rmsdet_temp_limit; + struct lc15bts_temp_limit ocxo_temp_limit; + struct lc15bts_temp_limit tx0_temp_limit; + struct lc15bts_temp_limit tx1_temp_limit; + struct lc15bts_temp_limit pa0_temp_limit; + struct lc15bts_temp_limit pa1_temp_limit; + } temp; + + struct { + struct lc15bts_volt_limit supply_volt_limit; + } volt; + + struct { + struct lc15bts_pwr_limit supply_pwr_limit; + struct lc15bts_pwr_limit pa0_pwr_limit; + struct lc15bts_pwr_limit pa1_pwr_limit; + } pwr; + + struct { + struct lc15bts_vswr_limit tx0_vswr_limit; + struct lc15bts_vswr_limit tx1_vswr_limit; + int tx0_last_vswr; + int tx1_last_vswr; + } vswr; + + struct { + struct lc15bts_gps_fix_limit gps_fix_limit; + time_t last_update; + } gps; + + struct { int action_norm; int action_warn; int action_crit; + int action_comb; - enum lc15bts_temp_state state; - - struct lc15bts_temp_limit supply_limit; - struct lc15bts_temp_limit soc_limit; - struct lc15bts_temp_limit fpga_limit; - struct lc15bts_temp_limit logrf_limit; - struct lc15bts_temp_limit ocxo_limit; - struct lc15bts_temp_limit tx0_limit; - struct lc15bts_temp_limit tx1_limit; - struct lc15bts_temp_limit pa0_limit; - struct lc15bts_temp_limit pa1_limit; - } temp; + enum lc15bts_sensor_state state; + } state; struct { int state; int calib_from_loop; struct osmo_timer_list calib_timeout; } calib; + + struct { + int state; + int swd_from_loop; + unsigned long long int swd_events; + unsigned long long int swd_events_cache; + unsigned long long int swd_eventmasks; + int num_events; + struct osmo_timer_list swd_timeout; + } swd; + + struct { + uint8_t led_idx; + uint8_t last_pattern_id; + uint8_t active_timer; + struct llist_head list; + } lc15bts_leds; + + struct { + int is_up; + uint32_t last_seqno; + struct osmo_timer_list recon_timer; + struct ipa_client_conn *bts_conn; + uint32_t crit_flags; + uint32_t warn_flags; + } lc15bts_ctrl; + + struct lc15bts_alarms { + int temp_high; + int temp_max; + int supply_low; + int supply_min; + int vswr_high; + int vswr_max; + int supply_pwr_high; + int supply_pwr_max; + int supply_pwr_max2; + int pa_pwr_high; + int pa_pwr_max; + int gps_fix_lost; + struct llist_head list; + struct osmo_timer_list preventive_timer; + int preventive_duration; + int preventive_retry; + } alarms; + +}; + +enum lc15bts_mgr_fail_evt_rep_crit_sig { + /* Critical alarms */ + S_MGR_TEMP_SUPPLY_CRIT_MAX_ALARM = (1 << 0), + S_MGR_TEMP_SOC_CRIT_MAX_ALARM = (1 << 1), + S_MGR_TEMP_FPGA_CRIT_MAX_ALARM = (1 << 2), + S_MGR_TEMP_RMS_DET_CRIT_MAX_ALARM = (1 << 3), + S_MGR_TEMP_OCXO_CRIT_MAX_ALARM = (1 << 4), + S_MGR_TEMP_TRX0_CRIT_MAX_ALARM = (1 << 5), + S_MGR_TEMP_TRX1_CRIT_MAX_ALARM = (1 << 6), + S_MGR_TEMP_PA0_CRIT_MAX_ALARM = (1 << 7), + S_MGR_TEMP_PA1_CRIT_MAX_ALARM = (1 << 8), + S_MGR_SUPPLY_CRIT_MAX_ALARM = (1 << 9), + S_MGR_SUPPLY_CRIT_MIN_ALARM = (1 << 10), + S_MGR_VSWR0_CRIT_MAX_ALARM = (1 << 11), + S_MGR_VSWR1_CRIT_MAX_ALARM = (1 << 12), + S_MGR_PWR_SUPPLY_CRIT_MAX_ALARM = (1 << 13), + S_MGR_PWR_PA0_CRIT_MAX_ALARM = (1 << 14), + S_MGR_PWR_PA1_CRIT_MAX_ALARM = (1 << 15), + _S_MGR_CRIT_ALARM_MAX, +}; + +enum lc15bts_mgr_fail_evt_rep_warn_sig { + /* Warning alarms */ + S_MGR_TEMP_SUPPLY_WARN_MIN_ALARM = (1 << 0), + S_MGR_TEMP_SUPPLY_WARN_MAX_ALARM = (1 << 2), + S_MGR_TEMP_SOC_WARN_MIN_ALARM = (1 << 3), + S_MGR_TEMP_SOC_WARN_MAX_ALARM = (1 << 4), + S_MGR_TEMP_FPGA_WARN_MIN_ALARM = (1 << 5), + S_MGR_TEMP_FPGA_WARN_MAX_ALARM = (1 << 6), + S_MGR_TEMP_RMS_DET_WARN_MIN_ALARM = (1 << 7), + S_MGR_TEMP_RMS_DET_WARN_MAX_ALARM = (1 << 8), + S_MGR_TEMP_OCXO_WARN_MIN_ALARM = (1 << 9), + S_MGR_TEMP_OCXO_WARN_MAX_ALARM = (1 << 10), + S_MGR_TEMP_TRX0_WARN_MIN_ALARM = (1 << 11), + S_MGR_TEMP_TRX0_WARN_MAX_ALARM = (1 << 12), + S_MGR_TEMP_TRX1_WARN_MIN_ALARM = (1 << 13), + S_MGR_TEMP_TRX1_WARN_MAX_ALARM = (1 << 14), + S_MGR_TEMP_PA0_WARN_MIN_ALARM = (1 << 15), + S_MGR_TEMP_PA0_WARN_MAX_ALARM = (1 << 16), + S_MGR_TEMP_PA1_WARN_MIN_ALARM = (1 << 17), + S_MGR_TEMP_PA1_WARN_MAX_ALARM = (1 << 18), + S_MGR_SUPPLY_WARN_MIN_ALARM = (1 << 19), + S_MGR_SUPPLY_WARN_MAX_ALARM = (1 << 20), + S_MGR_VSWR0_WARN_MAX_ALARM = (1 << 21), + S_MGR_VSWR1_WARN_MAX_ALARM = (1 << 22), + S_MGR_PWR_SUPPLY_WARN_MAX_ALARM = (1 << 23), + S_MGR_PWR_PA0_WARN_MAX_ALARM = (1 << 24), + S_MGR_PWR_PA1_WARN_MAX_ALARM = (1 << 25), + S_MGR_GPS_FIX_WARN_ALARM = (1 << 26), + _S_MGR_WARN_ALARM_MAX, +}; + +enum lc15bts_mgr_failure_event_causes { + /* Critical causes */ + NM_EVT_CAUSE_CRIT_TEMP_SUPPLY_MAX_FAIL = 0x4100, + NM_EVT_CAUSE_CRIT_TEMP_FPGA_MAX_FAIL = 0x4101, + NM_EVT_CAUSE_CRIT_TEMP_SOC_MAX_FAIL = 0x4102, + NM_EVT_CAUSE_CRIT_TEMP_RMS_DET_MAX_FAIL = 0x4103, + NM_EVT_CAUSE_CRIT_TEMP_OCXO_MAX_FAIL = 0x4104, + NM_EVT_CAUSE_CRIT_TEMP_TRX0_MAX_FAIL = 0x4105, + NM_EVT_CAUSE_CRIT_TEMP_TRX1_MAX_FAIL = 0x4106, + NM_EVT_CAUSE_CRIT_TEMP_PA0_MAX_FAIL = 0x4107, + NM_EVT_CAUSE_CRIT_TEMP_PA1_MAX_FAIL = 0x4108, + NM_EVT_CAUSE_CRIT_SUPPLY_MAX_FAIL = 0x4109, + NM_EVT_CAUSE_CRIT_SUPPLY_MIN_FAIL = 0x410A, + NM_EVT_CAUSE_CRIT_VSWR0_MAX_FAIL = 0x410B, + NM_EVT_CAUSE_CRIT_VSWR1_MAX_FAIL = 0x410C, + NM_EVT_CAUSE_CRIT_PWR_SUPPLY_MAX_FAIL = 0x410D, + NM_EVT_CAUSE_CRIT_PWR_PA0_MAX_FAIL = 0x410E, + NM_EVT_CAUSE_CRIT_PWR_PA1_MAX_FAIL = 0x410F, + /* Warning causes */ + NM_EVT_CAUSE_WARN_TEMP_SUPPLY_LOW_FAIL = 0x4400, + NM_EVT_CAUSE_WARN_TEMP_SUPPLY_HIGH_FAIL = 0x4401, + NM_EVT_CAUSE_WARN_TEMP_FPGA_LOW_FAIL = 0x4402, + NM_EVT_CAUSE_WARN_TEMP_FPGA_HIGH_FAIL = 0x4403, + NM_EVT_CAUSE_WARN_TEMP_SOC_LOW_FAIL = 0x4404, + NM_EVT_CAUSE_WARN_TEMP_SOC_HIGH_FAIL = 0x4405, + NM_EVT_CAUSE_WARN_TEMP_RMS_DET_LOW_FAIL = 0x4406, + NM_EVT_CAUSE_WARN_TEMP_RMS_DET_HIGH_FAIL= 0x4407, + NM_EVT_CAUSE_WARN_TEMP_OCXO_LOW_FAIL = 0x4408, + NM_EVT_CAUSE_WARN_TEMP_OCXO_HIGH_FAIL = 0x4409, + NM_EVT_CAUSE_WARN_TEMP_TRX0_LOW_FAIL = 0x440A, + NM_EVT_CAUSE_WARN_TEMP_TRX0_HIGH_FAIL = 0x440B, + NM_EVT_CAUSE_WARN_TEMP_TRX1_LOW_FAIL = 0x440C, + NM_EVT_CAUSE_WARN_TEMP_TRX1_HIGH_FAIL = 0x440D, + NM_EVT_CAUSE_WARN_TEMP_PA0_LOW_FAIL = 0x440E, + NM_EVT_CAUSE_WARN_TEMP_PA0_HIGH_FAIL = 0x440F, + NM_EVT_CAUSE_WARN_TEMP_PA1_LOW_FAIL = 0x4410, + NM_EVT_CAUSE_WARN_TEMP_PA1_HIGH_FAIL = 0x4411, + NM_EVT_CAUSE_WARN_SUPPLY_LOW_FAIL = 0x4412, + NM_EVT_CAUSE_WARN_SUPPLY_HIGH_FAIL = 0x4413, + NM_EVT_CAUSE_WARN_VSWR0_HIGH_FAIL = 0x4414, + NM_EVT_CAUSE_WANR_VSWR1_HIGH_FAIL = 0x4415, + NM_EVT_CAUSE_WARN_PWR_SUPPLY_HIGH_FAIL = 0x4416, + NM_EVT_CAUSE_WARN_PWR_PA0_HIGH_FAIL = 0x4417, + NM_EVT_CAUSE_WARN_PWR_PA1_HIGH_FAIL = 0x4418, + NM_EVT_CAUSE_WARN_GPS_FIX_FAIL = 0x4419, +}; + +/* This defines the list of notification events for systemd service watchdog. + all these events must be notified in a certain service defined timeslot + or the service (this app) would be restarted (only if related systemd service + unit file has WatchdogSec!=0). + WARNING: swd events must begin with event 0. Last events must be + SWD_LAST (max 64 events in this list). +*/ +enum mgr_swd_events { + SWD_MAINLOOP = 0, + SWD_CHECK_SENSOR, + SWD_UPDATE_HOURS, + SWD_CHECK_TEMP_SENSOR, + SWD_CHECK_LED_CTRL, + SWD_CHECK_CALIB, + SWD_CHECK_BTS_CONNECTION, + SWD_LAST }; int lc15bts_mgr_vty_init(void); int lc15bts_mgr_parse_config(struct lc15bts_mgr_instance *mgr); int lc15bts_mgr_nl_init(void); -int lc15bts_mgr_temp_init(struct lc15bts_mgr_instance *mgr); -const char *lc15bts_mgr_temp_get_state(enum lc15bts_temp_state state); - +int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr); +const char *lc15bts_mgr_sensor_get_state(enum lc15bts_sensor_state state); int lc15bts_mgr_calib_init(struct lc15bts_mgr_instance *mgr); +int lc15bts_mgr_control_init(struct lc15bts_mgr_instance *mgr); int lc15bts_mgr_calib_run(struct lc15bts_mgr_instance *mgr); - +void lc15bts_mgr_dispatch_alarm(struct lc15bts_mgr_instance *mgr, const int cause, const char *key, const char *text); extern void *tall_mgr_ctx; #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 042fc87..9d2dfec 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -22,19 +22,22 @@ * along with this program. If not, see . * */ - +#include #include "misc/lc15bts_mgr.h" #include "misc/lc15bts_misc.h" #include "misc/lc15bts_temp.h" #include "misc/lc15bts_power.h" +#include "misc/lc15bts_led.h" +#include "limits.h" #include #include #include +#include -static struct lc15bts_mgr_instance *s_mgr; -static struct osmo_timer_list temp_ctrl_timer; +struct lc15bts_mgr_instance *s_mgr; +static struct osmo_timer_list sensor_ctrl_timer; static const struct value_string state_names[] = { { STATE_NORMAL, "NORMAL" }, @@ -44,12 +47,12 @@ { 0, NULL } }; -const char *lc15bts_mgr_temp_get_state(enum lc15bts_temp_state state) +const char *lc15bts_mgr_sensor_get_state(enum lc15bts_sensor_state state) { return get_value_string(state_names, state); } -static int next_state(enum lc15bts_temp_state current_state, int critical, int warning) +static int next_state(enum lc15bts_sensor_state current_state, int critical, int warning) { int next_state = -1; switch (current_state) { @@ -85,7 +88,7 @@ static void handle_normal_actions(int actions) { /* switch on the PA */ - if (actions & TEMP_ACT_NORM_PA0_ON) { + if (actions & SENSOR_ACT_NORM_PA0_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA0, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch on the PA #0\n"); @@ -95,7 +98,7 @@ } } - if (actions & TEMP_ACT_NORM_PA1_ON) { + if (actions & SENSOR_ACT_NORM_PA1_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch on the PA #1\n"); @@ -105,7 +108,7 @@ } } - if (actions & TEMP_ACT_NORM_BTS_SRV_ON) { + if (actions & SENSOR_ACT_NORM_BTS_SRV_ON) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch on the BTS service\n"); /* @@ -120,7 +123,7 @@ static void handle_actions(int actions) { /* switch off the PA */ - if (actions & TEMP_ACT_PA1_OFF) { + if (actions & SENSOR_ACT_PA1_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch off the PA #1. Stop BTS?\n"); @@ -130,7 +133,7 @@ } } - if (actions & TEMP_ACT_PA0_OFF) { + if (actions & SENSOR_ACT_PA0_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA0, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to switch off the PA #0. Stop BTS?\n"); @@ -140,7 +143,7 @@ } } - if (actions & TEMP_ACT_BTS_SRV_OFF) { + if (actions & SENSOR_ACT_BTS_SRV_OFF) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch off the BTS service\n"); /* @@ -161,36 +164,36 @@ */ static void execute_normal_act(struct lc15bts_mgr_instance *manager) { - LOGP(DTEMP, LOGL_NOTICE, "System is back to normal temperature.\n"); - handle_normal_actions(manager->temp.action_norm); + LOGP(DTEMP, LOGL_NOTICE, "System is back to normal state.\n"); + handle_normal_actions(manager->state.action_norm); } static void execute_warning_act(struct lc15bts_mgr_instance *manager) { - LOGP(DTEMP, LOGL_NOTICE, "System has reached temperature warning.\n"); - handle_actions(manager->temp.action_warn); + LOGP(DTEMP, LOGL_NOTICE, "System has reached warning state.\n"); + handle_actions(manager->state.action_warn); } static void execute_critical_act(struct lc15bts_mgr_instance *manager) { LOGP(DTEMP, LOGL_NOTICE, "System has reached critical warning.\n"); - handle_actions(manager->temp.action_crit); + handle_actions(manager->state.action_crit); } -static void lc15bts_mgr_temp_handle(struct lc15bts_mgr_instance *manager, +static void lc15bts_mgr_sensor_handle(struct lc15bts_mgr_instance *manager, int critical, int warning) { - int new_state = next_state(manager->temp.state, critical, warning); + int new_state = next_state(manager->state.state, critical, warning); /* Nothing changed */ if (new_state < 0) return; LOGP(DTEMP, LOGL_NOTICE, "Moving from state %s to %s.\n", - get_value_string(state_names, manager->temp.state), + get_value_string(state_names, manager->state.state), get_value_string(state_names, new_state)); - manager->temp.state = new_state; - switch (manager->temp.state) { + manager->state.state = new_state; + switch (manager->state.state) { case STATE_NORMAL: execute_normal_act(manager); break; @@ -206,163 +209,168 @@ }; } -static void temp_ctrl_check() +static void sensor_ctrl_check(struct lc15bts_mgr_instance *mgr) { int rc; + int temp = 0; int warn_thresh_passed = 0; int crit_thresh_passed = 0; LOGP(DTEMP, LOGL_DEBUG, "Going to check the temperature.\n"); /* Read the current supply temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY); + rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the supply temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.supply_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.supply_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.supply_limit.thresh_crit) + if (temp > mgr->temp.supply_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "Supply temperature is: %d\n", temp); } /* Read the current SoC temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SOC); + rc = lc15bts_temp_get(LC15BTS_TEMP_SOC, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the SoC temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.soc_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.soc_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.soc_limit.thresh_crit) + if (temp > mgr->temp.soc_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "SoC temperature is: %d\n", temp); } /* Read the current fpga temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA); + rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the fpga temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.fpga_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.fpga_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.fpga_limit.thresh_crit) + if (temp > mgr->temp.fpga_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "FPGA temperature is: %d\n", temp); } - /* Read the current RF log detector temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_LOGRF); + /* Read the current RMS detector temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_RMSDET, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the RF log detector temperature. rc=%d\n", rc); + "Failed to read the RMS detector temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.logrf_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.rmsdet_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.logrf_limit.thresh_crit) + if (temp > mgr->temp.rmsdet_temp_limit.thresh_crit_max) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "RF log detector temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "RMS detector temperature is: %d\n", temp); } /* Read the current OCXO temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO); + rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the OCXO temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.ocxo_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.ocxo_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.ocxo_limit.thresh_crit) + if (temp > mgr->temp.ocxo_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "OCXO temperature is: %d\n", temp); } - /* Read the current TX #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX0); + /* Read the current TX #0 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX0, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.tx0_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.tx0_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx0_limit.thresh_crit) + if (temp > mgr->temp.tx0_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "TX #0 temperature is: %d\n", temp); } - /* Read the current TX #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX1); + /* Read the current TX #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX1, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #1 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.tx1_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.tx1_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx1_limit.thresh_crit) + if (temp > mgr->temp.tx1_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "TX #1 temperature is: %d\n", temp); } - /* Read the current PA #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA0); + /* Read the current PA #0 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA0, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa0_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.pa0_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa0_limit.thresh_crit) + if (temp > mgr->temp.pa0_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #0 temperature is: %d\n", temp); } - /* Read the current PA #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA1); + /* Read the current PA #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA1, &temp); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #1 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa1_limit.thresh_warn) + temp = temp / 1000; + if (temp > mgr->temp.pa1_temp_limit.thresh_warn_max) warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa1_limit.thresh_crit) + if (temp > mgr->temp.pa1_temp_limit.thresh_crit_max) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #1 temperature is: %d\n", temp); } - lc15bts_mgr_temp_handle(s_mgr, crit_thresh_passed, warn_thresh_passed); + lc15bts_mgr_sensor_handle(mgr, crit_thresh_passed, warn_thresh_passed); } -static void temp_ctrl_check_cb(void *unused) +static void sensor_ctrl_check_cb(void *_data) { - temp_ctrl_check(); - /* Check every two minutes? XXX make it configurable! */ - osmo_timer_schedule(&temp_ctrl_timer, 2 * 60, 0); + struct lc15bts_mgr_instance *mgr = _data; + sensor_ctrl_check(mgr); + /* Check every minute? XXX make it configurable! */ + osmo_timer_schedule(&sensor_ctrl_timer, LC15BTS_SENSOR_TIMER_DURATION, 0); + LOGP(DTEMP, LOGL_DEBUG,"Check sensors timer expired\n"); + /* TODO: do we want to notify if some sensors could not be read? */ } -int lc15bts_mgr_temp_init(struct lc15bts_mgr_instance *mgr) +int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr) { s_mgr = mgr; - temp_ctrl_timer.cb = temp_ctrl_check_cb; - temp_ctrl_check_cb(NULL); + sensor_ctrl_timer.cb = sensor_ctrl_check_cb; + sensor_ctrl_timer.data = s_mgr; + sensor_ctrl_check_cb(s_mgr); return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index 280c9c7..b96349e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -43,6 +44,7 @@ #include "lc15bts_mgr.h" #include "lc15bts_temp.h" #include "lc15bts_power.h" +#include "lc15bts_led.h" #include "btsconfig.h" static struct lc15bts_mgr_instance *s_mgr; @@ -64,15 +66,21 @@ case ACT_NORM_NODE: case ACT_WARN_NODE: case ACT_CRIT_NODE: - case LIMIT_SUPPLY_NODE: + case LIMIT_SUPPLY_TEMP_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_LOGRF_NODE: + case LIMIT_RMSDET_NODE: case LIMIT_OCXO_NODE: - case LIMIT_TX0_NODE: - case LIMIT_TX1_NODE: - case LIMIT_PA0_NODE: - case LIMIT_PA1_NODE: + case LIMIT_TX0_TEMP_NODE: + case LIMIT_TX1_TEMP_NODE: + case LIMIT_PA0_TEMP_NODE: + case LIMIT_PA1_TEMP_NODE: + case LIMIT_SUPPLY_VOLT_NODE: + case LIMIT_TX0_VSWR_NODE: + case LIMIT_TX1_VSWR_NODE: + case LIMIT_SUPPLY_PWR_NODE: + case LIMIT_PA0_PWR_NODE: + case LIMIT_PA1_PWR_NODE: vty->node = MGR_NODE; break; default: @@ -88,15 +96,21 @@ case ACT_NORM_NODE: case ACT_WARN_NODE: case ACT_CRIT_NODE: - case LIMIT_SUPPLY_NODE: + case LIMIT_SUPPLY_TEMP_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_LOGRF_NODE: + case LIMIT_RMSDET_NODE: case LIMIT_OCXO_NODE: - case LIMIT_TX0_NODE: - case LIMIT_TX1_NODE: - case LIMIT_PA0_NODE: - case LIMIT_PA1_NODE: + case LIMIT_TX0_TEMP_NODE: + case LIMIT_TX1_TEMP_NODE: + case LIMIT_PA0_TEMP_NODE: + case LIMIT_PA1_TEMP_NODE: + case LIMIT_SUPPLY_VOLT_NODE: + case LIMIT_TX0_VSWR_NODE: + case LIMIT_TX1_VSWR_NODE: + case LIMIT_SUPPLY_PWR_NODE: + case LIMIT_PA0_PWR_NODE: + case LIMIT_PA1_PWR_NODE: return 1; default: return 0; @@ -122,25 +136,25 @@ static struct cmd_node act_norm_node = { ACT_NORM_NODE, - "%s(action-normal)# ", + "%s(actions-normal)# ", 1, }; static struct cmd_node act_warn_node = { ACT_WARN_NODE, - "%s(action-warn)# ", + "%s(actions-warn)# ", 1, }; static struct cmd_node act_crit_node = { ACT_CRIT_NODE, - "%s(action-critical)# ", + "%s(actions-critical)# ", 1, }; -static struct cmd_node limit_supply_node = { - LIMIT_SUPPLY_NODE, - "%s(limit-supply)# ", +static struct cmd_node limit_supply_temp_node = { + LIMIT_SUPPLY_TEMP_NODE, + "%s(limit-supply-temp)# ", 1, }; @@ -156,9 +170,9 @@ 1, }; -static struct cmd_node limit_logrf_node = { - LIMIT_LOGRF_NODE, - "%s(limit-logrf)# ", +static struct cmd_node limit_rmsdet_node = { + LIMIT_RMSDET_NODE, + "%s(limit-rmsdet)# ", 1, }; @@ -168,24 +182,60 @@ 1, }; -static struct cmd_node limit_tx0_node = { - LIMIT_TX0_NODE, - "%s(limit-tx0)# ", +static struct cmd_node limit_tx0_temp_node = { + LIMIT_TX0_TEMP_NODE, + "%s(limit-tx0-temp)# ", 1, }; -static struct cmd_node limit_tx1_node = { - LIMIT_TX1_NODE, - "%s(limit-tx1)# ", +static struct cmd_node limit_tx1_temp_node = { + LIMIT_TX1_TEMP_NODE, + "%s(limit-tx1-temp)# ", 1, }; -static struct cmd_node limit_pa0_node = { - LIMIT_PA0_NODE, - "%s(limit-pa0)# ", +static struct cmd_node limit_pa0_temp_node = { + LIMIT_PA0_TEMP_NODE, + "%s(limit-pa0-temp)# ", 1, }; -static struct cmd_node limit_pa1_node = { - LIMIT_PA1_NODE, - "%s(limit-pa1)# ", +static struct cmd_node limit_pa1_temp_node = { + LIMIT_PA1_TEMP_NODE, + "%s(limit-pa1-temp)# ", + 1, +}; +static struct cmd_node limit_supply_volt_node = { + LIMIT_SUPPLY_VOLT_NODE, + "%s(limit-supply-volt)# ", + 1, +}; +static struct cmd_node limit_tx0_vswr_node = { + LIMIT_TX0_VSWR_NODE, + "%s(limit-tx0-vswr)# ", + 1, +}; +static struct cmd_node limit_tx1_vswr_node = { + LIMIT_TX1_VSWR_NODE, + "%s(limit-tx1-vswr)# ", + 1, +}; +static struct cmd_node limit_supply_pwr_node = { + LIMIT_SUPPLY_PWR_NODE, + "%s(limit-supply-pwr)# ", + 1, +}; +static struct cmd_node limit_pa0_pwr_node = { + LIMIT_PA0_PWR_NODE, + "%s(limit-pa0-pwr)# ", + 1, +}; +static struct cmd_node limit_pa1_pwr_node = { + LIMIT_PA1_PWR_NODE, + "%s(limit-pa1-pwr)# ", + 1, +}; + +static struct cmd_node limit_gps_fix_node = { + LIMIT_GPS_FIX_NODE, + "%s(limit-gps-fix)# ", 1, }; @@ -197,55 +247,68 @@ return CMD_SUCCESS; } -static void write_temp_limit(struct vty *vty, const char *name, - struct lc15bts_temp_limit *limit) +static void write_volt_limit(struct vty *vty, const char *name, + struct lc15bts_volt_limit *limit) { vty_out(vty, " %s%s", name, VTY_NEWLINE); - vty_out(vty, " threshold warning %d%s", - limit->thresh_warn, VTY_NEWLINE); - vty_out(vty, " threshold critical %d%s", - limit->thresh_crit, VTY_NEWLINE); + vty_out(vty, " threshold warning min %d%s", + limit->thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " threshold critical min %d%s", + limit->thresh_crit_min, VTY_NEWLINE); +} + +static void write_vswr_limit(struct vty *vty, const char *name, + struct lc15bts_vswr_limit *limit) +{ + vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " threshold warning max %d%s", + limit->thresh_warn_max, VTY_NEWLINE); +} + +static void write_pwr_limit(struct vty *vty, const char *name, + struct lc15bts_pwr_limit *limit) +{ + vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " threshold warning max %d%s", + limit->thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " threshold critical max %d%s", + limit->thresh_crit_max, VTY_NEWLINE); } static void write_norm_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); vty_out(vty, " %spa0-on%s", - (actions & TEMP_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-on%s", - (actions & TEMP_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-on%s", - (actions & TEMP_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); } static void write_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); vty_out(vty, " %spa0-off%s", - (actions & TEMP_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-off%s", - (actions & TEMP_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-off%s", - (actions & TEMP_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); + (actions & SENSOR_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); } static int config_write_mgr(struct vty *vty) { vty_out(vty, "lc15bts-mgr%s", VTY_NEWLINE); - write_temp_limit(vty, "limits supply", &s_mgr->temp.supply_limit); - write_temp_limit(vty, "limits soc", &s_mgr->temp.soc_limit); - write_temp_limit(vty, "limits fpga", &s_mgr->temp.fpga_limit); - write_temp_limit(vty, "limits logrf", &s_mgr->temp.logrf_limit); - write_temp_limit(vty, "limits ocxo", &s_mgr->temp.ocxo_limit); - write_temp_limit(vty, "limits tx0", &s_mgr->temp.tx0_limit); - write_temp_limit(vty, "limits tx1", &s_mgr->temp.tx1_limit); - write_temp_limit(vty, "limits pa0", &s_mgr->temp.pa0_limit); - write_temp_limit(vty, "limits pa1", &s_mgr->temp.pa1_limit); + write_volt_limit(vty, "limits supply_volt", &s_mgr->volt.supply_volt_limit); + write_pwr_limit(vty, "limits supply_pwr", &s_mgr->pwr.supply_pwr_limit); + write_vswr_limit(vty, "limits tx0_vswr", &s_mgr->vswr.tx0_vswr_limit); + write_vswr_limit(vty, "limits tx1_vswr", &s_mgr->vswr.tx1_vswr_limit); - write_norm_action(vty, "actions normal", s_mgr->temp.action_norm); - write_action(vty, "actions warn", s_mgr->temp.action_warn); - write_action(vty, "actions critical", s_mgr->temp.action_crit); + write_norm_action(vty, "actions normal", s_mgr->state.action_norm); + write_action(vty, "actions warn", s_mgr->state.action_warn); + write_action(vty, "actions critical", s_mgr->state.action_crit); return CMD_SUCCESS; } @@ -255,7 +318,7 @@ return CMD_SUCCESS; } -#define CFG_LIMIT(name, expl, switch_to, variable) \ +#define CFG_LIMIT_TEMP(name, expl, switch_to, variable) \ DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ "limits " #name, \ "Configure Limits\n" expl) \ @@ -265,32 +328,123 @@ return CMD_SUCCESS; \ } -CFG_LIMIT(supply, "SUPPLY\n", LIMIT_SUPPLY_NODE, supply_limit) -CFG_LIMIT(soc, "SOC\n", LIMIT_SOC_NODE, soc_limit) -CFG_LIMIT(fpga, "FPGA\n", LIMIT_FPGA_NODE, fpga_limit) -CFG_LIMIT(logrf, "LOGRF\n", LIMIT_LOGRF_NODE, logrf_limit) -CFG_LIMIT(ocxo, "OCXO\n", LIMIT_OCXO_NODE, ocxo_limit) -CFG_LIMIT(tx0, "TX0\n", LIMIT_TX0_NODE, tx0_limit) -CFG_LIMIT(tx1, "TX1\n", LIMIT_TX1_NODE, tx1_limit) -CFG_LIMIT(pa0, "PA0\n", LIMIT_PA0_NODE, pa0_limit) -CFG_LIMIT(pa1, "PA1\n", LIMIT_PA1_NODE, pa1_limit) -#undef CFG_LIMIT +CFG_LIMIT_TEMP(supply_temp, "SUPPLY TEMP\n", LIMIT_SUPPLY_TEMP_NODE, supply_temp_limit) +CFG_LIMIT_TEMP(soc_temp, "SOC TEMP\n", LIMIT_SOC_NODE, soc_temp_limit) +CFG_LIMIT_TEMP(fpga_temp, "FPGA TEMP\n", LIMIT_FPGA_NODE, fpga_temp_limit) +CFG_LIMIT_TEMP(rmsdet_temp, "RMSDET TEMP\n", LIMIT_RMSDET_NODE, rmsdet_temp_limit) +CFG_LIMIT_TEMP(ocxo_temp, "OCXO TEMP\n", LIMIT_OCXO_NODE, ocxo_temp_limit) +CFG_LIMIT_TEMP(tx0_temp, "TX0 TEMP\n", LIMIT_TX0_TEMP_NODE, tx0_temp_limit) +CFG_LIMIT_TEMP(tx1_temp, "TX1 TEMP\n", LIMIT_TX1_TEMP_NODE, tx1_temp_limit) +CFG_LIMIT_TEMP(pa0_temp, "PA0 TEMP\n", LIMIT_PA0_TEMP_NODE, pa0_temp_limit) +CFG_LIMIT_TEMP(pa1_temp, "PA1 TEMP\n", LIMIT_PA1_TEMP_NODE, pa1_temp_limit) +#undef CFG_LIMIT_TEMP -DEFUN(cfg_limit_warning, cfg_thresh_warning_cmd, - "threshold warning <0-200>", +#define CFG_LIMIT_VOLT(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->volt.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_VOLT(supply_volt, "SUPPLY VOLT\n", LIMIT_SUPPLY_VOLT_NODE, supply_volt_limit) +#undef CFG_LIMIT_VOLT + +#define CFG_LIMIT_VSWR(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->vswr.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_VSWR(tx0_vswr, "TX0 VSWR\n", LIMIT_TX0_VSWR_NODE, tx0_vswr_limit) +CFG_LIMIT_VSWR(tx1_vswr, "TX1 VSWR\n", LIMIT_TX1_VSWR_NODE, tx1_vswr_limit) +#undef CFG_LIMIT_VSWR + +#define CFG_LIMIT_PWR(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->pwr.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_PWR(supply_pwr, "SUPPLY PWR\n", LIMIT_SUPPLY_PWR_NODE, supply_pwr_limit) +CFG_LIMIT_PWR(pa0_pwr, "PA0 PWR\n", LIMIT_PA0_PWR_NODE, pa0_pwr_limit) +CFG_LIMIT_PWR(pa1_pwr, "PA1 PWR\n", LIMIT_PA1_PWR_NODE, pa1_pwr_limit) +#undef CFG_LIMIT_PWR + +#define CFG_LIMIT_GPS_FIX(name, expl, switch_to, variable) \ +DEFUN(cfg_limit_##name, cfg_limit_##name##_cmd, \ + "limits " #name, \ + "Configure Limits\n" expl) \ +{ \ + vty->node = switch_to; \ + vty->index = &s_mgr->gps.variable; \ + return CMD_SUCCESS; \ +} + +CFG_LIMIT_GPS_FIX(gps_fix, "GPS FIX\n", LIMIT_GPS_FIX_NODE, gps_fix_limit) +#undef CFG_LIMIT_GPS_FIX + +DEFUN(cfg_limit_volt_warn_min, cfg_thresh_volt_warn_min_cmd, + "threshold warning min <0-48000>", "Threshold to reach\n" "Warning level\n" "Range\n") { - struct lc15bts_temp_limit *limit = vty->index; - limit->thresh_warn = atoi(argv[0]); + struct lc15bts_volt_limit *limit = vty->index; + limit->thresh_warn_min = atoi(argv[0]); return CMD_SUCCESS; } -DEFUN(cfg_limit_crit, cfg_thresh_crit_cmd, - "threshold critical <0-200>", - "Threshold to reach\n" "Severe level\n" "Range\n") +DEFUN(cfg_limit_volt_crit_min, cfg_thresh_volt_crit_min_cmd, + "threshold critical min <0-48000>", + "Threshold to reach\n" "Critical level\n" "Range\n") { - struct lc15bts_temp_limit *limit = vty->index; - limit->thresh_crit = atoi(argv[0]); + struct lc15bts_volt_limit *limit = vty->index; + limit->thresh_crit_min = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_vswr_warn_max, cfg_thresh_vswr_warn_max_cmd, + "threshold warning max <1000-200000>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_vswr_limit *limit = vty->index; + limit->thresh_warn_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_vswr_crit_max, cfg_thresh_vswr_crit_max_cmd, + "threshold critical max <1000-200000>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_vswr_limit *limit = vty->index; + limit->thresh_crit_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_pwr_warn_max, cfg_thresh_pwr_warn_max_cmd, + "threshold warning max <0-200>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_pwr_limit *limit = vty->index; + limit->thresh_warn_max = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_limit_pwr_crit_max, cfg_thresh_pwr_crit_max_cmd, + "threshold critical max <0-200>", + "Threshold to reach\n" "Warning level\n" "Range\n") +{ + struct lc15bts_pwr_limit *limit = vty->index; + limit->thresh_crit_max = atoi(argv[0]); return CMD_SUCCESS; } @@ -300,7 +454,7 @@ "Configure Actions\n" expl) \ { \ vty->node = switch_to; \ - vty->index = &s_mgr->temp.variable; \ + vty->index = &s_mgr->state.variable; \ return CMD_SUCCESS; \ } CFG_ACTION(normal, "Normal Actions\n", ACT_NORM_NODE, action_norm) @@ -313,7 +467,7 @@ "Switch the Power Amplifier #0 on\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_PA0_ON; + *action |= SENSOR_ACT_NORM_PA0_ON; return CMD_SUCCESS; } @@ -322,7 +476,7 @@ NO_STR "Switch the Power Amplifieri #0 on\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA0_ON; + *action &= ~SENSOR_ACT_NORM_PA0_ON; return CMD_SUCCESS; } @@ -331,7 +485,7 @@ "Switch the Power Amplifier #1 on\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_PA1_ON; + *action |= SENSOR_ACT_NORM_PA1_ON; return CMD_SUCCESS; } @@ -340,7 +494,7 @@ NO_STR "Switch the Power Amplifieri #1 on\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA1_ON; + *action &= ~SENSOR_ACT_NORM_PA1_ON; return CMD_SUCCESS; } @@ -349,7 +503,7 @@ "Start the systemd lc15bts.service\n") { int *action = vty->index; - *action |= TEMP_ACT_NORM_BTS_SRV_ON; + *action |= SENSOR_ACT_NORM_BTS_SRV_ON; return CMD_SUCCESS; } @@ -358,7 +512,7 @@ NO_STR "Start the systemd lc15bts.service\n") { int *action = vty->index; - *action &= ~TEMP_ACT_NORM_BTS_SRV_ON; + *action &= ~SENSOR_ACT_NORM_BTS_SRV_ON; return CMD_SUCCESS; } @@ -367,7 +521,7 @@ "Switch the Power Amplifier #0 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA0_OFF; + *action |= SENSOR_ACT_PA0_OFF; return CMD_SUCCESS; } @@ -376,7 +530,7 @@ NO_STR "Do not switch off the Power Amplifier #0\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA0_OFF; + *action &= ~SENSOR_ACT_PA0_OFF; return CMD_SUCCESS; } @@ -385,7 +539,7 @@ "Switch the Power Amplifier #1 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA1_OFF; + *action |= SENSOR_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -394,7 +548,7 @@ NO_STR "Do not switch off the Power Amplifier #1\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA1_OFF; + *action &= ~SENSOR_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -403,7 +557,7 @@ "Stop the systemd lc15bts.service\n") { int *action = vty->index; - *action |= TEMP_ACT_BTS_SRV_OFF; + *action |= SENSOR_ACT_BTS_SRV_OFF; return CMD_SUCCESS; } @@ -412,71 +566,173 @@ NO_STR "Stop the systemd lc15bts.service\n") { int *action = vty->index; - *action &= ~TEMP_ACT_BTS_SRV_OFF; + *action &= ~SENSOR_ACT_BTS_SRV_OFF; return CMD_SUCCESS; } DEFUN(show_mgr, show_mgr_cmd, "show manager", SHOW_STR "Display information about the manager") { + int temp, volt, current, power, vswr; + vty_out(vty, "Warning alarm flags: 0x%08x%s", + s_mgr->lc15bts_ctrl.warn_flags, VTY_NEWLINE); + vty_out(vty, "Critical alarm flags: 0x%08x%s", + s_mgr->lc15bts_ctrl.crit_flags, VTY_NEWLINE); + vty_out(vty, "Preventive action retried: %d%s", + s_mgr->alarms.preventive_retry, VTY_NEWLINE); vty_out(vty, "Temperature control state: %s%s", - lc15bts_mgr_temp_get_state(s_mgr->temp.state), VTY_NEWLINE); + lc15bts_mgr_sensor_get_state(s_mgr->state.state), VTY_NEWLINE); vty_out(vty, "Current Temperatures%s", VTY_NEWLINE); - vty_out(vty, " Main Supply : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SUPPLY) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, &temp); + vty_out(vty, " Main Supply : %4.2f Celcius%s", + temp/ 1000.0f, VTY_NEWLINE); - vty_out(vty, " SoC : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SOC) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SOC, &temp); + vty_out(vty, " SoC : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " FPGA : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_FPGA) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_FPGA, &temp); + vty_out(vty, " FPGA : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " LogRF : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_LOGRF) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_RMSDET, &temp); + vty_out(vty, " RMSDet : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " OCXO : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_OCXO) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_OCXO, &temp); + vty_out(vty, " OCXO : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 0 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX0) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX0, &temp); + vty_out(vty, " TX 0 : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 1 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX1) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX1, &temp); + vty_out(vty, " TX 1 : %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Power Amp #0: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA0) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA0, &temp); + vty_out(vty, " Power Amp #0: %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Power Amp #1: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA1) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA1, &temp); + vty_out(vty, " Power Amp #1: %4.2f Celcius%s", + temp / 1000.0f, VTY_NEWLINE); vty_out(vty, "Power Status%s", VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Main Supply : ON [%6.2f Vdc, %4.2f A, %6.2f W]%s", - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Power Amp #0: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_get(LC15BTS_POWER_PA0) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA0, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_VOLTAGE, &volt); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_CURRENT, ¤t); + lc15bts_power_sensor_get(LC15BTS_POWER_PA1, + LC15BTS_POWER_POWER, &power); vty_out(vty, " Power Amp #1: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_get(LC15BTS_POWER_PA1) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_POWER)/1000000.0f, + volt /1000.0f, + current /1000.0f, + power /1000000.0f, VTY_NEWLINE); + vty_out(vty, "VSWR Status%s", VTY_NEWLINE); + lc15bts_vswr_get(LC15BTS_VSWR_TX0, &vswr); + vty_out(vty, " VSWR TX 0: %f %s", + vswr / 1000.0f, + VTY_NEWLINE); + lc15bts_vswr_get(LC15BTS_VSWR_TX1, &vswr); + vty_out(vty, " VSWR TX 1: %f %s", + vswr / 1000.0f, + VTY_NEWLINE); + + return CMD_SUCCESS; +} + +DEFUN(show_thresh, show_thresh_cmd, "show thresholds", + SHOW_STR "Display information about the thresholds") +{ + vty_out(vty, "Temperature limits (Celsius)%s", VTY_NEWLINE); + vty_out(vty, " Main supply%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.supply_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.supply_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.supply_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " SoC%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.soc_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.soc_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.soc_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " FPGA%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.fpga_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.fpga_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.fpga_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " RMSDet%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.rmsdet_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " OCXO%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.ocxo_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " TX0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.tx0_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.tx0_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.tx0_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " TX1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.tx1_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.tx1_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.tx1_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " PA0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.pa0_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.pa0_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.pa0_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " PA1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->temp.pa1_temp_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->temp.pa1_temp_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->temp.pa1_temp_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, "Power limits%s", VTY_NEWLINE); + vty_out(vty, " Main supply (mV)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->volt.supply_volt_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->volt.supply_volt_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " Warning min : %d%s",s_mgr->volt.supply_volt_limit.thresh_warn_min, VTY_NEWLINE); + vty_out(vty, " Critical min : %d%s",s_mgr->volt.supply_volt_limit.thresh_crit_min, VTY_NEWLINE); + vty_out(vty, " Main supply power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.supply_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.supply_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " PA0 power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.pa0_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.pa0_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " PA1 power (W)%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->pwr.pa1_pwr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->pwr.pa1_pwr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, "VSWR limits%s", VTY_NEWLINE); + vty_out(vty, " TX0%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->vswr.tx0_vswr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->vswr.tx0_vswr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, " TX1%s", VTY_NEWLINE); + vty_out(vty, " Critical max : %d%s",s_mgr->vswr.tx1_vswr_limit.thresh_crit_max, VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->vswr.tx1_vswr_limit.thresh_warn_max, VTY_NEWLINE); + vty_out(vty, "Days since last GPS 3D fix%s", VTY_NEWLINE); + vty_out(vty, " Warning max : %d%s",s_mgr->gps.gps_fix_limit.thresh_warn_max, VTY_NEWLINE); return CMD_SUCCESS; } @@ -493,10 +749,153 @@ return CMD_SUCCESS; } -static void register_limit(int limit) +DEFUN(set_led_pattern, set_led_pattern_cmd, + "set led pattern <0-255>", + "Set LED pattern\n" + "Set LED pattern for debugging purpose only. This pattern will be overridden after 60 seconds by LED pattern of actual system state\n") { - install_element(limit, &cfg_thresh_warning_cmd); - install_element(limit, &cfg_thresh_crit_cmd); + int pattern_id = atoi(argv[0]); + + if ((pattern_id < 0) || (pattern_id > BLINK_PATTERN_MAX_ITEM)) { + vty_out(vty, "%%Invalid LED pattern ID. It must be in range of %d..%d %s", 0, BLINK_PATTERN_MAX_ITEM - 1, VTY_NEWLINE); + return CMD_WARNING; + } + + led_set(s_mgr, pattern_id); + return CMD_SUCCESS; +} + +DEFUN(force_mgr_state, force_mgr_state_cmd, + "force manager state <0-255>", + "Force BTS manager state\n" + "Force BTS manager state for debugging purpose only\n") +{ + int state = atoi(argv[0]); + + if ((state < 0) || (state > STATE_CRITICAL)) { + vty_out(vty, "%%Invalid BTS manager state. It must be in range of %d..%d %s", 0, STATE_CRITICAL, VTY_NEWLINE); + return CMD_WARNING; + } + + s_mgr->state.state = state; + return CMD_SUCCESS; +} + +#define LIMIT_TEMP(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_temp_##name##_##variable, limit_temp_##name##_##variable##_cmd, \ + "limit temp " #name " " #criticity " " #min_max " <-200-200>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->temp.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(supply, supply_temp_limit, "SUPPLY TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(soc, supply_temp_limit, "SOC TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(fpga, fpga_temp_limit, "FPGA TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(rmsdet, rmsdet_temp_limit, "RMSDET TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(ocxo, ocxo_temp_limit, "OCXO TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(tx0, tx0_temp_limit, "TX0 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(tx1, tx1_temp_limit, "TX1 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(pa0, pa0_temp_limit, "PA0 TEMP\n", thresh_warn_min, warning, min) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_warn_max, warning, max) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_crit_max, critical, max) +LIMIT_TEMP(pa1, pa1_temp_limit, "PA1 TEMP\n", thresh_warn_min, warning, min) +#undef LIMIT_TEMP + +#define LIMIT_VOLT(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_volt_##name##_##variable, limit_volt_##name##_##variable##_cmd, \ + "limit " #name " " #criticity " " #min_max " <0-48000>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->volt.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_warn_max, warning, max) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_crit_max, critical, max) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_warn_min, warning, min) +LIMIT_VOLT(supply, supply_volt_limit, "SUPPLY VOLT\n", thresh_crit_min, critical, min) +#undef LIMIT_VOLT + +#define LIMIT_PWR(name, limit, expl, variable, criticity, min_max) \ + DEFUN(limit_pwr_##name##_##variable, limit_pwr_##name##_##variable##_cmd, \ + "limit power " #name " " #criticity " " #min_max " <0-200>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->pwr.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_PWR(supply, supply_pwr_limit, "SUPPLY PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(supply, supply_pwr_limit, "SUPPLY PWR\n", thresh_crit_max, critical, max) +LIMIT_PWR(pa0, pa0_pwr_limit, "PA0 PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(pa0, pa0_pwr_limit, "PA0 PWR\n", thresh_crit_max, critical, max) +LIMIT_PWR(pa1, pa1_pwr_limit, "PA1 PWR\n", thresh_warn_max, warning, max) +LIMIT_PWR(pa1, pa1_pwr_limit, "PA1 PWR\n", thresh_crit_max, critical, max) +#undef LIMIT_PWR + +#define LIMIT_VSWR(name, limit, expl, variable, criticity, min_max) \ +DEFUN(limit_vswr_##name##_##variable, limit_vswr_##name##_##variable##_cmd, \ + "limit vswr " #name " " #criticity " " #min_max " <1000-200000>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->vswr.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_VSWR(tx0, tx0_vswr_limit, "TX0 VSWR\n", thresh_warn_max, warning, max) +LIMIT_VSWR(tx0, tx0_vswr_limit, "TX0 VSWR\n", thresh_crit_max, critical, max) +LIMIT_VSWR(tx1, tx1_vswr_limit, "TX1 VSWR\n", thresh_warn_max, warning, max) +LIMIT_VSWR(tx1, tx1_vswr_limit, "TX1 VSWR\n", thresh_crit_max, critical, max) +#undef LIMIT_VSWR + +#define LIMIT_GPSFIX(limit, expl, variable, criticity, min_max) \ +DEFUN(limit_gpsfix_##variable, limit_gpsfix_##variable##_cmd, \ + "limit gpsfix " #criticity " " #min_max " <0-365>", \ + "Limit to reach\n" expl) \ +{ \ + s_mgr->gps.limit.variable = atoi(argv[0]); \ + return CMD_SUCCESS; \ +} + +LIMIT_GPSFIX(gps_fix_limit, "GPS FIX\n", thresh_warn_max, warning, max) +#undef LIMIT_GPSFIX + +static void register_limit(int limit, uint32_t unit) +{ + switch (unit) { + case MGR_LIMIT_TYPE_VOLT: + install_element(limit, &cfg_thresh_volt_warn_min_cmd); + install_element(limit, &cfg_thresh_volt_crit_min_cmd); + break; + case MGR_LIMIT_TYPE_VSWR: + install_element(limit, &cfg_thresh_vswr_warn_max_cmd); + install_element(limit, &cfg_thresh_vswr_crit_max_cmd); + break; + case MGR_LIMIT_TYPE_PWR: + install_element(limit, &cfg_thresh_pwr_warn_max_cmd); + install_element(limit, &cfg_thresh_pwr_crit_max_cmd); + break; + default: + break; + } } static void register_normal_action(int act) @@ -519,11 +918,62 @@ install_element(act, &cfg_no_action_bts_srv_off_cmd); } +static void register_hidden_commands() +{ + install_element(ENABLE_NODE, &limit_temp_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_supply_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_soc_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_fpga_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_rmsdet_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_ocxo_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx0_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_tx1_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa0_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_temp_pa1_thresh_warn_min_cmd); + + install_element(ENABLE_NODE, &limit_volt_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_warn_min_cmd); + install_element(ENABLE_NODE, &limit_volt_supply_thresh_crit_min_cmd); + + install_element(ENABLE_NODE, &limit_pwr_supply_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_supply_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_pwr_pa1_thresh_crit_max_cmd); + + install_element(ENABLE_NODE, &limit_vswr_tx0_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx0_thresh_crit_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx1_thresh_warn_max_cmd); + install_element(ENABLE_NODE, &limit_vswr_tx1_thresh_crit_max_cmd); + + install_element(ENABLE_NODE, &limit_gpsfix_thresh_warn_max_cmd); +} + int lc15bts_mgr_vty_init(void) { vty_init(&vty_info); install_element_ve(&show_mgr_cmd); + install_element_ve(&show_thresh_cmd); install_element(ENABLE_NODE, &calibrate_clock_cmd); @@ -532,50 +982,73 @@ vty_install_default(MGR_NODE); /* install the limit nodes */ - install_node(&limit_supply_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_supply_cmd); - register_limit(LIMIT_SUPPLY_NODE); - vty_install_default(LIMIT_SUPPLY_NODE); + install_node(&limit_supply_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_temp_cmd); + vty_install_default(LIMIT_SUPPLY_TEMP_NODE); install_node(&limit_soc_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_soc_cmd); - register_limit(LIMIT_SOC_NODE); + install_element(MGR_NODE, &cfg_limit_soc_temp_cmd); vty_install_default(LIMIT_SOC_NODE); install_node(&limit_fpga_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_fpga_cmd); - register_limit(LIMIT_FPGA_NODE); + install_element(MGR_NODE, &cfg_limit_fpga_temp_cmd); vty_install_default(LIMIT_FPGA_NODE); - install_node(&limit_logrf_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_logrf_cmd); - register_limit(LIMIT_LOGRF_NODE); - vty_install_default(LIMIT_LOGRF_NODE); + install_node(&limit_rmsdet_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_rmsdet_temp_cmd); + vty_install_default(LIMIT_RMSDET_NODE); install_node(&limit_ocxo_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_ocxo_cmd); - register_limit(LIMIT_OCXO_NODE); + install_element(MGR_NODE, &cfg_limit_ocxo_temp_cmd); vty_install_default(LIMIT_OCXO_NODE); - install_node(&limit_tx0_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx0_cmd); - register_limit(LIMIT_TX0_NODE); - vty_install_default(LIMIT_TX0_NODE); + install_node(&limit_tx0_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_temp_cmd); + vty_install_default(LIMIT_TX0_TEMP_NODE); - install_node(&limit_tx1_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx1_cmd); - register_limit(LIMIT_TX1_NODE); - vty_install_default(LIMIT_TX1_NODE); + install_node(&limit_tx1_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx1_temp_cmd); + vty_install_default(LIMIT_TX1_TEMP_NODE); - install_node(&limit_pa0_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa0_cmd); - register_limit(LIMIT_PA0_NODE); - vty_install_default(LIMIT_PA0_NODE); + install_node(&limit_pa0_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_temp_cmd); + vty_install_default(LIMIT_PA0_TEMP_NODE); - install_node(&limit_pa1_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa1_cmd); - register_limit(LIMIT_PA1_NODE); - vty_install_default(LIMIT_PA1_NODE); + install_node(&limit_pa1_temp_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa1_temp_cmd); + vty_install_default(LIMIT_PA1_TEMP_NODE); + + install_node(&limit_supply_volt_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_volt_cmd); + register_limit(LIMIT_SUPPLY_VOLT_NODE, MGR_LIMIT_TYPE_VOLT); + vty_install_default(LIMIT_SUPPLY_VOLT_NODE); + + install_node(&limit_tx0_vswr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_vswr_cmd); + register_limit(LIMIT_TX0_VSWR_NODE, MGR_LIMIT_TYPE_VSWR); + vty_install_default(LIMIT_TX0_VSWR_NODE); + + install_node(&limit_tx1_vswr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx1_vswr_cmd); + register_limit(LIMIT_TX1_VSWR_NODE, MGR_LIMIT_TYPE_VSWR); + vty_install_default(LIMIT_TX1_VSWR_NODE); + + install_node(&limit_supply_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_supply_pwr_cmd); + register_limit(LIMIT_SUPPLY_PWR_NODE, MGR_LIMIT_TYPE_PWR); + vty_install_default(LIMIT_SUPPLY_PWR_NODE); + + install_node(&limit_pa0_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_pwr_cmd); + vty_install_default(LIMIT_PA0_PWR_NODE); + + install_node(&limit_pa1_pwr_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa1_pwr_cmd); + vty_install_default(LIMIT_PA1_PWR_NODE); + + install_node(&limit_gps_fix_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_gps_fix_cmd); + vty_install_default(LIMIT_GPS_FIX_NODE); /* install the normal node */ install_node(&act_norm_node, config_write_dummy); @@ -593,6 +1066,12 @@ register_action(ACT_CRIT_NODE); vty_install_default(ACT_CRIT_NODE); + /* install LED pattern command for debugging purpose */ + install_element_ve(&set_led_pattern_cmd); + install_element_ve(&force_mgr_state_cmd); + + register_hidden_commands(); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c index fa59b7c..2cedc5d 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c @@ -41,11 +41,13 @@ #include #include +#include "lc15bts_mgr.h" #include "btsconfig.h" #include "lc15bts_misc.h" #include "lc15bts_par.h" #include "lc15bts_mgr.h" #include "lc15bts_temp.h" +#include "lc15bts_power.h" /********************************************************************* * Temperature handling @@ -58,52 +60,111 @@ enum lc15bts_par ee_par; } temp_data[] = { { - .name = "supply", + .name = "supply_temp", .has_max = 1, .sensor = LC15BTS_TEMP_SUPPLY, .ee_par = LC15BTS_PAR_TEMP_SUPPLY_MAX, }, { - .name = "soc", + .name = "soc_temp", .has_max = 0, .sensor = LC15BTS_TEMP_SOC, .ee_par = LC15BTS_PAR_TEMP_SOC_MAX, }, { - .name = "fpga", + .name = "fpga_temp", .has_max = 0, .sensor = LC15BTS_TEMP_FPGA, .ee_par = LC15BTS_PAR_TEMP_FPGA_MAX, }, { - .name = "logrf", + .name = "rmsdet_temp", .has_max = 1, - .sensor = LC15BTS_TEMP_LOGRF, - .ee_par = LC15BTS_PAR_TEMP_LOGRF_MAX, + .sensor = LC15BTS_TEMP_RMSDET, + .ee_par = LC15BTS_PAR_TEMP_RMSDET_MAX, }, { - .name = "ocxo", + .name = "ocxo_temp", .has_max = 1, .sensor = LC15BTS_TEMP_OCXO, .ee_par = LC15BTS_PAR_TEMP_OCXO_MAX, }, { - .name = "tx0", + .name = "tx0_temp", .has_max = 0, .sensor = LC15BTS_TEMP_TX0, .ee_par = LC15BTS_PAR_TEMP_TX0_MAX, }, { - .name = "tx1", + .name = "tx1_temp", .has_max = 0, .sensor = LC15BTS_TEMP_TX1, .ee_par = LC15BTS_PAR_TEMP_TX1_MAX, }, { - .name = "pa0", + .name = "pa0_temp", .has_max = 1, .sensor = LC15BTS_TEMP_PA0, .ee_par = LC15BTS_PAR_TEMP_PA0_MAX, }, { - .name = "pa1", + .name = "pa1_temp", .has_max = 1, .sensor = LC15BTS_TEMP_PA1, .ee_par = LC15BTS_PAR_TEMP_PA1_MAX, } +}; + +static const struct { + const char *name; + int has_max; + enum lc15bts_power_source sensor_source; + enum lc15bts_power_type sensor_type; + enum lc15bts_par ee_par; +} power_data[] = { + { + .name = "supply_volt", + .has_max = 1, + .sensor_source = LC15BTS_POWER_SUPPLY, + .sensor_type = LC15BTS_POWER_VOLTAGE, + .ee_par = LC15BTS_PAR_VOLT_SUPPLY_MAX, + }, { + .name = "supply_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_SUPPLY, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_SUPPLY_MAX, + }, { + .name = "pa0_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_PA0, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_PA0_MAX, + }, { + .name = "pa1_pwr", + .has_max = 1, + .sensor_source = LC15BTS_POWER_PA1, + .sensor_type = LC15BTS_POWER_POWER, + .ee_par = LC15BTS_PAR_PWR_PA1_MAX, + } +}; + +static const struct { + const char *name; + int has_max; + enum lc15bts_vswr_sensor sensor; + enum lc15bts_par ee_par; +} vswr_data[] = { + { + .name = "tx0_vswr", + .has_max = 0, + .sensor = LC15BTS_VSWR_TX0, + .ee_par = LC15BTS_PAR_VSWR_TX0_MAX, + }, { + .name = "tx1_vswr", + .has_max = 0, + .sensor = LC15BTS_VSWR_TX1, + .ee_par = LC15BTS_PAR_VSWR_TX1_MAX, + } +}; + +static const struct value_string power_unit_strs[] = { + { LC15BTS_POWER_POWER, "W" }, + { LC15BTS_POWER_VOLTAGE, "V" }, + { 0, NULL } }; void lc15bts_check_temp(int no_rom_write) @@ -117,7 +178,7 @@ rc = lc15bts_par_get_int(tall_mgr_ctx, temp_data[i].ee_par, &ret); temp_old[i] = ret * 1000; - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor); + lc15bts_temp_get(temp_data[i].sensor, &temp_cur[i]); if (temp_cur[i] < 0 && temp_cur[i] > -1000) { LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d): unexpected value %d\n", temp_data[i].sensor, temp_cur[i]); @@ -143,6 +204,91 @@ } } +void lc15bts_check_power(int no_rom_write) +{ + int power_old[ARRAY_SIZE(power_data)]; + int power_cur[ARRAY_SIZE(power_data)]; + int i, rc; + int div_ratio; + + for (i = 0; i < ARRAY_SIZE(power_data); i++) { + int ret; + rc = lc15bts_par_get_int(tall_mgr_ctx, power_data[i].ee_par, &ret); + switch(power_data[i].sensor_type) { + case LC15BTS_POWER_VOLTAGE: + div_ratio = 1000; + break; + case LC15BTS_POWER_POWER: + div_ratio = 1000000; + break; + default: + div_ratio = 1000; + } + power_old[i] = ret * div_ratio; + + lc15bts_power_sensor_get(power_data[i].sensor_source, power_data[i].sensor_type, &power_cur[i]); + if (power_cur[i] < 0 && power_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading power (%d) (%d)\n", power_data[i].sensor_source, + power_data[i].sensor_type); + continue; + } + LOGP(DTEMP, LOGL_DEBUG, "Current %s power: %d.%d %s\n", + power_data[i].name, power_cur[i]/div_ratio, power_cur[i]%div_ratio, + get_value_string(power_unit_strs, power_data[i].sensor_type)); + + if (power_cur[i] > power_old[i]) { + LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " + "power: %d.%d %s\n", power_data[i].name, + power_cur[i]/div_ratio, power_cur[i]%div_ratio, + get_value_string(power_unit_strs, power_data[i].sensor_type)); + + if (!no_rom_write) { + rc = lc15bts_par_set_int(tall_mgr_ctx, power_data[i].ee_par, power_cur[i]/div_ratio); + if (rc < 0) + LOGP(DTEMP, LOGL_ERROR, "error writing new %s " + "max power %d (%s)\n", power_data[i].name, + rc, strerror(errno)); + } + } + } +} + +void lc15bts_check_vswr(int no_rom_write) +{ + int vswr_old[ARRAY_SIZE(vswr_data)]; + int vswr_cur[ARRAY_SIZE(vswr_data)]; + int i, rc; + + for (i = 0; i < ARRAY_SIZE(vswr_data); i++) { + int ret; + rc = lc15bts_par_get_int(tall_mgr_ctx, vswr_data[i].ee_par, &ret); + vswr_old[i] = ret * 1000; + + lc15bts_vswr_get(vswr_data[i].sensor, &vswr_cur[i]); + if (vswr_cur[i] < 0 && vswr_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading vswr (%d)\n", vswr_data[i].sensor); + continue; + } + + LOGP(DTEMP, LOGL_DEBUG, "Current %s vswr: %d.%d\n", + vswr_data[i].name, vswr_cur[i]/1000, vswr_cur[i]%1000); + + if (vswr_cur[i] > vswr_old[i]) { + LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " + "vswr: %d.%d C\n", vswr_data[i].name, + vswr_cur[i]/1000, vswr_old[i]%1000); + + if (!no_rom_write) { + rc = lc15bts_par_set_int(tall_mgr_ctx, vswr_data[i].ee_par, vswr_cur[i]/1000); + if (rc < 0) + LOGP(DTEMP, LOGL_ERROR, "error writing new %s " + "max vswr %d (%s)\n", vswr_data[i].name, + rc, strerror(errno)); + } + } + } +} + /********************************************************************* * Hours handling *********************************************************************/ diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.h b/src/osmo-bts-litecell15/misc/lc15bts_misc.h index 4c3a862..79e9e68 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.h @@ -4,6 +4,8 @@ #include void lc15bts_check_temp(int no_rom_write); +void lc15bts_check_power(int no_rom_write); +void lc15bts_check_vswr(int no_rom_write); int lc15bts_update_hours(int no_rom_write); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index 13b0080..75314a4 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -43,12 +43,19 @@ { LC15BTS_PAR_TEMP_SUPPLY_MAX, "temp-supply-max" }, { LC15BTS_PAR_TEMP_SOC_MAX, "temp-soc-max" }, { LC15BTS_PAR_TEMP_FPGA_MAX, "temp-fpga-max" }, - { LC15BTS_PAR_TEMP_LOGRF_MAX, "temp-logrf-max" }, + { LC15BTS_PAR_TEMP_RMSDET_MAX, "temp-rmsdet-max" }, { LC15BTS_PAR_TEMP_OCXO_MAX, "temp-ocxo-max" }, { LC15BTS_PAR_TEMP_TX0_MAX, "temp-tx0-max" }, { LC15BTS_PAR_TEMP_TX1_MAX, "temp-tx1-max" }, { LC15BTS_PAR_TEMP_PA0_MAX, "temp-pa0-max" }, { LC15BTS_PAR_TEMP_PA1_MAX, "temp-pa1-max" }, + { LC15BTS_PAR_VOLT_SUPPLY_MAX, "volt-supply-max" }, + { LC15BTS_PAR_PWR_SUPPLY_MAX, "pwr-supply-max" }, + { LC15BTS_PAR_PWR_PA0_MAX, "pwr-pa0-max" }, + { LC15BTS_PAR_PWR_PA1_MAX, "pwr-pa1-max" }, + { LC15BTS_PAR_VSWR_TX0_MAX, "vswr-tx0-max" }, + { LC15BTS_PAR_VSWR_TX1_MAX, "vswr-tx1-max" }, + { LC15BTS_PAR_GPS_FIX, "gps-fix" }, { LC15BTS_PAR_SERNR, "serial-nr" }, { LC15BTS_PAR_HOURS, "hours-running" }, { LC15BTS_PAR_BOOTS, "boot-count" }, @@ -60,17 +67,23 @@ { switch (par) { case LC15BTS_PAR_TEMP_SUPPLY_MAX: - case LC15BTS_PAR_TEMP_SOC_MAX: - case LC15BTS_PAR_TEMP_FPGA_MAX: - case LC15BTS_PAR_TEMP_LOGRF_MAX: - case LC15BTS_PAR_TEMP_OCXO_MAX: - case LC15BTS_PAR_TEMP_TX0_MAX: - case LC15BTS_PAR_TEMP_TX1_MAX: - case LC15BTS_PAR_TEMP_PA0_MAX: - case LC15BTS_PAR_TEMP_PA1_MAX: + case LC15BTS_PAR_TEMP_SOC_MAX: + case LC15BTS_PAR_TEMP_FPGA_MAX: + case LC15BTS_PAR_TEMP_RMSDET_MAX: + case LC15BTS_PAR_TEMP_OCXO_MAX: + case LC15BTS_PAR_TEMP_TX0_MAX: + case LC15BTS_PAR_TEMP_TX1_MAX: + case LC15BTS_PAR_TEMP_PA0_MAX: + case LC15BTS_PAR_TEMP_PA1_MAX: + case LC15BTS_PAR_VOLT_SUPPLY_MAX: + case LC15BTS_PAR_VSWR_TX0_MAX: + case LC15BTS_PAR_VSWR_TX1_MAX: case LC15BTS_PAR_SERNR: case LC15BTS_PAR_HOURS: case LC15BTS_PAR_BOOTS: + case LC15BTS_PAR_PWR_SUPPLY_MAX: + case LC15BTS_PAR_PWR_PA0_MAX: + case LC15BTS_PAR_PWR_PA1_MAX: return 1; default: return 0; @@ -168,3 +181,52 @@ return rc; } + +int lc15bts_par_get_gps_fix(time_t *ret) +{ + char fpath[PATH_MAX]; + FILE *fp; + int rc; + + snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, LC15BTS_PAR_GPS_FIX)); + fpath[sizeof(fpath)-1] = '\0'; + + fp = fopen(fpath, "r"); + if (fp == NULL) { + return -errno; + } + + rc = fscanf(fp, "%lld", (long long *)ret); + if (rc != 1) { + fclose(fp); + return -EIO; + } + fclose(fp); + + return 0; +} + +int lc15bts_par_set_gps_fix(time_t val) +{ + char fpath[PATH_MAX]; + FILE *fp; + int rc; + + snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, LC15BTS_PAR_GPS_FIX)); + fpath[sizeof(fpath)-1] = '\0'; + + fp = fopen(fpath, "w"); + if (fp == NULL) { + return -errno; + } + + rc = fprintf(fp, "%lld", (long long)val); + if (rc < 0) { + fclose(fp); + return -EIO; + } + fsync(fp); + fclose(fp); + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index dd869d3..217ae5f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -10,12 +10,19 @@ LC15BTS_PAR_TEMP_SUPPLY_MAX, LC15BTS_PAR_TEMP_SOC_MAX, LC15BTS_PAR_TEMP_FPGA_MAX, - LC15BTS_PAR_TEMP_LOGRF_MAX, + LC15BTS_PAR_TEMP_RMSDET_MAX, LC15BTS_PAR_TEMP_OCXO_MAX, LC15BTS_PAR_TEMP_TX0_MAX, LC15BTS_PAR_TEMP_TX1_MAX, LC15BTS_PAR_TEMP_PA0_MAX, LC15BTS_PAR_TEMP_PA1_MAX, + LC15BTS_PAR_VOLT_SUPPLY_MAX, + LC15BTS_PAR_PWR_SUPPLY_MAX, + LC15BTS_PAR_PWR_PA0_MAX, + LC15BTS_PAR_PWR_PA1_MAX, + LC15BTS_PAR_VSWR_TX0_MAX, + LC15BTS_PAR_VSWR_TX1_MAX, + LC15BTS_PAR_GPS_FIX, LC15BTS_PAR_SERNR, LC15BTS_PAR_HOURS, LC15BTS_PAR_BOOTS, @@ -31,5 +38,7 @@ int lc15bts_par_set_buf(void *ctx, enum lc15bts_par par, const uint8_t *buf, unsigned int size); int lc15bts_par_is_int(enum lc15bts_par par); +int lc15bts_par_get_gps_fix(time_t *ret); +int lc15bts_par_set_gps_fix(time_t val); #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.c b/src/osmo-bts-litecell15/misc/lc15bts_power.c index 5b01d36..1a37d8e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.c @@ -39,7 +39,7 @@ }; static const char *power_sensor_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/pa-supply/", + [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/main-supply/", [LC15BTS_POWER_PA0] = "/var/lc15/pwr-sense/pa0/", [LC15BTS_POWER_PA1] = "/var/lc15/pwr-sense/pa1/", }; @@ -52,7 +52,8 @@ int lc15bts_power_sensor_get( enum lc15bts_power_source source, - enum lc15bts_power_type type) + enum lc15bts_power_type type, + int *power) { char buf[PATH_MAX]; char pwrstr[10]; @@ -82,8 +83,8 @@ return -EIO; } close(fd); - - return atoi(pwrstr); + *power = atoi(pwrstr); + return 0; } @@ -171,3 +172,39 @@ return retVal; } + +static const char *vswr_devs[_NUM_VSWR_SENSORS] = { + [LC15BTS_VSWR_TX0] = "/var/lc15/vswr/tx0/vswr", + [LC15BTS_VSWR_TX1] = "/var/lc15/vswr/tx1/vswr", +}; + +int lc15bts_vswr_get(enum lc15bts_vswr_sensor sensor, int *vswr) +{ + char buf[PATH_MAX]; + char vswrstr[8]; + int fd, rc; + + if (sensor < 0 || sensor >= _NUM_VSWR_SENSORS) + return -EINVAL; + + snprintf(buf, sizeof(buf)-1, "%s", vswr_devs[sensor]); + buf[sizeof(buf)-1] = '\0'; + + fd = open(buf, O_RDONLY); + if (fd < 0) + return fd; + + rc = read(fd, vswrstr, sizeof(vswrstr)); + vswrstr[sizeof(vswrstr)-1] = '\0'; + if (rc < 0) { + close(fd); + return rc; + } + if (rc == 0) { + close(fd); + return -EIO; + } + close(fd); + *vswr = atoi(vswrstr); + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.h b/src/osmo-bts-litecell15/misc/lc15bts_power.h index 8963b76..b48cfdc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.h @@ -17,7 +17,8 @@ int lc15bts_power_sensor_get( enum lc15bts_power_source source, - enum lc15bts_power_type type); + enum lc15bts_power_type type, + int *volt); int lc15bts_power_set( enum lc15bts_power_source source, @@ -26,4 +27,12 @@ int lc15bts_power_get( enum lc15bts_power_source source); +enum lc15bts_vswr_sensor { + LC15BTS_VSWR_TX0, + LC15BTS_VSWR_TX1, + _NUM_VSWR_SENSORS +}; + +int lc15bts_vswr_get(enum lc15bts_vswr_sensor sensor, int *vswr); + #endif diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_temp.c index aa35854..45602dc 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.c @@ -29,20 +29,19 @@ #include "lc15bts_temp.h" - static const char *temp_devs[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/pa-supply/temp", - [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", - [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", - [LC15BTS_TEMP_LOGRF] = "/var/lc15/temp/logrf/temp", - [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", - [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", - [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", - [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", - [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", + [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/main-supply/temp", + [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", + [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", + [LC15BTS_TEMP_RMSDET] = "/var/lc15/temp/rmsdet/temp", + [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", + [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", + [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", + [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", + [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor) +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, int *temp) { char buf[PATH_MAX]; char tempstr[8]; @@ -69,7 +68,7 @@ return -EIO; } close(fd); - - return atoi(tempstr); + *temp = atoi(tempstr); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.h b/src/osmo-bts-litecell15/misc/lc15bts_temp.h index aca8fe2..35d81f1 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.h @@ -5,7 +5,7 @@ LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_SOC, LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_LOGRF, + LC15BTS_TEMP_RMSDET, LC15BTS_TEMP_OCXO, LC15BTS_TEMP_TX0, LC15BTS_TEMP_TX1, @@ -22,6 +22,7 @@ _NUM_TEMP_TYPES }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor); +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, int *temp); + #endif -- To view, visit https://gerrit.osmocom.org/3277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: jfdionne From gerrit-no-reply at lists.osmocom.org Wed Jul 19 10:52:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 10:52:58 +0000 Subject: osmo-gsm-manuals[master]: all manuals: Move date and release from center head to right... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I685a981a5cfd82214d1d654aa1553a844c2af157 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 10:53:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 10:53:05 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: all manuals: Move date and release from center head to right... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: all manuals: Move date and release from center head to right foot ...................................................................... all manuals: Move date and release from center head to right foot Otherwise long doc titles (top left) run on top of release and date making it impossible to read any of them correctly. Change-Id: I685a981a5cfd82214d1d654aa1553a844c2af157 --- M build/custom-dblatex.sty 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty index 41e7c70..606b9ab 100644 --- a/build/custom-dblatex.sty +++ b/build/custom-dblatex.sty @@ -77,7 +77,8 @@ % left footer \def\DBKpublisher{} -\def\releasebox{\DBKreleaseinfo, \DBKdate} +\def\releasebox{} +\rfoot[]{\DBKreleaseinfo, \DBKdate} \def\maketitle{ \DBKcover -- To view, visit https://gerrit.osmocom.org/3276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I685a981a5cfd82214d1d654aa1553a844c2af157 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 10:53:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 10:53:25 +0000 Subject: [MERGED] libosmocore[master]: add DLMGCP logging category for libosmo-mgcp In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add DLMGCP logging category for libosmo-mgcp ...................................................................... add DLMGCP logging category for libosmo-mgcp In the course of splitting up the openbsc.git repository, we will create libosmo-mgcp and need a library logging category for that purpose. Change-Id: I09c587e2d59472cbde852d467d457254746d9e67 --- M include/osmocom/core/logging.h M src/logging.c 2 files changed, 7 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/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index e058a57..86a6977 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -104,7 +104,8 @@ #define DLSCCP -14 /*!< Osmocom SCCP */ #define DLSUA -15 /*!< Osmocom SUA */ #define DLM3UA -16 /*!< Osmocom M3UA */ -#define OSMO_NUM_DLIB 16 /*!< Number of logging sub-systems in libraries */ +#define DLMGCP -17 /*!< Osmocom MGCP */ +#define OSMO_NUM_DLIB 17 /*!< Number of logging sub-systems in libraries */ /*! Configuration of single log category / sub-system */ struct log_category { diff --git a/src/logging.c b/src/logging.c index 2fb06ba..2e913e5 100644 --- a/src/logging.c +++ b/src/logging.c @@ -161,6 +161,11 @@ .description = "libosmo-sigtran MTP3 User Adaptation", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [INT2IDX(DLMGCP)] = { + .name = "DLMGCP", + .description = "libosmo-mgcp Media Gateway Control Protocol", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, }; /*! descriptive string for each log level */ -- To view, visit https://gerrit.osmocom.org/3181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09c587e2d59472cbde852d467d457254746d9e67 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:37 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Use new OSMO_SOCK_F_NO_MCAST_{LOOP, ALL} flags Message-ID: Review at https://gerrit.osmocom.org/3279 VIRT-PHY: Use new OSMO_SOCK_F_NO_MCAST_{LOOP,ALL} flags libosmocore has recently gained support for flags like OSMO_SOCK_F_NO_MCAST_LOOP and OSMO_SOCK_F_NO_MCAST_ALL that can be passed to the socket initializer functions, further reducing complexity of the code in osmo_mcast_sock.c here. The related change-IDs are I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 and I24a5b1ebc3f84d2d5d4734e54df50efaea26490b in libosmocore.git. Change-Id: I961aa07a381fef2cf9a2fb5357937864364ca04b --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 8 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/79/3279/1 diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index df3abc3..0521c0d 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -28,21 +28,16 @@ uint16_t tx_mcast_port, bool loopback) { int rc; + unsigned int flags = OSMO_SOCK_F_CONNECT; + + if (!loopback) + flags |= OSMO_SOCK_F_NO_MCAST_LOOP; /* setup mcast server socket */ rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, - tx_mcast_group, tx_mcast_port, OSMO_SOCK_F_CONNECT); + tx_mcast_group, tx_mcast_port, flags); if (rc < 0) { perror("Failed to create Multicast Server Socket"); - return rc; - } - - /* determines whether sent mcast packets should be looped back to the local sockets. - * loopback must be enabled if the mcast client is on the same machine */ - rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); - if (rc < 0) { - perror("Failed to configure multicast loopback.\n"); - fd_close(ofd); return rc; } @@ -56,8 +51,7 @@ int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { - struct ip_mreq mreq; - int rc, loopback = 1, all = 0; + int rc; ofd->cb = fd_rx_cb; ofd->when = BSC_FD_READ; @@ -65,38 +59,16 @@ /* Create mcast client socket */ rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, - NULL, mcast_port, OSMO_SOCK_F_BIND); + NULL, mcast_port, OSMO_SOCK_F_BIND|OSMO_SOCK_F_NO_MCAST_ALL); if (rc < 0) { perror("Could not create mcast client socket"); return rc; } - /* Enable loopback of msgs to the host. */ - /* Loopback must be enabled for the client, so multiple - * processes are able to receive a mcast package. */ - rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, - &loopback, sizeof(loopback)); - if (rc < 0) { - perror("Failed to enable IP_MULTICAST_LOOP"); - fd_close(ofd); - return rc; - } - /* Configure and join the multicast group */ - memset(&mreq, 0, sizeof(mreq)); - mreq.imr_multiaddr.s_addr = inet_addr(mcast_group); - mreq.imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(ofd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); + rc = osmo_sock_mcast_subscribe(ofd->fd, mcast_group); if (rc < 0) { perror("Failed to join to mcast goup"); - fd_close(ofd); - return rc; - } - - /* this option will set the delivery option so that only packets - * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ - if (setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { - perror("Failed to modify delivery policy to explicitly joined.\n"); fd_close(ofd); return rc; } -- To view, visit https://gerrit.osmocom.org/3279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I961aa07a381fef2cf9a2fb5357937864364ca04b Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:38 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Use osmo_fd_close() introduced in libosmocore Message-ID: Review at https://gerrit.osmocom.org/3280 VIRT-PHY: Use osmo_fd_close() introduced in libosmocore libosmocore has recently received a new function osmo_fd_close() which can be used to replace the private fd_close() function in this code. This requires Change-Id Icd0933eed6a24edde7cdcb378e138897ecc5332c in libosmocore. Change-Id: Id8a518dfb09465c2765681407e5581aee2d62d6d --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 4 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/80/3280/1 diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 0521c0d..b52e005 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -10,17 +10,6 @@ #include #include -/* convenience wrapper */ -static void fd_close(struct osmo_fd *ofd) -{ - /* multicast memberships of socket are implicitly dropped when - * socket is closed */ - osmo_fd_unregister(ofd); - close(ofd->fd); - ofd->fd = -1; - ofd->when = 0; -} - /* server socket is what we use for transmission. It is not subscribed * to a multicast group or locally bound, but it is just a normal UDP * socket that's connected to the remote mcast group + port */ @@ -69,7 +58,7 @@ rc = osmo_sock_mcast_subscribe(ofd->fd, mcast_group); if (rc < 0) { perror("Failed to join to mcast goup"); - fd_close(ofd); + osmo_fd_close(ofd); return rc; } @@ -96,7 +85,7 @@ } rc = mcast_server_sock_setup(&bidir_sock->tx_ofd, tx_mcast_group, tx_mcast_port, loopback); if (rc < 0) { - fd_close(&bidir_sock->rx_ofd); + osmo_fd_close(&bidir_sock->rx_ofd); talloc_free(bidir_sock); return NULL; } @@ -117,7 +106,7 @@ void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) { - fd_close(&bidir_sock->tx_ofd); - fd_close(&bidir_sock->rx_ofd); + osmo_fd_close(&bidir_sock->tx_ofd); + osmo_fd_close(&bidir_sock->rx_ofd); talloc_free(bidir_sock); } -- To view, visit https://gerrit.osmocom.org/3280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8a518dfb09465c2765681407e5581aee2d62d6d Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:38 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Use IPv4 multicast groups for private / local scope Message-ID: Review at https://gerrit.osmocom.org/3281 VIRT-PHY: Use IPv4 multicast groups for private / local scope The addresses in the original code make little sense: * 224.0.0.1 is "All systems on this subnet" and not routed outside the local ethernet segment * 225.0.0.1 is in a RESERVED range that shouldn't be used Change-Id: I8e3acd745e65a6cfa70b681a440da6a59a1ed0b5 --- M src/host/virt_phy/include/virtphy/virtual_um.h 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/81/3281/1 diff --git a/src/host/virt_phy/include/virtphy/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h index 6e7c384..ac098dd 100644 --- a/src/host/virt_phy/include/virtphy/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -4,10 +4,15 @@ #include #include "osmo_mcast_sock.h" +/* We use multicast group addresses from the 239.192.0.0/14 rage, as + * those are designated by RFC2365 as "IPv4 Organization Local Scope, + * "... the space from which an organization should allocate sub- + * ranges when defining scopes for private use." */ + #define VIRT_UM_MSGB_SIZE 256 -#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_GROUP "239.193.23.1" #define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ -#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_GROUP "239.193.23.2" #define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ struct virt_um_inst { -- To view, visit https://gerrit.osmocom.org/3281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e3acd745e65a6cfa70b681a440da6a59a1ed0b5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:38 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: some more comments/documentation Message-ID: Review at https://gerrit.osmocom.org/3282 VIRT-PHY: some more comments/documentation Change-Id: I24fc98624178e9441d6cfcd61bc14e17c1391e9e --- M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/include/virtphy/virtual_um.h 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/82/3282/1 diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 296931a..991cb1a 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -1,5 +1,7 @@ #pragma once +/* Per-MS specific state, closely attached to the L1CTL user progran */ + #include #include #include diff --git a/src/host/virt_phy/include/virtphy/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h index ac098dd..79d74a5 100644 --- a/src/host/virt_phy/include/virtphy/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -1,5 +1,11 @@ #pragma once +/* the "Virtual Um instance" encapsulates the multicast UDP sockets as + * well as the encoding and decoding of GSMTAP messages towards the + * virtual radio interface. It receives DL messages via GSMTAP from any + * number of BTSs transmitting to GSMTAP, and transmits UL messages via + * GSMTAP to those BTSs in another multicast group */ + #include #include #include "osmo_mcast_sock.h" -- To view, visit https://gerrit.osmocom.org/3282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24fc98624178e9441d6cfcd61bc14e17c1391e9e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:38 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: reorganize data structures Message-ID: Review at https://gerrit.osmocom.org/3283 VIRT-PHY: reorganize data structures * l1_model_ms can become a static member of l1_model_ms * crypto_info_ms can become a static member of l1_state_ms Change-Id: I94ca4dad1c6c668ce6307d5e5d728b1c1502af12 --- M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 11 files changed, 82 insertions(+), 77 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/83/3283/1 diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 991cb1a..61776ec 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -18,13 +18,6 @@ }; -struct l1_model_ms { - struct l1ctl_sock_inst *lsi; - struct virt_um_inst *vui; - struct l1_state_ms *state; - struct crypto_info_ms *crypto_inf; -}; - /* structure representing L1 sync information about a cell */ struct l1_cell_info { /* on which ARFCN (+band) is the cell? */ @@ -53,12 +46,13 @@ struct gsm_time downlink_time; /* current GSM time received on downlink */ struct gsm_time current_time; /* GSM time used internally for scheduling */ - uint8_t state; // the ms state like in ms_state + enum ms_state state; /* the cell on which we are camping right now */ struct l1_cell_info serving_cell; /* neighbor cell sync info */ struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; + struct crypto_info_ms crypto_inf; /* TCH info */ uint8_t tch_mode; // see enum gsm48_chan_mode in gsm_04_08.h @@ -94,6 +88,13 @@ } pm; }; +struct l1_model_ms { + struct l1ctl_sock_inst *lsi; + struct virt_um_inst *vui; + struct l1_state_ms state; +}; + + struct l1_model_ms *l1_model_ms_init(void *ctx); void l1_model_ms_destroy(struct l1_model_ms *model); diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 2624046..18580b4 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -55,7 +55,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; struct msgb *outmsg; /* msg to send with gsmtap header prepended */ - uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; /* arfcn of the cell we currently camp on */ + uint16_t arfcn = l1_model_ms->state.serving_cell.arfcn; /* arfcn of the cell we currently camp on */ uint8_t signal_dbm = 63; /* signal strength */ uint8_t snr = 63; /* signal noise ratio, 63 is best */ uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ @@ -145,19 +145,19 @@ goto freemsg; } /* we do not forward messages to l23 if we are in network search state */ - if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) + if (l1_model_ms->state.state == MS_STATE_IDLE_SEARCHING) goto freemsg; /* forward downlink msg to fbsb sync routine if we are in sync state */ - if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { + if (l1_model_ms->state.state == MS_STATE_IDLE_SYNCING) { prim_fbsb_sync(msg); return; } /* generally ignore all messages coming from another arfcn than the camped one */ - if (l1_model_ms->state->serving_cell.arfcn != arfcn) { + if (l1_model_ms->state.serving_cell.arfcn != arfcn) { LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn, l1_model_ms->state->serving_cell.arfcn); + arfcn, l1_model_ms->state.serving_cell.arfcn); goto freemsg; } @@ -166,8 +166,8 @@ /* see TS 08.58 -> 9.3.1 for channel number encoding */ chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); - gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); - virt_l1_sched_sync_time(l1_model_ms->state->downlink_time, 0); + gsm_fn2gsmtime(&l1_model_ms->state.downlink_time, fn); + virt_l1_sched_sync_time(l1_model_ms->state.downlink_time, 0); virt_l1_sched_execute(fn); DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " @@ -191,8 +191,8 @@ case GSMTAP_CHANNEL_SDCCH8: /* only forward messages on dedicated channels to l2, if * the timeslot and subslot is fitting */ - if (l1_model_ms->state->dedicated.tn == timeslot - && l1_model_ms->state->dedicated.subslot == subslot) { + if (l1_model_ms->state.dedicated.tn == timeslot + && l1_model_ms->state.dedicated.subslot == subslot) { l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); } break; diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 0871f1f..8965ac1 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -44,10 +44,10 @@ static void l1_model_tch_mode_set(uint8_t tch_mode) { if (tch_mode == GSM48_CMODE_SPEECH_V1 || tch_mode == GSM48_CMODE_SPEECH_EFR) - l1_model_ms->state->tch_mode = tch_mode; + l1_model_ms->state.tch_mode = tch_mode; else { /* set default value if no proper mode was assigned by l23 */ - l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; + l1_model_ms->state.tch_mode = GSM48_CMODE_SIGN; } } @@ -267,16 +267,16 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", ul->chan_nr, timeslot, subslot); - l1_model_ms->state->dedicated.chan_type = rsl_chantype; - l1_model_ms->state->dedicated.tn = timeslot; - l1_model_ms->state->dedicated.subslot = subslot; - l1_model_ms->state->state = MS_STATE_DEDICATED; + l1_model_ms->state.dedicated.chan_type = rsl_chantype; + l1_model_ms->state.dedicated.tn = timeslot; + l1_model_ms->state.dedicated.subslot = subslot; + l1_model_ms->state.state = MS_STATE_DEDICATED; /* TCH config */ if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { - l1_model_ms->state->tch_mode = est_req->tch_mode; + l1_model_ms->state.tch_mode = est_req->tch_mode; l1_model_tch_mode_set(est_req->tch_mode); - l1_model_ms->state->audio_mode = est_req->audio_mode; + l1_model_ms->state.audio_mode = est_req->audio_mode; /* TODO: configure audio hardware for encoding / * decoding / recording / playing voice */ } @@ -332,8 +332,8 @@ return; } - l1_model_ms->crypto_inf->algo = cr->algo; - memcpy(l1_model_ms->crypto_inf->key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); + l1_model_ms->state.crypto_inf.algo = cr->algo; + memcpy(l1_model_ms->state.crypto_inf.key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); } /** @@ -350,11 +350,11 @@ { DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); - l1_model_ms->state->dedicated.chan_type = 0; - l1_model_ms->state->dedicated.tn = 0; - l1_model_ms->state->dedicated.subslot = 0; - l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; - l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; + l1_model_ms->state.dedicated.chan_type = 0; + l1_model_ms->state.dedicated.tn = 0; + l1_model_ms->state.dedicated.subslot = 0; + l1_model_ms->state.tch_mode = GSM48_CMODE_SIGN; + l1_model_ms->state.state = MS_STATE_IDLE_CAMPING; /* TODO: disable ciphering */ /* TODO: disable audio recording / playing */ @@ -402,12 +402,12 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); - l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; + l1_model_ms->state.state = MS_STATE_IDLE_SEARCHING; virt_l1_sched_stop(); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: - virt_l1_sched_restart(l1_model_ms->state->downlink_time); + virt_l1_sched_restart(l1_model_ms->state.downlink_time); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; @@ -438,7 +438,7 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); - l1_model_ms->state->serving_cell.ccch_mode = ccch_mode; + l1_model_ms->state.serving_cell.ccch_mode = ccch_mode; /* check if more has to be done here */ l1ctl_tx_ccch_mode_conf(ccch_mode); @@ -461,14 +461,14 @@ struct l1ctl_tch_mode_req *tch_mode_req = (struct l1ctl_tch_mode_req *) l1h->data; l1_model_tch_mode_set(tch_mode_req->tch_mode); - l1_model_ms->state->audio_mode = tch_mode_req->audio_mode; + l1_model_ms->state.audio_mode = tch_mode_req->audio_mode; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", tch_mode_req->tch_mode, tch_mode_req->audio_mode); /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ - l1ctl_tx_tch_mode_conf(l1_model_ms->state->tch_mode, l1_model_ms->state->audio_mode); + l1ctl_tx_tch_mode_conf(l1_model_ms->state.tch_mode, l1_model_ms->state.audio_mode); } /** diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index 65e8068..056c9eb 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -24,7 +24,6 @@ struct l1_model_ms* l1_model_ms_init(void *ctx) { struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); - model->state = talloc_zero(ctx, struct l1_state_ms); return model; } @@ -32,6 +31,5 @@ { virt_um_destroy(model->vui); l1ctl_sock_destroy(model->lsi); - talloc_free(model->state); talloc_free(model); } diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index 40bc57a..20481df 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -61,7 +61,7 @@ */ void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset) { - l1_model_ms->state->current_time = time; + l1_model_ms->state.current_time = time; } /** diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 8b65d6d..72c58b7 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -50,7 +50,7 @@ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_data_conf(fn, 0, l1_model_ms->state->serving_cell.arfcn); + l1ctl_tx_data_conf(fn, 0, l1_model_ms->state.serving_cell.arfcn); } /** @@ -70,7 +70,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 4f6306e..7f99821 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -54,14 +54,15 @@ */ void l1ctl_rx_fbsb_req(struct msgb *msg) { + struct l1_state_ms *l1s = &l1_model_ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); - l1_model_ms->state->state = MS_STATE_IDLE_SYNCING; - l1_model_ms->state->fbsb.arfcn = ntohs(sync_req->band_arfcn); + l1s->state = MS_STATE_IDLE_SYNCING; + l1s->fbsb.arfcn = ntohs(sync_req->band_arfcn); } /** @@ -71,32 +72,33 @@ */ void prim_fbsb_sync(struct msgb *msg) { + struct l1_state_ms *l1s = &l1_model_ms->state; struct gsmtap_hdr *gh = msgb_l1(msg); uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ /* ignore messages from other arfcns as the one requested to sync to by l23 */ - if (l1_model_ms->state->fbsb.arfcn != arfcn) { + if (l1s->fbsb.arfcn != arfcn) { talloc_free(msg); /* cancel sync if we did not receive a msg on dl from * the requested arfcn that we can sync to */ if (sync_count++ > 20) { sync_count = 0; - l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; - l1ctl_tx_fbsb_conf(1, (l1_model_ms->state->fbsb.arfcn)); + l1s->state = MS_STATE_IDLE_SEARCHING; + l1ctl_tx_fbsb_conf(1, (l1s->fbsb.arfcn)); } return; } - l1_model_ms->state->serving_cell.arfcn = arfcn; - l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; + l1s->serving_cell.arfcn = arfcn; + l1s->state = MS_STATE_IDLE_CAMPING; /* Not needed in virtual phy */ - l1_model_ms->state->serving_cell.fn_offset = 0; - l1_model_ms->state->serving_cell.time_alignment = 0; - l1_model_ms->state->serving_cell.bsic = 0; + l1s->serving_cell.fn_offset = 0; + l1s->serving_cell.time_alignment = 0; + l1s->serving_cell.bsic = 0; /* Update current gsm time each time we receive a message on the virt um */ - gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); + gsm_fn2gsmtime(&l1s->downlink_time, fn); /* Restart scheduler */ - virt_l1_sched_restart(l1_model_ms->state->downlink_time); + virt_l1_sched_restart(l1s->downlink_time); talloc_free(msg); l1ctl_tx_fbsb_conf(0, arfcn); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 9afee0c..6335c61 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -47,17 +47,17 @@ */ uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) { - if (l1_model_ms->state->pm.timeout_s > 0 || l1_model_ms->state->pm.timeout_us > 0) { - osmo_timer_schedule(&l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[arfcn], - l1_model_ms->state->pm.timeout_s, - l1_model_ms->state->pm.timeout_us); + struct l1_state_ms *l1s = &l1_model_ms->state; + + if (l1s->pm.timeout_s > 0 || l1s->pm.timeout_us > 0) { + osmo_timer_schedule(&l1s->pm.meas.arfcn_sig_lev_timers[arfcn], + l1s->pm.timeout_s, l1s->pm.timeout_us); } - l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn] = - sig_lev - l1_model_ms->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; + l1s->pm.meas.arfcn_sig_lev_dbm[arfcn] = sig_lev - l1s->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", - arfcn, l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn], - dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn])); - return l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn]; + arfcn, l1s->pm.meas.arfcn_sig_lev_dbm[arfcn], + dbm2rxlev(l1s->pm.meas.arfcn_sig_lev_dbm[arfcn])); + return l1s->pm.meas.arfcn_sig_lev_dbm[arfcn]; } void prim_pm_timer_cb(void *data) @@ -83,6 +83,7 @@ */ void l1ctl_rx_pm_req(struct msgb *msg) { + struct l1_state_ms *l1s = &l1_model_ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *) l1h->data; struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); @@ -101,8 +102,8 @@ pm_conf->band_arfcn = htons(arfcn_next); /* set min and max to the value calculated for that * arfcn (IGNORE UPLINKK AND PCS AND OTHER FLAGS) */ - pm_conf->pm[0] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); - pm_conf->pm[1] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); + pm_conf->pm[0] = dbm2rxlev(l1s->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); + pm_conf->pm[1] = dbm2rxlev(l1s->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); if (arfcn_next == pm_req->range.band_arfcn_to) { struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; @@ -125,13 +126,15 @@ */ void prim_pm_init(struct l1_model_ms *model) { + struct l1_state_ms *l1s = &model->state; int i; + l1_model_ms = model; /* init the signal level of all arfcns with the lowest value possible */ - memset(model->state->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); + memset(l1s->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); /* init timers */ for (i = 0; i < 1024; ++i) { - l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].cb = prim_pm_timer_cb; - l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].data = &l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[i]; + l1s->pm.meas.arfcn_sig_lev_timers[i].cb = prim_pm_timer_cb; + l1s->pm.meas.arfcn_sig_lev_timers[i].data = &l1s->pm.meas.arfcn_sig_lev_dbm[i]; } } diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index 1642ac6..bff777d 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -62,7 +62,7 @@ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb *msg) { gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_rach_conf(fn, l1_model_ms->state->serving_cell.arfcn); + l1ctl_tx_rach_conf(fn, l1_model_ms->state.serving_cell.arfcn); } /** @@ -77,6 +77,7 @@ */ void l1ctl_rx_rach_req(struct msgb *msg) { + struct l1_state_ms *l1s = &l1_model_ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; @@ -102,13 +103,13 @@ /* sched fn calculation if we have a combined ccch channel configuration */ if (rach_req->combined) { /* add elapsed RACH slots to offset */ - offset += t3_to_rach_comb[l1_model_ms->state->current_time.t3]; + offset += t3_to_rach_comb[l1s->current_time.t3]; /* offset is the number of RACH slots in the future */ - fn_sched = l1_model_ms->state->current_time.fn - l1_model_ms->state->current_time.t3; + fn_sched = l1s->current_time.fn - l1s->current_time.t3; fn_sched += offset / 27 * 51; fn_sched += rach_to_t3_comb[offset % 27]; } else - fn_sched = l1_model_ms->state->current_time.fn + offset; + fn_sched = l1s->current_time.fn + offset; virt_l1_sched_schedule(msg, fn_sched, ts, &virt_l1_sched_handler_cb); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 50e6857..acfd493 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -50,7 +50,7 @@ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_traffic_conf(fn, 0, l1_model_ms->state->serving_cell.arfcn); + l1ctl_tx_traffic_conf(fn, 0, l1_model_ms->state.serving_cell.arfcn); } /** @@ -69,7 +69,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *) ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index e4f5fd2..43346ed 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -99,11 +99,11 @@ /* seconds */ char *buf = strtok(pm_timeout, ":"); - model->state->pm.timeout_s = atoi(buf); + model->state.pm.timeout_s = atoi(buf); /* microseconds */ buf = strtok(NULL, ":"); if (buf) - model->state->pm.timeout_us = atoi(buf); + model->state.pm.timeout_us = atoi(buf); } /** @@ -128,7 +128,7 @@ red = atoi(colon + 1); /* TODO: this may go wild if the token string is not properly formatted */ - model->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn] = red; + model->state.pm.meas.arfcn_sig_lev_red_dbm[arfcn] = red; } while ((token = strtok(NULL, ":"))); } -- To view, visit https://gerrit.osmocom.org/3283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94ca4dad1c6c668ce6307d5e5d728b1c1502af12 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:39 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY Use libosmocore unix domain socket helper Message-ID: Review at https://gerrit.osmocom.org/3284 VIRT-PHY Use libosmocore unix domain socket helper Change-Id: Ic0fa003bd7c7468d39a0c39fbea89000d576a4f3 --- M src/host/virt_phy/src/l1ctl_sock.c 1 file changed, 11 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/84/3284/1 diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index 2e16bfa..370d3f3 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -32,13 +32,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include @@ -102,11 +102,9 @@ { struct l1ctl_sock_inst *lsi = ofd->data; - struct sockaddr_un local_addr; - socklen_t addr_len = sizeof(struct sockaddr_in); int fd; - fd = accept(ofd->fd, (struct sockaddr *)&local_addr, &addr_len); + fd = accept(ofd->fd, NULL, NULL); if (fd < 0) { fprintf(stderr, "Failed to accept connection to l2.\n"); return -1; @@ -130,39 +128,24 @@ char *path) { struct l1ctl_sock_inst *lsi; - struct sockaddr_un local_addr; - int fd, rc; + int rc; if (!path) path = L1CTL_SOCK_PATH; - if ((fd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) { - fprintf(stderr, "Failed to create Unix Domain Socket.\n"); - return NULL; - } - - local_addr.sun_family = AF_LOCAL; - strcpy(local_addr.sun_path, path); - unlink(local_addr.sun_path); - - if ((rc = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) != 0) { - fprintf(stderr, "Failed to bind the unix domain socket. '%s'\n", - local_addr.sun_path); - return NULL; - } - - if (listen(fd, 0) != 0) { - fprintf(stderr, "Failed to listen.\n"); - return NULL; - } - lsi = talloc_zero(ctx, struct l1ctl_sock_inst); lsi->priv = NULL; - lsi->recv_cb = recv_cb; lsi->ofd.data = lsi; - lsi->ofd.fd = fd; lsi->ofd.when = BSC_FD_READ; lsi->ofd.cb = l1ctl_sock_accept_cb; + + rc = osmo_sock_unix_init_ofd(&lsi->ofd, SOCK_STREAM, 0, path, OSMO_SOCK_F_BIND); + if (rc < 0) { + talloc_free(lsi); + return NULL; + } + + lsi->recv_cb = recv_cb; /* no connection -> invalid filedescriptor and not 0 (==std_in) */ lsi->connection.fd = -1; lsi->l1ctl_sock_path = path; -- To view, visit https://gerrit.osmocom.org/3284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0fa003bd7c7468d39a0c39fbea89000d576a4f3 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:39 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Don't redefine GSMTAP port number, use libosmocore Message-ID: Review at https://gerrit.osmocom.org/3285 VIRT-PHY: Don't redefine GSMTAP port number, use libosmocore Change-Id: I11d04d76292c52ec5ab70893e8c6a2e55586b2ec --- M src/host/virt_phy/include/virtphy/virtual_um.h M src/host/virt_phy/src/virtphy.c 2 files changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/85/3285/1 diff --git a/src/host/virt_phy/include/virtphy/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h index 79d74a5..52f2df6 100644 --- a/src/host/virt_phy/include/virtphy/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -17,9 +17,7 @@ #define VIRT_UM_MSGB_SIZE 256 #define DEFAULT_MS_MCAST_GROUP "239.193.23.1" -#define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ #define DEFAULT_BTS_MCAST_GROUP "239.193.23.2" -#define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ struct virt_um_inst { void *priv; diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 43346ed..28dd685 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -34,12 +35,11 @@ #include #include -#define DEFAULT_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ #define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" static char *dl_rx_grp = DEFAULT_MS_MCAST_GROUP; static char *ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; -static int port = DEFAULT_MCAST_PORT; +static int port = GSMTAP_UDP_PORT; static char *log_mask = DEFAULT_LOG_MASK; static char *l1ctl_sock_path = L1CTL_SOCK_PATH; static char *arfcn_sig_lev_red_mask = NULL; -- To view, visit https://gerrit.osmocom.org/3285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11d04d76292c52ec5ab70893e8c6a2e55586b2ec Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:39 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Major rewrite to deal with muliple L1CTL clients Message-ID: Review at https://gerrit.osmocom.org/3286 VIRT-PHY: Major rewrite to deal with muliple L1CTL clients Change-Id: Ibfb2a93f8b45a95215c01368b1a52d92283474e6 --- M src/host/virt_phy/include/virtphy/gsmtapl1_if.h M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/l1ctl_sock.h M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/include/virtphy/virt_l1_sched.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 16 files changed, 388 insertions(+), 428 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/86/3286/1 diff --git a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h index d8a4367..125ec11 100644 --- a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -9,8 +9,4 @@ void gsmtapl1_init(struct l1_model_ms *model); void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_rx_from_virt_um(struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg); -void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, - uint8_t *link_id); +void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg); diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index b84c3e9..5903a02 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -27,17 +27,11 @@ void l1ctl_sap_init(struct l1_model_ms *model); -void prim_rach_init(struct l1_model_ms *model); -void prim_data_init(struct l1_model_ms *model); -void prim_traffic_init(struct l1_model_ms *model); -void prim_fbsb_init(struct l1_model_ms *model); void prim_pm_init(struct l1_model_ms *model); -void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); -void l1ctl_sap_tx_to_l23(struct msgb *msg); -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, - struct msgb *msg); +void l1ctl_sap_tx_to_l23_inst(struct l1_model_ms *model, struct msgb *msg); +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_client *lsc, struct msgb *msg); void l1ctl_sap_rx_from_l23(struct msgb *msg); -void l1ctl_sap_handler(struct msgb *msg); +void l1ctl_sap_handler(struct l1_model_ms *ms, struct msgb *msg); /* utility methods */ struct msgb *l1ctl_msgb_alloc(uint8_t msg_type); @@ -45,39 +39,39 @@ uint16_t arfcn); /* receive routines */ -void l1ctl_rx_fbsb_req(struct msgb *msg); -void l1ctl_rx_dm_est_req(struct msgb *msg); -void l1ctl_rx_dm_rel_req(struct msgb *msg); -void l1ctl_rx_param_req(struct msgb *msg); -void l1ctl_rx_dm_freq_req(struct msgb *msg); -void l1ctl_rx_crypto_req(struct msgb *msg); -void l1ctl_rx_rach_req(struct msgb *msg); -void l1ctl_rx_data_req(struct msgb *msg); -void l1ctl_rx_pm_req(struct msgb *msg); -void l1ctl_rx_reset_req(struct msgb *msg); -void l1ctl_rx_ccch_mode_req(struct msgb *msg); -void l1ctl_rx_tch_mode_req(struct msgb *msg); -void l1ctl_rx_neigh_pm_req(struct msgb *msg); -void l1ctl_rx_traffic_req(struct msgb *msg); -void l1ctl_rx_sim_req(struct msgb *msg); +void l1ctl_rx_fbsb_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_dm_est_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_dm_rel_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_param_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_dm_freq_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_crypto_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_rach_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_data_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_pm_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_reset_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_ccch_mode_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_tch_mode_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_neigh_pm_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_traffic_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_sim_req(struct l1_model_ms *, struct msgb *msg); /* transmit routines */ -void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type); -void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn); -void l1ctl_tx_data_conf(uint32_t fn, uint16_t snr, uint16_t arfcn); -void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, +void l1ctl_tx_reset(struct l1_model_ms *, uint8_t msg_type, uint8_t reset_type); +void l1ctl_tx_rach_conf(struct l1_model_ms *, uint32_t fn, uint16_t arfcn); +void l1ctl_tx_data_conf(struct l1_model_ms *, uint32_t fn, uint16_t snr, uint16_t arfcn); +void l1ctl_tx_data_ind(struct l1_model_ms *, struct msgb *msg, uint16_t arfcn, uint8_t link_id, uint8_t chan_nr, uint32_t fn, uint8_t snr, uint8_t signal_dbm, uint8_t num_biterr, uint8_t fire_crc); -void l1ctl_tx_traffic_conf(uint32_t fn, uint16_t snr, uint16_t arfcn); -void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, +void l1ctl_tx_traffic_conf(struct l1_model_ms *, uint32_t fn, uint16_t snr, uint16_t arfcn); +void l1ctl_tx_traffic_ind(struct l1_model_ms *, struct msgb *msg, uint16_t arfcn, uint8_t link_id, uint8_t chan_nr, uint32_t fn, uint8_t snr, uint8_t signal_dbm, uint8_t num_biterr, uint8_t fire_crc); -void l1ctl_tx_pm_conf(struct l1ctl_pm_req *pm_req); -void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn); -void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); -void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode); +void l1ctl_tx_pm_conf(struct l1_model_ms *, struct l1ctl_pm_req *pm_req); +void l1ctl_tx_fbsb_conf(struct l1_model_ms *, uint8_t res, uint16_t arfcn); +void l1ctl_tx_ccch_mode_conf(struct l1_model_ms *, uint8_t ccch_mode); +void l1ctl_tx_tch_mode_conf(struct l1_model_ms *, uint8_t tch_mode, uint8_t audio_mode); /* scheduler functions */ uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sock.h b/src/host/virt_phy/include/virtphy/l1ctl_sock.h index 8c96dc8..82ee5ca 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sock.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sock.h @@ -1,17 +1,33 @@ #pragma once #include +#include #include #define L1CTL_SOCK_PATH "/tmp/osmocom_l2" +struct l1ctl_sock_inst; + +struct l1ctl_sock_client { + /* list head in l1ctl_sock_inst.clients */ + struct llist_head list; + /* pointer back to the server socket that accepted us */ + struct l1ctl_sock_inst *l1ctl_sock; + /* Osmo FD for the client socket */ + struct osmo_fd ofd; + /* private data, can be set in accept_cb */ + void *priv; +}; + /* L1CTL socket instance contains socket data. */ struct l1ctl_sock_inst { void *priv; /* Will be appended after osmo-fd's data pointer. */ - struct osmo_fd connection; /* L1CTL connection to l2 app */ + struct llist_head clients; char* l1ctl_sock_path; /* Socket path used to connect to l23 */ struct osmo_fd ofd; /* Osmocom file descriptor to accept L1CTL connections. */ - void (*recv_cb)(struct l1ctl_sock_inst *vui, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ + void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ + /* Callback function called for new client after accept() */ + int (*accept_cb)(struct l1ctl_sock_client *lsc); }; /** @@ -19,20 +35,16 @@ */ struct l1ctl_sock_inst *l1ctl_sock_init( void *ctx, - void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg), + int (*accept_cb)(struct l1ctl_sock_client *lsc), char *path); /** * @brief Transmit message to l2. */ -int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg); +int l1ctl_sock_write_msg(struct l1ctl_sock_client *lsc, struct msgb *msg); /** * @brief Destroy instance. */ -void l1ctl_sock_destroy(); - -/** - * @brief Disconnect current connection. - */ -void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi); +void l1ctl_sock_destroy(struct l1ctl_sock_inst *lsi); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 61776ec..0cb5381 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -45,6 +45,10 @@ struct gsm_time downlink_time; /* current GSM time received on downlink */ struct gsm_time current_time; /* GSM time used internally for scheduling */ + struct { + uint32_t last_exec_fn; + struct llist_head mframe_items; + } sched; enum ms_state state; @@ -89,13 +93,16 @@ }; struct l1_model_ms { - struct l1ctl_sock_inst *lsi; + /* pointer to the L1CTL socket client associated with this specific MS */ + struct l1ctl_sock_client *lsc; + /* pointer to the (shared) GSMTAP/VirtUM socket to talk to BTS(s) */ struct virt_um_inst *vui; + /* actual per-MS state */ struct l1_state_ms state; }; -struct l1_model_ms *l1_model_ms_init(void *ctx); +struct l1_model_ms *l1_model_ms_init(void *ctx, struct l1ctl_sock_client *lsc, struct virt_um_inst *vui); void l1_model_ms_destroy(struct l1_model_ms *model); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_sched.h b/src/host/virt_phy/include/virtphy/virt_l1_sched.h index de08550..f3e9b84 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_sched.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_sched.h @@ -5,7 +5,9 @@ #include #include -typedef void virt_l1_sched_cb(uint32_t fn, struct msgb * msg); +struct l1_model_ms; + +typedef void virt_l1_sched_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg); /* bucket containing items to be executed for a specific mframe number */ struct virt_l1_sched_mframe_item { @@ -22,11 +24,9 @@ virt_l1_sched_cb * handler_cb; /* handler callback */ }; -void virt_l1_sched_init(struct l1_model_ms * model); -int virt_l1_sched_start(struct gsm_time time); -int virt_l1_sched_restart(struct gsm_time time); -void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset); -void virt_l1_sched_stop(); -void virt_l1_sched_execute(uint32_t fn); -void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, +int virt_l1_sched_restart(struct l1_model_ms *ms, struct gsm_time time); +void virt_l1_sched_sync_time(struct l1_model_ms *ms, struct gsm_time time, uint8_t hard_reset); +void virt_l1_sched_stop(struct l1_model_ms *ms); +void virt_l1_sched_execute(struct l1_model_ms *ms, uint32_t fn); +void virt_l1_sched_schedule(struct l1_model_ms *ms, struct msgb *msg, uint32_t fn, uint8_t ts, virt_l1_sched_cb * handler_cb); diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 18580b4..dfcd5a8 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -1,6 +1,7 @@ /* GSMTAP layer1 is transmits gsmtap messages over a virtual layer 1.*/ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -38,24 +39,16 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; - -void gsmtapl1_init(struct l1_model_ms *model) -{ - l1_model_ms = model; -} - /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, - struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; struct msgb *outmsg; /* msg to send with gsmtap header prepended */ - uint16_t arfcn = l1_model_ms->state.serving_cell.arfcn; /* arfcn of the cell we currently camp on */ + uint16_t arfcn = ms->state.serving_cell.arfcn; /* arfcn of the cell we currently camp on */ uint8_t signal_dbm = 63; /* signal strength */ uint8_t snr = 63; /* signal noise ratio, 63 is best */ uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ @@ -76,7 +69,7 @@ if (outmsg) { outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); - if (virt_um_write_msg(l1_model_ms->vui, outmsg) == -1) { + if (virt_um_write_msg(ms->vui, outmsg) == -1) { LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not send to virt um - " "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, @@ -95,86 +88,44 @@ } /** - * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint32_t fn, struct msgb *msg). - */ -void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg) -{ - gsmtapl1_tx_to_virt_um_inst(fn, l1_model_ms->vui, msg); -} - -/** * @see virt_prim_fbsb.c */ -extern void prim_fbsb_sync(struct msgb *msg); +extern void prim_fbsb_sync(struct l1_model_ms *ms, struct msgb *msg); /** * @see virt_prim_pm.c */ -extern uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev); +extern uint16_t prim_pm_set_sig_strength(struct l1_model_ms *ms, uint16_t arfcn, int16_t sig_lev); -/** - * Receive a gsmtap message from the virt um. - * - * As we do not have a downlink scheduler, but not all dl messages must be processed and thus forwarded to l2, this function also implements some message filtering. - * E.g. we do not forward: - * - uplink messages - * - messages with a wrong arfcn - * - if in MS_STATE_IDLE_SEARCHING - */ -void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, - struct msgb *msg) +static void l1ctl_from_virt_um(struct l1ctl_sock_client *lsc, struct msgb *msg, uint32_t fn, + uint16_t arfcn, uint8_t timeslot, uint8_t subslot, + uint8_t gsmtap_chantype, uint8_t chan_nr, uint8_t link_id, + uint8_t snr_db) { - if (!msg) + struct l1_model_ms *ms = lsc->priv; + uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(ms, arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); /* Power measurement with each received massage */ + + gsm_fn2gsmtime(&ms->state.downlink_time, fn); + + /* we do not forward messages to l23 if we are in network search state */ + if (ms->state.state == MS_STATE_IDLE_SEARCHING) return; - struct gsmtap_hdr *gh = msgb_l1(msg); - uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ - uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ - uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ - uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); /* Power measurement with each received massage */ - uint8_t snr = gh->snr_db; /* signal noise ratio */ - uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ - uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ - uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ - uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ - uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ - - /* generally ignore all uplink messages received */ - if (arfcn & GSMTAP_ARFCN_F_UPLINK) { - LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); - goto freemsg; - } - /* we do not forward messages to l23 if we are in network search state */ - if (l1_model_ms->state.state == MS_STATE_IDLE_SEARCHING) - goto freemsg; - /* forward downlink msg to fbsb sync routine if we are in sync state */ - if (l1_model_ms->state.state == MS_STATE_IDLE_SYNCING) { - prim_fbsb_sync(msg); + if (ms->state.state == MS_STATE_IDLE_SYNCING) { + prim_fbsb_sync(ms, msg); return; } /* generally ignore all messages coming from another arfcn than the camped one */ - if (l1_model_ms->state.serving_cell.arfcn != arfcn) { + if (ms->state.serving_cell.arfcn != arfcn) { LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn, l1_model_ms->state.serving_cell.arfcn); - goto freemsg; + arfcn, ms->state.serving_cell.arfcn); + return; } - msg->l2h = msgb_pull(msg, sizeof(*gh)); - chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); - /* see TS 08.58 -> 9.3.1 for channel number encoding */ - chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); - - gsm_fn2gsmtime(&l1_model_ms->state.downlink_time, fn); - virt_l1_sched_sync_time(l1_model_ms->state.downlink_time, 0); - virt_l1_sched_execute(fn); - - DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " - "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", - arfcn, fn, get_value_string(gsmtap_type_names, gh->type), - get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype), timeslot, - subslot, rsl_chantype, link_id, chan_nr); + virt_l1_sched_sync_time(ms, ms->state.downlink_time, 0); + virt_l1_sched_execute(ms, fn); /* switch case with removed ACCH flag */ switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { @@ -191,9 +142,9 @@ case GSMTAP_CHANNEL_SDCCH8: /* only forward messages on dedicated channels to l2, if * the timeslot and subslot is fitting */ - if (l1_model_ms->state.dedicated.tn == timeslot - && l1_model_ms->state.dedicated.subslot == subslot) { - l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); + if (ms->state.dedicated.tn == timeslot + && ms->state.dedicated.subslot == subslot) { + l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); } break; case GSMTAP_CHANNEL_AGCH: @@ -201,7 +152,7 @@ case GSMTAP_CHANNEL_BCCH: /* save to just forward here, as upper layer ignores messages that * do not fit the current state (e.g. gsm48_rr.c:2159) */ - l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); + l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: LOGP(DVIRPHY, LOGL_NOTICE, @@ -222,15 +173,60 @@ "Ignoring gsmtap msg from virt um - channel type unknown.\n"); break; } - -freemsg: - talloc_free(msg); } /** - * @see void gsmtapl1_rx_from_virt_um_cb(struct virt_um_inst *vui, struct msgb msg). + * Receive a gsmtap message from the virt um. + * + * As we do not have a downlink scheduler, but not all dl messages must be processed and thus forwarded to l2, this function also implements some message filtering. + * E.g. we do not forward: + * - uplink messages + * - messages with a wrong arfcn + * - if in MS_STATE_IDLE_SEARCHING */ -void gsmtapl1_rx_from_virt_um(struct msgb *msg) +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, + struct msgb *msg) { - gsmtapl1_rx_from_virt_um_inst_cb(l1_model_ms->vui, msg); + struct l1ctl_sock_inst *lsi = vui->priv; + struct l1ctl_sock_client *lsc; + + if (!msg) + return; + + struct gsmtap_hdr *gh = msgb_l1(msg); + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ + uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ + uint8_t snr = gh->snr_db; /* signal noise ratio */ + uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ + uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ + + msg->l2h = msgb_pull(msg, sizeof(*gh)); + chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); + /* see TS 08.58 -> 9.3.1 for channel number encoding */ + chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + + /* generally ignore all uplink messages received */ + if (arfcn & GSMTAP_ARFCN_F_UPLINK) { + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + goto freemsg; + } + + DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " + "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", + arfcn, fn, get_value_string(gsmtap_type_names, gh->type), + get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype), timeslot, + subslot, rsl_chantype, link_id, chan_nr); + + /* dispatch the incoming DL message from GSMTAP to each of the registered L1CTL instances */ + llist_for_each_entry(lsc, &lsi->clients, list) { + l1ctl_from_virt_um(lsc, msg, fn, arfcn, timeslot, subslot, gsmtap_chantype, + chan_nr, link_id, snr); + } + +freemsg: + talloc_free(msg); } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 8965ac1..be5557d 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -39,15 +39,13 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; - -static void l1_model_tch_mode_set(uint8_t tch_mode) +static void l1_model_tch_mode_set(struct l1_model_ms *ms, uint8_t tch_mode) { if (tch_mode == GSM48_CMODE_SPEECH_V1 || tch_mode == GSM48_CMODE_SPEECH_EFR) - l1_model_ms->state.tch_mode = tch_mode; + ms->state.tch_mode = tch_mode; else { /* set default value if no proper mode was assigned by l23 */ - l1_model_ms->state.tch_mode = GSM48_CMODE_SIGN; + ms->state.tch_mode = GSM48_CMODE_SIGN; } } @@ -56,11 +54,7 @@ */ void l1ctl_sap_init(struct l1_model_ms *model) { - l1_model_ms = model; - prim_rach_init(model); - prim_fbsb_init(model); - prim_data_init(model); - prim_traffic_init(model); + INIT_LLIST_HEAD(&model->state.sched.mframe_items); prim_pm_init(model); } @@ -69,20 +63,15 @@ * * Enqueues the message into the rx queue. */ -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_client *lsc, struct msgb *msg) { + struct l1_model_ms *ms = lsc->priv; /* check if the received msg is not empty */ - if (msg) { - DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); - l1ctl_sap_handler(msg); - } -} -/** - * @see l1ctl_sap_rx_from_l23_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg). - */ -void l1ctl_sap_rx_from_l23(struct msgb *msg) -{ - l1ctl_sap_rx_from_l23_inst_cb(l1_model_ms->lsi, msg); + if (!msg) + return; + + DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); + l1ctl_sap_handler(ms, msg); } /** @@ -90,19 +79,11 @@ * * This will forward the message as it is to the upper layer. */ -void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg) +void l1ctl_sap_tx_to_l23_inst(struct l1_model_ms *ms, struct msgb *msg) { /* prepend 16bit length before sending */ msgb_push_u16(msg, msg->len); - l1ctl_sock_write_msg(lsi, msg); -} - -/** - * @see void l1ctl_sap_tx_to_l23(struct l1ctl_sock_inst *lsi, struct msgb *msg). - */ -void l1ctl_sap_tx_to_l23(struct msgb *msg) -{ - l1ctl_sap_tx_to_l23_inst(l1_model_ms->lsi, msg); + l1ctl_sock_write_msg(ms->lsc, msg); } /** @@ -170,7 +151,7 @@ * * This handler will call the specific routine dependent on the L1CTL message type. */ -void l1ctl_sap_handler(struct msgb *msg) +void l1ctl_sap_handler(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h; @@ -186,49 +167,49 @@ switch (l1h->msg_type) { case L1CTL_FBSB_REQ: - l1ctl_rx_fbsb_req(msg); + l1ctl_rx_fbsb_req(ms, msg); break; case L1CTL_DM_EST_REQ: - l1ctl_rx_dm_est_req(msg); + l1ctl_rx_dm_est_req(ms, msg); break; case L1CTL_DM_REL_REQ: - l1ctl_rx_dm_rel_req(msg); + l1ctl_rx_dm_rel_req(ms, msg); break; case L1CTL_PARAM_REQ: - l1ctl_rx_param_req(msg); + l1ctl_rx_param_req(ms, msg); break; case L1CTL_DM_FREQ_REQ: - l1ctl_rx_dm_freq_req(msg); + l1ctl_rx_dm_freq_req(ms,msg); break; case L1CTL_CRYPTO_REQ: - l1ctl_rx_crypto_req(msg); + l1ctl_rx_crypto_req(ms, msg); break; case L1CTL_RACH_REQ: - l1ctl_rx_rach_req(msg); + l1ctl_rx_rach_req(ms, msg); goto exit_nofree; case L1CTL_DATA_REQ: - l1ctl_rx_data_req(msg); + l1ctl_rx_data_req(ms, msg); goto exit_nofree; case L1CTL_PM_REQ: - l1ctl_rx_pm_req(msg); + l1ctl_rx_pm_req(ms, msg); break; case L1CTL_RESET_REQ: - l1ctl_rx_reset_req(msg); + l1ctl_rx_reset_req(ms, msg); break; case L1CTL_CCCH_MODE_REQ: - l1ctl_rx_ccch_mode_req(msg); + l1ctl_rx_ccch_mode_req(ms, msg); break; case L1CTL_TCH_MODE_REQ: - l1ctl_rx_tch_mode_req(msg); + l1ctl_rx_tch_mode_req(ms, msg); break; case L1CTL_NEIGH_PM_REQ: - l1ctl_rx_neigh_pm_req(msg); + l1ctl_rx_neigh_pm_req(ms, msg); break; case L1CTL_TRAFFIC_REQ: - l1ctl_rx_traffic_req(msg); + l1ctl_rx_traffic_req(ms, msg); goto exit_nofree; case L1CTL_SIM_REQ: - l1ctl_rx_sim_req(msg); + l1ctl_rx_sim_req(ms, msg); break; } @@ -255,7 +236,7 @@ * Handle state change from idle to dedicated mode. * */ -void l1ctl_rx_dm_est_req(struct msgb *msg) +void l1ctl_rx_dm_est_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; @@ -267,16 +248,16 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", ul->chan_nr, timeslot, subslot); - l1_model_ms->state.dedicated.chan_type = rsl_chantype; - l1_model_ms->state.dedicated.tn = timeslot; - l1_model_ms->state.dedicated.subslot = subslot; - l1_model_ms->state.state = MS_STATE_DEDICATED; + ms->state.dedicated.chan_type = rsl_chantype; + ms->state.dedicated.tn = timeslot; + ms->state.dedicated.subslot = subslot; + ms->state.state = MS_STATE_DEDICATED; /* TCH config */ if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { - l1_model_ms->state.tch_mode = est_req->tch_mode; - l1_model_tch_mode_set(est_req->tch_mode); - l1_model_ms->state.audio_mode = est_req->audio_mode; + ms->state.tch_mode = est_req->tch_mode; + l1_model_tch_mode_set(ms, est_req->tch_mode); + ms->state.audio_mode = est_req->audio_mode; /* TODO: configure audio hardware for encoding / * decoding / recording / playing voice */ } @@ -293,7 +274,7 @@ * * Note: Not needed for virtual physical layer as freqency hopping is generally disabled. */ -void l1ctl_rx_dm_freq_req(struct msgb *msg) +void l1ctl_rx_dm_freq_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; @@ -317,7 +298,7 @@ * TODO: Implement cryptographic operations for virtual um! * TODO: Implement this handler routine! */ -void l1ctl_rx_crypto_req(struct msgb *msg) +void l1ctl_rx_crypto_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; @@ -332,8 +313,8 @@ return; } - l1_model_ms->state.crypto_inf.algo = cr->algo; - memcpy(l1_model_ms->state.crypto_inf.key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); + ms->state.crypto_inf.algo = cr->algo; + memcpy(ms->state.crypto_inf.key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); } /** @@ -346,15 +327,15 @@ * Handle state change from dedicated to idle mode. Flush message buffers of dedicated channel. * */ -void l1ctl_rx_dm_rel_req(struct msgb *msg) +void l1ctl_rx_dm_rel_req(struct l1_model_ms *ms, struct msgb *msg) { DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); - l1_model_ms->state.dedicated.chan_type = 0; - l1_model_ms->state.dedicated.tn = 0; - l1_model_ms->state.dedicated.subslot = 0; - l1_model_ms->state.tch_mode = GSM48_CMODE_SIGN; - l1_model_ms->state.state = MS_STATE_IDLE_CAMPING; + ms->state.dedicated.chan_type = 0; + ms->state.dedicated.tn = 0; + ms->state.dedicated.subslot = 0; + ms->state.tch_mode = GSM48_CMODE_SIGN; + ms->state.state = MS_STATE_IDLE_CAMPING; /* TODO: disable ciphering */ /* TODO: disable audio recording / playing */ @@ -371,7 +352,7 @@ * * Note: Not needed for virtual physical layer. */ -void l1ctl_rx_param_req(struct msgb *msg) +void l1ctl_rx_param_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; @@ -394,7 +375,7 @@ * to just tell l2 that we are rdy. * */ -void l1ctl_rx_reset_req(struct msgb *msg) +void l1ctl_rx_reset_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_reset *reset_req = (struct l1ctl_reset *) l1h->data; @@ -402,14 +383,14 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); - l1_model_ms->state.state = MS_STATE_IDLE_SEARCHING; - virt_l1_sched_stop(); - l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + ms->state.state = MS_STATE_IDLE_SEARCHING; + virt_l1_sched_stop(ms); + l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: - virt_l1_sched_restart(l1_model_ms->state.downlink_time); + virt_l1_sched_restart(ms, ms->state.downlink_time); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); - l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; default: LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); @@ -430,7 +411,7 @@ * * TODO: Implement this handler routine! */ -void l1ctl_rx_ccch_mode_req(struct msgb *msg) +void l1ctl_rx_ccch_mode_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_ccch_mode_req *ccch_mode_req = (struct l1ctl_ccch_mode_req *) l1h->data; @@ -438,10 +419,10 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); - l1_model_ms->state.serving_cell.ccch_mode = ccch_mode; + ms->state.serving_cell.ccch_mode = ccch_mode; /* check if more has to be done here */ - l1ctl_tx_ccch_mode_conf(ccch_mode); + l1ctl_tx_ccch_mode_conf(ms, ccch_mode); } /** @@ -455,20 +436,20 @@ * * TODO: Implement this handler routine! */ -void l1ctl_rx_tch_mode_req(struct msgb *msg) +void l1ctl_rx_tch_mode_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_tch_mode_req *tch_mode_req = (struct l1ctl_tch_mode_req *) l1h->data; - l1_model_tch_mode_set(tch_mode_req->tch_mode); - l1_model_ms->state.audio_mode = tch_mode_req->audio_mode; + l1_model_tch_mode_set(ms, tch_mode_req->tch_mode); + ms->state.audio_mode = tch_mode_req->audio_mode; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", tch_mode_req->tch_mode, tch_mode_req->audio_mode); /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ - l1ctl_tx_tch_mode_conf(l1_model_ms->state.tch_mode, l1_model_ms->state.audio_mode); + l1ctl_tx_tch_mode_conf(ms, ms->state.tch_mode, ms->state.audio_mode); } /** @@ -484,7 +465,7 @@ * * Note: Not needed for virtual physical layer as we dont maintain neigbors. */ -void l1ctl_rx_neigh_pm_req(struct msgb *msg) +void l1ctl_rx_neigh_pm_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_neigh_pm_req *pm_req = (struct l1ctl_neigh_pm_req *) l1h->data; @@ -512,7 +493,7 @@ * ki comp128 * -------- */ -void l1ctl_rx_sim_req(struct msgb *msg) +void l1ctl_rx_sim_req(struct l1_model_ms *ms, struct msgb *msg) { uint16_t len = msg->len - sizeof(struct l1ctl_hdr); uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); @@ -536,7 +517,7 @@ * @param [in] msg_type L1CTL primitive message type. * @param [in] reset_type reset type (full, boot or just scheduler reset). */ -void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type) +void l1ctl_tx_reset(struct l1_model_ms *ms, uint8_t msg_type, uint8_t reset_type) { struct msgb *msg = l1ctl_msgb_alloc(msg_type); struct l1ctl_reset *reset_resp = (struct l1ctl_reset *) msgb_put(msg, sizeof(*reset_resp)); @@ -544,7 +525,7 @@ reset_resp->type = reset_type; DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); - l1ctl_sap_tx_to_l23(msg); + l1ctl_sap_tx_to_l23_inst(ms, msg); } /** @@ -556,7 +537,7 @@ * * Called by layer 1 to inform layer 2 that the ccch mode was successfully changed. */ -void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode) +void l1ctl_tx_ccch_mode_conf(struct l1_model_ms *ms, uint8_t ccch_mode) { struct msgb *msg = l1ctl_msgb_alloc(L1CTL_CCCH_MODE_CONF); struct l1ctl_ccch_mode_conf *mode_conf; @@ -565,7 +546,7 @@ mode_conf->ccch_mode = ccch_mode; DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); - l1ctl_sap_tx_to_l23(msg); + l1ctl_sap_tx_to_l23_inst(ms, msg); } /** @@ -578,7 +559,7 @@ * * Called by layer 1 to inform layer 23 that the traffic channel mode was successfully changed. */ -void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode) +void l1ctl_tx_tch_mode_conf(struct l1_model_ms *ms, uint8_t tch_mode, uint8_t audio_mode) { struct msgb *msg = l1ctl_msgb_alloc(L1CTL_TCH_MODE_CONF); struct l1ctl_tch_mode_conf *mode_conf; @@ -589,7 +570,7 @@ DEBUGP(DL1C, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, audio_mode); - l1ctl_sap_tx_to_l23(msg); + l1ctl_sap_tx_to_l23_inst(ms, msg); } /** diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index 370d3f3..d654c21 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -1,6 +1,7 @@ /* Socket based Layer1 <-> Layer23 communication over L1CTL primitives. */ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -32,23 +33,24 @@ #include #include #include +#include #include #include -#include #include -#include #include -#include - -#include - -#include #include #include #define L1CTL_SOCK_MSGB_SIZE 256 + +static void l1ctl_client_destroy(struct l1ctl_sock_client *lsc) +{ + osmo_fd_close(&lsc->ofd); + llist_del(&lsc->list); + talloc_free(lsc); +} /** * @brief L1CTL socket file descriptor callback function. @@ -60,7 +62,7 @@ */ static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what) { - struct l1ctl_sock_inst *lsi = ofd->data; + struct l1ctl_sock_client *lsc = ofd->data; struct l1ctl_hdr *l1h; struct msgb *msg; uint16_t len; @@ -87,44 +89,67 @@ msgb_put(msg, rc); l1h = (void *) msgb_data(msg); msg->l1h = (void *) l1h; - lsi->recv_cb(lsi, msg); + lsc->l1ctl_sock->recv_cb(lsc, msg); return 0; } err_close: perror("Failed to receive msg from l2. Connection will be closed.\n"); - l1ctl_sock_disconnect(lsi); + l1ctl_client_destroy(lsc); return 0; } +/* called for the master (listening) socket of the instance, allocates a new client */ static int l1ctl_sock_accept_cb(struct osmo_fd *ofd, unsigned int what) { struct l1ctl_sock_inst *lsi = ofd->data; - int fd; + struct l1ctl_sock_client *lsc; + int fd, rc; fd = accept(ofd->fd, NULL, NULL); if (fd < 0) { fprintf(stderr, "Failed to accept connection to l2.\n"); return -1; } + printf("Accepted client (fd=%u) from server (fd=%u)\n", fd, ofd->fd); - lsi->connection.fd = fd; - lsi->connection.when = BSC_FD_READ; - lsi->connection.cb = l1ctl_sock_data_cb; - lsi->connection.data = lsi; - - if (osmo_fd_register(&lsi->connection) != 0) { - fprintf(stderr, "Failed to register the l2 connection fd.\n"); + lsc = talloc_zero(lsi, struct l1ctl_sock_client); + if (!lsc) { + close(fd); + fprintf(stderr, "Failed to allocate L1CTL client\n"); return -1; } + + lsc->l1ctl_sock = lsi; + lsc->ofd.fd = fd; + lsc->ofd.when = BSC_FD_READ; + lsc->ofd.cb = l1ctl_sock_data_cb; + lsc->ofd.data = lsc; + if (lsi->accept_cb) { + rc = lsi->accept_cb(lsc); + if (rc < 0) { + talloc_free(lsc); + close(fd); + return rc; + } + } + + printf("Accepted L1CTL connection, lsc=%p, lsc->priv=%p\n", lsc, lsc->priv); + if (osmo_fd_register(&lsc->ofd) != 0) { + fprintf(stderr, "Failed to register the l2 connection fd.\n"); + talloc_free(lsc); + return -1; + } + llist_add_tail(&lsc->list, &lsi->clients); return 0; } struct l1ctl_sock_inst *l1ctl_sock_init( void *ctx, - void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg), + int (*accept_cb)(struct l1ctl_sock_client *lsc), char *path) { struct l1ctl_sock_inst *lsi; @@ -146,40 +171,28 @@ } lsi->recv_cb = recv_cb; - /* no connection -> invalid filedescriptor and not 0 (==std_in) */ - lsi->connection.fd = -1; + lsi->accept_cb = accept_cb; lsi->l1ctl_sock_path = path; - - osmo_fd_register(&lsi->ofd); + INIT_LLIST_HEAD(&lsi->clients); return lsi; } void l1ctl_sock_destroy(struct l1ctl_sock_inst *lsi) { - struct osmo_fd *ofd = &lsi->ofd; + struct l1ctl_sock_client *lsc, *lsc2; - osmo_fd_unregister(ofd); - close(ofd->fd); - ofd->fd = -1; - ofd->when = 0; + llist_for_each_entry_safe(lsc, lsc2, &lsi->clients, list) + l1ctl_client_destroy(lsc); + osmo_fd_close(&lsi->ofd); talloc_free(lsi); } -void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi) -{ - struct osmo_fd *ofd = &lsi->connection; - osmo_fd_unregister(ofd); - close(ofd->fd); - ofd->fd = -1; - ofd->when = 0; -} - -int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg) +int l1ctl_sock_write_msg(struct l1ctl_sock_client *lsc, struct msgb *msg) { int rc; - rc = write(lsi->connection.fd, msgb_data(msg), msgb_length(msg)); + rc = write(lsc->ofd.fd, msgb_data(msg), msgb_length(msg)); msgb_free(msg); return rc; } diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index 056c9eb..da0c314 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -19,17 +19,24 @@ */ #include +#include #include -struct l1_model_ms* l1_model_ms_init(void *ctx) +struct l1_model_ms *l1_model_ms_init(void *ctx, struct l1ctl_sock_client *lsc, struct virt_um_inst *vui) { struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); + if (!model) + return NULL; + + model->lsc = lsc; + model->vui = vui; + + l1ctl_sap_init(model); + return model; } void l1_model_ms_destroy(struct l1_model_ms *model) { - virt_um_destroy(model->vui); - l1ctl_sock_destroy(model->lsi); talloc_free(model); } diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index 20481df..7d1cdd4 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -1,4 +1,5 @@ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -24,55 +25,41 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; - -static LLIST_HEAD(mframe_item_list); - -static uint32_t last_exec_fn = 0; - /** - * @brief Initialize schedulers data structures. + * @brief Start scheduler thread based on current gsm time from model */ -void virt_l1_sched_init(struct l1_model_ms *model) +static int virt_l1_sched_start(struct l1_model_ms *ms, struct gsm_time time) { - l1_model_ms = model; + virt_l1_sched_sync_time(ms, time, 1); + return 0; } /** * @brief Clear scheduler queue and completely restart scheduler. */ -int virt_l1_sched_restart(struct gsm_time time) +int virt_l1_sched_restart(struct l1_model_ms *ms, struct gsm_time time) { - virt_l1_sched_stop(); - return virt_l1_sched_start(time); -} - -/** - * @brief Start scheduler thread based on current gsm time from model - */ -int virt_l1_sched_start(struct gsm_time time) -{ - virt_l1_sched_sync_time(time, 1); - return 0; + virt_l1_sched_stop(ms); + return virt_l1_sched_start(ms, time); } /** * @brief Sync scheduler with given time. */ -void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset) +void virt_l1_sched_sync_time(struct l1_model_ms *ms, struct gsm_time time, uint8_t hard_reset) { - l1_model_ms->state.current_time = time; + ms->state.current_time = time; } /** * @brief Stop the scheduler thread and cleanup mframe items queue */ -void virt_l1_sched_stop() +void virt_l1_sched_stop(struct l1_model_ms *ms) { struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; /* Empty tdma and mframe sched items lists */ - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { + llist_for_each_entry_safe(mi_next, mi_tmp, &ms->state.sched.mframe_items, mframe_item_entry) { struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) { @@ -87,14 +74,15 @@ /** * @brief Handle all pending scheduled items for the current frame number. */ -void virt_l1_sched_execute(uint32_t fn) +void virt_l1_sched_execute(struct l1_model_ms *ms, uint32_t fn) { + struct l1_state_ms *l1s = &ms->state; struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; - uint8_t hyperframe_restart = fn < last_exec_fn; + uint8_t hyperframe_restart = fn < l1s->sched.last_exec_fn; - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { + llist_for_each_entry_safe(mi_next, mi_tmp, &l1s->sched.mframe_items, mframe_item_entry) { /* execute all registered handler for current mf sched item */ - uint8_t exec_now = mi_next->fn <= fn || (hyperframe_restart && mi_next->fn > last_exec_fn); + uint8_t exec_now = mi_next->fn <= fn || (hyperframe_restart && mi_next->fn > l1s->sched.last_exec_fn); /* break loop, as we have an ordered list in case the hyperframe had not been reset */ uint8_t break_now = mi_next->fn > fn && !hyperframe_restart; @@ -106,7 +94,7 @@ /* exec tdma sched item's handler callback */ /* TODO: we do not have a TDMA scheduler currently and execute * all scheduled tdma items here at once */ - ti_next->handler_cb(mi_next->fn, ti_next->msg); + ti_next->handler_cb(ms, mi_next->fn, ti_next->msg); /* remove handled tdma sched item */ llist_del(&ti_next->tdma_item_entry); } @@ -118,19 +106,19 @@ if (break_now) break; } - last_exec_fn = fn; + l1s->sched.last_exec_fn = fn; } /** * @brief Schedule a msg to the given framenumber and timeslot. */ -void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, - virt_l1_sched_cb * handler_cb) +void virt_l1_sched_schedule(struct l1_model_ms *ms, struct msgb *msg, uint32_t fn, uint8_t ts, + virt_l1_sched_cb *handler_cb) { struct virt_l1_sched_mframe_item *mi_next = NULL, *mi_tmp = NULL, *mi_fn = NULL; struct virt_l1_sched_tdma_item *ti_new = NULL; - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { + llist_for_each_entry_safe(mi_next, mi_tmp, &ms->state.sched.mframe_items, mframe_item_entry) { if (mi_next->fn == fn) { mi_fn = mi_next; break; diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 72c58b7..4b07ca6 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -1,7 +1,7 @@ /* Layer 1 normal data burst uplink handling and scheduling */ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -38,19 +38,16 @@ #include -static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); - /** * @brief Handler callback function for DATA request. * * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_data_conf(fn, 0, l1_model_ms->state.serving_cell.arfcn); + gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + l1ctl_tx_data_conf(ms, fn, 0, ms->state.serving_cell.arfcn); } /** @@ -64,13 +61,13 @@ * * TODO: Check if a msg on FACCH needs special handling. */ -void l1ctl_rx_data_req(struct msgb *msg) +void l1ctl_rx_data_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state.current_time, + uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); @@ -81,10 +78,10 @@ msg->l2h = data_ind->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(ms, msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } -void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, +void l1ctl_tx_data_ind(struct l1_model_ms *ms, struct msgb *msg, uint16_t arfcn, uint8_t link_id, uint8_t chan_nr, uint32_t fn, uint8_t snr, uint8_t signal_dbm, uint8_t num_biterr, uint8_t fire_crc) { @@ -111,7 +108,7 @@ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); DEBUGP(DL1C, "Sending signaling-data to l23.\n"); - l1ctl_sap_tx_to_l23(l1ctl_msg); + l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } /** @@ -122,20 +119,10 @@ * @param [in] arfcn arfcn of the cell the message was send on * */ -void l1ctl_tx_data_conf(uint32_t fn, uint16_t snr, uint16_t arfcn) +void l1ctl_tx_data_conf(struct l1_model_ms *ms, uint32_t fn, uint16_t snr, uint16_t arfcn) { struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn, snr, arfcn); /* send confirm to layer23 */ - l1ctl_sap_tx_to_l23(l1ctl_msg); -} - -/** - * @brief Initialize virtual prim data. - * - * @param [in] model the l1 model instance - */ -void prim_data_init(struct l1_model_ms *model) -{ - l1_model_ms = model; + l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 7f99821..59fda35 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -1,6 +1,6 @@ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -35,7 +35,6 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; static uint16_t sync_count = 0; /** @@ -52,9 +51,9 @@ * Note: virt bts does not broadcast freq and sync bursts. * */ -void l1ctl_rx_fbsb_req(struct msgb *msg) +void l1ctl_rx_fbsb_req(struct l1_model_ms *ms, struct msgb *msg) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; @@ -70,22 +69,21 @@ * * Note: for virtual layer 1 this can be a random downlink message, as we can parse the fn from the gsmtap header. */ -void prim_fbsb_sync(struct msgb *msg) +void prim_fbsb_sync(struct l1_model_ms *ms, struct msgb *msg) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; struct gsmtap_hdr *gh = msgb_l1(msg); uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ /* ignore messages from other arfcns as the one requested to sync to by l23 */ if (l1s->fbsb.arfcn != arfcn) { - talloc_free(msg); /* cancel sync if we did not receive a msg on dl from * the requested arfcn that we can sync to */ if (sync_count++ > 20) { sync_count = 0; l1s->state = MS_STATE_IDLE_SEARCHING; - l1ctl_tx_fbsb_conf(1, (l1s->fbsb.arfcn)); + l1ctl_tx_fbsb_conf(ms, 1, (l1s->fbsb.arfcn)); } return; } @@ -98,9 +96,8 @@ /* Update current gsm time each time we receive a message on the virt um */ gsm_fn2gsmtime(&l1s->downlink_time, fn); /* Restart scheduler */ - virt_l1_sched_restart(l1s->downlink_time); - talloc_free(msg); - l1ctl_tx_fbsb_conf(0, arfcn); + virt_l1_sched_restart(ms, l1s->downlink_time); + l1ctl_tx_fbsb_conf(ms, 0, arfcn); } /** @@ -113,7 +110,7 @@ * * No calculation needed for virtual pyh -> uses dummy values for a good link quality. */ -void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) +void l1ctl_tx_fbsb_conf(struct l1_model_ms *ms, uint8_t res, uint16_t arfcn) { struct msgb *msg; struct l1ctl_fbsb_conf *resp; @@ -131,14 +128,5 @@ DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); - l1ctl_sap_tx_to_l23(msg); -} -/** - * @brief Initialize virtual prim pm. - * - * @param [in] model the l1 model instance - */ -void prim_fbsb_init(struct l1_model_ms *model) -{ - l1_model_ms = model; + l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 6335c61..96b7f07 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -1,6 +1,6 @@ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -35,8 +35,6 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; - /** * @brief Change the signal strength for a given arfcn. * @@ -45,9 +43,9 @@ * @param [in] arfcn to change sig str for. * @param [in] sig_lev the measured signal level value. */ -uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) +uint16_t prim_pm_set_sig_strength(struct l1_model_ms *ms, uint16_t arfcn, int16_t sig_lev) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; if (l1s->pm.timeout_s > 0 || l1s->pm.timeout_us > 0) { osmo_timer_schedule(&l1s->pm.meas.arfcn_sig_lev_timers[arfcn], @@ -81,9 +79,9 @@ * Note: This should only be called after a certain time so some * messages have already been received. */ -void l1ctl_rx_pm_req(struct msgb *msg) +void l1ctl_rx_pm_req(struct l1_model_ms *ms, struct msgb *msg) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *) l1h->data; struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); @@ -110,13 +108,13 @@ } /* no more space to hold mor pm info in msgb, flush to l23 */ if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { - l1ctl_sap_tx_to_l23(resp_msg); + l1ctl_sap_tx_to_l23_inst(ms, resp_msg); resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); } } /* transmit the remaining part of pm response to l23 */ if (resp_msg) - l1ctl_sap_tx_to_l23(resp_msg); + l1ctl_sap_tx_to_l23_inst(ms, resp_msg); } /** @@ -129,7 +127,6 @@ struct l1_state_ms *l1s = &model->state; int i; - l1_model_ms = model; /* init the signal level of all arfcns with the lowest value possible */ memset(l1s->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); /* init timers */ diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index bff777d..88e8206 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -1,7 +1,7 @@ /* Layer 1 Random Access Channel Burst */ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -38,9 +38,6 @@ #include -static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); - /* use if we have a combined uplink (RACH, SDCCH, ...) (see * http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) * if we have no combined channel config, uplink consists of only RACH * */ @@ -59,10 +56,10 @@ * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb *msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg) { - gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_rach_conf(fn, l1_model_ms->state.serving_cell.arfcn); + gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + l1ctl_tx_rach_conf(ms, fn, ms->state.serving_cell.arfcn); } /** @@ -75,9 +72,9 @@ * Transmit RACH request on RACH. Refer to 04.08 - 9.1.8 - Channel request. * */ -void l1ctl_rx_rach_req(struct msgb *msg) +void l1ctl_rx_rach_req(struct l1_model_ms *ms, struct msgb *msg) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; @@ -111,7 +108,7 @@ } else fn_sched = l1s->current_time.fn + offset; - virt_l1_sched_schedule(msg, fn_sched, ts, &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(ms, msg, fn_sched, ts, &virt_l1_sched_handler_cb); } /** @@ -122,21 +119,11 @@ * @param [in] fn the fn on which the rach was sent * @param [in] arfcn arfcn on which the rach was sent */ -void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn) +void l1ctl_tx_rach_conf(struct l1_model_ms *ms, uint32_t fn, uint16_t arfcn) { - struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); + struct msgb *msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); - l1ctl_sap_tx_to_l23(msg); -} - -/** - * @brief Initialize virtual prim rach. - * - * @param [in] model the l1 model instance - */ -void prim_rach_init(struct l1_model_ms *model) -{ - l1_model_ms = model; + l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index acfd493..9e87db9 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -1,7 +1,7 @@ /* Layer 1 normal data burst tx handling */ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -38,19 +38,16 @@ #include -static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); - /** * @brief Handler callback function for TRAFFIC request. * * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_traffic_conf(fn, 0, l1_model_ms->state.serving_cell.arfcn); + gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + l1ctl_tx_traffic_conf(ms, fn, 0, ms->state.serving_cell.arfcn); } /** @@ -63,26 +60,25 @@ * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. In virtual layer1 just submit it to the virt um. * */ -void l1ctl_rx_traffic_req(struct msgb *msg) +void l1ctl_rx_traffic_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *) ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state.current_time, ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(ms, msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } -void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, - uint8_t chan_nr, uint32_t fn, uint8_t snr, - uint8_t signal_dbm, uint8_t num_biterr, - uint8_t fire_crc) +void l1ctl_tx_traffic_ind(struct l1_model_ms *ms, struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, uint8_t signal_dbm, + uint8_t num_biterr, uint8_t fire_crc) { struct msgb *l1ctl_msg = NULL; struct l1ctl_traffic_ind * l1ti; @@ -107,7 +103,7 @@ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); DEBUGP(DL1C, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); - l1ctl_sap_tx_to_l23(l1ctl_msg); + l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } /** @@ -118,20 +114,10 @@ * @param [in] arfcn arfcn of the cell the message was send on * */ -void l1ctl_tx_traffic_conf(uint32_t fn, uint16_t snr, uint16_t arfcn) +void l1ctl_tx_traffic_conf(struct l1_model_ms *ms, uint32_t fn, uint16_t snr, uint16_t arfcn) { struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn, snr, arfcn); /* send confirm to layer23 */ - l1ctl_sap_tx_to_l23(l1ctl_msg); -} - -/** - * @brief Initialize virtual prim traffic. - * - * @param [in] model the l1 model instance - */ -void prim_traffic_init(struct l1_model_ms *model) -{ - l1_model_ms = model; + l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 28dd685..c7e11ca 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -1,6 +1,7 @@ /* osmocom includes */ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -27,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +38,17 @@ #include #define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" + +/* this exists once in the program, and contains the state that we + * only keep once: L1CTL server socket, GSMTAP/VirtUM socket */ +struct virtphy_context { + /* L1CTL socket server */ + struct l1ctl_sock_inst *l1ctl_sock; + /* Virtual Um layer based on GSMTAP multicast */ + struct virt_um_inst *virt_um; +}; + +static struct virtphy_context g_vphy; static char *dl_rx_grp = DEFAULT_MS_MCAST_GROUP; static char *ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; @@ -132,31 +145,38 @@ } while ((token = strtok(NULL, ":"))); } +/* create a new l1_model_ms instance when L1CTL socket accept()s new connection */ +static int l1ctl_accept_cb(struct l1ctl_sock_client *lsc) +{ + struct l1_model_ms *ms = l1_model_ms_init(lsc, lsc, g_vphy.virt_um); + + if (!ms) + return -ENOMEM; + + /* apply timeout and arfcn reduction value config to model */ + parse_pm_timeout(ms, pm_timeout); + parse_arfcn_sig_lev_red(ms, arfcn_sig_lev_red_mask); + + lsc->priv = ms; + + return 0; +} + int main(int argc, char *argv[]) { /* init loginfo */ - static struct l1_model_ms *model; - handle_options(argc, argv); ms_log_init(log_mask); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); - model = l1_model_ms_init(NULL); + g_vphy.virt_um = virt_um_init(NULL, ul_tx_grp, port, dl_rx_grp, port, + gsmtapl1_rx_from_virt_um_inst_cb); - model->vui = virt_um_init(NULL, ul_tx_grp, port, dl_rx_grp, port, - gsmtapl1_rx_from_virt_um_inst_cb); - model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, - l1ctl_sock_path); - - gsmtapl1_init(model); - l1ctl_sap_init(model); - virt_l1_sched_init(model); - - /* apply timeout and arfcn reduction value config to model */ - parse_pm_timeout(model, pm_timeout); - parse_arfcn_sig_lev_red(model, arfcn_sig_lev_red_mask); + g_vphy.l1ctl_sock = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, + l1ctl_accept_cb, l1ctl_sock_path); + g_vphy.virt_um->priv = g_vphy.l1ctl_sock; LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ @@ -168,7 +188,8 @@ osmo_select_main(0); } - l1_model_ms_destroy(model); + l1ctl_sock_destroy(g_vphy.l1ctl_sock); + virt_um_destroy(g_vphy.virt_um); /* not reached */ return EXIT_FAILURE; -- To view, visit https://gerrit.osmocom.org/3286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfb2a93f8b45a95215c01368b1a52d92283474e6 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:40 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Log MS context number whenever possible Message-ID: Review at https://gerrit.osmocom.org/3287 VIRT-PHY: Log MS context number whenever possible Now that we can have multiple MS connected to one virtphy instance, it is important to log some context whenever possible. To do so, we introduce a monotonically increasing MS number which gets assigned whenever we allocate a l1_model_ms and printed when the LOGPMS() or DEBUGPMS() macros are used. Change-Id: Id7d9507126a03def5bd7690f1dbe987f9a749e65 --- M src/host/virt_phy/include/virtphy/logging.h M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 13 files changed, 71 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/87/3287/1 diff --git a/src/host/virt_phy/include/virtphy/logging.h b/src/host/virt_phy/include/virtphy/logging.h index 6ca2525..c98986c 100644 --- a/src/host/virt_phy/include/virtphy/logging.h +++ b/src/host/virt_phy/include/virtphy/logging.h @@ -2,8 +2,15 @@ #include -#define DL1C 0 -#define DVIRPHY 1 +/* L1CTL related messages */ +enum virtphy_log_cat { + DL1C, + DVIRPHY, + DMAIN +}; + +#define LOGPMS(ss, lvl, ms, fmt, args ...) LOGP(ss, lvl, "MS %04u: " fmt, ms->nr, ## args) +#define DEBUGPMS(ss, ms, fmt, args ...) DEBUGP(ss, "MS %04u: " fmt, ms->nr, ## args) extern const struct log_info ms_log_info; diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 0cb5381..fa79127 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -93,6 +93,7 @@ }; struct l1_model_ms { + uint32_t nr; /* pointer to the L1CTL socket client associated with this specific MS */ struct l1ctl_sock_client *lsc; /* pointer to the (shared) GSMTAP/VirtUM socket to talk to BTS(s) */ diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index dfcd5a8..ac1c2b5 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -70,18 +70,18 @@ outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); if (virt_um_write_msg(ms->vui, outmsg) == -1) { - LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not send to virt um - " + LOGPMS(DVIRPHY, LOGL_ERROR, ms, "Gsmtap msg could not send to virt um - " "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, gh->sub_slot); } else { - DEBUGP(DVIRPHY, "Sending gsmtap msg to virt um - " + DEBUGPMS(DVIRPHY, ms, "Sending gsmtap msg to virt um - " "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, gh->sub_slot); } } else - LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); + LOGPMS(DVIRPHY, LOGL_ERROR, ms, "Gsmtap msg could not be created!\n"); /* free message */ msgb_free(msg); @@ -118,7 +118,7 @@ } /* generally ignore all messages coming from another arfcn than the camped one */ if (ms->state.serving_cell.arfcn != arfcn) { - LOGP(DVIRPHY, LOGL_NOTICE, + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn, ms->state.serving_cell.arfcn); return; @@ -155,7 +155,7 @@ l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: - LOGP(DVIRPHY, LOGL_NOTICE, + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); break; case GSMTAP_CHANNEL_SDCCH: @@ -165,11 +165,11 @@ case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: - LOGP(DVIRPHY, LOGL_NOTICE, + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring gsmtap msg from virt um - channel type not supported!\n"); break; default: - LOGP(DVIRPHY, LOGL_NOTICE, + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring gsmtap msg from virt um - channel type unknown.\n"); break; } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index be5557d..6bd63c9 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -70,7 +70,7 @@ if (!msg) return; - DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); + DEBUGPMS(DL1C, ms, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); l1ctl_sap_handler(ms, msg); } @@ -161,7 +161,7 @@ l1h = (struct l1ctl_hdr *) msg->data; if (sizeof(*l1h) > msg->len) { - LOGP(DL1C, LOGL_NOTICE, "Malformed message: too short. %u\n", msg->len); + LOGPMS(DL1C, LOGL_NOTICE, ms, "Malformed message: too short. %u\n", msg->len); goto exit_msgbfree; } @@ -245,7 +245,7 @@ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", ul->chan_nr, timeslot, subslot); ms->state.dedicated.chan_type = rsl_chantype; @@ -280,7 +280,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_dm_freq_req *freq_req = (struct l1ctl_dm_freq_req *) ul->payload; - DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", + DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, freq_req->h1.maio); } @@ -305,7 +305,7 @@ struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *) ul->payload; uint8_t key_len = msg->len - sizeof(*l1h) - sizeof(*ul) - sizeof(*cr); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", cr->algo, key_len); if (cr->algo && key_len != A5_KEY_LEN) { @@ -329,7 +329,7 @@ */ void l1ctl_rx_dm_rel_req(struct l1_model_ms *ms, struct msgb *msg) { - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); ms->state.dedicated.chan_type = 0; ms->state.dedicated.tn = 0; @@ -358,7 +358,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_par_req *par_req = (struct l1ctl_par_req *)ul->payload; - DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", + DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", par_req->ta, par_req->tx_power); } @@ -382,18 +382,18 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); ms->state.state = MS_STATE_IDLE_SEARCHING; virt_l1_sched_stop(ms); l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: virt_l1_sched_restart(ms, ms->state.downlink_time); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; default: - LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGPMS(DL1C, LOGL_ERROR, ms, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); break; } } @@ -417,7 +417,7 @@ struct l1ctl_ccch_mode_req *ccch_mode_req = (struct l1ctl_ccch_mode_req *) l1h->data; uint8_t ccch_mode = ccch_mode_req->ccch_mode; - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); ms->state.serving_cell.ccch_mode = ccch_mode; @@ -444,7 +444,7 @@ l1_model_tch_mode_set(ms, tch_mode_req->tch_mode); ms->state.audio_mode = tch_mode_req->audio_mode; - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", tch_mode_req->tch_mode, tch_mode_req->audio_mode); /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ @@ -470,7 +470,7 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_neigh_pm_req *pm_req = (struct l1ctl_neigh_pm_req *) l1h->data; - DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", + DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", pm_req->n); } @@ -498,7 +498,7 @@ uint16_t len = msg->len - sizeof(struct l1ctl_hdr); uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); - LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - SIM Request length: %u, data: %s\n", + LOGPMS(DL1C, LOGL_ERROR, ms, "Received and ignored from l23 - SIM Request length: %u, data: %s\n", len, osmo_hexdump(data, sizeof(data))); } @@ -523,7 +523,7 @@ struct l1ctl_reset *reset_resp = (struct l1ctl_reset *) msgb_put(msg, sizeof(*reset_resp)); reset_resp->type = reset_type; - DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); + DEBUGPMS(DL1C, ms, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); l1ctl_sap_tx_to_l23_inst(ms, msg); } @@ -545,7 +545,7 @@ mode_conf = (struct l1ctl_ccch_mode_conf *) msgb_put(msg, sizeof(*mode_conf)); mode_conf->ccch_mode = ccch_mode; - DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); + DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); l1ctl_sap_tx_to_l23_inst(ms, msg); } @@ -568,7 +568,7 @@ mode_conf->tch_mode = tch_mode; mode_conf->audio_mode = audio_mode; - DEBUGP(DL1C, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", + DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, audio_mode); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index d654c21..00f25a6 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -93,7 +93,7 @@ return 0; } err_close: - perror("Failed to receive msg from l2. Connection will be closed.\n"); + LOGP(DL1C, LOGL_ERROR, "Failed to receive msg from l2. Connection will be closed.\n"); l1ctl_client_destroy(lsc); return 0; @@ -110,15 +110,14 @@ fd = accept(ofd->fd, NULL, NULL); if (fd < 0) { - fprintf(stderr, "Failed to accept connection to l2.\n"); + LOGP(DL1C, LOGL_ERROR, "Failed to accept connection to l2.\n"); return -1; } - printf("Accepted client (fd=%u) from server (fd=%u)\n", fd, ofd->fd); lsc = talloc_zero(lsi, struct l1ctl_sock_client); if (!lsc) { close(fd); - fprintf(stderr, "Failed to allocate L1CTL client\n"); + LOGP(DL1C, LOGL_ERROR, "Failed to allocate L1CTL client\n"); return -1; } @@ -136,9 +135,9 @@ } } - printf("Accepted L1CTL connection, lsc=%p, lsc->priv=%p\n", lsc, lsc->priv); + LOGP(DL1C, LOGL_INFO, "Accepted client (fd=%u) from server (fd=%u)\n", fd, ofd->fd); if (osmo_fd_register(&lsc->ofd) != 0) { - fprintf(stderr, "Failed to register the l2 connection fd.\n"); + LOGP(DL1C, LOGL_ERROR, "Failed to register the l2 connection fd.\n"); talloc_free(lsc); return -1; } @@ -166,6 +165,7 @@ rc = osmo_sock_unix_init_ofd(&lsi->ofd, SOCK_STREAM, 0, path, OSMO_SOCK_F_BIND); if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Error creating L1CTL listening socket\n"); talloc_free(lsi); return NULL; } diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 7801bec..7fb2c23 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -71,7 +71,14 @@ .color = "\033[1;31m", .enabled = 1, .loglevel = LOGL_DEBUG, - } + }, + [DMAIN] = { + .name = "DMAIN", + .description = "Main Program / Data Structures", + .color = "\033[1;32m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + }, }; const struct log_info ms_log_info = { @@ -107,5 +114,8 @@ const char *getL1ctlPrimName(uint8_t type) { - return l1ctlPrimNames[type]; + if (type <= ARRAY_SIZE(l1ctlPrimNames)) + return l1ctlPrimNames[type]; + else + return "Unknwon Primitive"; } diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index da0c314..14676b0 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -1,5 +1,6 @@ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -20,7 +21,10 @@ #include #include +#include #include + +static uint32_t next_ms_nr; struct l1_model_ms *l1_model_ms_init(void *ctx, struct l1ctl_sock_client *lsc, struct virt_um_inst *vui) { @@ -28,15 +32,19 @@ if (!model) return NULL; + model->nr = next_ms_nr++; model->lsc = lsc; model->vui = vui; l1ctl_sap_init(model); + + LOGPMS(DMAIN, LOGL_INFO, model, "allocated\n"); return model; } void l1_model_ms_destroy(struct l1_model_ms *model) { + LOGPMS(DMAIN, LOGL_INFO, model, "destryed\n"); talloc_free(model); } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 4b07ca6..e03d097 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -71,7 +71,7 @@ ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGP(DL1C, + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", ul->link_id, ul, ul->payload, data_ind, data_ind->data, msg->l3h); @@ -107,7 +107,7 @@ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - DEBUGP(DL1C, "Sending signaling-data to l23.\n"); + DEBUGPMS(DL1C, ms, "Sending signaling-data to l23.\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 59fda35..932f163 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -57,7 +57,7 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); l1s->state = MS_STATE_IDLE_SYNCING; @@ -126,7 +126,7 @@ resp->result = res; resp->bsic = bsic; - DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); + DEBUGPMS(DL1C, ms, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 96b7f07..3202680 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -52,7 +52,7 @@ l1s->pm.timeout_s, l1s->pm.timeout_us); } l1s->pm.meas.arfcn_sig_lev_dbm[arfcn] = sig_lev - l1s->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; - DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", + DEBUGPMS(DL1C, ms, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", arfcn, l1s->pm.meas.arfcn_sig_lev_dbm[arfcn], dbm2rxlev(l1s->pm.meas.arfcn_sig_lev_dbm[arfcn])); return l1s->pm.meas.arfcn_sig_lev_dbm[arfcn]; @@ -91,7 +91,7 @@ pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - DEBUGP(DL1C, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + DEBUGPMS(DL1C, ms, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); for (arfcn_next = pm_req->range.band_arfcn_from; diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index 88e8206..c5bac73 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -82,7 +82,7 @@ uint8_t ts = 1; /* FIXME mostly, ts 1 is used for rach, where can i get that info? System info? */ uint16_t offset = ntohs(rach_req->offset); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", rach_req->ra, offset, rach_req->combined); if (rach_req->ra == 0x03) @@ -123,7 +123,7 @@ { struct msgb *msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); - DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", + DEBUGPMS(DL1C, ms, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 9e87db9..04f6749 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -69,7 +69,7 @@ uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; @@ -102,7 +102,7 @@ /* TODO: traffic decoding and decryption */ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); - DEBUGP(DL1C, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); + DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index c7e11ca..78a45f0 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -37,7 +37,7 @@ #include #include -#define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" +#define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1:DMAIN,1" /* this exists once in the program, and contains the state that we * only keep once: L1CTL server socket, GSMTAP/VirtUM socket */ -- To view, visit https://gerrit.osmocom.org/3287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id7d9507126a03def5bd7690f1dbe987f9a749e65 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:40 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Separate logging of L1 Control and L1 Data Message-ID: Review at https://gerrit.osmocom.org/3288 VIRT-PHY: Separate logging of L1 Control and L1 Data L1 Data is quite verbose, while control is typically limited, so let's make sure we log them as separate sub-systems Change-Id: Idebc371a63508c593855486ff01b2ba6e8c2cfd1 --- M src/host/virt_phy/include/virtphy/logging.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 6 files changed, 37 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/88/3288/1 diff --git a/src/host/virt_phy/include/virtphy/logging.h b/src/host/virt_phy/include/virtphy/logging.h index c98986c..b22db99 100644 --- a/src/host/virt_phy/include/virtphy/logging.h +++ b/src/host/virt_phy/include/virtphy/logging.h @@ -5,6 +5,7 @@ /* L1CTL related messages */ enum virtphy_log_cat { DL1C, + DL1P, DVIRPHY, DMAIN }; diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 6bd63c9..d896042 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -70,7 +70,6 @@ if (!msg) return; - DEBUGPMS(DL1C, ms, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); l1ctl_sap_handler(ms, msg); } @@ -146,6 +145,20 @@ return msg; } +static bool is_l1ctl_control(uint8_t msg_type) +{ + switch (msg_type) { + case L1CTL_DATA_REQ: + case L1CTL_DATA_CONF: + case L1CTL_TRAFFIC_REQ: + case L1CTL_TRAFFIC_CONF: + case L1CTL_TRAFFIC_IND: + return false; + default: + return true; + } +} + /** * @brief General handler for incoming L1CTL messages from layer 2/3. * @@ -154,6 +167,7 @@ void l1ctl_sap_handler(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h; + int log_subsys; if (!msg) return; @@ -165,6 +179,13 @@ goto exit_msgbfree; } + if (is_l1ctl_control(l1h->msg_type)) + log_subsys = DL1C; + else + log_subsys = DL1P; + + DEBUGPMS(log_subsys, ms, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); + switch (l1h->msg_type) { case L1CTL_FBSB_REQ: l1ctl_rx_fbsb_req(ms, msg); diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 7fb2c23..feb5081 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -64,7 +64,15 @@ .description = "Layer 1 Control", .color = "\033[1;31m", .enabled = 1, - .loglevel = LOGL_DEBUG, }, + .loglevel = LOGL_DEBUG, + }, + [DL1P] = { + .name = "DL1P", + .description = "Layer 1 Data", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + }, [DVIRPHY] = { .name = "DVIRPHY", .description = "Virtual Layer 1 Interface", diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index e03d097..cf34e7a 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -71,7 +71,7 @@ ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1C, ms, + DEBUGPMS(DL1P, ms, "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", ul->link_id, ul, ul->payload, data_ind, data_ind->data, msg->l3h); @@ -107,7 +107,7 @@ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - DEBUGPMS(DL1C, ms, "Sending signaling-data to l23.\n"); + DEBUGPMS(DL1P, ms, "Sending signaling-data to l23.\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 04f6749..46ba9f1 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -69,7 +69,7 @@ uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + DEBUGPMS(DL1P, ms, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; @@ -102,7 +102,7 @@ /* TODO: traffic decoding and decryption */ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); - DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); + DEBUGPMS(DL1P, ms, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 78a45f0..481cdc1 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -37,7 +37,7 @@ #include #include -#define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1:DMAIN,1" +#define DEFAULT_LOG_MASK "DL1C,1:DL1P,1:DVIRPHY,1:DMAIN,1" /* this exists once in the program, and contains the state that we * only keep once: L1CTL server socket, GSMTAP/VirtUM socket */ -- To view, visit https://gerrit.osmocom.org/3288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idebc371a63508c593855486ff01b2ba6e8c2cfd1 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:41 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Clean up logging statements Message-ID: Review at https://gerrit.osmocom.org/3289 VIRT-PHY: Clean up logging statements The generated log lines have been *super* long, let's make them significantly shorter. Also, differentiate between DEBUG and INFO level, so normal operation with LOGL_INFO will not spam the user while still printing useful information. Change-Id: If06a8b5f99349796d66a71201524361a6547945a --- M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c 7 files changed, 66 insertions(+), 59 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/89/3289/1 diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index ac1c2b5..5454022 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,14 @@ #include #include #include + +static char *pseudo_lchan_name(uint16_t arfcn, uint8_t ts, uint8_t ss, uint8_t sub_type) +{ + static char lname[64]; + snprintf(lname, sizeof(lname), "(arfcn=%u,ts=%u,ss=%u,type=%s)", + arfcn, ts, ss, get_value_string(gsmtap_gsm_channel_names, sub_type)); + return lname; +} /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. @@ -70,18 +79,16 @@ outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); if (virt_um_write_msg(ms->vui, outmsg) == -1) { - LOGPMS(DVIRPHY, LOGL_ERROR, ms, "Gsmtap msg could not send to virt um - " - "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, gh->timeslot, - gh->sub_slot); + LOGPMS(DVIRPHY, LOGL_ERROR, ms, "%s Tx go GSMTAP failed: %s\n", + pseudo_lchan_name(gh->arfcn, gh->timeslot, gh->sub_slot, gh->sub_type), + strerror(errno)); } else { - DEBUGPMS(DVIRPHY, ms, "Sending gsmtap msg to virt um - " - "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, gh->timeslot, - gh->sub_slot); + DEBUGPMS(DVIRPHY, ms, "%s: Tx to GSMTAP: %s\n", + pseudo_lchan_name(gh->arfcn, gh->timeslot, gh->sub_slot, gh->sub_type), + osmo_hexdump(data, data_len)); } } else - LOGPMS(DVIRPHY, LOGL_ERROR, ms, "Gsmtap msg could not be created!\n"); + LOGPMS(DVIRPHY, LOGL_ERROR, ms, "GSMTAP msg could not be created!\n"); /* free message */ msgb_free(msg); @@ -118,9 +125,6 @@ } /* generally ignore all messages coming from another arfcn than the camped one */ if (ms->state.serving_cell.arfcn != arfcn) { - LOGPMS(DVIRPHY, LOGL_NOTICE, ms, - "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn, ms->state.serving_cell.arfcn); return; } @@ -155,8 +159,7 @@ l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: - LOGPMS(DVIRPHY, LOGL_NOTICE, ms, - "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unexpected RACH in downlink ?!?\n"); break; case GSMTAP_CHANNEL_SDCCH: case GSMTAP_CHANNEL_CCCH: @@ -165,12 +168,12 @@ case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: - LOGPMS(DVIRPHY, LOGL_NOTICE, ms, - "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unsupported channel type %s\n", + get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype)); break; default: - LOGPMS(DVIRPHY, LOGL_NOTICE, ms, - "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unknown channel type %s\n", + get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype)); break; } } @@ -203,23 +206,24 @@ uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ + struct gsm_time gtime; msg->l2h = msgb_pull(msg, sizeof(*gh)); chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); /* see TS 08.58 -> 9.3.1 for channel number encoding */ chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + gsm_fn2gsmtime(>ime, fn); + + DEBUGP(DVIRPHY, "%s Rx from VirtUM: FN=%s chan_nr=0x%02x link_id=0x%02x\n", + pseudo_lchan_name(arfcn, timeslot, subslot, gsmtap_chantype), + osmo_dump_gsmtime(>ime), chan_nr, link_id); + /* generally ignore all uplink messages received */ if (arfcn & GSMTAP_ARFCN_F_UPLINK) { - LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring unexpected uplink message in downlink!\n"); goto freemsg; } - - DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " - "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", - arfcn, fn, get_value_string(gsmtap_type_names, gh->type), - get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype), timeslot, - subslot, rsl_chantype, link_id, chan_nr); /* dispatch the incoming DL message from GSMTAP to each of the registered L1CTL instances */ llist_for_each_entry(lsc, &lsi->clients, list) { diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index d896042..c7c8e3e 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -184,7 +184,7 @@ else log_subsys = DL1P; - DEBUGPMS(log_subsys, ms, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); + DEBUGPMS(log_subsys, ms, "Rx RAW from MS: %s\n", msgb_hexdump(msg)); switch (l1h->msg_type) { case L1CTL_FBSB_REQ: @@ -266,7 +266,7 @@ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", ul->chan_nr, timeslot, subslot); ms->state.dedicated.chan_type = rsl_chantype; @@ -301,7 +301,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_dm_freq_req *freq_req = (struct l1ctl_dm_freq_req *) ul->payload; - DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u): IGNORED\n", ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, freq_req->h1.maio); } @@ -326,11 +326,11 @@ struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *) ul->payload; uint8_t key_len = msg->len - sizeof(*l1h) - sizeof(*ul) - sizeof(*cr); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", cr->algo, key_len); if (cr->algo && key_len != A5_KEY_LEN) { - LOGP(DL1C, LOGL_ERROR, "L1CTL_CRYPTO_REQ -> Invalid key\n"); + LOGPMS(DL1C, LOGL_ERROR, ms, "L1CTL_CRYPTO_REQ -> Invalid key\n"); return; } @@ -350,7 +350,7 @@ */ void l1ctl_rx_dm_rel_req(struct l1_model_ms *ms, struct msgb *msg) { - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_DM_REL_REQ\n"); ms->state.dedicated.chan_type = 0; ms->state.dedicated.tn = 0; @@ -379,7 +379,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_par_req *par_req = (struct l1ctl_par_req *)ul->payload; - DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", par_req->ta, par_req->tx_power); } @@ -403,18 +403,18 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + DEBUGPMS(DL1C, ms, "Rx L1CTL_RESET_REQ (type=FULL)\n"); ms->state.state = MS_STATE_IDLE_SEARCHING; virt_l1_sched_stop(ms); l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: virt_l1_sched_restart(ms, ms->state.downlink_time); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); + DEBUGPMS(DL1C, ms, "Rx L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; default: - LOGPMS(DL1C, LOGL_ERROR, ms, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGPMS(DL1C, LOGL_ERROR, ms, "Rx L1CTL_RESET_REQ (type=unknown): IGNORED\n"); break; } } @@ -438,7 +438,7 @@ struct l1ctl_ccch_mode_req *ccch_mode_req = (struct l1ctl_ccch_mode_req *) l1h->data; uint8_t ccch_mode = ccch_mode_req->ccch_mode; - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_CCCH_MODE_REQ (mode=%u)\n", ccch_mode); ms->state.serving_cell.ccch_mode = ccch_mode; @@ -465,7 +465,7 @@ l1_model_tch_mode_set(ms, tch_mode_req->tch_mode); ms->state.audio_mode = tch_mode_req->audio_mode; - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", tch_mode_req->tch_mode, tch_mode_req->audio_mode); /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ @@ -491,8 +491,7 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_neigh_pm_req *pm_req = (struct l1ctl_neigh_pm_req *) l1h->data; - DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", - pm_req->n); + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_NEIGH_PM_REQ (list with %u entries): IGNORED\n", pm_req->n); } /** @@ -519,7 +518,7 @@ uint16_t len = msg->len - sizeof(struct l1ctl_hdr); uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); - LOGPMS(DL1C, LOGL_ERROR, ms, "Received and ignored from l23 - SIM Request length: %u, data: %s\n", + LOGPMS(DL1C, LOGL_ERROR, ms, "Rx SIM Request (length: %u, data: %s): UNSUPPORTED\n", len, osmo_hexdump(data, sizeof(data))); } @@ -544,7 +543,7 @@ struct l1ctl_reset *reset_resp = (struct l1ctl_reset *) msgb_put(msg, sizeof(*reset_resp)); reset_resp->type = reset_type; - DEBUGPMS(DL1C, ms, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); + LOGPMS(DL1C, LOGL_INFO, ms, "Tx %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); l1ctl_sap_tx_to_l23_inst(ms, msg); } @@ -566,7 +565,7 @@ mode_conf = (struct l1ctl_ccch_mode_conf *) msgb_put(msg, sizeof(*mode_conf)); mode_conf->ccch_mode = ccch_mode; - DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); l1ctl_sap_tx_to_l23_inst(ms, msg); } @@ -589,7 +588,7 @@ mode_conf->tch_mode = tch_mode; mode_conf->audio_mode = audio_mode; - DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, audio_mode); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index cf34e7a..8931cf9 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -71,12 +71,10 @@ ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1P, ms, - "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", - ul->link_id, ul, ul->payload, data_ind, data_ind->data, - msg->l3h); - msg->l2h = data_ind->data; + + LOGPMS(DL1P, LOGL_INFO, ms, "Rx L1CTL_DATA_REQ (chan_nr=0x%02x, link_id=0x%02x) %s\n", + ul->chan_nr, ul->link_id, osmo_hexdump(msg->l2h, msgb_l2len(msg))); virt_l1_sched_schedule(ms, msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } @@ -107,7 +105,8 @@ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - DEBUGPMS(DL1P, ms, "Sending signaling-data to l23.\n"); + LOGPMS(DL1P, LOGL_INFO, ms, "TX L1CTL_DATA_IND (link_id=0x%02x) %s\n", link_id, + osmo_hexdump(msgb_data(msg), msgb_length(msg))); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } @@ -124,5 +123,6 @@ struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn, snr, arfcn); /* send confirm to layer23 */ + LOGPMS(DL1P, LOGL_INFO, ms, "Tx L1CTL_DATA_CONF\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 932f163..c14a448 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -57,8 +57,8 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", - ntohs(sync_req->band_arfcn), sync_req->flags); + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + ntohs(sync_req->band_arfcn), sync_req->flags); l1s->state = MS_STATE_IDLE_SYNCING; l1s->fbsb.arfcn = ntohs(sync_req->band_arfcn); @@ -126,7 +126,7 @@ resp->result = res; resp->bsic = bsic; - DEBUGPMS(DL1C, ms, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_FBSB_CONF (res: %u)\n", res); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 3202680..1cd3c03 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -91,7 +91,7 @@ pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - DEBUGPMS(DL1C, ms, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); for (arfcn_next = pm_req->range.band_arfcn_from; @@ -108,13 +108,16 @@ } /* no more space to hold mor pm info in msgb, flush to l23 */ if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_PM_CONF\n"); l1ctl_sap_tx_to_l23_inst(ms, resp_msg); resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); } } /* transmit the remaining part of pm response to l23 */ - if (resp_msg) + if (resp_msg) { + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_PM_CONF\n"); l1ctl_sap_tx_to_l23_inst(ms, resp_msg); + } } /** diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index c5bac73..8fb0e2f 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -82,7 +82,7 @@ uint8_t ts = 1; /* FIXME mostly, ts 1 is used for rach, where can i get that info? System info? */ uint16_t offset = ntohs(rach_req->offset); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", rach_req->ra, offset, rach_req->combined); if (rach_req->ra == 0x03) @@ -123,7 +123,6 @@ { struct msgb *msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); - DEBUGPMS(DL1C, ms, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", - getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_RACH_CONF (fn: %u, arfcn: %u)\n", fn, arfcn); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 46ba9f1..6798bc1 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -69,7 +69,8 @@ uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1P, ms, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + DEBUGPMS(DL1P, ms, "Rx L1CTL_TRAFFIC_REQ (chan_nr=0x%02x, link_id=0x%02x)\n", + ul->chan_nr, ul->link_id); msg->l2h = tr->data; @@ -102,7 +103,7 @@ /* TODO: traffic decoding and decryption */ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); - DEBUGPMS(DL1P, ms, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); + DEBUGPMS(DL1P, ms, "Tx L1CTL_TRAFFIC_IND (chan_nr=0x%02x, link_id=0x%02x)\n", chan_nr, link_id); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } @@ -119,5 +120,6 @@ struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn, snr, arfcn); /* send confirm to layer23 */ + DEBUGPMS(DL1P, ms, "Tx L1CTL_TRAFFIC_CONF\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } -- To view, visit https://gerrit.osmocom.org/3289 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If06a8b5f99349796d66a71201524361a6547945a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:41 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Change default log levels Message-ID: Review at https://gerrit.osmocom.org/3290 VIRT-PHY: Change default log levels This will basically only print L1C message for all L1CTL happening between MS and the BTS, while suppressing the GSMTAP/virtUM and L1P related messages. Change-Id: I9513db3cee12644ed9b9858e13b740ffd27aba24 --- M src/host/virt_phy/src/virtphy.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/90/3290/1 diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 481cdc1..b6f4f0c 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -37,7 +37,7 @@ #include #include -#define DEFAULT_LOG_MASK "DL1C,1:DL1P,1:DVIRPHY,1:DMAIN,1" +#define DEFAULT_LOG_MASK "DL1C,2:DL1P,2:DVIRPHY,2:DMAIN,1" /* this exists once in the program, and contains the state that we * only keep once: L1CTL server socket, GSMTAP/VirtUM socket */ -- To view, visit https://gerrit.osmocom.org/3290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9513db3cee12644ed9b9858e13b740ffd27aba24 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:54:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:54:41 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Properly destroy l1_model_ms after disconnect Message-ID: Review at https://gerrit.osmocom.org/3291 VIRT-PHY: Properly destroy l1_model_ms after disconnect If a MS disconnects, we need to clean up all related state Change-Id: Ib7adef61150b5a4338483019e4dd75d7279d1f5d --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/l1ctl_sock.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virtphy.c 7 files changed, 33 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/91/3291/1 diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index 5903a02..94174da 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -27,7 +27,9 @@ void l1ctl_sap_init(struct l1_model_ms *model); +void l1ctl_sap_exit(struct l1_model_ms *model); void prim_pm_init(struct l1_model_ms *model); +void prim_pm_exit(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1_model_ms *model, struct msgb *msg); void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_client *lsc, struct msgb *msg); void l1ctl_sap_rx_from_l23(struct msgb *msg); diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sock.h b/src/host/virt_phy/include/virtphy/l1ctl_sock.h index 82ee5ca..2c98fa5 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sock.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sock.h @@ -28,6 +28,8 @@ void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ /* Callback function called for new client after accept() */ int (*accept_cb)(struct l1ctl_sock_client *lsc); + /* Callback function called when client disappeared */ + void (*close_cb)(struct l1ctl_sock_client *lsc); }; /** @@ -37,6 +39,7 @@ void *ctx, void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg), int (*accept_cb)(struct l1ctl_sock_client *lsc), + void (*close_cb)(struct l1ctl_sock_client *lsc), char *path); /** diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index c7c8e3e..d4b33f1 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -58,6 +58,12 @@ prim_pm_init(model); } +void l1ctl_sap_exit(struct l1_model_ms *model) +{ + virt_l1_sched_stop(model); + prim_pm_exit(model); +} + /** * @brief L1CTL handler called for received messages from L23. * diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index 00f25a6..bf28895 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -47,6 +47,9 @@ static void l1ctl_client_destroy(struct l1ctl_sock_client *lsc) { + struct l1ctl_sock_inst *lsi = lsc->l1ctl_sock; + if (lsi->close_cb) + lsi->close_cb(lsc); osmo_fd_close(&lsc->ofd); llist_del(&lsc->list); talloc_free(lsc); @@ -149,6 +152,7 @@ void *ctx, void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg), int (*accept_cb)(struct l1ctl_sock_client *lsc), + void (*close_cb)(struct l1ctl_sock_client *lsc), char *path) { struct l1ctl_sock_inst *lsi; @@ -172,6 +176,7 @@ lsi->recv_cb = recv_cb; lsi->accept_cb = accept_cb; + lsi->close_cb = close_cb; lsi->l1ctl_sock_path = path; INIT_LLIST_HEAD(&lsi->clients); diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index 14676b0..6a9fa99 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -46,5 +46,6 @@ void l1_model_ms_destroy(struct l1_model_ms *model) { LOGPMS(DMAIN, LOGL_INFO, model, "destryed\n"); + l1ctl_sap_exit(model); talloc_free(model); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 1cd3c03..4637013 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -138,3 +138,12 @@ l1s->pm.meas.arfcn_sig_lev_timers[i].data = &l1s->pm.meas.arfcn_sig_lev_dbm[i]; } } + +void prim_pm_exit(struct l1_model_ms *model) +{ + struct l1_state_ms *l1s = &model->state; + int i; + + for (i = 0; i < 1024; ++i) + osmo_timer_del(&l1s->pm.meas.arfcn_sig_lev_timers[i]); +} diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index b6f4f0c..23811c2 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -162,6 +162,12 @@ return 0; } +static void l1ctl_close_cb(struct l1ctl_sock_client *lsc) +{ + struct l1_model_ms *ms = lsc->priv; + l1_model_ms_destroy(ms); +} + int main(int argc, char *argv[]) { /* init loginfo */ @@ -175,7 +181,7 @@ gsmtapl1_rx_from_virt_um_inst_cb); g_vphy.l1ctl_sock = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, - l1ctl_accept_cb, l1ctl_sock_path); + l1ctl_accept_cb, l1ctl_close_cb, l1ctl_sock_path); g_vphy.virt_um->priv = g_vphy.l1ctl_sock; LOGP(DVIRPHY, LOGL_INFO, -- To view, visit https://gerrit.osmocom.org/3291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib7adef61150b5a4338483019e4dd75d7279d1f5d Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:55:36 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 19 Jul 2017 11:55:36 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: ensure addressbook entry names are unique Message-ID: Review at https://gerrit.osmocom.org/3292 sccp: ensure addressbook entry names are unique It is possible to add two (or more) different sccp-addresses under the same name, when the addresses are defined in different cs7 instances. Add a check to make sure an address name is not used multiple times Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 --- M src/osmo_ss7_vty.c 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/92/3292/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index a076724..76882eb 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1199,6 +1199,15 @@ return CMD_WARNING; } + /* Ensure that we do not use address names that + * are already used in other ss7 instances. */ + if (addr_entry_by_name(name, NULL) != NULL) { + vty_out(vty, + "address-name already used in other ss7 instance!%s", + VTY_NEWLINE); + return CMD_WARNING; + } + entry = addr_entry_by_name(name, inst); /* Create a new addressbook entry if we can not find an -- To view, visit https://gerrit.osmocom.org/3292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:55:36 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 19 Jul 2017 11:55:36 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: improve sccp-addressbook API Message-ID: Review at https://gerrit.osmocom.org/3293 sccp: improve sccp-addressbook API When searching the addressbook, return the SS7 instance and write sccp-address to given destination pointer. (name -> addr+ss7inst) Remove the no longer needed ss7 instance pointer when using the backward search. (addr -> name) Change-Id: I68209dd1b2c0aa94b1894637a22b5cc3a3ff1250 --- M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7_vty.c 2 files changed, 20 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/93/3293/1 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 2258b0d..c00320c 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -248,8 +248,7 @@ int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); -struct osmo_sccp_addr * -osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); +struct osmo_ss7_instance * +osmo_sccp_addr_by_name(struct osmo_sccp_addr *addr, const char *name); -char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, - const struct osmo_ss7_instance *ss7); +const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr); diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 76882eb..e3f7f46 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -979,41 +979,35 @@ } /*! \brief Lookup an SCCP address from the addressbook by its name. - * \param[in] lookup-name of the address to lookup - * \param[in] ss7 instance (NULL to search global) - * \returns SCCP address; NULL on error */ -struct osmo_sccp_addr *osmo_sccp_addr_by_name(const char *name, - const struct osmo_ss7_instance - *ss7) + * \param[in] addr pointer to output the resulting sccp-address; + * (set to NULL if not interested) + * \param[in] name of the address to lookup + * \returns SS7 instance; NULL on error */ +struct osmo_ss7_instance *osmo_sccp_addr_by_name(struct osmo_sccp_addr *addr, + const char *name) { struct osmo_sccp_addr_entry *entry; - entry = addr_entry_by_name(name, ss7); - if (entry) - return &entry->addr; + entry = addr_entry_by_name(name, NULL); + if (!entry) + return NULL; - return NULL; + if (addr) + memcpy(addr, &entry->addr, sizeof(*addr)); + + return entry->inst; } /*! \brief Reverse lookup the lookup-name of a specified SCCP address. * \param[in] name of the address to lookup - * \param[in] ss7 instance (NULL to search global) * \returns char pointer to the lookup-name; NULL on error */ -char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, - const struct osmo_ss7_instance *ss7) +const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr) { struct osmo_sccp_addr_entry *entry; - if (ss7 == NULL) { - llist_for_each_entry(entry, &sccp_address_book_global, list_global) { - if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) - return entry->name; - } - } else { - llist_for_each_entry(entry, &ss7->cfg.sccp_address_book, list) { - if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) - return entry->name; - } + llist_for_each_entry(entry, &sccp_address_book_global, list_global) { + if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) + return entry->name; } return NULL; -- To view, visit https://gerrit.osmocom.org/3293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68209dd1b2c0aa94b1894637a22b5cc3a3ff1250 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:56:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:56:47 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Use new OSMO_SOCK_F_NO_MCAST_{LOOP, ALL} flags In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I961aa07a381fef2cf9a2fb5357937864364ca04b Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 11:57:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:57:00 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Use osmo_fd_close() introduced in libosmocore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8a518dfb09465c2765681407e5581aee2d62d6d Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 11:57:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:57:18 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Use IPv4 multicast groups for private / local scope In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e3acd745e65a6cfa70b681a440da6a59a1ed0b5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 11:57:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:57:23 +0000 Subject: osmocom-bb[master]: VIRT-PHY: some more comments/documentation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24fc98624178e9441d6cfcd61bc14e17c1391e9e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 11:57:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:57:38 +0000 Subject: osmocom-bb[master]: VIRT-PHY: reorganize data structures In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ca4dad1c6c668ce6307d5e5d728b1c1502af12 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 11:58:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:58:38 +0000 Subject: osmocom-bb[master]: VIRT-PHY Use libosmocore unix domain socket helper In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0fa003bd7c7468d39a0c39fbea89000d576a4f3 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 11:58:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:58:41 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Don't redefine GSMTAP port number, use libosmocore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11d04d76292c52ec5ab70893e8c6a2e55586b2ec Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 11:58:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:58:46 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Don't redefine GSMTAP port number, use libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Don't redefine GSMTAP port number, use libosmocore ...................................................................... VIRT-PHY: Don't redefine GSMTAP port number, use libosmocore Change-Id: I11d04d76292c52ec5ab70893e8c6a2e55586b2ec --- M src/host/virt_phy/include/virtphy/virtual_um.h M src/host/virt_phy/src/virtphy.c 2 files changed, 2 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h index 79d74a5..52f2df6 100644 --- a/src/host/virt_phy/include/virtphy/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -17,9 +17,7 @@ #define VIRT_UM_MSGB_SIZE 256 #define DEFAULT_MS_MCAST_GROUP "239.193.23.1" -#define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ #define DEFAULT_BTS_MCAST_GROUP "239.193.23.2" -#define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ struct virt_um_inst { void *priv; diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 43346ed..28dd685 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -34,12 +35,11 @@ #include #include -#define DEFAULT_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ #define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" static char *dl_rx_grp = DEFAULT_MS_MCAST_GROUP; static char *ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; -static int port = DEFAULT_MCAST_PORT; +static int port = GSMTAP_UDP_PORT; static char *log_mask = DEFAULT_LOG_MASK; static char *l1ctl_sock_path = L1CTL_SOCK_PATH; static char *arfcn_sig_lev_red_mask = NULL; -- To view, visit https://gerrit.osmocom.org/3285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I11d04d76292c52ec5ab70893e8c6a2e55586b2ec Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:58:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:58:47 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY Use libosmocore unix domain socket helper In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY Use libosmocore unix domain socket helper ...................................................................... VIRT-PHY Use libosmocore unix domain socket helper Change-Id: Ic0fa003bd7c7468d39a0c39fbea89000d576a4f3 --- M src/host/virt_phy/src/l1ctl_sock.c 1 file changed, 11 insertions(+), 28 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index 2e16bfa..370d3f3 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -32,13 +32,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include @@ -102,11 +102,9 @@ { struct l1ctl_sock_inst *lsi = ofd->data; - struct sockaddr_un local_addr; - socklen_t addr_len = sizeof(struct sockaddr_in); int fd; - fd = accept(ofd->fd, (struct sockaddr *)&local_addr, &addr_len); + fd = accept(ofd->fd, NULL, NULL); if (fd < 0) { fprintf(stderr, "Failed to accept connection to l2.\n"); return -1; @@ -130,39 +128,24 @@ char *path) { struct l1ctl_sock_inst *lsi; - struct sockaddr_un local_addr; - int fd, rc; + int rc; if (!path) path = L1CTL_SOCK_PATH; - if ((fd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) { - fprintf(stderr, "Failed to create Unix Domain Socket.\n"); - return NULL; - } - - local_addr.sun_family = AF_LOCAL; - strcpy(local_addr.sun_path, path); - unlink(local_addr.sun_path); - - if ((rc = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) != 0) { - fprintf(stderr, "Failed to bind the unix domain socket. '%s'\n", - local_addr.sun_path); - return NULL; - } - - if (listen(fd, 0) != 0) { - fprintf(stderr, "Failed to listen.\n"); - return NULL; - } - lsi = talloc_zero(ctx, struct l1ctl_sock_inst); lsi->priv = NULL; - lsi->recv_cb = recv_cb; lsi->ofd.data = lsi; - lsi->ofd.fd = fd; lsi->ofd.when = BSC_FD_READ; lsi->ofd.cb = l1ctl_sock_accept_cb; + + rc = osmo_sock_unix_init_ofd(&lsi->ofd, SOCK_STREAM, 0, path, OSMO_SOCK_F_BIND); + if (rc < 0) { + talloc_free(lsi); + return NULL; + } + + lsi->recv_cb = recv_cb; /* no connection -> invalid filedescriptor and not 0 (==std_in) */ lsi->connection.fd = -1; lsi->l1ctl_sock_path = path; -- To view, visit https://gerrit.osmocom.org/3284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic0fa003bd7c7468d39a0c39fbea89000d576a4f3 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:58:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:58:47 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: reorganize data structures In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: reorganize data structures ...................................................................... VIRT-PHY: reorganize data structures * l1_model_ms can become a static member of l1_model_ms * crypto_info_ms can become a static member of l1_state_ms Change-Id: I94ca4dad1c6c668ce6307d5e5d728b1c1502af12 --- M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 11 files changed, 82 insertions(+), 77 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 991cb1a..61776ec 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -18,13 +18,6 @@ }; -struct l1_model_ms { - struct l1ctl_sock_inst *lsi; - struct virt_um_inst *vui; - struct l1_state_ms *state; - struct crypto_info_ms *crypto_inf; -}; - /* structure representing L1 sync information about a cell */ struct l1_cell_info { /* on which ARFCN (+band) is the cell? */ @@ -53,12 +46,13 @@ struct gsm_time downlink_time; /* current GSM time received on downlink */ struct gsm_time current_time; /* GSM time used internally for scheduling */ - uint8_t state; // the ms state like in ms_state + enum ms_state state; /* the cell on which we are camping right now */ struct l1_cell_info serving_cell; /* neighbor cell sync info */ struct l1_cell_info neigh_cell[L1S_NUM_NEIGH_CELL]; + struct crypto_info_ms crypto_inf; /* TCH info */ uint8_t tch_mode; // see enum gsm48_chan_mode in gsm_04_08.h @@ -94,6 +88,13 @@ } pm; }; +struct l1_model_ms { + struct l1ctl_sock_inst *lsi; + struct virt_um_inst *vui; + struct l1_state_ms state; +}; + + struct l1_model_ms *l1_model_ms_init(void *ctx); void l1_model_ms_destroy(struct l1_model_ms *model); diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 2624046..18580b4 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -55,7 +55,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; struct msgb *outmsg; /* msg to send with gsmtap header prepended */ - uint16_t arfcn = l1_model_ms->state->serving_cell.arfcn; /* arfcn of the cell we currently camp on */ + uint16_t arfcn = l1_model_ms->state.serving_cell.arfcn; /* arfcn of the cell we currently camp on */ uint8_t signal_dbm = 63; /* signal strength */ uint8_t snr = 63; /* signal noise ratio, 63 is best */ uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ @@ -145,19 +145,19 @@ goto freemsg; } /* we do not forward messages to l23 if we are in network search state */ - if (l1_model_ms->state->state == MS_STATE_IDLE_SEARCHING) + if (l1_model_ms->state.state == MS_STATE_IDLE_SEARCHING) goto freemsg; /* forward downlink msg to fbsb sync routine if we are in sync state */ - if (l1_model_ms->state->state == MS_STATE_IDLE_SYNCING) { + if (l1_model_ms->state.state == MS_STATE_IDLE_SYNCING) { prim_fbsb_sync(msg); return; } /* generally ignore all messages coming from another arfcn than the camped one */ - if (l1_model_ms->state->serving_cell.arfcn != arfcn) { + if (l1_model_ms->state.serving_cell.arfcn != arfcn) { LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn, l1_model_ms->state->serving_cell.arfcn); + arfcn, l1_model_ms->state.serving_cell.arfcn); goto freemsg; } @@ -166,8 +166,8 @@ /* see TS 08.58 -> 9.3.1 for channel number encoding */ chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); - gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); - virt_l1_sched_sync_time(l1_model_ms->state->downlink_time, 0); + gsm_fn2gsmtime(&l1_model_ms->state.downlink_time, fn); + virt_l1_sched_sync_time(l1_model_ms->state.downlink_time, 0); virt_l1_sched_execute(fn); DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " @@ -191,8 +191,8 @@ case GSMTAP_CHANNEL_SDCCH8: /* only forward messages on dedicated channels to l2, if * the timeslot and subslot is fitting */ - if (l1_model_ms->state->dedicated.tn == timeslot - && l1_model_ms->state->dedicated.subslot == subslot) { + if (l1_model_ms->state.dedicated.tn == timeslot + && l1_model_ms->state.dedicated.subslot == subslot) { l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); } break; diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 0871f1f..8965ac1 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -44,10 +44,10 @@ static void l1_model_tch_mode_set(uint8_t tch_mode) { if (tch_mode == GSM48_CMODE_SPEECH_V1 || tch_mode == GSM48_CMODE_SPEECH_EFR) - l1_model_ms->state->tch_mode = tch_mode; + l1_model_ms->state.tch_mode = tch_mode; else { /* set default value if no proper mode was assigned by l23 */ - l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; + l1_model_ms->state.tch_mode = GSM48_CMODE_SIGN; } } @@ -267,16 +267,16 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", ul->chan_nr, timeslot, subslot); - l1_model_ms->state->dedicated.chan_type = rsl_chantype; - l1_model_ms->state->dedicated.tn = timeslot; - l1_model_ms->state->dedicated.subslot = subslot; - l1_model_ms->state->state = MS_STATE_DEDICATED; + l1_model_ms->state.dedicated.chan_type = rsl_chantype; + l1_model_ms->state.dedicated.tn = timeslot; + l1_model_ms->state.dedicated.subslot = subslot; + l1_model_ms->state.state = MS_STATE_DEDICATED; /* TCH config */ if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { - l1_model_ms->state->tch_mode = est_req->tch_mode; + l1_model_ms->state.tch_mode = est_req->tch_mode; l1_model_tch_mode_set(est_req->tch_mode); - l1_model_ms->state->audio_mode = est_req->audio_mode; + l1_model_ms->state.audio_mode = est_req->audio_mode; /* TODO: configure audio hardware for encoding / * decoding / recording / playing voice */ } @@ -332,8 +332,8 @@ return; } - l1_model_ms->crypto_inf->algo = cr->algo; - memcpy(l1_model_ms->crypto_inf->key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); + l1_model_ms->state.crypto_inf.algo = cr->algo; + memcpy(l1_model_ms->state.crypto_inf.key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); } /** @@ -350,11 +350,11 @@ { DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); - l1_model_ms->state->dedicated.chan_type = 0; - l1_model_ms->state->dedicated.tn = 0; - l1_model_ms->state->dedicated.subslot = 0; - l1_model_ms->state->tch_mode = GSM48_CMODE_SIGN; - l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; + l1_model_ms->state.dedicated.chan_type = 0; + l1_model_ms->state.dedicated.tn = 0; + l1_model_ms->state.dedicated.subslot = 0; + l1_model_ms->state.tch_mode = GSM48_CMODE_SIGN; + l1_model_ms->state.state = MS_STATE_IDLE_CAMPING; /* TODO: disable ciphering */ /* TODO: disable audio recording / playing */ @@ -402,12 +402,12 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); - l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; + l1_model_ms->state.state = MS_STATE_IDLE_SEARCHING; virt_l1_sched_stop(); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: - virt_l1_sched_restart(l1_model_ms->state->downlink_time); + virt_l1_sched_restart(l1_model_ms->state.downlink_time); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); break; @@ -438,7 +438,7 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); - l1_model_ms->state->serving_cell.ccch_mode = ccch_mode; + l1_model_ms->state.serving_cell.ccch_mode = ccch_mode; /* check if more has to be done here */ l1ctl_tx_ccch_mode_conf(ccch_mode); @@ -461,14 +461,14 @@ struct l1ctl_tch_mode_req *tch_mode_req = (struct l1ctl_tch_mode_req *) l1h->data; l1_model_tch_mode_set(tch_mode_req->tch_mode); - l1_model_ms->state->audio_mode = tch_mode_req->audio_mode; + l1_model_ms->state.audio_mode = tch_mode_req->audio_mode; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", tch_mode_req->tch_mode, tch_mode_req->audio_mode); /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ - l1ctl_tx_tch_mode_conf(l1_model_ms->state->tch_mode, l1_model_ms->state->audio_mode); + l1ctl_tx_tch_mode_conf(l1_model_ms->state.tch_mode, l1_model_ms->state.audio_mode); } /** diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index 65e8068..056c9eb 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -24,7 +24,6 @@ struct l1_model_ms* l1_model_ms_init(void *ctx) { struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); - model->state = talloc_zero(ctx, struct l1_state_ms); return model; } @@ -32,6 +31,5 @@ { virt_um_destroy(model->vui); l1ctl_sock_destroy(model->lsi); - talloc_free(model->state); talloc_free(model); } diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index 40bc57a..20481df 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -61,7 +61,7 @@ */ void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset) { - l1_model_ms->state->current_time = time; + l1_model_ms->state.current_time = time; } /** diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 8b65d6d..72c58b7 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -50,7 +50,7 @@ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_data_conf(fn, 0, l1_model_ms->state->serving_cell.arfcn); + l1ctl_tx_data_conf(fn, 0, l1_model_ms->state.serving_cell.arfcn); } /** @@ -70,7 +70,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 4f6306e..7f99821 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -54,14 +54,15 @@ */ void l1ctl_rx_fbsb_req(struct msgb *msg) { + struct l1_state_ms *l1s = &l1_model_ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); - l1_model_ms->state->state = MS_STATE_IDLE_SYNCING; - l1_model_ms->state->fbsb.arfcn = ntohs(sync_req->band_arfcn); + l1s->state = MS_STATE_IDLE_SYNCING; + l1s->fbsb.arfcn = ntohs(sync_req->band_arfcn); } /** @@ -71,32 +72,33 @@ */ void prim_fbsb_sync(struct msgb *msg) { + struct l1_state_ms *l1s = &l1_model_ms->state; struct gsmtap_hdr *gh = msgb_l1(msg); uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ /* ignore messages from other arfcns as the one requested to sync to by l23 */ - if (l1_model_ms->state->fbsb.arfcn != arfcn) { + if (l1s->fbsb.arfcn != arfcn) { talloc_free(msg); /* cancel sync if we did not receive a msg on dl from * the requested arfcn that we can sync to */ if (sync_count++ > 20) { sync_count = 0; - l1_model_ms->state->state = MS_STATE_IDLE_SEARCHING; - l1ctl_tx_fbsb_conf(1, (l1_model_ms->state->fbsb.arfcn)); + l1s->state = MS_STATE_IDLE_SEARCHING; + l1ctl_tx_fbsb_conf(1, (l1s->fbsb.arfcn)); } return; } - l1_model_ms->state->serving_cell.arfcn = arfcn; - l1_model_ms->state->state = MS_STATE_IDLE_CAMPING; + l1s->serving_cell.arfcn = arfcn; + l1s->state = MS_STATE_IDLE_CAMPING; /* Not needed in virtual phy */ - l1_model_ms->state->serving_cell.fn_offset = 0; - l1_model_ms->state->serving_cell.time_alignment = 0; - l1_model_ms->state->serving_cell.bsic = 0; + l1s->serving_cell.fn_offset = 0; + l1s->serving_cell.time_alignment = 0; + l1s->serving_cell.bsic = 0; /* Update current gsm time each time we receive a message on the virt um */ - gsm_fn2gsmtime(&l1_model_ms->state->downlink_time, fn); + gsm_fn2gsmtime(&l1s->downlink_time, fn); /* Restart scheduler */ - virt_l1_sched_restart(l1_model_ms->state->downlink_time); + virt_l1_sched_restart(l1s->downlink_time); talloc_free(msg); l1ctl_tx_fbsb_conf(0, arfcn); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 9afee0c..6335c61 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -47,17 +47,17 @@ */ uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) { - if (l1_model_ms->state->pm.timeout_s > 0 || l1_model_ms->state->pm.timeout_us > 0) { - osmo_timer_schedule(&l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[arfcn], - l1_model_ms->state->pm.timeout_s, - l1_model_ms->state->pm.timeout_us); + struct l1_state_ms *l1s = &l1_model_ms->state; + + if (l1s->pm.timeout_s > 0 || l1s->pm.timeout_us > 0) { + osmo_timer_schedule(&l1s->pm.meas.arfcn_sig_lev_timers[arfcn], + l1s->pm.timeout_s, l1s->pm.timeout_us); } - l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn] = - sig_lev - l1_model_ms->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; + l1s->pm.meas.arfcn_sig_lev_dbm[arfcn] = sig_lev - l1s->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", - arfcn, l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn], - dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn])); - return l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn]; + arfcn, l1s->pm.meas.arfcn_sig_lev_dbm[arfcn], + dbm2rxlev(l1s->pm.meas.arfcn_sig_lev_dbm[arfcn])); + return l1s->pm.meas.arfcn_sig_lev_dbm[arfcn]; } void prim_pm_timer_cb(void *data) @@ -83,6 +83,7 @@ */ void l1ctl_rx_pm_req(struct msgb *msg) { + struct l1_state_ms *l1s = &l1_model_ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *) l1h->data; struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); @@ -101,8 +102,8 @@ pm_conf->band_arfcn = htons(arfcn_next); /* set min and max to the value calculated for that * arfcn (IGNORE UPLINKK AND PCS AND OTHER FLAGS) */ - pm_conf->pm[0] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); - pm_conf->pm[1] = dbm2rxlev(l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); + pm_conf->pm[0] = dbm2rxlev(l1s->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); + pm_conf->pm[1] = dbm2rxlev(l1s->pm.meas.arfcn_sig_lev_dbm[arfcn_next & ARFCN_NO_FLAGS_MASK]); if (arfcn_next == pm_req->range.band_arfcn_to) { struct l1ctl_hdr *resp_l1h = msgb_l1(resp_msg); resp_l1h->flags |= L1CTL_F_DONE; @@ -125,13 +126,15 @@ */ void prim_pm_init(struct l1_model_ms *model) { + struct l1_state_ms *l1s = &model->state; int i; + l1_model_ms = model; /* init the signal level of all arfcns with the lowest value possible */ - memset(model->state->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); + memset(l1s->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); /* init timers */ for (i = 0; i < 1024; ++i) { - l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].cb = prim_pm_timer_cb; - l1_model_ms->state->pm.meas.arfcn_sig_lev_timers[i].data = &l1_model_ms->state->pm.meas.arfcn_sig_lev_dbm[i]; + l1s->pm.meas.arfcn_sig_lev_timers[i].cb = prim_pm_timer_cb; + l1s->pm.meas.arfcn_sig_lev_timers[i].data = &l1s->pm.meas.arfcn_sig_lev_dbm[i]; } } diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index 1642ac6..bff777d 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -62,7 +62,7 @@ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb *msg) { gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_rach_conf(fn, l1_model_ms->state->serving_cell.arfcn); + l1ctl_tx_rach_conf(fn, l1_model_ms->state.serving_cell.arfcn); } /** @@ -77,6 +77,7 @@ */ void l1ctl_rx_rach_req(struct msgb *msg) { + struct l1_state_ms *l1s = &l1_model_ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; @@ -102,13 +103,13 @@ /* sched fn calculation if we have a combined ccch channel configuration */ if (rach_req->combined) { /* add elapsed RACH slots to offset */ - offset += t3_to_rach_comb[l1_model_ms->state->current_time.t3]; + offset += t3_to_rach_comb[l1s->current_time.t3]; /* offset is the number of RACH slots in the future */ - fn_sched = l1_model_ms->state->current_time.fn - l1_model_ms->state->current_time.t3; + fn_sched = l1s->current_time.fn - l1s->current_time.t3; fn_sched += offset / 27 * 51; fn_sched += rach_to_t3_comb[offset % 27]; } else - fn_sched = l1_model_ms->state->current_time.fn + offset; + fn_sched = l1s->current_time.fn + offset; virt_l1_sched_schedule(msg, fn_sched, ts, &virt_l1_sched_handler_cb); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 50e6857..acfd493 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -50,7 +50,7 @@ static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) { gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_traffic_conf(fn, 0, l1_model_ms->state->serving_cell.arfcn); + l1ctl_tx_traffic_conf(fn, 0, l1_model_ms->state.serving_cell.arfcn); } /** @@ -69,7 +69,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *) ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state->current_time, ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(l1_model_ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index e4f5fd2..43346ed 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -99,11 +99,11 @@ /* seconds */ char *buf = strtok(pm_timeout, ":"); - model->state->pm.timeout_s = atoi(buf); + model->state.pm.timeout_s = atoi(buf); /* microseconds */ buf = strtok(NULL, ":"); if (buf) - model->state->pm.timeout_us = atoi(buf); + model->state.pm.timeout_us = atoi(buf); } /** @@ -128,7 +128,7 @@ red = atoi(colon + 1); /* TODO: this may go wild if the token string is not properly formatted */ - model->state->pm.meas.arfcn_sig_lev_red_dbm[arfcn] = red; + model->state.pm.meas.arfcn_sig_lev_red_dbm[arfcn] = red; } while ((token = strtok(NULL, ":"))); } -- To view, visit https://gerrit.osmocom.org/3283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94ca4dad1c6c668ce6307d5e5d728b1c1502af12 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:58:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:58:47 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: some more comments/documentation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: some more comments/documentation ...................................................................... VIRT-PHY: some more comments/documentation Change-Id: I24fc98624178e9441d6cfcd61bc14e17c1391e9e --- M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/include/virtphy/virtual_um.h 2 files changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 296931a..991cb1a 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -1,5 +1,7 @@ #pragma once +/* Per-MS specific state, closely attached to the L1CTL user progran */ + #include #include #include diff --git a/src/host/virt_phy/include/virtphy/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h index ac098dd..79d74a5 100644 --- a/src/host/virt_phy/include/virtphy/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -1,5 +1,11 @@ #pragma once +/* the "Virtual Um instance" encapsulates the multicast UDP sockets as + * well as the encoding and decoding of GSMTAP messages towards the + * virtual radio interface. It receives DL messages via GSMTAP from any + * number of BTSs transmitting to GSMTAP, and transmits UL messages via + * GSMTAP to those BTSs in another multicast group */ + #include #include #include "osmo_mcast_sock.h" -- To view, visit https://gerrit.osmocom.org/3282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24fc98624178e9441d6cfcd61bc14e17c1391e9e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:58:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:58:48 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Use IPv4 multicast groups for private / local scope In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Use IPv4 multicast groups for private / local scope ...................................................................... VIRT-PHY: Use IPv4 multicast groups for private / local scope The addresses in the original code make little sense: * 224.0.0.1 is "All systems on this subnet" and not routed outside the local ethernet segment * 225.0.0.1 is in a RESERVED range that shouldn't be used Change-Id: I8e3acd745e65a6cfa70b681a440da6a59a1ed0b5 --- M src/host/virt_phy/include/virtphy/virtual_um.h 1 file changed, 7 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/virtual_um.h b/src/host/virt_phy/include/virtphy/virtual_um.h index 6e7c384..ac098dd 100644 --- a/src/host/virt_phy/include/virtphy/virtual_um.h +++ b/src/host/virt_phy/include/virtphy/virtual_um.h @@ -4,10 +4,15 @@ #include #include "osmo_mcast_sock.h" +/* We use multicast group addresses from the 239.192.0.0/14 rage, as + * those are designated by RFC2365 as "IPv4 Organization Local Scope, + * "... the space from which an organization should allocate sub- + * ranges when defining scopes for private use." */ + #define VIRT_UM_MSGB_SIZE 256 -#define DEFAULT_MS_MCAST_GROUP "224.0.0.1" +#define DEFAULT_MS_MCAST_GROUP "239.193.23.1" #define DEFAULT_MS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ -#define DEFAULT_BTS_MCAST_GROUP "225.0.0.1" +#define DEFAULT_BTS_MCAST_GROUP "239.193.23.2" #define DEFAULT_BTS_MCAST_PORT 4729 /* IANA-registered port for GSMTAP */ struct virt_um_inst { -- To view, visit https://gerrit.osmocom.org/3281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e3acd745e65a6cfa70b681a440da6a59a1ed0b5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:58:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:58:48 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Use osmo_fd_close() introduced in libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Use osmo_fd_close() introduced in libosmocore ...................................................................... VIRT-PHY: Use osmo_fd_close() introduced in libosmocore libosmocore has recently received a new function osmo_fd_close() which can be used to replace the private fd_close() function in this code. This requires Change-Id Icd0933eed6a24edde7cdcb378e138897ecc5332c in libosmocore. Change-Id: Id8a518dfb09465c2765681407e5581aee2d62d6d --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 4 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index 0521c0d..b52e005 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -10,17 +10,6 @@ #include #include -/* convenience wrapper */ -static void fd_close(struct osmo_fd *ofd) -{ - /* multicast memberships of socket are implicitly dropped when - * socket is closed */ - osmo_fd_unregister(ofd); - close(ofd->fd); - ofd->fd = -1; - ofd->when = 0; -} - /* server socket is what we use for transmission. It is not subscribed * to a multicast group or locally bound, but it is just a normal UDP * socket that's connected to the remote mcast group + port */ @@ -69,7 +58,7 @@ rc = osmo_sock_mcast_subscribe(ofd->fd, mcast_group); if (rc < 0) { perror("Failed to join to mcast goup"); - fd_close(ofd); + osmo_fd_close(ofd); return rc; } @@ -96,7 +85,7 @@ } rc = mcast_server_sock_setup(&bidir_sock->tx_ofd, tx_mcast_group, tx_mcast_port, loopback); if (rc < 0) { - fd_close(&bidir_sock->rx_ofd); + osmo_fd_close(&bidir_sock->rx_ofd); talloc_free(bidir_sock); return NULL; } @@ -117,7 +106,7 @@ void mcast_bidir_sock_close(struct mcast_bidir_sock *bidir_sock) { - fd_close(&bidir_sock->tx_ofd); - fd_close(&bidir_sock->rx_ofd); + osmo_fd_close(&bidir_sock->tx_ofd); + osmo_fd_close(&bidir_sock->rx_ofd); talloc_free(bidir_sock); } -- To view, visit https://gerrit.osmocom.org/3280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id8a518dfb09465c2765681407e5581aee2d62d6d Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 11:58:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 11:58:48 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Use new OSMO_SOCK_F_NO_MCAST_{LOOP, ALL} flags In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Use new OSMO_SOCK_F_NO_MCAST_{LOOP,ALL} flags ...................................................................... VIRT-PHY: Use new OSMO_SOCK_F_NO_MCAST_{LOOP,ALL} flags libosmocore has recently gained support for flags like OSMO_SOCK_F_NO_MCAST_LOOP and OSMO_SOCK_F_NO_MCAST_ALL that can be passed to the socket initializer functions, further reducing complexity of the code in osmo_mcast_sock.c here. The related change-IDs are I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 and I24a5b1ebc3f84d2d5d4734e54df50efaea26490b in libosmocore.git. Change-Id: I961aa07a381fef2cf9a2fb5357937864364ca04b --- M src/host/virt_phy/src/shared/osmo_mcast_sock.c 1 file changed, 8 insertions(+), 36 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c index df3abc3..0521c0d 100644 --- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c +++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c @@ -28,21 +28,16 @@ uint16_t tx_mcast_port, bool loopback) { int rc; + unsigned int flags = OSMO_SOCK_F_CONNECT; + + if (!loopback) + flags |= OSMO_SOCK_F_NO_MCAST_LOOP; /* setup mcast server socket */ rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, - tx_mcast_group, tx_mcast_port, OSMO_SOCK_F_CONNECT); + tx_mcast_group, tx_mcast_port, flags); if (rc < 0) { perror("Failed to create Multicast Server Socket"); - return rc; - } - - /* determines whether sent mcast packets should be looped back to the local sockets. - * loopback must be enabled if the mcast client is on the same machine */ - rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)); - if (rc < 0) { - perror("Failed to configure multicast loopback.\n"); - fd_close(ofd); return rc; } @@ -56,8 +51,7 @@ int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what), void *osmo_fd_data) { - struct ip_mreq mreq; - int rc, loopback = 1, all = 0; + int rc; ofd->cb = fd_rx_cb; ofd->when = BSC_FD_READ; @@ -65,38 +59,16 @@ /* Create mcast client socket */ rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, - NULL, mcast_port, OSMO_SOCK_F_BIND); + NULL, mcast_port, OSMO_SOCK_F_BIND|OSMO_SOCK_F_NO_MCAST_ALL); if (rc < 0) { perror("Could not create mcast client socket"); return rc; } - /* Enable loopback of msgs to the host. */ - /* Loopback must be enabled for the client, so multiple - * processes are able to receive a mcast package. */ - rc = setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_LOOP, - &loopback, sizeof(loopback)); - if (rc < 0) { - perror("Failed to enable IP_MULTICAST_LOOP"); - fd_close(ofd); - return rc; - } - /* Configure and join the multicast group */ - memset(&mreq, 0, sizeof(mreq)); - mreq.imr_multiaddr.s_addr = inet_addr(mcast_group); - mreq.imr_interface.s_addr = htonl(INADDR_ANY); - rc = setsockopt(ofd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); + rc = osmo_sock_mcast_subscribe(ofd->fd, mcast_group); if (rc < 0) { perror("Failed to join to mcast goup"); - fd_close(ofd); - return rc; - } - - /* this option will set the delivery option so that only packets - * from sockets we are subscribed to via IP_ADD_MEMBERSHIP are received */ - if (setsockopt(ofd->fd, IPPROTO_IP, IP_MULTICAST_ALL, &all, sizeof(all)) < 0) { - perror("Failed to modify delivery policy to explicitly joined.\n"); fd_close(ofd); return rc; } -- To view, visit https://gerrit.osmocom.org/3279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I961aa07a381fef2cf9a2fb5357937864364ca04b Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:08:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 19 Jul 2017 12:08:24 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: make addressbook available for _sg and _asp 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/3103 to look at the new patch set (#6). vty: make addressbook available for _sg and _asp The installation of the vty commands for the sccp addressbook is currently located in osmo_ss7_vty_init_sg(), which is normally only used in signalling gateway applications. An ASP would lack the addressbook functionality. Make SCCP addressbook available for both SG and ASP Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb --- M src/osmo_ss7_vty.c 1 file changed, 37 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/3103/6 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b06f554..9a4e963 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1587,6 +1587,41 @@ } } +/* Commands for SCCP-Addressbook */ +static void vty_init_addr(void) +{ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); +} + static void vty_init_shared(void) { install_element_ve(&show_cs7_user_cmd); @@ -1628,6 +1663,8 @@ install_element(L_CS7_AS_NODE, &as_qos_class_cmd); install_element(L_CS7_AS_NODE, &as_rout_key_cmd); install_element(L_CS7_AS_NODE, &as_pc_override_cmd); + + vty_init_addr(); } void osmo_ss7_vty_init_asp(void) @@ -1653,38 +1690,6 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); - - /* Commands for SCCP-Addressbook */ - install_node(&sccpaddr_node, NULL); - vty_install_default(L_CS7_SCCPADDR_NODE); - install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); - install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); - install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); -#if 0 - /* FIXME: IP-Address based SCCP-Routing is currently not supported, - * so we leave the related VTY options out for now */ - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); -#endif - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); -#if 0 - /* FIXME: IP-Address based SCCP-Routing is currently not supported, - * so we leave the related VTY options out for now */ - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); -#endif - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); - install_node(&sccpaddr_gt_node, NULL); - vty_install_default(L_CS7_SCCPADDR_GT_NODE); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 6 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:08:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 19 Jul 2017 12:08:27 +0000 Subject: libosmo-sccp[master]: vty: make addressbook available for _sg and _asp In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 6 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:08:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 19 Jul 2017 12:08:30 +0000 Subject: [MERGED] libosmo-sccp[master]: vty: make addressbook available for _sg and _asp In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: make addressbook available for _sg and _asp ...................................................................... vty: make addressbook available for _sg and _asp The installation of the vty commands for the sccp addressbook is currently located in osmo_ss7_vty_init_sg(), which is normally only used in signalling gateway applications. An ASP would lack the addressbook functionality. Make SCCP addressbook available for both SG and ASP Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb --- M src/osmo_ss7_vty.c 1 file changed, 37 insertions(+), 32 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b06f554..9a4e963 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1587,6 +1587,41 @@ } } +/* Commands for SCCP-Addressbook */ +static void vty_init_addr(void) +{ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); +} + static void vty_init_shared(void) { install_element_ve(&show_cs7_user_cmd); @@ -1628,6 +1663,8 @@ install_element(L_CS7_AS_NODE, &as_qos_class_cmd); install_element(L_CS7_AS_NODE, &as_rout_key_cmd); install_element(L_CS7_AS_NODE, &as_pc_override_cmd); + + vty_init_addr(); } void osmo_ss7_vty_init_asp(void) @@ -1653,38 +1690,6 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); - - /* Commands for SCCP-Addressbook */ - install_node(&sccpaddr_node, NULL); - vty_install_default(L_CS7_SCCPADDR_NODE); - install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); - install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); - install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); -#if 0 - /* FIXME: IP-Address based SCCP-Routing is currently not supported, - * so we leave the related VTY options out for now */ - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); -#endif - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); -#if 0 - /* FIXME: IP-Address based SCCP-Routing is currently not supported, - * so we leave the related VTY options out for now */ - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); -#endif - install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); - install_node(&sccpaddr_gt_node, NULL); - vty_install_default(L_CS7_SCCPADDR_GT_NODE); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); - install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/3103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib49ab623055e9ada7f95e0163ba7e33c5f6f99cb Gerrit-PatchSet: 6 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:14:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:14:44 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: We don't do line-breaks inside log statements Message-ID: Review at https://gerrit.osmocom.org/3294 VIRT-PHY: We don't do line-breaks inside log statements Change-Id: I27cba13ee782c53a9b2406319241fc7f4e3db0bd --- M src/host/virt_phy/src/virtphy.c 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/94/3294/1 diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 23811c2..e0bee72 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -184,9 +184,7 @@ l1ctl_accept_cb, l1ctl_close_cb, l1ctl_sock_path); g_vphy.virt_um->priv = g_vphy.l1ctl_sock; - LOGP(DVIRPHY, LOGL_INFO, - "Virtual physical layer ready...\n \ - Waiting for l23 app on %s", + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready, waiting for l23 app(s) on %s\n", l1ctl_sock_path); while (1) { -- To view, visit https://gerrit.osmocom.org/3294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27cba13ee782c53a9b2406319241fc7f4e3db0bd Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:14:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:14:44 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: enable proper memory leak debugging Message-ID: Review at https://gerrit.osmocom.org/3295 VIRT-PHY: enable proper memory leak debugging We make sure that all allocations are tracked back to one talloc root context, and install the usual SIGUSR1 handler to dump the talloc report. This enables us to do interactive debugging for memory leaks while virtphy is running. Change-Id: I73b3cf86eea5f56595c1b045cf0fde8035ff185a --- M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virtphy.c 2 files changed, 26 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/95/3295/1 diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index 7d1cdd4..ba8298f 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -127,7 +127,7 @@ } if (!mi_fn) { /* list did not contain mframe item with needed fn */ - mi_fn = talloc_zero(NULL, struct virt_l1_sched_mframe_item); + mi_fn = talloc_zero(ms, struct virt_l1_sched_mframe_item); mi_fn->fn = fn; /* need to manually init the struct content.... no so happy */ mi_fn->tdma_item_list.prev = &mi_fn->tdma_item_list; diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index e0bee72..412b742 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -23,12 +23,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -168,8 +170,29 @@ l1_model_ms_destroy(ms); } +static void *tall_vphy_ctx; + +static void signal_handler(int signum) +{ + LOGP(DMAIN, LOGL_NOTICE, "Signal %d received\n", signum); + + switch (signum) { + case SIGUSR1: + talloc_report_full(tall_vphy_ctx, stderr); + break; + default: + break; + } +} + int main(int argc, char *argv[]) { + tall_vphy_ctx = talloc_named_const(NULL, 1, "root"); + + msgb_talloc_ctx_init(tall_vphy_ctx, 0); + signal(SIGUSR1, &signal_handler); + osmo_init_ignore_signals(); + /* init loginfo */ handle_options(argc, argv); @@ -177,10 +200,10 @@ LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); - g_vphy.virt_um = virt_um_init(NULL, ul_tx_grp, port, dl_rx_grp, port, + g_vphy.virt_um = virt_um_init(tall_vphy_ctx, ul_tx_grp, port, dl_rx_grp, port, gsmtapl1_rx_from_virt_um_inst_cb); - g_vphy.l1ctl_sock = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, + g_vphy.l1ctl_sock = l1ctl_sock_init(tall_vphy_ctx, l1ctl_sap_rx_from_l23_inst_cb, l1ctl_accept_cb, l1ctl_close_cb, l1ctl_sock_path); g_vphy.virt_um->priv = g_vphy.l1ctl_sock; -- To view, visit https://gerrit.osmocom.org/3295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73b3cf86eea5f56595c1b045cf0fde8035ff185a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:14:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:14:56 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Major rewrite to deal with muliple L1CTL clients In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfb2a93f8b45a95215c01368b1a52d92283474e6 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 12:15:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:00 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Log MS context number whenever possible In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id7d9507126a03def5bd7690f1dbe987f9a749e65 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 12:15:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:02 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Separate logging of L1 Control and L1 Data In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idebc371a63508c593855486ff01b2ba6e8c2cfd1 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 12:15:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:11 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Clean up logging statements In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3289 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If06a8b5f99349796d66a71201524361a6547945a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 12:15:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:13 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Change default log levels In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9513db3cee12644ed9b9858e13b740ffd27aba24 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 12:15:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:15 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Properly destroy l1_model_ms after disconnect In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7adef61150b5a4338483019e4dd75d7279d1f5d Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 12:15:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:19 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Properly destroy l1_model_ms after disconnect In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Properly destroy l1_model_ms after disconnect ...................................................................... VIRT-PHY: Properly destroy l1_model_ms after disconnect If a MS disconnects, we need to clean up all related state Change-Id: Ib7adef61150b5a4338483019e4dd75d7279d1f5d --- M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/l1ctl_sock.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virtphy.c 7 files changed, 33 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index 5903a02..94174da 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -27,7 +27,9 @@ void l1ctl_sap_init(struct l1_model_ms *model); +void l1ctl_sap_exit(struct l1_model_ms *model); void prim_pm_init(struct l1_model_ms *model); +void prim_pm_exit(struct l1_model_ms *model); void l1ctl_sap_tx_to_l23_inst(struct l1_model_ms *model, struct msgb *msg); void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_client *lsc, struct msgb *msg); void l1ctl_sap_rx_from_l23(struct msgb *msg); diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sock.h b/src/host/virt_phy/include/virtphy/l1ctl_sock.h index 82ee5ca..2c98fa5 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sock.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sock.h @@ -28,6 +28,8 @@ void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ /* Callback function called for new client after accept() */ int (*accept_cb)(struct l1ctl_sock_client *lsc); + /* Callback function called when client disappeared */ + void (*close_cb)(struct l1ctl_sock_client *lsc); }; /** @@ -37,6 +39,7 @@ void *ctx, void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg), int (*accept_cb)(struct l1ctl_sock_client *lsc), + void (*close_cb)(struct l1ctl_sock_client *lsc), char *path); /** diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index c7c8e3e..d4b33f1 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -58,6 +58,12 @@ prim_pm_init(model); } +void l1ctl_sap_exit(struct l1_model_ms *model) +{ + virt_l1_sched_stop(model); + prim_pm_exit(model); +} + /** * @brief L1CTL handler called for received messages from L23. * diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index 00f25a6..bf28895 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -47,6 +47,9 @@ static void l1ctl_client_destroy(struct l1ctl_sock_client *lsc) { + struct l1ctl_sock_inst *lsi = lsc->l1ctl_sock; + if (lsi->close_cb) + lsi->close_cb(lsc); osmo_fd_close(&lsc->ofd); llist_del(&lsc->list); talloc_free(lsc); @@ -149,6 +152,7 @@ void *ctx, void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg), int (*accept_cb)(struct l1ctl_sock_client *lsc), + void (*close_cb)(struct l1ctl_sock_client *lsc), char *path) { struct l1ctl_sock_inst *lsi; @@ -172,6 +176,7 @@ lsi->recv_cb = recv_cb; lsi->accept_cb = accept_cb; + lsi->close_cb = close_cb; lsi->l1ctl_sock_path = path; INIT_LLIST_HEAD(&lsi->clients); diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index 14676b0..6a9fa99 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -46,5 +46,6 @@ void l1_model_ms_destroy(struct l1_model_ms *model) { LOGPMS(DMAIN, LOGL_INFO, model, "destryed\n"); + l1ctl_sap_exit(model); talloc_free(model); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 1cd3c03..4637013 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -138,3 +138,12 @@ l1s->pm.meas.arfcn_sig_lev_timers[i].data = &l1s->pm.meas.arfcn_sig_lev_dbm[i]; } } + +void prim_pm_exit(struct l1_model_ms *model) +{ + struct l1_state_ms *l1s = &model->state; + int i; + + for (i = 0; i < 1024; ++i) + osmo_timer_del(&l1s->pm.meas.arfcn_sig_lev_timers[i]); +} diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index b6f4f0c..23811c2 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -162,6 +162,12 @@ return 0; } +static void l1ctl_close_cb(struct l1ctl_sock_client *lsc) +{ + struct l1_model_ms *ms = lsc->priv; + l1_model_ms_destroy(ms); +} + int main(int argc, char *argv[]) { /* init loginfo */ @@ -175,7 +181,7 @@ gsmtapl1_rx_from_virt_um_inst_cb); g_vphy.l1ctl_sock = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, - l1ctl_accept_cb, l1ctl_sock_path); + l1ctl_accept_cb, l1ctl_close_cb, l1ctl_sock_path); g_vphy.virt_um->priv = g_vphy.l1ctl_sock; LOGP(DVIRPHY, LOGL_INFO, -- To view, visit https://gerrit.osmocom.org/3291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib7adef61150b5a4338483019e4dd75d7279d1f5d Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:15:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:19 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Change default log levels In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Change default log levels ...................................................................... VIRT-PHY: Change default log levels This will basically only print L1C message for all L1CTL happening between MS and the BTS, while suppressing the GSMTAP/virtUM and L1P related messages. Change-Id: I9513db3cee12644ed9b9858e13b740ffd27aba24 --- M src/host/virt_phy/src/virtphy.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 481cdc1..b6f4f0c 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -37,7 +37,7 @@ #include #include -#define DEFAULT_LOG_MASK "DL1C,1:DL1P,1:DVIRPHY,1:DMAIN,1" +#define DEFAULT_LOG_MASK "DL1C,2:DL1P,2:DVIRPHY,2:DMAIN,1" /* this exists once in the program, and contains the state that we * only keep once: L1CTL server socket, GSMTAP/VirtUM socket */ -- To view, visit https://gerrit.osmocom.org/3290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9513db3cee12644ed9b9858e13b740ffd27aba24 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:15:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:19 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Clean up logging statements In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Clean up logging statements ...................................................................... VIRT-PHY: Clean up logging statements The generated log lines have been *super* long, let's make them significantly shorter. Also, differentiate between DEBUG and INFO level, so normal operation with LOGL_INFO will not spam the user while still printing useful information. Change-Id: If06a8b5f99349796d66a71201524361a6547945a --- M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c 7 files changed, 66 insertions(+), 59 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index ac1c2b5..5454022 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,14 @@ #include #include #include + +static char *pseudo_lchan_name(uint16_t arfcn, uint8_t ts, uint8_t ss, uint8_t sub_type) +{ + static char lname[64]; + snprintf(lname, sizeof(lname), "(arfcn=%u,ts=%u,ss=%u,type=%s)", + arfcn, ts, ss, get_value_string(gsmtap_gsm_channel_names, sub_type)); + return lname; +} /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. @@ -70,18 +79,16 @@ outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); if (virt_um_write_msg(ms->vui, outmsg) == -1) { - LOGPMS(DVIRPHY, LOGL_ERROR, ms, "Gsmtap msg could not send to virt um - " - "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, gh->timeslot, - gh->sub_slot); + LOGPMS(DVIRPHY, LOGL_ERROR, ms, "%s Tx go GSMTAP failed: %s\n", + pseudo_lchan_name(gh->arfcn, gh->timeslot, gh->sub_slot, gh->sub_type), + strerror(errno)); } else { - DEBUGPMS(DVIRPHY, ms, "Sending gsmtap msg to virt um - " - "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", - gh->arfcn, gh->type, gh->sub_type, gh->timeslot, - gh->sub_slot); + DEBUGPMS(DVIRPHY, ms, "%s: Tx to GSMTAP: %s\n", + pseudo_lchan_name(gh->arfcn, gh->timeslot, gh->sub_slot, gh->sub_type), + osmo_hexdump(data, data_len)); } } else - LOGPMS(DVIRPHY, LOGL_ERROR, ms, "Gsmtap msg could not be created!\n"); + LOGPMS(DVIRPHY, LOGL_ERROR, ms, "GSMTAP msg could not be created!\n"); /* free message */ msgb_free(msg); @@ -118,9 +125,6 @@ } /* generally ignore all messages coming from another arfcn than the camped one */ if (ms->state.serving_cell.arfcn != arfcn) { - LOGPMS(DVIRPHY, LOGL_NOTICE, ms, - "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn, ms->state.serving_cell.arfcn); return; } @@ -155,8 +159,7 @@ l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: - LOGPMS(DVIRPHY, LOGL_NOTICE, ms, - "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unexpected RACH in downlink ?!?\n"); break; case GSMTAP_CHANNEL_SDCCH: case GSMTAP_CHANNEL_CCCH: @@ -165,12 +168,12 @@ case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: - LOGPMS(DVIRPHY, LOGL_NOTICE, ms, - "Ignoring gsmtap msg from virt um - channel type not supported!\n"); + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unsupported channel type %s\n", + get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype)); break; default: - LOGPMS(DVIRPHY, LOGL_NOTICE, ms, - "Ignoring gsmtap msg from virt um - channel type unknown.\n"); + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unknown channel type %s\n", + get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype)); break; } } @@ -203,23 +206,24 @@ uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ + struct gsm_time gtime; msg->l2h = msgb_pull(msg, sizeof(*gh)); chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); /* see TS 08.58 -> 9.3.1 for channel number encoding */ chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + gsm_fn2gsmtime(>ime, fn); + + DEBUGP(DVIRPHY, "%s Rx from VirtUM: FN=%s chan_nr=0x%02x link_id=0x%02x\n", + pseudo_lchan_name(arfcn, timeslot, subslot, gsmtap_chantype), + osmo_dump_gsmtime(>ime), chan_nr, link_id); + /* generally ignore all uplink messages received */ if (arfcn & GSMTAP_ARFCN_F_UPLINK) { - LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring unexpected uplink message in downlink!\n"); goto freemsg; } - - DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " - "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", - arfcn, fn, get_value_string(gsmtap_type_names, gh->type), - get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype), timeslot, - subslot, rsl_chantype, link_id, chan_nr); /* dispatch the incoming DL message from GSMTAP to each of the registered L1CTL instances */ llist_for_each_entry(lsc, &lsi->clients, list) { diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index d896042..c7c8e3e 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -184,7 +184,7 @@ else log_subsys = DL1P; - DEBUGPMS(log_subsys, ms, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); + DEBUGPMS(log_subsys, ms, "Rx RAW from MS: %s\n", msgb_hexdump(msg)); switch (l1h->msg_type) { case L1CTL_FBSB_REQ: @@ -266,7 +266,7 @@ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", ul->chan_nr, timeslot, subslot); ms->state.dedicated.chan_type = rsl_chantype; @@ -301,7 +301,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_dm_freq_req *freq_req = (struct l1ctl_dm_freq_req *) ul->payload; - DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u): IGNORED\n", ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, freq_req->h1.maio); } @@ -326,11 +326,11 @@ struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *) ul->payload; uint8_t key_len = msg->len - sizeof(*l1h) - sizeof(*ul) - sizeof(*cr); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", cr->algo, key_len); if (cr->algo && key_len != A5_KEY_LEN) { - LOGP(DL1C, LOGL_ERROR, "L1CTL_CRYPTO_REQ -> Invalid key\n"); + LOGPMS(DL1C, LOGL_ERROR, ms, "L1CTL_CRYPTO_REQ -> Invalid key\n"); return; } @@ -350,7 +350,7 @@ */ void l1ctl_rx_dm_rel_req(struct l1_model_ms *ms, struct msgb *msg) { - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_DM_REL_REQ\n"); ms->state.dedicated.chan_type = 0; ms->state.dedicated.tn = 0; @@ -379,7 +379,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_par_req *par_req = (struct l1ctl_par_req *)ul->payload; - DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", par_req->ta, par_req->tx_power); } @@ -403,18 +403,18 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + DEBUGPMS(DL1C, ms, "Rx L1CTL_RESET_REQ (type=FULL)\n"); ms->state.state = MS_STATE_IDLE_SEARCHING; virt_l1_sched_stop(ms); l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: virt_l1_sched_restart(ms, ms->state.downlink_time); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); + DEBUGPMS(DL1C, ms, "Rx L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; default: - LOGPMS(DL1C, LOGL_ERROR, ms, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGPMS(DL1C, LOGL_ERROR, ms, "Rx L1CTL_RESET_REQ (type=unknown): IGNORED\n"); break; } } @@ -438,7 +438,7 @@ struct l1ctl_ccch_mode_req *ccch_mode_req = (struct l1ctl_ccch_mode_req *) l1h->data; uint8_t ccch_mode = ccch_mode_req->ccch_mode; - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_CCCH_MODE_REQ (mode=%u)\n", ccch_mode); ms->state.serving_cell.ccch_mode = ccch_mode; @@ -465,7 +465,7 @@ l1_model_tch_mode_set(ms, tch_mode_req->tch_mode); ms->state.audio_mode = tch_mode_req->audio_mode; - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", tch_mode_req->tch_mode, tch_mode_req->audio_mode); /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ @@ -491,8 +491,7 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_neigh_pm_req *pm_req = (struct l1ctl_neigh_pm_req *) l1h->data; - DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", - pm_req->n); + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_NEIGH_PM_REQ (list with %u entries): IGNORED\n", pm_req->n); } /** @@ -519,7 +518,7 @@ uint16_t len = msg->len - sizeof(struct l1ctl_hdr); uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); - LOGPMS(DL1C, LOGL_ERROR, ms, "Received and ignored from l23 - SIM Request length: %u, data: %s\n", + LOGPMS(DL1C, LOGL_ERROR, ms, "Rx SIM Request (length: %u, data: %s): UNSUPPORTED\n", len, osmo_hexdump(data, sizeof(data))); } @@ -544,7 +543,7 @@ struct l1ctl_reset *reset_resp = (struct l1ctl_reset *) msgb_put(msg, sizeof(*reset_resp)); reset_resp->type = reset_type; - DEBUGPMS(DL1C, ms, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); + LOGPMS(DL1C, LOGL_INFO, ms, "Tx %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); l1ctl_sap_tx_to_l23_inst(ms, msg); } @@ -566,7 +565,7 @@ mode_conf = (struct l1ctl_ccch_mode_conf *) msgb_put(msg, sizeof(*mode_conf)); mode_conf->ccch_mode = ccch_mode; - DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); l1ctl_sap_tx_to_l23_inst(ms, msg); } @@ -589,7 +588,7 @@ mode_conf->tch_mode = tch_mode; mode_conf->audio_mode = audio_mode; - DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, audio_mode); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index cf34e7a..8931cf9 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -71,12 +71,10 @@ ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1P, ms, - "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", - ul->link_id, ul, ul->payload, data_ind, data_ind->data, - msg->l3h); - msg->l2h = data_ind->data; + + LOGPMS(DL1P, LOGL_INFO, ms, "Rx L1CTL_DATA_REQ (chan_nr=0x%02x, link_id=0x%02x) %s\n", + ul->chan_nr, ul->link_id, osmo_hexdump(msg->l2h, msgb_l2len(msg))); virt_l1_sched_schedule(ms, msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } @@ -107,7 +105,8 @@ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - DEBUGPMS(DL1P, ms, "Sending signaling-data to l23.\n"); + LOGPMS(DL1P, LOGL_INFO, ms, "TX L1CTL_DATA_IND (link_id=0x%02x) %s\n", link_id, + osmo_hexdump(msgb_data(msg), msgb_length(msg))); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } @@ -124,5 +123,6 @@ struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn, snr, arfcn); /* send confirm to layer23 */ + LOGPMS(DL1P, LOGL_INFO, ms, "Tx L1CTL_DATA_CONF\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 932f163..c14a448 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -57,8 +57,8 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", - ntohs(sync_req->band_arfcn), sync_req->flags); + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + ntohs(sync_req->band_arfcn), sync_req->flags); l1s->state = MS_STATE_IDLE_SYNCING; l1s->fbsb.arfcn = ntohs(sync_req->band_arfcn); @@ -126,7 +126,7 @@ resp->result = res; resp->bsic = bsic; - DEBUGPMS(DL1C, ms, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_FBSB_CONF (res: %u)\n", res); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 3202680..1cd3c03 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -91,7 +91,7 @@ pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - DEBUGPMS(DL1C, ms, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); for (arfcn_next = pm_req->range.band_arfcn_from; @@ -108,13 +108,16 @@ } /* no more space to hold mor pm info in msgb, flush to l23 */ if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_PM_CONF\n"); l1ctl_sap_tx_to_l23_inst(ms, resp_msg); resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); } } /* transmit the remaining part of pm response to l23 */ - if (resp_msg) + if (resp_msg) { + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_PM_CONF\n"); l1ctl_sap_tx_to_l23_inst(ms, resp_msg); + } } /** diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index c5bac73..8fb0e2f 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -82,7 +82,7 @@ uint8_t ts = 1; /* FIXME mostly, ts 1 is used for rach, where can i get that info? System info? */ uint16_t offset = ntohs(rach_req->offset); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", rach_req->ra, offset, rach_req->combined); if (rach_req->ra == 0x03) @@ -123,7 +123,6 @@ { struct msgb *msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); - DEBUGPMS(DL1C, ms, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", - getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); + LOGPMS(DL1C, LOGL_INFO, ms, "Tx L1CTL_RACH_CONF (fn: %u, arfcn: %u)\n", fn, arfcn); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 46ba9f1..6798bc1 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -69,7 +69,8 @@ uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1P, ms, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + DEBUGPMS(DL1P, ms, "Rx L1CTL_TRAFFIC_REQ (chan_nr=0x%02x, link_id=0x%02x)\n", + ul->chan_nr, ul->link_id); msg->l2h = tr->data; @@ -102,7 +103,7 @@ /* TODO: traffic decoding and decryption */ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); - DEBUGPMS(DL1P, ms, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); + DEBUGPMS(DL1P, ms, "Tx L1CTL_TRAFFIC_IND (chan_nr=0x%02x, link_id=0x%02x)\n", chan_nr, link_id); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } @@ -119,5 +120,6 @@ struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn, snr, arfcn); /* send confirm to layer23 */ + DEBUGPMS(DL1P, ms, "Tx L1CTL_TRAFFIC_CONF\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } -- To view, visit https://gerrit.osmocom.org/3289 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If06a8b5f99349796d66a71201524361a6547945a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:15:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:20 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Separate logging of L1 Control and L1 Data In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Separate logging of L1 Control and L1 Data ...................................................................... VIRT-PHY: Separate logging of L1 Control and L1 Data L1 Data is quite verbose, while control is typically limited, so let's make sure we log them as separate sub-systems Change-Id: Idebc371a63508c593855486ff01b2ba6e8c2cfd1 --- M src/host/virt_phy/include/virtphy/logging.h M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 6 files changed, 37 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/logging.h b/src/host/virt_phy/include/virtphy/logging.h index c98986c..b22db99 100644 --- a/src/host/virt_phy/include/virtphy/logging.h +++ b/src/host/virt_phy/include/virtphy/logging.h @@ -5,6 +5,7 @@ /* L1CTL related messages */ enum virtphy_log_cat { DL1C, + DL1P, DVIRPHY, DMAIN }; diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 6bd63c9..d896042 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -70,7 +70,6 @@ if (!msg) return; - DEBUGPMS(DL1C, ms, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); l1ctl_sap_handler(ms, msg); } @@ -146,6 +145,20 @@ return msg; } +static bool is_l1ctl_control(uint8_t msg_type) +{ + switch (msg_type) { + case L1CTL_DATA_REQ: + case L1CTL_DATA_CONF: + case L1CTL_TRAFFIC_REQ: + case L1CTL_TRAFFIC_CONF: + case L1CTL_TRAFFIC_IND: + return false; + default: + return true; + } +} + /** * @brief General handler for incoming L1CTL messages from layer 2/3. * @@ -154,6 +167,7 @@ void l1ctl_sap_handler(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h; + int log_subsys; if (!msg) return; @@ -165,6 +179,13 @@ goto exit_msgbfree; } + if (is_l1ctl_control(l1h->msg_type)) + log_subsys = DL1C; + else + log_subsys = DL1P; + + DEBUGPMS(log_subsys, ms, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); + switch (l1h->msg_type) { case L1CTL_FBSB_REQ: l1ctl_rx_fbsb_req(ms, msg); diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 7fb2c23..feb5081 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -64,7 +64,15 @@ .description = "Layer 1 Control", .color = "\033[1;31m", .enabled = 1, - .loglevel = LOGL_DEBUG, }, + .loglevel = LOGL_DEBUG, + }, + [DL1P] = { + .name = "DL1P", + .description = "Layer 1 Data", + .color = "\033[1;31m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + }, [DVIRPHY] = { .name = "DVIRPHY", .description = "Virtual Layer 1 Interface", diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index e03d097..cf34e7a 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -71,7 +71,7 @@ ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1C, ms, + DEBUGPMS(DL1P, ms, "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", ul->link_id, ul, ul->payload, data_ind, data_ind->data, msg->l3h); @@ -107,7 +107,7 @@ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - DEBUGPMS(DL1C, ms, "Sending signaling-data to l23.\n"); + DEBUGPMS(DL1P, ms, "Sending signaling-data to l23.\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 04f6749..46ba9f1 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -69,7 +69,7 @@ uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + DEBUGPMS(DL1P, ms, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; @@ -102,7 +102,7 @@ /* TODO: traffic decoding and decryption */ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); - DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); + DEBUGPMS(DL1P, ms, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 78a45f0..481cdc1 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -37,7 +37,7 @@ #include #include -#define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1:DMAIN,1" +#define DEFAULT_LOG_MASK "DL1C,1:DL1P,1:DVIRPHY,1:DMAIN,1" /* this exists once in the program, and contains the state that we * only keep once: L1CTL server socket, GSMTAP/VirtUM socket */ -- To view, visit https://gerrit.osmocom.org/3288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idebc371a63508c593855486ff01b2ba6e8c2cfd1 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:15:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:20 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Log MS context number whenever possible In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Log MS context number whenever possible ...................................................................... VIRT-PHY: Log MS context number whenever possible Now that we can have multiple MS connected to one virtphy instance, it is important to log some context whenever possible. To do so, we introduce a monotonically increasing MS number which gets assigned whenever we allocate a l1_model_ms and printed when the LOGPMS() or DEBUGPMS() macros are used. Change-Id: Id7d9507126a03def5bd7690f1dbe987f9a749e65 --- M src/host/virt_phy/include/virtphy/logging.h M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/logging.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 13 files changed, 71 insertions(+), 45 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/logging.h b/src/host/virt_phy/include/virtphy/logging.h index 6ca2525..c98986c 100644 --- a/src/host/virt_phy/include/virtphy/logging.h +++ b/src/host/virt_phy/include/virtphy/logging.h @@ -2,8 +2,15 @@ #include -#define DL1C 0 -#define DVIRPHY 1 +/* L1CTL related messages */ +enum virtphy_log_cat { + DL1C, + DVIRPHY, + DMAIN +}; + +#define LOGPMS(ss, lvl, ms, fmt, args ...) LOGP(ss, lvl, "MS %04u: " fmt, ms->nr, ## args) +#define DEBUGPMS(ss, ms, fmt, args ...) DEBUGP(ss, "MS %04u: " fmt, ms->nr, ## args) extern const struct log_info ms_log_info; diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 0cb5381..fa79127 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -93,6 +93,7 @@ }; struct l1_model_ms { + uint32_t nr; /* pointer to the L1CTL socket client associated with this specific MS */ struct l1ctl_sock_client *lsc; /* pointer to the (shared) GSMTAP/VirtUM socket to talk to BTS(s) */ diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index dfcd5a8..ac1c2b5 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -70,18 +70,18 @@ outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); if (virt_um_write_msg(ms->vui, outmsg) == -1) { - LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not send to virt um - " + LOGPMS(DVIRPHY, LOGL_ERROR, ms, "Gsmtap msg could not send to virt um - " "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, gh->sub_slot); } else { - DEBUGP(DVIRPHY, "Sending gsmtap msg to virt um - " + DEBUGPMS(DVIRPHY, ms, "Sending gsmtap msg to virt um - " "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, gh->sub_slot); } } else - LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not be created!\n"); + LOGPMS(DVIRPHY, LOGL_ERROR, ms, "Gsmtap msg could not be created!\n"); /* free message */ msgb_free(msg); @@ -118,7 +118,7 @@ } /* generally ignore all messages coming from another arfcn than the camped one */ if (ms->state.serving_cell.arfcn != arfcn) { - LOGP(DVIRPHY, LOGL_NOTICE, + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", arfcn, ms->state.serving_cell.arfcn); return; @@ -155,7 +155,7 @@ l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: - LOGP(DVIRPHY, LOGL_NOTICE, + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring gsmtap msg from virt um - channel type is uplink only!\n"); break; case GSMTAP_CHANNEL_SDCCH: @@ -165,11 +165,11 @@ case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: - LOGP(DVIRPHY, LOGL_NOTICE, + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring gsmtap msg from virt um - channel type not supported!\n"); break; default: - LOGP(DVIRPHY, LOGL_NOTICE, + LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring gsmtap msg from virt um - channel type unknown.\n"); break; } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index be5557d..6bd63c9 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -70,7 +70,7 @@ if (!msg) return; - DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); + DEBUGPMS(DL1C, ms, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); l1ctl_sap_handler(ms, msg); } @@ -161,7 +161,7 @@ l1h = (struct l1ctl_hdr *) msg->data; if (sizeof(*l1h) > msg->len) { - LOGP(DL1C, LOGL_NOTICE, "Malformed message: too short. %u\n", msg->len); + LOGPMS(DL1C, LOGL_NOTICE, ms, "Malformed message: too short. %u\n", msg->len); goto exit_msgbfree; } @@ -245,7 +245,7 @@ rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", ul->chan_nr, timeslot, subslot); ms->state.dedicated.chan_type = rsl_chantype; @@ -280,7 +280,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_dm_freq_req *freq_req = (struct l1ctl_dm_freq_req *) ul->payload; - DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", + DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_DM_FREQ_REQ (arfcn0=%u, hsn=%u, maio=%u)\n", ntohs(freq_req->h0.band_arfcn), freq_req->h1.hsn, freq_req->h1.maio); } @@ -305,7 +305,7 @@ struct l1ctl_crypto_req *cr = (struct l1ctl_crypto_req *) ul->payload; uint8_t key_len = msg->len - sizeof(*l1h) - sizeof(*ul) - sizeof(*cr); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_CRYPTO_REQ (algo=A5/%u, len=%u)\n", cr->algo, key_len); if (cr->algo && key_len != A5_KEY_LEN) { @@ -329,7 +329,7 @@ */ void l1ctl_rx_dm_rel_req(struct l1_model_ms *ms, struct msgb *msg) { - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); ms->state.dedicated.chan_type = 0; ms->state.dedicated.tn = 0; @@ -358,7 +358,7 @@ struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_par_req *par_req = (struct l1ctl_par_req *)ul->payload; - DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", + DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_PARAM_REQ (ta=%d, tx_power=%d)\n", par_req->ta, par_req->tx_power); } @@ -382,18 +382,18 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); ms->state.state = MS_STATE_IDLE_SEARCHING; virt_l1_sched_stop(ms); l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: virt_l1_sched_restart(ms, ms->state.downlink_time); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; default: - LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); + LOGPMS(DL1C, LOGL_ERROR, ms, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); break; } } @@ -417,7 +417,7 @@ struct l1ctl_ccch_mode_req *ccch_mode_req = (struct l1ctl_ccch_mode_req *) l1h->data; uint8_t ccch_mode = ccch_mode_req->ccch_mode; - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); ms->state.serving_cell.ccch_mode = ccch_mode; @@ -444,7 +444,7 @@ l1_model_tch_mode_set(ms, tch_mode_req->tch_mode); ms->state.audio_mode = tch_mode_req->audio_mode; - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", tch_mode_req->tch_mode, tch_mode_req->audio_mode); /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ @@ -470,7 +470,7 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_neigh_pm_req *pm_req = (struct l1ctl_neigh_pm_req *) l1h->data; - DEBUGP(DL1C, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", + DEBUGPMS(DL1C, ms, "Received and ignored from l23 - L1CTL_NEIGH_PM_REQ new list with %u entries\n", pm_req->n); } @@ -498,7 +498,7 @@ uint16_t len = msg->len - sizeof(struct l1ctl_hdr); uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); - LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - SIM Request length: %u, data: %s\n", + LOGPMS(DL1C, LOGL_ERROR, ms, "Received and ignored from l23 - SIM Request length: %u, data: %s\n", len, osmo_hexdump(data, sizeof(data))); } @@ -523,7 +523,7 @@ struct l1ctl_reset *reset_resp = (struct l1ctl_reset *) msgb_put(msg, sizeof(*reset_resp)); reset_resp->type = reset_type; - DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); + DEBUGPMS(DL1C, ms, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); l1ctl_sap_tx_to_l23_inst(ms, msg); } @@ -545,7 +545,7 @@ mode_conf = (struct l1ctl_ccch_mode_conf *) msgb_put(msg, sizeof(*mode_conf)); mode_conf->ccch_mode = ccch_mode; - DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); + DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); l1ctl_sap_tx_to_l23_inst(ms, msg); } @@ -568,7 +568,7 @@ mode_conf->tch_mode = tch_mode; mode_conf->audio_mode = audio_mode; - DEBUGP(DL1C, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", + DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, audio_mode); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index d654c21..00f25a6 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -93,7 +93,7 @@ return 0; } err_close: - perror("Failed to receive msg from l2. Connection will be closed.\n"); + LOGP(DL1C, LOGL_ERROR, "Failed to receive msg from l2. Connection will be closed.\n"); l1ctl_client_destroy(lsc); return 0; @@ -110,15 +110,14 @@ fd = accept(ofd->fd, NULL, NULL); if (fd < 0) { - fprintf(stderr, "Failed to accept connection to l2.\n"); + LOGP(DL1C, LOGL_ERROR, "Failed to accept connection to l2.\n"); return -1; } - printf("Accepted client (fd=%u) from server (fd=%u)\n", fd, ofd->fd); lsc = talloc_zero(lsi, struct l1ctl_sock_client); if (!lsc) { close(fd); - fprintf(stderr, "Failed to allocate L1CTL client\n"); + LOGP(DL1C, LOGL_ERROR, "Failed to allocate L1CTL client\n"); return -1; } @@ -136,9 +135,9 @@ } } - printf("Accepted L1CTL connection, lsc=%p, lsc->priv=%p\n", lsc, lsc->priv); + LOGP(DL1C, LOGL_INFO, "Accepted client (fd=%u) from server (fd=%u)\n", fd, ofd->fd); if (osmo_fd_register(&lsc->ofd) != 0) { - fprintf(stderr, "Failed to register the l2 connection fd.\n"); + LOGP(DL1C, LOGL_ERROR, "Failed to register the l2 connection fd.\n"); talloc_free(lsc); return -1; } @@ -166,6 +165,7 @@ rc = osmo_sock_unix_init_ofd(&lsi->ofd, SOCK_STREAM, 0, path, OSMO_SOCK_F_BIND); if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Error creating L1CTL listening socket\n"); talloc_free(lsi); return NULL; } diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 7801bec..7fb2c23 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -71,7 +71,14 @@ .color = "\033[1;31m", .enabled = 1, .loglevel = LOGL_DEBUG, - } + }, + [DMAIN] = { + .name = "DMAIN", + .description = "Main Program / Data Structures", + .color = "\033[1;32m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + }, }; const struct log_info ms_log_info = { @@ -107,5 +114,8 @@ const char *getL1ctlPrimName(uint8_t type) { - return l1ctlPrimNames[type]; + if (type <= ARRAY_SIZE(l1ctlPrimNames)) + return l1ctlPrimNames[type]; + else + return "Unknwon Primitive"; } diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index da0c314..14676b0 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -1,5 +1,6 @@ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -20,7 +21,10 @@ #include #include +#include #include + +static uint32_t next_ms_nr; struct l1_model_ms *l1_model_ms_init(void *ctx, struct l1ctl_sock_client *lsc, struct virt_um_inst *vui) { @@ -28,15 +32,19 @@ if (!model) return NULL; + model->nr = next_ms_nr++; model->lsc = lsc; model->vui = vui; l1ctl_sap_init(model); + + LOGPMS(DMAIN, LOGL_INFO, model, "allocated\n"); return model; } void l1_model_ms_destroy(struct l1_model_ms *model) { + LOGPMS(DMAIN, LOGL_INFO, model, "destryed\n"); talloc_free(model); } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 4b07ca6..e03d097 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -71,7 +71,7 @@ ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGP(DL1C, + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_DATA_REQ (link_id=0x%02x, ul=%p, ul->payload=%p, data_ind=%p, data_ind->data=%p l3h=%p)\n", ul->link_id, ul, ul->payload, data_ind, data_ind->data, msg->l3h); @@ -107,7 +107,7 @@ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); - DEBUGP(DL1C, "Sending signaling-data to l23.\n"); + DEBUGPMS(DL1C, ms, "Sending signaling-data to l23.\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 59fda35..932f163 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -57,7 +57,7 @@ struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_FBSB_REQ (arfcn=%u, flags=0x%x)\n", ntohs(sync_req->band_arfcn), sync_req->flags); l1s->state = MS_STATE_IDLE_SYNCING; @@ -126,7 +126,7 @@ resp->result = res; resp->bsic = bsic; - DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); + DEBUGPMS(DL1C, ms, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 96b7f07..3202680 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -52,7 +52,7 @@ l1s->pm.timeout_s, l1s->pm.timeout_us); } l1s->pm.meas.arfcn_sig_lev_dbm[arfcn] = sig_lev - l1s->pm.meas.arfcn_sig_lev_red_dbm[arfcn]; - DEBUGP(DL1C, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", + DEBUGPMS(DL1C, ms, "Power measurement set for arfcn %u. Set signal level to %d (== rxlev: %u).\n", arfcn, l1s->pm.meas.arfcn_sig_lev_dbm[arfcn], dbm2rxlev(l1s->pm.meas.arfcn_sig_lev_dbm[arfcn])); return l1s->pm.meas.arfcn_sig_lev_dbm[arfcn]; @@ -91,7 +91,7 @@ pm_req->range.band_arfcn_from = ntohs(pm_req->range.band_arfcn_from); pm_req->range.band_arfcn_to = ntohs(pm_req->range.band_arfcn_to); - DEBUGP(DL1C, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", + DEBUGPMS(DL1C, ms, "Received from l23 - L1CTL_PM_REQ TYPE=%u, FROM=%d, TO=%d\n", pm_req->type, pm_req->range.band_arfcn_from, pm_req->range.band_arfcn_to); for (arfcn_next = pm_req->range.band_arfcn_from; diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index 88e8206..c5bac73 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -82,7 +82,7 @@ uint8_t ts = 1; /* FIXME mostly, ts 1 is used for rach, where can i get that info? System info? */ uint16_t offset = ntohs(rach_req->offset); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_RACH_REQ (ra=0x%02x, offset=%d combined=%d)\n", rach_req->ra, offset, rach_req->combined); if (rach_req->ra == 0x03) @@ -123,7 +123,7 @@ { struct msgb *msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); - DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", + DEBUGPMS(DL1C, ms, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 9e87db9..04f6749 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -69,7 +69,7 @@ uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); + DEBUGPMS(DL1C, ms, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; @@ -102,7 +102,7 @@ /* TODO: traffic decoding and decryption */ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); - DEBUGP(DL1C, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); + DEBUGPMS(DL1C, ms, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index c7e11ca..78a45f0 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -37,7 +37,7 @@ #include #include -#define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" +#define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1:DMAIN,1" /* this exists once in the program, and contains the state that we * only keep once: L1CTL server socket, GSMTAP/VirtUM socket */ -- To view, visit https://gerrit.osmocom.org/3287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id7d9507126a03def5bd7690f1dbe987f9a749e65 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:15:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:15:20 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Major rewrite to deal with muliple L1CTL clients In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Major rewrite to deal with muliple L1CTL clients ...................................................................... VIRT-PHY: Major rewrite to deal with muliple L1CTL clients Change-Id: Ibfb2a93f8b45a95215c01368b1a52d92283474e6 --- M src/host/virt_phy/include/virtphy/gsmtapl1_if.h M src/host/virt_phy/include/virtphy/l1ctl_sap.h M src/host/virt_phy/include/virtphy/l1ctl_sock.h M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/include/virtphy/virt_l1_sched.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c M src/host/virt_phy/src/l1ctl_sock.c M src/host/virt_phy/src/virt_l1_model.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_fbsb.c M src/host/virt_phy/src/virt_prim_pm.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c M src/host/virt_phy/src/virtphy.c 16 files changed, 388 insertions(+), 428 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h index d8a4367..125ec11 100644 --- a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -9,8 +9,4 @@ void gsmtapl1_init(struct l1_model_ms *model); void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_rx_from_virt_um(struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg); -void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, - uint8_t *link_id); +void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg); diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sap.h b/src/host/virt_phy/include/virtphy/l1ctl_sap.h index b84c3e9..5903a02 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sap.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sap.h @@ -27,17 +27,11 @@ void l1ctl_sap_init(struct l1_model_ms *model); -void prim_rach_init(struct l1_model_ms *model); -void prim_data_init(struct l1_model_ms *model); -void prim_traffic_init(struct l1_model_ms *model); -void prim_fbsb_init(struct l1_model_ms *model); void prim_pm_init(struct l1_model_ms *model); -void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg); -void l1ctl_sap_tx_to_l23(struct msgb *msg); -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, - struct msgb *msg); +void l1ctl_sap_tx_to_l23_inst(struct l1_model_ms *model, struct msgb *msg); +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_client *lsc, struct msgb *msg); void l1ctl_sap_rx_from_l23(struct msgb *msg); -void l1ctl_sap_handler(struct msgb *msg); +void l1ctl_sap_handler(struct l1_model_ms *ms, struct msgb *msg); /* utility methods */ struct msgb *l1ctl_msgb_alloc(uint8_t msg_type); @@ -45,39 +39,39 @@ uint16_t arfcn); /* receive routines */ -void l1ctl_rx_fbsb_req(struct msgb *msg); -void l1ctl_rx_dm_est_req(struct msgb *msg); -void l1ctl_rx_dm_rel_req(struct msgb *msg); -void l1ctl_rx_param_req(struct msgb *msg); -void l1ctl_rx_dm_freq_req(struct msgb *msg); -void l1ctl_rx_crypto_req(struct msgb *msg); -void l1ctl_rx_rach_req(struct msgb *msg); -void l1ctl_rx_data_req(struct msgb *msg); -void l1ctl_rx_pm_req(struct msgb *msg); -void l1ctl_rx_reset_req(struct msgb *msg); -void l1ctl_rx_ccch_mode_req(struct msgb *msg); -void l1ctl_rx_tch_mode_req(struct msgb *msg); -void l1ctl_rx_neigh_pm_req(struct msgb *msg); -void l1ctl_rx_traffic_req(struct msgb *msg); -void l1ctl_rx_sim_req(struct msgb *msg); +void l1ctl_rx_fbsb_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_dm_est_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_dm_rel_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_param_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_dm_freq_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_crypto_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_rach_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_data_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_pm_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_reset_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_ccch_mode_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_tch_mode_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_neigh_pm_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_traffic_req(struct l1_model_ms *, struct msgb *msg); +void l1ctl_rx_sim_req(struct l1_model_ms *, struct msgb *msg); /* transmit routines */ -void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type); -void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn); -void l1ctl_tx_data_conf(uint32_t fn, uint16_t snr, uint16_t arfcn); -void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, +void l1ctl_tx_reset(struct l1_model_ms *, uint8_t msg_type, uint8_t reset_type); +void l1ctl_tx_rach_conf(struct l1_model_ms *, uint32_t fn, uint16_t arfcn); +void l1ctl_tx_data_conf(struct l1_model_ms *, uint32_t fn, uint16_t snr, uint16_t arfcn); +void l1ctl_tx_data_ind(struct l1_model_ms *, struct msgb *msg, uint16_t arfcn, uint8_t link_id, uint8_t chan_nr, uint32_t fn, uint8_t snr, uint8_t signal_dbm, uint8_t num_biterr, uint8_t fire_crc); -void l1ctl_tx_traffic_conf(uint32_t fn, uint16_t snr, uint16_t arfcn); -void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, +void l1ctl_tx_traffic_conf(struct l1_model_ms *, uint32_t fn, uint16_t snr, uint16_t arfcn); +void l1ctl_tx_traffic_ind(struct l1_model_ms *, struct msgb *msg, uint16_t arfcn, uint8_t link_id, uint8_t chan_nr, uint32_t fn, uint8_t snr, uint8_t signal_dbm, uint8_t num_biterr, uint8_t fire_crc); -void l1ctl_tx_pm_conf(struct l1ctl_pm_req *pm_req); -void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn); -void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode); -void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode); +void l1ctl_tx_pm_conf(struct l1_model_ms *, struct l1ctl_pm_req *pm_req); +void l1ctl_tx_fbsb_conf(struct l1_model_ms *, uint8_t res, uint16_t arfcn); +void l1ctl_tx_ccch_mode_conf(struct l1_model_ms *, uint8_t ccch_mode); +void l1ctl_tx_tch_mode_conf(struct l1_model_ms *, uint8_t tch_mode, uint8_t audio_mode); /* scheduler functions */ uint32_t sched_fn_ul(struct gsm_time cur_time, uint8_t chan_nr, diff --git a/src/host/virt_phy/include/virtphy/l1ctl_sock.h b/src/host/virt_phy/include/virtphy/l1ctl_sock.h index 8c96dc8..82ee5ca 100644 --- a/src/host/virt_phy/include/virtphy/l1ctl_sock.h +++ b/src/host/virt_phy/include/virtphy/l1ctl_sock.h @@ -1,17 +1,33 @@ #pragma once #include +#include #include #define L1CTL_SOCK_PATH "/tmp/osmocom_l2" +struct l1ctl_sock_inst; + +struct l1ctl_sock_client { + /* list head in l1ctl_sock_inst.clients */ + struct llist_head list; + /* pointer back to the server socket that accepted us */ + struct l1ctl_sock_inst *l1ctl_sock; + /* Osmo FD for the client socket */ + struct osmo_fd ofd; + /* private data, can be set in accept_cb */ + void *priv; +}; + /* L1CTL socket instance contains socket data. */ struct l1ctl_sock_inst { void *priv; /* Will be appended after osmo-fd's data pointer. */ - struct osmo_fd connection; /* L1CTL connection to l2 app */ + struct llist_head clients; char* l1ctl_sock_path; /* Socket path used to connect to l23 */ struct osmo_fd ofd; /* Osmocom file descriptor to accept L1CTL connections. */ - void (*recv_cb)(struct l1ctl_sock_inst *vui, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ + void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg); /* Callback function called for incoming data from l2 app. */ + /* Callback function called for new client after accept() */ + int (*accept_cb)(struct l1ctl_sock_client *lsc); }; /** @@ -19,20 +35,16 @@ */ struct l1ctl_sock_inst *l1ctl_sock_init( void *ctx, - void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg), + int (*accept_cb)(struct l1ctl_sock_client *lsc), char *path); /** * @brief Transmit message to l2. */ -int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg); +int l1ctl_sock_write_msg(struct l1ctl_sock_client *lsc, struct msgb *msg); /** * @brief Destroy instance. */ -void l1ctl_sock_destroy(); - -/** - * @brief Disconnect current connection. - */ -void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi); +void l1ctl_sock_destroy(struct l1ctl_sock_inst *lsi); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index 61776ec..0cb5381 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -45,6 +45,10 @@ struct gsm_time downlink_time; /* current GSM time received on downlink */ struct gsm_time current_time; /* GSM time used internally for scheduling */ + struct { + uint32_t last_exec_fn; + struct llist_head mframe_items; + } sched; enum ms_state state; @@ -89,13 +93,16 @@ }; struct l1_model_ms { - struct l1ctl_sock_inst *lsi; + /* pointer to the L1CTL socket client associated with this specific MS */ + struct l1ctl_sock_client *lsc; + /* pointer to the (shared) GSMTAP/VirtUM socket to talk to BTS(s) */ struct virt_um_inst *vui; + /* actual per-MS state */ struct l1_state_ms state; }; -struct l1_model_ms *l1_model_ms_init(void *ctx); +struct l1_model_ms *l1_model_ms_init(void *ctx, struct l1ctl_sock_client *lsc, struct virt_um_inst *vui); void l1_model_ms_destroy(struct l1_model_ms *model); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_sched.h b/src/host/virt_phy/include/virtphy/virt_l1_sched.h index de08550..f3e9b84 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_sched.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_sched.h @@ -5,7 +5,9 @@ #include #include -typedef void virt_l1_sched_cb(uint32_t fn, struct msgb * msg); +struct l1_model_ms; + +typedef void virt_l1_sched_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg); /* bucket containing items to be executed for a specific mframe number */ struct virt_l1_sched_mframe_item { @@ -22,11 +24,9 @@ virt_l1_sched_cb * handler_cb; /* handler callback */ }; -void virt_l1_sched_init(struct l1_model_ms * model); -int virt_l1_sched_start(struct gsm_time time); -int virt_l1_sched_restart(struct gsm_time time); -void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset); -void virt_l1_sched_stop(); -void virt_l1_sched_execute(uint32_t fn); -void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, +int virt_l1_sched_restart(struct l1_model_ms *ms, struct gsm_time time); +void virt_l1_sched_sync_time(struct l1_model_ms *ms, struct gsm_time time, uint8_t hard_reset); +void virt_l1_sched_stop(struct l1_model_ms *ms); +void virt_l1_sched_execute(struct l1_model_ms *ms, uint32_t fn); +void virt_l1_sched_schedule(struct l1_model_ms *ms, struct msgb *msg, uint32_t fn, uint8_t ts, virt_l1_sched_cb * handler_cb); diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 18580b4..dfcd5a8 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -1,6 +1,7 @@ /* GSMTAP layer1 is transmits gsmtap messages over a virtual layer 1.*/ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -38,24 +39,16 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; - -void gsmtapl1_init(struct l1_model_ms *model) -{ - l1_model_ms = model; -} - /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(uint32_t fn, struct virt_um_inst *vui, - struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct gsmtap_hdr *gh; struct msgb *outmsg; /* msg to send with gsmtap header prepended */ - uint16_t arfcn = l1_model_ms->state.serving_cell.arfcn; /* arfcn of the cell we currently camp on */ + uint16_t arfcn = ms->state.serving_cell.arfcn; /* arfcn of the cell we currently camp on */ uint8_t signal_dbm = 63; /* signal strength */ uint8_t snr = 63; /* signal noise ratio, 63 is best */ uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */ @@ -76,7 +69,7 @@ if (outmsg) { outmsg->l1h = msgb_data(outmsg); gh = msgb_l1(outmsg); - if (virt_um_write_msg(l1_model_ms->vui, outmsg) == -1) { + if (virt_um_write_msg(ms->vui, outmsg) == -1) { LOGP(DVIRPHY, LOGL_ERROR, "Gsmtap msg could not send to virt um - " "(arfcn=%u, type=%u, subtype=%u, timeslot=%u, subslot=%u)\n", gh->arfcn, gh->type, gh->sub_type, gh->timeslot, @@ -95,86 +88,44 @@ } /** - * @see void gsmtapl1_tx_to_virt_um(struct virt_um_inst *vui, uint32_t fn, struct msgb *msg). - */ -void gsmtapl1_tx_to_virt_um(uint32_t fn, struct msgb *msg) -{ - gsmtapl1_tx_to_virt_um_inst(fn, l1_model_ms->vui, msg); -} - -/** * @see virt_prim_fbsb.c */ -extern void prim_fbsb_sync(struct msgb *msg); +extern void prim_fbsb_sync(struct l1_model_ms *ms, struct msgb *msg); /** * @see virt_prim_pm.c */ -extern uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev); +extern uint16_t prim_pm_set_sig_strength(struct l1_model_ms *ms, uint16_t arfcn, int16_t sig_lev); -/** - * Receive a gsmtap message from the virt um. - * - * As we do not have a downlink scheduler, but not all dl messages must be processed and thus forwarded to l2, this function also implements some message filtering. - * E.g. we do not forward: - * - uplink messages - * - messages with a wrong arfcn - * - if in MS_STATE_IDLE_SEARCHING - */ -void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, - struct msgb *msg) +static void l1ctl_from_virt_um(struct l1ctl_sock_client *lsc, struct msgb *msg, uint32_t fn, + uint16_t arfcn, uint8_t timeslot, uint8_t subslot, + uint8_t gsmtap_chantype, uint8_t chan_nr, uint8_t link_id, + uint8_t snr_db) { - if (!msg) + struct l1_model_ms *ms = lsc->priv; + uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(ms, arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); /* Power measurement with each received massage */ + + gsm_fn2gsmtime(&ms->state.downlink_time, fn); + + /* we do not forward messages to l23 if we are in network search state */ + if (ms->state.state == MS_STATE_IDLE_SEARCHING) return; - struct gsmtap_hdr *gh = msgb_l1(msg); - uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ - uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ - uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ - uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); /* Power measurement with each received massage */ - uint8_t snr = gh->snr_db; /* signal noise ratio */ - uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ - uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ - uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ - uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ - uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ - - /* generally ignore all uplink messages received */ - if (arfcn & GSMTAP_ARFCN_F_UPLINK) { - LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); - goto freemsg; - } - /* we do not forward messages to l23 if we are in network search state */ - if (l1_model_ms->state.state == MS_STATE_IDLE_SEARCHING) - goto freemsg; - /* forward downlink msg to fbsb sync routine if we are in sync state */ - if (l1_model_ms->state.state == MS_STATE_IDLE_SYNCING) { - prim_fbsb_sync(msg); + if (ms->state.state == MS_STATE_IDLE_SYNCING) { + prim_fbsb_sync(ms, msg); return; } /* generally ignore all messages coming from another arfcn than the camped one */ - if (l1_model_ms->state.serving_cell.arfcn != arfcn) { + if (ms->state.serving_cell.arfcn != arfcn) { LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - msg arfcn=%d not equal synced arfcn=%d!\n", - arfcn, l1_model_ms->state.serving_cell.arfcn); - goto freemsg; + arfcn, ms->state.serving_cell.arfcn); + return; } - msg->l2h = msgb_pull(msg, sizeof(*gh)); - chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); - /* see TS 08.58 -> 9.3.1 for channel number encoding */ - chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); - - gsm_fn2gsmtime(&l1_model_ms->state.downlink_time, fn); - virt_l1_sched_sync_time(l1_model_ms->state.downlink_time, 0); - virt_l1_sched_execute(fn); - - DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " - "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", - arfcn, fn, get_value_string(gsmtap_type_names, gh->type), - get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype), timeslot, - subslot, rsl_chantype, link_id, chan_nr); + virt_l1_sched_sync_time(ms, ms->state.downlink_time, 0); + virt_l1_sched_execute(ms, fn); /* switch case with removed ACCH flag */ switch (gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH & 0xff) { @@ -191,9 +142,9 @@ case GSMTAP_CHANNEL_SDCCH8: /* only forward messages on dedicated channels to l2, if * the timeslot and subslot is fitting */ - if (l1_model_ms->state.dedicated.tn == timeslot - && l1_model_ms->state.dedicated.subslot == subslot) { - l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); + if (ms->state.dedicated.tn == timeslot + && ms->state.dedicated.subslot == subslot) { + l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); } break; case GSMTAP_CHANNEL_AGCH: @@ -201,7 +152,7 @@ case GSMTAP_CHANNEL_BCCH: /* save to just forward here, as upper layer ignores messages that * do not fit the current state (e.g. gsm48_rr.c:2159) */ - l1ctl_tx_data_ind(msg, arfcn, link_id, chan_nr, fn, snr, signal_dbm, 0, 0); + l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); break; case GSMTAP_CHANNEL_RACH: LOGP(DVIRPHY, LOGL_NOTICE, @@ -222,15 +173,60 @@ "Ignoring gsmtap msg from virt um - channel type unknown.\n"); break; } - -freemsg: - talloc_free(msg); } /** - * @see void gsmtapl1_rx_from_virt_um_cb(struct virt_um_inst *vui, struct msgb msg). + * Receive a gsmtap message from the virt um. + * + * As we do not have a downlink scheduler, but not all dl messages must be processed and thus forwarded to l2, this function also implements some message filtering. + * E.g. we do not forward: + * - uplink messages + * - messages with a wrong arfcn + * - if in MS_STATE_IDLE_SEARCHING */ -void gsmtapl1_rx_from_virt_um(struct msgb *msg) +void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, + struct msgb *msg) { - gsmtapl1_rx_from_virt_um_inst_cb(l1_model_ms->vui, msg); + struct l1ctl_sock_inst *lsi = vui->priv; + struct l1ctl_sock_client *lsc; + + if (!msg) + return; + + struct gsmtap_hdr *gh = msgb_l1(msg); + uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ + uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ + uint8_t gsmtap_chantype = gh->sub_type; /* gsmtap channel type */ + uint8_t snr = gh->snr_db; /* signal noise ratio */ + uint8_t subslot = gh->sub_slot; /* multiframe subslot to send msg in (tch -> 0-26, bcch/ccch -> 0-51) */ + uint8_t timeslot = gh->timeslot; /* tdma timeslot to send in (0-7) */ + uint8_t rsl_chantype; /* rsl chan type (8.58, 9.3.1) */ + uint8_t link_id; /* rsl link id tells if this is an ssociated or dedicated link */ + uint8_t chan_nr; /* encoded rsl channel type, timeslot and mf subslot */ + + msg->l2h = msgb_pull(msg, sizeof(*gh)); + chantype_gsmtap2rsl(gsmtap_chantype, &rsl_chantype, &link_id); + /* see TS 08.58 -> 9.3.1 for channel number encoding */ + chan_nr = rsl_enc_chan_nr(rsl_chantype, subslot, timeslot); + + /* generally ignore all uplink messages received */ + if (arfcn & GSMTAP_ARFCN_F_UPLINK) { + LOGP(DVIRPHY, LOGL_NOTICE, "Ignoring gsmtap msg from virt um - uplink flag set!\n"); + goto freemsg; + } + + DEBUGP(DVIRPHY, "Receiving gsmtap msg from virt um - " + "(arfcn=%u, framenumber=%u, type=%s, subtype=%s, timeslot=%u, subslot=%u, rsl_chan_type=0x%2x, link_id=0x%2x, chan_nr=0x%2x)\n", + arfcn, fn, get_value_string(gsmtap_type_names, gh->type), + get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype), timeslot, + subslot, rsl_chantype, link_id, chan_nr); + + /* dispatch the incoming DL message from GSMTAP to each of the registered L1CTL instances */ + llist_for_each_entry(lsc, &lsi->clients, list) { + l1ctl_from_virt_um(lsc, msg, fn, arfcn, timeslot, subslot, gsmtap_chantype, + chan_nr, link_id, snr); + } + +freemsg: + talloc_free(msg); } diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index 8965ac1..be5557d 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -39,15 +39,13 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; - -static void l1_model_tch_mode_set(uint8_t tch_mode) +static void l1_model_tch_mode_set(struct l1_model_ms *ms, uint8_t tch_mode) { if (tch_mode == GSM48_CMODE_SPEECH_V1 || tch_mode == GSM48_CMODE_SPEECH_EFR) - l1_model_ms->state.tch_mode = tch_mode; + ms->state.tch_mode = tch_mode; else { /* set default value if no proper mode was assigned by l23 */ - l1_model_ms->state.tch_mode = GSM48_CMODE_SIGN; + ms->state.tch_mode = GSM48_CMODE_SIGN; } } @@ -56,11 +54,7 @@ */ void l1ctl_sap_init(struct l1_model_ms *model) { - l1_model_ms = model; - prim_rach_init(model); - prim_fbsb_init(model); - prim_data_init(model); - prim_traffic_init(model); + INIT_LLIST_HEAD(&model->state.sched.mframe_items); prim_pm_init(model); } @@ -69,20 +63,15 @@ * * Enqueues the message into the rx queue. */ -void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg) +void l1ctl_sap_rx_from_l23_inst_cb(struct l1ctl_sock_client *lsc, struct msgb *msg) { + struct l1_model_ms *ms = lsc->priv; /* check if the received msg is not empty */ - if (msg) { - DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); - l1ctl_sap_handler(msg); - } -} -/** - * @see l1ctl_sap_rx_from_l23_cb(struct l1ctl_sock_inst *lsi, struct msgb *msg). - */ -void l1ctl_sap_rx_from_l23(struct msgb *msg) -{ - l1ctl_sap_rx_from_l23_inst_cb(l1_model_ms->lsi, msg); + if (!msg) + return; + + DEBUGP(DL1C, "Message incoming from layer 2: %s\n", osmo_hexdump(msg->data, msg->len)); + l1ctl_sap_handler(ms, msg); } /** @@ -90,19 +79,11 @@ * * This will forward the message as it is to the upper layer. */ -void l1ctl_sap_tx_to_l23_inst(struct l1ctl_sock_inst *lsi, struct msgb *msg) +void l1ctl_sap_tx_to_l23_inst(struct l1_model_ms *ms, struct msgb *msg) { /* prepend 16bit length before sending */ msgb_push_u16(msg, msg->len); - l1ctl_sock_write_msg(lsi, msg); -} - -/** - * @see void l1ctl_sap_tx_to_l23(struct l1ctl_sock_inst *lsi, struct msgb *msg). - */ -void l1ctl_sap_tx_to_l23(struct msgb *msg) -{ - l1ctl_sap_tx_to_l23_inst(l1_model_ms->lsi, msg); + l1ctl_sock_write_msg(ms->lsc, msg); } /** @@ -170,7 +151,7 @@ * * This handler will call the specific routine dependent on the L1CTL message type. */ -void l1ctl_sap_handler(struct msgb *msg) +void l1ctl_sap_handler(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h; @@ -186,49 +167,49 @@ switch (l1h->msg_type) { case L1CTL_FBSB_REQ: - l1ctl_rx_fbsb_req(msg); + l1ctl_rx_fbsb_req(ms, msg); break; case L1CTL_DM_EST_REQ: - l1ctl_rx_dm_est_req(msg); + l1ctl_rx_dm_est_req(ms, msg); break; case L1CTL_DM_REL_REQ: - l1ctl_rx_dm_rel_req(msg); + l1ctl_rx_dm_rel_req(ms, msg); break; case L1CTL_PARAM_REQ: - l1ctl_rx_param_req(msg); + l1ctl_rx_param_req(ms, msg); break; case L1CTL_DM_FREQ_REQ: - l1ctl_rx_dm_freq_req(msg); + l1ctl_rx_dm_freq_req(ms,msg); break; case L1CTL_CRYPTO_REQ: - l1ctl_rx_crypto_req(msg); + l1ctl_rx_crypto_req(ms, msg); break; case L1CTL_RACH_REQ: - l1ctl_rx_rach_req(msg); + l1ctl_rx_rach_req(ms, msg); goto exit_nofree; case L1CTL_DATA_REQ: - l1ctl_rx_data_req(msg); + l1ctl_rx_data_req(ms, msg); goto exit_nofree; case L1CTL_PM_REQ: - l1ctl_rx_pm_req(msg); + l1ctl_rx_pm_req(ms, msg); break; case L1CTL_RESET_REQ: - l1ctl_rx_reset_req(msg); + l1ctl_rx_reset_req(ms, msg); break; case L1CTL_CCCH_MODE_REQ: - l1ctl_rx_ccch_mode_req(msg); + l1ctl_rx_ccch_mode_req(ms, msg); break; case L1CTL_TCH_MODE_REQ: - l1ctl_rx_tch_mode_req(msg); + l1ctl_rx_tch_mode_req(ms, msg); break; case L1CTL_NEIGH_PM_REQ: - l1ctl_rx_neigh_pm_req(msg); + l1ctl_rx_neigh_pm_req(ms, msg); break; case L1CTL_TRAFFIC_REQ: - l1ctl_rx_traffic_req(msg); + l1ctl_rx_traffic_req(ms, msg); goto exit_nofree; case L1CTL_SIM_REQ: - l1ctl_rx_sim_req(msg); + l1ctl_rx_sim_req(ms, msg); break; } @@ -255,7 +236,7 @@ * Handle state change from idle to dedicated mode. * */ -void l1ctl_rx_dm_est_req(struct msgb *msg) +void l1ctl_rx_dm_est_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; @@ -267,16 +248,16 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n", ul->chan_nr, timeslot, subslot); - l1_model_ms->state.dedicated.chan_type = rsl_chantype; - l1_model_ms->state.dedicated.tn = timeslot; - l1_model_ms->state.dedicated.subslot = subslot; - l1_model_ms->state.state = MS_STATE_DEDICATED; + ms->state.dedicated.chan_type = rsl_chantype; + ms->state.dedicated.tn = timeslot; + ms->state.dedicated.subslot = subslot; + ms->state.state = MS_STATE_DEDICATED; /* TCH config */ if (rsl_chantype == RSL_CHAN_Bm_ACCHs || rsl_chantype == RSL_CHAN_Lm_ACCHs) { - l1_model_ms->state.tch_mode = est_req->tch_mode; - l1_model_tch_mode_set(est_req->tch_mode); - l1_model_ms->state.audio_mode = est_req->audio_mode; + ms->state.tch_mode = est_req->tch_mode; + l1_model_tch_mode_set(ms, est_req->tch_mode); + ms->state.audio_mode = est_req->audio_mode; /* TODO: configure audio hardware for encoding / * decoding / recording / playing voice */ } @@ -293,7 +274,7 @@ * * Note: Not needed for virtual physical layer as freqency hopping is generally disabled. */ -void l1ctl_rx_dm_freq_req(struct msgb *msg) +void l1ctl_rx_dm_freq_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; @@ -317,7 +298,7 @@ * TODO: Implement cryptographic operations for virtual um! * TODO: Implement this handler routine! */ -void l1ctl_rx_crypto_req(struct msgb *msg) +void l1ctl_rx_crypto_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; @@ -332,8 +313,8 @@ return; } - l1_model_ms->state.crypto_inf.algo = cr->algo; - memcpy(l1_model_ms->state.crypto_inf.key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); + ms->state.crypto_inf.algo = cr->algo; + memcpy(ms->state.crypto_inf.key, cr->key, sizeof(uint8_t) * A5_KEY_LEN); } /** @@ -346,15 +327,15 @@ * Handle state change from dedicated to idle mode. Flush message buffers of dedicated channel. * */ -void l1ctl_rx_dm_rel_req(struct msgb *msg) +void l1ctl_rx_dm_rel_req(struct l1_model_ms *ms, struct msgb *msg) { DEBUGP(DL1C, "Received and handled from l23 - L1CTL_DM_REL_REQ\n"); - l1_model_ms->state.dedicated.chan_type = 0; - l1_model_ms->state.dedicated.tn = 0; - l1_model_ms->state.dedicated.subslot = 0; - l1_model_ms->state.tch_mode = GSM48_CMODE_SIGN; - l1_model_ms->state.state = MS_STATE_IDLE_CAMPING; + ms->state.dedicated.chan_type = 0; + ms->state.dedicated.tn = 0; + ms->state.dedicated.subslot = 0; + ms->state.tch_mode = GSM48_CMODE_SIGN; + ms->state.state = MS_STATE_IDLE_CAMPING; /* TODO: disable ciphering */ /* TODO: disable audio recording / playing */ @@ -371,7 +352,7 @@ * * Note: Not needed for virtual physical layer. */ -void l1ctl_rx_param_req(struct msgb *msg) +void l1ctl_rx_param_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; @@ -394,7 +375,7 @@ * to just tell l2 that we are rdy. * */ -void l1ctl_rx_reset_req(struct msgb *msg) +void l1ctl_rx_reset_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_reset *reset_req = (struct l1ctl_reset *) l1h->data; @@ -402,14 +383,14 @@ switch (reset_req->type) { case L1CTL_RES_T_FULL: DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=FULL)\n"); - l1_model_ms->state.state = MS_STATE_IDLE_SEARCHING; - virt_l1_sched_stop(); - l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + ms->state.state = MS_STATE_IDLE_SEARCHING; + virt_l1_sched_stop(ms); + l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; case L1CTL_RES_T_SCHED: - virt_l1_sched_restart(l1_model_ms->state.downlink_time); + virt_l1_sched_restart(ms, ms->state.downlink_time); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_RESET_REQ (type=SCHED)\n"); - l1ctl_tx_reset(L1CTL_RESET_CONF, reset_req->type); + l1ctl_tx_reset(ms, L1CTL_RESET_CONF, reset_req->type); break; default: LOGP(DL1C, LOGL_ERROR, "Received and ignored from l23 - L1CTL_RESET_REQ (type=unknown)\n"); @@ -430,7 +411,7 @@ * * TODO: Implement this handler routine! */ -void l1ctl_rx_ccch_mode_req(struct msgb *msg) +void l1ctl_rx_ccch_mode_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_ccch_mode_req *ccch_mode_req = (struct l1ctl_ccch_mode_req *) l1h->data; @@ -438,10 +419,10 @@ DEBUGP(DL1C, "Received and handled from l23 - L1CTL_CCCH_MODE_REQ\n"); - l1_model_ms->state.serving_cell.ccch_mode = ccch_mode; + ms->state.serving_cell.ccch_mode = ccch_mode; /* check if more has to be done here */ - l1ctl_tx_ccch_mode_conf(ccch_mode); + l1ctl_tx_ccch_mode_conf(ms, ccch_mode); } /** @@ -455,20 +436,20 @@ * * TODO: Implement this handler routine! */ -void l1ctl_rx_tch_mode_req(struct msgb *msg) +void l1ctl_rx_tch_mode_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_tch_mode_req *tch_mode_req = (struct l1ctl_tch_mode_req *) l1h->data; - l1_model_tch_mode_set(tch_mode_req->tch_mode); - l1_model_ms->state.audio_mode = tch_mode_req->audio_mode; + l1_model_tch_mode_set(ms, tch_mode_req->tch_mode); + ms->state.audio_mode = tch_mode_req->audio_mode; DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TCH_MODE_REQ (tch_mode=0x%02x audio_mode=0x%02x)\n", tch_mode_req->tch_mode, tch_mode_req->audio_mode); /* TODO: configure audio hardware for encoding / decoding / recording / playing voice */ - l1ctl_tx_tch_mode_conf(l1_model_ms->state.tch_mode, l1_model_ms->state.audio_mode); + l1ctl_tx_tch_mode_conf(ms, ms->state.tch_mode, ms->state.audio_mode); } /** @@ -484,7 +465,7 @@ * * Note: Not needed for virtual physical layer as we dont maintain neigbors. */ -void l1ctl_rx_neigh_pm_req(struct msgb *msg) +void l1ctl_rx_neigh_pm_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_neigh_pm_req *pm_req = (struct l1ctl_neigh_pm_req *) l1h->data; @@ -512,7 +493,7 @@ * ki comp128 * -------- */ -void l1ctl_rx_sim_req(struct msgb *msg) +void l1ctl_rx_sim_req(struct l1_model_ms *ms, struct msgb *msg) { uint16_t len = msg->len - sizeof(struct l1ctl_hdr); uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); @@ -536,7 +517,7 @@ * @param [in] msg_type L1CTL primitive message type. * @param [in] reset_type reset type (full, boot or just scheduler reset). */ -void l1ctl_tx_reset(uint8_t msg_type, uint8_t reset_type) +void l1ctl_tx_reset(struct l1_model_ms *ms, uint8_t msg_type, uint8_t reset_type) { struct msgb *msg = l1ctl_msgb_alloc(msg_type); struct l1ctl_reset *reset_resp = (struct l1ctl_reset *) msgb_put(msg, sizeof(*reset_resp)); @@ -544,7 +525,7 @@ reset_resp->type = reset_type; DEBUGP(DL1C, "Sending to l23 - %s (reset_type: %u)\n", getL1ctlPrimName(msg_type), reset_type); - l1ctl_sap_tx_to_l23(msg); + l1ctl_sap_tx_to_l23_inst(ms, msg); } /** @@ -556,7 +537,7 @@ * * Called by layer 1 to inform layer 2 that the ccch mode was successfully changed. */ -void l1ctl_tx_ccch_mode_conf(uint8_t ccch_mode) +void l1ctl_tx_ccch_mode_conf(struct l1_model_ms *ms, uint8_t ccch_mode) { struct msgb *msg = l1ctl_msgb_alloc(L1CTL_CCCH_MODE_CONF); struct l1ctl_ccch_mode_conf *mode_conf; @@ -565,7 +546,7 @@ mode_conf->ccch_mode = ccch_mode; DEBUGP(DL1C, "Sending to l23 - L1CTL_CCCH_MODE_CONF (mode: %u)\n", ccch_mode); - l1ctl_sap_tx_to_l23(msg); + l1ctl_sap_tx_to_l23_inst(ms, msg); } /** @@ -578,7 +559,7 @@ * * Called by layer 1 to inform layer 23 that the traffic channel mode was successfully changed. */ -void l1ctl_tx_tch_mode_conf(uint8_t tch_mode, uint8_t audio_mode) +void l1ctl_tx_tch_mode_conf(struct l1_model_ms *ms, uint8_t tch_mode, uint8_t audio_mode) { struct msgb *msg = l1ctl_msgb_alloc(L1CTL_TCH_MODE_CONF); struct l1ctl_tch_mode_conf *mode_conf; @@ -589,7 +570,7 @@ DEBUGP(DL1C, "Sending to l23 - L1CTL_TCH_MODE_CONF (tch_mode: %u, audio_mode: %u)\n", tch_mode, audio_mode); - l1ctl_sap_tx_to_l23(msg); + l1ctl_sap_tx_to_l23_inst(ms, msg); } /** diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c index 370d3f3..d654c21 100644 --- a/src/host/virt_phy/src/l1ctl_sock.c +++ b/src/host/virt_phy/src/l1ctl_sock.c @@ -1,6 +1,7 @@ /* Socket based Layer1 <-> Layer23 communication over L1CTL primitives. */ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -32,23 +33,24 @@ #include #include #include +#include #include #include -#include #include -#include #include -#include - -#include - -#include #include #include #define L1CTL_SOCK_MSGB_SIZE 256 + +static void l1ctl_client_destroy(struct l1ctl_sock_client *lsc) +{ + osmo_fd_close(&lsc->ofd); + llist_del(&lsc->list); + talloc_free(lsc); +} /** * @brief L1CTL socket file descriptor callback function. @@ -60,7 +62,7 @@ */ static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what) { - struct l1ctl_sock_inst *lsi = ofd->data; + struct l1ctl_sock_client *lsc = ofd->data; struct l1ctl_hdr *l1h; struct msgb *msg; uint16_t len; @@ -87,44 +89,67 @@ msgb_put(msg, rc); l1h = (void *) msgb_data(msg); msg->l1h = (void *) l1h; - lsi->recv_cb(lsi, msg); + lsc->l1ctl_sock->recv_cb(lsc, msg); return 0; } err_close: perror("Failed to receive msg from l2. Connection will be closed.\n"); - l1ctl_sock_disconnect(lsi); + l1ctl_client_destroy(lsc); return 0; } +/* called for the master (listening) socket of the instance, allocates a new client */ static int l1ctl_sock_accept_cb(struct osmo_fd *ofd, unsigned int what) { struct l1ctl_sock_inst *lsi = ofd->data; - int fd; + struct l1ctl_sock_client *lsc; + int fd, rc; fd = accept(ofd->fd, NULL, NULL); if (fd < 0) { fprintf(stderr, "Failed to accept connection to l2.\n"); return -1; } + printf("Accepted client (fd=%u) from server (fd=%u)\n", fd, ofd->fd); - lsi->connection.fd = fd; - lsi->connection.when = BSC_FD_READ; - lsi->connection.cb = l1ctl_sock_data_cb; - lsi->connection.data = lsi; - - if (osmo_fd_register(&lsi->connection) != 0) { - fprintf(stderr, "Failed to register the l2 connection fd.\n"); + lsc = talloc_zero(lsi, struct l1ctl_sock_client); + if (!lsc) { + close(fd); + fprintf(stderr, "Failed to allocate L1CTL client\n"); return -1; } + + lsc->l1ctl_sock = lsi; + lsc->ofd.fd = fd; + lsc->ofd.when = BSC_FD_READ; + lsc->ofd.cb = l1ctl_sock_data_cb; + lsc->ofd.data = lsc; + if (lsi->accept_cb) { + rc = lsi->accept_cb(lsc); + if (rc < 0) { + talloc_free(lsc); + close(fd); + return rc; + } + } + + printf("Accepted L1CTL connection, lsc=%p, lsc->priv=%p\n", lsc, lsc->priv); + if (osmo_fd_register(&lsc->ofd) != 0) { + fprintf(stderr, "Failed to register the l2 connection fd.\n"); + talloc_free(lsc); + return -1; + } + llist_add_tail(&lsc->list, &lsi->clients); return 0; } struct l1ctl_sock_inst *l1ctl_sock_init( void *ctx, - void (*recv_cb)(struct l1ctl_sock_inst *lsi, struct msgb *msg), + void (*recv_cb)(struct l1ctl_sock_client *lsc, struct msgb *msg), + int (*accept_cb)(struct l1ctl_sock_client *lsc), char *path) { struct l1ctl_sock_inst *lsi; @@ -146,40 +171,28 @@ } lsi->recv_cb = recv_cb; - /* no connection -> invalid filedescriptor and not 0 (==std_in) */ - lsi->connection.fd = -1; + lsi->accept_cb = accept_cb; lsi->l1ctl_sock_path = path; - - osmo_fd_register(&lsi->ofd); + INIT_LLIST_HEAD(&lsi->clients); return lsi; } void l1ctl_sock_destroy(struct l1ctl_sock_inst *lsi) { - struct osmo_fd *ofd = &lsi->ofd; + struct l1ctl_sock_client *lsc, *lsc2; - osmo_fd_unregister(ofd); - close(ofd->fd); - ofd->fd = -1; - ofd->when = 0; + llist_for_each_entry_safe(lsc, lsc2, &lsi->clients, list) + l1ctl_client_destroy(lsc); + osmo_fd_close(&lsi->ofd); talloc_free(lsi); } -void l1ctl_sock_disconnect(struct l1ctl_sock_inst *lsi) -{ - struct osmo_fd *ofd = &lsi->connection; - osmo_fd_unregister(ofd); - close(ofd->fd); - ofd->fd = -1; - ofd->when = 0; -} - -int l1ctl_sock_write_msg(struct l1ctl_sock_inst *lsi, struct msgb *msg) +int l1ctl_sock_write_msg(struct l1ctl_sock_client *lsc, struct msgb *msg) { int rc; - rc = write(lsi->connection.fd, msgb_data(msg), msgb_length(msg)); + rc = write(lsc->ofd.fd, msgb_data(msg), msgb_length(msg)); msgb_free(msg); return rc; } diff --git a/src/host/virt_phy/src/virt_l1_model.c b/src/host/virt_phy/src/virt_l1_model.c index 056c9eb..da0c314 100644 --- a/src/host/virt_phy/src/virt_l1_model.c +++ b/src/host/virt_phy/src/virt_l1_model.c @@ -19,17 +19,24 @@ */ #include +#include #include -struct l1_model_ms* l1_model_ms_init(void *ctx) +struct l1_model_ms *l1_model_ms_init(void *ctx, struct l1ctl_sock_client *lsc, struct virt_um_inst *vui) { struct l1_model_ms *model = talloc_zero(ctx, struct l1_model_ms); + if (!model) + return NULL; + + model->lsc = lsc; + model->vui = vui; + + l1ctl_sap_init(model); + return model; } void l1_model_ms_destroy(struct l1_model_ms *model) { - virt_um_destroy(model->vui); - l1ctl_sock_destroy(model->lsi); talloc_free(model); } diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index 20481df..7d1cdd4 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -1,4 +1,5 @@ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -24,55 +25,41 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; - -static LLIST_HEAD(mframe_item_list); - -static uint32_t last_exec_fn = 0; - /** - * @brief Initialize schedulers data structures. + * @brief Start scheduler thread based on current gsm time from model */ -void virt_l1_sched_init(struct l1_model_ms *model) +static int virt_l1_sched_start(struct l1_model_ms *ms, struct gsm_time time) { - l1_model_ms = model; + virt_l1_sched_sync_time(ms, time, 1); + return 0; } /** * @brief Clear scheduler queue and completely restart scheduler. */ -int virt_l1_sched_restart(struct gsm_time time) +int virt_l1_sched_restart(struct l1_model_ms *ms, struct gsm_time time) { - virt_l1_sched_stop(); - return virt_l1_sched_start(time); -} - -/** - * @brief Start scheduler thread based on current gsm time from model - */ -int virt_l1_sched_start(struct gsm_time time) -{ - virt_l1_sched_sync_time(time, 1); - return 0; + virt_l1_sched_stop(ms); + return virt_l1_sched_start(ms, time); } /** * @brief Sync scheduler with given time. */ -void virt_l1_sched_sync_time(struct gsm_time time, uint8_t hard_reset) +void virt_l1_sched_sync_time(struct l1_model_ms *ms, struct gsm_time time, uint8_t hard_reset) { - l1_model_ms->state.current_time = time; + ms->state.current_time = time; } /** * @brief Stop the scheduler thread and cleanup mframe items queue */ -void virt_l1_sched_stop() +void virt_l1_sched_stop(struct l1_model_ms *ms) { struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; /* Empty tdma and mframe sched items lists */ - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { + llist_for_each_entry_safe(mi_next, mi_tmp, &ms->state.sched.mframe_items, mframe_item_entry) { struct virt_l1_sched_tdma_item *ti_next, *ti_tmp; llist_for_each_entry_safe(ti_next, ti_tmp, &mi_next->tdma_item_list, tdma_item_entry) { @@ -87,14 +74,15 @@ /** * @brief Handle all pending scheduled items for the current frame number. */ -void virt_l1_sched_execute(uint32_t fn) +void virt_l1_sched_execute(struct l1_model_ms *ms, uint32_t fn) { + struct l1_state_ms *l1s = &ms->state; struct virt_l1_sched_mframe_item *mi_next, *mi_tmp; - uint8_t hyperframe_restart = fn < last_exec_fn; + uint8_t hyperframe_restart = fn < l1s->sched.last_exec_fn; - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { + llist_for_each_entry_safe(mi_next, mi_tmp, &l1s->sched.mframe_items, mframe_item_entry) { /* execute all registered handler for current mf sched item */ - uint8_t exec_now = mi_next->fn <= fn || (hyperframe_restart && mi_next->fn > last_exec_fn); + uint8_t exec_now = mi_next->fn <= fn || (hyperframe_restart && mi_next->fn > l1s->sched.last_exec_fn); /* break loop, as we have an ordered list in case the hyperframe had not been reset */ uint8_t break_now = mi_next->fn > fn && !hyperframe_restart; @@ -106,7 +94,7 @@ /* exec tdma sched item's handler callback */ /* TODO: we do not have a TDMA scheduler currently and execute * all scheduled tdma items here at once */ - ti_next->handler_cb(mi_next->fn, ti_next->msg); + ti_next->handler_cb(ms, mi_next->fn, ti_next->msg); /* remove handled tdma sched item */ llist_del(&ti_next->tdma_item_entry); } @@ -118,19 +106,19 @@ if (break_now) break; } - last_exec_fn = fn; + l1s->sched.last_exec_fn = fn; } /** * @brief Schedule a msg to the given framenumber and timeslot. */ -void virt_l1_sched_schedule(struct msgb * msg, uint32_t fn, uint8_t ts, - virt_l1_sched_cb * handler_cb) +void virt_l1_sched_schedule(struct l1_model_ms *ms, struct msgb *msg, uint32_t fn, uint8_t ts, + virt_l1_sched_cb *handler_cb) { struct virt_l1_sched_mframe_item *mi_next = NULL, *mi_tmp = NULL, *mi_fn = NULL; struct virt_l1_sched_tdma_item *ti_new = NULL; - llist_for_each_entry_safe(mi_next, mi_tmp, &mframe_item_list, mframe_item_entry) { + llist_for_each_entry_safe(mi_next, mi_tmp, &ms->state.sched.mframe_items, mframe_item_entry) { if (mi_next->fn == fn) { mi_fn = mi_next; break; diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 72c58b7..4b07ca6 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -1,7 +1,7 @@ /* Layer 1 normal data burst uplink handling and scheduling */ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -38,19 +38,16 @@ #include -static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); - /** * @brief Handler callback function for DATA request. * * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_data_conf(fn, 0, l1_model_ms->state.serving_cell.arfcn); + gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + l1ctl_tx_data_conf(ms, fn, 0, ms->state.serving_cell.arfcn); } /** @@ -64,13 +61,13 @@ * * TODO: Check if a msg on FACCH needs special handling. */ -void l1ctl_rx_data_req(struct msgb *msg) +void l1ctl_rx_data_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; struct l1ctl_data_ind *data_ind = (struct l1ctl_data_ind *)ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state.current_time, + uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); @@ -81,10 +78,10 @@ msg->l2h = data_ind->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(ms, msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } -void l1ctl_tx_data_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, +void l1ctl_tx_data_ind(struct l1_model_ms *ms, struct msgb *msg, uint16_t arfcn, uint8_t link_id, uint8_t chan_nr, uint32_t fn, uint8_t snr, uint8_t signal_dbm, uint8_t num_biterr, uint8_t fire_crc) { @@ -111,7 +108,7 @@ memcpy(l1di->data, msgb_data(msg), msgb_length(msg)); DEBUGP(DL1C, "Sending signaling-data to l23.\n"); - l1ctl_sap_tx_to_l23(l1ctl_msg); + l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } /** @@ -122,20 +119,10 @@ * @param [in] arfcn arfcn of the cell the message was send on * */ -void l1ctl_tx_data_conf(uint32_t fn, uint16_t snr, uint16_t arfcn) +void l1ctl_tx_data_conf(struct l1_model_ms *ms, uint32_t fn, uint16_t snr, uint16_t arfcn) { struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_DATA_CONF, fn, snr, arfcn); /* send confirm to layer23 */ - l1ctl_sap_tx_to_l23(l1ctl_msg); -} - -/** - * @brief Initialize virtual prim data. - * - * @param [in] model the l1 model instance - */ -void prim_data_init(struct l1_model_ms *model) -{ - l1_model_ms = model; + l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virt_prim_fbsb.c b/src/host/virt_phy/src/virt_prim_fbsb.c index 7f99821..59fda35 100644 --- a/src/host/virt_phy/src/virt_prim_fbsb.c +++ b/src/host/virt_phy/src/virt_prim_fbsb.c @@ -1,6 +1,6 @@ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -35,7 +35,6 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; static uint16_t sync_count = 0; /** @@ -52,9 +51,9 @@ * Note: virt bts does not broadcast freq and sync bursts. * */ -void l1ctl_rx_fbsb_req(struct msgb *msg) +void l1ctl_rx_fbsb_req(struct l1_model_ms *ms, struct msgb *msg) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_fbsb_req *sync_req = (struct l1ctl_fbsb_req *) l1h->data; @@ -70,22 +69,21 @@ * * Note: for virtual layer 1 this can be a random downlink message, as we can parse the fn from the gsmtap header. */ -void prim_fbsb_sync(struct msgb *msg) +void prim_fbsb_sync(struct l1_model_ms *ms, struct msgb *msg) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; struct gsmtap_hdr *gh = msgb_l1(msg); uint32_t fn = ntohl(gh->frame_number); /* frame number of the rcv msg */ uint16_t arfcn = ntohs(gh->arfcn); /* arfcn of the received msg */ /* ignore messages from other arfcns as the one requested to sync to by l23 */ if (l1s->fbsb.arfcn != arfcn) { - talloc_free(msg); /* cancel sync if we did not receive a msg on dl from * the requested arfcn that we can sync to */ if (sync_count++ > 20) { sync_count = 0; l1s->state = MS_STATE_IDLE_SEARCHING; - l1ctl_tx_fbsb_conf(1, (l1s->fbsb.arfcn)); + l1ctl_tx_fbsb_conf(ms, 1, (l1s->fbsb.arfcn)); } return; } @@ -98,9 +96,8 @@ /* Update current gsm time each time we receive a message on the virt um */ gsm_fn2gsmtime(&l1s->downlink_time, fn); /* Restart scheduler */ - virt_l1_sched_restart(l1s->downlink_time); - talloc_free(msg); - l1ctl_tx_fbsb_conf(0, arfcn); + virt_l1_sched_restart(ms, l1s->downlink_time); + l1ctl_tx_fbsb_conf(ms, 0, arfcn); } /** @@ -113,7 +110,7 @@ * * No calculation needed for virtual pyh -> uses dummy values for a good link quality. */ -void l1ctl_tx_fbsb_conf(uint8_t res, uint16_t arfcn) +void l1ctl_tx_fbsb_conf(struct l1_model_ms *ms, uint8_t res, uint16_t arfcn) { struct msgb *msg; struct l1ctl_fbsb_conf *resp; @@ -131,14 +128,5 @@ DEBUGP(DL1C, "Sending to l23 - %s (res: %u)\n", getL1ctlPrimName(L1CTL_FBSB_CONF), res); - l1ctl_sap_tx_to_l23(msg); -} -/** - * @brief Initialize virtual prim pm. - * - * @param [in] model the l1 model instance - */ -void prim_fbsb_init(struct l1_model_ms *model) -{ - l1_model_ms = model; + l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_pm.c b/src/host/virt_phy/src/virt_prim_pm.c index 6335c61..96b7f07 100644 --- a/src/host/virt_phy/src/virt_prim_pm.c +++ b/src/host/virt_phy/src/virt_prim_pm.c @@ -1,6 +1,6 @@ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -35,8 +35,6 @@ #include #include -static struct l1_model_ms *l1_model_ms = NULL; - /** * @brief Change the signal strength for a given arfcn. * @@ -45,9 +43,9 @@ * @param [in] arfcn to change sig str for. * @param [in] sig_lev the measured signal level value. */ -uint16_t prim_pm_set_sig_strength(uint16_t arfcn, int16_t sig_lev) +uint16_t prim_pm_set_sig_strength(struct l1_model_ms *ms, uint16_t arfcn, int16_t sig_lev) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; if (l1s->pm.timeout_s > 0 || l1s->pm.timeout_us > 0) { osmo_timer_schedule(&l1s->pm.meas.arfcn_sig_lev_timers[arfcn], @@ -81,9 +79,9 @@ * Note: This should only be called after a certain time so some * messages have already been received. */ -void l1ctl_rx_pm_req(struct msgb *msg) +void l1ctl_rx_pm_req(struct l1_model_ms *ms, struct msgb *msg) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_pm_req *pm_req = (struct l1ctl_pm_req *) l1h->data; struct msgb *resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); @@ -110,13 +108,13 @@ } /* no more space to hold mor pm info in msgb, flush to l23 */ if (msgb_tailroom(resp_msg) < sizeof(*pm_conf)) { - l1ctl_sap_tx_to_l23(resp_msg); + l1ctl_sap_tx_to_l23_inst(ms, resp_msg); resp_msg = l1ctl_msgb_alloc(L1CTL_PM_CONF); } } /* transmit the remaining part of pm response to l23 */ if (resp_msg) - l1ctl_sap_tx_to_l23(resp_msg); + l1ctl_sap_tx_to_l23_inst(ms, resp_msg); } /** @@ -129,7 +127,6 @@ struct l1_state_ms *l1s = &model->state; int i; - l1_model_ms = model; /* init the signal level of all arfcns with the lowest value possible */ memset(l1s->pm.meas.arfcn_sig_lev_dbm, MIN_SIG_LEV_DBM, sizeof (int16_t) * 1024); /* init timers */ diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index bff777d..88e8206 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -1,7 +1,7 @@ /* Layer 1 Random Access Channel Burst */ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -38,9 +38,6 @@ #include -static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); - /* use if we have a combined uplink (RACH, SDCCH, ...) (see * http://www.rfwireless-world.com/Terminology/GSM-combined-channel-configuration.html) * if we have no combined channel config, uplink consists of only RACH * */ @@ -59,10 +56,10 @@ * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb *msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg) { - gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_rach_conf(fn, l1_model_ms->state.serving_cell.arfcn); + gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + l1ctl_tx_rach_conf(ms, fn, ms->state.serving_cell.arfcn); } /** @@ -75,9 +72,9 @@ * Transmit RACH request on RACH. Refer to 04.08 - 9.1.8 - Channel request. * */ -void l1ctl_rx_rach_req(struct msgb *msg) +void l1ctl_rx_rach_req(struct l1_model_ms *ms, struct msgb *msg) { - struct l1_state_ms *l1s = &l1_model_ms->state; + struct l1_state_ms *l1s = &ms->state; struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload; @@ -111,7 +108,7 @@ } else fn_sched = l1s->current_time.fn + offset; - virt_l1_sched_schedule(msg, fn_sched, ts, &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(ms, msg, fn_sched, ts, &virt_l1_sched_handler_cb); } /** @@ -122,21 +119,11 @@ * @param [in] fn the fn on which the rach was sent * @param [in] arfcn arfcn on which the rach was sent */ -void l1ctl_tx_rach_conf(uint32_t fn, uint16_t arfcn) +void l1ctl_tx_rach_conf(struct l1_model_ms *ms, uint32_t fn, uint16_t arfcn) { - struct msgb * msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); + struct msgb *msg = l1ctl_create_l2_msg(L1CTL_RACH_CONF, fn, 0, arfcn); DEBUGP(DL1C, "Sending to l23 - %s (fn: %u, arfcn: %u)\n", getL1ctlPrimName(L1CTL_RACH_CONF), fn, arfcn); - l1ctl_sap_tx_to_l23(msg); -} - -/** - * @brief Initialize virtual prim rach. - * - * @param [in] model the l1 model instance - */ -void prim_rach_init(struct l1_model_ms *model) -{ - l1_model_ms = model; + l1ctl_sap_tx_to_l23_inst(ms, msg); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index acfd493..9e87db9 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -1,7 +1,7 @@ /* Layer 1 normal data burst tx handling */ /* (C) 2010 by Dieter Spaar - * (C) 2010 by Harald Welte + * (C) 2010,2017 by Harald Welte * (C) 2016 by Sebastian Stumpf * * All Rights Reserved @@ -38,19 +38,16 @@ #include -static struct l1_model_ms *l1_model_ms = NULL; -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg); - /** * @brief Handler callback function for TRAFFIC request. * * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um(fn, msg); - l1ctl_tx_traffic_conf(fn, 0, l1_model_ms->state.serving_cell.arfcn); + gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + l1ctl_tx_traffic_conf(ms, fn, 0, ms->state.serving_cell.arfcn); } /** @@ -63,26 +60,25 @@ * Enqueue the message (traffic frame) to the L1 state machine's transmit queue. In virtual layer1 just submit it to the virt um. * */ -void l1ctl_rx_traffic_req(struct msgb *msg) +void l1ctl_rx_traffic_req(struct l1_model_ms *ms, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_traffic_req *tr = (struct l1ctl_traffic_req *) ul->payload; uint8_t rsl_chantype, subslot, timeslot; - uint32_t fn_sched = sched_fn_ul(l1_model_ms->state.current_time, ul->chan_nr, ul->link_id); + uint32_t fn_sched = sched_fn_ul(ms->state.current_time, ul->chan_nr, ul->link_id); rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); DEBUGP(DL1C, "Received and handled from l23 - L1CTL_TRAFFIC_REQ\n"); msg->l2h = tr->data; - virt_l1_sched_schedule(msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); + virt_l1_sched_schedule(ms, msg, fn_sched, timeslot, &virt_l1_sched_handler_cb); } -void l1ctl_tx_traffic_ind(struct msgb *msg, uint16_t arfcn, uint8_t link_id, - uint8_t chan_nr, uint32_t fn, uint8_t snr, - uint8_t signal_dbm, uint8_t num_biterr, - uint8_t fire_crc) +void l1ctl_tx_traffic_ind(struct l1_model_ms *ms, struct msgb *msg, uint16_t arfcn, uint8_t link_id, + uint8_t chan_nr, uint32_t fn, uint8_t snr, uint8_t signal_dbm, + uint8_t num_biterr, uint8_t fire_crc) { struct msgb *l1ctl_msg = NULL; struct l1ctl_traffic_ind * l1ti; @@ -107,7 +103,7 @@ memcpy(l1ti->data, msgb_data(msg), msgb_length(msg)); DEBUGP(DL1C, "Sending to l23 - L1CTL_TRAFFIC_IND\n"); - l1ctl_sap_tx_to_l23(l1ctl_msg); + l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } /** @@ -118,20 +114,10 @@ * @param [in] arfcn arfcn of the cell the message was send on * */ -void l1ctl_tx_traffic_conf(uint32_t fn, uint16_t snr, uint16_t arfcn) +void l1ctl_tx_traffic_conf(struct l1_model_ms *ms, uint32_t fn, uint16_t snr, uint16_t arfcn) { struct msgb * l1ctl_msg; l1ctl_msg = l1ctl_create_l2_msg(L1CTL_TRAFFIC_CONF, fn, snr, arfcn); /* send confirm to layer23 */ - l1ctl_sap_tx_to_l23(l1ctl_msg); -} - -/** - * @brief Initialize virtual prim traffic. - * - * @param [in] model the l1 model instance - */ -void prim_traffic_init(struct l1_model_ms *model) -{ - l1_model_ms = model; + l1ctl_sap_tx_to_l23_inst(ms, l1ctl_msg); } diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 28dd685..c7e11ca 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -1,6 +1,7 @@ /* osmocom includes */ /* (C) 2016 by Sebastian Stumpf + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -27,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +38,17 @@ #include #define DEFAULT_LOG_MASK "DL1C,1:DVIRPHY,1" + +/* this exists once in the program, and contains the state that we + * only keep once: L1CTL server socket, GSMTAP/VirtUM socket */ +struct virtphy_context { + /* L1CTL socket server */ + struct l1ctl_sock_inst *l1ctl_sock; + /* Virtual Um layer based on GSMTAP multicast */ + struct virt_um_inst *virt_um; +}; + +static struct virtphy_context g_vphy; static char *dl_rx_grp = DEFAULT_MS_MCAST_GROUP; static char *ul_tx_grp = DEFAULT_BTS_MCAST_GROUP; @@ -132,31 +145,38 @@ } while ((token = strtok(NULL, ":"))); } +/* create a new l1_model_ms instance when L1CTL socket accept()s new connection */ +static int l1ctl_accept_cb(struct l1ctl_sock_client *lsc) +{ + struct l1_model_ms *ms = l1_model_ms_init(lsc, lsc, g_vphy.virt_um); + + if (!ms) + return -ENOMEM; + + /* apply timeout and arfcn reduction value config to model */ + parse_pm_timeout(ms, pm_timeout); + parse_arfcn_sig_lev_red(ms, arfcn_sig_lev_red_mask); + + lsc->priv = ms; + + return 0; +} + int main(int argc, char *argv[]) { /* init loginfo */ - static struct l1_model_ms *model; - handle_options(argc, argv); ms_log_init(log_mask); LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); - model = l1_model_ms_init(NULL); + g_vphy.virt_um = virt_um_init(NULL, ul_tx_grp, port, dl_rx_grp, port, + gsmtapl1_rx_from_virt_um_inst_cb); - model->vui = virt_um_init(NULL, ul_tx_grp, port, dl_rx_grp, port, - gsmtapl1_rx_from_virt_um_inst_cb); - model->lsi = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, - l1ctl_sock_path); - - gsmtapl1_init(model); - l1ctl_sap_init(model); - virt_l1_sched_init(model); - - /* apply timeout and arfcn reduction value config to model */ - parse_pm_timeout(model, pm_timeout); - parse_arfcn_sig_lev_red(model, arfcn_sig_lev_red_mask); + g_vphy.l1ctl_sock = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, + l1ctl_accept_cb, l1ctl_sock_path); + g_vphy.virt_um->priv = g_vphy.l1ctl_sock; LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready...\n \ @@ -168,7 +188,8 @@ osmo_select_main(0); } - l1_model_ms_destroy(model); + l1ctl_sock_destroy(g_vphy.l1ctl_sock); + virt_um_destroy(g_vphy.virt_um); /* not reached */ return EXIT_FAILURE; -- To view, visit https://gerrit.osmocom.org/3286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibfb2a93f8b45a95215c01368b1a52d92283474e6 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:25:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 19 Jul 2017 12:25:32 +0000 Subject: libosmo-sccp[master]: sccp: enable global addressbook search In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) As I said in person, my humble opinion goes against keeping a second list. I see less bug surface if we simply iterate the ss7 instances' address lists. When each address is in exactly one list (only with its ss7 instance), we don't need to take care to keep the separate lists in sync in potentially numerous places. (I am tempted to accept the patch, but the more I think about it the less I like it) https://gerrit.osmocom.org/#/c/3265/2/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 987: *ss7) (As discussed in person yesterday:) There's a mutability problem with this function, even before this patch: it is possible to inadvertently change an address book entry. The returned address should be const, or we shoul d copy the found address to a destination struct provided by the caller. Also, if I search globally, I want to know which ss7 instance the address was found in. We discussed yesterday that a good function signature would be: struct osmo_ss7_instance *osmo_sccp_addr_by_name(const char *name, struct osmo_sccp_addr *dest) It is then not possible to provide a specific instance to search in, but with the global address namespace we deemed that not necessary / to be added later if needed. If no address was found, a NULL return value can indicate that. Line 1000: * \param[in] ss7 instance (NULL to search global) s/global/in all ss7 instances -- To view, visit https://gerrit.osmocom.org/3265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5acc1e5abc3b3081149a9f476038e4e53d23b763 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:32:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 19 Jul 2017 12:32:42 +0000 Subject: libosmo-sccp[master]: sccp: ensure addressbook entry names are unique In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3292/1/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 1209: } (Hmm, I would have expected to see an API function that adds an address which the vty calls, and to forbid duplicates in that function. But ok, if so far the only way to manage address book entries is the vty command, I can accept it. A separate address management API would have made sense, but no need to add it now, "unfortunately") -- To view, visit https://gerrit.osmocom.org/3292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:39:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 19 Jul 2017 12:39:06 +0000 Subject: libosmo-sccp[master]: sccp: improve sccp-addressbook API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (4 comments) This should rather be two or three separate patches with more meaningful summaries than "improve API". I believe it would make sense to combine the osmo_sccp_addr_by_name part with the 'enable global addressbook search' patch. https://gerrit.osmocom.org/#/c/3293/1/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 982: * \param[in] addr pointer to output the resulting sccp-address; \param[out] I would also welcome the name to contain 'dest', maybe dest_addr to make it more obvious that it's an out-parameter Line 983: * (set to NULL if not interested) (indent this second line to line up with the description?) Line 996: memcpy(addr, &entry->addr, sizeof(*addr)); rather addr = entry->addr; Line 1004: const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr) Is this strictly an improvement of the API? -- To view, visit https://gerrit.osmocom.org/3293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68209dd1b2c0aa94b1894637a22b5cc3a3ff1250 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:41:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 19 Jul 2017 12:41:10 +0000 Subject: libosmo-sccp[master]: cosmetic: fixup comment In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3264/2/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 1198: /* Delete an addressbook entry */ the vty command string already says it all, could just drop the comment entirely. -- To view, visit https://gerrit.osmocom.org/3264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:46:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 19 Jul 2017 12:46:43 +0000 Subject: libosmo-sccp[master]: sccp: enable global addressbook search In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3265/2/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 966: llist_for_each_entry(entry, &sccp_address_book_global, in the vty command to remove an address book entry, we call this function to remove a specific instance's address book entry. It feels a bit shaky that this function could techincally return a different instance's entry; that vty could OSMO_ASSERT(inst) to guard against that case -- but IMHO it's better to have a separate function to search globally: these are already two entirely distinct function bodies separated by an if(). -- To view, visit https://gerrit.osmocom.org/3265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5acc1e5abc3b3081149a9f476038e4e53d23b763 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:51:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:51:51 +0000 Subject: osmocom-bb[master]: VIRT-PHY: We don't do line-breaks inside log statements In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27cba13ee782c53a9b2406319241fc7f4e3db0bd Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 12:51:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:51:53 +0000 Subject: osmocom-bb[master]: VIRT-PHY: enable proper memory leak debugging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73b3cf86eea5f56595c1b045cf0fde8035ff185a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: 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 Jul 19 12:51:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:51:58 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: enable proper memory leak debugging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: enable proper memory leak debugging ...................................................................... VIRT-PHY: enable proper memory leak debugging We make sure that all allocations are tracked back to one talloc root context, and install the usual SIGUSR1 handler to dump the talloc report. This enables us to do interactive debugging for memory leaks while virtphy is running. Change-Id: I73b3cf86eea5f56595c1b045cf0fde8035ff185a --- M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virtphy.c 2 files changed, 26 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index 7d1cdd4..ba8298f 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -127,7 +127,7 @@ } if (!mi_fn) { /* list did not contain mframe item with needed fn */ - mi_fn = talloc_zero(NULL, struct virt_l1_sched_mframe_item); + mi_fn = talloc_zero(ms, struct virt_l1_sched_mframe_item); mi_fn->fn = fn; /* need to manually init the struct content.... no so happy */ mi_fn->tdma_item_list.prev = &mi_fn->tdma_item_list; diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index e0bee72..412b742 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -23,12 +23,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -168,8 +170,29 @@ l1_model_ms_destroy(ms); } +static void *tall_vphy_ctx; + +static void signal_handler(int signum) +{ + LOGP(DMAIN, LOGL_NOTICE, "Signal %d received\n", signum); + + switch (signum) { + case SIGUSR1: + talloc_report_full(tall_vphy_ctx, stderr); + break; + default: + break; + } +} + int main(int argc, char *argv[]) { + tall_vphy_ctx = talloc_named_const(NULL, 1, "root"); + + msgb_talloc_ctx_init(tall_vphy_ctx, 0); + signal(SIGUSR1, &signal_handler); + osmo_init_ignore_signals(); + /* init loginfo */ handle_options(argc, argv); @@ -177,10 +200,10 @@ LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer starting up...\n"); - g_vphy.virt_um = virt_um_init(NULL, ul_tx_grp, port, dl_rx_grp, port, + g_vphy.virt_um = virt_um_init(tall_vphy_ctx, ul_tx_grp, port, dl_rx_grp, port, gsmtapl1_rx_from_virt_um_inst_cb); - g_vphy.l1ctl_sock = l1ctl_sock_init(NULL, l1ctl_sap_rx_from_l23_inst_cb, + g_vphy.l1ctl_sock = l1ctl_sock_init(tall_vphy_ctx, l1ctl_sap_rx_from_l23_inst_cb, l1ctl_accept_cb, l1ctl_close_cb, l1ctl_sock_path); g_vphy.virt_um->priv = g_vphy.l1ctl_sock; -- To view, visit https://gerrit.osmocom.org/3295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73b3cf86eea5f56595c1b045cf0fde8035ff185a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 12:51:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 12:51:58 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: We don't do line-breaks inside log statements In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: We don't do line-breaks inside log statements ...................................................................... VIRT-PHY: We don't do line-breaks inside log statements Change-Id: I27cba13ee782c53a9b2406319241fc7f4e3db0bd --- M src/host/virt_phy/src/virtphy.c 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 23811c2..e0bee72 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -184,9 +184,7 @@ l1ctl_accept_cb, l1ctl_close_cb, l1ctl_sock_path); g_vphy.virt_um->priv = g_vphy.l1ctl_sock; - LOGP(DVIRPHY, LOGL_INFO, - "Virtual physical layer ready...\n \ - Waiting for l23 app on %s", + LOGP(DVIRPHY, LOGL_INFO, "Virtual physical layer ready, waiting for l23 app(s) on %s\n", l1ctl_sock_path); while (1) { -- To view, visit https://gerrit.osmocom.org/3294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I27cba13ee782c53a9b2406319241fc7f4e3db0bd Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:02:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 14:02:47 +0000 Subject: [PATCH] osmo-bts[master]: virt: Don't print NOTICE log message if ARFCN doesn't match Message-ID: Review at https://gerrit.osmocom.org/3296 virt: Don't print NOTICE log message if ARFCN doesn't match In a larger simulated network with multiple BTSs it is normal that one BTS will see GSMTAP frames for an ARFCN that is not an ARFCN used by the local BTS. This is just normal operation. Change-Id: Ic68cace9648ccb17500c94b6ede8814674aa9c29 --- M src/osmo-bts-virtual/l1_if.c 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/3296/1 diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 9212121..3ef8c72 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -102,11 +102,8 @@ /* Generally ignore all msgs that are either not received with the right ARFCN... */ pinst = phy_instance_by_arfcn(plink, arfcn & GSMTAP_ARFCN_MASK); - if (!pinst) { - LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - msg ARFCN=%d not part of BTS\n", - arfcn & GSMTAP_ARFCN_MASK); + if (!pinst) goto nomessage; - } /* switch case with removed ACCH flag */ switch ((gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH) & 0xff) { -- To view, visit https://gerrit.osmocom.org/3296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic68cace9648ccb17500c94b6ede8814674aa9c29 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:02:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 14:02:52 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Report virtual RACH bursts with plausible burst type Message-ID: Review at https://gerrit.osmocom.org/3297 VIRT-PHY: Report virtual RACH bursts with plausible burst type Change-Id: I35b103c512993fc52d4e608f07115a4bb4b21022 --- M src/osmo-bts-virtual/l1_if.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/3297/1 diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 3ef8c72..4fe1ec8 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -119,7 +119,9 @@ l1sap.u.rach_ind.acc_delay = 0; /* probably not used in virt um */ l1sap.u.rach_ind.is_11bit = 0; l1sap.u.rach_ind.fn = fn; - l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_NONE; /* FIXME: what comes here */ + /* we don't rally know which RACH bursrt type the virtual MS is using, as this field is not + * part of information present in the GSMTAP header. So we simply report all of them as 0 */ + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0; break; case GSMTAP_CHANNEL_TCH_F: case GSMTAP_CHANNEL_TCH_H: -- To view, visit https://gerrit.osmocom.org/3297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35b103c512993fc52d4e608f07115a4bb4b21022 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:02:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 14:02:52 +0000 Subject: [PATCH] osmo-bts[master]: scheduler: Fix wrong log subsystem: L1C is L1 *control* not ... Message-ID: Review at https://gerrit.osmocom.org/3298 scheduler: Fix wrong log subsystem: L1C is L1 *control* not user data RTS.ind, DATA.* and TCH.* primitives are L1P, not L1C. Change-Id: I4a32b83225e931ced561fdf457fa962e8ad44bd2 --- M src/common/scheduler.c 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/3298/1 diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 121475a..08603d2 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -282,7 +282,7 @@ l1sap = msgb_l1sap_prim(msg); if (l1sap->oph.operation != PRIM_OP_REQUEST) { wrong_type: - LOGP(DL1C, LOGL_ERROR, "Prim for ts=%u at fn=%u has " + LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has " "wrong type.\n", tn, fn); free_msg: /* unlink and free message */ @@ -305,7 +305,7 @@ goto wrong_type; } if (prim_fn > 100) { - LOGP(DL1C, LOGL_NOTICE, "Prim %u for trx=%u ts=%u at " + LOGP(DL1P, LOGL_NOTICE, "Prim %u for trx=%u ts=%u at " "fn=%u is out of range (100), or channel %s with " "type %s is already disabled. If this happens in " "conjunction with PCU, increase 'rts-advance' by 5." @@ -329,7 +329,7 @@ found_msg: if ((chan_nr ^ (trx_chan_desc[chan].chan_nr | tn)) || ((link_id & 0xc0) ^ trx_chan_desc[chan].link_id)) { - LOGP(DL1C, LOGL_ERROR, "Prim for ts=%u at fn=%u has wrong " + LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has wrong " "chan_nr=%02x link_id=%02x, expecting chan_nr=%02x " "link_id=%02x.\n", tn, fn, chan_nr, link_id, trx_chan_desc[chan].chan_nr | tn, @@ -418,7 +418,7 @@ uint8_t tn = l1sap->u.data.chan_nr & 7; struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); - LOGP(DL1C, LOGL_INFO, "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x " + LOGP(DL1P, LOGL_INFO, "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x " "fn=%u ts=%u trx=%u\n", l1sap->u.data.chan_nr, l1sap->u.data.link_id, l1sap->u.data.fn, tn, l1t->trx->nr); @@ -441,7 +441,7 @@ uint8_t tn = l1sap->u.tch.chan_nr & 7; struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); - LOGP(DL1C, LOGL_INFO, "TCH.req: chan_nr=0x%02x " + LOGP(DL1P, LOGL_INFO, "TCH.req: chan_nr=0x%02x " "fn=%u ts=%u trx=%u\n", l1sap->u.tch.chan_nr, l1sap->u.tch.fn, tn, l1t->trx->nr); @@ -477,12 +477,12 @@ link_id = trx_chan_desc[chan].link_id; if (!chan_nr) { - LOGP(DL1C, LOGL_FATAL, "RTS func for %s with non-existing " + LOGP(DL1P, LOGL_FATAL, "RTS func for %s with non-existing " "chan_nr %d\n", trx_chan_desc[chan].name, chan_nr); return -ENODEV; } - LOGP(DL1C, LOGL_INFO, "PH-RTS.ind: chan=%s chan_nr=0x%02x " + LOGP(DL1P, LOGL_INFO, "PH-RTS.ind: chan=%s chan_nr=0x%02x " "link_id=0x%02x fn=%u ts=%u trx=%u\n", trx_chan_desc[chan].name, chan_nr, link_id, fn, tn, l1t->trx->nr); @@ -514,12 +514,12 @@ link_id = trx_chan_desc[chan].link_id; if (!chan_nr) { - LOGP(DL1C, LOGL_FATAL, "RTS func for %s with non-existing " + LOGP(DL1P, LOGL_FATAL, "RTS func for %s with non-existing " "chan_nr %d\n", trx_chan_desc[chan].name, chan_nr); return -ENODEV; } - LOGP(DL1C, LOGL_INFO, "TCH RTS.ind: chan=%s chan_nr=0x%02x " + LOGP(DL1P, LOGL_INFO, "TCH RTS.ind: chan=%s chan_nr=0x%02x " "fn=%u ts=%u trx=%u\n", trx_chan_desc[chan].name, chan_nr, fn, tn, l1t->trx->nr); -- To view, visit https://gerrit.osmocom.org/3298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a32b83225e931ced561fdf457fa962e8ad44bd2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:17:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 14:17:12 +0000 Subject: osmo-bts[master]: virt: Don't print NOTICE log message if ARFCN doesn't match In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic68cace9648ccb17500c94b6ede8814674aa9c29 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:17:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 14:17:20 +0000 Subject: osmo-bts[master]: VIRT-PHY: Report virtual RACH bursts with plausible burst type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35b103c512993fc52d4e608f07115a4bb4b21022 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:17:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 14:17:34 +0000 Subject: osmo-bts[master]: scheduler: Fix wrong log subsystem: L1C is L1 *control* not ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a32b83225e931ced561fdf457fa962e8ad44bd2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:17:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 14:17:35 +0000 Subject: [MERGED] osmo-bts[master]: scheduler: Fix wrong log subsystem: L1C is L1 *control* not ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: scheduler: Fix wrong log subsystem: L1C is L1 *control* not user data ...................................................................... scheduler: Fix wrong log subsystem: L1C is L1 *control* not user data RTS.ind, DATA.* and TCH.* primitives are L1P, not L1C. Change-Id: I4a32b83225e931ced561fdf457fa962e8ad44bd2 --- M src/common/scheduler.c 1 file changed, 9 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 121475a..08603d2 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -282,7 +282,7 @@ l1sap = msgb_l1sap_prim(msg); if (l1sap->oph.operation != PRIM_OP_REQUEST) { wrong_type: - LOGP(DL1C, LOGL_ERROR, "Prim for ts=%u at fn=%u has " + LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has " "wrong type.\n", tn, fn); free_msg: /* unlink and free message */ @@ -305,7 +305,7 @@ goto wrong_type; } if (prim_fn > 100) { - LOGP(DL1C, LOGL_NOTICE, "Prim %u for trx=%u ts=%u at " + LOGP(DL1P, LOGL_NOTICE, "Prim %u for trx=%u ts=%u at " "fn=%u is out of range (100), or channel %s with " "type %s is already disabled. If this happens in " "conjunction with PCU, increase 'rts-advance' by 5." @@ -329,7 +329,7 @@ found_msg: if ((chan_nr ^ (trx_chan_desc[chan].chan_nr | tn)) || ((link_id & 0xc0) ^ trx_chan_desc[chan].link_id)) { - LOGP(DL1C, LOGL_ERROR, "Prim for ts=%u at fn=%u has wrong " + LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has wrong " "chan_nr=%02x link_id=%02x, expecting chan_nr=%02x " "link_id=%02x.\n", tn, fn, chan_nr, link_id, trx_chan_desc[chan].chan_nr | tn, @@ -418,7 +418,7 @@ uint8_t tn = l1sap->u.data.chan_nr & 7; struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); - LOGP(DL1C, LOGL_INFO, "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x " + LOGP(DL1P, LOGL_INFO, "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x " "fn=%u ts=%u trx=%u\n", l1sap->u.data.chan_nr, l1sap->u.data.link_id, l1sap->u.data.fn, tn, l1t->trx->nr); @@ -441,7 +441,7 @@ uint8_t tn = l1sap->u.tch.chan_nr & 7; struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); - LOGP(DL1C, LOGL_INFO, "TCH.req: chan_nr=0x%02x " + LOGP(DL1P, LOGL_INFO, "TCH.req: chan_nr=0x%02x " "fn=%u ts=%u trx=%u\n", l1sap->u.tch.chan_nr, l1sap->u.tch.fn, tn, l1t->trx->nr); @@ -477,12 +477,12 @@ link_id = trx_chan_desc[chan].link_id; if (!chan_nr) { - LOGP(DL1C, LOGL_FATAL, "RTS func for %s with non-existing " + LOGP(DL1P, LOGL_FATAL, "RTS func for %s with non-existing " "chan_nr %d\n", trx_chan_desc[chan].name, chan_nr); return -ENODEV; } - LOGP(DL1C, LOGL_INFO, "PH-RTS.ind: chan=%s chan_nr=0x%02x " + LOGP(DL1P, LOGL_INFO, "PH-RTS.ind: chan=%s chan_nr=0x%02x " "link_id=0x%02x fn=%u ts=%u trx=%u\n", trx_chan_desc[chan].name, chan_nr, link_id, fn, tn, l1t->trx->nr); @@ -514,12 +514,12 @@ link_id = trx_chan_desc[chan].link_id; if (!chan_nr) { - LOGP(DL1C, LOGL_FATAL, "RTS func for %s with non-existing " + LOGP(DL1P, LOGL_FATAL, "RTS func for %s with non-existing " "chan_nr %d\n", trx_chan_desc[chan].name, chan_nr); return -ENODEV; } - LOGP(DL1C, LOGL_INFO, "TCH RTS.ind: chan=%s chan_nr=0x%02x " + LOGP(DL1P, LOGL_INFO, "TCH RTS.ind: chan=%s chan_nr=0x%02x " "fn=%u ts=%u trx=%u\n", trx_chan_desc[chan].name, chan_nr, fn, tn, l1t->trx->nr); -- To view, visit https://gerrit.osmocom.org/3298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a32b83225e931ced561fdf457fa962e8ad44bd2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:17:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 14:17:35 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-PHY: Report virtual RACH bursts with plausible burst type In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Report virtual RACH bursts with plausible burst type ...................................................................... VIRT-PHY: Report virtual RACH bursts with plausible burst type Change-Id: I35b103c512993fc52d4e608f07115a4bb4b21022 --- M src/osmo-bts-virtual/l1_if.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 3ef8c72..4fe1ec8 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -119,7 +119,9 @@ l1sap.u.rach_ind.acc_delay = 0; /* probably not used in virt um */ l1sap.u.rach_ind.is_11bit = 0; l1sap.u.rach_ind.fn = fn; - l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_NONE; /* FIXME: what comes here */ + /* we don't rally know which RACH bursrt type the virtual MS is using, as this field is not + * part of information present in the GSMTAP header. So we simply report all of them as 0 */ + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0; break; case GSMTAP_CHANNEL_TCH_F: case GSMTAP_CHANNEL_TCH_H: -- To view, visit https://gerrit.osmocom.org/3297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I35b103c512993fc52d4e608f07115a4bb4b21022 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:17:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 14:17:36 +0000 Subject: [MERGED] osmo-bts[master]: virt: Don't print NOTICE log message if ARFCN doesn't match In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: virt: Don't print NOTICE log message if ARFCN doesn't match ...................................................................... virt: Don't print NOTICE log message if ARFCN doesn't match In a larger simulated network with multiple BTSs it is normal that one BTS will see GSMTAP frames for an ARFCN that is not an ARFCN used by the local BTS. This is just normal operation. Change-Id: Ic68cace9648ccb17500c94b6ede8814674aa9c29 --- M src/osmo-bts-virtual/l1_if.c 1 file changed, 1 insertion(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 9212121..3ef8c72 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -102,11 +102,8 @@ /* Generally ignore all msgs that are either not received with the right ARFCN... */ pinst = phy_instance_by_arfcn(plink, arfcn & GSMTAP_ARFCN_MASK); - if (!pinst) { - LOGP(DL1P, LOGL_NOTICE, "Ignoring incoming msg - msg ARFCN=%d not part of BTS\n", - arfcn & GSMTAP_ARFCN_MASK); + if (!pinst) goto nomessage; - } /* switch case with removed ACCH flag */ switch ((gsmtap_chantype & ~GSMTAP_CHANNEL_ACCH) & 0xff) { -- To view, visit https://gerrit.osmocom.org/3296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic68cace9648ccb17500c94b6ede8814674aa9c29 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:30:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 19 Jul 2017 14:30:51 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: osmux-reference: Use packetdiag to draw packet header struct... Message-ID: Review at https://gerrit.osmocom.org/3299 osmux-reference: Use packetdiag to draw packet header structures Change-Id: Id75152278f41d56b7bd2e652b9947e33d6523c64 --- M OsmoBSC/Makefile M OsmoBSC/osmux-reference.adoc 2 files changed, 50 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/99/3299/1 diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 93c7b81..35f50da 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -33,6 +33,9 @@ -rm aoip-mgw-options*.png -rm aoip-mgw-options*.svg -rm aoip-mgw-options*.check + -rm osmux-reference__*.svg + -rm osmux-reference__*.png + -rm osmux-reference__*.check gen-bsc-vty-docbook: FORCE $(call command,xsltproc -o generated/combined1.xml \ diff --git a/OsmoBSC/osmux-reference.adoc b/OsmoBSC/osmux-reference.adoc index 068bc19..b2767f3 100644 --- a/OsmoBSC/osmux-reference.adoc +++ b/OsmoBSC/osmux-reference.adoc @@ -144,14 +144,22 @@ === LAPD Signalling (0) - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -|X|FT |X X X X X| PL-LENGTH | LAPD header + payload | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +[packetdiag] +---- +{ + colwidth = 32 + node_height = 40 + + 0: - + 1-2: FT + 3-7: ---- + 8-15: PL-LENGTH + 16-31: LAPD header + payload +} +---- Field Type (FT): 2 bits:: -The Field Type allocated for AMR codec is "0". +The Field Type allocated for LAPD Signalling is "0". This frame type is not yet supported inside OsmoCom and may be subject to change in future versions of the protocol. @@ -162,11 +170,23 @@ This OSmux packet header is used to transport one or more RTP-AMR packets for a specific RTP stream identified by the Circuit ID field. - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -|M|FT | CTR |F|Q| Red. TS/SeqNR | Circuit ID |AMR FT |AMR CMR| -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +[packetdiag] +---- +{ + colwidth = 32 + node_height = 40 + + 0: M + 1-2: FT + 3-5: CTR + 6: F + 7: Q + 8-15: Red. TS/SeqNR + 16-23: Circuit ID + 24-27: AMR FT + 28-31: AMR CMR +} +---- Marker (M): 1 bit:: This is a 1:1 mapping from the RTP Marker (M) bit as specified in RFC3550 @@ -246,11 +266,22 @@ When opening a connection, the peer is expected to send dummy packets until it starts sending real audio, at which point dummy packets are not needed anymore. - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -|X|FT | CTR |X X|X X X X X X X X X| Circuit ID |AMR FT |X X X X| -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +[packetdiag] +---- +{ + colwidth = 32 + node_height = 40 + + 0: - + 1-2: FT + 3-5: CTR + 6-7: -- + 8-15: ---- + 16-23: Circuit ID + 24-27: AMR FT + 28-31: ---- +} +---- Field Type (FT): 2 bits:: The Field Type allocated for AMR codec is "2". -- To view, visit https://gerrit.osmocom.org/3299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id75152278f41d56b7bd2e652b9947e33d6523c64 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:30:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 19 Jul 2017 14:30:51 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: osmux-reference: Add sequence charts Message-ID: Review at https://gerrit.osmocom.org/3300 osmux-reference: Add sequence charts Change-Id: Ic2c63e4d9e67b877dc06a206ec7f07d0704329a5 --- M OsmoBSC/osmux-reference.adoc 1 file changed, 189 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/00/3300/1 diff --git a/OsmoBSC/osmux-reference.adoc b/OsmoBSC/osmux-reference.adoc index b2767f3..0f66118 100644 --- a/OsmoBSC/osmux-reference.adoc +++ b/OsmoBSC/osmux-reference.adoc @@ -307,6 +307,195 @@ * On receival of this kind of OSmux frame, it's usually enough for the reader to discard the header plus the calculated padding and keep operating. +== Sequence Charts + +=== Trunking + +Following chart shows how trunking works for 3 concurrent calls from different +MS on a given BTS. In this case only uplink data is shown, but downlink follows +the same idea. Batching factor is set to 1 to easily illustrate trunking mechanism. + +It can be seen how 3 RTP packets from 3 different Ms (a, b, and c) arrive to the +BSC from the BTS. The BSC generates 3 OSmux frames and stores and sends them +together in one UDP packet to the BSC-NAT. The BSC-NAT decodes the three OSmux +frames, identifies each of them through CID values and transform them back to +RTP before sending them to the MGW. + +["mscgen"] +---- +msc { + hscale = 2; + bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"]; + + ...; + --- [label="3 Regular RTP-AMR calls using OSmux (has been ongoing for some time)"]; + + bts => bsc [label="RTP-AMR[seq=y,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=z,ssrc=MSc]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(y)],Osmux[ft=2,cid=i+1,seq=n,AMR(x)],Osmux[ft=2,cid=i+2,seq=l,AMR(z)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=y,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p,ssrc=s] (originally seq=x,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=q,ssrc=t] (originally seq=z,ssrc=MSc)"]; + bts => bsc [label="RTP-AMR[seq=y+1,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=z+1,ssrc=MSc]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(y+1)],Osmux[ft=2,cid=i+1,seq=n+1,AMR(x+1)],Osmux[ft=2,cid=i+2,seq=l+1,AMR(z+1)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=y+1,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+1,ssrc=s] (originally seq=x+1,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=q+1,ssrc=t] (originally seq=z+1,ssrc=MSc)"]; + bts => bsc [label="RTP-AMR[seq=y+2,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=z+2,ssrc=MSc]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+2,AMR(y+2)],Osmux[ft=2,cid=i+1,seq=n+2,AMR(x+2)],Osmux[ft=2,cid=i+2,seq=l+2,AMR(z+2)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=y+2,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+2,ssrc=s] (originally seq=x+2,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=q+2,ssrc=t] (originally seq=z+2,ssrc=MSc)"]; +} +---- + +=== Batching + +Following chart shows how batching with a factor of 3 works. To easilly +illustrate batching, only uplink and one concurrent call is considered. + +It can be seen how 3 RTP packets from MSa arrive to the BSC from the BTS. The +BSC queues the 3 RTP packets and once the batchfactor is reached, an OSmux frame +is generated and sent to the BSC-NAT. The BSC-NAT decodes the OSmux frames, +transforms each AMR payload into an RTP packet and each RTP packet is scheduled +for delivery according to expected proportional time delay (and timestamp field +is set accordingly). + +["mscgen"] +---- +msc { + hscale = 2; + bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"]; + + ...; + --- [label="Regular RTP-AMR call using OSmux with batch factor 3 (has been ongoing for some time)"]; + + bts => bsc [label="RTP-AMR[seq=x,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSa]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(x),AMR(x+1),AMR(x+2)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=x,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=x+1,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=x+2,ssrc=MSa)"]; + bts => bsc [label="RTP-AMR[seq=x+3,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+4,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+5,ssrc=MSa]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(x+3),AMR(x+4),AMR(x+5)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+3,ssrc=r] (originally seq=x+3,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+4,ssrc=r] (originally seq=x+4,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+5,ssrc=r] (originally seq=x+5,ssrc=MSa)"]; + bts => bsc [label="RTP-AMR[seq=x+6,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+7,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+8,ssrc=MSa]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+2,AMR(x+6),AMR(x+7),AMR(x+8)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+6,ssrc=r] (originally seq=x+6,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+7,ssrc=r] (originally seq=x+7,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+8,ssrc=r] (originally seq=x+8,ssrc=MSa)"]; +} +---- + +=== Trunking and Batching + +Following chart shows how trunking and batching work together. The chart shows 2 +concurrent calls from different MS on a given BTS, and BSC is configured with a +batch factor of 3. Again only uplink data is shown, but downlink follows the +same idea. Batching factor is set to 1 to easily illustrate trunking mechanism. + +["mscgen"] +---- +msc { + hscale = 2; + bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"]; + + ...; + --- [label="2 Regular RTP-AMR call using OSmux with batch factor 3 (has been ongoing for some time)"]; + + bts => bsc [label="RTP-AMR[seq=x,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+1,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+2,ssrc=MSb]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(x),AMR(x+1),AMR(x+2)],Osmux[ft=2,cid=i+1,seq=n,AMR(y),AMR(y+1),AMR(y+2)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=x,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p,ssrc=s] (originally seq=y,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=x+1,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+1,ssrc=s] (originally seq=y+1,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=x+2,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+2,ssrc=s] (originally seq=y+2,ssrc=MSb)"]; + bts => bsc [label="RTP-AMR[seq=x+3,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+3,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+4,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+4,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+5,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+5,ssrc=MSb]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(x+3),AMR(x+4),AMR(x+5)],Osmux[ft=2,cid=i+1,seq=n+1,AMR(y+3),AMR(y+4),AMR(y+5)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+3,ssrc=r] (originally seq=x+3,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+3,ssrc=s] (originally seq=y+3,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+4,ssrc=r] (originally seq=x+4,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+4,ssrc=s] (originally seq=y+4,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+5,ssrc=r] (originally seq=x+5,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+5,ssrc=s] (originally seq=y+5,ssrc=MSb)"]; +} +---- + +=== Marker bit + +As described earlier, the Marker bit is always expected to relate to the first +AMR payload of an OSmux frame. Thus, special considerations may be followed when +the OSmux encoder receives an RTP packet with a marker bit. For instance, +previously enqueued RTP packets may be sent even if the configured batch factor +is not reached. + +We again use the scenario with 2 concurrent calls and a batch factor of 3. + +["mscgen"] +---- +msc { + hscale = 2; + bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"]; + + ...; + --- [label="2 Regular RTP-AMR call using OSmux with batch factor 3 (has been ongoing for some time)"]; + + bts => bsc [label="RTP-AMR[seq=x,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+1,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+2,ssrc=MSb]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(x),AMR(x+1),AMR(x+2)],Osmux[ft=2,cid=i+1,seq=n,AMR(y),AMR(y+1),AMR(y+2)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=x,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p,ssrc=r] (originally seq=y,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=x+1,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+1,ssrc=s] (originally seq=y+1,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=x+2,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+2,ssrc=s] (originally seq=y+2,ssrc=MSb)"]; + bts => bsc [label="RTP-AMR[seq=x+3,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+3,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+4,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+4,ssrc=MSb] with Marker bit set M=1"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(x+3),AMR(x+4)],Osmux[ft=2,cid=i+1,seq=n+1,AMR(y+3)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+3,ssrc=r] (originally seq=x+3,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+3,ssrc=s] (originally seq=y+3,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+4,ssrc=r] (originally seq=x+4,ssrc=MSa)"]; + bts => bsc [label="RTP-AMR[seq=x+5,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+5,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+6,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+6,ssrc=MSb]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+2,AMR(x+5),AMR(x+6)],Osmux[ft=2,cid=i+1,seq=n+2,AMR(y+4),AMR(y+5),AMR(y+6)]]"]; + bscnat => mgw [label="RTP-AMR[seq=p+4,ssrc=s] (originally seq=y+4,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+5,ssrc=r] (originally seq=x+5,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+5,ssrc=s] (originally seq=y+5,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+6,ssrc=r] (originally seq=x+6,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+6,ssrc=s] (originally seq=y+6,ssrc=MSb)"]; +} +---- == Evaluation: Expected traffic savings -- To view, visit https://gerrit.osmocom.org/3300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2c63e4d9e67b877dc06a206ec7f07d0704329a5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:30:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 19 Jul 2017 14:30:51 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: osmux-reference: Add traffic saving plot Message-ID: Review at https://gerrit.osmocom.org/3301 osmux-reference: Add traffic saving plot Change-Id: I8fa60c1f95436c39fd1ff9424a907876d367484e --- M INSTALL.txt M OsmoBSC/osmux-reference.adoc M build/Makefile.asciidoc.inc A build/python2-filter.conf 4 files changed, 80 insertions(+), 82 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/01/3301/1 diff --git a/INSTALL.txt b/INSTALL.txt index 6f19720..39653d3 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -6,7 +6,8 @@ xsltproc \ dblatex \ mscgen \ - graphviz + graphviz \ + python-pychart Build PDFs, run: make diff --git a/OsmoBSC/osmux-reference.adoc b/OsmoBSC/osmux-reference.adoc index 0f66118..4d03a4b 100644 --- a/OsmoBSC/osmux-reference.adoc +++ b/OsmoBSC/osmux-reference.adoc @@ -499,91 +499,67 @@ == Evaluation: Expected traffic savings -The following figure shows the traffic saving (in %) depending on the number -of concurrent numbers of callings (asumming trunking but no batching at all): +The following figure shows the growth in traffic saving (in %) depending on the +number of concurrent numbers of callings for a given set of batching factor +values: + +["python2"] ---- - Traffic savings (%) - 100 ++-------+-------+--------+--------+-------+--------+-------+-------++ - + + + + + + batch factor 1 **E*** + - | | - 80 ++ ++ - | | - | | - | ****E********E - 60 ++ ****E*******E********E*** ++ - | **E**** | - | **** | - 40 ++ *E** ++ - | ** | - | ** | - | ** | - 20 ++ E ++ - | | - + + + + + + + + + - 0 ++-------+-------+--------+--------+-------+--------+-------+-------++ - 0 1 2 3 4 5 6 7 8 - Concurrent calls +from pychart import * +theme.get_options() +theme.scale_factor = 5 +theme.use_color = 1 +theme.reinitialize() + +IP_HEADER=20 +UDP_HEADER=8 +RTP_HEADER=12 +OSMUX_HEADER=4 +AMR59_PAYLOAD=17 + +def osmux_get_size(calls, payloads): + return IP_HEADER + UDP_HEADER + (OSMUX_HEADER + AMR59_PAYLOAD * payloads) * calls + +def rtp_get_size(calls, payloads): + return calls * payloads * (IP_HEADER + UDP_HEADER + RTP_HEADER + AMR59_PAYLOAD) + +def calc_traffic_saving(calls, payloads): + return 100 - 100.0 * osmux_get_size(calls, payloads) / rtp_get_size(calls, payloads) + +# The first value in each tuple is the X value, and subsequent values are Y values for different lines. +def gen_table(): + data = [] + for calls in range(1, 9): + col = (calls,) + for factor in range(1, 9): + col += (calc_traffic_saving(calls, factor),) + data.append(col) + return data + +def do_plot(data): + xaxis = axis.X(format="/hL%d", tic_interval = 1, label="Concurrent calls") + yaxis = axis.Y(format="%d%%", tic_interval = 10, label="Traffic Saving") + ar = area.T(x_axis=xaxis, y_axis=yaxis, y_range=(None,None), x_grid_interval=1, x_grid_style=line_style.gray70_dash3) + for y in range(1, len(data[0])): + plot = line_plot.T(label="bfactor "+str(y), data=data, ycol=y, tick_mark=tick_mark.circle1) + ar.add_plot(plot) + ar.draw() + +data = gen_table() +do_plot(data) ---- -The results shows a saving of 15.79% with only one concurrent call, that -quickly improves with more concurrent calls (due to trunking). +The results show a saving of 15.79% with only one concurrent call and with +batching disabled (bfactor 1), that quickly improves with more concurrent calls +(due to trunking). -We also provide the expected results by batching 4 messages for a single call: ----- - Traffic savings (%) - 100 ++-------+-------+--------+--------+-------+--------+-------+-------++ - + + + + + + batch factor 4 **E*** + - | | - 80 ++ ++ - | | - | | - | ****E********E*******E********E*******E********E - 60 ++ ****E**** ++ - | E*** | - | | - 40 ++ ++ - | | - | | - | | - 20 ++ ++ - | | - + + + + + + + + + - 0 ++-------+-------+--------+--------+-------+--------+-------+-------++ - 0 1 2 3 4 5 6 7 8 - Concurrent calls ----- +By increasing the batching of messages to 4, the results show a saving of 56.68% +with only one concurrent call. Trunking slightly improves the situation with +more concurrent calls. -The results show a saving of 56.68% with only one concurrent call. Trunking -slightly improves the situation with more concurrent calls. - -We also provide the figure with batching factor of 8: ----- - Traffic savings (%) - 100 ++-------+-------+--------+--------+-------+--------+-------+-------++ - + + + + + + batch factor 8 **E*** + - | | - 80 ++ ++ - | | - | ****E*******E********E - | ****E********E********E*******E**** | - 60 ++ E*** ++ - | | - | | - 40 ++ ++ - | | - | | - | | - 20 ++ ++ - | | - + + + + + + + + + - 0 ++-------+-------+--------+--------+-------+--------+-------+-------++ - 0 1 2 3 4 5 6 7 8 - Concurrent calls ----- - -That shows very little improvement with regards to batching 4 messages. -Still, we risk to degrade user experience. Thus, we consider a batching factor -of 3 and 4 is adecuate. +A batching factor of 8 provides very little improvement with regards to batching +4 messages. Still, we risk to degrade user experience. Thus, we consider a +batching factor of 3 and 4 is adecuate. == Other proposed follow-up works diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index 56a6ed9..660d72a 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -15,7 +15,7 @@ cleanfiles += $(ASCIIDOCPDFS) -ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf +ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -f $(BUILDDIR)/python2-filter.conf DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 ifeq (,$(BUILD_RELEASE)) diff --git a/build/python2-filter.conf b/build/python2-filter.conf new file mode 100644 index 0000000..ca2ddaf --- /dev/null +++ b/build/python2-filter.conf @@ -0,0 +1,21 @@ +# +# AsciiDoc mscgen filter configuration file. +# + +[python2-filter-style] +python2-style=template="python2-block",subs=(),posattrs=("style","target"),filter='../build/filter-wrapper.py python2 - --output="{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}"' + +[blockdef-listing] +template::[python2-filter-style] + +[paradef-default] +template::[python2-filter-style] + +[python2-block] +template::[filter-image-pngsvg-blockmacro] + +[filter-image-pngsvg-blockmacro] +{target%}{counter2:target-number} +{target%}{set2:target:{docname}__{target-number}.{format={basebackend-docbook!png}{basebackend-docbook?png}}} +| +template::[image-blockmacro] -- To view, visit https://gerrit.osmocom.org/3301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8fa60c1f95436c39fd1ff9424a907876d367484e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 19 14:30:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 19 Jul 2017 14:30:51 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: osmux-reference-docinfo: Add latest changes to revhistory Message-ID: Review at https://gerrit.osmocom.org/3302 osmux-reference-docinfo: Add latest changes to revhistory Change-Id: I01e513a71a3f830d393c57c43678d7e4c8d2d151 --- M OsmoBSC/osmux-reference-docinfo.xml 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/02/3302/1 diff --git a/OsmoBSC/osmux-reference-docinfo.xml b/OsmoBSC/osmux-reference-docinfo.xml index 06b2d7e..7e31ec7 100644 --- a/OsmoBSC/osmux-reference-docinfo.xml +++ b/OsmoBSC/osmux-reference-docinfo.xml @@ -28,6 +28,14 @@ Update frame bits according to implementation. + + 0.4 + 19 July 2017 + Pau Espin Pedrol + + Add sequence charts, generate packet header structure with packetdiag, generate traffic saving plot with pychart. + + -- To view, visit https://gerrit.osmocom.org/3302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I01e513a71a3f830d393c57c43678d7e4c8d2d151 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 19 16:05:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 16:05:01 +0000 Subject: osmo-gsm-manuals[master]: osmux-reference: Use packetdiag to draw packet header struct... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id75152278f41d56b7bd2e652b9947e33d6523c64 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 16:05:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 16:05:11 +0000 Subject: osmo-gsm-manuals[master]: osmux-reference: Add sequence charts In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic2c63e4d9e67b877dc06a206ec7f07d0704329a5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 16:05:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 16:05:36 +0000 Subject: osmo-gsm-manuals[master]: osmux-reference: Add traffic saving plot In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fa60c1f95436c39fd1ff9424a907876d367484e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 16:05:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 16:05:44 +0000 Subject: osmo-gsm-manuals[master]: osmux-reference-docinfo: Add latest changes to revhistory In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01e513a71a3f830d393c57c43678d7e4c8d2d151 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 16:05:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 16:05:45 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: osmux-reference-docinfo: Add latest changes to revhistory In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmux-reference-docinfo: Add latest changes to revhistory ...................................................................... osmux-reference-docinfo: Add latest changes to revhistory Change-Id: I01e513a71a3f830d393c57c43678d7e4c8d2d151 --- M OsmoBSC/osmux-reference-docinfo.xml 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBSC/osmux-reference-docinfo.xml b/OsmoBSC/osmux-reference-docinfo.xml index 06b2d7e..7e31ec7 100644 --- a/OsmoBSC/osmux-reference-docinfo.xml +++ b/OsmoBSC/osmux-reference-docinfo.xml @@ -28,6 +28,14 @@ Update frame bits according to implementation. + + 0.4 + 19 July 2017 + Pau Espin Pedrol + + Add sequence charts, generate packet header structure with packetdiag, generate traffic saving plot with pychart. + + -- To view, visit https://gerrit.osmocom.org/3302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I01e513a71a3f830d393c57c43678d7e4c8d2d151 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 16:05:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 16:05:46 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: osmux-reference: Add traffic saving plot In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmux-reference: Add traffic saving plot ...................................................................... osmux-reference: Add traffic saving plot Change-Id: I8fa60c1f95436c39fd1ff9424a907876d367484e --- M INSTALL.txt M OsmoBSC/osmux-reference.adoc M build/Makefile.asciidoc.inc A build/python2-filter.conf 4 files changed, 80 insertions(+), 82 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/INSTALL.txt b/INSTALL.txt index 6f19720..39653d3 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -6,7 +6,8 @@ xsltproc \ dblatex \ mscgen \ - graphviz + graphviz \ + python-pychart Build PDFs, run: make diff --git a/OsmoBSC/osmux-reference.adoc b/OsmoBSC/osmux-reference.adoc index 0f66118..4d03a4b 100644 --- a/OsmoBSC/osmux-reference.adoc +++ b/OsmoBSC/osmux-reference.adoc @@ -499,91 +499,67 @@ == Evaluation: Expected traffic savings -The following figure shows the traffic saving (in %) depending on the number -of concurrent numbers of callings (asumming trunking but no batching at all): +The following figure shows the growth in traffic saving (in %) depending on the +number of concurrent numbers of callings for a given set of batching factor +values: + +["python2"] ---- - Traffic savings (%) - 100 ++-------+-------+--------+--------+-------+--------+-------+-------++ - + + + + + + batch factor 1 **E*** + - | | - 80 ++ ++ - | | - | | - | ****E********E - 60 ++ ****E*******E********E*** ++ - | **E**** | - | **** | - 40 ++ *E** ++ - | ** | - | ** | - | ** | - 20 ++ E ++ - | | - + + + + + + + + + - 0 ++-------+-------+--------+--------+-------+--------+-------+-------++ - 0 1 2 3 4 5 6 7 8 - Concurrent calls +from pychart import * +theme.get_options() +theme.scale_factor = 5 +theme.use_color = 1 +theme.reinitialize() + +IP_HEADER=20 +UDP_HEADER=8 +RTP_HEADER=12 +OSMUX_HEADER=4 +AMR59_PAYLOAD=17 + +def osmux_get_size(calls, payloads): + return IP_HEADER + UDP_HEADER + (OSMUX_HEADER + AMR59_PAYLOAD * payloads) * calls + +def rtp_get_size(calls, payloads): + return calls * payloads * (IP_HEADER + UDP_HEADER + RTP_HEADER + AMR59_PAYLOAD) + +def calc_traffic_saving(calls, payloads): + return 100 - 100.0 * osmux_get_size(calls, payloads) / rtp_get_size(calls, payloads) + +# The first value in each tuple is the X value, and subsequent values are Y values for different lines. +def gen_table(): + data = [] + for calls in range(1, 9): + col = (calls,) + for factor in range(1, 9): + col += (calc_traffic_saving(calls, factor),) + data.append(col) + return data + +def do_plot(data): + xaxis = axis.X(format="/hL%d", tic_interval = 1, label="Concurrent calls") + yaxis = axis.Y(format="%d%%", tic_interval = 10, label="Traffic Saving") + ar = area.T(x_axis=xaxis, y_axis=yaxis, y_range=(None,None), x_grid_interval=1, x_grid_style=line_style.gray70_dash3) + for y in range(1, len(data[0])): + plot = line_plot.T(label="bfactor "+str(y), data=data, ycol=y, tick_mark=tick_mark.circle1) + ar.add_plot(plot) + ar.draw() + +data = gen_table() +do_plot(data) ---- -The results shows a saving of 15.79% with only one concurrent call, that -quickly improves with more concurrent calls (due to trunking). +The results show a saving of 15.79% with only one concurrent call and with +batching disabled (bfactor 1), that quickly improves with more concurrent calls +(due to trunking). -We also provide the expected results by batching 4 messages for a single call: ----- - Traffic savings (%) - 100 ++-------+-------+--------+--------+-------+--------+-------+-------++ - + + + + + + batch factor 4 **E*** + - | | - 80 ++ ++ - | | - | | - | ****E********E*******E********E*******E********E - 60 ++ ****E**** ++ - | E*** | - | | - 40 ++ ++ - | | - | | - | | - 20 ++ ++ - | | - + + + + + + + + + - 0 ++-------+-------+--------+--------+-------+--------+-------+-------++ - 0 1 2 3 4 5 6 7 8 - Concurrent calls ----- +By increasing the batching of messages to 4, the results show a saving of 56.68% +with only one concurrent call. Trunking slightly improves the situation with +more concurrent calls. -The results show a saving of 56.68% with only one concurrent call. Trunking -slightly improves the situation with more concurrent calls. - -We also provide the figure with batching factor of 8: ----- - Traffic savings (%) - 100 ++-------+-------+--------+--------+-------+--------+-------+-------++ - + + + + + + batch factor 8 **E*** + - | | - 80 ++ ++ - | | - | ****E*******E********E - | ****E********E********E*******E**** | - 60 ++ E*** ++ - | | - | | - 40 ++ ++ - | | - | | - | | - 20 ++ ++ - | | - + + + + + + + + + - 0 ++-------+-------+--------+--------+-------+--------+-------+-------++ - 0 1 2 3 4 5 6 7 8 - Concurrent calls ----- - -That shows very little improvement with regards to batching 4 messages. -Still, we risk to degrade user experience. Thus, we consider a batching factor -of 3 and 4 is adecuate. +A batching factor of 8 provides very little improvement with regards to batching +4 messages. Still, we risk to degrade user experience. Thus, we consider a +batching factor of 3 and 4 is adecuate. == Other proposed follow-up works diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index 56a6ed9..660d72a 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -15,7 +15,7 @@ cleanfiles += $(ASCIIDOCPDFS) -ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf +ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -f $(BUILDDIR)/python2-filter.conf DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 ifeq (,$(BUILD_RELEASE)) diff --git a/build/python2-filter.conf b/build/python2-filter.conf new file mode 100644 index 0000000..ca2ddaf --- /dev/null +++ b/build/python2-filter.conf @@ -0,0 +1,21 @@ +# +# AsciiDoc mscgen filter configuration file. +# + +[python2-filter-style] +python2-style=template="python2-block",subs=(),posattrs=("style","target"),filter='../build/filter-wrapper.py python2 - --output="{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}"' + +[blockdef-listing] +template::[python2-filter-style] + +[paradef-default] +template::[python2-filter-style] + +[python2-block] +template::[filter-image-pngsvg-blockmacro] + +[filter-image-pngsvg-blockmacro] +{target%}{counter2:target-number} +{target%}{set2:target:{docname}__{target-number}.{format={basebackend-docbook!png}{basebackend-docbook?png}}} +| +template::[image-blockmacro] -- To view, visit https://gerrit.osmocom.org/3301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8fa60c1f95436c39fd1ff9424a907876d367484e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 16:05:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 16:05:46 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: osmux-reference: Add sequence charts In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmux-reference: Add sequence charts ...................................................................... osmux-reference: Add sequence charts Change-Id: Ic2c63e4d9e67b877dc06a206ec7f07d0704329a5 --- M OsmoBSC/osmux-reference.adoc 1 file changed, 189 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBSC/osmux-reference.adoc b/OsmoBSC/osmux-reference.adoc index b2767f3..0f66118 100644 --- a/OsmoBSC/osmux-reference.adoc +++ b/OsmoBSC/osmux-reference.adoc @@ -307,6 +307,195 @@ * On receival of this kind of OSmux frame, it's usually enough for the reader to discard the header plus the calculated padding and keep operating. +== Sequence Charts + +=== Trunking + +Following chart shows how trunking works for 3 concurrent calls from different +MS on a given BTS. In this case only uplink data is shown, but downlink follows +the same idea. Batching factor is set to 1 to easily illustrate trunking mechanism. + +It can be seen how 3 RTP packets from 3 different Ms (a, b, and c) arrive to the +BSC from the BTS. The BSC generates 3 OSmux frames and stores and sends them +together in one UDP packet to the BSC-NAT. The BSC-NAT decodes the three OSmux +frames, identifies each of them through CID values and transform them back to +RTP before sending them to the MGW. + +["mscgen"] +---- +msc { + hscale = 2; + bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"]; + + ...; + --- [label="3 Regular RTP-AMR calls using OSmux (has been ongoing for some time)"]; + + bts => bsc [label="RTP-AMR[seq=y,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=z,ssrc=MSc]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(y)],Osmux[ft=2,cid=i+1,seq=n,AMR(x)],Osmux[ft=2,cid=i+2,seq=l,AMR(z)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=y,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p,ssrc=s] (originally seq=x,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=q,ssrc=t] (originally seq=z,ssrc=MSc)"]; + bts => bsc [label="RTP-AMR[seq=y+1,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=z+1,ssrc=MSc]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(y+1)],Osmux[ft=2,cid=i+1,seq=n+1,AMR(x+1)],Osmux[ft=2,cid=i+2,seq=l+1,AMR(z+1)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=y+1,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+1,ssrc=s] (originally seq=x+1,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=q+1,ssrc=t] (originally seq=z+1,ssrc=MSc)"]; + bts => bsc [label="RTP-AMR[seq=y+2,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=z+2,ssrc=MSc]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+2,AMR(y+2)],Osmux[ft=2,cid=i+1,seq=n+2,AMR(x+2)],Osmux[ft=2,cid=i+2,seq=l+2,AMR(z+2)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=y+2,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+2,ssrc=s] (originally seq=x+2,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=q+2,ssrc=t] (originally seq=z+2,ssrc=MSc)"]; +} +---- + +=== Batching + +Following chart shows how batching with a factor of 3 works. To easilly +illustrate batching, only uplink and one concurrent call is considered. + +It can be seen how 3 RTP packets from MSa arrive to the BSC from the BTS. The +BSC queues the 3 RTP packets and once the batchfactor is reached, an OSmux frame +is generated and sent to the BSC-NAT. The BSC-NAT decodes the OSmux frames, +transforms each AMR payload into an RTP packet and each RTP packet is scheduled +for delivery according to expected proportional time delay (and timestamp field +is set accordingly). + +["mscgen"] +---- +msc { + hscale = 2; + bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"]; + + ...; + --- [label="Regular RTP-AMR call using OSmux with batch factor 3 (has been ongoing for some time)"]; + + bts => bsc [label="RTP-AMR[seq=x,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSa]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(x),AMR(x+1),AMR(x+2)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=x,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=x+1,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=x+2,ssrc=MSa)"]; + bts => bsc [label="RTP-AMR[seq=x+3,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+4,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+5,ssrc=MSa]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(x+3),AMR(x+4),AMR(x+5)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+3,ssrc=r] (originally seq=x+3,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+4,ssrc=r] (originally seq=x+4,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+5,ssrc=r] (originally seq=x+5,ssrc=MSa)"]; + bts => bsc [label="RTP-AMR[seq=x+6,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+7,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=x+8,ssrc=MSa]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+2,AMR(x+6),AMR(x+7),AMR(x+8)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+6,ssrc=r] (originally seq=x+6,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+7,ssrc=r] (originally seq=x+7,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=o+8,ssrc=r] (originally seq=x+8,ssrc=MSa)"]; +} +---- + +=== Trunking and Batching + +Following chart shows how trunking and batching work together. The chart shows 2 +concurrent calls from different MS on a given BTS, and BSC is configured with a +batch factor of 3. Again only uplink data is shown, but downlink follows the +same idea. Batching factor is set to 1 to easily illustrate trunking mechanism. + +["mscgen"] +---- +msc { + hscale = 2; + bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"]; + + ...; + --- [label="2 Regular RTP-AMR call using OSmux with batch factor 3 (has been ongoing for some time)"]; + + bts => bsc [label="RTP-AMR[seq=x,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+1,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+2,ssrc=MSb]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(x),AMR(x+1),AMR(x+2)],Osmux[ft=2,cid=i+1,seq=n,AMR(y),AMR(y+1),AMR(y+2)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=x,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p,ssrc=s] (originally seq=y,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=x+1,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+1,ssrc=s] (originally seq=y+1,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=x+2,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+2,ssrc=s] (originally seq=y+2,ssrc=MSb)"]; + bts => bsc [label="RTP-AMR[seq=x+3,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+3,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+4,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+4,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+5,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+5,ssrc=MSb]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(x+3),AMR(x+4),AMR(x+5)],Osmux[ft=2,cid=i+1,seq=n+1,AMR(y+3),AMR(y+4),AMR(y+5)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+3,ssrc=r] (originally seq=x+3,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+3,ssrc=s] (originally seq=y+3,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+4,ssrc=r] (originally seq=x+4,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+4,ssrc=s] (originally seq=y+4,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+5,ssrc=r] (originally seq=x+5,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+5,ssrc=s] (originally seq=y+5,ssrc=MSb)"]; +} +---- + +=== Marker bit + +As described earlier, the Marker bit is always expected to relate to the first +AMR payload of an OSmux frame. Thus, special considerations may be followed when +the OSmux encoder receives an RTP packet with a marker bit. For instance, +previously enqueued RTP packets may be sent even if the configured batch factor +is not reached. + +We again use the scenario with 2 concurrent calls and a batch factor of 3. + +["mscgen"] +---- +msc { + hscale = 2; + bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"]; + + ...; + --- [label="2 Regular RTP-AMR call using OSmux with batch factor 3 (has been ongoing for some time)"]; + + bts => bsc [label="RTP-AMR[seq=x,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+1,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+2,ssrc=MSb]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(x),AMR(x+1),AMR(x+2)],Osmux[ft=2,cid=i+1,seq=n,AMR(y),AMR(y+1),AMR(y+2)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=x,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p,ssrc=r] (originally seq=y,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=x+1,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+1,ssrc=s] (originally seq=y+1,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=x+2,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+2,ssrc=s] (originally seq=y+2,ssrc=MSb)"]; + bts => bsc [label="RTP-AMR[seq=x+3,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+3,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+4,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+4,ssrc=MSb] with Marker bit set M=1"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(x+3),AMR(x+4)],Osmux[ft=2,cid=i+1,seq=n+1,AMR(y+3)]]"]; + bscnat => mgw [label="RTP-AMR[seq=o+3,ssrc=r] (originally seq=x+3,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+3,ssrc=s] (originally seq=y+3,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+4,ssrc=r] (originally seq=x+4,ssrc=MSa)"]; + bts => bsc [label="RTP-AMR[seq=x+5,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+5,ssrc=MSb]"]; + bts => bsc [label="RTP-AMR[seq=x+6,ssrc=MSa]"]; + bts => bsc [label="RTP-AMR[seq=y+6,ssrc=MSb]"]; + bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+2,AMR(x+5),AMR(x+6)],Osmux[ft=2,cid=i+1,seq=n+2,AMR(y+4),AMR(y+5),AMR(y+6)]]"]; + bscnat => mgw [label="RTP-AMR[seq=p+4,ssrc=s] (originally seq=y+4,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+5,ssrc=r] (originally seq=x+5,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+5,ssrc=s] (originally seq=y+5,ssrc=MSb)"]; + bscnat => mgw [label="RTP-AMR[seq=o+6,ssrc=r] (originally seq=x+6,ssrc=MSa)"]; + bscnat => mgw [label="RTP-AMR[seq=p+6,ssrc=s] (originally seq=y+6,ssrc=MSb)"]; +} +---- == Evaluation: Expected traffic savings -- To view, visit https://gerrit.osmocom.org/3300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic2c63e4d9e67b877dc06a206ec7f07d0704329a5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 16:05:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 16:05:46 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: osmux-reference: Use packetdiag to draw packet header struct... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmux-reference: Use packetdiag to draw packet header structures ...................................................................... osmux-reference: Use packetdiag to draw packet header structures Change-Id: Id75152278f41d56b7bd2e652b9947e33d6523c64 --- M OsmoBSC/Makefile M OsmoBSC/osmux-reference.adoc 2 files changed, 50 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 93c7b81..35f50da 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -33,6 +33,9 @@ -rm aoip-mgw-options*.png -rm aoip-mgw-options*.svg -rm aoip-mgw-options*.check + -rm osmux-reference__*.svg + -rm osmux-reference__*.png + -rm osmux-reference__*.check gen-bsc-vty-docbook: FORCE $(call command,xsltproc -o generated/combined1.xml \ diff --git a/OsmoBSC/osmux-reference.adoc b/OsmoBSC/osmux-reference.adoc index 068bc19..b2767f3 100644 --- a/OsmoBSC/osmux-reference.adoc +++ b/OsmoBSC/osmux-reference.adoc @@ -144,14 +144,22 @@ === LAPD Signalling (0) - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -|X|FT |X X X X X| PL-LENGTH | LAPD header + payload | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +[packetdiag] +---- +{ + colwidth = 32 + node_height = 40 + + 0: - + 1-2: FT + 3-7: ---- + 8-15: PL-LENGTH + 16-31: LAPD header + payload +} +---- Field Type (FT): 2 bits:: -The Field Type allocated for AMR codec is "0". +The Field Type allocated for LAPD Signalling is "0". This frame type is not yet supported inside OsmoCom and may be subject to change in future versions of the protocol. @@ -162,11 +170,23 @@ This OSmux packet header is used to transport one or more RTP-AMR packets for a specific RTP stream identified by the Circuit ID field. - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -|M|FT | CTR |F|Q| Red. TS/SeqNR | Circuit ID |AMR FT |AMR CMR| -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +[packetdiag] +---- +{ + colwidth = 32 + node_height = 40 + + 0: M + 1-2: FT + 3-5: CTR + 6: F + 7: Q + 8-15: Red. TS/SeqNR + 16-23: Circuit ID + 24-27: AMR FT + 28-31: AMR CMR +} +---- Marker (M): 1 bit:: This is a 1:1 mapping from the RTP Marker (M) bit as specified in RFC3550 @@ -246,11 +266,22 @@ When opening a connection, the peer is expected to send dummy packets until it starts sending real audio, at which point dummy packets are not needed anymore. - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -|X|FT | CTR |X X|X X X X X X X X X| Circuit ID |AMR FT |X X X X| -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +[packetdiag] +---- +{ + colwidth = 32 + node_height = 40 + + 0: - + 1-2: FT + 3-5: CTR + 6-7: -- + 8-15: ---- + 16-23: Circuit ID + 24-27: AMR FT + 28-31: ---- +} +---- Field Type (FT): 2 bits:: The Field Type allocated for AMR codec is "2". -- To view, visit https://gerrit.osmocom.org/3299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id75152278f41d56b7bd2e652b9947e33d6523c64 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 19 17:08:59 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 19 Jul 2017 17:08:59 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: make simple client configurable via VTY Message-ID: Review at https://gerrit.osmocom.org/3303 sccp: make simple client configurable via VTY The osmo_sccp_simple_client_on_ss7_id and osmo_sccp_simple_client are not entirely configurable via VTY commands. Add additional logic that checks for a still existing, valid configuration. If no or an insufficient configuration is detected, assume use the caller supplied parameters as standard configuration. Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c M src/sccp_user.c 3 files changed, 158 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/3303/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 57a4e06..87ace4a 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -307,6 +307,8 @@ osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx); struct osmo_ss7_as * osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id); +struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, + enum osmo_ss7_asp_protocol proto); struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto); @@ -383,6 +385,9 @@ struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name); +struct osmo_ss7_asp +*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, + enum osmo_ss7_asp_protocol proto); struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index c13c588..2760e5e 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -833,6 +833,44 @@ return NULL; } +/*! \brief Find Application Server by given protocol. + * \param[in] inst SS7 Instance on which we operate + * \param[in] proto Protocol identifier that must match + * \returns pointer to Application Server on success; NULL otherwise */ +struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, + enum osmo_ss7_asp_protocol proto) +{ + struct osmo_ss7_as *as; + struct osmo_ss7_as *second_best_as = NULL; + unsigned int i; + + OSMO_ASSERT(ss7_initialized); + + /* Loop through the list with AS and try to find one + * where the proto matches up */ + llist_for_each_entry(as, &inst->as_list, list) { + if (as->cfg.proto == proto) { + + /* Put down the first AS that matches the + * proto, just in cas we will not find any + * matching ASP */ + if (!second_best_as) + second_best_as = as; + + /* Check if the candicate we have here as + * any suitable ASP */ + for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { + if (as->cfg.asps[i] + && as->cfg.asps[i]->cfg.proto == proto) + return as; + } + } + } + + /* Return with the second best find, if there is any */ + return second_best_as; +} + /*! \brief Find or Create Application Server * \param[in] inst SS7 Instance on which we operate * \param[in] name Name of Application Server @@ -1044,6 +1082,23 @@ return NULL; } +/*! \brief Find an ASP that matches the given protocol. + * \param[in] as Application Server in which to look for \ref asp + * \returns SS7 ASP in case a matching one is found; NULL otherwise */ +struct osmo_ss7_asp +*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, + enum osmo_ss7_asp_protocol proto) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { + if (as->cfg.asps[i] && as->cfg.asps[i]->cfg.proto == proto) + return as->cfg.asps[i]; + } + + return NULL; +} + struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, diff --git a/src/sccp_user.c b/src/sccp_user.c index b21a756..8fe9056 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -242,54 +242,115 @@ int remote_port, const char *remote_ip) { struct osmo_ss7_instance *ss7; + bool ss7_created = false; struct osmo_ss7_as *as; + bool as_created = false; struct osmo_ss7_route *rt; + bool rt_created = false; struct osmo_ss7_asp *asp; - char *as_name, *asp_name; + bool asp_created = false; + char *as_name, *asp_name = NULL; + /* Choose default ports when the caller does not supply + * valid port numbers */ if (!remote_port || remote_port < 0) remote_port = osmo_ss7_asp_protocol_port(prot); if (local_port < 0) local_port = osmo_ss7_asp_protocol_port(prot); - /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); + /* Check if there is already an ss7 instance present under + * the given id. If not, we will create a new one */ + ss7 = osmo_ss7_instance_find(ss7_id); if (!ss7) { - LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); - return NULL; + LOGP(DLSCCP, LOGL_NOTICE, + "%s: No SS7 instance found, autocreating one...\n", name); + + /* Create a new ss7 instance */ + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); + if (!ss7) { + LOGP(DLSCCP, LOGL_ERROR, + "Failed to find or create SS7 instance\n"); + return NULL; + } + + /* Setup primary pointcode + * NOTE: This means that the user must set the pointcode to a + * proper value when a cs7 instance is defined via the VTY */ + ss7->cfg.primary_pc = pc; + ss7_created = true; } - ss7->cfg.primary_pc = pc; + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, + ss7->cfg.id, osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc)); - as_name = talloc_asprintf(ctx, "as-clnt-%s", name); - asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); + /* Exit early in case there is already an SCCP instance present. + * We will also return the already existing SCCP instance back + * to the caller */ + if (ss7->sccp) { + LOGP(DLSCCP, LOGL_NOTICE, + "%s: SCCP instance already present, skipping...\n", name); + return ss7->sccp; + } - /* application server */ - as = osmo_ss7_as_find_or_create(ss7, as_name, prot); - if (!as) - goto out_strings; + /* Check if there is already an application server that matches + * the protocol we intend to use. If not, we will create one */ + as = osmo_ss7_as_find_by_proto(ss7, prot); + if (!as) { + LOGP(DLSCCP, LOGL_NOTICE, + "%s: No AS instance found, autocreating one...\n", name); + as_name = talloc_asprintf(ctx, "as-clnt-%s", name); + as = osmo_ss7_as_find_or_create(ss7, as_name, prot); + talloc_free(as_name); + if (!as) + goto out_ss7; + as_created = true; - as->cfg.routing_key.pc = pc; + as->cfg.routing_key.pc = ss7->cfg.primary_pc; - /* install default route */ - rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, as_name); - if (!rt) - goto out_as; - talloc_free(as_name); + /* install default route */ + rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, + as->cfg.name); + if (!rt) + goto out_as; + rt_created = true; + } + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, + as->cfg.name); - /* application server process */ - asp = osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, local_port, - prot); - if (!asp) - goto out_rt; - asp->cfg.local.host = talloc_strdup(asp, local_ip); - asp->cfg.remote.host = talloc_strdup(asp, remote_ip); - osmo_ss7_as_add_asp(as, asp_name); + /* Check if we do already have an application server process + * that is associated with the application server we have choosen + * the application server process must also match the protocol + * we intend to use */ + asp = osmo_ss7_asp_find_by_proto(as, prot); + if (!asp) { + LOGP(DLSCCP, LOGL_NOTICE, + "%s: No ASP instance found, autocreating one...\n", name); + asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); + asp = + osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, + local_port, prot); + talloc_free(asp_name); + if (!asp) + goto out_rt; + asp_created = true; + + asp->cfg.local.host = talloc_strdup(asp, local_ip); + asp->cfg.remote.host = talloc_strdup(asp, remote_ip); + + osmo_ss7_as_add_asp(as, asp->cfg.name); + } + + /* Ensure that the ASP we use is set to client mode */ + asp->cfg.is_server = false; + + /* Restart ASP */ if (prot != OSMO_SS7_ASP_PROT_IPA) osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG); - talloc_free(asp_name); osmo_ss7_asp_restart(asp); + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using ASP instance %s\n", name, + asp->cfg.name); - /* Allocate SCCP stack + SCCP user */ + /* Allocate SCCP instance */ + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SCCP instance...\n", name); ss7->sccp = osmo_sccp_instance_create(ss7, NULL); if (!ss7->sccp) goto out_asp; @@ -297,15 +358,17 @@ return ss7->sccp; out_asp: - osmo_ss7_asp_destroy(asp); + if (asp_created) + osmo_ss7_asp_destroy(asp); out_rt: - osmo_ss7_route_destroy(rt); + if (rt_created) + osmo_ss7_route_destroy(rt); out_as: - osmo_ss7_as_destroy(as); -out_strings: - talloc_free(as_name); - talloc_free(asp_name); - osmo_ss7_instance_destroy(ss7); + if (as_created) + osmo_ss7_as_destroy(as); +out_ss7: + if (ss7_created) + osmo_ss7_instance_destroy(ss7); return NULL; } -- To view, visit https://gerrit.osmocom.org/3303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jul 19 17:17:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 17:17:55 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: update osmo-bts-virtual documentation, now that code is merged Message-ID: Review at https://gerrit.osmocom.org/3304 update osmo-bts-virtual documentation, now that code is merged Change-Id: Icd8706d29ca0e96cb89b7736dbb62f9ce159382d --- M OsmoBTS/chapters/bts-models.adoc 1 file changed, 41 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/04/3304/1 diff --git a/OsmoBTS/chapters/bts-models.adoc b/OsmoBTS/chapters/bts-models.adoc index 40a86e2..5e51009 100644 --- a/OsmoBTS/chapters/bts-models.adoc +++ b/OsmoBTS/chapters/bts-models.adoc @@ -381,13 +381,32 @@ Rather than communicating over a wireless RF interface, the GSM Um messages are encapsulated over GSMTAP/UDP/IP. -At the time of writing, this functionality is not fully completed. It -is the idea to adopt the OsmocomBB MS-side GSM implementation to -interface with this virtual Um interface, so that many instances of -virtual MS can connect to some instances of OsmoBTS, testing MS, BTS, -BSC and core network functionality. +The Virtual Um interface (i.e. virtual radio layer) between OsmoBTS and +OsmocomBB allows us to run a complete GSM network with 1-N BTSs and 1-M +MSs without any actual radio hardware, which is of course excellent for +all kinds of testing scenarios. -=== `osmo-bts-trx` specific VTY commands +The Virtual Um layer is based on sending L2 frames (blocks) encapsulated +via GSMTAP UDP multicast packets. There are two separate multicast +groups, one for uplink and one for downlink. The multicast nature +simulates the shared medium and enables any simulated phone to receive +the signal from multiple BTSs via the downlink multicast group. + +In OsmoBTS, this is implemented via the `osmo-bts-virtual` BTS model. + +Setting up OsmoBTS in its `osmo-bts-virtual` flavor isn't really much +different from setting it up with real hardware. The amount of required +configuration at the BTS configuration file is (as always) very minimal, +as in the GSM network architecture provides almost all relevant +configuration to the BTS from the BSC. + +An example configuratin file is provided as part of the osmo-bts source +code: `doc/examples/virtual/osmobts-virtual.cfg` + +For more information see +http://osmocom.org/projects/cellular-infrastructure/wiki/Virtual_Um + +=== `osmo-bts-virtual` specific VTY commands For a auto-generated complete syntax reference of the VTY commands, please see the associated _OsmoBTS VTY reference manual_ @@ -401,12 +420,22 @@ Configure the network device used for sending/receiving the virtual Um interface messages (e.g. `eth0`). -===== `virtual-um udp-port <0-65535>` +===== `virtual-um ms-udp-port <0-65535>` -Configure the UDP port used for sending/receiving the virtual Um -interface messages (default: GSMTAP 2775). +Configure the UDP port used for sending virtual Um +downlink messages towards the MS (default: GSMTAP 4729). -===== `virtual-um multicast-group GROUP` +===== `virtual-um ms-multicast-group GROUP` -Configure the IP multicast group used for sending/receiving the virtual -Um interface messages. +Configure the IP multicast group used for sending virtual +Um downlink messages towards the MS (default: 239.193.23.1) + +===== `virtual-um bts-udp-port <0-65535>` + +Configure the UDP port used for receiving virtual Um +uplink messages from the MS (default: GSMTAP 4729). + +===== `virtual-um bts-multicast-group GROUP` + +Configure the IP multicast group used for receiving virtual +Um uplink messages from the MS (default: 239.193.23.2) -- To view, visit https://gerrit.osmocom.org/3304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd8706d29ca0e96cb89b7736dbb62f9ce159382d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Wed Jul 19 19:54:04 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 19 Jul 2017 19:54:04 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/i586 In-Reply-To: References: Message-ID: <596fb8f1388d9_4ee150af78250915@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 247s] - [ 247s] -[+] Testing: ??? (non-recursive, direct truncation, not punctured) [ 247s] -[.] Input length : ret = 224 exp = 224 -> OK [ 247s] -[.] Output length : ret = 448 exp = 448 -> OK [ 247s] -[.] Pre computed vector checks: [ 247s] -[..] Encoding: OK [ 247s] -[..] Decoding: OK [ 247s] -[.] Random vector checks: [ 247s] -[..] Encoding / Decoding cycle : OK [ 247s] -[..] Encoding / Decoding cycle : OK [ 247s] -[..] Encoding / Decoding cycle : OK [ 247s] - [ 247s] ./testsuite.at:51: exit code was 132, expected 0 [ 247s] 8. testsuite.at:48: 8. conv (testsuite.at:48): FAILED (testsuite.at:51) [ 247s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 247s] make[1]: *** [override_dh_auto_test] Error 1 [ 247s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 247s] debian/rules:15: recipe for target 'build' failed [ 247s] make: *** [build] Error 2 [ 247s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 247s] [ 247s] build36 failed "build libosmocore_0.9.6.20170719.dsc" at Wed Jul 19 19:53:56 UTC 2017. [ 247s] [ 247s] ### VM INTERACTION START ### [ 249s] [ 227.771645] reboot: Power down [ 252s] ### VM INTERACTION END ### [ 252s] [ 252s] build36 failed "build libosmocore_0.9.6.20170719.dsc" at Wed Jul 19 19:54:02 UTC 2017. [ 252s] -- 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 Jul 19 23:53:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 23:53:51 +0000 Subject: [PATCH] openbsc[master]: bsc_vty: Don't allow timers of zero (0) Message-ID: Review at https://gerrit.osmocom.org/3305 bsc_vty: Don't allow timers of zero (0) It typically doesn't make sense to configure any of the GSM RR timer to 0 (Seconds). In fact, accidentially configuring any of the timers to zero might have severe side effects, such as "stuck channels" described in https://osmocom.org/issues/2380 Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/05/3305/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 6472e9d..92b4bbb 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1539,14 +1539,14 @@ #define DECLARE_TIMER(number, doc) \ DEFUN(cfg_net_T##number, \ cfg_net_T##number##_cmd, \ - "timer t" #number " <0-65535>", \ + "timer t" #number " <1-65535>", \ "Configure GSM Timers\n" \ doc "Timer Value in seconds\n") \ { \ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ int value = atoi(argv[0]); \ \ - if (value < 0 || value > 65535) { \ + if (value < 1 || value > 65535) { \ vty_out(vty, "Timer value %s out of range.%s", \ argv[0], VTY_NEWLINE); \ return CMD_WARNING; \ -- To view, visit https://gerrit.osmocom.org/3305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jul 19 23:53:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 19 Jul 2017 23:53:52 +0000 Subject: [PATCH] openbsc[master]: GSM timers: User reasonable defaults; don't save if equal de... Message-ID: Review at https://gerrit.osmocom.org/3306 GSM timers: User reasonable defaults; don't save if equal default A number of the GSM timers (including T3109) had no reasonable default values if not specified in the VTY / config file. Together with unconditional writing to the config file, this created config files with a persistent setting for important timers as '0'. Let's avoid this from happening by * having reasonable defaults if nothing specified in the config file * conditionally savingg timers only if they differ from default * reject any timer values that state zero during start-up (see previous commit) Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Closes: OS#2380 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/net_init.c 3 files changed, 35 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/06/3306/1 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index a974051..37a341c 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -289,10 +289,18 @@ GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */ }; -#define GSM_T3101_DEFAULT 10 -#define GSM_T3105_DEFAULT 40 +#define GSM_T3101_DEFAULT 10 /* s */ +#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_T3111_DEFAULT 2 /* s */ #define GSM_T3113_DEFAULT 60 +#define GSM_T3115_DEFAULT 10 +#define GSM_T3117_DEFAULT 10 +#define GSM_T3119_DEFAULT 10 #define GSM_T3122_DEFAULT 10 +#define GSM_T3141_DEFAULT 10 struct gsm_tz { int override; /* if 0, use system's time zone instead. */ diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 92b4bbb..bcd78e3 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -787,6 +787,11 @@ return CMD_SUCCESS; } +/* small helper macro for conditional dumping of timer */ +#define VTY_OUT_TIMER(number) \ + if (gsmnet->T##number != GSM_T##number##_DEFAULT) \ + vty_out(vty, " timer t"#number" %u%s", gsmnet->T##number, VTY_NEWLINE) + static int config_write_net(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); @@ -820,18 +825,18 @@ gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); vty_out(vty, " handover maximum distance %u%s", gsmnet->handover.max_distance, VTY_NEWLINE); - vty_out(vty, " timer t3101 %u%s", gsmnet->T3101, VTY_NEWLINE); - vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); - vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); - vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); - vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); - vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); - vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); - vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); - vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); - vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); - vty_out(vty, " timer t3122 %u%s", gsmnet->T3122, VTY_NEWLINE); - vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); + VTY_OUT_TIMER(3101); + VTY_OUT_TIMER(3103); + VTY_OUT_TIMER(3105); + VTY_OUT_TIMER(3107); + VTY_OUT_TIMER(3109); + VTY_OUT_TIMER(3111); + VTY_OUT_TIMER(3113); + VTY_OUT_TIMER(3115); + VTY_OUT_TIMER(3117); + VTY_OUT_TIMER(3119); + VTY_OUT_TIMER(3122); + VTY_OUT_TIMER(3141); vty_out(vty, " dyn_ts_allow_tch_f %d%s", gsmnet->dyn_ts_allow_tch_f ? 1 : 0, VTY_NEWLINE); vty_out(vty, " subscriber-keep-in-ram %d%s", diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 4dfc258..9d54319 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -44,10 +44,17 @@ net->num_bts = 0; net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED; net->T3101 = GSM_T3101_DEFAULT; + net->T3103 = GSM_T3103_DEFAULT; net->T3105 = GSM_T3105_DEFAULT; + net->T3107 = GSM_T3107_DEFAULT; + net->T3109 = GSM_T3109_DEFAULT; + net->T3111 = GSM_T3111_DEFAULT; net->T3113 = GSM_T3113_DEFAULT; + net->T3115 = GSM_T3115_DEFAULT; + net->T3117 = GSM_T3117_DEFAULT; + net->T3119 = GSM_T3119_DEFAULT; net->T3122 = GSM_T3122_DEFAULT; - /* FIXME: initialize all other timers! */ + net->T3141 = GSM_T3141_DEFAULT; /* default set of handover parameters */ net->handover.win_rxlev_avg = 10; -- To view, visit https://gerrit.osmocom.org/3306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 20 08:18:05 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 20 Jul 2017 08:18:05 +0000 Subject: [PATCH] openbsc[master]: sgsn: Convert cch_pdp to host order for libgtp Message-ID: Review at https://gerrit.osmocom.org/3307 sgsn: Convert cch_pdp to host order for libgtp libgtp is calling gtpie_tv2 which will convert this uint16_t from host to network order. So far libosmogsm and the sgsn treated the charging characteristics as opaque data. So when moving from byte array to the uint16_t do the swapping. Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/07/3307/1 diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 90ac48a..d1e30a7 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -239,6 +239,7 @@ OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); + pdp->cch_pdp = ntohs(pdp->cch_pdp); } /* SGSN address for control plane */ -- To view, visit https://gerrit.osmocom.org/3307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Thu Jul 20 08:39:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 08:39:16 +0000 Subject: [PATCH] openbsc[master]: GSM timers: User reasonable defaults; don't save if equal de... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3306 to look at the new patch set (#2). GSM timers: User reasonable defaults; don't save if equal default A number of the GSM timers (including T3109) had no reasonable default values if not specified in the VTY / config file. Together with unconditional writing to the config file, this created config files with a persistent setting for important timers as '0'. To make things worse, many of our example cofig files suffered from the same problem. Let's avoid this from happening by * having reasonable defaults if nothing specified in the config file * conditionally savingg timers only if they differ from default * reject any timer values that state zero during start-up (see previous commit) Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Closes: OS#2380 --- M openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg M openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg M openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg M openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg M openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg M openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg M openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg M openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg M openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg M openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/net_init.c 13 files changed, 35 insertions(+), 91 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/06/3306/2 diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg index 56e4724..ab23a76 100644 --- a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -28,18 +28,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 0 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3122 0 - timer t3141 0 subscriber-keep-in-ram 0 bts 0 type nanobts diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg index 6730644..dbb9cff 100644 --- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg +++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg @@ -26,17 +26,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type bs11 band GSM900 diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg index ca5689f..02ff4b8 100644 --- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg +++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg @@ -13,8 +13,6 @@ mobile network code 1 short name OpenBSC long name OpenBSC - timer t3101 10 - timer t3113 60 bts 0 type bs11 band GSM900 diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg index 4f194c0..47b8d46 100644 --- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg +++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg @@ -11,8 +11,6 @@ mobile network code 1 short name OpenBSC long name OpenBSC - timer t3101 10 - timer t3113 60 bts 0 type bs11 band GSM900 diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg index 6c47a90..bcb0b98 100644 --- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg +++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg @@ -13,8 +13,6 @@ mobile network code 1 short name OpenBSC long name OpenBSC - timer t3101 10 - timer t3113 60 bts 0 type bs11 band GSM900 diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg index 3277bea..7c03ed5 100644 --- a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg +++ b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg @@ -26,17 +26,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type nanobts band DCS1800 diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg index cfc1be6..c5e7be8 100644 --- a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg +++ b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg @@ -26,17 +26,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type nanobts band DCS1800 diff --git a/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg b/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg index 90386be..1906991 100644 --- a/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg +++ b/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg @@ -13,8 +13,6 @@ mobile network code 1 short name OpenBSC long name OpenBSC - timer t3101 10 - timer t3113 60 bts 0 type nokia_site band GSM1800 diff --git a/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg index 0226920..d783796 100644 --- a/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg +++ b/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg @@ -25,18 +25,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3122 0 - timer t3141 0 subscriber-keep-in-ram 0 bts 0 type rbs2000 diff --git a/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg index 7c078f6..7cd5d1f 100644 --- a/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg +++ b/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg @@ -26,17 +26,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type sysmobts band DCS1800 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index a974051..37a341c 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -289,10 +289,18 @@ GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */ }; -#define GSM_T3101_DEFAULT 10 -#define GSM_T3105_DEFAULT 40 +#define GSM_T3101_DEFAULT 10 /* s */ +#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_T3111_DEFAULT 2 /* s */ #define GSM_T3113_DEFAULT 60 +#define GSM_T3115_DEFAULT 10 +#define GSM_T3117_DEFAULT 10 +#define GSM_T3119_DEFAULT 10 #define GSM_T3122_DEFAULT 10 +#define GSM_T3141_DEFAULT 10 struct gsm_tz { int override; /* if 0, use system's time zone instead. */ diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 6472e9d..b8352ce 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -787,6 +787,11 @@ return CMD_SUCCESS; } +/* small helper macro for conditional dumping of timer */ +#define VTY_OUT_TIMER(number) \ + if (gsmnet->T##number != GSM_T##number##_DEFAULT) \ + vty_out(vty, " timer t"#number" %u%s", gsmnet->T##number, VTY_NEWLINE) + static int config_write_net(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); @@ -820,18 +825,18 @@ gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); vty_out(vty, " handover maximum distance %u%s", gsmnet->handover.max_distance, VTY_NEWLINE); - vty_out(vty, " timer t3101 %u%s", gsmnet->T3101, VTY_NEWLINE); - vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); - vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); - vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); - vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); - vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); - vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); - vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); - vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); - vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); - vty_out(vty, " timer t3122 %u%s", gsmnet->T3122, VTY_NEWLINE); - vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); + VTY_OUT_TIMER(3101); + VTY_OUT_TIMER(3103); + VTY_OUT_TIMER(3105); + VTY_OUT_TIMER(3107); + VTY_OUT_TIMER(3109); + VTY_OUT_TIMER(3111); + VTY_OUT_TIMER(3113); + VTY_OUT_TIMER(3115); + VTY_OUT_TIMER(3117); + VTY_OUT_TIMER(3119); + VTY_OUT_TIMER(3122); + VTY_OUT_TIMER(3141); vty_out(vty, " dyn_ts_allow_tch_f %d%s", gsmnet->dyn_ts_allow_tch_f ? 1 : 0, VTY_NEWLINE); vty_out(vty, " subscriber-keep-in-ram %d%s", diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 4dfc258..9d54319 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -44,10 +44,17 @@ net->num_bts = 0; net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED; net->T3101 = GSM_T3101_DEFAULT; + net->T3103 = GSM_T3103_DEFAULT; net->T3105 = GSM_T3105_DEFAULT; + net->T3107 = GSM_T3107_DEFAULT; + net->T3109 = GSM_T3109_DEFAULT; + net->T3111 = GSM_T3111_DEFAULT; net->T3113 = GSM_T3113_DEFAULT; + net->T3115 = GSM_T3115_DEFAULT; + net->T3117 = GSM_T3117_DEFAULT; + net->T3119 = GSM_T3119_DEFAULT; net->T3122 = GSM_T3122_DEFAULT; - /* FIXME: initialize all other timers! */ + net->T3141 = GSM_T3141_DEFAULT; /* default set of handover parameters */ net->handover.win_rxlev_avg = 10; -- To view, visit https://gerrit.osmocom.org/3306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 20 08:48:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 20 Jul 2017 08:48:58 +0000 Subject: osmo-gsm-tester[master]: Improve SMPP supported features and test coverage In-Reply-To: References: Message-ID: Patch Set 3: (5 comments) https://gerrit.osmocom.org/#/c/3129/3/src/osmo_gsm_tester/esme.py File src/osmo_gsm_tester/esme.py: Line 98: lambda pdu: self.dbg('message sent unhandled resp:', pdu.sequence) ) > clarify ... "message we are sending contains an unhandled response"? can't This API from python-smpplib is quite misleading. Looking at the code, this handler is actually called when a message of type submit_sm_resp is received (a response from the server to our submit_sm request). I will change the message to: "Unhandled submit_sm_resp message" Line 116: def message_received_handler(self, pdu, *args): > might be good to indicate that this is not part of the intended testing API Agree Line 126: self.log('FIXME: wait_receipt disabled because receipts are not received, see OsmoNITB #2353') > hmm, we don't have an expected-to-fail mechanism yet. this would qualify to IMHO an expeted-to-fail mechanism can be marking the test as SKIP, but that should be done by the test, not by an internal API. Let's leave it like this for now as I don't want to spend time adding this kind of features now. Line 166: def process_pdus_pending(self, pdu, **kwargs): > public API or internal? Internal, I'll prepend an underscore. https://gerrit.osmocom.org/#/c/3129/3/suites/aoip_smpp/esme_ms_sms_storeforward.py File suites/aoip_smpp/esme_ms_sms_storeforward.py: Line 52: wait(esme.receipt_was_received, umref) > ...like another option: try: wait(...) except ExpectedFailure: suite.test_set_skip() return -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 20 09:20:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 20 Jul 2017 09:20:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Improve SMPP supported features and test coverage 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/3129 to look at the new patch set (#4). Improve SMPP supported features and test coverage esme: Add several bits to handle logic required by tests: - Allow specifying the mode used to send an sms - Add a parameter to ask to receive a Delivery receipt for that message - Add sms_send_wait_resp API, which waits until the response message for a given smpp message is received when sending an sms. - Add receipt_was_received API, which together with message_received_handler maintains state of the delivery receipts we asked for and were still not received. However, the check needs to be disabled for now because OsmoNITB doens't seem to be sending stuff properly, see OsmoNITB #2353. - On message_received_handler, also print alert_notification messages, to show that there's actually a bug in OsmoNITB, see #2352. Move old esme_ms_sms to esme_ms_sms_transaction, and explicitly state that we are using that mode. On the same test, we can now enable the part which asserts that sending an SMS to an msisdn with unknown destination triggers an error. The issue was mainly that the error had to come from the SMSC server response, not from the sent message, so we have to wait for the response to have the failure triggered. Finally, add esme_ms_sms_storeforward, which tests features for sms sent using that mode, and uses the APIs described above. Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e --- M src/osmo_gsm_tester/esme.py A suites/aoip_smpp/esme_ms_sms_storeforward.py R suites/aoip_smpp/esme_ms_sms_transaction.py A suites/smpp/esme_ms_sms_storeforward.py R suites/smpp/esme_ms_sms_transaction.py 5 files changed, 178 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/29/3129/4 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index f92863d..ff403c0 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -19,6 +19,7 @@ import smpplib.gsm import smpplib.client +import smpplib.command import smpplib.consts import smpplib.exceptions @@ -35,6 +36,9 @@ client = None smsc = None + MSGMODE_TRANSACTION = smpplib.consts.SMPP_MSGMODE_FORWARD + MSGMODE_STOREFORWARD = smpplib.consts.SMPP_MSGMODE_STOREFORWARD + def __init__(self, msisdn): self.msisdn = msisdn # Get last characters of msisdn to stay inside MAX_SYS_ID_LEN. Similar to modulus operator. @@ -44,6 +48,8 @@ self.connected = False self.bound = False self.listening = False + self.references_pending_receipt = [] + self.next_user_message_reference = 1 def __del__(self): try: @@ -89,9 +95,8 @@ self.disconnect() self.client = smpplib.client.Client(host, port, timeout=None) self.client.set_message_sent_handler( - lambda pdu: self.dbg('message sent:', repr(pdu)) ) - self.client.set_message_received_handler( - lambda pdu: self.dbg('message received:', repr(pdu)) ) + lambda pdu: self.dbg('Unhandled submit_sm_resp message:', pdu.sequence) ) + self.client.set_message_received_handler(self._message_received_handler) self.client.connect() self.connected = True self.client.bind_transceiver(system_id=self.system_id, password=self.password) @@ -108,6 +113,19 @@ self.client.disconnect() self.connected = False + def _message_received_handler(self, pdu, *args): + self.dbg('message received:', seq=pdu.sequence) + if isinstance(pdu, smpplib.command.AlertNotification): + self.dbg('message received: AlertNotification:', ms_availability_status=pdu.ms_availability_status) + elif isinstance(pdu, smpplib.command.DeliverSM): + self.dbg('message received:', user_message_reference=pdu.user_message_reference, references_pending_receipt=self.references_pending_receipt) + self.references_pending_receipt.remove(pdu.user_message_reference) + + def receipt_was_received(self, umref): + # return umref not in self.references_pending_receipt + self.log('FIXME: wait_receipt disabled because receipts are not received, see OsmoNITB #2353') + return True + def run_method_expect_failure(self, errcode, method, *args): try: method(*args) @@ -116,11 +134,14 @@ except smpplib.exceptions.PDUError as e: if e.args[1] != errcode: raise e + self.dbg('Expected failure triggered: %d' % errcode) - def sms_send(self, sms_obj): + def sms_send(self, sms_obj, mode, receipt=False): parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) - + seqs = [] self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) + umref = self.next_user_message_reference + self.next_user_message_reference += 1 for part in parts: pdu = self.client.send_message( source_addr_ton=smpplib.consts.SMPP_TON_INTL, @@ -131,8 +152,30 @@ destination_addr=sms_obj.dst_msisdn(), short_message=part, data_coding=encoding_flag, - esm_class=smpplib.consts.SMPP_MSGMODE_FORWARD, - registered_delivery=False, + esm_class=mode, + registered_delivery=receipt, + user_message_reference=umref, ) + self.dbg('sent part with seq', pdu.sequence) + seqs.append(pdu.sequence) + if receipt: + self.references_pending_receipt.append(umref) + return umref, seqs + + def _process_pdus_pending(self, pdu, **kwargs): + self.dbg('message sent resp with seq', pdu.sequence, ', pdus_pending:', self.pdus_pending) + self.pdus_pending.remove(pdu.sequence) + + def sms_send_wait_resp(self, sms_obj, mode, receipt=False): + old_func = self.client.message_sent_handler + try: + umref, self.pdus_pending = self.sms_send(sms_obj, mode, receipt) + self.dbg('pdus_pending:', self.pdus_pending) + self.client.set_message_sent_handler(self._process_pdus_pending) + event_loop.wait(self, lambda: len(self.pdus_pending) == 0, timeout=10) + return umref + finally: + self.client.set_message_sent_handler(old_func) + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py new file mode 100755 index 0000000..3e7e4f8 --- /dev/null +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * When SMS is sent in 'store & forward' mode, ESME fails to send an SMS to non registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to a not yet registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'store & forward' mode, ESME receives a SMS receipt if it asked for it. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +bsc.bts_add(bts) + +ms = suite.modem() +esme = suite.esme() +msc.smsc.esme_add(esme) + +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +esme.connect() +hlr.subscriber_add(ms) + +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending sms with wrong msisdn %s, it will fail' % 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) + +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) + +print('checking MS can receive SMS while registered...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send already-registered message') +umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) +wait(ms.sms_was_received, msg) +print('Waiting to receive and consume sms receipt with reference', umref) +wait(esme.receipt_was_received, umref) +esme.disconnect() diff --git a/suites/aoip_smpp/esme_ms_sms.py b/suites/aoip_smpp/esme_ms_sms_transaction.py similarity index 65% rename from suites/aoip_smpp/esme_ms_sms.py rename to suites/aoip_smpp/esme_ms_sms_transaction.py index 7f9ef18..8bcfb6b 100755 --- a/suites/aoip_smpp/esme_ms_sms.py +++ b/suites/aoip_smpp/esme_ms_sms_transaction.py @@ -3,7 +3,8 @@ # This test checks following use-cases: # * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously # defined in its configuration file. -# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. +# * When SMS is sent in 'transaction' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'transaction' mode, ESME fails to send an SMS to non registered MS. from osmo_gsm_tester.test import * @@ -39,18 +40,17 @@ print('sending first sms...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) print('sending second sms (unicode chars not in gsm aplhabet)...') msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) -# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) -# wrong_msisdn = ms.msisdn + esme.msisdn -# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) -# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_TRANSACTION) esme.disconnect() diff --git a/suites/smpp/esme_ms_sms_storeforward.py b/suites/smpp/esme_ms_sms_storeforward.py new file mode 100755 index 0000000..5ff6ad3 --- /dev/null +++ b/suites/smpp/esme_ms_sms_storeforward.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * When SMS is sent in 'store & forward' mode, ESME fails to send an SMS to non registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to a not yet registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'store & forward' mode, ESME receives a SMS receipt if it asked for it. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() +esme = suite.esme() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.smsc.esme_add(esme) +nitb.start() +bts.start() + +esme.connect() +nitb.subscriber_add(ms) + +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending sms with wrong msisdn %s, it will fail' % 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) + +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(nitb.mcc_mnc()) +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.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) + +print('checking MS can receive SMS while registered...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send already-registered message') +umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) +wait(ms.sms_was_received, msg) +print('Waiting to receive and consume sms receipt with reference', umref) +wait(esme.receipt_was_received, umref) +esme.disconnect() diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms_transaction.py similarity index 62% rename from suites/smpp/esme_ms_sms.py rename to suites/smpp/esme_ms_sms_transaction.py index bc9d7d4..a147754 100755 --- a/suites/smpp/esme_ms_sms.py +++ b/suites/smpp/esme_ms_sms_transaction.py @@ -3,7 +3,8 @@ # This test checks following use-cases: # * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously # defined in its configuration file. -# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. +# * When SMS is sent in 'transaction' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'transaction' mode, ESME fails to send an SMS to non registered MS. from osmo_gsm_tester.test import * @@ -31,19 +32,17 @@ print('sending first sms...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) print('sending second sms (unicode chars not in gsm aplhabet)...') msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) - -# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) -# wrong_msisdn = ms.msisdn + esme.msisdn -# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) -# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_TRANSACTION) esme.disconnect() -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 20 09:49:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 09:49:43 +0000 Subject: [PATCH] osmo-gsm-tester[master]: remove timer section from osmo-{bts, bsc}.cfg.tmpl Message-ID: Review at https://gerrit.osmocom.org/3308 remove timer section from osmo-{bts,bsc}.cfg.tmpl As described in https://osmocom.org/issues/2380 and related gerrit patch https://gerrit.osmocom.org/#/c/3306 the config files currently contain timers with a 'zero' value, leading to issues. The config file templates used in osmo-gsm-tester suffer actually from exactly the same issue: They basically contain values that were written back to the file based on the default initialization in libbsc, which unfortunately was zero in some cases. Let's remove those values, they are the (bad) default anyway. libbsc patches in the pipeline will introduce reasonable defaults and forbid the use of zero for timers. Change-Id: I8cde29a597a17c2659b3b87268be4b12975f4bef --- M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl 2 files changed, 0 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/08/3308/1 diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 89cfb1d..514514f 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -31,17 +31,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 %for bts in bsc.net.bts_list: bts ${loop.index} type ${bts.osmobsc_bts_type} diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index 23cc225..d2927f9 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -33,17 +33,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 %for bts in nitb.net.bts_list: bts ${loop.index} type ${bts.osmobsc_bts_type} -- To view, visit https://gerrit.osmocom.org/3308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8cde29a597a17c2659b3b87268be4b12975f4bef Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 20 09:54:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 09:54:53 +0000 Subject: [PATCH] osmo-gsm-tester[master]: remove timer section from osmo-{bts, bsc}.cfg.tmpl In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3308 to look at the new patch set (#2). remove timer section from osmo-{bts,bsc}.cfg.tmpl As described in https://osmocom.org/issues/2380 and related gerrit patch https://gerrit.osmocom.org/#/c/3306 the config files currently contain timers with a 'zero' value, leading to issues. The config file templates used in osmo-gsm-tester suffer actually from exactly the same issue: They basically contain values that were written back to the file based on the default initialization in libbsc, which unfortunately was zero in some cases. Let's remove those values, they are the (bad) default anyway. libbsc patches in the pipeline will introduce reasonable defaults and forbid the use of zero for timers. Change-Id: I8cde29a597a17c2659b3b87268be4b12975f4bef --- M selftest/template_test.ok M selftest/template_test/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl 4 files changed, 0 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/08/3308/2 diff --git a/selftest/template_test.ok b/selftest/template_test.ok index 688361f..5af4b6a 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -35,17 +35,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type val_type_bts0 band val_band_bts0 diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 7a76878..200dfdc 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -35,17 +35,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 smpp local-tcp-ip ${nitb.ip_address.addr} 2775 system-id test-nitb diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 89cfb1d..514514f 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -31,17 +31,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 %for bts in bsc.net.bts_list: bts ${loop.index} type ${bts.osmobsc_bts_type} diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index 23cc225..d2927f9 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -33,17 +33,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 %for bts in nitb.net.bts_list: bts ${loop.index} type ${bts.osmobsc_bts_type} -- To view, visit https://gerrit.osmocom.org/3308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8cde29a597a17c2659b3b87268be4b12975f4bef Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 20 09:55:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 09:55:21 +0000 Subject: osmo-gsm-tester[master]: remove timer section from osmo-{bts, bsc}.cfg.tmpl In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8cde29a597a17c2659b3b87268be4b12975f4bef Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: 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 Jul 20 09:55:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 09:55:32 +0000 Subject: [MERGED] osmo-gsm-tester[master]: remove timer section from osmo-{bts, bsc}.cfg.tmpl In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove timer section from osmo-{bts,bsc}.cfg.tmpl ...................................................................... remove timer section from osmo-{bts,bsc}.cfg.tmpl As described in https://osmocom.org/issues/2380 and related gerrit patch https://gerrit.osmocom.org/#/c/3306 the config files currently contain timers with a 'zero' value, leading to issues. The config file templates used in osmo-gsm-tester suffer actually from exactly the same issue: They basically contain values that were written back to the file based on the default initialization in libbsc, which unfortunately was zero in some cases. Let's remove those values, they are the (bad) default anyway. libbsc patches in the pipeline will introduce reasonable defaults and forbid the use of zero for timers. Change-Id: I8cde29a597a17c2659b3b87268be4b12975f4bef --- M selftest/template_test.ok M selftest/template_test/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl 4 files changed, 0 insertions(+), 44 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/template_test.ok b/selftest/template_test.ok index 688361f..5af4b6a 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -35,17 +35,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type val_type_bts0 band val_band_bts0 diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 7a76878..200dfdc 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -35,17 +35,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 smpp local-tcp-ip ${nitb.ip_address.addr} 2775 system-id test-nitb diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 89cfb1d..514514f 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -31,17 +31,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 %for bts in bsc.net.bts_list: bts ${loop.index} type ${bts.osmobsc_bts_type} diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index 23cc225..d2927f9 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -33,17 +33,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 %for bts in nitb.net.bts_list: bts ${loop.index} type ${bts.osmobsc_bts_type} -- To view, visit https://gerrit.osmocom.org/3308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8cde29a597a17c2659b3b87268be4b12975f4bef Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 20 09:55:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 09:55:40 +0000 Subject: openbsc[master]: GSM timers: User reasonable defaults; don't save if equal de... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 20 09:55:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 09:55:42 +0000 Subject: openbsc[master]: bsc_vty: Don't allow timers of zero (0) In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 20 09:55:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 09:55:44 +0000 Subject: [MERGED] openbsc[master]: bsc_vty: Don't allow timers of zero (0) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc_vty: Don't allow timers of zero (0) ...................................................................... bsc_vty: Don't allow timers of zero (0) It typically doesn't make sense to configure any of the GSM RR timer to 0 (Seconds). In fact, accidentially configuring any of the timers to zero might have severe side effects, such as "stuck channels" described in https://osmocom.org/issues/2380 Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57 --- M openbsc/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/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index b8352ce..bcd78e3 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1544,14 +1544,14 @@ #define DECLARE_TIMER(number, doc) \ DEFUN(cfg_net_T##number, \ cfg_net_T##number##_cmd, \ - "timer t" #number " <0-65535>", \ + "timer t" #number " <1-65535>", \ "Configure GSM Timers\n" \ doc "Timer Value in seconds\n") \ { \ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ int value = atoi(argv[0]); \ \ - if (value < 0 || value > 65535) { \ + if (value < 1 || value > 65535) { \ vty_out(vty, "Timer value %s out of range.%s", \ argv[0], VTY_NEWLINE); \ return CMD_WARNING; \ -- To view, visit https://gerrit.osmocom.org/3305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 20 09:55:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 09:55:46 +0000 Subject: [MERGED] openbsc[master]: GSM timers: User reasonable defaults; don't save if equal de... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSM timers: User reasonable defaults; don't save if equal default ...................................................................... GSM timers: User reasonable defaults; don't save if equal default A number of the GSM timers (including T3109) had no reasonable default values if not specified in the VTY / config file. Together with unconditional writing to the config file, this created config files with a persistent setting for important timers as '0'. To make things worse, many of our example cofig files suffered from the same problem. Let's avoid this from happening by * having reasonable defaults if nothing specified in the config file * conditionally savingg timers only if they differ from default * reject any timer values that state zero during start-up (see previous commit) Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Closes: OS#2380 --- M openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg M openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg M openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg M openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg M openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg M openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg M openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg M openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg M openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg M openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/net_init.c 13 files changed, 35 insertions(+), 91 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg index 56e4724..ab23a76 100644 --- a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -28,18 +28,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 0 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3122 0 - timer t3141 0 subscriber-keep-in-ram 0 bts 0 type nanobts diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg index 6730644..dbb9cff 100644 --- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg +++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg @@ -26,17 +26,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type bs11 band GSM900 diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg index ca5689f..02ff4b8 100644 --- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg +++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg @@ -13,8 +13,6 @@ mobile network code 1 short name OpenBSC long name OpenBSC - timer t3101 10 - timer t3113 60 bts 0 type bs11 band GSM900 diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg index 4f194c0..47b8d46 100644 --- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg +++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg @@ -11,8 +11,6 @@ mobile network code 1 short name OpenBSC long name OpenBSC - timer t3101 10 - timer t3113 60 bts 0 type bs11 band GSM900 diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg index 6c47a90..bcb0b98 100644 --- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg +++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg @@ -13,8 +13,6 @@ mobile network code 1 short name OpenBSC long name OpenBSC - timer t3101 10 - timer t3113 60 bts 0 type bs11 band GSM900 diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg index 3277bea..7c03ed5 100644 --- a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg +++ b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg @@ -26,17 +26,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type nanobts band DCS1800 diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg index cfc1be6..c5e7be8 100644 --- a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg +++ b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg @@ -26,17 +26,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type nanobts band DCS1800 diff --git a/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg b/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg index 90386be..1906991 100644 --- a/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg +++ b/openbsc/doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg @@ -13,8 +13,6 @@ mobile network code 1 short name OpenBSC long name OpenBSC - timer t3101 10 - timer t3113 60 bts 0 type nokia_site band GSM1800 diff --git a/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg index 0226920..d783796 100644 --- a/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg +++ b/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg @@ -25,18 +25,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3122 0 - timer t3141 0 subscriber-keep-in-ram 0 bts 0 type rbs2000 diff --git a/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg index 7c078f6..7cd5d1f 100644 --- a/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg +++ b/openbsc/doc/examples/osmo-nitb/sysmobts/openbsc.cfg @@ -26,17 +26,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 4 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3141 0 bts 0 type sysmobts band DCS1800 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index a974051..37a341c 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -289,10 +289,18 @@ GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */ }; -#define GSM_T3101_DEFAULT 10 -#define GSM_T3105_DEFAULT 40 +#define GSM_T3101_DEFAULT 10 /* s */ +#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_T3111_DEFAULT 2 /* s */ #define GSM_T3113_DEFAULT 60 +#define GSM_T3115_DEFAULT 10 +#define GSM_T3117_DEFAULT 10 +#define GSM_T3119_DEFAULT 10 #define GSM_T3122_DEFAULT 10 +#define GSM_T3141_DEFAULT 10 struct gsm_tz { int override; /* if 0, use system's time zone instead. */ diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 6472e9d..b8352ce 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -787,6 +787,11 @@ return CMD_SUCCESS; } +/* small helper macro for conditional dumping of timer */ +#define VTY_OUT_TIMER(number) \ + if (gsmnet->T##number != GSM_T##number##_DEFAULT) \ + vty_out(vty, " timer t"#number" %u%s", gsmnet->T##number, VTY_NEWLINE) + static int config_write_net(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); @@ -820,18 +825,18 @@ gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); vty_out(vty, " handover maximum distance %u%s", gsmnet->handover.max_distance, VTY_NEWLINE); - vty_out(vty, " timer t3101 %u%s", gsmnet->T3101, VTY_NEWLINE); - vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); - vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); - vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); - vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); - vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); - vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); - vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); - vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); - vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); - vty_out(vty, " timer t3122 %u%s", gsmnet->T3122, VTY_NEWLINE); - vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); + VTY_OUT_TIMER(3101); + VTY_OUT_TIMER(3103); + VTY_OUT_TIMER(3105); + VTY_OUT_TIMER(3107); + VTY_OUT_TIMER(3109); + VTY_OUT_TIMER(3111); + VTY_OUT_TIMER(3113); + VTY_OUT_TIMER(3115); + VTY_OUT_TIMER(3117); + VTY_OUT_TIMER(3119); + VTY_OUT_TIMER(3122); + VTY_OUT_TIMER(3141); vty_out(vty, " dyn_ts_allow_tch_f %d%s", gsmnet->dyn_ts_allow_tch_f ? 1 : 0, VTY_NEWLINE); vty_out(vty, " subscriber-keep-in-ram %d%s", diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 4dfc258..9d54319 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -44,10 +44,17 @@ net->num_bts = 0; net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED; net->T3101 = GSM_T3101_DEFAULT; + net->T3103 = GSM_T3103_DEFAULT; net->T3105 = GSM_T3105_DEFAULT; + net->T3107 = GSM_T3107_DEFAULT; + net->T3109 = GSM_T3109_DEFAULT; + net->T3111 = GSM_T3111_DEFAULT; net->T3113 = GSM_T3113_DEFAULT; + net->T3115 = GSM_T3115_DEFAULT; + net->T3117 = GSM_T3117_DEFAULT; + net->T3119 = GSM_T3119_DEFAULT; net->T3122 = GSM_T3122_DEFAULT; - /* FIXME: initialize all other timers! */ + net->T3141 = GSM_T3141_DEFAULT; /* default set of handover parameters */ net->handover.win_rxlev_avg = 10; -- To view, visit https://gerrit.osmocom.org/3306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 20 10:43:57 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 20 Jul 2017 10:43:57 +0000 Subject: [ABANDON] libosmo-sccp[master]: sccp: improve sccp-addressbook API In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: sccp: improve sccp-addressbook API ...................................................................... Abandoned fixed up into #3265 -- To view, visit https://gerrit.osmocom.org/3293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I68209dd1b2c0aa94b1894637a22b5cc3a3ff1250 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 10:46:08 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 20 Jul 2017 10:46:08 +0000 Subject: [PATCH] libosmo-sccp[master]: cosmetic: remove comment 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/3264 to look at the new patch set (#3). cosmetic: remove comment The vty command string already says it all, remove the comment entirely. Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d --- M src/osmo_ss7_vty.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/64/3264/3 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 9a4e963..7e6f9ee 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1195,7 +1195,6 @@ return CMD_SUCCESS; } -/* Create a new addressbook entry and switch nodes */ DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, "no sccp-address NAME", NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") -- To view, visit https://gerrit.osmocom.org/3264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 20 10:46:08 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 20 Jul 2017 10:46:08 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: global addressbook search + api fix 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/3265 to look at the new patch set (#3). sccp: global addressbook search + api fix The sccp-addressbook only allows defining addresses for a specific ss7 instance. It is not possible to use an sscp-address, that is defined in the one ss7 instance in another ss7 instance. Add a second global list where all sscp-addresses are added, regardless on which instance they are defined. Fixup the search functions so that they always search the global list. Change the API, so that the address data is written to a destination pointer. This protects the stored address from unintentional changes. Also return the ss7 instance, where the address is associated with. Change-Id: I5acc1e5abc3b3081149a9f476038e4e53d23b763 --- M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7_vty.c 2 files changed, 54 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/65/3265/3 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 2258b0d..24d64d9 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -248,8 +248,8 @@ int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); -struct osmo_sccp_addr * -osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); +struct osmo_ss7_instance * +osmo_sccp_addr_by_name(struct osmo_sccp_addr *dest_addr, + const char *name); -char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, - const struct osmo_ss7_instance *ss7); +const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr); diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 7e6f9ee..8a03303 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -934,6 +934,7 @@ /* SCCP addressbook */ struct osmo_sccp_addr_entry { struct llist_head list; + struct llist_head list_global; struct osmo_ss7_instance *inst; char name[512]; struct osmo_sccp_addr addr; @@ -951,45 +952,72 @@ 1, }; -/* Pick an SCCP address entry from the addressbook by its name */ -struct osmo_sccp_addr_entry *addr_entry_by_name(const char *name, - const struct osmo_ss7_instance - *inst) +/* A global list that holds all addressbook entries at once + * (see also .cfg in struct osmo_ss7_instance) */ +LLIST_HEAD(sccp_address_book_global); + +/* Pick an SCCP address entry from the addressbook list by its name */ +static struct osmo_sccp_addr_entry +*addr_entry_by_name_local(const char *name, + const struct osmo_ss7_instance *inst) { struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) { + OSMO_ASSERT(entry->inst == inst); + return entry; + } + } + + return NULL; +} + +/* Pick an SCCP address entry from the global addressbook + * list by its name */ +static struct osmo_sccp_addr_entry +*addr_entry_by_name_global(const char *name) +{ + struct osmo_sccp_addr_entry *entry; + + llist_for_each_entry(entry, &sccp_address_book_global, + list_global) { if (strcmp(entry->name, name) == 0) return entry; } + return NULL; } /*! \brief Lookup an SCCP address from the addressbook by its name. - * \param[in] lookup-name of the address to lookup - * \param[in] ss7 instance - * \returns SCCP address; NULL on error */ -struct osmo_sccp_addr *osmo_sccp_addr_by_name(const char *name, - const struct osmo_ss7_instance - *ss7) + * \param[out] dest_addr pointer to output the resulting sccp-address; + * (set to NULL if not interested) + * \param[in] name of the address to lookup + * \returns SS7 instance; NULL on error */ +struct osmo_ss7_instance * +osmo_sccp_addr_by_name(struct osmo_sccp_addr *dest_addr, + const char *name) { struct osmo_sccp_addr_entry *entry; - entry = addr_entry_by_name(name, ss7); - if (entry) - return &entry->addr; + entry = addr_entry_by_name_global(name); + if (!entry) + return NULL; - return NULL; + if (dest_addr) + *dest_addr = entry->addr; + + return entry->inst; } /*! \brief Reverse lookup the lookup-name of a specified SCCP address. * \param[in] name of the address to lookup - * \param[in] ss7 instance * \returns char pointer to the lookup-name; NULL on error */ -char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, - const struct osmo_ss7_instance *ss7) +const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr) { struct osmo_sccp_addr_entry *entry; - llist_for_each_entry(entry, &ss7->cfg.sccp_address_book, list) { + + llist_for_each_entry(entry, &sccp_address_book_global, list_global) { if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) return entry->name; } @@ -1177,7 +1205,7 @@ return CMD_WARNING; } - entry = addr_entry_by_name(name, inst); + entry = addr_entry_by_name_local(name, inst); /* Create a new addressbook entry if we can not find an * already existing entry */ @@ -1185,6 +1213,7 @@ entry = talloc_zero(inst, struct osmo_sccp_addr_entry); osmo_strlcpy(entry->name, name, sizeof(entry->name)); llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + llist_add_tail(&entry->list_global, &sccp_address_book_global); entry->addr.ri = OSMO_SCCP_RI_SSN_PC; } @@ -1203,9 +1232,10 @@ struct osmo_sccp_addr_entry *entry; const char *name = argv[0]; - entry = addr_entry_by_name(name, inst); + entry = addr_entry_by_name_local(name, inst); if (entry) { llist_del(&entry->list); + llist_del(&entry->list_global); talloc_free(entry); } else { vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/3265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5acc1e5abc3b3081149a9f476038e4e53d23b763 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 10:46:08 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 20 Jul 2017 10:46:08 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: ensure addressbook entry names are unique 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/3292 to look at the new patch set (#2). sccp: ensure addressbook entry names are unique It is possible to add two (or more) different sccp-addresses under the same name, when the addresses are defined in different cs7 instances. Add a check to make sure an address name is not used multiple times Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 --- M src/osmo_ss7_vty.c 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/92/3292/2 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 8a03303..a97cfb4 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1205,6 +1205,15 @@ return CMD_WARNING; } + /* Ensure that we do not use address names that + * are already used in other ss7 instances. */ + if (addr_entry_by_name_global(name) != NULL) { + vty_out(vty, + "address-name already used in other ss7 instance!%s", + VTY_NEWLINE); + return CMD_WARNING; + } + entry = addr_entry_by_name_local(name, inst); /* Create a new addressbook entry if we can not find an -- To view, visit https://gerrit.osmocom.org/3292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 11:54:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 11:54:05 +0000 Subject: [PATCH] openbsc[master]: remove code disabling T3109 if configured to 0 Message-ID: Review at https://gerrit.osmocom.org/3309 remove code disabling T3109 if configured to 0 We no longer permit timers with a 0 value, so this case can never happen. Also, if it should happen, I'd rather have a timter expiring immediately (and breaking something) than not being started in the first place. Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/09/3309/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index f537cf2..f4fd6de 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -2899,10 +2899,6 @@ { struct gsm_bts *bts = lchan->ts->trx->bts; - /* Disabled, mostly legacy code */ - if (bts->network->T3109 == 0) - return -1; - osmo_timer_setup(&lchan->T3109, t3109_expired, lchan); osmo_timer_schedule(&lchan->T3109, bts->network->T3109, 0); return 0; -- To view, visit https://gerrit.osmocom.org/3309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 20 12:49:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 12:49:38 +0000 Subject: [PATCH] osmo-msc[master]: Add libvlr implementation 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/3194 to look at the new patch set (#5). Add libvlr implementation Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/debug.h A include/openbsc/vlr.h M src/Makefile.am M src/libcommon/debug.c A src/libmsc/subscr_conn.c M src/libmsc/vty_interface_layer3.c A src/libvlr/Makefile.am A src/libvlr/vlr.c A src/libvlr/vlr_access_req_fsm.c A src/libvlr/vlr_access_req_fsm.h A src/libvlr/vlr_auth_fsm.c A src/libvlr/vlr_auth_fsm.h A src/libvlr/vlr_core.h A src/libvlr/vlr_lu_fsm.c A src/libvlr/vlr_lu_fsm.h M src/osmo-nitb/Makefile.am A tests/vlr/Makefile.am A tests/vlr/vlr_test.c 20 files changed, 5,451 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/3194/5 diff --git a/configure.ac b/configure.ac index ff51ccf..3089a2e 100644 --- a/configure.ac +++ b/configure.ac @@ -225,6 +225,7 @@ src/libtrau/Makefile src/libbsc/Makefile src/libmsc/Makefile + src/libvlr/Makefile src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile @@ -261,6 +262,7 @@ tests/slhc/Makefile tests/v42bis/Makefile tests/nanobts_omlattr/Makefile + tests/vlr/Makefile doc/Makefile doc/examples/Makefile Makefile) diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 2740a5d..532328c 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -84,6 +84,7 @@ trau_mux.h \ trau_upqueue.h \ ussd.h \ + vlr.h \ vty.h \ v42bis.h \ v42bis_private.h \ diff --git a/include/openbsc/debug.h b/include/openbsc/debug.h index 8a4247b..3feb7c3 100644 --- a/include/openbsc/debug.h +++ b/include/openbsc/debug.h @@ -38,12 +38,8 @@ DSUA, DV42BIS, DPCU, + DVLR, Debug_LastEntry, }; - -struct gsm_subscriber; - -void log_set_filter_vlr_subscr(struct log_target *target, - struct gsm_subscriber *vlr_subscr); extern const struct log_info log_info; diff --git a/include/openbsc/vlr.h b/include/openbsc/vlr.h new file mode 100644 index 0000000..90e3d7a --- /dev/null +++ b/include/openbsc/vlr.h @@ -0,0 +1,413 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +// for GSM_NAME_LENGTH +#include + +/* from 3s to 10s */ +#define GSM_29002_TIMER_S 10 +/* from 15s to 30s */ +#define GSM_29002_TIMER_M 30 +/* from 1min to 10min */ +#define GSM_29002_TIMER_ML (10*60) +/* from 28h to 38h */ +#define GSM_29002_TIMER_L (32*60*60) + + +/* VLR subscriber authentication state */ +enum vlr_subscr_auth_state { + /* subscriber needs to be autenticated */ + VLR_SUB_AS_NEEDS_AUTH, + /* waiting for AuthInfo from HLR/AUC */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + /* waiting for response from subscriber */ + VLR_SUB_AS_WAIT_RESP, + /* successfully authenticated */ + VLR_SUB_AS_AUTHENTICATED, + /* subscriber needs re-sync */ + VLR_SUB_AS_NEEDS_RESYNC, + /* waiting for AuthInfo with ReSync */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + /* waiting for response from subscr, resync case */ + VLR_SUB_AS_WAIT_RESP_RESYNC, + /* waiting for IMSI from subscriber */ + VLR_SUB_AS_WAIT_ID_IMSI, + /* authentication has failed */ + VLR_SUB_AS_AUTH_FAILED, +}; + +enum vlr_lu_event { + VLR_ULA_E_UPDATE_LA, /* Initial trigger (LU from MS) */ + VLR_ULA_E_SEND_ID_ACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_SEND_ID_NACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_AUTH_RES, /* Result of auth procedure */ + VLR_ULA_E_CIPH_RES, /* Result of Ciphering Mode Command */ + VLR_ULA_E_ID_IMSI, /* IMSI recieved from MS */ + VLR_ULA_E_ID_IMEI, /* IMEI received from MS */ + VLR_ULA_E_ID_IMEISV, /* IMEISV received from MS */ + VLR_ULA_E_HLR_LU_RES, /* HLR UpdateLocation result */ + VLR_ULA_E_UPD_HLR_COMPL,/* UpdatE_HLR_VLR result */ + VLR_ULA_E_LU_COMPL_SUCCESS,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_LU_COMPL_FAILURE,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_NEW_TMSI_ACK, /* TMSI Reallocation Complete */ +}; + +enum vlr_ciph_result_cause { + VLR_CIPH_REJECT, /* ? */ + VLR_CIPH_COMPL, +}; + +struct vlr_ciph_result { + enum vlr_ciph_result_cause cause; + const char *imeisv; +}; + +enum vlr_subscr_security_context { + VLR_SEC_CTX_NONE, + VLR_SEC_CTX_GSM, + VLR_SEC_CTX_UMTS, +}; + +enum vlr_lu_type { + VLR_LU_TYPE_PERIODIC, + VLR_LU_TYPE_IMSI_ATTACH, + VLR_LU_TYPE_REGULAR, +}; + +#define OSMO_LBUF_DECL(name, xlen) \ + struct { \ + uint8_t buf[xlen]; \ + size_t len; \ + } name + +struct sgsn_mm_ctx; +struct vlr_instance; + +/* The VLR subscriber is the part of the GSM subscriber state in VLR (CS) or + * SGSN (PS), particularly while interacting with the HLR via GSUP */ +struct vlr_subscr { + struct llist_head list; + struct vlr_instance *vlr; + + /* TODO either populate from HLR or drop this completely? */ + long long unsigned int id; + + /* Data from HLR */ /* 3GPP TS 23.008 */ + /* Always use vlr_subscr_set_imsi() to write to imsi[] */ + char imsi[GSM23003_IMSI_MAX_DIGITS+1]; /* 2.1.1.1 */ + char msisdn[GSM_EXTENSION_LENGTH+1]; /* 2.1.2 */ + char name[GSM_NAME_LENGTH+1]; /* proprietary */ + OSMO_LBUF_DECL(hlr, 16); /* 2.4.7 */ + uint32_t periodic_lu_timer; /* 2.4.24 */ + uint32_t age_indicator; /* 2.17.1 */ + + /* Authentication Data */ + struct gsm_auth_tuple auth_tuples[5]; /* 2.3.1-2.3.4 */ + struct gsm_auth_tuple *last_tuple; + enum vlr_subscr_security_context sec_ctx; + + /* Data local to VLR is below */ + uint32_t tmsi; /* 2.1.4 */ + /* Newly allocated TMSI that was not yet acked by MS */ + uint32_t tmsi_new; + + /* some redundancy in information below? */ + struct osmo_cell_global_id cgi; /* 2.4.16 */ + uint16_t lac; /* 2.4.2 */ + + char imeisv[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.2.3 */ + char imei[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.1.9 */ + bool imsi_detached_flag; /* 2.7.1 */ + bool conf_by_radio_contact_ind; /* 2.7.4.1 */ + bool sub_dataconf_by_hlr_ind; /* 2.7.4.2 */ + bool loc_conf_in_hlr_ind; /* 2.7.4.3 */ + bool dormant_ind; /* 2.7.8 */ + bool cancel_loc_rx; /* 2.7.8A */ + bool ms_not_reachable_flag; /* 2.10.2 (MNRF) */ + bool la_allowed; + + int use_count; + time_t expire_lu; /* FIXME: overlap with periodic_lu_timer/age_indicator */ + + struct osmo_fsm_inst *lu_fsm; + struct osmo_fsm_inst *auth_fsm; + struct osmo_fsm_inst *proc_arq_fsm; + + bool lu_complete; + + void *msc_conn_ref; + + /* PS (SGSN) specific parts */ + struct { + struct llist_head pdp_list; + uint8_t rac; + uint8_t sac; + struct gprs_mm_ctx *mmctx; + } ps; + /* CS (NITB/CSCN) specific parts */ + struct { + /* pending requests */ + bool is_paging; + struct llist_head requests; + } cs; +}; + +enum vlr_proc_arq_result; + +enum vlr_ciph { + VLR_CIPH_NONE, /*< A5/0, no encryption */ + VLR_CIPH_A5_1, /*< A5/1, encryption */ + VLR_CIPH_A5_2, /*< A5/2, deprecated export-grade encryption */ + VLR_CIPH_A5_3, /*< A5/3, 'new secure' encryption */ +}; + +struct vlr_ops { + /* encode + transmit an AUTH REQ towards the MS. + * \param[in] at auth tuple providing rand, key_seq and autn. + * \param[in] send_autn True to send AUTN, for r99 UMTS auth. + */ + int (*tx_auth_req)(void *msc_conn_ref, struct gsm_auth_tuple *at, + bool send_autn); + /* encode + transmit an AUTH REJECT towards the MS */ + int (*tx_auth_rej)(void *msc_conn_ref); + + /* encode + transmit an IDENTITY REQUEST towards the MS */ + int (*tx_id_req)(void *msc_conn_ref, uint8_t mi_type); + + int (*tx_lu_acc)(void *msc_conn_ref, uint32_t send_tmsi); + int (*tx_lu_rej)(void *msc_conn_ref, uint8_t cause); + 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 retrieve_imeisv); + + /* notify MSC/SGSN that the subscriber data in VLR has been updated */ + void (*subscr_update)(struct vlr_subscr *vsub); + /* notify MSC/SGSN that the given subscriber has been associated + * with this msc_conn_ref */ + void (*subscr_assoc)(void *msc_conn_ref, struct vlr_subscr *vsub); +}; + +enum vlr_timer { + VLR_T_3250, + VLR_T_3260, + VLR_T_3270, + _NUM_VLR_TIMERS +}; + +/* An instance of the VLR codebase */ +struct vlr_instance { + struct llist_head subscribers; + struct llist_head operations; + struct gsup_client *gsup_client; + struct vlr_ops ops; + struct { + bool retrieve_imeisv; + bool assign_tmsi; + bool check_imei_rqd; + int auth_tuple_max_use_count; + bool auth_reuse_old_sets_on_error; + bool parq_retrieve_imsi; + bool is_ps; + uint32_t timer[_NUM_VLR_TIMERS]; + } cfg; + /* A free-form pointer for use by the caller */ + void *user_ctx; +}; + +extern const struct value_string vlr_ciph_names[]; +static inline const char *vlr_ciph_name(enum vlr_ciph val) +{ + return get_value_string(vlr_ciph_names, val); +} + +/* Location Updating request */ +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi); + +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi); + +/* tell the VLR that the subscriber connection is gone */ +int vlr_subscr_disconnected(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); +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); +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); +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub); + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops); +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port); + +/* internal use only */ + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event); +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event); + +struct osmo_fsm_inst * +lu_compl_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure); + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +const char *vlr_subscr_msisdn_or_name(struct vlr_subscr *vsub); + +#define vlr_subscr_find_by_imsi(vlr, imsi) \ + _vlr_subscr_find_by_imsi(vlr, imsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_imsi(vlr, imsi, created) \ + _vlr_subscr_find_or_create_by_imsi(vlr, imsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_tmsi(vlr, tmsi) \ + _vlr_subscr_find_by_tmsi(vlr, tmsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created) \ + _vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_msisdn(vlr, msisdn) \ + _vlr_subscr_find_by_msisdn(vlr, msisdn, __BASE_FILE__, __LINE__) + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line); + +#define vlr_subscr_get(sub) _vlr_subscr_get(sub, __BASE_FILE__, __LINE__) +#define vlr_subscr_put(sub) _vlr_subscr_put(sub, __BASE_FILE__, __LINE__) +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line); +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line); + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_free(struct vlr_subscr *vsub); +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub); + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi); +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei); +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv); +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn); + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi); +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi); +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn); +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei); + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer); + +int vlr_subscr_changed(struct vlr_subscr *vsub); +int vlr_subscr_purge(struct vlr_subscr *vsub); +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause); + + +/* Process Acccess Request FSM */ + +enum vlr_proc_arq_result { + VLR_PR_ARQ_RES_NONE, + VLR_PR_ARQ_RES_SYSTEM_FAILURE, + VLR_PR_ARQ_RES_ILLEGAL_SUBSCR, + VLR_PR_ARQ_RES_UNIDENT_SUBSCR, + VLR_PR_ARQ_RES_ROAMING_NOTALLOWED, + VLR_PR_ARQ_RES_ILLEGAL_EQUIP, + VLR_PR_ARQ_RES_UNKNOWN_ERROR, + VLR_PR_ARQ_RES_TIMEOUT, + VLR_PR_ARQ_RES_PASSED, +}; + +extern const struct value_string vlr_proc_arq_result_names[]; +static inline const char *vlr_proc_arq_result_name(enum vlr_proc_arq_result res) +{ + return get_value_string(vlr_proc_arq_result_names, res); +} + +enum proc_arq_vlr_event { + PR_ARQ_E_START, + PR_ARQ_E_ID_IMSI, + PR_ARQ_E_AUTH_RES, + PR_ARQ_E_CIPH_RES, + PR_ARQ_E_UPD_LOC_RES, + PR_ARQ_E_TRACE_RES, + PR_ARQ_E_IMEI_RES, + PR_ARQ_E_PRES_RES, + PR_ARQ_E_TMSI_ACK, +}; + +enum vlr_parq_type { + VLR_PR_ARQ_T_INVALID = 0, /* to guard against unset vars */ + VLR_PR_ARQ_T_CM_SERV_REQ, + VLR_PR_ARQ_T_PAGING_RESP, + /* FIXME: differentiate between services of 24.008 10.5.3.3 */ +}; + +/* Process Access Request (CM SERV REQ / PAGING RESP) */ +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran); + +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi); + +void vlr_parq_fsm_init(void); + +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv); + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr); diff --git a/src/Makefile.am b/src/Makefile.am index cfad7df..c66f9e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,7 @@ # Libraries SUBDIRS = \ libcommon \ + libvlr \ libmgcp \ libbsc \ libmsc \ diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index f29f168..088902a 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -180,6 +180,11 @@ .description = "PCU Interface", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DVLR] = { + .name = "DVLR", + .description = "Visitor Location Register", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static int filter_fn(const struct log_context *ctx, struct log_target *tar) diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c new file mode 100644 index 0000000..91ffe40 --- /dev/null +++ b/src/libmsc/subscr_conn.c @@ -0,0 +1,269 @@ +/* MSC subscriber connection implementation */ + +/* + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +static const struct value_string subscr_conn_fsm_event_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_E_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_E_ACCEPTED), + OSMO_VALUE_STRING(SUBSCR_CONN_E_BUMP), + OSMO_VALUE_STRING(SUBSCR_CONN_E_MO_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CN_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CLOSE_CONF), + { 0, NULL } +}; + +const struct value_string subscr_conn_from_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_LU), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_CM_SERVICE_REQ), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_PAGING_RESP), + { 0, NULL } +}; + +static void paging_resp(struct gsm_subscriber_connection *conn, + enum gsm_paging_event pe) +{ + subscr_paging_dispatch(GSM_HOOK_RR_PAGING, pe, NULL, conn, conn->subscr); +} + +void subscr_conn_fsm_new(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + enum subscr_conn_from from = SUBSCR_CONN_FROM_INVALID; + enum gsm_paging_event pe; + + if (data) { + from = *(enum subscr_conn_from*)data; + LOGPFSM(fi, "%s\n", subscr_conn_from_name(from)); + } + + /* If accepted, transition the state, all other cases mean failure. */ + switch (event) { + case SUBSCR_CONN_E_ACCEPTED: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + break; + + case SUBSCR_CONN_E_MO_CLOSE: + case SUBSCR_CONN_E_CN_CLOSE: + case SUBSCR_CONN_E_CLOSE_CONF: + break; + + default: + LOGPFSM(fi, "Unexpected event: %d %s\n", + event, osmo_fsm_event_name(fi->fsm, event)); + break; + } + + /* if appropriate, signal paging success or failure */ + if (from == SUBSCR_CONN_FROM_PAGING_RESP) { + pe = (fi->state == SUBSCR_CONN_S_ACCEPTED)? + GSM_PAGING_SUCCEEDED : GSM_PAGING_EXPIRED; + paging_resp(conn, pe); + } + + /* On failure, discard the conn */ + if (fi->state != SUBSCR_CONN_S_ACCEPTED) { + /* TODO: on MO_CLOSE or CN_CLOSE, first go to RELEASING and + * await BSC confirmation? */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); + return; + } + + /* On success, handle pending requests and/or close conn */ + + if (from == SUBSCR_CONN_FROM_CM_SERVICE_REQ) { + conn->received_cm_service_request = true; + LOGPFSM(fi, "received_cm_service_request = true\n"); + } + + osmo_fsm_inst_dispatch(fi, SUBSCR_CONN_E_BUMP, data); +} + +#if 0 + case SUBSCR_CONN_E_PARQ_SUCCESS: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + accept_conn = true; + /* fall through */ + case SUBSCR_CONN_E_PARQ_FAILURE: + parq_type = data ? *(enum vlr_parq_type*)data : VLR_PR_ARQ_T_INVALID; + switch (parq_type) { + + case VLR_PR_ARQ_T_CM_SERV_REQ: + accept_conn = handle_cm_serv_result(fi, accept_conn); + break; + + case VLR_PR_ARQ_T_PAGING_RESP: + accept_conn = handle_paging_result(fi, accept_conn); + break; + + default: + LOGPFSML(fi, LOGL_ERROR, + "Invalid VLR Process Access Request type" + " %d\n", parq_type); + accept_conn = false; + break; + } + break; +#endif + +static void subscr_conn_fsm_bump(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + + if (conn->silent_call) + return; + + if (conn->received_cm_service_request) + return; + + /* is this needed? */ + if (conn->subscr && !llist_empty(&conn->subscr->requests)) + return; + + if (trans_has_conn(conn)) + return; + + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_accepted(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case SUBSCR_CONN_E_BUMP: + subscr_conn_fsm_bump(fi, event, data); + return; + + default: + break; + } + /* Whatever unexpected happens in the accepted state, it means release. + * Even if an unexpected event is passed, the safest thing to do is + * discard the conn. We don't expect another SUBSCR_CONN_E_ACCEPTED. */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_release(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = fi->priv; + if (!conn) + return; + + /* temporary hack, see owned_by_msc */ + if (!conn->owned_by_msc) { + DEBUGP(DMM, "%s leaving bsc_subscr_con_free() to bsc_api.c, owned_by_msc = false\n", + subscr_name(conn->subscr)); + return; + } + + DEBUGP(DMM, "%s calling bsc_subscr_con_free(), owned_by_msc = true\n", + subscr_name(conn->subscr)); + gsm0808_clear(conn); + bsc_subscr_con_free(conn); +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state subscr_conn_fsm_states[] = { + [SUBSCR_CONN_S_NEW] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_NEW), + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_ACCEPTED) | + S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_new, + }, + [SUBSCR_CONN_S_ACCEPTED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_ACCEPTED), + /* allow everything to release for any odd behavior */ + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_BUMP) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_accepted, + }, + [SUBSCR_CONN_S_RELEASED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_RELEASED), + .onenter = subscr_conn_fsm_release, + }, +}; + +static struct osmo_fsm subscr_conn_fsm = { + .name = "Subscr_Conn", + .states = subscr_conn_fsm_states, + .num_states = ARRAY_SIZE(subscr_conn_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = subscr_conn_fsm_event_names, +}; + +int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id) +{ + struct osmo_fsm_inst *fi; + OSMO_ASSERT(conn); + + if (conn->conn_fsm) { + LOGP(DMM, LOGL_ERROR, + "%s: Error: connection already in use\n", id); + return -EINVAL; + } + + fi = osmo_fsm_inst_alloc(&subscr_conn_fsm, conn, conn, LOGL_DEBUG, id); + + if (!fi) { + LOGP(DMM, LOGL_ERROR, + "%s: Failed to allocate subscr conn master FSM\n", id); + return -ENOMEM; + } + conn->conn_fsm = fi; + return 0; +} + +bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn) +{ + if (!conn) + return false; + if (!conn->subscr) + return false; + if (!conn->conn_fsm) + return false; + if (conn->conn_fsm->state != SUBSCR_CONN_S_ACCEPTED) + return false; + return true; +} + +void msc_subscr_conn_init(void) +{ + osmo_fsm_register(&subscr_conn_fsm); +} diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index e503291..99d7fb9 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -1053,7 +1053,6 @@ return CMD_WARNING; } - log_set_filter_vlr_subscr(tgt, vlr_subscr); log_set_filter_bsc_subscr(tgt, bsc_subscr); return CMD_SUCCESS; } diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am new file mode 100644 index 0000000..17ad411 --- /dev/null +++ b/src/libvlr/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) + +noinst_HEADERS = \ + vlr_access_req_fsm.h \ + vlr_auth_fsm.h \ + vlr_core.h \ + vlr_lu_fsm.h \ + $(NULL) + +noinst_LIBRARIES = libvlr.a + +libvlr_a_SOURCES = \ + vlr.c \ + vlr_access_req_fsm.c \ + vlr_auth_fsm.c \ + vlr_lu_fsm.c \ + $(NULL) diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c new file mode 100644 index 0000000..0e0d31c --- /dev/null +++ b/src/libvlr/vlr.c @@ -0,0 +1,1108 @@ +/* Osmocom Visitor Location Register (VLR) code base */ + +/* (C) 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define SGSN_SUBSCR_MAX_RETRIES 3 +#define SGSN_SUBSCR_RETRY_INTERVAL 10 + +/*********************************************************************** + * Convenience functions + ***********************************************************************/ + +const struct value_string vlr_ciph_names[] = { + OSMO_VALUE_STRING(VLR_CIPH_NONE), + OSMO_VALUE_STRING(VLR_CIPH_A5_1), + OSMO_VALUE_STRING(VLR_CIPH_A5_2), + OSMO_VALUE_STRING(VLR_CIPH_A5_3), + { 0, NULL } +}; + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer) +{ + uint32_t tidx = 0xffffffff; + + switch (timer) { + case 3270: + tidx = VLR_T_3270; + break; + case 3260: + tidx = VLR_T_3260; + break; + case 3250: + tidx = VLR_T_3250; + break; + } + + OSMO_ASSERT(tidx < sizeof(vlr->cfg.timer)); + return vlr->cfg.timer[tidx]; +} + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!imsi || !*imsi) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_imsi(vsub, imsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (tmsi == GSM_RESERVED_TMSI) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_tmsi(vsub, tmsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!msisdn || !*msisdn) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_msisdn(vsub, msisdn)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +/* Transmit GSUP message to HLR */ +static int vlr_tx_gsup_message(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + struct msgb *msg = gsup_client_msgb_alloc(); + + osmo_gsup_encode(msg, gsup_msg); + + if (!vlr->gsup_client) { + LOGP(DVLR, LOGL_NOTICE, "GSUP link is down, cannot " + "send GSUP: %s\n", msgb_hexdump(msg)); + msgb_free(msg); + return -ENOTSUP; + } + + LOGP(DVLR, LOGL_DEBUG, "GSUP tx: %s\n", + osmo_hexdump_nospc(msg->data, msg->len)); + + return gsup_client_send(vlr->gsup_client, msg); +} + +/* Transmit GSUP message for subscriber to HLR, using IMSI from subscriber */ +static int vlr_subscr_tx_gsup_message(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct vlr_instance *vlr = vsub->vlr; + + if (strlen(gsup_msg->imsi) == 0) + osmo_strlcpy(gsup_msg->imsi, vsub->imsi, sizeof(gsup_msg->imsi)); + + return vlr_tx_gsup_message(vlr, gsup_msg); +} + +/* Transmit GSUP error in response to original message */ +static int vlr_tx_gsup_error_reply(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_orig, + enum gsm48_gmm_cause cause) +{ + struct osmo_gsup_message gsup_reply = {0}; + + osmo_strlcpy(gsup_reply.imsi, gsup_orig->imsi, sizeof(gsup_reply.imsi)); + gsup_reply.cause = cause; + gsup_reply.message_type = + OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type); + + return vlr_tx_gsup_message(vlr, &gsup_reply); +} + +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + OSMO_ASSERT(sub->use_count < INT_MAX); + sub->use_count++; + LOGPSRC(DREF, LOGL_DEBUG, file, line, + "VLR subscr %s usage increases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + return sub; +} + +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + sub->use_count--; + LOGPSRC(DREF, sub->use_count >= 0? LOGL_DEBUG : LOGL_ERROR, + file, line, + "VLR subscr %s usage decreases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + if (sub->use_count <= 0) + vlr_subscr_free(sub); + return NULL; +} + +/* Allocate a new subscriber and insert it into list */ +static struct vlr_subscr *_vlr_subscr_alloc(struct vlr_instance *vlr) +{ + struct vlr_subscr *vsub; + int i; + + vsub = talloc_zero(vlr, struct vlr_subscr); + vsub->vlr = vlr; + vsub->tmsi = GSM_RESERVED_TMSI; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + + INIT_LLIST_HEAD(&vsub->cs.requests); + INIT_LLIST_HEAD(&vsub->ps.pdp_list); + + llist_add_tail(&vsub->list, &vlr->subscribers); + return vsub; +} + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr) +{ + return vlr_subscr_get(_vlr_subscr_alloc(vlr)); +} + +/* Send a GSUP Purge MS request. + * TODO: this should be sent to the *previous* VLR when this VLR is "taking" + * this subscriber, not to the HLR? */ +int vlr_subscr_purge(struct vlr_subscr *vsub) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_PURGE_MS_REQUEST; + + /* provide HLR number in case we know it */ + gsup_msg.hlr_enc_len = vsub->hlr.len; + gsup_msg.hlr_enc = vsub->hlr.buf; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause) +{ + if (!vsub) + return; + + if (vsub->lu_fsm) { + if (vsub->lu_fsm->state == VLR_ULA_S_WAIT_HLR_UPD) + osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_HLR_LU_RES, + (void*)&cause); + else + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_ERROR, + 0); + } + + if (vsub->proc_arq_fsm) + osmo_fsm_inst_term(vsub->proc_arq_fsm, OSMO_FSM_TERM_ERROR, 0); +} + +/* Call vlr_subscr_cancel(), then completely drop the entry from the VLR */ +void vlr_subscr_free(struct vlr_subscr *vsub) +{ + llist_del(&vsub->list); + DEBUGP(DREF, "freeing VLR subscr %s\n", vlr_subscr_name(vsub)); + talloc_free(vsub); +} + +/* Generate a new TMSI and store in vsub->tmsi_new. + * Search all known subscribers to ensure that the TMSI is unique. */ +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub) +{ + struct vlr_instance *vlr = vsub->vlr; + uint32_t tmsi; + int tried; + + for (tried = 0; tried < 100; tried++) { + if (RAND_bytes((uint8_t *) &tmsi, sizeof(tmsi)) != 1) { + LOGP(DVLR, LOGL_ERROR, "RAND_bytes failed\n"); + return -1; + } + /* throw the dice again, if the TSMI doesn't fit */ + if (tmsi == GSM_RESERVED_TMSI) + continue; + + /* Section 2.4 of 23.003: MSC has two MSB 00/01/10, SGSN 11 */ + if (vlr->cfg.is_ps) { + /* SGSN */ + tmsi |= 0xC000000; + } else { + /* MSC */ + if ((tmsi & 0xC0000000) == 0xC0000000) + tmsi &= ~0xC0000000; + } + + /* If this TMSI is already in use, try another one. */ + if (vlr_subscr_find_by_tmsi(vlr, tmsi)) + continue; + + vsub->tmsi_new = tmsi; + return 0; + } + + LOGP(DVLR, LOGL_ERROR, "subscr %s: unable to generate valid TMSI" + " after %d tries\n", vlr_subscr_name(vsub), tried); + return -1; +} + +/* Find subscriber by IMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] imsi IMSI string. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_imsi(vlr, imsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vlr_subscr_set_imsi(vsub, imsi); + LOGP(DVLR, LOGL_INFO, "New subscr, IMSI: %s\n", vsub->imsi); + if (created) + *created = true; + return vsub; +} + +/* Find subscriber by TMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] tmsi TMSI. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_tmsi(vlr, tmsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vsub->tmsi = tmsi; + LOGP(DVLR, LOGL_INFO, "New subscr, TMSI: 0x%08x\n", vsub->tmsi); + if (created) + *created = true; + return vsub; +} + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + vsub->id = atoll(vsub->imsi); + DEBUGP(DVLR, "set IMSI on subscriber; IMSI=%s id=%llu\n", + vsub->imsi, vsub->id); +} + +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imei, imei, sizeof(vsub->imei)); + DEBUGP(DVLR, "set IMEI on subscriber; IMSI=%s IMEI=%s\n", + vsub->imsi, vsub->imei); +} + +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imeisv, imeisv, sizeof(vsub->imeisv)); + DEBUGP(DVLR, "set IMEISV on subscriber; IMSI=%s IMEISV=%s\n", + vsub->imsi, vsub->imeisv); +} + +/* Safely copy the given MSISDN string to vsub->msisdn */ +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->msisdn, msisdn, sizeof(vsub->msisdn)); + DEBUGP(DVLR, "set MSISDN on subscriber; IMSI=%s MSISDN=%s\n", + vsub->imsi, vsub->msisdn); +} + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + return vsub && imsi && vsub->imsi[0] && !strcmp(vsub->imsi, imsi); +} + +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi) +{ + return vsub && tmsi != GSM_RESERVED_TMSI + && (vsub->tmsi == tmsi || vsub->tmsi_new == tmsi); +} + +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + return vsub && msisdn && vsub->msisdn[0] + && !strcmp(vsub->msisdn, msisdn); +} + +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei) +{ + return vsub && imei && vsub->imei[0] + && !strcmp(vsub->imei, imei); +} + +/* Send updated subscriber information to HLR */ +int vlr_subscr_changed(struct vlr_subscr *vsub) +{ + /* FIXME */ + LOGP(DVLR, LOGL_ERROR, "Not implemented: %s\n", __func__); + return 0; +} + +/*********************************************************************** + * PDP context data + ***********************************************************************/ + +struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_alloc(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data* pdata; + + pdata = talloc_zero(vsub, struct sgsn_subscriber_pdp_data); + + llist_add_tail(&pdata->list, &vsub->ps.pdp_list); + + return pdata; +} + +static int vlr_subscr_pdp_data_clear(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data *pdp, *pdp2; + int count = 0; + + llist_for_each_entry_safe(pdp, pdp2, &vsub->ps.pdp_list, list) { + llist_del(&pdp->list); + talloc_free(pdp); + count += 1; + } + + return count; +} + +static struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_get_by_id(struct vlr_subscr *vsub, unsigned context_id) +{ + struct sgsn_subscriber_pdp_data *pdp; + + llist_for_each_entry(pdp, &vsub->ps.pdp_list, list) { + if (pdp->context_id == context_id) + return pdp; + } + + return NULL; +} + +/*********************************************************************** + * Actual Implementation + ***********************************************************************/ + +static int vlr_rx_gsup_unknown_imsi(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup_msg->message_type)) { + vlr_tx_gsup_error_reply(vlr, gsup_msg, + GMM_CAUSE_IMSI_UNKNOWN); + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP request " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } else if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP error " + "of type 0x%02x, cause '%s' (%d)\n", + gsup_msg->imsi, gsup_msg->message_type, + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + } else { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP response " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } + + return -GMM_CAUSE_IMSI_UNKNOWN; +} + +static int vlr_rx_gsup_purge_no_subscr(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGGSUPP(LOGL_NOTICE, gsup_msg, + "Purge MS has failed with cause '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + return -gsup_msg->cause; + } + LOGGSUPP(LOGL_INFO, gsup_msg, "Completing purge MS\n"); + return 0; +} + +/* VLR internal call to request UpdateLocation from HLR */ +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps) +{ + struct osmo_gsup_message gsup_msg = {0}; + int rc; + + gsup_msg.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; + rc = vlr_subscr_tx_gsup_message(vsub, &gsup_msg); + + return rc; +} + +/* VLR internal call to request tuples from HLR */ +int vlr_subscr_req_sai(struct vlr_subscr *vsub, + const uint8_t *auts, const uint8_t *auts_rand) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; + gsup_msg.auts = auts; + gsup_msg.rand = auts_rand; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +/* Tell HLR that authentication failure occurred */ +int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub) +{ + 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)); + return vlr_tx_gsup_message(vsub->vlr, &gsup_msg); +} + +/* Update the subscriber with GSUP-received auth tuples */ +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + unsigned int i; + unsigned int got_tuples; + + if (gsup->num_auth_vectors) { + memset(&vsub->auth_tuples, 0, sizeof(vsub->auth_tuples)); + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + } + + got_tuples = 0; + for (i = 0; i < gsup->num_auth_vectors; i++) { + size_t key_seq = i; + + if (key_seq >= ARRAY_SIZE(vsub->auth_tuples)) { + LOGVSUBP(LOGL_NOTICE, vsub, + "Skipping auth tuple wih invalid cksn %zu\n", + key_seq); + continue; + } + vsub->auth_tuples[i].vec = gsup->auth_vectors[i]; + vsub->auth_tuples[i].key_seq = key_seq; + got_tuples ++; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "Received %u auth tuples\n", got_tuples); + + if (!got_tuples) { + /* FIXME what now? */ + // vlr_subscr_cancel(vsub, GMM_CAUSE_GSM_AUTH_UNACCEPT); ? + } + + /* New tuples means last_tuple becomes invalid */ + vsub->last_tuple = NULL; +} + +/* Handle SendAuthInfo Result/Error from HLR */ +static int vlr_subscr_handle_sai_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + void *data = (void *) gsup; + + switch (gsup->message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_ACK, data); + break; + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_NACK, data); + break; + default: + return -1; + } + + return 0; +} + +static int decode_bcd_number_safe(char *output, int output_len, + const uint8_t *bcd_lv, int input_len, + int h_len) +{ + uint8_t len; + OSMO_ASSERT(output_len >= 1); + *output = '\0'; + if (input_len < 1) + return -EIO; + len = bcd_lv[0]; + if (input_len < len) + return -EIO; + return gsm48_decode_bcd_number(output, output_len, bcd_lv, h_len); +} + +static void vlr_subscr_gsup_insert_data(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup_msg) +{ + unsigned idx; + int rc; + + if (gsup_msg->msisdn_enc) { + decode_bcd_number_safe(vsub->msisdn, sizeof(vsub->msisdn), + gsup_msg->msisdn_enc, + gsup_msg->msisdn_enc_len, 0); + LOGP(DVLR, LOGL_DEBUG, "IMSI:%s has MSISDN:%s\n", + vsub->imsi, vsub->msisdn); + } + + if (gsup_msg->hlr_enc) { + if (gsup_msg->hlr_enc_len > sizeof(vsub->hlr.buf)) { + LOGP(DVLR, LOGL_ERROR, "HLR-Number too long (%zu)\n", + gsup_msg->hlr_enc_len); + vsub->hlr.len = 0; + } else { + memcpy(vsub->hlr.buf, gsup_msg->hlr_enc, + gsup_msg->hlr_enc_len); + vsub->hlr.len = gsup_msg->hlr_enc_len; + } + } + + if (gsup_msg->pdp_info_compl) { + rc = vlr_subscr_pdp_data_clear(vsub); + if (rc > 0) + LOGP(DVLR, LOGL_INFO, "Cleared existing PDP info\n"); + } + + for (idx = 0; idx < gsup_msg->num_pdp_infos; idx++) { + const struct osmo_gsup_pdp_info *pdp_info = &gsup_msg->pdp_infos[idx]; + size_t ctx_id = pdp_info->context_id; + struct sgsn_subscriber_pdp_data *pdp_data; + + if (pdp_info->apn_enc_len >= sizeof(pdp_data->apn_str)-1) { + LOGVSUBP(LOGL_ERROR, vsub, + "APN too long, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, + pdp_info->apn_enc_len)); + continue; + } + + if (pdp_info->qos_enc_len > sizeof(pdp_data->qos_subscribed)) { + LOGVSUBP(LOGL_ERROR, vsub, + "QoS info too long (%zu)\n", + pdp_info->qos_enc_len); + continue; + } + + LOGVSUBP(LOGL_INFO, vsub, + "Will set PDP info, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, pdp_info->apn_enc_len)); + + /* Set PDP info [ctx_id] */ + pdp_data = vlr_subscr_pdp_data_get_by_id(vsub, ctx_id); + if (!pdp_data) { + pdp_data = vlr_subscr_pdp_data_alloc(vsub); + pdp_data->context_id = ctx_id; + } + + OSMO_ASSERT(pdp_data != NULL); + pdp_data->pdp_type = pdp_info->pdp_type; + osmo_apn_to_str(pdp_data->apn_str, + pdp_info->apn_enc, pdp_info->apn_enc_len); + memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); + pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + } +} + + +/* Handle InsertSubscrData Result from HLR */ +static int vlr_subscr_handle_isd_req(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_gsup_message gsup_reply = {0}; + + vlr_subscr_gsup_insert_data(vsub, gsup); + vsub->vlr->ops.subscr_update(vsub); + + gsup_reply.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; + return vlr_subscr_tx_gsup_message(vsub, &gsup_reply); +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Result " + "without LU in progress\n"); + return -ENODEV; + } + + /* contrary to MAP, we allow piggy-backing subscriber data onto the + * UPDATE LOCATION RESULT, and don't mandate the use of a separate + * nested INSERT SUBSCRIBER DATA transaction */ + vlr_subscr_gsup_insert_data(vsub, gsup); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, NULL); + + return 0; +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_err(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Error " + "without LU in progress\n"); + return -ENODEV; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "UpdateLocation failed; gmm_cause: %s\n", + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, + (void *)&gsup->cause); + + return 0; +} + +/* Handle LOCATION CANCEL request from HLR */ +static int vlr_subscr_handle_cancel_req(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct osmo_gsup_message gsup_reply = {0}; + int is_update_procedure = !gsup_msg->cancel_type || + gsup_msg->cancel_type == OSMO_GSUP_CANCEL_TYPE_UPDATE; + + LOGVSUBP(LOGL_INFO, vsub, "Cancelling MS subscriber (%s)\n", + is_update_procedure ? + "update procedure" : "subscription withdraw"); + + gsup_reply.message_type = OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT; + vlr_subscr_tx_gsup_message(vsub, &gsup_reply); + + vlr_subscr_cancel(vsub, gsup_msg->cause); + + return 0; +} + +/* Incoming handler for GSUP from HLR. + * Keep this function non-static for direct invocation by unit tests. */ +int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +{ + struct vlr_instance *vlr = (struct vlr_instance *) gsupc->data; + struct vlr_subscr *vsub; + struct osmo_gsup_message gsup; + int rc; + + DEBUGP(DVLR, "GSUP rx %u: %s\n", msgb_l2len(msg), + osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup); + if (rc < 0) { + LOGP(DVLR, LOGL_ERROR, + "decoding GSUP message fails with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return rc; + } + + if (!gsup.imsi[0]) { + LOGP(DVLR, LOGL_ERROR, "Missing IMSI in GSUP message\n"); + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup.message_type)) + vlr_tx_gsup_error_reply(vlr, &gsup, + GMM_CAUSE_INV_MAND_INFO); + return -GMM_CAUSE_INV_MAND_INFO; + } + + vsub = vlr_subscr_find_by_imsi(vlr, gsup.imsi); + if (!vsub) { + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + return vlr_rx_gsup_purge_no_subscr(vlr, &gsup); + default: + return vlr_rx_gsup_unknown_imsi(vlr, &gsup); + } + } + + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + rc = vlr_subscr_handle_sai_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: + rc = vlr_subscr_handle_isd_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST: + rc = vlr_subscr_handle_cancel_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: + rc = vlr_subscr_handle_lu_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: + rc = vlr_subscr_handle_lu_err(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_DELETE_DATA_REQUEST: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not yet implemented\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + default: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not valid at VLR/SGSN side\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + } + + vlr_subscr_put(vsub); + return rc; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_id_resp(struct vlr_subscr *vsub, + const uint8_t *mi, size_t mi_len) +{ + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type = mi[0] & GSM_MI_TYPE_MASK; + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); + + /* update the vlr_subscr with the given identity */ + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else + vlr_subscr_set_imsi(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEI: + vlr_subscr_set_imei(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEISV: + vlr_subscr_set_imeisv(vsub, mi_string); + break; + } + + if (vsub->auth_fsm) { + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + osmo_fsm_inst_dispatch(vsub->auth_fsm, + VLR_AUTH_E_MS_ID_IMSI, mi_string); + break; + } + } + + if (vsub->lu_fsm) { + uint32_t event = 0; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + event = VLR_ULA_E_ID_IMSI; + break; + case GSM_MI_TYPE_IMEI: + event = VLR_ULA_E_ID_IMEI; + break; + case GSM_MI_TYPE_IMEISV: + event = VLR_ULA_E_ID_IMEISV; + break; + default: + OSMO_ASSERT(0); + break; + } + osmo_fsm_inst_dispatch(vsub->lu_fsm, event, mi_string); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, "gratuitous ID RESPONSE?!?\n"); + } + + return 0; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_tmsi_reall_compl(struct vlr_subscr *vsub) +{ + if (vsub->lu_fsm) { + return osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_NEW_TMSI_ACK, NULL); + } else if (vsub->proc_arq_fsm) { + return osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, + PR_ARQ_E_TMSI_ACK, NULL); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, + "gratuitous TMSI REALLOC COMPL"); + return -EINVAL; + } +} + +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); + } + return 0; +} + +/* Tear down any running FSMs due to MSC connection timeout. + * Visit all vsub->*_fsm pointers and give them a queue to send a final reject + * message before the entire connection is torn down. + * \param[in] vsub subscriber to tear down + */ +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub) +{ + if (!vsub) + return; + + vlr_loc_update_conn_timeout(vsub->lu_fsm); + vlr_parq_conn_timeout(vsub->proc_arq_fsm); +} + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops) +{ + struct vlr_instance *vlr = talloc_zero(ctx, struct vlr_instance); + OSMO_ASSERT(vlr); + OSMO_ASSERT(ops->tx_auth_req); + OSMO_ASSERT(ops->tx_auth_rej); + OSMO_ASSERT(ops->tx_id_req); + OSMO_ASSERT(ops->tx_lu_acc); + OSMO_ASSERT(ops->tx_lu_rej); + OSMO_ASSERT(ops->tx_cm_serv_acc); + OSMO_ASSERT(ops->tx_cm_serv_rej); + OSMO_ASSERT(ops->set_ciph_mode); + OSMO_ASSERT(ops->subscr_update); + OSMO_ASSERT(ops->subscr_assoc); + + INIT_LLIST_HEAD(&vlr->subscribers); + INIT_LLIST_HEAD(&vlr->operations); + memcpy(&vlr->ops, ops, sizeof(vlr->ops)); + + /* osmo_auth_fsm.c */ + osmo_fsm_register(&vlr_auth_fsm); + /* osmo_lu_fsm.c */ + vlr_lu_fsm_init(); + /* vlr_access_request_fsm.c */ + vlr_parq_fsm_init(); + + return vlr; +} + +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port) +{ + OSMO_ASSERT(vlr); + + vlr->gsup_client = gsup_client_create(gsup_unit_name, + gsup_server_addr_str, + gsup_server_port, + &vlr_gsupc_read_cb, NULL); + if (!vlr->gsup_client) + return -ENOMEM; + vlr->gsup_client->data = vlr; + + return 0; +} + +/* MSC->VLR: Subscribre has disconnected */ +int vlr_subscr_disconnected(struct vlr_subscr *vsub) +{ + /* This corresponds to a MAP-ABORT from MSC->VLR on a classic B + * interface */ + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_REQUEST, NULL); + osmo_fsm_inst_term(vsub->auth_fsm, OSMO_FSM_TERM_REQUEST, NULL); + vsub->msc_conn_ref = NULL; + + return 0; +} + +/* MSC->VLR: Receive Authentication Failure from Subscriber */ +int vlr_subscr_rx_auth_fail(struct vlr_subscr *vsub, const uint8_t *auts) +{ + struct vlr_auth_resp_par par = {0}; + par.auts = auts; + + osmo_fsm_inst_dispatch(vsub->auth_fsm, VLR_AUTH_E_MS_AUTH_FAIL, &par); + return 0; +} + +/* MSC->VLR: Receive Authentication Response from MS + * \returns 1 in case of success, 0 in case of delay, -1 on auth error */ +int vlr_subscr_rx_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, uint8_t res_len) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + struct vlr_auth_resp_par par; + + par.is_r99 = is_r99; + par.is_utran = is_utran; + par.res = res; + par.res_len = res_len; + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_MS_AUTH_RESP, (void *) &par); + + return 0; +} + +/* MSC->VLR: Receive result of Ciphering Mode Command from MS */ +void vlr_subscr_rx_ciph_res(struct vlr_subscr *vsub, struct vlr_ciph_result *res) +{ + if (vsub->lu_fsm && vsub->lu_fsm->state == VLR_ULA_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_CIPH_RES, res); + if (vsub->proc_arq_fsm + && vsub->proc_arq_fsm->state == PR_ARQ_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, PR_ARQ_E_CIPH_RES, + res); +} + +/* Internal evaluation of requested ciphering mode. + * Send set_ciph_mode() to MSC depending on the ciph_mode argument. + * \param[in] vlr VLR instance. + * \param[in] fi Calling FSM instance, for logging. + * \param[in] msc_conn_ref MSC conn to send to. + * \param[in] ciph_mode Ciphering config, to decide whether to do ciphering. + * \returns 0 if no ciphering is needed or message was sent successfully, + * or a negative value if ciph_mode is invalid or sending failed. + */ +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv) +{ + switch (ciph_mode) { + case VLR_CIPH_NONE: + return 0; + + case VLR_CIPH_A5_1: + case VLR_CIPH_A5_3: + return vlr->ops.set_ciph_mode(msc_conn_ref, + ciph_mode, + 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; + } +} + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr) +{ + struct vlr_subscr **fsub = (void*)&target->filter_data[LOG_FLT_VLR_SUBSCR]; + + /* free the old data */ + if (*fsub) { + vlr_subscr_put(*fsub); + *fsub = NULL; + } + + if (vlr_subscr) { + target->filter_map |= (1 << LOG_FLT_VLR_SUBSCR); + *fsub = vlr_subscr_get(vlr_subscr); + } else + target->filter_map &= ~(1 << LOG_FLT_VLR_SUBSCR); +} diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c new file mode 100644 index 0000000..a64f193 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.c @@ -0,0 +1,778 @@ +/* Osmocom Visitor Location Register (VLR): Access Request FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define S(x) (1 << (x)) + +/*********************************************************************** + * Process_Access_Request_VLR, TS 29.002 Chapter 25.4.2 + ***********************************************************************/ + +const struct value_string vlr_proc_arq_result_names[] = { + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_NONE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_SYSTEM_FAILURE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNIDENT_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ROAMING_NOTALLOWED), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_EQUIP), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNKNOWN_ERROR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_TIMEOUT), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_PASSED), + { 0, NULL } +}; + +static const struct value_string proc_arq_vlr_event_names[] = { + OSMO_VALUE_STRING(PR_ARQ_E_START), + OSMO_VALUE_STRING(PR_ARQ_E_ID_IMSI), + OSMO_VALUE_STRING(PR_ARQ_E_AUTH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_CIPH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_UPD_LOC_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TRACE_RES), + OSMO_VALUE_STRING(PR_ARQ_E_IMEI_RES), + OSMO_VALUE_STRING(PR_ARQ_E_PRES_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TMSI_ACK), + { 0, NULL } +}; + +struct proc_arq_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *ul_child_fsm; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + + enum vlr_parq_type type; + enum vlr_proc_arq_result result; + bool by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool implicitly_accepted_parq_by_ciphering_cmd; +}; + +static void assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + + vsub->msc_conn_ref = par->msc_conn_ref; + par->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(par->msc_conn_ref, par->vsub); +} + +#define proc_arq_fsm_done(fi, res) _proc_arq_fsm_done(fi, res, __FILE__, __LINE__) +static void _proc_arq_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_proc_arq_result res, + const char *file, int line) +{ + struct proc_arq_priv *par = fi->priv; + LOGPFSMSRC(fi, file, line, "proc_arq_fsm_done(%s)\n", + vlr_proc_arq_result_name(res)); + par->result = res; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_DONE, 0, 0); +} + +static void proc_arq_vlr_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct proc_arq_priv *par = fi->priv; + bool success; + int rc; + LOGPFSM(fi, "Process Access Request result: %s\n", + vlr_proc_arq_result_name(par->result)); + + success = (par->result == VLR_PR_ARQ_RES_PASSED); + + /* It would be logical to first dispatch the success event to the + * parent FSM, but that could start actions that send messages to the + * MS. Rather send the CM Service Accept message first and then signal + * success. Since messages are handled synchronously, the success event + * will be processed before we handle new incoming data from the MS. */ + + if (par->type == VLR_PR_ARQ_T_CM_SERV_REQ) { + if (success + && !par->implicitly_accepted_parq_by_ciphering_cmd) { + rc = par->vlr->ops.tx_cm_serv_acc(par->msc_conn_ref); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Accept\n"); + success = false; + } + } + if (!success) { + rc = par->vlr->ops.tx_cm_serv_rej(par->msc_conn_ref, + par->result); + if (rc) + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Reject\n"); + } + } + + /* For VLR_PR_ARQ_T_PAGING_RESP, there is nothing to send. The conn_fsm + * will start handling pending paging transactions. */ + + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + success ? par->parent_event_success + : par->parent_event_failure, + par->parent_event_data); +} + +void proc_arq_vlr_cleanup(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause) +{ + struct proc_arq_priv *par = fi->priv; + if (par->vsub && par->vsub->proc_arq_fsm == fi) + par->vsub->proc_arq_fsm = NULL; +} + +static void _proc_arq_vlr_post_imei(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + /* TODO: Identity := IMSI */ + if (0 /* TODO: TMSI reallocation at access: vlr->cfg.alloc_tmsi_arq */) { + vlr_subscr_alloc_tmsi(vsub); + /* TODO: forward TMSI to MS, wait for TMSI + * REALLOC COMPLETE */ + /* TODO: Freeze old TMSI */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TMSI_ACK, 0, 0); + return; + } + + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static void _proc_arq_vlr_post_trace(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + /* Node 3 */ + if (0 /* IMEI check required */) { + /* Chck_IMEI_VLR */ + vlr->ops.tx_id_req(par->msc_conn_ref, GSM_MI_TYPE_IMEI); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CHECK_IMEI, + vlr_timer(vlr, 3270), 3270); + } else + _proc_arq_vlr_post_imei(fi); +} + +/* After Subscriber_Present_VLR */ +static void _proc_arq_vlr_post_pres(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + if (0 /* TODO: tracing required */) { + /* TODO: Trace_Subscriber_Activity_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TRACE_SUB, 0, 0); + } + _proc_arq_vlr_post_trace(fi); +} + +/* After Update_Location_Child_VLR */ +static void _proc_arq_vlr_node2_post_vlr(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!vsub->sub_dataconf_by_hlr_ind) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + if (0 /* roaming not allowed in LA */) { + /* Set User Error: Roaming not allowed in this LA */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ROAMING_NOTALLOWED); + return; + } + vsub->imsi_detached_flag = false; + if (vsub->ms_not_reachable_flag) { + /* Start Subscriber_Present_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_SUB_PRES, 0, 0); + par->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + PR_ARQ_E_PRES_RES); + return; + } + _proc_arq_vlr_post_pres(fi); +} + +static void _proc_arq_vlr_node2_post_ciph(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + vsub->conf_by_radio_contact_ind = true; + if (vsub->loc_conf_in_hlr_ind == false) { + /* start Update_Location_Child_VLR. WE use + * Update_HLR_VLR instead, the differences appear + * insignificant for now. */ + par->ul_child_fsm = upd_hlr_vlr_proc_start(fi, vsub, + PR_ARQ_E_UPD_LOC_RES); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_UPD_LOC_CHILD, 0, 0); + return; + } + _proc_arq_vlr_node2_post_vlr(fi); +} + +static bool is_ciph_required(struct proc_arq_priv *par) +{ + return par->ciphering_required != VLR_CIPH_NONE; +} + +static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!is_ciph_required(par)) { + _proc_arq_vlr_node2_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, par->msc_conn_ref, + par->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_SYSTEM_FAILURE); + return; + } + + par->implicitly_accepted_parq_by_ciphering_cmd = true; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CIPH, 0, 0); +} + +static bool is_auth_required(struct proc_arq_priv *par) +{ + /* 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); +} + +/* after the IMSI is known */ +static void proc_arq_vlr_fn_post_imsi(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + /* TODO: Identity IMEI -> System Failure */ + if (is_auth_required(par)) { + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_AUTH, + 0, 0); + vsub->auth_fsm = auth_fsm_start(vsub, fi->log_level, fi, + PR_ARQ_E_AUTH_RES, + par->is_r99, + par->is_utran); + } else { + _proc_arq_vlr_node2(fi); + } +} + +static void proc_arq_vlr_fn_init(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub = NULL; + + OSMO_ASSERT(event == PR_ARQ_E_START); + + /* Obtain_Identity_VLR */ + if (!par->by_tmsi) { + /* IMSI was included */ + vsub = vlr_subscr_find_by_imsi(par->vlr, par->imsi); + } else { + /* TMSI was included */ + vsub = vlr_subscr_find_by_tmsi(par->vlr, par->tmsi); + } + if (vsub) { + if (vsub->proc_arq_fsm && fi != vsub->proc_arq_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "Another proc_arq_fsm is already" + " associated with subscr %s," + " terminating the other FSM.\n", + vlr_subscr_name(vsub)); + proc_arq_fsm_done(vsub->proc_arq_fsm, + VLR_PR_ARQ_RES_SYSTEM_FAILURE); + } + vsub->proc_arq_fsm = fi; + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); + return; + } + /* No VSUB could be resolved. What now? */ + + if (!par->by_tmsi) { + /* We couldn't find a subscriber even by IMSI, + * Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } else { + /* TMSI was included, are we permitted to use it? */ + if (vlr->cfg.parq_retrieve_imsi) { + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_OBTAIN_IMSI, + vlr_timer(vlr, 3270), 3270); + return; + } else { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + } +} + +/* ID REQ(IMSI) has returned */ +static void proc_arq_vlr_fn_w_obt_imsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub; + + OSMO_ASSERT(event == PR_ARQ_E_ID_IMSI); + + vsub = vlr_subscr_find_by_imsi(vlr, par->imsi); + if (!vsub) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); +} + +/* Authenticate_VLR has completed */ +static void proc_arq_vlr_fn_w_auth(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + enum vlr_auth_fsm_result res; + enum vlr_proc_arq_result ret; + + OSMO_ASSERT(event == PR_ARQ_E_AUTH_RES); + + res = data ? *(enum vlr_auth_fsm_result*)data : -1; + LOGPFSM(fi, "got %s\n", vlr_auth_fsm_result_name(res)); + + switch (res) { + case VLR_AUTH_RES_PASSED: + /* Node 2 */ + _proc_arq_vlr_node2(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* Error */ + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* Set User Error: Unidentified Subscriber */ + ret = VLR_PR_ARQ_RES_UNIDENT_SUBSCR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* Set User Error: Illegal Subscriber */ + ret = VLR_PR_ARQ_RES_ILLEGAL_SUBSCR; + break; + case VLR_AUTH_RES_PROC_ERR: + /* Set User Error: System failure */ + ret = VLR_PR_ARQ_RES_SYSTEM_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "Unexpected vlr_auth_fsm_result value: %d (data=%p)\n", res, data); + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + } + + /* send process_access_req response to caller, enter error state */ + proc_arq_fsm_done(fi, ret); +} + +static void proc_arq_vlr_fn_w_ciph(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == PR_ARQ_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + } + + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + _proc_arq_vlr_node2_post_ciph(fi); +} + +/* Update_Location_Child_VLR has completed */ +static void proc_arq_vlr_fn_w_upd_loc(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_UPD_LOC_RES); + + _proc_arq_vlr_node2_post_vlr(fi); +} + +/* Subscriber_Present_VLR has completed */ +static void proc_arq_vlr_fn_w_pres(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_PRES_RES); + + _proc_arq_vlr_post_pres(fi); +} + +static void proc_arq_vlr_fn_w_trace(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TRACE_RES); + + _proc_arq_vlr_post_trace(fi); +} + +/* we have received the ID RESPONSE (IMEI) */ +static void proc_arq_vlr_fn_w_imei(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_IMEI_RES); + + _proc_arq_vlr_post_imei(fi); +} + +/* MSC tells us that MS has acknowleded TMSI re-allocation */ +static void proc_arq_vlr_fn_w_tmsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TMSI_ACK); + + /* FIXME: check confirmation? unfreeze? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static const struct osmo_fsm_state proc_arq_vlr_states[] = { + [PR_ARQ_S_INIT] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_INIT), + .in_event_mask = S(PR_ARQ_E_START), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_OBTAIN_IMSI) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_init, + }, + [PR_ARQ_S_WAIT_OBTAIN_IMSI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_OBTAIN_IMSI), + .in_event_mask = S(PR_ARQ_E_ID_IMSI), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_obt_imsi, + }, + [PR_ARQ_S_WAIT_AUTH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_AUTH), + .in_event_mask = S(PR_ARQ_E_AUTH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CIPH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_auth, + }, + [PR_ARQ_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CIPH), + .in_event_mask = S(PR_ARQ_E_CIPH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_ciph, + }, + [PR_ARQ_S_WAIT_UPD_LOC_CHILD] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_UPD_LOC_CHILD), + .in_event_mask = S(PR_ARQ_E_UPD_LOC_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_upd_loc, + }, + [PR_ARQ_S_WAIT_SUB_PRES] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_SUB_PRES), + .in_event_mask = S(PR_ARQ_E_PRES_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_pres, + }, + [PR_ARQ_S_WAIT_TRACE_SUB] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TRACE_SUB), + .in_event_mask = S(PR_ARQ_E_TRACE_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_trace, + }, + [PR_ARQ_S_WAIT_CHECK_IMEI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CHECK_IMEI), + .in_event_mask = S(PR_ARQ_E_IMEI_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_imei, + }, + [PR_ARQ_S_WAIT_TMSI_ACK] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TMSI_ACK), + .in_event_mask = S(PR_ARQ_E_TMSI_ACK), + .out_state_mask = S(PR_ARQ_S_DONE), + .action = proc_arq_vlr_fn_w_tmsi, + }, + [PR_ARQ_S_DONE] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_DONE), + .onenter = proc_arq_vlr_dispatch_result, + }, +}; + +static struct osmo_fsm proc_arq_vlr_fsm = { + .name = "Process_Access_Request_VLR", + .states = proc_arq_vlr_states, + .num_states = ARRAY_SIZE(proc_arq_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = proc_arq_vlr_event_names, + .cleanup = proc_arq_vlr_cleanup, +}; + +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct proc_arq_priv *par; + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type; + + fi = osmo_fsm_inst_alloc_child(&proc_arq_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return; + + par = talloc_zero(fi, struct proc_arq_priv); + fi->priv = par; + par->vlr = vlr; + par->msc_conn_ref = msc_conn_ref; + par->type = type; + par->lai = *lai; + par->parent_event_success = parent_event_success; + par->parent_event_failure = parent_event_failure; + par->parent_event_data = parent_event_data; + par->authentication_required = authentication_required; + par->ciphering_required = ciphering_required; + par->is_r99 = is_r99; + par->is_utran = is_utran; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi_lv+1, mi_lv[0]); + mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); + par->imsi[sizeof(par->imsi)-1] = '\0'; + par->by_tmsi = false; + break; + case GSM_MI_TYPE_TMSI: + par->by_tmsi = true; + par->tmsi = osmo_load32be(mi_lv+2); + break; + case GSM_MI_TYPE_IMEI: + /* TODO: IMEI (emergency call) */ + default: + /* FIXME: directly send reject? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + + osmo_fsm_inst_dispatch(fi, PR_ARQ_E_START, NULL); +} + +/* Gracefully terminate an FSM created by vlr_proc_acc_req() in case of + * external timeout (i.e. from MSC). */ +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == PR_ARQ_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_TIMEOUT); +} + + +#if 0 +/*********************************************************************** + * Update_Location_Child_VLR, TS 29.002 Chapter 25.4.4 + ***********************************************************************/ + +enum upd_loc_child_vlr_state { + ULC_S_IDLE, + ULC_S_WAIT_HLR_RESP, + ULC_S_DONE, +}; + +enum upd_loc_child_vlr_event { + ULC_E_START, +}; + +static const struct value_string upd_loc_child_vlr_event_names[] = { + { ULC_E_START, "START" }, + { 0, NULL } +}; + +static void upd_loc_child_f_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + OSMO_ASSERT(event == ULC_E_START); + + /* send update location */ +} + +static void upd_loc_child_f_w_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ +} + +static const struct osmo_fsm_state upd_loc_child_vlr_states[] = { + [ULC_S_IDLE] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_WAIT_HLR_RESP) | + S(ULC_S_DONE), + .name = "IDLE", + .action = upd_loc_child_f_idle, + }, + [ULC_S_WAIT_HLR_RESP] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_DONE), + .name = "WAIT-HLR-RESP", + .action = upd_loc_child_f_w_hlr, + }, + [ULC_S_DONE] = { + .name = "DONE", + }, +}; + +static struct osmo_fsm upd_loc_child_vlr_fsm = { + .name = "Update_Location_Child_VLR", + .states = upd_loc_child_vlr_states, + .num_states = ARRAY_SIZE(upd_loc_child_vlr_states), + .log_subsys = DVLR, + .event_names = upd_loc_child_vlr_event_names, +}; +#endif + +void vlr_parq_fsm_init(void) +{ + //osmo_fsm_register(&upd_loc_child_vlr_fsm); + osmo_fsm_register(&proc_arq_vlr_fsm); +} diff --git a/src/libvlr/vlr_access_req_fsm.h b/src/libvlr/vlr_access_req_fsm.h new file mode 100644 index 0000000..8386da6 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.h @@ -0,0 +1,17 @@ +#pragma once + +enum proc_arq_vlr_state { + PR_ARQ_S_INIT, + /* Waiting for Obtain_Identity_VLR (IMSI) result */ + PR_ARQ_S_WAIT_OBTAIN_IMSI, + /* Waiting for Authenticate_VLR result */ + PR_ARQ_S_WAIT_AUTH, + PR_ARQ_S_WAIT_CIPH, + PR_ARQ_S_WAIT_UPD_LOC_CHILD, + PR_ARQ_S_WAIT_SUB_PRES, + PR_ARQ_S_WAIT_TRACE_SUB, + PR_ARQ_S_WAIT_CHECK_IMEI, + PR_ARQ_S_WAIT_TMSI_ACK, + PR_ARQ_S_WAIT_CECK_CONF, + PR_ARQ_S_DONE, +}; diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c new file mode 100644 index 0000000..0eb86e7 --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.c @@ -0,0 +1,605 @@ +/* Osmocom Visitor Location Register (VLR) Autentication FSM */ + +/* (C) 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 +#include +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" + +#define S(x) (1 << (x)) + +static const struct value_string fsm_auth_event_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_E_START), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_NACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ABORT), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_RESP), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_FAIL), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_ID_IMSI), + { 0, NULL } +}; + +const struct value_string vlr_auth_fsm_result_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_RES_ABORTED), + OSMO_VALUE_STRING(VLR_AUTH_RES_UNKNOWN_SUBSCR), + OSMO_VALUE_STRING(VLR_AUTH_RES_PROC_ERR), + OSMO_VALUE_STRING(VLR_AUTH_RES_AUTH_FAILED), + OSMO_VALUE_STRING(VLR_AUTH_RES_PASSED), + {0, NULL} +}; + +/* private state of the auth_fsm_instance */ +struct auth_fsm_priv { + struct vlr_subscr *vsub; + bool by_imsi; + bool is_r99; + bool is_utran; + bool auth_requested; + + int auth_tuple_max_use_count; /* see vlr->cfg instead */ +}; + +/*********************************************************************** + * Utility functions + ***********************************************************************/ + +/* Always use either vlr_subscr_get_auth_tuple() or vlr_subscr_has_auth_tuple() + * instead, to ensure proper use count. + * Return an auth tuple with the lowest use_count among the auth tuples. If + * max_use_count >= 0, return NULL if all available auth tuples have a use + * count > max_use_count. If max_use_count is negative, return a currently + * least used auth tuple without enforcing a maximum use count. If there are + * no auth tuples, return NULL. + */ +static struct gsm_auth_tuple * +_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + unsigned int count; + unsigned int idx; + struct gsm_auth_tuple *at = NULL; + unsigned int key_seq = GSM_KEY_SEQ_INVAL; + + if (!vsub) + return NULL; + + if (vsub->last_tuple) + key_seq = vsub->last_tuple->key_seq; + + if (key_seq == GSM_KEY_SEQ_INVAL) + /* Start with 0 after increment modulo array size */ + idx = ARRAY_SIZE(vsub->auth_tuples) - 1; + else + idx = key_seq; + + for (count = ARRAY_SIZE(vsub->auth_tuples); count > 0; count--) { + idx = (idx + 1) % ARRAY_SIZE(vsub->auth_tuples); + + if (vsub->auth_tuples[idx].key_seq == GSM_KEY_SEQ_INVAL) + continue; + + if (!at || vsub->auth_tuples[idx].use_count < at->use_count) + at = &vsub->auth_tuples[idx]; + } + + if (!at || (max_use_count >= 0 && at->use_count > max_use_count)) + return NULL; + + return at; +} + +/* Return an auth tuple and increment its use count. */ +static struct gsm_auth_tuple * +vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + struct gsm_auth_tuple *at = _vlr_subscr_next_auth_tuple(vsub, + max_use_count); + if (!at) + return NULL; + at->use_count++; + return at; +} + +/* Return whether an auth tuple with the given max_use_count is available. */ +static bool vlr_subscr_has_auth_tuple(struct vlr_subscr *vsub, + int max_use_count) +{ + return _vlr_subscr_next_auth_tuple(vsub, max_use_count) != NULL; +} + +static bool check_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, + uint8_t res_len) +{ + struct gsm_auth_tuple *at = vsub->last_tuple; + struct osmo_auth_vector *vec = &at->vec; + bool check_umts; + OSMO_ASSERT(at); + + LOGVSUBP(LOGL_DEBUG, vsub, "received res: %s\n", + osmo_hexdump(res, res_len)); + + /* RES must be present and at least 32bit */ + if (!res || res_len < sizeof(vec->sres)) { + LOGVSUBP(LOGL_NOTICE, vsub, "AUTH RES missing or too short " + "(%u)\n", res_len); + goto out_false; + } + + check_umts = false; + if (is_r99 && (vec->auth_types & OSMO_AUTH_TYPE_UMTS)) { + check_umts = true; + /* We have a R99 capable UE and have a UMTS AKA capable USIM. + * However, the ME may still choose to only perform GSM AKA, as + * long as the bearer is GERAN */ + if (res_len != vec->res_len) { + if (is_utran) { + LOGVSUBP(LOGL_NOTICE, vsub, + "AUTH via UTRAN but " + "res_len(%u) != vec->res_len(%u)\n", + res_len, vec->res_len); + goto out_false; + } + check_umts = false; + } + } + + if (check_umts) { + if (res_len != vec->res_len + || memcmp(res, vec->res, res_len)) { + LOGVSUBP(LOGL_INFO, vsub, "UMTS AUTH failure:" + " mismatching res (expected res=%s)\n", + osmo_hexdump(vec->res, vec->res_len)); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established UMTS security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_UMTS; + return true; + } else { + if (res_len != sizeof(vec->sres) + || memcmp(res, vec->sres, sizeof(vec->sres))) { + LOGVSUBP(LOGL_INFO, vsub, "GSM AUTH failure:" + " mismatching sres (expected sres=%s)\n", + osmo_hexdump(vec->sres, sizeof(vec->sres))); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established GSM security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_GSM; + return true; + } + +out_false: + vsub->sec_ctx = VLR_SEC_CTX_NONE; + return false; +} + +static void auth_fsm_onenter_failed(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + /* If authentication hasn't even started, e.g. the HLR sent no auth + * info, then we also don't need to tell the HLR about an auth failure. + */ + if (afp->auth_requested) + vlr_subscr_tx_auth_fail_rep(vsub); +} + +static bool is_umts_auth(struct auth_fsm_priv *afp, + uint32_t auth_types) +{ + if (!afp->is_r99) + return false; + if (!(auth_types & OSMO_AUTH_TYPE_UMTS)) + return false; + return true; +} + +/* Terminate the Auth FSM Instance and notify parent */ +static void auth_fsm_term(struct osmo_fsm_inst *fi, enum vlr_auth_fsm_result res) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + LOGPFSM(fi, "Authentication terminating with result %s\n", + vlr_auth_fsm_result_name(res)); + + /* Do one final state transition (mostly for logging purpose) */ + if (res == VLR_AUTH_RES_PASSED) + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTHENTICATED, 0, 0); + else + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTH_FAILED, 0, 0); + + /* return the result to the parent FSM */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, &res); + vsub->auth_fsm = NULL; +} + +/* back-end function transmitting authentication. Caller ensures we have valid + * tuple */ +static int _vlr_subscr_authenticate(struct osmo_fsm_inst *fi) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct gsm_auth_tuple *at; + + /* Caller ensures we have vectors available */ + at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_use_count); + if (!at) { + LOGPFSML(fi, LOGL_ERROR, "A previous check ensured that an" + " auth tuple was available, but now there is in fact" + " none.\n"); + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return -1; + } + + LOGPFSM(fi, "got auth tuple: use_count=%d key_seq=%d\n", + at->use_count, at->key_seq); + + OSMO_ASSERT(at); + + /* Transmit auth req to subscriber */ + afp->auth_requested = true; + vsub->last_tuple = at; + vsub->vlr->ops.tx_auth_req(vsub->msc_conn_ref, at, + is_umts_auth(afp, at->vec.auth_types)); + return 0; +} + +/*********************************************************************** + * FSM State Action functions + ***********************************************************************/ + +/* Initial State of TS 23.018 AUT_VLR */ +static void auth_fsm_needs_auth(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + OSMO_ASSERT(event == VLR_AUTH_E_START); + + /* Start off with the default max_use_count, possibly change that if we + * need to re-use an old tuple. */ + afp->auth_tuple_max_use_count = vsub->vlr->cfg.auth_tuple_max_use_count; + + /* Check if we have vectors available */ + if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_use_count)) { + /* Obtain_Authentication_Sets_VLR */ + vlr_subscr_req_sai(vsub, NULL, NULL); + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + GSM_29002_TIMER_M, 0); + } else { + /* go straight ahead with sending auth request */ + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); + } +} + +/* Waiting for Authentication Info from HLR */ +static void auth_fsm_wait_ai(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + if (event == VLR_AUTH_E_HLR_SAI_NACK) + LOGPFSM(fi, "GSUP: rx Auth Info Error cause: %d: %s\n", + gsup->cause, + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) + || (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) + || (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + if (vsub->vlr->cfg.auth_reuse_old_sets_on_error + && vlr_subscr_has_auth_tuple(vsub, -1)) { + /* To re-use an old tuple, disable the max_use_count + * constraint. */ + afp->auth_tuple_max_use_count = -1; + goto pass; + } + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return; + } + + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for Authentication Response from MS */ +static void auth_fsm_wait_auth_resp(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_instance *vlr = vsub->vlr; + struct vlr_auth_resp_par *par = data; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + } + } else { + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + if (par->auts) { + /* First failure, start re-sync attempt */ + vlr_subscr_req_sai(vsub, par->auts, + vsub->last_tuple->vec.rand); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + GSM_29002_TIMER_M, 0); + } else + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* Waiting for Authentication Info from HLR (resync case) */ +static void auth_fsm_wait_ai_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) || + (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) || + (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + } + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP_RESYNC, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for AUTH RESP from MS (re-sync case) */ +static void auth_fsm_wait_auth_resp_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_auth_resp_par *par = data; + struct vlr_instance *vlr = vsub->vlr; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + /* Result = Aborted */ + auth_fsm_term(fi, VLR_AUTH_RES_ABORTED); + } + } else { + /* Result = Pass */ + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + /* Second failure: Result = Fail */ + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* AUT_VLR waiting for Obtain_IMSI_VLR result */ +static void auth_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + const char *mi_string = data; + + switch (event) { + case VLR_AUTH_E_MS_ID_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else { + strncpy(vsub->imsi, mi_string, sizeof(vsub->imsi)); + vsub->imsi[sizeof(vsub->imsi)-1] = '\0'; + } + /* retry with identity=IMSI */ + afp->by_imsi = true; + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH, 0, 0); + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + break; + } +} + +static const struct osmo_fsm_state auth_fsm_states[] = { + [VLR_SUB_AS_NEEDS_AUTH] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH), + .in_event_mask = S(VLR_AUTH_E_START), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_needs_auth, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_AI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_wait_ai, + }, + [VLR_SUB_AS_WAIT_RESP] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_WAIT_ID_IMSI) | + S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED) | + S(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .action = auth_fsm_wait_auth_resp, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP_RESYNC), + .action = auth_fsm_wait_ai_resync, + }, + [VLR_SUB_AS_WAIT_RESP_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP_RESYNC), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED), + .action = auth_fsm_wait_auth_resp_resync, + }, + [VLR_SUB_AS_WAIT_ID_IMSI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_ID_IMSI), + .in_event_mask = S(VLR_AUTH_E_MS_ID_IMSI), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH), + .action = auth_fsm_wait_imsi, + }, + [VLR_SUB_AS_AUTHENTICATED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTHENTICATED), + .in_event_mask = 0, + .out_state_mask = 0, + }, + [VLR_SUB_AS_AUTH_FAILED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTH_FAILED), + .in_event_mask = 0, + .out_state_mask = 0, + .onenter = auth_fsm_onenter_failed, + }, +}; + +struct osmo_fsm vlr_auth_fsm = { + .name = "VLR_Authenticate", + .states = auth_fsm_states, + .num_states = ARRAY_SIZE(auth_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_auth_event_names, +}; + +/*********************************************************************** + * User API (for SGSN/MSC code) + ***********************************************************************/ + +/* MSC->VLR: Start Procedure Authenticate_VLR (TS 23.012 Ch. 4.1.2.2) */ +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct auth_fsm_priv *afp; + + fi = osmo_fsm_inst_alloc_child(&vlr_auth_fsm, parent, + parent_term_event); + + + afp = talloc_zero(fi, struct auth_fsm_priv); + if (!afp) { + osmo_fsm_inst_dispatch(parent, parent_term_event, 0); + return NULL; + } + + afp->vsub = vsub; + if (vsub->imsi[0]) + afp->by_imsi = true; + afp->is_r99 = is_r99; + afp->is_utran = is_utran; + fi->priv = afp; + vsub->auth_fsm = fi; + + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + + return fi; +} diff --git a/src/libvlr/vlr_auth_fsm.h b/src/libvlr/vlr_auth_fsm.h new file mode 100644 index 0000000..226435f --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.h @@ -0,0 +1,52 @@ +#pragma once + +#include + +/* Parameters to VLR_AUTH_E_MS_AUTH_RESP */ +struct vlr_auth_resp_par { + bool is_r99; + bool is_utran; + const uint8_t *res; + unsigned int res_len; + const uint8_t *auts; +}; + +/* Result communicated back to parent FMS */ +enum vlr_auth_fsm_result { + VLR_AUTH_RES_ABORTED, + VLR_AUTH_RES_UNKNOWN_SUBSCR, + VLR_AUTH_RES_PROC_ERR, + VLR_AUTH_RES_AUTH_FAILED, + VLR_AUTH_RES_PASSED, +}; + +extern const struct value_string vlr_auth_fsm_result_names[]; +static inline const char *vlr_auth_fsm_result_name(enum vlr_auth_fsm_result val) +{ + return get_value_string(vlr_auth_fsm_result_names, val); +} + +enum vlr_fsm_auth_event { + VLR_AUTH_E_START, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo ACK from HLR */ + VLR_AUTH_E_HLR_SAI_ACK, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo NACK from HLR */ + VLR_AUTH_E_HLR_SAI_NACK, + /* FIXME: merge with NACK? */ + VLR_AUTH_E_HLR_SAI_ABORT, + /* Authentication Response from MS */ + VLR_AUTH_E_MS_AUTH_RESP, + /* Authentication Failure from MS */ + VLR_AUTH_E_MS_AUTH_FAIL, + /* Identity Response (IMSI) from MS */ + VLR_AUTH_E_MS_ID_IMSI, +}; + +struct osmo_fsm vlr_auth_fsm; + +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran); diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h new file mode 100644 index 0000000..0e63c7e --- /dev/null +++ b/src/libvlr/vlr_core.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#define LOGGSUPP(level, gsup, fmt, args...) \ + LOGP(DVLR, level, "GSUP(%s) " fmt, \ + (gsup)->imsi, \ + ## args) + +#define LOGVSUBP(level, vsub, fmt, args...) \ + LOGP(DVLR, level, "SUBSCR(%s) " fmt, \ + vlr_subscr_name(vsub), ## args) + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps); +int vlr_subscr_req_sai(struct vlr_subscr *vsub, const uint8_t *auts, + const uint8_t *auts_rand); +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c new file mode 100644 index 0000000..d32659f --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.c @@ -0,0 +1,1424 @@ +/* Osmocom Visitor Location Register (VLR): Location Update FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" + +#define S(x) (1 << (x)) + +#define LU_TIMEOUT_LONG 30 + +enum vlr_fsm_result { + VLR_FSM_RESULT_NONE, + VLR_FSM_RESULT_SUCCESS, + VLR_FSM_RESULT_FAILURE, +}; + + +/*********************************************************************** + * Update_HLR_VLR, TS 23.012 Chapter 4.1.2.4 + ***********************************************************************/ + +enum upd_hlr_vlr_state { + UPD_HLR_VLR_S_INIT, + UPD_HLR_VLR_S_WAIT_FOR_DATA, + UPD_HLR_VLR_S_DONE, +}; + +enum upd_hlr_vlr_evt { + UPD_HLR_VLR_E_START, + UPD_HLR_VLR_E_INS_SUB_DATA, + UPD_HLR_VLR_E_ACT_TRACE_MODE, + UPD_HLR_VLR_E_FW_CHECK_SS_IND, + UPD_HLR_VLR_E_UPD_LOC_ACK, + UPD_HLR_VLR_E_UPD_LOC_NACK, +}; + +static const struct value_string upd_hlr_vlr_event_names[] = { + OSMO_VALUE_STRING(UPD_HLR_VLR_E_START), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_INS_SUB_DATA), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_ACT_TRACE_MODE), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_FW_CHECK_SS_IND), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_ACK), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_NACK), + { 0, NULL } +}; + +static void upd_hlr_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + OSMO_ASSERT(event == UPD_HLR_VLR_E_START); + + /* Send UpdateLocation to HLR */ + vlr_subscr_req_lu(vsub, vsub->vlr->cfg.is_ps); + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_WAIT_FOR_DATA, + LU_TIMEOUT_LONG, 0); +} + +static void upd_hlr_vlr_fsm_wait_data(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case UPD_HLR_VLR_E_INS_SUB_DATA: + /* FIXME: Insert_Subscr_Data_VLR */ + break; + case UPD_HLR_VLR_E_ACT_TRACE_MODE: + /* TODO: Activate_Tracing_VLR */ + break; + case UPD_HLR_VLR_E_FW_CHECK_SS_IND: + /* TODO: Forward Check SS Ind to MSC */ + break; + case UPD_HLR_VLR_E_UPD_LOC_ACK: + /* Inside Update_HLR_VLR after UpdateLocationAck */ + vsub->sub_dataconf_by_hlr_ind = true; + vsub->loc_conf_in_hlr_ind = true; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + case UPD_HLR_VLR_E_UPD_LOC_NACK: + /* Inside Update_HLR_VLR after UpdateLocationNack */ + /* TODO: Check_User_Error_In_Serving_Network_Entity */ + vsub->sub_dataconf_by_hlr_ind = false; + vsub->loc_conf_in_hlr_ind = false; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + /* Data is a pointer to a gsm48_gmm_cause which we + * simply pass through */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, data); + break; + } +} + +static const struct osmo_fsm_state upd_hlr_vlr_states[] = { + [UPD_HLR_VLR_S_INIT] = { + .in_event_mask = S(UPD_HLR_VLR_E_START), + .out_state_mask = S(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_INIT), + .action = upd_hlr_vlr_fsm_init, + }, + [UPD_HLR_VLR_S_WAIT_FOR_DATA] = { + .in_event_mask = S(UPD_HLR_VLR_E_INS_SUB_DATA) | + S(UPD_HLR_VLR_E_ACT_TRACE_MODE) | + S(UPD_HLR_VLR_E_FW_CHECK_SS_IND) | + S(UPD_HLR_VLR_E_UPD_LOC_ACK) | + S(UPD_HLR_VLR_E_UPD_LOC_NACK), + .out_state_mask = S(UPD_HLR_VLR_S_DONE), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .action = upd_hlr_vlr_fsm_wait_data, + }, + [UPD_HLR_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_DONE), + }, +}; + +static struct osmo_fsm upd_hlr_vlr_fsm = { + .name = "upd_hlr_vlr_fsm", + .states = upd_hlr_vlr_states, + .num_states = ARRAY_SIZE(upd_hlr_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = upd_hlr_vlr_event_names, +}; + +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&upd_hlr_vlr_fsm, parent, + parent_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, UPD_HLR_VLR_E_START, NULL); + + return fi; +} + + +/*********************************************************************** + * Subscriber_Present_VLR, TS 29.002 Chapter 25.10.1 + ***********************************************************************/ + +enum sub_pres_vlr_state { + SUB_PRES_VLR_S_INIT, + SUB_PRES_VLR_S_WAIT_FOR_HLR, + SUB_PRES_VLR_S_DONE, +}; + +enum sub_pres_vlr_event { + SUB_PRES_VLR_E_START, + SUB_PRES_VLR_E_READY_SM_CNF, + SUB_PRES_VLR_E_READY_SM_ERR, +}; + +static const struct value_string sub_pres_vlr_event_names[] = { + OSMO_VALUE_STRING(SUB_PRES_VLR_E_START), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_CNF), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_ERR), + { 0, NULL } +}; + +static void sub_pres_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + OSMO_ASSERT(event == SUB_PRES_VLR_E_START); + + if (!vsub->ms_not_reachable_flag) { + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + return; + } + /* FIXME: Send READY_FOR_SM via GSUP */ + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_WAIT_FOR_HLR, + LU_TIMEOUT_LONG, 0); +} + +static void sub_pres_vlr_fsm_wait_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case SUB_PRES_VLR_E_READY_SM_CNF: + vsub->ms_not_reachable_flag = false; + break; + case SUB_PRES_VLR_E_READY_SM_ERR: + break; + } + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +static const struct osmo_fsm_state sub_pres_vlr_states[] = { + [SUB_PRES_VLR_S_INIT] = { + .in_event_mask = S(SUB_PRES_VLR_E_START), + .out_state_mask = S(SUB_PRES_VLR_S_WAIT_FOR_HLR) | + S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_INIT), + .action = sub_pres_vlr_fsm_init, + }, + [SUB_PRES_VLR_S_WAIT_FOR_HLR] = { + .in_event_mask = S(SUB_PRES_VLR_E_READY_SM_CNF) | + S(SUB_PRES_VLR_E_READY_SM_ERR), + .out_state_mask = S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_WAIT_FOR_HLR), + .action = sub_pres_vlr_fsm_wait_hlr, + }, + [SUB_PRES_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_DONE), + }, +}; + +static struct osmo_fsm sub_pres_vlr_fsm = { + .name = "sub_pres_vlr_fsm", + .states = sub_pres_vlr_states, + .num_states = ARRAY_SIZE(sub_pres_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = sub_pres_vlr_event_names, +}; + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&sub_pres_vlr_fsm, parent, + term_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, SUB_PRES_VLR_E_START, NULL); + + return fi; +} + +/*********************************************************************** + * Location_Update_Completion_VLR, TS 23.012 Chapter 4.1.2.3 + ***********************************************************************/ + +enum lu_compl_vlr_state { + LU_COMPL_VLR_S_INIT, + LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_COMPL_VLR_S_WAIT_IMEI, + LU_COMPL_VLR_S_WAIT_IMEI_TMSI, + LU_COMPL_VLR_S_WAIT_TMSI_CNF, + LU_COMPL_VLR_S_DONE, +}; + +enum lu_compl_vlr_event { + LU_COMPL_VLR_E_START, + LU_COMPL_VLR_E_SUB_PRES_COMPL, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, + LU_COMPL_VLR_E_IMEI_CHECK_NACK, + LU_COMPL_VLR_E_NEW_TMSI_ACK, +}; + +static const struct value_string lu_compl_vlr_event_names[] = { + OSMO_VALUE_STRING(LU_COMPL_VLR_E_START), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_SUB_PRES_COMPL), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_ACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_compl_vlr_priv { + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t cause; + bool assign_tmsi; +}; + +static void _vlr_lu_compl_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result, + uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->result = result; + lcvp->cause = cause; + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_DONE, 0, 0); +} + +static void vlr_lu_compl_fsm_success(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + if (!vsub->lu_complete) { + vsub->lu_complete = true; + /* Balanced by vlr_subscr_rx_imsi_detach() */ + vlr_subscr_get(vsub); + } + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_SUCCESS, 0); +} + +static void vlr_lu_compl_fsm_failure(struct osmo_fsm_inst *fi, uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->vsub->vlr->ops.tx_lu_rej(lcvp->msc_conn_ref, cause); + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_FAILURE, cause); +} + +static void vlr_lu_compl_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lcvp->result == VLR_FSM_RESULT_SUCCESS) + ? lcvp->parent_event_success + : lcvp->parent_event_failure, + &lcvp->cause); +} + +static void lu_compl_vlr_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr; + OSMO_ASSERT(vsub); + vlr = vsub->vlr; + OSMO_ASSERT(vlr); + + OSMO_ASSERT(event == LU_COMPL_VLR_E_START); + + /* TODO: National Roaming restrictions? */ + /* TODO: Roaming restriction due to unsupported feature in subscriber + * data? */ + /* TODO: Regional subscription restriction? */ + /* TODO: Administrative restriction of subscribres' access feature? */ + /* TODO: AccessRestrictuionData parameter available? */ + /* TODO: AccessRestrictionData permits RAT? */ + /* Node 1 */ + /* TODO: Autonomous CSG supported in VPLMN and allowed by HPLMN? */ + /* TODO: Hybrid Cel / CSG Cell */ + /* Node 2 */ + vsub->la_allowed = true; + vsub->imsi_detached_flag = false; + /* Start Subscriber_Present_VLR Procedure */ + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_TIMEOUT_LONG, 0); + + lcvp->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + LU_COMPL_VLR_E_SUB_PRES_COMPL); + +} + +static void lu_compl_vlr_new_tmsi(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + if (vlr_subscr_alloc_tmsi(vsub)) { + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_TMSI_CNF, + vlr_timer(vlr, 3250), 3250); + + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, vsub->tmsi_new); +} + +/* After completion of Subscriber_Present_VLR */ +static void lu_compl_vlr_wait_subscr_pres(struct osmo_fsm_inst *fi, + uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_SUB_PRES_COMPL); + + lcvp->sub_pres_vlr_fsm = NULL; + + /* TODO: Trace_Subscriber_Activity_VLR */ + + if (vlr->cfg.check_imei_rqd) { + /* Check IMEI VLR */ + osmo_fsm_inst_state_chg(fi, + lcvp->assign_tmsi ? + LU_COMPL_VLR_S_WAIT_IMEI_TMSI + : LU_COMPL_VLR_S_WAIT_IMEI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lcvp->msc_conn_ref, GSM_MI_TYPE_IMEI); + return; + } + + /* Do we need to allocate a TMSI? */ + if (lcvp->assign_tmsi) { + lu_compl_vlr_new_tmsi(fi); + return; + } + + /* Location Updating Accept */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for completion of CHECK_IMEI_VLR */ +static void lu_compl_vlr_wait_imei(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + switch (event) { + case LU_COMPL_VLR_E_IMEI_CHECK_ACK: + if (!vsub->imei[0]) { + /* Abort: Do nothing */ + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_PROTOCOL_ERROR); + return; + } + /* Pass */ + break; + + case LU_COMPL_VLR_E_IMEI_CHECK_NACK: + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_ILLEGAL_ME); + /* FIXME: IMEI Check Fail to VLR Application (Detach IMSI VLR) */ + return; + } + + /* IMEI is available. Allocate TMSI if needed. */ + if (lcvp->assign_tmsi) { + if (fi->state != LU_COMPL_VLR_S_WAIT_IMEI_TMSI) + LOGPFSML(fi, LOGL_ERROR, + "TMSI required, expected to be in state" + " LU_COMPL_VLR_S_WAIT_IMEI_TMSI," + " am in %s instead\n", + osmo_fsm_state_name(fi->fsm, fi->state)); + /* Logged an error, continue anyway. */ + + lu_compl_vlr_new_tmsi(fi); + + /* Wait for TMSI ack */ + return; + } + + /* No TMSI needed, accept now. */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for TMSI confirmation */ +static void lu_compl_vlr_wait_tmsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_NEW_TMSI_ACK); + + if (!vsub || vsub->tmsi_new == GSM_RESERVED_TMSI) { + LOGPFSML(fi, LOGL_ERROR, "TMSI Realloc Compl implies that" + " the subscriber has a new TMSI allocated, but" + " the new TMSI is unset.\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + vsub->tmsi = vsub->tmsi_new; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + vlr_lu_compl_fsm_success(fi); +} + +static const struct osmo_fsm_state lu_compl_vlr_states[] = { + [LU_COMPL_VLR_S_INIT] = { + .in_event_mask = S(LU_COMPL_VLR_E_START), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_SUB_PRES) | + S(LU_COMPL_VLR_S_WAIT_IMEI), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_INIT), + .action = lu_compl_vlr_init, + }, + [LU_COMPL_VLR_S_WAIT_SUB_PRES] = { + .in_event_mask = S(LU_COMPL_VLR_E_SUB_PRES_COMPL), + .out_state_mask = S(LU_COMPL_VLR_S_WAIT_IMEI) | + S(LU_COMPL_VLR_S_WAIT_IMEI_TMSI) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF) | + S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_SUB_PRES), + .action = lu_compl_vlr_wait_subscr_pres, + }, + [LU_COMPL_VLR_S_WAIT_IMEI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_IMEI_TMSI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI_TMSI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_TMSI_CNF] = { + .in_event_mask = S(LU_COMPL_VLR_E_NEW_TMSI_ACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .action = lu_compl_vlr_wait_tmsi, + }, + [LU_COMPL_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_DONE), + .onenter = vlr_lu_compl_fsm_dispatch_result, + }, +}; + +static struct osmo_fsm lu_compl_vlr_fsm = { + .name = "lu_compl_vlr_fsm", + .states = lu_compl_vlr_states, + .num_states = ARRAY_SIZE(lu_compl_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = lu_compl_vlr_event_names, +}; + +struct osmo_fsm_inst * +lu_compl_vlr_proc_alloc(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_compl_vlr_priv *lcvp; + + fi = osmo_fsm_inst_alloc_child(&lu_compl_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return NULL; + + lcvp = talloc_zero(fi, struct lu_compl_vlr_priv); + lcvp->vsub = vsub; + lcvp->msc_conn_ref = msc_conn_ref; + lcvp->parent_event_success = parent_event_success; + lcvp->parent_event_failure = parent_event_failure; + lcvp->assign_tmsi = assign_tmsi; + fi->priv = lcvp; + + return fi; +} + + +/*********************************************************************** + * Update_Location_Area_VLR, TS 23.012 Chapter 4.1.2.1 + ***********************************************************************/ + +static const struct value_string fsm_lu_event_names[] = { + OSMO_VALUE_STRING(VLR_ULA_E_UPDATE_LA), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_ACK), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_NACK), + OSMO_VALUE_STRING(VLR_ULA_E_AUTH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_CIPH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMSI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEISV), + OSMO_VALUE_STRING(VLR_ULA_E_HLR_LU_RES), + OSMO_VALUE_STRING(VLR_ULA_E_UPD_HLR_COMPL), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_SUCCESS), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_FAILURE), + OSMO_VALUE_STRING(VLR_ULA_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_fsm_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *upd_hlr_vlr_fsm; + struct osmo_fsm_inst *lu_compl_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t rej_cause; + + enum vlr_lu_type type; + bool lu_by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id old_lai; + struct osmo_location_area_id new_lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool assign_tmsi; +}; + + +/* Determine if given location area is served by this VLR */ +static bool lai_in_this_vlr(struct vlr_instance *vlr, + const struct osmo_location_area_id *lai) +{ + /* TODO: VLR needs to keep a locally configued list of LAIs */ + return true; +} + +/* Determine if authentication is required */ +static bool is_auth_required(struct lu_fsm_priv *lfp) +{ + /* 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); +} + +/* Determine if ciphering is required */ +static bool is_ciph_required(struct lu_fsm_priv *lfp) +{ + return lfp->ciphering_required != VLR_CIPH_NONE; +} + +/* Determine if a HLR Update is required */ +static bool hlr_update_needed(struct vlr_subscr *vsub) +{ + /* TODO: properly decide this, rather than always assuming we + * need to update the HLR. */ + return true; +} + +static void lu_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lfp->result == VLR_FSM_RESULT_SUCCESS) + ? lfp->parent_event_success + : lfp->parent_event_failure, + lfp->parent_event_data); +} + +static void _lu_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->result = result; + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_DONE, 0, 0); +} + +static void lu_fsm_success(struct osmo_fsm_inst *fi) +{ + _lu_fsm_done(fi, VLR_FSM_RESULT_SUCCESS); +} + +static void lu_fsm_failure(struct osmo_fsm_inst *fi, uint8_t rej_cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (rej_cause) + lfp->vlr->ops.tx_lu_rej(lfp->msc_conn_ref, rej_cause); + _lu_fsm_done(fi, VLR_FSM_RESULT_FAILURE); +} + +static void vlr_loc_upd_start_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->lu_compl_vlr_fsm = + lu_compl_vlr_proc_alloc(fi, lfp->vsub, lfp->msc_conn_ref, + VLR_ULA_E_LU_COMPL_SUCCESS, + VLR_ULA_E_LU_COMPL_FAILURE, + lfp->assign_tmsi); + + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, LU_COMPL_VLR_E_START, NULL); +} + +static void lu_fsm_discard_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!lfp->lu_compl_vlr_fsm) + return; + osmo_fsm_inst_term(lfp->lu_compl_vlr_fsm, OSMO_FSM_TERM_PARENT, NULL); +} + +/* 4.1.2.1 Node 4 */ +static void vlr_loc_upd_node_4(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + bool hlr_unknown = false; + + LOGPFSM(fi, "%s()\n", __func__); + + if (hlr_unknown) { + /* FIXME: Delete subscriber record */ + /* LU REJ: Roaming not allowed */ + lu_fsm_failure(fi, GSM48_REJECT_ROAMING_NOT_ALLOWED); + } else { + /* Update_HLR_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_HLR_UPD, + LU_TIMEOUT_LONG, 0); + lfp->upd_hlr_vlr_fsm = + upd_hlr_vlr_proc_start(fi, vsub, VLR_ULA_E_UPD_HLR_COMPL); + } +} + +/* 4.1.2.1 Node B */ +static void vlr_loc_upd_node_b(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + + /* FIXME */ + if (0) { /* IMEISV or PgA to send */ + vlr_loc_upd_node_4(fi); + } else { + /* Location_Update_Completion */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } +} + +/* Non-standard: after Ciphering Mode Complete (or no ciph required) */ +static void vlr_loc_upd_post_ciph(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + vsub->conf_by_radio_contact_ind = true; + /* Update LAI */ + vsub->cgi.lai = lfp->new_lai; + vsub->dormant_ind = false; + vsub->cancel_loc_rx = false; + if (hlr_update_needed(vsub)) { + vlr_loc_upd_node_4(fi); + } else { + /* TODO: ADD Support */ + /* TODO: Node A: PgA Support */ + vlr_loc_upd_node_b(fi); + } +} + +/* 4.1.2.1 after Authentication successful (or no auth rqd) */ +static void vlr_loc_upd_post_auth(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (!is_ciph_required(lfp)) { + vlr_loc_upd_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, lfp->msc_conn_ref, + lfp->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_CIPH, LU_TIMEOUT_LONG, 0); +} + +static void vlr_loc_upd_node1(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (is_auth_required(lfp)) { + /* Authenticate_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_AUTH, + LU_TIMEOUT_LONG, 0); + vsub->auth_fsm = auth_fsm_start(lfp->vsub, fi->log_level, + fi, VLR_ULA_E_AUTH_RES, + lfp->is_r99, + lfp->is_utran); + } else { + /* no need for authentication */ + vlr_loc_upd_post_auth(fi); + } +} + +static void vlr_loc_upd_want_imsi(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(lfp->vsub); + + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMSI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMSI); + /* will continue at vlr_loc_upd_node1() once IMSI arrives */ +} + +static int assoc_lfp_with_sub(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + if (vsub->lu_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "A Location Updating process is already pending for" + " this subscriber. Aborting.\n"); + /* Also get rid of the other pending LU attempt? */ + /*lu_fsm_failure(vsub->lu_fsm, GSM48_REJECT_CONGESTION);*/ + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); + return -EINVAL; + } + vsub->lu_fsm = fi; + vsub->msc_conn_ref = lfp->msc_conn_ref; + /* FIXME: send new LAC to HLR? */ + vsub->lac = lfp->new_lai.lac; + lfp->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(lfp->msc_conn_ref, lfp->vsub); + return 0; +} + +static const char *lai_name(struct osmo_location_area_id *lai) +{ + static char buf[64]; + snprintf(buf, sizeof(buf),"MCC:%u, MNC:%u, LAC:%u", + lai->plmn.mcc, lai->plmn.mnc, lai->lac); + return buf; +} + +/* 4.1.2.1: Subscriber (via MSC/SGSN) requests location update */ +static void _start_lu_main(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + struct vlr_subscr *vsub = NULL; + bool created; + + /* TODO: PUESBINE related handling */ + + /* Is previous LAI in this VLR? */ + if (!lai_in_this_vlr(vlr, &lfp->old_lai)) { +#if 0 + /* FIXME: check previous VLR, (3) */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_PVLR, + LU_TIMEOUT_LONG, 0); + return; +#endif + LOGPFSML(fi, LOGL_NOTICE, "LAI change from %s," + " but checking previous VLR not implemented\n", + lai_name(&lfp->old_lai)); + } + + if (!lfp->imsi[0]) { + /* TMSI was used */ + lfp->lu_by_tmsi = true; + /* TMSI clash: if a different subscriber already has this TMSI, + * we will find that other subscriber in the VLR. So the IMSIs + * would mismatch, but we don't know about it. Theoretically, + * an authentication process would thwart any attempt to use + * someone else's TMSI. + * TODO: Otherwise we can ask for the IMSI and verify that it + * matches the IMSI on record. */ + vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, + &created); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + + if (created) + vlr_loc_upd_want_imsi(fi); + else + vlr_loc_upd_node1(fi); + /* We cannot have MSC area change, as the VLR + * serves only one MSC */ + vlr_subscr_put(vsub); + } else { + /* IMSI was used */ + vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + vlr_subscr_put(vsub); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + vlr_loc_upd_node1(fi); + vlr_subscr_put(vsub); + } +} + + +static void lu_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + OSMO_ASSERT(event == VLR_ULA_E_UPDATE_LA); + + if (1) { // FIXME + //if (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0]) + /* R_IMEISV_IR1 passed */ + _start_lu_main(fi); + } else { + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMEISV); + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMEISV, + vlr_timer(vlr, 3270), 3270); + } +} + +static void lu_fsm_wait_imeisv(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_ID_IMEISV: + /* FIXME: copy IMEISV */ + _start_lu_main(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for response from Send_Identification to PVLR */ +static void lu_fsm_wait_pvlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_SEND_ID_ACK: + vlr_loc_upd_node1(fi); + break; + case VLR_ULA_E_SEND_ID_NACK: + vlr_loc_upd_want_imsi(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for result of Authenticate_VLR procedure */ +static void lu_fsm_wait_auth(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + enum vlr_auth_fsm_result *res = data; + uint8_t rej_cause = 0; + + OSMO_ASSERT(event == VLR_ULA_E_AUTH_RES); + + lfp->upd_hlr_vlr_fsm = NULL; + + if (res) { + switch (*res) { + case VLR_AUTH_RES_PASSED: + /* Result == Pass */ + vlr_loc_upd_post_auth(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* go to Idle with no response */ + rej_cause = 0; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* FIXME: delete subscribe record */ + rej_cause = GSM48_REJECT_IMSI_UNKNOWN_IN_HLR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* cause = illegal subscriber */ + rej_cause = GSM48_REJECT_ILLEGAL_MS; + break; + case VLR_AUTH_RES_PROC_ERR: + /* cause = system failure */ + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } + } else + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + + lu_fsm_failure(fi, rej_cause); +} + +static void lu_fsm_wait_ciph(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == VLR_ULA_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + } + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + vlr_loc_upd_post_ciph(fi); +} + +static void lu_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + char *mi_string = data; + + switch (event) { + case VLR_ULA_E_ID_IMSI: + vlr_subscr_set_imsi(vsub, mi_string); + vlr_loc_upd_node1(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* At the end of Update_HLR_VLR */ +static void lu_fsm_wait_hlr_ul_res(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + + switch (event) { + case VLR_ULA_E_HLR_LU_RES: + /* pass-through this event to Update_HLR_VLR */ + if (data == NULL) + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_ACK, NULL); + else + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_NACK, data); + break; + case VLR_ULA_E_UPD_HLR_COMPL: + if (data == NULL) { + /* successful case */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + /* continue in MSC ?!? */ + } else { + /* unsuccessful case */ + enum gsm48_gmm_cause cause = + *(enum gsm48_gmm_cause *)data; + if (0 /* procedure_error && vlr->cfg.standalone_mode */) { + osmo_fsm_inst_state_chg(fi, + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } else { + lu_fsm_failure(fi, cause); + } + } + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR */ +static void lu_fsm_wait_lu_compl(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_ID_IMEI: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + + /* Update Register */ + /* TODO: Set_Notification_Type 23.078 */ + /* TODO: Notify_gsmSCF 23.078 */ + /* TODO: Authenticated Radio Contact Established -> ARC */ + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR (standalone case) */ +static void lu_fsm_wait_lu_compl_standalone(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + vsub->sub_dataconf_by_hlr_ind = false; + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + vsub->sub_dataconf_by_hlr_ind = false; + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +static const struct osmo_fsm_state vlr_lu_fsm_states[] = { + [VLR_ULA_S_IDLE] = { + .in_event_mask = S(VLR_ULA_E_UPDATE_LA), + .out_state_mask = S(VLR_ULA_S_WAIT_IMEISV) | + S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_IDLE), + .action = lu_fsm_idle, + }, + [VLR_ULA_S_WAIT_IMEISV] = { + .in_event_mask = S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMEISV), + .action = lu_fsm_wait_imeisv, + }, + [VLR_ULA_S_WAIT_PVLR] = { + .in_event_mask = S(VLR_ULA_E_SEND_ID_ACK) | + S(VLR_ULA_E_SEND_ID_NACK), + .out_state_mask = S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_PVLR), + .action = lu_fsm_wait_pvlr, + }, + [VLR_ULA_S_WAIT_AUTH] = { + .in_event_mask = S(VLR_ULA_E_AUTH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_CIPH) | + S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_AUTH), + .action = lu_fsm_wait_auth, + }, + [VLR_ULA_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_CIPH), + .in_event_mask = S(VLR_ULA_E_CIPH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .action = lu_fsm_wait_ciph, + }, + [VLR_ULA_S_WAIT_IMSI] = { + .in_event_mask = S(VLR_ULA_E_ID_IMSI), + .out_state_mask = S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMSI), + .action = lu_fsm_wait_imsi, + }, + [VLR_ULA_S_WAIT_HLR_UPD] = { + .in_event_mask = S(VLR_ULA_E_HLR_LU_RES) | + S(VLR_ULA_E_UPD_HLR_COMPL), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_HLR_UPD), + .action = lu_fsm_wait_hlr_ul_res, + }, + [VLR_ULA_S_WAIT_LU_COMPL] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK) | + S(VLR_ULA_E_ID_IMEI) | + S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL), + .action = lu_fsm_wait_lu_compl, + }, + [VLR_ULA_S_WAIT_LU_COMPL_STANDALONE] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE), + .action = lu_fsm_wait_lu_compl_standalone, + }, + [VLR_ULA_S_DONE] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_DONE), + .onenter = lu_fsm_dispatch_result, + }, +}; + +static void fsm_lu_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "fsm_lu_cleanup called with cause %s\n", + osmo_fsm_term_cause_name(cause)); + if (vsub && vsub->lu_fsm == fi) + vsub->lu_fsm = NULL; +} + +static struct osmo_fsm vlr_lu_fsm = { + .name = "vlr_lu_fsm", + .states = vlr_lu_fsm_states, + .num_states = ARRAY_SIZE(vlr_lu_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_lu_event_names, + .cleanup = fsm_lu_cleanup, +}; + +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_fsm_priv *lfp; + + fi = osmo_fsm_inst_alloc_child(&vlr_lu_fsm, parent, parent_event_failure); + if (!fi) + return NULL; + + lfp = talloc_zero(fi, struct lu_fsm_priv); + lfp->vlr = vlr; + lfp->msc_conn_ref = msc_conn_ref; + lfp->tmsi = tmsi; + lfp->type = type; + lfp->old_lai = *old_lai; + lfp->new_lai = *new_lai; + lfp->lu_by_tmsi = true; + lfp->parent_event_success = parent_event_success; + lfp->parent_event_failure = parent_event_failure; + lfp->parent_event_data = parent_event_data; + lfp->authentication_required = authentication_required; + lfp->ciphering_required = ciphering_required; + lfp->is_r99 = is_r99; + lfp->is_utran = is_utran; + lfp->assign_tmsi = assign_tmsi; + if (imsi) { + strncpy(lfp->imsi, imsi, sizeof(lfp->imsi)-1); + lfp->imsi[sizeof(lfp->imsi)-1] = '\0'; + lfp->lu_by_tmsi = false; + } + fi->priv = lfp; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + osmo_fsm_inst_dispatch(fi, VLR_ULA_E_UPDATE_LA, NULL); + + return fi; +} + +/* Gracefully terminate an FSM created by vlr_loc_update() in case of external + * timeout (i.e. from MSC). */ +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == VLR_ULA_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); +} + +void vlr_lu_fsm_init(void) +{ + osmo_fsm_register(&vlr_lu_fsm); + osmo_fsm_register(&upd_hlr_vlr_fsm); + osmo_fsm_register(&sub_pres_vlr_fsm); + osmo_fsm_register(&lu_compl_vlr_fsm); +} diff --git a/src/libvlr/vlr_lu_fsm.h b/src/libvlr/vlr_lu_fsm.h new file mode 100644 index 0000000..5cf13c7 --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +enum vlr_lu_state { + VLR_ULA_S_IDLE, + VLR_ULA_S_WAIT_IMEISV, + VLR_ULA_S_WAIT_PVLR, /* Waiting for ID from PVLR */ + VLR_ULA_S_WAIT_AUTH, /* Waiting for Authentication */ + VLR_ULA_S_WAIT_CIPH, /* Waiting for Ciphering Complete */ + VLR_ULA_S_WAIT_IMSI, /* Waiting for IMSI from MS */ + VLR_ULA_S_WAIT_HLR_UPD, /* Waiting for end of HLR update */ + VLR_ULA_S_WAIT_LU_COMPL,/* Waiting for LU complete */ + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, /* Standalone VLR */ + VLR_ULA_S_DONE +}; + +void vlr_lu_fsm_init(void); diff --git a/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am index f4ef487..a99334d 100644 --- a/src/osmo-nitb/Makefile.am +++ b/src/osmo-nitb/Makefile.am @@ -32,6 +32,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libvlr/libvlr.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOGSM_LIBS) \ diff --git a/tests/vlr/Makefile.am b/tests/vlr/Makefile.am new file mode 100644 index 0000000..2208a6f --- /dev/null +++ b/tests/vlr/Makefile.am @@ -0,0 +1,22 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS = -Wall -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(NULL) +AM_LDFLAGS = $(COVERAGE_LDFLAGS) + +noinst_PROGRAMS = vlr_test + +vlr_test_SOURCES = vlr_test.c +vlr_test_LDADD = \ + $(top_builddir)/src/libvlr/libvlr.a \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(LIBRARY_DL) \ + $(LIBCRYPTO_LIBS) \ + $(NULL) diff --git a/tests/vlr/vlr_test.c b/tests/vlr/vlr_test.c new file mode 100644 index 0000000..19beb69 --- /dev/null +++ b/tests/vlr/vlr_test.c @@ -0,0 +1,694 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#define S(x) (1 << (x)) + +/* + * TODO: + * * test FSM for all testvlr_mode (and more) + * * test also the time-outs in the vlr code + * * test for memory leaks + * * how to get the HLR running? Or test against stub? + * * test disappearing MS connection + * * test absence of HLR + */ + +void *tall_bsc_ctx; +static struct vlr_instance *g_vlr; + +/*********************************************************************** + * Finite State Machine simulating MS and MSC towards VLR + ***********************************************************************/ + +static int timer_error_cb(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "timer expired waiting for completion\n"); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return 1; +} + +enum testvlr_mode { + MODE_SUCCESS, + MODE_SUCCESS_TMSI, + MODE_AUTH_FAIL, + MODE_AUTH_RESYNC, +}; + +struct testvlr_priv { + enum testvlr_mode mode; + uint32_t tmsi; + char imsi[16]; + char imei[16]; + struct osmo_location_area_id old_lai; + struct osmo_location_area_id new_lai; + + struct vlr_subscr *subscr; + + struct osmo_fsm_inst *lu_fsm; +}; + +#define fsi_priv(x) (struct testvlr_priv *)(x)->priv + +enum f_state { + /*! initial state */ + ST_NULL, + /*! LU was sent by MS */ + ST_LU_SENT, + /*! waiting for auth re-sync */ + ST_RESYNC_SENT, + /* Waiting for LU ACK */ + ST_WAIT_LU_ACK, + ST_DONE, + ST_FAILED, +}; + +enum f_event { + /* events from MS */ + EVT_MS_TX_LU, /* transmit LU REQ to network */ + EVT_MS_TX_ID_RESP, /* tranmit ID RSP to network */ + EVT_MS_TX_AUTH_RESP, /* transmit AUTH RESP to network */ + EVT_MS_TX_AUTH_FAIL, /* transmit AUTH FAIL to network */ + EVT_MS_CONN_LOST, /* connection to MS was lost */ + + /* events from VLR */ + EVT_VLR_AUTH_REQ, /* transmit AUTH REQ to MS */ + EVT_VLR_ID_REQ_IMSI, /* transmit ID REQ(IMSI) to MS */ + EVT_VLR_ID_REQ_IMEI, /* tramsmit ID REQ(IMEI) to MS */ + EVT_VLR_ID_REQ_IMEISV, /* trasnmit ID REQ(IMEISV) to MS */ + EVT_VLR_AUTH_REJ, /* transmit AUTH REJ to MS */ + EVT_VLR_SET_CIPH, /* transmit SET CIPH to MS */ + EVT_VLR_LU_ACK, /* transmit LU ACK to MS */ + EVT_VLR_LU_REJ, /* transmit LU REJ to MS */ +}; + +static struct value_string f_event_names[] = { + { EVT_MS_TX_LU, "MS-TX-LU" }, + { EVT_MS_TX_ID_RESP, "MS-TX-ID-RESP" }, + { EVT_MS_TX_AUTH_RESP, "MS-TX-AUTH-RESP" }, + { EVT_MS_TX_AUTH_FAIL, "MS-TX-AUTH-FAIL" }, + { EVT_MS_CONN_LOST, "MS-CONN-LOST" }, + + { EVT_VLR_AUTH_REQ, "VLR-AUTH-REQ" }, + { EVT_VLR_ID_REQ_IMSI, "VLR-ID-REQ-IMSI" }, + { EVT_VLR_ID_REQ_IMEI, "VLR-ID-REQ-IMEI" }, + { EVT_VLR_ID_REQ_IMEISV,"VLR-ID-REQ-IMEISV" }, + { EVT_VLR_AUTH_REJ, "VLR-AUTH-REJ" }, + { EVT_VLR_SET_CIPH, "VLR-SET-CIPH" }, + { EVT_VLR_LU_ACK, "VLR-LU-ACK" }, + { EVT_VLR_LU_REJ, "VLR-LU-REJ" }, + { 0, NULL } +}; + +static void fsm_f_allstate(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + uint8_t mi[16]; + unsigned int mi_len; + + switch (event) { + case EVT_VLR_ID_REQ_IMSI: + if (priv->mode != MODE_SUCCESS_TMSI) { + LOGP(DGPRS, LOGL_NOTICE, "Unexpected ID REQ " + "(IMSI)\n"); + } + mi_len = gsm48_generate_mid_from_imsi(mi, priv->imsi); + vlr_subscr_rx_id_resp(priv->subscr, mi+2, mi_len-2); + break; + case EVT_VLR_ID_REQ_IMEI: + mi_len = gsm48_generate_mid_from_imsi(mi, priv->imei); + mi[0] = (mi[0] & 0xf8) | GSM_MI_TYPE_IMEI; + vlr_subscr_rx_id_resp(priv->subscr+2, mi, mi_len-2); + break; + case EVT_VLR_ID_REQ_IMEISV: + mi_len = gsm48_generate_mid_from_imsi(mi, priv->imei); + mi[0] = (mi[0] & 0xf8) | GSM_MI_TYPE_IMEISV; + vlr_subscr_rx_id_resp(priv->subscr, mi+2, mi_len-2); + break; + case EVT_MS_CONN_LOST: + vlr_subscr_disconnected(priv->subscr); + /* IDEA: not release but keep around in extra state to + * see if VLR still sends us anything? */ + osmo_fsm_inst_free(fi); + break; + } +} + +static void fsm_f_null(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + uint32_t tmsi = 0; + const char *imsi = NULL; + + switch (event) { + case EVT_MS_TX_LU: + /* send LU to VLR */ + if (priv->mode == MODE_SUCCESS) + imsi = priv->imsi; + else + tmsi = priv->tmsi; + priv->lu_fsm = vlr_loc_update(fi, + EVT_VLR_LU_ACK, + EVT_VLR_LU_REJ, + NULL, + g_vlr, NULL, + VLR_LU_TYPE_IMSI_ATTACH, tmsi, + imsi, &priv->old_lai, + &priv->new_lai, + true, + true, + false, + false, + true); + OSMO_ASSERT(priv->subscr); + osmo_fsm_inst_state_chg(fi, ST_LU_SENT, 0, 0); + break; + default: + break; + } +} + +static void fsm_f_lu_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct gsm_auth_tuple *at = NULL; + struct testvlr_priv *priv = fsi_priv(fi); + uint8_t res_fail[4]; + uint8_t auts[14]; + + switch (event) { + case EVT_VLR_AUTH_REQ: + at = data; + OSMO_ASSERT(at); + DEBUGP(DGPRS, "%s: at->res=%s\n", __func__, osmo_hexdump(at->vec.res, at->vec.res_len)); + switch (priv->mode) { + case MODE_SUCCESS: + case MODE_SUCCESS_TMSI: + /* return matching SRES/AUTS */ + vlr_subscr_rx_auth_resp(priv->subscr, true, false, + at->vec.res, at->vec.res_len); + break; + case MODE_AUTH_FAIL: + /* return not matching SRES/AUTS */ + vlr_subscr_rx_auth_resp(priv->subscr, true, false, + res_fail, sizeof(res_fail)); + /* FIXME: state transition? */ + break; + case MODE_AUTH_RESYNC: + /* return SRES/AUTS requesting re-sync */ + /* FIXME: generate a proper authenticating + * re-sync request */ + vlr_subscr_rx_auth_fail(priv->subscr, auts); + /* FIXME: state transition? */ + osmo_fsm_inst_state_chg(fi, ST_RESYNC_SENT, 0, 0); + break; + } + osmo_fsm_inst_state_chg(fi, ST_WAIT_LU_ACK, 0, 0); + break; + case EVT_VLR_LU_REJ: + { + uint8_t cause = *(uint8_t *)data; + LOGP(DGPRS, LOGL_NOTICE, "LU(%s): Rejected; cause=0x%02x\n", + priv->imsi, cause); + + } + break; + default: + break; + } +} + +#if 0 +static void fsm_f_resync_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + struct gsm_auth_tuple *at = NULL; + + /* second auth request is supposed to succed after the + * re-sync procedure before */ + switch (event) { + case EVT_VLR_AUTH_REQ: + at = data; + /* return matching SRES/AUTS now */ + vlr_subscr_rx_auth_resp(priv->subscr, true, false, + at->vec.res, at->vec.res_len); + osmo_fsm_inst_state_chg(fi, ST_WAIT_LU_ACK, 0, 0); + break; + } +} +#endif + +static void fsm_f_wait_lu_ack(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct testvlr_priv *priv = fsi_priv(fi); + + switch (event) { + case EVT_VLR_LU_ACK: + if (priv->subscr->tmsi != GSM_RESERVED_TMSI) { + /* we need to send an TMSI REALLOC COMPL */ + vlr_subscr_rx_tmsi_reall_compl(priv->subscr); + } + osmo_fsm_inst_state_chg(fi, ST_DONE, 0, 0); + break; + case EVT_VLR_LU_REJ: + osmo_fsm_inst_state_chg(fi, ST_FAILED, 0, 0); + break; + } +} + +static void fsm_f_imsi_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case EVT_MS_TX_ID_RESP: + break; + } +} + +#if 0 +static void fsm_f_areq_sent(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case EVT_MS_TX_AUTH_RESP: + break; + case EVT_MS_TX_AUTH_FAIL: + break; + } +} +#endif + +static struct osmo_fsm_state fsm_success_states[] = { + [ST_NULL] = { + .in_event_mask = S(EVT_MS_TX_LU), + .out_state_mask = S(ST_LU_SENT), + .name = "NULL", + .action = fsm_f_null, + }, + [ST_LU_SENT] = { + .in_event_mask = S(EVT_VLR_AUTH_REQ) | + S(EVT_VLR_LU_REJ), + //.out_state_mask = S(ST_IDREQ_IMSI_SENT) | S(ST_AUTH_REQ_SENT), + .out_state_mask = S(ST_WAIT_LU_ACK), + .name = "LU Sent", + .action = fsm_f_lu_sent, + }, + [ST_RESYNC_SENT] = { + .in_event_mask = S(EVT_VLR_AUTH_REQ), + .out_state_mask = S(ST_WAIT_LU_ACK), + .name = "AUTH-RESYNC sent", + .action = fsm_f_imsi_sent, + }, + [ST_WAIT_LU_ACK] = { + .in_event_mask = S(EVT_VLR_LU_ACK) | + S(EVT_VLR_SET_CIPH) | + S(EVT_VLR_LU_REJ), + .out_state_mask = S(ST_DONE), + .name = "WAIT-LU-ACK", + .action = fsm_f_wait_lu_ack, + }, + [ST_DONE] = { + .name = "DONE" + }, +}; + +static struct osmo_fsm vlr_test_fsm = { + .name = "VLR Test FSM", + .states = fsm_success_states, + .num_states = ARRAY_SIZE(fsm_success_states), + .log_subsys = DGPRS, + .event_names = f_event_names, + .allstate_event_mask = S(EVT_MS_CONN_LOST) | + S(EVT_VLR_ID_REQ_IMSI) | + S(EVT_VLR_ID_REQ_IMEI) | + S(EVT_VLR_ID_REQ_IMEISV), + .allstate_action = fsm_f_allstate, +}; + +/* Testing of Subscriber_Present_VLR */ + +enum test_sub_pres_state { + TSPV_S_INIT, + TSPV_S_RUNNING, +}; + +enum test_sub_pres_evt { + TSPV_E_START, + TSPV_E_COMPL, +}; + +static void tspv_f_running(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case TSPV_E_COMPL: + OSMO_ASSERT(vsub); + OSMO_ASSERT(vsub->ms_not_reachable_flag == false); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + } +} + +static void tspv_f_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_fsm_inst *spv; + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case TSPV_E_START: + OSMO_ASSERT(vsub); + vsub->ms_not_reachable_flag = true; + spv = sub_pres_vlr_fsm_start(fi, vsub, TSPV_E_COMPL); + OSMO_ASSERT(spv); + osmo_fsm_inst_state_chg(fi, TSPV_S_RUNNING, 4, 0); + break; + } +} + +static const struct osmo_fsm_state test_sub_pres_vlr_states[] = { + [TSPV_S_INIT] = { + .in_event_mask = S(TSPV_E_START), + .out_state_mask = S(TSPV_S_RUNNING), + .name = "INIT", + .action = tspv_f_init, + }, + [TSPV_S_RUNNING] = { + .in_event_mask = S(TSPV_E_COMPL), + .out_state_mask = 0, + .name = "RUNNING", + .action = tspv_f_running, + }, +}; + +static struct osmo_fsm test_sub_pres_vlr_fsm = { + .name = "Test Subscriber_Present_VLR", + .states = test_sub_pres_vlr_states, + .num_states = ARRAY_SIZE(test_sub_pres_vlr_states), + .log_subsys = DGPRS, + .event_names = f_event_names, + .timer_cb = timer_error_cb, +}; + +#if 0 +static void start_sub_pres_vlr(void *ctx, uint32_t tmsi, const char *imsi) +{ + struct osmo_fsm_inst *fi; + struct vlr_subscr *vsub = vlr_subscr_alloc(g_vlr); + + vsub->tmsi = tmsi; + strncpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + fi = osmo_fsm_inst_alloc(&test_sub_pres_vlr_fsm, ctx, vsub, LOGL_DEBUG, vsub->imsi); + osmo_fsm_inst_dispatch(fi, TSPV_E_START, NULL); +} +#endif + +/* Testing of Update_HLR_VLR */ + +enum test_update_hlr_vlr_state { + TUHV_S_INIT, + TUHV_S_RUNNING, +}; + +enum test_update_hlr_vlr_event { + TUHV_E_START, + TUHV_E_COMPL, +}; + +static void tuhv_f_running(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + enum gsm48_gmm_cause *res = data; + + switch (event) { + case TUHV_E_COMPL: + if (!res) { + /* Success */ + LOGPFSM(fi, "success\n"); + } else { + /* error */ + LOGPFSM(fi, "errror cause=0x%u\n", *res); + } + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + } +} + +static void tuhv_f_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_fsm_inst *child; + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case TUHV_E_START: + child = upd_hlr_vlr_proc_start(fi, vsub, TUHV_E_COMPL); + OSMO_ASSERT(child); + osmo_fsm_inst_state_chg(fi, TUHV_S_RUNNING, 4, 0); + break; + } +} + +static const struct osmo_fsm_state test_upd_hlr_vlr_states[] = { + [TUHV_S_INIT] = { + .in_event_mask = S(TUHV_E_START), + .out_state_mask = S(TUHV_S_RUNNING), + .name = "INIT", + .action = tuhv_f_init, + }, + [TUHV_S_RUNNING] = { + .in_event_mask = S(TUHV_E_COMPL), + .out_state_mask = 0, + .name = "RUNNING", + .action = tuhv_f_running, + }, +}; + +static struct osmo_fsm test_upd_hlr_vlr_fsm = { + .name = "Test Update_HLR_VLR", + .states = test_upd_hlr_vlr_states, + .num_states = ARRAY_SIZE(test_upd_hlr_vlr_states), + .log_subsys = DGPRS, + .event_names = f_event_names, + .timer_cb = timer_error_cb, +}; + +#if 0 +static void start_upd_hlr_vlr(void *ctx, uint32_t tmsi, const char *imsi) +{ + struct osmo_fsm_inst *fi; + struct vlr_subscr *vsub = vlr_subscr_alloc(g_vlr); + + vsub->tmsi = tmsi; + strncpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + + + fi = osmo_fsm_inst_alloc(&test_upd_hlr_vlr_fsm, ctx, vsub, LOGL_DEBUG, + vsub->imsi); + /* we need to set this to fool vlr.c in an ongoing LU */ + vsub->lu_fsm = fi; + osmo_fsm_inst_dispatch(fi, TUHV_E_START, NULL); +} +#endif + +/*********************************************************************** + * Integration with VLR code + ***********************************************************************/ + +static struct vlr_instance *g_vlr; + +/* VLR asks us to send an authentication request */ +static int msc_vlr_tx_auth_req(void *msc_conn_ref, struct gsm_auth_tuple *at, + bool send_autn) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + OSMO_ASSERT(at); + DEBUGP(DGPRS, "%s: RES=%s\n", __func__, + osmo_hexdump_nospc(at->vec.res, at->vec.res_len)); + osmo_fsm_inst_dispatch(fi, EVT_VLR_AUTH_REQ, at); + return 0; +} + +/* VLR asks us to send an authentication reject */ +static int msc_vlr_tx_auth_rej(void *msc_conn_ref) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_AUTH_REJ, NULL); + return 0; +} + +/* VLR asks us to transmit an Identity Request of given type */ +static int msc_vlr_tx_id_req(void *msc_conn_ref, uint8_t mi_type) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + uint32_t event; + + DEBUGP(DGPRS, "%s (%u)\n", __func__, mi_type); + + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + event = EVT_VLR_ID_REQ_IMSI; + break; + case GSM_MI_TYPE_IMEI: + event = EVT_VLR_ID_REQ_IMEI; + break; + case GSM_MI_TYPE_IMEISV: + event = EVT_VLR_ID_REQ_IMEISV; + break; + default: + LOGP(DGPRS, LOGL_ERROR, "Unknown identity 0x%02x\n", + mi_type); + return -1; + } + osmo_fsm_inst_dispatch(fi, event, NULL); + return 0; +} + +/* VLR asks us to transmit a Location Update Accept */ +static int msc_vlr_tx_lu_ack(void *msc_conn_ref, uint32_t send_tmsi) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_LU_ACK, NULL); + return 0; +} + +/* VLR asks us to transmit a Location Update Reject */ +static int msc_vlr_tx_lu_rej(void *msc_conn_ref, uint8_t cause) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_LU_REJ, (void *) &cause); + return 0; +} + +static int msc_vlr_set_ciph_mode(void *msc_conn_ref, enum vlr_ciph mode, + bool retrieve_imeisv) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + DEBUGP(DGPRS, "%s\n", __func__); + osmo_fsm_inst_dispatch(fi, EVT_VLR_SET_CIPH, NULL); + return 0; +} + +/* VLR informs us that the subscriber data has somehow been modified */ +static void msc_vlr_subscr_update(struct vlr_subscr *subscr) +{ + DEBUGP(DGPRS, "%s\n", __func__); + /* FIXME */ +} + +static void msc_vlr_subscr_assoc(void *msc_conn_ref, struct vlr_subscr *vsub) +{ + struct osmo_fsm_inst *fi = msc_conn_ref; + struct testvlr_priv *priv = fsi_priv(fi); + DEBUGP(DGPRS, "%s(%p, %s)\n", __func__, msc_conn_ref, vlr_subscr_name(vsub)); + priv->subscr = vsub; +} + +/* operations that we need to implement for libvlr */ +static const struct vlr_ops test_vlr_ops = { + .tx_auth_req = msc_vlr_tx_auth_req, + .tx_auth_rej = msc_vlr_tx_auth_rej, + .tx_id_req = msc_vlr_tx_id_req, + .tx_lu_acc = msc_vlr_tx_lu_ack, + .tx_lu_rej = msc_vlr_tx_lu_rej, + .set_ciph_mode = msc_vlr_set_ciph_mode, + .subscr_update = msc_vlr_subscr_update, + .subscr_assoc = msc_vlr_subscr_assoc, +}; + +/*********************************************************************** + * Actual test cases + ***********************************************************************/ + + +static struct osmo_fsm_inst * +start_lu(enum testvlr_mode mode, uint32_t tmsi, + const char *imsi, const char *imei) +{ + struct testvlr_priv *vp; + struct osmo_fsm_inst *fi; + + vp = talloc_zero(tall_bsc_ctx, struct testvlr_priv); + vp->mode = mode; + vp->tmsi = tmsi; + strncpy(vp->imsi, imsi, sizeof(vp->imsi)); + strncpy(vp->imei, imei, sizeof(vp->imei)); + + fi = osmo_fsm_inst_alloc(&vlr_test_fsm, vp, vp, LOGL_DEBUG, vp->imsi); + osmo_fsm_inst_dispatch(fi, EVT_MS_TX_LU, NULL); + return fi; +} + +/*********************************************************************** + * Main / Misc + ***********************************************************************/ + +static struct osmo_timer_list tmr; + +static void timer_cb(void *data) +{ + uint32_t tmsi = rand() % 1000000; + uint64_t imsi = 901790000000000 + tmsi; + char imsi_str[32]; + + snprintf(imsi_str, sizeof(imsi_str), "%lu", imsi); + //start_lu(MODE_AUTH_FAIL, tmsi, imsi_str, "23422342"); + start_lu(MODE_SUCCESS_TMSI, tmsi, imsi_str, "23422342"); + //start_lu(MODE_SUCCESS, tmsi, imsi_str, "23422342"); + //start_upd_hlr_vlr(tall_bsc_ctx, tmsi, imsi_str); + //start_sub_pres_vlr(tall_bsc_ctx); + osmo_timer_schedule(&tmr, 8, 0); +} + +static void sighdlr(int sig) +{ + switch (sig) { + case SIGUSR1: + talloc_report_full(tall_bsc_ctx, stderr); + break; + } +} + +int main(int argc, char **argv) +{ + tall_bsc_ctx = talloc_named_const(NULL, 1, "tall_bsc_ctx"); + + signal(SIGUSR1, sighdlr); + + osmo_init_logging(&log_info); + + g_vlr = vlr_alloc(NULL, &test_vlr_ops); + vlr_start("VLRTEST", g_vlr, "localhost", 2222); + OSMO_ASSERT(g_vlr); + osmo_fsm_register(&vlr_test_fsm); + osmo_fsm_register(&test_sub_pres_vlr_fsm); + osmo_fsm_register(&test_upd_hlr_vlr_fsm); + + g_vlr->cfg.assign_tmsi = true; + + tmr.cb = timer_cb; + timer_cb(NULL); + + while (1) { + osmo_select_main(0); + } + + exit(0); +} + +struct gsm_subscriber_connection; +int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn) { return 0; } -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 12:49:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 12:49:38 +0000 Subject: [PATCH] osmo-msc[master]: Use libvlr in libmsc (large refactoring) 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/3195 to look at the new patch set (#3). Use libvlr in libmsc (large refactoring) Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Related: OS#1592 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 --- M configure.ac M include/openbsc/abis_rsl.h M include/openbsc/auth.h M include/openbsc/bsc_api.h M include/openbsc/chan_alloc.h M include/openbsc/db.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/gsm_subscriber.h M include/openbsc/osmo_msc.h M include/openbsc/signal.h M include/openbsc/silent_call.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/paging.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/meas_feed.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c M src/libmsc/token_auth.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr_access_req_fsm.c M src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/db/db_test.c M tests/mm_auth/mm_auth_test.c M tests/mm_auth/mm_auth_test.ok A tests/sms_queue/Makefile.am A tests/sms_queue/sms_queue_test.c A tests/sms_queue/sms_queue_test.err A tests/sms_queue/sms_queue_test.ok M tests/subscr/Makefile.am D tests/subscr/subscr_test.c D tests/subscr/subscr_test.ok M tests/testsuite.at M tests/vty_test_runner.py 66 files changed, 2,170 insertions(+), 3,860 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3195/3 -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 3 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 Thu Jul 20 12:49:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 12:49:40 +0000 Subject: [PATCH] osmo-msc[master]: SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA Message-ID: Review at https://gerrit.osmocom.org/3310 SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA Change-Id: I796e1f4281628061f4522c43c549de9e751bc045 --- M src/libbsc/bsc_init.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/10/3310/1 diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index b7135f1..e12b880 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -462,6 +462,9 @@ for (n=0, i=0; i<8; i++) n += bts->c0->ts[i].pchan == GSM_PCHAN_CCCH ? 1 : 0; + /* Indicate R99 MSC in SI3 */ + bts->si_common.chan_desc.mscr = 1; + switch (n) { case 0: bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_1_C; -- To view, visit https://gerrit.osmocom.org/3310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I796e1f4281628061f4522c43c549de9e751bc045 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 12:53:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 12:53:57 +0000 Subject: [PATCH] osmo-msc[master]: IuPS: don't require an MM context for Iu Release Message-ID: Review at https://gerrit.osmocom.org/3311 IuPS: don't require an MM context for Iu Release Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3 --- M src/gprs/gprs_gmm.c 1 file changed, 13 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/3311/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index dfec604..be1d0e0 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -180,25 +180,33 @@ int rc = -1; mm = sgsn_mm_ctx_by_ue_ctx(ctx); - if (!mm) { - LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event %i!\n", type); - return rc; + +#define REQUIRE_MM \ + if (!mm) { \ + LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event %i!\n", type); \ + return rc; \ } switch (type) { case IU_EVENT_RAB_ASSIGN: + REQUIRE_MM rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; case IU_EVENT_IU_RELEASE: /* fall thru */ case IU_EVENT_LINK_INVALIDATED: /* Clean up ue_conn_ctx here */ - LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); - if (mm->pmm_state == PMM_CONNECTED) + if (mm) + LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); + else + LOGMMCTXP(LOGL_INFO, mm, "IU release for UE conn 0x%x\n", + ctx->conn_id); + if (mm && mm->pmm_state == PMM_CONNECTED) mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; case IU_EVENT_SECURITY_MODE_COMPLETE: + REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; rc = gsm48_gmm_authorize(mm); -- To view, visit https://gerrit.osmocom.org/3311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 12:53:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 12:53:58 +0000 Subject: [PATCH] osmo-msc[master]: IuPS: explicitly check RAN type; move comment Message-ID: Review at https://gerrit.osmocom.org/3312 IuPS: explicitly check RAN type; move comment Change-Id: I054d72590dfb2012f6f8506d3a5f8fd2953194e1 --- M src/gprs/gprs_gmm.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/12/3312/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index be1d0e0..08e0dc0 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -971,10 +971,12 @@ static int gsm48_tx_gmm_ra_upd_ack(struct sgsn_mm_ctx *mm); #ifdef BUILD_IU +/* Send RAB activation requests for all PDP contexts */ void activate_pdp_rabs(struct sgsn_mm_ctx *ctx) { - /* Send RAB activation requests for all PDP contexts */ struct sgsn_pdp_ctx *pdp; + if (ctx->ran_type != MM_CTX_T_UTRAN_Iu) + return; llist_for_each_entry(pdp, &ctx->pdp_list, list) { iu_rab_act_ps(pdp->nsapi, pdp, 1); } -- To view, visit https://gerrit.osmocom.org/3312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I054d72590dfb2012f6f8506d3a5f8fd2953194e1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 12:53:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 12:53:58 +0000 Subject: [PATCH] osmo-msc[master]: SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN Message-ID: Review at https://gerrit.osmocom.org/3313 SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN Change-Id: Ifd9ff4342de342475609bad0257a23c50290e23b --- M src/gprs/sgsn_libgtp.c 1 file changed, 20 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/13/3313/1 diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 001e611..cd10931 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -247,12 +247,8 @@ memcpy(pdp->gsnlu.v, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); - /* Assume we are a GERAN system */ - pdp->rattype.l = 1; - pdp->rattype.v[0] = 2; - pdp->rattype_given = 1; - - /* Include RAI and ULI all the time */ + /* Routing Area Identifier with LAC and RAC fixed values, as + * requested in 29.006 7.3.1 */ pdp->rai_given = 1; pdp->rai.l = 6; raid = mmctx->ra; @@ -260,10 +256,24 @@ raid.rac = 0xFF; gsm48_construct_ra(pdp->rai.v, &raid); - pdp->userloc_given = 1; - pdp->userloc.l = 8; - pdp->userloc.v[0] = 0; /* CGI for GERAN */ - bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); + pdp->rattype.l = 1; + pdp->rattype_given = 1; + + switch (mmctx->ran_type) { + case MM_CTX_T_GERAN_Gb: + case MM_CTX_T_GERAN_Iu: + pdp->rattype.v[0] = 2; + /* User Location Information */ + pdp->userloc_given = 1; + pdp->userloc.l = 8; + pdp->userloc.v[0] = 0; /* CGI for GERAN */ + bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); + break; + case MM_CTX_T_UTRAN_Iu: + pdp->rattype.v[0] = 1; + /* FIXME: Optional User Location Information with SAI */ + break; + } /* include the IMEI(SV) */ pdp->imeisv_given = 1; -- To view, visit https://gerrit.osmocom.org/3313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd9ff4342de342475609bad0257a23c50290e23b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 12:53:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 12:53:59 +0000 Subject: [PATCH] osmo-msc[master]: osmo-nitb: change default db name to sms.db Message-ID: Review at https://gerrit.osmocom.org/3314 osmo-nitb: change default db name to sms.db libvlr now delegates subscriber management to osmo-hlr, so the database no longer represents a HLR. It basically only stores SMS, so reflect that fact in the default database name. Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197 --- M src/osmo-nitb/bsc_hack.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/14/3314/1 diff --git a/src/osmo-nitb/bsc_hack.c b/src/osmo-nitb/bsc_hack.c index ab118d3..9103116 100644 --- a/src/osmo-nitb/bsc_hack.c +++ b/src/osmo-nitb/bsc_hack.c @@ -58,7 +58,7 @@ /* MCC and MNC for the Location Area Identifier */ struct gsm_network *bsc_gsmnet = 0; -static const char *database_name = "hlr.sqlite3"; +static const char *database_name = "sms.db"; static const char *config_file = "openbsc.cfg"; static const char *rf_ctrl_path = NULL; extern const char *openbsc_copyright; -- To view, visit https://gerrit.osmocom.org/3314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 13:13:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 13:13:49 +0000 Subject: libosmo-sccp[master]: cosmetic: remove comment In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 20 13:16:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 20 Jul 2017 13:16:23 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Makefile: Add check-deps target and run it by default Message-ID: Review at https://gerrit.osmocom.org/3315 Makefile: Add check-deps target and run it by default This target will do several quick tests to ensure all the required dependencies needed to build all documents are installed on the system. If a dependency is missing, we abort the build early. Otherwise we can end up building documents which some content missing. Change-Id: I9b86aedd3bfccd7ac00343c16b9d25adc605808d --- M Makefile 1 file changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/15/3315/1 diff --git a/Makefile b/Makefile index fc8ebbf..a870bef 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: +all: check-deps cd OsmoBTS; $(MAKE) cd OsmoNITB; $(MAKE) cd OsmoBSC; $(MAKE) @@ -38,3 +38,22 @@ #cd OsmoMGCP; $(MAKE) check #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check + +define check_dep_bin + @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } +endef +define check_dep_python2_module + @echo "import $(1)" | python2 - >/dev/null 2>&1 || { echo >&2 "Failed to import '$(1)' module, please install $(2)."; exit 1; } +endef + +check-deps: + $(call check_dep_bin,mscgen,mscgen) + $(call check_dep_bin,xsltproc,libxslt) + $(call check_dep_bin,git,git) + $(call check_dep_bin,a2x,asciidoc) + $(call check_dep_bin,asciidoc,asciidoc) + $(call check_dep_bin,dblatex,dblatex) + $(call check_dep_bin,packetdiag,nwdiag) + $(call check_dep_bin,dot,graphviz) + $(call check_dep_bin,python2,python2) + $(call check_dep_python2_module,pychart,python2-pychart) -- To view, visit https://gerrit.osmocom.org/3315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b86aedd3bfccd7ac00343c16b9d25adc605808d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 20 14:36:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 14:36:03 +0000 Subject: libosmo-sccp[master]: sccp: global addressbook search + api fix In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3265/3/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 957: LLIST_HEAD(sccp_address_book_global); I still don't like the second list... It's inviting trouble, should be easy to iterate the ss7 instances instead. OTOH it should also be easy to change that later. -- To view, visit https://gerrit.osmocom.org/3265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5acc1e5abc3b3081149a9f476038e4e53d23b763 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 20 14:40:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 14:40:15 +0000 Subject: libosmo-sccp[master]: sccp: ensure addressbook entry names are unique In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3292/2/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 1212: "address-name already used in other ss7 instance!%s", You are relying on the "happened during this line" output to tell the user which address? I'd still prefer including the name in the error message itself. Maybe even tell the user which ss7 instance already uses that name. (also I personally dislike '!' in log and eror messages, but that's just my bikeshed) -- To view, visit https://gerrit.osmocom.org/3292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 20 14:48:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 20 Jul 2017 14:48:05 +0000 Subject: [PATCH] osmo-bts[master]: lc15: port lc15bts-mgr dependency changes Message-ID: Review at https://gerrit.osmocom.org/3316 lc15: port lc15bts-mgr dependency changes That's mostly changes related to lc15bts-mgr from https://gitlab.com/nrw_noa/osmo-bts branch nrw/litecell15 based on eb5b7f80510b603579f7af6d7d5ead296c2fa260 commit: * adjust comments to simplify further diffs * add libsystemd dependency to lc15bts-mgr * add software watchdog which uses it * ocxo calibration and gps related code Change-Id: I475a330af771891ba3c897294ce0dd57ec2ba8db Related: SYS#3679 --- M configure.ac M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/calib_file.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c A src/osmo-bts-litecell15/misc/lc15bts_swd.c A src/osmo-bts-litecell15/misc/lc15bts_swd.h 8 files changed, 327 insertions(+), 85 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/16/3316/1 diff --git a/configure.ac b/configure.ac index 0ceb8eb..bc36456 100644 --- a/configure.ac +++ b/configure.ac @@ -143,6 +143,7 @@ AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], [#include ]) + PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd) CPPFLAGS=$oldCPPFLAGS fi diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 90e6c46..78a770a 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,14 +1,14 @@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(LITECELL15_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +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) AM_CFLAGS += -DENABLE_LC15BTS EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h misc/lc15bts_led.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ - misc/lc15bts_bid.h misc/lc15bts_nl.h misc/lc15bts_bts.h \ + misc/lc15bts_bid.h misc/lc15bts_nl.h misc/lc15bts_bts.h misc/lc15bts_swd.h \ hw_misc.h l1_if.h l1_transp.h lc15bts.h oml_router.h utils.h bin_PROGRAMS = osmo-bts-lc15 lc15bts-mgr lc15bts-util @@ -29,9 +29,10 @@ misc/lc15bts_mgr_temp.c \ misc/lc15bts_mgr_calib.c \ misc/lc15bts_led.c \ - misc/lc15bts_bts.c + misc/lc15bts_bts.c \ + misc/lc15bts_swd.c -lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(COMMON_LDADD) +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBSYSTEMD_LIBS) $(COMMON_LDADD) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index ac39e46..b7049df 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -42,10 +42,9 @@ #include "lc15bts.h" #include "utils.h" -/** - * * Maximum calibration data chunk size - * */ +/* Maximum calibration data chunk size */ #define MAX_CALIB_TBL_SIZE 65536 +/* Calibration header version */ #define CALIB_HDR_V1 0x01 struct calib_file_desc { @@ -93,19 +92,19 @@ { struct { - uint8_t u8Version; // Header version (1) - uint8_t u8Parity; // Parity byte (xor) - uint8_t u8Type; // Table type (0:TX Downlink, 1:RX-A Uplink, 2:RX-B Uplink) - uint8_t u8Band; // GSM Band (0:GSM-850, 1:EGSM-900, 2:DCS-1800, 3:PCS-1900) - uint32_t u32Len; // Table length in bytes including the header + uint8_t u8Version; /* Header version (1) */ + uint8_t u8Parity; /* Parity byte (xor) */ + uint8_t u8Type; /* Table type (0:TX Downlink, 1:RX-A Uplink, 2:RX-B Uplink) */ + uint8_t u8Band; /* GSM Band (0:GSM-850, 1:EGSM-900, 2:DCS-1800, 3:PCS-1900) */ + uint32_t u32Len; /* Table length in bytes including the header */ struct { - uint32_t u32DescOfst; // Description section offset - uint32_t u32DateOfst; // Date section offset - uint32_t u32StationOfst; // Calibration test station section offset - uint32_t u32FpgaFwVerOfst; // Calibration FPGA firmware version section offset - uint32_t u32DspFwVerOfst; // Calibration DSP firmware section offset - uint32_t u32DataOfst; // Calibration data section offset + uint32_t u32DescOfst; /* Description section offset */ + uint32_t u32DateOfst; /* Date section offset */ + uint32_t u32StationOfst; /* Calibration test station section offset */ + uint32_t u32FpgaFwVerOfst; /* Calibration FPGA firmware version section offset */ + uint32_t u32DspFwVerOfst; /* Calibration DSP firmware section offset */ + uint32_t u32DataOfst; /* Calibration data section offset */ } toc; } v1; } hdr; @@ -314,15 +313,14 @@ struct calTbl_t *calTbl; char calChkSum ; - - //calculate file size in bytes + /* calculate file size in bytes */ fseek(st->fp, 0L, SEEK_END); sz = ftell(st->fp); - //rewind read poiner + /* rewind read poiner */ fseek(st->fp, 0L, SEEK_SET); - //read file + /* read file */ rbuf = (char *) malloc( sizeof(char) * sz ); rc = fread(rbuf, 1, sizeof(char) * sz, st->fp); @@ -331,7 +329,7 @@ LOGP(DL1C, LOGL_ERROR, "%s reading error\n", desc->fname); free(rbuf); - //close file + /* close file */ rc = calib_file_close(fl1h); if (rc < 0 ) { LOGP(DL1C, LOGL_ERROR, "%s can not close\n", desc->fname); @@ -341,33 +339,32 @@ return -2; } - calTbl = (struct calTbl_t*) rbuf; - //calcualte file checksum + /* calculate file checksum */ calChkSum = 0; while ( sz-- ) { calChkSum ^= rbuf[sz]; } - //validate Tx calibration parity + /* validate Tx calibration parity */ if ( calChkSum ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid checksum %x.\n", desc->fname, calChkSum); return -4; } - //validate Tx calibration header + /* validate Tx calibration header */ if ( calTbl->hdr.v1.u8Version != CALIB_HDR_V1 ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid header version %u.\n", desc->fname, calTbl->hdr.v1.u8Version); return -5; } - //validate calibration description + /* validate calibration description */ if ( calTbl->hdr.v1.toc.u32DescOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration description offset.\n", desc->fname); return -6; } - //validate calibration date + /* validate calibration date */ if ( calTbl->hdr.v1.toc.u32DateOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration date offset.\n", desc->fname); return -7; @@ -377,24 +374,25 @@ desc->fname, calTbl->u8RawData + calTbl->hdr.v1.toc.u32DateOfst); - //validate calibration station + /* validate calibration station */ if ( calTbl->hdr.v1.toc.u32StationOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration station ID offset.\n", desc->fname); return -8; } - //validate FPGA FW version + /* validate FPGA FW version */ if ( calTbl->hdr.v1.toc.u32FpgaFwVerOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid FPGA FW version offset.\n", desc->fname); return -9; } - //validate DSP FW version + + /* validate DSP FW version */ if ( calTbl->hdr.v1.toc.u32DspFwVerOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid DSP FW version offset.\n", desc->fname); return -10; } - //validate Tx calibration data offset + /* validate Tx calibration data offset */ if ( calTbl->hdr.v1.toc.u32DataOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration data offset.\n", desc->fname); return -11; @@ -402,11 +400,11 @@ if ( !desc->rx ) { - //parse min/max Tx power + /* parse min/max Tx power */ fl1h->phy_inst->u.lc15.minTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (5 << 2)]; fl1h->phy_inst->u.lc15.maxTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (6 << 2)]; - //override nominal Tx power of given TRX if needed + /* override nominal Tx power of given TRX if needed */ if ( fl1h->phy_inst->trx->nominal_power > fl1h->phy_inst->u.lc15.maxTxPower) { LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", plink->num, @@ -449,7 +447,7 @@ fl1h->phy_inst->u.lc15.maxTxPower ); } - //rewind read poiner for subsequence tasks + /* rewind read pointer for subsequence tasks */ fseek(st->fp, 0L, SEEK_SET); free(rbuf); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index 51a05f9..cec9a82 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -46,6 +46,8 @@ #include "misc/lc15bts_par.h" #include "misc/lc15bts_bid.h" #include "misc/lc15bts_power.h" +#include "misc/lc15bts_swd.h" + #include "lc15bts_led.h" static int no_rom_write = 0; @@ -163,6 +165,7 @@ lc15bts_check_vswr(no_rom_write); osmo_timer_schedule(&sensor_timer, SENSOR_TIMER_SECS, 0); /* TODO checks if lc15bts_check_temp/lc15bts_check_power/lc15bts_check_vswr went ok */ + lc15bts_swd_event(&manager, SWD_CHECK_SENSOR); } static struct osmo_timer_list hours_timer; @@ -172,6 +175,7 @@ osmo_timer_schedule(&hours_timer, HOURS_TIMER_SECS, 0); /* TODO: validates if lc15bts_update_hours went correctly */ + lc15bts_swd_event(&manager, SWD_UPDATE_HOURS); } static void print_help(void) @@ -317,6 +321,10 @@ INIT_LLIST_HEAD(&manager.lc15bts_leds.list); INIT_LLIST_HEAD(&manager.alarms.list); + /* Initialize the service watchdog notification for SWD_LAST event(s) */ + if (lc15bts_swd_init(&manager, (int)(SWD_LAST)) != 0) + exit(3); + /* start temperature check timer */ sensor_timer.cb = check_sensor_timer_cb; check_sensor_timer_cb(NULL); @@ -357,5 +365,6 @@ while (1) { log_reset_context(); osmo_select_main(0); + lc15bts_swd_event(&manager, SWD_MAINLOOP); } } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c index fb49477..badb545 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c @@ -27,6 +27,9 @@ #include "misc/lc15bts_mgr.h" #include "misc/lc15bts_misc.h" #include "misc/lc15bts_clock.h" +#include "misc/lc15bts_swd.h" +#include "misc/lc15bts_par.h" +#include "misc/lc15bts_led.h" #include "osmo-bts/msg_utils.h" #include @@ -41,9 +44,13 @@ #include #include +#include + static void calib_adjust(struct lc15bts_mgr_instance *mgr); static void calib_state_reset(struct lc15bts_mgr_instance *mgr, int reason); static void calib_loop_run(void *_data); + +static int ocxodac_saved_value = -1; enum calib_state { CALIB_INITIAL, @@ -88,7 +95,9 @@ int interval_sec; int dac_value; int new_dac_value; - double dac_correction; + int dac_correction; + time_t now; + time_t last_gps_fix; rc = lc15bts_clock_err_get(&fault, &error_ppt, &accuracy_ppq, &interval_sec); @@ -99,11 +108,31 @@ return; } + /* get current time */ + now = time(NULL); + + /* first time after start of manager program */ + if (mgr->gps.last_update == 0) + mgr->gps.last_update = now; + + /* read last GPS 3D fix from storage */ + rc = lc15bts_par_get_gps_fix(&last_gps_fix); + if (rc < 0) { + LOGP(DCALIB, LOGL_NOTICE, "Last GPS 3D fix can not read (%d). Last GPS 3D fix sets to zero\n", rc); + last_gps_fix = 0; + } + if (fault) { LOGP(DCALIB, LOGL_NOTICE, "GPS has no fix\n"); calib_state_reset(mgr, CALIB_FAIL_GPSFIX); return; } + + /* We got GPS 3D fix */ + LOGP(DCALIB, LOGL_DEBUG, "Got GPS 3D fix warn_flags=0x%08x, last=%lld, now=%lld\n", + mgr->lc15bts_ctrl.warn_flags, + (long long)last_gps_fix, + (long long)now); rc = lc15bts_clock_dac_get(&dac_value); if (rc < 0) { @@ -113,60 +142,74 @@ return; } + /* Set OCXO initial dac value */ + if (ocxodac_saved_value < 0) + ocxodac_saved_value = dac_value; + LOGP(DCALIB, LOGL_NOTICE, "Calibration ERR(%f PPB) ACC(%f PPB) INT(%d) DAC(%d)\n", error_ppt / 1000., accuracy_ppq / 1000000., interval_sec, dac_value); - /* 1 unit of correction equal about 0.5 - 1 PPB correction */ - dac_correction = (int)(-error_ppt * 0.00056); - new_dac_value = dac_value + dac_correction + 0.5; - - /* We have a fix, make sure the measured error is - meaningful (10 times the accuracy) */ - if ((new_dac_value != dac_value) && ((100l * abs(error_ppt)) > accuracy_ppq)) { - + /* Need integration time to correct */ + if (interval_sec) { + /* 1 unit of correction equal about 0.5 - 1 PPB correction */ + dac_correction = (int)(-error_ppt * 0.0015); + new_dac_value = dac_value + dac_correction; + if (new_dac_value > 4095) - dac_value = 4095; + new_dac_value = 4095; else if (new_dac_value < 0) - dac_value = 0; - else - dac_value = new_dac_value; - - LOGP(DCALIB, LOGL_NOTICE, - "Going to apply %d as new clock setting.\n", - dac_value); - - rc = lc15bts_clock_dac_set(dac_value); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to set OCXO dac value %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_OCXODAC); - return; - } - rc = lc15bts_clock_err_reset(); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to set reset clock error module %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_CLKERR); - return; - } - } + new_dac_value = 0; - /* Save the correction value in the DAC eeprom if the - frequency has been stable for 24 hours */ - else if (interval_sec >= (24 * 60 * 60)) { - rc = lc15bts_clock_dac_save(); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to save OCXO dac value %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_OCXODAC); + /* We have a fix, make sure the measured error is + meaningful (10 times the accuracy) */ + if ((new_dac_value != dac_value) && ((100l * abs(error_ppt)) > accuracy_ppq)) { + + LOGP(DCALIB, LOGL_NOTICE, + "Going to apply %d as new clock setting.\n", + new_dac_value); + + rc = lc15bts_clock_dac_set(new_dac_value); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to set OCXO dac value %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_OCXODAC); + return; + } + rc = lc15bts_clock_err_reset(); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to reset clock error module %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_CLKERR); + return; + } } - rc = lc15bts_clock_err_reset(); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to set reste clock error module %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_CLKERR); + /* New conditions to store DAC value: + * - Resolution accuracy less or equal than 0.01PPB (or 10000 PPQ) + * - Error less or equal than 2PPB (or 2000PPT) + * - Solution different than the last one */ + else if (accuracy_ppq <= 10000) { + if((dac_value != ocxodac_saved_value) && (abs(error_ppt) < 2000)) { + LOGP(DCALIB, LOGL_NOTICE, "Saving OCXO DAC value to memory... val = %d\n", dac_value); + rc = lc15bts_clock_dac_save(); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to save OCXO dac value %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_OCXODAC); + } else { + ocxodac_saved_value = dac_value; + } + } + + rc = lc15bts_clock_err_reset(); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to reset clock error module %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_CLKERR); + } } + } else { + LOGP(DCALIB, LOGL_NOTICE, "Skipping this iteration, no integration time\n"); } calib_state_reset(mgr, CALIB_SUCCESS); @@ -197,6 +240,8 @@ mgr->calib.calib_timeout.data = mgr; mgr->calib.calib_timeout.cb = calib_loop_run; osmo_timer_schedule(&mgr->calib.calib_timeout, timeout, 0); + /* TODO: do we want to notify if we got a calibration error, like no gps fix? */ + lc15bts_swd_event(mgr, SWD_CHECK_CALIB); } mgr->calib.state = CALIB_INITIAL; @@ -241,6 +286,7 @@ mgr->calib.calib_timeout.data = mgr; mgr->calib.calib_timeout.cb = calib_loop_run; osmo_timer_schedule(&mgr->calib.calib_timeout, 0, 0); - return 0; + + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 9d2dfec..9665e1d 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -28,6 +28,7 @@ #include "misc/lc15bts_temp.h" #include "misc/lc15bts_power.h" #include "misc/lc15bts_led.h" +#include "misc/lc15bts_swd.h" #include "limits.h" #include @@ -116,7 +117,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl start lc15bts.service"); + system("/bin/systemctl start osmo-bts.service"); } } @@ -151,7 +152,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl stop lc15bts.service"); + system("/bin/systemctl stop osmo-bts.service"); } } @@ -364,6 +365,7 @@ osmo_timer_schedule(&sensor_ctrl_timer, LC15BTS_SENSOR_TIMER_DURATION, 0); LOGP(DTEMP, LOGL_DEBUG,"Check sensors timer expired\n"); /* TODO: do we want to notify if some sensors could not be read? */ + lc15bts_swd_event(mgr, SWD_CHECK_TEMP_SENSOR); } int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr) diff --git a/src/osmo-bts-litecell15/misc/lc15bts_swd.c b/src/osmo-bts-litecell15/misc/lc15bts_swd.c new file mode 100644 index 0000000..59c7b61 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_swd.c @@ -0,0 +1,178 @@ +/* Systemd service wd notification for Litecell 1.5 BTS management daemon */ + +/* Copyright (C) 2015 by Yves Godin + * + * 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 "misc/lc15bts_mgr.h" +#include "misc/lc15bts_swd.h" +#include + +/* Needed for service watchdog notification */ +#include + +/* This is the period used to verify if all events have been registered to be allowed + to notify the systemd service watchdog +*/ +#define SWD_PERIOD 30 + +static void swd_start(struct lc15bts_mgr_instance *mgr); +static void swd_process(struct lc15bts_mgr_instance *mgr); +static void swd_close(struct lc15bts_mgr_instance *mgr); +static void swd_state_reset(struct lc15bts_mgr_instance *mgr, int reason); +static int swd_run(struct lc15bts_mgr_instance *mgr, int from_loop); +static void swd_loop_run(void *_data); + +enum swd_state { + SWD_INITIAL, + SWD_IN_PROGRESS, +}; + +enum swd_result { + SWD_FAIL_START, + SWD_FAIL_NOTIFY, + SWD_SUCCESS, +}; + +static void swd_start(struct lc15bts_mgr_instance *mgr) +{ + swd_process(mgr); +} + +static void swd_process(struct lc15bts_mgr_instance *mgr) +{ + int rc = 0, notify = 0; + + /* Did we get all needed conditions ? */ + if (mgr->swd.swd_eventmasks == mgr->swd.swd_events) { + /* Ping systemd service wd if enabled */ + rc = sd_notify(0, "WATCHDOG=1"); + LOGP(DSWD, LOGL_NOTICE, "Watchdog notification attempt\n"); + notify = 1; + } + else { + LOGP(DSWD, LOGL_NOTICE, "Missing watchdog events: e:0x%016llx,m:0x%016llx\n",mgr->swd.swd_events,mgr->swd.swd_eventmasks); + } + + if (rc < 0) { + LOGP(DSWD, LOGL_ERROR, + "Failed to notify system service watchdog: %d\n", rc); + swd_state_reset(mgr, SWD_FAIL_NOTIFY); + return; + } + else { + /* Did we notified the watchdog? */ + if (notify) { + mgr->swd.swd_events = 0; + /* Makes sure we really cleared it in case any event was notified at this same moment (it would be lost) */ + if (mgr->swd.swd_events != 0) + mgr->swd.swd_events = 0; + } + } + + swd_state_reset(mgr, SWD_SUCCESS); + return; +} + +static void swd_close(struct lc15bts_mgr_instance *mgr) +{ +} + +static void swd_state_reset(struct lc15bts_mgr_instance *mgr, int outcome) +{ + if (mgr->swd.swd_from_loop) { + mgr->swd.swd_timeout.data = mgr; + mgr->swd.swd_timeout.cb = swd_loop_run; + osmo_timer_schedule(&mgr->swd.swd_timeout, SWD_PERIOD, 0); + } + + mgr->swd.state = SWD_INITIAL; + swd_close(mgr); +} + +static int swd_run(struct lc15bts_mgr_instance *mgr, int from_loop) +{ + if (mgr->swd.state != SWD_INITIAL) { + LOGP(DSWD, LOGL_ERROR, "Swd is already in progress.\n"); + return -1; + } + + mgr->swd.swd_from_loop = from_loop; + + /* From now on everything will be handled from the failure */ + mgr->swd.state = SWD_IN_PROGRESS; + swd_start(mgr); + return 0; +} + +static void swd_loop_run(void *_data) +{ + int rc; + struct lc15bts_mgr_instance *mgr = _data; + + LOGP(DSWD, LOGL_NOTICE, "Going to check for watchdog notification.\n"); + rc = swd_run(mgr, 1); + if (rc != 0) { + swd_state_reset(mgr, SWD_FAIL_START); + } +} + +/* 'swd_num_events' configures the number of events to be monitored before notifying the + systemd service watchdog. It must be in the range of [1,64]. Events are notified + through the function 'lc15bts_swd_event' +*/ +int lc15bts_swd_init(struct lc15bts_mgr_instance *mgr, int swd_num_events) +{ + /* Checks for a valid number of events to validate */ + if (swd_num_events < 1 || swd_num_events > 64) + return(-1); + + mgr->swd.state = SWD_INITIAL; + mgr->swd.swd_timeout.data = mgr; + mgr->swd.swd_timeout.cb = swd_loop_run; + osmo_timer_schedule(&mgr->swd.swd_timeout, 0, 0); + + if (swd_num_events == 64){ + mgr->swd.swd_eventmasks = 0xffffffffffffffffULL; + } + else { + mgr->swd.swd_eventmasks = ((1ULL << swd_num_events) - 1); + } + mgr->swd.swd_events = 0; + mgr->swd.num_events = swd_num_events; + + return 0; +} + +/* Notifies that the specified event 'swd_event' happened correctly; + the value must be in the range of [0,'swd_num_events'[ (see lc15bts_swd_init). + For example, if 'swd_num_events' was 64, 'swd_event' events are numbered 0 to 63. + WARNING: if this function can be used from multiple threads at the same time, + it must be protected with a kind of mutex to avoid loosing event notification. +*/ +int lc15bts_swd_event(struct lc15bts_mgr_instance *mgr, enum mgr_swd_events swd_event) +{ + /* Checks for a valid specified event (smaller than max possible) */ + if ((int)(swd_event) < 0 || (int)(swd_event) >= mgr->swd.num_events) + return(-1); + + mgr->swd.swd_events = mgr->swd.swd_events | ((unsigned long long int)(1) << (int)(swd_event)); + + /* !!! Uncomment following line to debug events notification */ + LOGP(DSWD, LOGL_DEBUG,"Swd event notified: %d\n", (int)(swd_event)); + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_swd.h b/src/osmo-bts-litecell15/misc/lc15bts_swd.h new file mode 100644 index 0000000..b78a2c2 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_swd.h @@ -0,0 +1,7 @@ +#ifndef _LC15BTS_SWD_H +#define _LC15BTS_SWD_H + +int lc15bts_swd_init(struct lc15bts_mgr_instance *mgr, int swd_num_events); +int lc15bts_swd_event(struct lc15bts_mgr_instance *mgr, enum mgr_swd_events swd_event); + +#endif -- To view, visit https://gerrit.osmocom.org/3316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I475a330af771891ba3c897294ce0dd57ec2ba8db Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jul 20 15:30:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 15:30:18 +0000 Subject: libosmo-sccp[master]: sccp: make simple client configurable via VTY In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (19 comments) https://gerrit.osmocom.org/#/c/3303/1//COMMIT_MSG Commit Message: Line 7: sccp: make simple client configurable via VTY I don't see how this patch relates to the VTY. AFAICT it rather goes to great lengths to allow calling simple_client() multiple times on the same ss7 instance, the reason not being clear. How does a VTY config end up in this function? Why is re-entrant client creation necessary? >90% of this patch are not needed if we disallow multiple simple_client calls per ss7 instance, so we need a good reason. Line 12: Add additional logic that checks for a still existing, valid ("already existing") Line 14: assume use the caller supplied parameters as standard configuration. assume? https://gerrit.osmocom.org/#/c/3303/1/src/osmo_ss7.c File src/osmo_ss7.c: Line 836: /*! \brief Find Application Server by given protocol. missing explanation: If an AS has an ASP also matching the given protocol, that AS is preferred. If there are multiple matches, return the first matching AS. Line 844: struct osmo_ss7_as *second_best_as = NULL; (var name bikeshed: 'as_without_asp') Line 850: * where the proto matches up */ (rather make use of the entire line width, by your choice either 80 or since recently up to 120. But let's not spread out the comments unnecessarily to match the other osmocom code. same below.) Line 855: * proto, just in cas we will not find any typo Line 860: /* Check if the candicate we have here as typo x2 Line 862: for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { don't duplicate code, rather re-use below osmo_ss7_asp_find_by_proto() https://gerrit.osmocom.org/#/c/3303/1/src/sccp_user.c File src/sccp_user.c: Line 255: * valid port numbers */ (use line width, same below) Line 278: * proper value when a cs7 instance is defined via the VTY */ otherwise what happens? can we make the code protect us from adverse effects if the user fails to do it properly, i.e. fail with an error message? Line 288: if (ss7->sccp) { If we really need to call this more than once: verify that this matches *all* arguments passed to this function: as->cfg.routing_key, asp->name and ports, asp->cfg.local.host asp->cfg.remote.host, protocol. We should not silently ignore mismatches = highly confusing to a user. What would be the reaction to mismatching conf? Since there can be only one sccp, it must be a fatal error AFAICT. Line 315: } else { check matching function arguments } Line 320: * that is associated with the application server we have choosen (chosen) (please end sentences with proper punctuation, don't rely on line breaks) Line 326: "%s: No ASP instance found, autocreating one...\n", name); Rather drop the "No ASP instance found", it looks like an error, but it will always be printed for the first call: just "Creating ASP instance...". Also add the asp_name as well as the protocol string and ports. OTOH, isn't osmo_ss7_* already logging this? In that case we could drop this logging. Line 340: } else { ensure matching parameters } Line 343: asp->cfg.is_server = false; if the asp already existed, you may be changing an ASP intended for a different purpose. It seems more and more appropriate to only allow one simple_client call per ss7 instance and skip all of these complications. Line 347: osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG); it seems osmo_ss7_asp_use_default_lm() does not guard against an asp->lm_priv FSM instance already existing. It simply drops the previous fi on the floor = mem leak. I guess we need to fix that function separately, but another point against allowing re-use of simple-client. Line 353: LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SCCP instance...\n", name); (the '...' implies that it takes a while, but it's instantaneous) -- To view, visit https://gerrit.osmocom.org/3303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 20 15:59:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 15:59:29 +0000 Subject: [PATCH] osmo-msc[master]: jenkins: actually pass proper configure flags to make distcheck Message-ID: Review at https://gerrit.osmocom.org/3317 jenkins: actually pass proper configure flags to make distcheck Change-Id: I8cf2baa60a2a1fa5ad1933b34080c18cd05ba1c8 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/17/3317/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6650b5d..5903429 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -48,5 +48,7 @@ $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh -LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \ +LD_LIBRARY_PATH="$inst/lib" \ + DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8cf2baa60a2a1fa5ad1933b34080c18cd05ba1c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 16:01:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 16:01:08 +0000 Subject: [PATCH] osmo-msc[master]: Add libvlr implementation 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/3194 to look at the new patch set (#6). Add libvlr implementation Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/debug.h A include/openbsc/vlr.h M src/Makefile.am M src/libcommon/debug.c A src/libmsc/subscr_conn.c M src/libmsc/vty_interface_layer3.c A src/libvlr/Makefile.am A src/libvlr/vlr.c A src/libvlr/vlr_access_req_fsm.c A src/libvlr/vlr_access_req_fsm.h A src/libvlr/vlr_auth_fsm.c A src/libvlr/vlr_auth_fsm.h A src/libvlr/vlr_core.h A src/libvlr/vlr_lu_fsm.c A src/libvlr/vlr_lu_fsm.h M src/osmo-nitb/Makefile.am 18 files changed, 4,734 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/3194/6 diff --git a/configure.ac b/configure.ac index ff51ccf..034c2a4 100644 --- a/configure.ac +++ b/configure.ac @@ -225,6 +225,7 @@ src/libtrau/Makefile src/libbsc/Makefile src/libmsc/Makefile + src/libvlr/Makefile src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 2740a5d..532328c 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -84,6 +84,7 @@ trau_mux.h \ trau_upqueue.h \ ussd.h \ + vlr.h \ vty.h \ v42bis.h \ v42bis_private.h \ diff --git a/include/openbsc/debug.h b/include/openbsc/debug.h index 8a4247b..3feb7c3 100644 --- a/include/openbsc/debug.h +++ b/include/openbsc/debug.h @@ -38,12 +38,8 @@ DSUA, DV42BIS, DPCU, + DVLR, Debug_LastEntry, }; - -struct gsm_subscriber; - -void log_set_filter_vlr_subscr(struct log_target *target, - struct gsm_subscriber *vlr_subscr); extern const struct log_info log_info; diff --git a/include/openbsc/vlr.h b/include/openbsc/vlr.h new file mode 100644 index 0000000..90e3d7a --- /dev/null +++ b/include/openbsc/vlr.h @@ -0,0 +1,413 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +// for GSM_NAME_LENGTH +#include + +/* from 3s to 10s */ +#define GSM_29002_TIMER_S 10 +/* from 15s to 30s */ +#define GSM_29002_TIMER_M 30 +/* from 1min to 10min */ +#define GSM_29002_TIMER_ML (10*60) +/* from 28h to 38h */ +#define GSM_29002_TIMER_L (32*60*60) + + +/* VLR subscriber authentication state */ +enum vlr_subscr_auth_state { + /* subscriber needs to be autenticated */ + VLR_SUB_AS_NEEDS_AUTH, + /* waiting for AuthInfo from HLR/AUC */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + /* waiting for response from subscriber */ + VLR_SUB_AS_WAIT_RESP, + /* successfully authenticated */ + VLR_SUB_AS_AUTHENTICATED, + /* subscriber needs re-sync */ + VLR_SUB_AS_NEEDS_RESYNC, + /* waiting for AuthInfo with ReSync */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + /* waiting for response from subscr, resync case */ + VLR_SUB_AS_WAIT_RESP_RESYNC, + /* waiting for IMSI from subscriber */ + VLR_SUB_AS_WAIT_ID_IMSI, + /* authentication has failed */ + VLR_SUB_AS_AUTH_FAILED, +}; + +enum vlr_lu_event { + VLR_ULA_E_UPDATE_LA, /* Initial trigger (LU from MS) */ + VLR_ULA_E_SEND_ID_ACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_SEND_ID_NACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_AUTH_RES, /* Result of auth procedure */ + VLR_ULA_E_CIPH_RES, /* Result of Ciphering Mode Command */ + VLR_ULA_E_ID_IMSI, /* IMSI recieved from MS */ + VLR_ULA_E_ID_IMEI, /* IMEI received from MS */ + VLR_ULA_E_ID_IMEISV, /* IMEISV received from MS */ + VLR_ULA_E_HLR_LU_RES, /* HLR UpdateLocation result */ + VLR_ULA_E_UPD_HLR_COMPL,/* UpdatE_HLR_VLR result */ + VLR_ULA_E_LU_COMPL_SUCCESS,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_LU_COMPL_FAILURE,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_NEW_TMSI_ACK, /* TMSI Reallocation Complete */ +}; + +enum vlr_ciph_result_cause { + VLR_CIPH_REJECT, /* ? */ + VLR_CIPH_COMPL, +}; + +struct vlr_ciph_result { + enum vlr_ciph_result_cause cause; + const char *imeisv; +}; + +enum vlr_subscr_security_context { + VLR_SEC_CTX_NONE, + VLR_SEC_CTX_GSM, + VLR_SEC_CTX_UMTS, +}; + +enum vlr_lu_type { + VLR_LU_TYPE_PERIODIC, + VLR_LU_TYPE_IMSI_ATTACH, + VLR_LU_TYPE_REGULAR, +}; + +#define OSMO_LBUF_DECL(name, xlen) \ + struct { \ + uint8_t buf[xlen]; \ + size_t len; \ + } name + +struct sgsn_mm_ctx; +struct vlr_instance; + +/* The VLR subscriber is the part of the GSM subscriber state in VLR (CS) or + * SGSN (PS), particularly while interacting with the HLR via GSUP */ +struct vlr_subscr { + struct llist_head list; + struct vlr_instance *vlr; + + /* TODO either populate from HLR or drop this completely? */ + long long unsigned int id; + + /* Data from HLR */ /* 3GPP TS 23.008 */ + /* Always use vlr_subscr_set_imsi() to write to imsi[] */ + char imsi[GSM23003_IMSI_MAX_DIGITS+1]; /* 2.1.1.1 */ + char msisdn[GSM_EXTENSION_LENGTH+1]; /* 2.1.2 */ + char name[GSM_NAME_LENGTH+1]; /* proprietary */ + OSMO_LBUF_DECL(hlr, 16); /* 2.4.7 */ + uint32_t periodic_lu_timer; /* 2.4.24 */ + uint32_t age_indicator; /* 2.17.1 */ + + /* Authentication Data */ + struct gsm_auth_tuple auth_tuples[5]; /* 2.3.1-2.3.4 */ + struct gsm_auth_tuple *last_tuple; + enum vlr_subscr_security_context sec_ctx; + + /* Data local to VLR is below */ + uint32_t tmsi; /* 2.1.4 */ + /* Newly allocated TMSI that was not yet acked by MS */ + uint32_t tmsi_new; + + /* some redundancy in information below? */ + struct osmo_cell_global_id cgi; /* 2.4.16 */ + uint16_t lac; /* 2.4.2 */ + + char imeisv[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.2.3 */ + char imei[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.1.9 */ + bool imsi_detached_flag; /* 2.7.1 */ + bool conf_by_radio_contact_ind; /* 2.7.4.1 */ + bool sub_dataconf_by_hlr_ind; /* 2.7.4.2 */ + bool loc_conf_in_hlr_ind; /* 2.7.4.3 */ + bool dormant_ind; /* 2.7.8 */ + bool cancel_loc_rx; /* 2.7.8A */ + bool ms_not_reachable_flag; /* 2.10.2 (MNRF) */ + bool la_allowed; + + int use_count; + time_t expire_lu; /* FIXME: overlap with periodic_lu_timer/age_indicator */ + + struct osmo_fsm_inst *lu_fsm; + struct osmo_fsm_inst *auth_fsm; + struct osmo_fsm_inst *proc_arq_fsm; + + bool lu_complete; + + void *msc_conn_ref; + + /* PS (SGSN) specific parts */ + struct { + struct llist_head pdp_list; + uint8_t rac; + uint8_t sac; + struct gprs_mm_ctx *mmctx; + } ps; + /* CS (NITB/CSCN) specific parts */ + struct { + /* pending requests */ + bool is_paging; + struct llist_head requests; + } cs; +}; + +enum vlr_proc_arq_result; + +enum vlr_ciph { + VLR_CIPH_NONE, /*< A5/0, no encryption */ + VLR_CIPH_A5_1, /*< A5/1, encryption */ + VLR_CIPH_A5_2, /*< A5/2, deprecated export-grade encryption */ + VLR_CIPH_A5_3, /*< A5/3, 'new secure' encryption */ +}; + +struct vlr_ops { + /* encode + transmit an AUTH REQ towards the MS. + * \param[in] at auth tuple providing rand, key_seq and autn. + * \param[in] send_autn True to send AUTN, for r99 UMTS auth. + */ + int (*tx_auth_req)(void *msc_conn_ref, struct gsm_auth_tuple *at, + bool send_autn); + /* encode + transmit an AUTH REJECT towards the MS */ + int (*tx_auth_rej)(void *msc_conn_ref); + + /* encode + transmit an IDENTITY REQUEST towards the MS */ + int (*tx_id_req)(void *msc_conn_ref, uint8_t mi_type); + + int (*tx_lu_acc)(void *msc_conn_ref, uint32_t send_tmsi); + int (*tx_lu_rej)(void *msc_conn_ref, uint8_t cause); + 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 retrieve_imeisv); + + /* notify MSC/SGSN that the subscriber data in VLR has been updated */ + void (*subscr_update)(struct vlr_subscr *vsub); + /* notify MSC/SGSN that the given subscriber has been associated + * with this msc_conn_ref */ + void (*subscr_assoc)(void *msc_conn_ref, struct vlr_subscr *vsub); +}; + +enum vlr_timer { + VLR_T_3250, + VLR_T_3260, + VLR_T_3270, + _NUM_VLR_TIMERS +}; + +/* An instance of the VLR codebase */ +struct vlr_instance { + struct llist_head subscribers; + struct llist_head operations; + struct gsup_client *gsup_client; + struct vlr_ops ops; + struct { + bool retrieve_imeisv; + bool assign_tmsi; + bool check_imei_rqd; + int auth_tuple_max_use_count; + bool auth_reuse_old_sets_on_error; + bool parq_retrieve_imsi; + bool is_ps; + uint32_t timer[_NUM_VLR_TIMERS]; + } cfg; + /* A free-form pointer for use by the caller */ + void *user_ctx; +}; + +extern const struct value_string vlr_ciph_names[]; +static inline const char *vlr_ciph_name(enum vlr_ciph val) +{ + return get_value_string(vlr_ciph_names, val); +} + +/* Location Updating request */ +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi); + +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi); + +/* tell the VLR that the subscriber connection is gone */ +int vlr_subscr_disconnected(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); +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); +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); +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub); + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops); +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port); + +/* internal use only */ + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event); +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event); + +struct osmo_fsm_inst * +lu_compl_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure); + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +const char *vlr_subscr_msisdn_or_name(struct vlr_subscr *vsub); + +#define vlr_subscr_find_by_imsi(vlr, imsi) \ + _vlr_subscr_find_by_imsi(vlr, imsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_imsi(vlr, imsi, created) \ + _vlr_subscr_find_or_create_by_imsi(vlr, imsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_tmsi(vlr, tmsi) \ + _vlr_subscr_find_by_tmsi(vlr, tmsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created) \ + _vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_msisdn(vlr, msisdn) \ + _vlr_subscr_find_by_msisdn(vlr, msisdn, __BASE_FILE__, __LINE__) + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line); + +#define vlr_subscr_get(sub) _vlr_subscr_get(sub, __BASE_FILE__, __LINE__) +#define vlr_subscr_put(sub) _vlr_subscr_put(sub, __BASE_FILE__, __LINE__) +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line); +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line); + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_free(struct vlr_subscr *vsub); +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub); + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi); +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei); +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv); +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn); + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi); +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi); +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn); +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei); + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer); + +int vlr_subscr_changed(struct vlr_subscr *vsub); +int vlr_subscr_purge(struct vlr_subscr *vsub); +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause); + + +/* Process Acccess Request FSM */ + +enum vlr_proc_arq_result { + VLR_PR_ARQ_RES_NONE, + VLR_PR_ARQ_RES_SYSTEM_FAILURE, + VLR_PR_ARQ_RES_ILLEGAL_SUBSCR, + VLR_PR_ARQ_RES_UNIDENT_SUBSCR, + VLR_PR_ARQ_RES_ROAMING_NOTALLOWED, + VLR_PR_ARQ_RES_ILLEGAL_EQUIP, + VLR_PR_ARQ_RES_UNKNOWN_ERROR, + VLR_PR_ARQ_RES_TIMEOUT, + VLR_PR_ARQ_RES_PASSED, +}; + +extern const struct value_string vlr_proc_arq_result_names[]; +static inline const char *vlr_proc_arq_result_name(enum vlr_proc_arq_result res) +{ + return get_value_string(vlr_proc_arq_result_names, res); +} + +enum proc_arq_vlr_event { + PR_ARQ_E_START, + PR_ARQ_E_ID_IMSI, + PR_ARQ_E_AUTH_RES, + PR_ARQ_E_CIPH_RES, + PR_ARQ_E_UPD_LOC_RES, + PR_ARQ_E_TRACE_RES, + PR_ARQ_E_IMEI_RES, + PR_ARQ_E_PRES_RES, + PR_ARQ_E_TMSI_ACK, +}; + +enum vlr_parq_type { + VLR_PR_ARQ_T_INVALID = 0, /* to guard against unset vars */ + VLR_PR_ARQ_T_CM_SERV_REQ, + VLR_PR_ARQ_T_PAGING_RESP, + /* FIXME: differentiate between services of 24.008 10.5.3.3 */ +}; + +/* Process Access Request (CM SERV REQ / PAGING RESP) */ +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran); + +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi); + +void vlr_parq_fsm_init(void); + +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv); + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr); diff --git a/src/Makefile.am b/src/Makefile.am index cfad7df..c66f9e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,7 @@ # Libraries SUBDIRS = \ libcommon \ + libvlr \ libmgcp \ libbsc \ libmsc \ diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index f29f168..088902a 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -180,6 +180,11 @@ .description = "PCU Interface", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DVLR] = { + .name = "DVLR", + .description = "Visitor Location Register", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static int filter_fn(const struct log_context *ctx, struct log_target *tar) diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c new file mode 100644 index 0000000..91ffe40 --- /dev/null +++ b/src/libmsc/subscr_conn.c @@ -0,0 +1,269 @@ +/* MSC subscriber connection implementation */ + +/* + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +static const struct value_string subscr_conn_fsm_event_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_E_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_E_ACCEPTED), + OSMO_VALUE_STRING(SUBSCR_CONN_E_BUMP), + OSMO_VALUE_STRING(SUBSCR_CONN_E_MO_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CN_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CLOSE_CONF), + { 0, NULL } +}; + +const struct value_string subscr_conn_from_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_LU), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_CM_SERVICE_REQ), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_PAGING_RESP), + { 0, NULL } +}; + +static void paging_resp(struct gsm_subscriber_connection *conn, + enum gsm_paging_event pe) +{ + subscr_paging_dispatch(GSM_HOOK_RR_PAGING, pe, NULL, conn, conn->subscr); +} + +void subscr_conn_fsm_new(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + enum subscr_conn_from from = SUBSCR_CONN_FROM_INVALID; + enum gsm_paging_event pe; + + if (data) { + from = *(enum subscr_conn_from*)data; + LOGPFSM(fi, "%s\n", subscr_conn_from_name(from)); + } + + /* If accepted, transition the state, all other cases mean failure. */ + switch (event) { + case SUBSCR_CONN_E_ACCEPTED: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + break; + + case SUBSCR_CONN_E_MO_CLOSE: + case SUBSCR_CONN_E_CN_CLOSE: + case SUBSCR_CONN_E_CLOSE_CONF: + break; + + default: + LOGPFSM(fi, "Unexpected event: %d %s\n", + event, osmo_fsm_event_name(fi->fsm, event)); + break; + } + + /* if appropriate, signal paging success or failure */ + if (from == SUBSCR_CONN_FROM_PAGING_RESP) { + pe = (fi->state == SUBSCR_CONN_S_ACCEPTED)? + GSM_PAGING_SUCCEEDED : GSM_PAGING_EXPIRED; + paging_resp(conn, pe); + } + + /* On failure, discard the conn */ + if (fi->state != SUBSCR_CONN_S_ACCEPTED) { + /* TODO: on MO_CLOSE or CN_CLOSE, first go to RELEASING and + * await BSC confirmation? */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); + return; + } + + /* On success, handle pending requests and/or close conn */ + + if (from == SUBSCR_CONN_FROM_CM_SERVICE_REQ) { + conn->received_cm_service_request = true; + LOGPFSM(fi, "received_cm_service_request = true\n"); + } + + osmo_fsm_inst_dispatch(fi, SUBSCR_CONN_E_BUMP, data); +} + +#if 0 + case SUBSCR_CONN_E_PARQ_SUCCESS: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + accept_conn = true; + /* fall through */ + case SUBSCR_CONN_E_PARQ_FAILURE: + parq_type = data ? *(enum vlr_parq_type*)data : VLR_PR_ARQ_T_INVALID; + switch (parq_type) { + + case VLR_PR_ARQ_T_CM_SERV_REQ: + accept_conn = handle_cm_serv_result(fi, accept_conn); + break; + + case VLR_PR_ARQ_T_PAGING_RESP: + accept_conn = handle_paging_result(fi, accept_conn); + break; + + default: + LOGPFSML(fi, LOGL_ERROR, + "Invalid VLR Process Access Request type" + " %d\n", parq_type); + accept_conn = false; + break; + } + break; +#endif + +static void subscr_conn_fsm_bump(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + + if (conn->silent_call) + return; + + if (conn->received_cm_service_request) + return; + + /* is this needed? */ + if (conn->subscr && !llist_empty(&conn->subscr->requests)) + return; + + if (trans_has_conn(conn)) + return; + + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_accepted(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case SUBSCR_CONN_E_BUMP: + subscr_conn_fsm_bump(fi, event, data); + return; + + default: + break; + } + /* Whatever unexpected happens in the accepted state, it means release. + * Even if an unexpected event is passed, the safest thing to do is + * discard the conn. We don't expect another SUBSCR_CONN_E_ACCEPTED. */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_release(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = fi->priv; + if (!conn) + return; + + /* temporary hack, see owned_by_msc */ + if (!conn->owned_by_msc) { + DEBUGP(DMM, "%s leaving bsc_subscr_con_free() to bsc_api.c, owned_by_msc = false\n", + subscr_name(conn->subscr)); + return; + } + + DEBUGP(DMM, "%s calling bsc_subscr_con_free(), owned_by_msc = true\n", + subscr_name(conn->subscr)); + gsm0808_clear(conn); + bsc_subscr_con_free(conn); +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state subscr_conn_fsm_states[] = { + [SUBSCR_CONN_S_NEW] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_NEW), + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_ACCEPTED) | + S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_new, + }, + [SUBSCR_CONN_S_ACCEPTED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_ACCEPTED), + /* allow everything to release for any odd behavior */ + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_BUMP) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_accepted, + }, + [SUBSCR_CONN_S_RELEASED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_RELEASED), + .onenter = subscr_conn_fsm_release, + }, +}; + +static struct osmo_fsm subscr_conn_fsm = { + .name = "Subscr_Conn", + .states = subscr_conn_fsm_states, + .num_states = ARRAY_SIZE(subscr_conn_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = subscr_conn_fsm_event_names, +}; + +int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id) +{ + struct osmo_fsm_inst *fi; + OSMO_ASSERT(conn); + + if (conn->conn_fsm) { + LOGP(DMM, LOGL_ERROR, + "%s: Error: connection already in use\n", id); + return -EINVAL; + } + + fi = osmo_fsm_inst_alloc(&subscr_conn_fsm, conn, conn, LOGL_DEBUG, id); + + if (!fi) { + LOGP(DMM, LOGL_ERROR, + "%s: Failed to allocate subscr conn master FSM\n", id); + return -ENOMEM; + } + conn->conn_fsm = fi; + return 0; +} + +bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn) +{ + if (!conn) + return false; + if (!conn->subscr) + return false; + if (!conn->conn_fsm) + return false; + if (conn->conn_fsm->state != SUBSCR_CONN_S_ACCEPTED) + return false; + return true; +} + +void msc_subscr_conn_init(void) +{ + osmo_fsm_register(&subscr_conn_fsm); +} diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index e503291..99d7fb9 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -1053,7 +1053,6 @@ return CMD_WARNING; } - log_set_filter_vlr_subscr(tgt, vlr_subscr); log_set_filter_bsc_subscr(tgt, bsc_subscr); return CMD_SUCCESS; } diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am new file mode 100644 index 0000000..17ad411 --- /dev/null +++ b/src/libvlr/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) + +noinst_HEADERS = \ + vlr_access_req_fsm.h \ + vlr_auth_fsm.h \ + vlr_core.h \ + vlr_lu_fsm.h \ + $(NULL) + +noinst_LIBRARIES = libvlr.a + +libvlr_a_SOURCES = \ + vlr.c \ + vlr_access_req_fsm.c \ + vlr_auth_fsm.c \ + vlr_lu_fsm.c \ + $(NULL) diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c new file mode 100644 index 0000000..0e0d31c --- /dev/null +++ b/src/libvlr/vlr.c @@ -0,0 +1,1108 @@ +/* Osmocom Visitor Location Register (VLR) code base */ + +/* (C) 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define SGSN_SUBSCR_MAX_RETRIES 3 +#define SGSN_SUBSCR_RETRY_INTERVAL 10 + +/*********************************************************************** + * Convenience functions + ***********************************************************************/ + +const struct value_string vlr_ciph_names[] = { + OSMO_VALUE_STRING(VLR_CIPH_NONE), + OSMO_VALUE_STRING(VLR_CIPH_A5_1), + OSMO_VALUE_STRING(VLR_CIPH_A5_2), + OSMO_VALUE_STRING(VLR_CIPH_A5_3), + { 0, NULL } +}; + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer) +{ + uint32_t tidx = 0xffffffff; + + switch (timer) { + case 3270: + tidx = VLR_T_3270; + break; + case 3260: + tidx = VLR_T_3260; + break; + case 3250: + tidx = VLR_T_3250; + break; + } + + OSMO_ASSERT(tidx < sizeof(vlr->cfg.timer)); + return vlr->cfg.timer[tidx]; +} + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!imsi || !*imsi) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_imsi(vsub, imsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (tmsi == GSM_RESERVED_TMSI) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_tmsi(vsub, tmsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!msisdn || !*msisdn) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_msisdn(vsub, msisdn)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +/* Transmit GSUP message to HLR */ +static int vlr_tx_gsup_message(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + struct msgb *msg = gsup_client_msgb_alloc(); + + osmo_gsup_encode(msg, gsup_msg); + + if (!vlr->gsup_client) { + LOGP(DVLR, LOGL_NOTICE, "GSUP link is down, cannot " + "send GSUP: %s\n", msgb_hexdump(msg)); + msgb_free(msg); + return -ENOTSUP; + } + + LOGP(DVLR, LOGL_DEBUG, "GSUP tx: %s\n", + osmo_hexdump_nospc(msg->data, msg->len)); + + return gsup_client_send(vlr->gsup_client, msg); +} + +/* Transmit GSUP message for subscriber to HLR, using IMSI from subscriber */ +static int vlr_subscr_tx_gsup_message(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct vlr_instance *vlr = vsub->vlr; + + if (strlen(gsup_msg->imsi) == 0) + osmo_strlcpy(gsup_msg->imsi, vsub->imsi, sizeof(gsup_msg->imsi)); + + return vlr_tx_gsup_message(vlr, gsup_msg); +} + +/* Transmit GSUP error in response to original message */ +static int vlr_tx_gsup_error_reply(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_orig, + enum gsm48_gmm_cause cause) +{ + struct osmo_gsup_message gsup_reply = {0}; + + osmo_strlcpy(gsup_reply.imsi, gsup_orig->imsi, sizeof(gsup_reply.imsi)); + gsup_reply.cause = cause; + gsup_reply.message_type = + OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type); + + return vlr_tx_gsup_message(vlr, &gsup_reply); +} + +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + OSMO_ASSERT(sub->use_count < INT_MAX); + sub->use_count++; + LOGPSRC(DREF, LOGL_DEBUG, file, line, + "VLR subscr %s usage increases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + return sub; +} + +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + sub->use_count--; + LOGPSRC(DREF, sub->use_count >= 0? LOGL_DEBUG : LOGL_ERROR, + file, line, + "VLR subscr %s usage decreases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + if (sub->use_count <= 0) + vlr_subscr_free(sub); + return NULL; +} + +/* Allocate a new subscriber and insert it into list */ +static struct vlr_subscr *_vlr_subscr_alloc(struct vlr_instance *vlr) +{ + struct vlr_subscr *vsub; + int i; + + vsub = talloc_zero(vlr, struct vlr_subscr); + vsub->vlr = vlr; + vsub->tmsi = GSM_RESERVED_TMSI; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + + INIT_LLIST_HEAD(&vsub->cs.requests); + INIT_LLIST_HEAD(&vsub->ps.pdp_list); + + llist_add_tail(&vsub->list, &vlr->subscribers); + return vsub; +} + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr) +{ + return vlr_subscr_get(_vlr_subscr_alloc(vlr)); +} + +/* Send a GSUP Purge MS request. + * TODO: this should be sent to the *previous* VLR when this VLR is "taking" + * this subscriber, not to the HLR? */ +int vlr_subscr_purge(struct vlr_subscr *vsub) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_PURGE_MS_REQUEST; + + /* provide HLR number in case we know it */ + gsup_msg.hlr_enc_len = vsub->hlr.len; + gsup_msg.hlr_enc = vsub->hlr.buf; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause) +{ + if (!vsub) + return; + + if (vsub->lu_fsm) { + if (vsub->lu_fsm->state == VLR_ULA_S_WAIT_HLR_UPD) + osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_HLR_LU_RES, + (void*)&cause); + else + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_ERROR, + 0); + } + + if (vsub->proc_arq_fsm) + osmo_fsm_inst_term(vsub->proc_arq_fsm, OSMO_FSM_TERM_ERROR, 0); +} + +/* Call vlr_subscr_cancel(), then completely drop the entry from the VLR */ +void vlr_subscr_free(struct vlr_subscr *vsub) +{ + llist_del(&vsub->list); + DEBUGP(DREF, "freeing VLR subscr %s\n", vlr_subscr_name(vsub)); + talloc_free(vsub); +} + +/* Generate a new TMSI and store in vsub->tmsi_new. + * Search all known subscribers to ensure that the TMSI is unique. */ +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub) +{ + struct vlr_instance *vlr = vsub->vlr; + uint32_t tmsi; + int tried; + + for (tried = 0; tried < 100; tried++) { + if (RAND_bytes((uint8_t *) &tmsi, sizeof(tmsi)) != 1) { + LOGP(DVLR, LOGL_ERROR, "RAND_bytes failed\n"); + return -1; + } + /* throw the dice again, if the TSMI doesn't fit */ + if (tmsi == GSM_RESERVED_TMSI) + continue; + + /* Section 2.4 of 23.003: MSC has two MSB 00/01/10, SGSN 11 */ + if (vlr->cfg.is_ps) { + /* SGSN */ + tmsi |= 0xC000000; + } else { + /* MSC */ + if ((tmsi & 0xC0000000) == 0xC0000000) + tmsi &= ~0xC0000000; + } + + /* If this TMSI is already in use, try another one. */ + if (vlr_subscr_find_by_tmsi(vlr, tmsi)) + continue; + + vsub->tmsi_new = tmsi; + return 0; + } + + LOGP(DVLR, LOGL_ERROR, "subscr %s: unable to generate valid TMSI" + " after %d tries\n", vlr_subscr_name(vsub), tried); + return -1; +} + +/* Find subscriber by IMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] imsi IMSI string. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_imsi(vlr, imsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vlr_subscr_set_imsi(vsub, imsi); + LOGP(DVLR, LOGL_INFO, "New subscr, IMSI: %s\n", vsub->imsi); + if (created) + *created = true; + return vsub; +} + +/* Find subscriber by TMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] tmsi TMSI. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_tmsi(vlr, tmsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vsub->tmsi = tmsi; + LOGP(DVLR, LOGL_INFO, "New subscr, TMSI: 0x%08x\n", vsub->tmsi); + if (created) + *created = true; + return vsub; +} + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + vsub->id = atoll(vsub->imsi); + DEBUGP(DVLR, "set IMSI on subscriber; IMSI=%s id=%llu\n", + vsub->imsi, vsub->id); +} + +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imei, imei, sizeof(vsub->imei)); + DEBUGP(DVLR, "set IMEI on subscriber; IMSI=%s IMEI=%s\n", + vsub->imsi, vsub->imei); +} + +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imeisv, imeisv, sizeof(vsub->imeisv)); + DEBUGP(DVLR, "set IMEISV on subscriber; IMSI=%s IMEISV=%s\n", + vsub->imsi, vsub->imeisv); +} + +/* Safely copy the given MSISDN string to vsub->msisdn */ +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->msisdn, msisdn, sizeof(vsub->msisdn)); + DEBUGP(DVLR, "set MSISDN on subscriber; IMSI=%s MSISDN=%s\n", + vsub->imsi, vsub->msisdn); +} + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + return vsub && imsi && vsub->imsi[0] && !strcmp(vsub->imsi, imsi); +} + +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi) +{ + return vsub && tmsi != GSM_RESERVED_TMSI + && (vsub->tmsi == tmsi || vsub->tmsi_new == tmsi); +} + +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + return vsub && msisdn && vsub->msisdn[0] + && !strcmp(vsub->msisdn, msisdn); +} + +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei) +{ + return vsub && imei && vsub->imei[0] + && !strcmp(vsub->imei, imei); +} + +/* Send updated subscriber information to HLR */ +int vlr_subscr_changed(struct vlr_subscr *vsub) +{ + /* FIXME */ + LOGP(DVLR, LOGL_ERROR, "Not implemented: %s\n", __func__); + return 0; +} + +/*********************************************************************** + * PDP context data + ***********************************************************************/ + +struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_alloc(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data* pdata; + + pdata = talloc_zero(vsub, struct sgsn_subscriber_pdp_data); + + llist_add_tail(&pdata->list, &vsub->ps.pdp_list); + + return pdata; +} + +static int vlr_subscr_pdp_data_clear(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data *pdp, *pdp2; + int count = 0; + + llist_for_each_entry_safe(pdp, pdp2, &vsub->ps.pdp_list, list) { + llist_del(&pdp->list); + talloc_free(pdp); + count += 1; + } + + return count; +} + +static struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_get_by_id(struct vlr_subscr *vsub, unsigned context_id) +{ + struct sgsn_subscriber_pdp_data *pdp; + + llist_for_each_entry(pdp, &vsub->ps.pdp_list, list) { + if (pdp->context_id == context_id) + return pdp; + } + + return NULL; +} + +/*********************************************************************** + * Actual Implementation + ***********************************************************************/ + +static int vlr_rx_gsup_unknown_imsi(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup_msg->message_type)) { + vlr_tx_gsup_error_reply(vlr, gsup_msg, + GMM_CAUSE_IMSI_UNKNOWN); + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP request " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } else if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP error " + "of type 0x%02x, cause '%s' (%d)\n", + gsup_msg->imsi, gsup_msg->message_type, + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + } else { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP response " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } + + return -GMM_CAUSE_IMSI_UNKNOWN; +} + +static int vlr_rx_gsup_purge_no_subscr(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGGSUPP(LOGL_NOTICE, gsup_msg, + "Purge MS has failed with cause '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + return -gsup_msg->cause; + } + LOGGSUPP(LOGL_INFO, gsup_msg, "Completing purge MS\n"); + return 0; +} + +/* VLR internal call to request UpdateLocation from HLR */ +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps) +{ + struct osmo_gsup_message gsup_msg = {0}; + int rc; + + gsup_msg.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; + rc = vlr_subscr_tx_gsup_message(vsub, &gsup_msg); + + return rc; +} + +/* VLR internal call to request tuples from HLR */ +int vlr_subscr_req_sai(struct vlr_subscr *vsub, + const uint8_t *auts, const uint8_t *auts_rand) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; + gsup_msg.auts = auts; + gsup_msg.rand = auts_rand; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +/* Tell HLR that authentication failure occurred */ +int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub) +{ + 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)); + return vlr_tx_gsup_message(vsub->vlr, &gsup_msg); +} + +/* Update the subscriber with GSUP-received auth tuples */ +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + unsigned int i; + unsigned int got_tuples; + + if (gsup->num_auth_vectors) { + memset(&vsub->auth_tuples, 0, sizeof(vsub->auth_tuples)); + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + } + + got_tuples = 0; + for (i = 0; i < gsup->num_auth_vectors; i++) { + size_t key_seq = i; + + if (key_seq >= ARRAY_SIZE(vsub->auth_tuples)) { + LOGVSUBP(LOGL_NOTICE, vsub, + "Skipping auth tuple wih invalid cksn %zu\n", + key_seq); + continue; + } + vsub->auth_tuples[i].vec = gsup->auth_vectors[i]; + vsub->auth_tuples[i].key_seq = key_seq; + got_tuples ++; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "Received %u auth tuples\n", got_tuples); + + if (!got_tuples) { + /* FIXME what now? */ + // vlr_subscr_cancel(vsub, GMM_CAUSE_GSM_AUTH_UNACCEPT); ? + } + + /* New tuples means last_tuple becomes invalid */ + vsub->last_tuple = NULL; +} + +/* Handle SendAuthInfo Result/Error from HLR */ +static int vlr_subscr_handle_sai_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + void *data = (void *) gsup; + + switch (gsup->message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_ACK, data); + break; + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_NACK, data); + break; + default: + return -1; + } + + return 0; +} + +static int decode_bcd_number_safe(char *output, int output_len, + const uint8_t *bcd_lv, int input_len, + int h_len) +{ + uint8_t len; + OSMO_ASSERT(output_len >= 1); + *output = '\0'; + if (input_len < 1) + return -EIO; + len = bcd_lv[0]; + if (input_len < len) + return -EIO; + return gsm48_decode_bcd_number(output, output_len, bcd_lv, h_len); +} + +static void vlr_subscr_gsup_insert_data(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup_msg) +{ + unsigned idx; + int rc; + + if (gsup_msg->msisdn_enc) { + decode_bcd_number_safe(vsub->msisdn, sizeof(vsub->msisdn), + gsup_msg->msisdn_enc, + gsup_msg->msisdn_enc_len, 0); + LOGP(DVLR, LOGL_DEBUG, "IMSI:%s has MSISDN:%s\n", + vsub->imsi, vsub->msisdn); + } + + if (gsup_msg->hlr_enc) { + if (gsup_msg->hlr_enc_len > sizeof(vsub->hlr.buf)) { + LOGP(DVLR, LOGL_ERROR, "HLR-Number too long (%zu)\n", + gsup_msg->hlr_enc_len); + vsub->hlr.len = 0; + } else { + memcpy(vsub->hlr.buf, gsup_msg->hlr_enc, + gsup_msg->hlr_enc_len); + vsub->hlr.len = gsup_msg->hlr_enc_len; + } + } + + if (gsup_msg->pdp_info_compl) { + rc = vlr_subscr_pdp_data_clear(vsub); + if (rc > 0) + LOGP(DVLR, LOGL_INFO, "Cleared existing PDP info\n"); + } + + for (idx = 0; idx < gsup_msg->num_pdp_infos; idx++) { + const struct osmo_gsup_pdp_info *pdp_info = &gsup_msg->pdp_infos[idx]; + size_t ctx_id = pdp_info->context_id; + struct sgsn_subscriber_pdp_data *pdp_data; + + if (pdp_info->apn_enc_len >= sizeof(pdp_data->apn_str)-1) { + LOGVSUBP(LOGL_ERROR, vsub, + "APN too long, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, + pdp_info->apn_enc_len)); + continue; + } + + if (pdp_info->qos_enc_len > sizeof(pdp_data->qos_subscribed)) { + LOGVSUBP(LOGL_ERROR, vsub, + "QoS info too long (%zu)\n", + pdp_info->qos_enc_len); + continue; + } + + LOGVSUBP(LOGL_INFO, vsub, + "Will set PDP info, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, pdp_info->apn_enc_len)); + + /* Set PDP info [ctx_id] */ + pdp_data = vlr_subscr_pdp_data_get_by_id(vsub, ctx_id); + if (!pdp_data) { + pdp_data = vlr_subscr_pdp_data_alloc(vsub); + pdp_data->context_id = ctx_id; + } + + OSMO_ASSERT(pdp_data != NULL); + pdp_data->pdp_type = pdp_info->pdp_type; + osmo_apn_to_str(pdp_data->apn_str, + pdp_info->apn_enc, pdp_info->apn_enc_len); + memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); + pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + } +} + + +/* Handle InsertSubscrData Result from HLR */ +static int vlr_subscr_handle_isd_req(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_gsup_message gsup_reply = {0}; + + vlr_subscr_gsup_insert_data(vsub, gsup); + vsub->vlr->ops.subscr_update(vsub); + + gsup_reply.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; + return vlr_subscr_tx_gsup_message(vsub, &gsup_reply); +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Result " + "without LU in progress\n"); + return -ENODEV; + } + + /* contrary to MAP, we allow piggy-backing subscriber data onto the + * UPDATE LOCATION RESULT, and don't mandate the use of a separate + * nested INSERT SUBSCRIBER DATA transaction */ + vlr_subscr_gsup_insert_data(vsub, gsup); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, NULL); + + return 0; +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_err(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Error " + "without LU in progress\n"); + return -ENODEV; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "UpdateLocation failed; gmm_cause: %s\n", + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, + (void *)&gsup->cause); + + return 0; +} + +/* Handle LOCATION CANCEL request from HLR */ +static int vlr_subscr_handle_cancel_req(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct osmo_gsup_message gsup_reply = {0}; + int is_update_procedure = !gsup_msg->cancel_type || + gsup_msg->cancel_type == OSMO_GSUP_CANCEL_TYPE_UPDATE; + + LOGVSUBP(LOGL_INFO, vsub, "Cancelling MS subscriber (%s)\n", + is_update_procedure ? + "update procedure" : "subscription withdraw"); + + gsup_reply.message_type = OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT; + vlr_subscr_tx_gsup_message(vsub, &gsup_reply); + + vlr_subscr_cancel(vsub, gsup_msg->cause); + + return 0; +} + +/* Incoming handler for GSUP from HLR. + * Keep this function non-static for direct invocation by unit tests. */ +int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +{ + struct vlr_instance *vlr = (struct vlr_instance *) gsupc->data; + struct vlr_subscr *vsub; + struct osmo_gsup_message gsup; + int rc; + + DEBUGP(DVLR, "GSUP rx %u: %s\n", msgb_l2len(msg), + osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup); + if (rc < 0) { + LOGP(DVLR, LOGL_ERROR, + "decoding GSUP message fails with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return rc; + } + + if (!gsup.imsi[0]) { + LOGP(DVLR, LOGL_ERROR, "Missing IMSI in GSUP message\n"); + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup.message_type)) + vlr_tx_gsup_error_reply(vlr, &gsup, + GMM_CAUSE_INV_MAND_INFO); + return -GMM_CAUSE_INV_MAND_INFO; + } + + vsub = vlr_subscr_find_by_imsi(vlr, gsup.imsi); + if (!vsub) { + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + return vlr_rx_gsup_purge_no_subscr(vlr, &gsup); + default: + return vlr_rx_gsup_unknown_imsi(vlr, &gsup); + } + } + + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + rc = vlr_subscr_handle_sai_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: + rc = vlr_subscr_handle_isd_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST: + rc = vlr_subscr_handle_cancel_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: + rc = vlr_subscr_handle_lu_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: + rc = vlr_subscr_handle_lu_err(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_DELETE_DATA_REQUEST: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not yet implemented\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + default: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not valid at VLR/SGSN side\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + } + + vlr_subscr_put(vsub); + return rc; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_id_resp(struct vlr_subscr *vsub, + const uint8_t *mi, size_t mi_len) +{ + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type = mi[0] & GSM_MI_TYPE_MASK; + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); + + /* update the vlr_subscr with the given identity */ + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else + vlr_subscr_set_imsi(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEI: + vlr_subscr_set_imei(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEISV: + vlr_subscr_set_imeisv(vsub, mi_string); + break; + } + + if (vsub->auth_fsm) { + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + osmo_fsm_inst_dispatch(vsub->auth_fsm, + VLR_AUTH_E_MS_ID_IMSI, mi_string); + break; + } + } + + if (vsub->lu_fsm) { + uint32_t event = 0; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + event = VLR_ULA_E_ID_IMSI; + break; + case GSM_MI_TYPE_IMEI: + event = VLR_ULA_E_ID_IMEI; + break; + case GSM_MI_TYPE_IMEISV: + event = VLR_ULA_E_ID_IMEISV; + break; + default: + OSMO_ASSERT(0); + break; + } + osmo_fsm_inst_dispatch(vsub->lu_fsm, event, mi_string); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, "gratuitous ID RESPONSE?!?\n"); + } + + return 0; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_tmsi_reall_compl(struct vlr_subscr *vsub) +{ + if (vsub->lu_fsm) { + return osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_NEW_TMSI_ACK, NULL); + } else if (vsub->proc_arq_fsm) { + return osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, + PR_ARQ_E_TMSI_ACK, NULL); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, + "gratuitous TMSI REALLOC COMPL"); + return -EINVAL; + } +} + +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); + } + return 0; +} + +/* Tear down any running FSMs due to MSC connection timeout. + * Visit all vsub->*_fsm pointers and give them a queue to send a final reject + * message before the entire connection is torn down. + * \param[in] vsub subscriber to tear down + */ +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub) +{ + if (!vsub) + return; + + vlr_loc_update_conn_timeout(vsub->lu_fsm); + vlr_parq_conn_timeout(vsub->proc_arq_fsm); +} + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops) +{ + struct vlr_instance *vlr = talloc_zero(ctx, struct vlr_instance); + OSMO_ASSERT(vlr); + OSMO_ASSERT(ops->tx_auth_req); + OSMO_ASSERT(ops->tx_auth_rej); + OSMO_ASSERT(ops->tx_id_req); + OSMO_ASSERT(ops->tx_lu_acc); + OSMO_ASSERT(ops->tx_lu_rej); + OSMO_ASSERT(ops->tx_cm_serv_acc); + OSMO_ASSERT(ops->tx_cm_serv_rej); + OSMO_ASSERT(ops->set_ciph_mode); + OSMO_ASSERT(ops->subscr_update); + OSMO_ASSERT(ops->subscr_assoc); + + INIT_LLIST_HEAD(&vlr->subscribers); + INIT_LLIST_HEAD(&vlr->operations); + memcpy(&vlr->ops, ops, sizeof(vlr->ops)); + + /* osmo_auth_fsm.c */ + osmo_fsm_register(&vlr_auth_fsm); + /* osmo_lu_fsm.c */ + vlr_lu_fsm_init(); + /* vlr_access_request_fsm.c */ + vlr_parq_fsm_init(); + + return vlr; +} + +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port) +{ + OSMO_ASSERT(vlr); + + vlr->gsup_client = gsup_client_create(gsup_unit_name, + gsup_server_addr_str, + gsup_server_port, + &vlr_gsupc_read_cb, NULL); + if (!vlr->gsup_client) + return -ENOMEM; + vlr->gsup_client->data = vlr; + + return 0; +} + +/* MSC->VLR: Subscribre has disconnected */ +int vlr_subscr_disconnected(struct vlr_subscr *vsub) +{ + /* This corresponds to a MAP-ABORT from MSC->VLR on a classic B + * interface */ + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_REQUEST, NULL); + osmo_fsm_inst_term(vsub->auth_fsm, OSMO_FSM_TERM_REQUEST, NULL); + vsub->msc_conn_ref = NULL; + + return 0; +} + +/* MSC->VLR: Receive Authentication Failure from Subscriber */ +int vlr_subscr_rx_auth_fail(struct vlr_subscr *vsub, const uint8_t *auts) +{ + struct vlr_auth_resp_par par = {0}; + par.auts = auts; + + osmo_fsm_inst_dispatch(vsub->auth_fsm, VLR_AUTH_E_MS_AUTH_FAIL, &par); + return 0; +} + +/* MSC->VLR: Receive Authentication Response from MS + * \returns 1 in case of success, 0 in case of delay, -1 on auth error */ +int vlr_subscr_rx_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, uint8_t res_len) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + struct vlr_auth_resp_par par; + + par.is_r99 = is_r99; + par.is_utran = is_utran; + par.res = res; + par.res_len = res_len; + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_MS_AUTH_RESP, (void *) &par); + + return 0; +} + +/* MSC->VLR: Receive result of Ciphering Mode Command from MS */ +void vlr_subscr_rx_ciph_res(struct vlr_subscr *vsub, struct vlr_ciph_result *res) +{ + if (vsub->lu_fsm && vsub->lu_fsm->state == VLR_ULA_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_CIPH_RES, res); + if (vsub->proc_arq_fsm + && vsub->proc_arq_fsm->state == PR_ARQ_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, PR_ARQ_E_CIPH_RES, + res); +} + +/* Internal evaluation of requested ciphering mode. + * Send set_ciph_mode() to MSC depending on the ciph_mode argument. + * \param[in] vlr VLR instance. + * \param[in] fi Calling FSM instance, for logging. + * \param[in] msc_conn_ref MSC conn to send to. + * \param[in] ciph_mode Ciphering config, to decide whether to do ciphering. + * \returns 0 if no ciphering is needed or message was sent successfully, + * or a negative value if ciph_mode is invalid or sending failed. + */ +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv) +{ + switch (ciph_mode) { + case VLR_CIPH_NONE: + return 0; + + case VLR_CIPH_A5_1: + case VLR_CIPH_A5_3: + return vlr->ops.set_ciph_mode(msc_conn_ref, + ciph_mode, + 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; + } +} + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr) +{ + struct vlr_subscr **fsub = (void*)&target->filter_data[LOG_FLT_VLR_SUBSCR]; + + /* free the old data */ + if (*fsub) { + vlr_subscr_put(*fsub); + *fsub = NULL; + } + + if (vlr_subscr) { + target->filter_map |= (1 << LOG_FLT_VLR_SUBSCR); + *fsub = vlr_subscr_get(vlr_subscr); + } else + target->filter_map &= ~(1 << LOG_FLT_VLR_SUBSCR); +} diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c new file mode 100644 index 0000000..a64f193 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.c @@ -0,0 +1,778 @@ +/* Osmocom Visitor Location Register (VLR): Access Request FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define S(x) (1 << (x)) + +/*********************************************************************** + * Process_Access_Request_VLR, TS 29.002 Chapter 25.4.2 + ***********************************************************************/ + +const struct value_string vlr_proc_arq_result_names[] = { + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_NONE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_SYSTEM_FAILURE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNIDENT_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ROAMING_NOTALLOWED), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_EQUIP), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNKNOWN_ERROR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_TIMEOUT), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_PASSED), + { 0, NULL } +}; + +static const struct value_string proc_arq_vlr_event_names[] = { + OSMO_VALUE_STRING(PR_ARQ_E_START), + OSMO_VALUE_STRING(PR_ARQ_E_ID_IMSI), + OSMO_VALUE_STRING(PR_ARQ_E_AUTH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_CIPH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_UPD_LOC_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TRACE_RES), + OSMO_VALUE_STRING(PR_ARQ_E_IMEI_RES), + OSMO_VALUE_STRING(PR_ARQ_E_PRES_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TMSI_ACK), + { 0, NULL } +}; + +struct proc_arq_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *ul_child_fsm; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + + enum vlr_parq_type type; + enum vlr_proc_arq_result result; + bool by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool implicitly_accepted_parq_by_ciphering_cmd; +}; + +static void assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + + vsub->msc_conn_ref = par->msc_conn_ref; + par->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(par->msc_conn_ref, par->vsub); +} + +#define proc_arq_fsm_done(fi, res) _proc_arq_fsm_done(fi, res, __FILE__, __LINE__) +static void _proc_arq_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_proc_arq_result res, + const char *file, int line) +{ + struct proc_arq_priv *par = fi->priv; + LOGPFSMSRC(fi, file, line, "proc_arq_fsm_done(%s)\n", + vlr_proc_arq_result_name(res)); + par->result = res; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_DONE, 0, 0); +} + +static void proc_arq_vlr_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct proc_arq_priv *par = fi->priv; + bool success; + int rc; + LOGPFSM(fi, "Process Access Request result: %s\n", + vlr_proc_arq_result_name(par->result)); + + success = (par->result == VLR_PR_ARQ_RES_PASSED); + + /* It would be logical to first dispatch the success event to the + * parent FSM, but that could start actions that send messages to the + * MS. Rather send the CM Service Accept message first and then signal + * success. Since messages are handled synchronously, the success event + * will be processed before we handle new incoming data from the MS. */ + + if (par->type == VLR_PR_ARQ_T_CM_SERV_REQ) { + if (success + && !par->implicitly_accepted_parq_by_ciphering_cmd) { + rc = par->vlr->ops.tx_cm_serv_acc(par->msc_conn_ref); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Accept\n"); + success = false; + } + } + if (!success) { + rc = par->vlr->ops.tx_cm_serv_rej(par->msc_conn_ref, + par->result); + if (rc) + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Reject\n"); + } + } + + /* For VLR_PR_ARQ_T_PAGING_RESP, there is nothing to send. The conn_fsm + * will start handling pending paging transactions. */ + + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + success ? par->parent_event_success + : par->parent_event_failure, + par->parent_event_data); +} + +void proc_arq_vlr_cleanup(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause) +{ + struct proc_arq_priv *par = fi->priv; + if (par->vsub && par->vsub->proc_arq_fsm == fi) + par->vsub->proc_arq_fsm = NULL; +} + +static void _proc_arq_vlr_post_imei(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + /* TODO: Identity := IMSI */ + if (0 /* TODO: TMSI reallocation at access: vlr->cfg.alloc_tmsi_arq */) { + vlr_subscr_alloc_tmsi(vsub); + /* TODO: forward TMSI to MS, wait for TMSI + * REALLOC COMPLETE */ + /* TODO: Freeze old TMSI */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TMSI_ACK, 0, 0); + return; + } + + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static void _proc_arq_vlr_post_trace(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + /* Node 3 */ + if (0 /* IMEI check required */) { + /* Chck_IMEI_VLR */ + vlr->ops.tx_id_req(par->msc_conn_ref, GSM_MI_TYPE_IMEI); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CHECK_IMEI, + vlr_timer(vlr, 3270), 3270); + } else + _proc_arq_vlr_post_imei(fi); +} + +/* After Subscriber_Present_VLR */ +static void _proc_arq_vlr_post_pres(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + if (0 /* TODO: tracing required */) { + /* TODO: Trace_Subscriber_Activity_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TRACE_SUB, 0, 0); + } + _proc_arq_vlr_post_trace(fi); +} + +/* After Update_Location_Child_VLR */ +static void _proc_arq_vlr_node2_post_vlr(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!vsub->sub_dataconf_by_hlr_ind) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + if (0 /* roaming not allowed in LA */) { + /* Set User Error: Roaming not allowed in this LA */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ROAMING_NOTALLOWED); + return; + } + vsub->imsi_detached_flag = false; + if (vsub->ms_not_reachable_flag) { + /* Start Subscriber_Present_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_SUB_PRES, 0, 0); + par->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + PR_ARQ_E_PRES_RES); + return; + } + _proc_arq_vlr_post_pres(fi); +} + +static void _proc_arq_vlr_node2_post_ciph(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + vsub->conf_by_radio_contact_ind = true; + if (vsub->loc_conf_in_hlr_ind == false) { + /* start Update_Location_Child_VLR. WE use + * Update_HLR_VLR instead, the differences appear + * insignificant for now. */ + par->ul_child_fsm = upd_hlr_vlr_proc_start(fi, vsub, + PR_ARQ_E_UPD_LOC_RES); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_UPD_LOC_CHILD, 0, 0); + return; + } + _proc_arq_vlr_node2_post_vlr(fi); +} + +static bool is_ciph_required(struct proc_arq_priv *par) +{ + return par->ciphering_required != VLR_CIPH_NONE; +} + +static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!is_ciph_required(par)) { + _proc_arq_vlr_node2_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, par->msc_conn_ref, + par->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_SYSTEM_FAILURE); + return; + } + + par->implicitly_accepted_parq_by_ciphering_cmd = true; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CIPH, 0, 0); +} + +static bool is_auth_required(struct proc_arq_priv *par) +{ + /* 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); +} + +/* after the IMSI is known */ +static void proc_arq_vlr_fn_post_imsi(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + /* TODO: Identity IMEI -> System Failure */ + if (is_auth_required(par)) { + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_AUTH, + 0, 0); + vsub->auth_fsm = auth_fsm_start(vsub, fi->log_level, fi, + PR_ARQ_E_AUTH_RES, + par->is_r99, + par->is_utran); + } else { + _proc_arq_vlr_node2(fi); + } +} + +static void proc_arq_vlr_fn_init(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub = NULL; + + OSMO_ASSERT(event == PR_ARQ_E_START); + + /* Obtain_Identity_VLR */ + if (!par->by_tmsi) { + /* IMSI was included */ + vsub = vlr_subscr_find_by_imsi(par->vlr, par->imsi); + } else { + /* TMSI was included */ + vsub = vlr_subscr_find_by_tmsi(par->vlr, par->tmsi); + } + if (vsub) { + if (vsub->proc_arq_fsm && fi != vsub->proc_arq_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "Another proc_arq_fsm is already" + " associated with subscr %s," + " terminating the other FSM.\n", + vlr_subscr_name(vsub)); + proc_arq_fsm_done(vsub->proc_arq_fsm, + VLR_PR_ARQ_RES_SYSTEM_FAILURE); + } + vsub->proc_arq_fsm = fi; + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); + return; + } + /* No VSUB could be resolved. What now? */ + + if (!par->by_tmsi) { + /* We couldn't find a subscriber even by IMSI, + * Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } else { + /* TMSI was included, are we permitted to use it? */ + if (vlr->cfg.parq_retrieve_imsi) { + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_OBTAIN_IMSI, + vlr_timer(vlr, 3270), 3270); + return; + } else { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + } +} + +/* ID REQ(IMSI) has returned */ +static void proc_arq_vlr_fn_w_obt_imsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub; + + OSMO_ASSERT(event == PR_ARQ_E_ID_IMSI); + + vsub = vlr_subscr_find_by_imsi(vlr, par->imsi); + if (!vsub) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); +} + +/* Authenticate_VLR has completed */ +static void proc_arq_vlr_fn_w_auth(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + enum vlr_auth_fsm_result res; + enum vlr_proc_arq_result ret; + + OSMO_ASSERT(event == PR_ARQ_E_AUTH_RES); + + res = data ? *(enum vlr_auth_fsm_result*)data : -1; + LOGPFSM(fi, "got %s\n", vlr_auth_fsm_result_name(res)); + + switch (res) { + case VLR_AUTH_RES_PASSED: + /* Node 2 */ + _proc_arq_vlr_node2(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* Error */ + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* Set User Error: Unidentified Subscriber */ + ret = VLR_PR_ARQ_RES_UNIDENT_SUBSCR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* Set User Error: Illegal Subscriber */ + ret = VLR_PR_ARQ_RES_ILLEGAL_SUBSCR; + break; + case VLR_AUTH_RES_PROC_ERR: + /* Set User Error: System failure */ + ret = VLR_PR_ARQ_RES_SYSTEM_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "Unexpected vlr_auth_fsm_result value: %d (data=%p)\n", res, data); + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + } + + /* send process_access_req response to caller, enter error state */ + proc_arq_fsm_done(fi, ret); +} + +static void proc_arq_vlr_fn_w_ciph(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == PR_ARQ_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + } + + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + _proc_arq_vlr_node2_post_ciph(fi); +} + +/* Update_Location_Child_VLR has completed */ +static void proc_arq_vlr_fn_w_upd_loc(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_UPD_LOC_RES); + + _proc_arq_vlr_node2_post_vlr(fi); +} + +/* Subscriber_Present_VLR has completed */ +static void proc_arq_vlr_fn_w_pres(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_PRES_RES); + + _proc_arq_vlr_post_pres(fi); +} + +static void proc_arq_vlr_fn_w_trace(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TRACE_RES); + + _proc_arq_vlr_post_trace(fi); +} + +/* we have received the ID RESPONSE (IMEI) */ +static void proc_arq_vlr_fn_w_imei(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_IMEI_RES); + + _proc_arq_vlr_post_imei(fi); +} + +/* MSC tells us that MS has acknowleded TMSI re-allocation */ +static void proc_arq_vlr_fn_w_tmsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TMSI_ACK); + + /* FIXME: check confirmation? unfreeze? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static const struct osmo_fsm_state proc_arq_vlr_states[] = { + [PR_ARQ_S_INIT] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_INIT), + .in_event_mask = S(PR_ARQ_E_START), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_OBTAIN_IMSI) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_init, + }, + [PR_ARQ_S_WAIT_OBTAIN_IMSI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_OBTAIN_IMSI), + .in_event_mask = S(PR_ARQ_E_ID_IMSI), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_obt_imsi, + }, + [PR_ARQ_S_WAIT_AUTH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_AUTH), + .in_event_mask = S(PR_ARQ_E_AUTH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CIPH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_auth, + }, + [PR_ARQ_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CIPH), + .in_event_mask = S(PR_ARQ_E_CIPH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_ciph, + }, + [PR_ARQ_S_WAIT_UPD_LOC_CHILD] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_UPD_LOC_CHILD), + .in_event_mask = S(PR_ARQ_E_UPD_LOC_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_upd_loc, + }, + [PR_ARQ_S_WAIT_SUB_PRES] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_SUB_PRES), + .in_event_mask = S(PR_ARQ_E_PRES_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_pres, + }, + [PR_ARQ_S_WAIT_TRACE_SUB] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TRACE_SUB), + .in_event_mask = S(PR_ARQ_E_TRACE_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_trace, + }, + [PR_ARQ_S_WAIT_CHECK_IMEI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CHECK_IMEI), + .in_event_mask = S(PR_ARQ_E_IMEI_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_imei, + }, + [PR_ARQ_S_WAIT_TMSI_ACK] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TMSI_ACK), + .in_event_mask = S(PR_ARQ_E_TMSI_ACK), + .out_state_mask = S(PR_ARQ_S_DONE), + .action = proc_arq_vlr_fn_w_tmsi, + }, + [PR_ARQ_S_DONE] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_DONE), + .onenter = proc_arq_vlr_dispatch_result, + }, +}; + +static struct osmo_fsm proc_arq_vlr_fsm = { + .name = "Process_Access_Request_VLR", + .states = proc_arq_vlr_states, + .num_states = ARRAY_SIZE(proc_arq_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = proc_arq_vlr_event_names, + .cleanup = proc_arq_vlr_cleanup, +}; + +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct proc_arq_priv *par; + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type; + + fi = osmo_fsm_inst_alloc_child(&proc_arq_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return; + + par = talloc_zero(fi, struct proc_arq_priv); + fi->priv = par; + par->vlr = vlr; + par->msc_conn_ref = msc_conn_ref; + par->type = type; + par->lai = *lai; + par->parent_event_success = parent_event_success; + par->parent_event_failure = parent_event_failure; + par->parent_event_data = parent_event_data; + par->authentication_required = authentication_required; + par->ciphering_required = ciphering_required; + par->is_r99 = is_r99; + par->is_utran = is_utran; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi_lv+1, mi_lv[0]); + mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); + par->imsi[sizeof(par->imsi)-1] = '\0'; + par->by_tmsi = false; + break; + case GSM_MI_TYPE_TMSI: + par->by_tmsi = true; + par->tmsi = osmo_load32be(mi_lv+2); + break; + case GSM_MI_TYPE_IMEI: + /* TODO: IMEI (emergency call) */ + default: + /* FIXME: directly send reject? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + + osmo_fsm_inst_dispatch(fi, PR_ARQ_E_START, NULL); +} + +/* Gracefully terminate an FSM created by vlr_proc_acc_req() in case of + * external timeout (i.e. from MSC). */ +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == PR_ARQ_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_TIMEOUT); +} + + +#if 0 +/*********************************************************************** + * Update_Location_Child_VLR, TS 29.002 Chapter 25.4.4 + ***********************************************************************/ + +enum upd_loc_child_vlr_state { + ULC_S_IDLE, + ULC_S_WAIT_HLR_RESP, + ULC_S_DONE, +}; + +enum upd_loc_child_vlr_event { + ULC_E_START, +}; + +static const struct value_string upd_loc_child_vlr_event_names[] = { + { ULC_E_START, "START" }, + { 0, NULL } +}; + +static void upd_loc_child_f_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + OSMO_ASSERT(event == ULC_E_START); + + /* send update location */ +} + +static void upd_loc_child_f_w_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ +} + +static const struct osmo_fsm_state upd_loc_child_vlr_states[] = { + [ULC_S_IDLE] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_WAIT_HLR_RESP) | + S(ULC_S_DONE), + .name = "IDLE", + .action = upd_loc_child_f_idle, + }, + [ULC_S_WAIT_HLR_RESP] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_DONE), + .name = "WAIT-HLR-RESP", + .action = upd_loc_child_f_w_hlr, + }, + [ULC_S_DONE] = { + .name = "DONE", + }, +}; + +static struct osmo_fsm upd_loc_child_vlr_fsm = { + .name = "Update_Location_Child_VLR", + .states = upd_loc_child_vlr_states, + .num_states = ARRAY_SIZE(upd_loc_child_vlr_states), + .log_subsys = DVLR, + .event_names = upd_loc_child_vlr_event_names, +}; +#endif + +void vlr_parq_fsm_init(void) +{ + //osmo_fsm_register(&upd_loc_child_vlr_fsm); + osmo_fsm_register(&proc_arq_vlr_fsm); +} diff --git a/src/libvlr/vlr_access_req_fsm.h b/src/libvlr/vlr_access_req_fsm.h new file mode 100644 index 0000000..8386da6 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.h @@ -0,0 +1,17 @@ +#pragma once + +enum proc_arq_vlr_state { + PR_ARQ_S_INIT, + /* Waiting for Obtain_Identity_VLR (IMSI) result */ + PR_ARQ_S_WAIT_OBTAIN_IMSI, + /* Waiting for Authenticate_VLR result */ + PR_ARQ_S_WAIT_AUTH, + PR_ARQ_S_WAIT_CIPH, + PR_ARQ_S_WAIT_UPD_LOC_CHILD, + PR_ARQ_S_WAIT_SUB_PRES, + PR_ARQ_S_WAIT_TRACE_SUB, + PR_ARQ_S_WAIT_CHECK_IMEI, + PR_ARQ_S_WAIT_TMSI_ACK, + PR_ARQ_S_WAIT_CECK_CONF, + PR_ARQ_S_DONE, +}; diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c new file mode 100644 index 0000000..0eb86e7 --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.c @@ -0,0 +1,605 @@ +/* Osmocom Visitor Location Register (VLR) Autentication FSM */ + +/* (C) 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 +#include +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" + +#define S(x) (1 << (x)) + +static const struct value_string fsm_auth_event_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_E_START), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_NACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ABORT), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_RESP), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_FAIL), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_ID_IMSI), + { 0, NULL } +}; + +const struct value_string vlr_auth_fsm_result_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_RES_ABORTED), + OSMO_VALUE_STRING(VLR_AUTH_RES_UNKNOWN_SUBSCR), + OSMO_VALUE_STRING(VLR_AUTH_RES_PROC_ERR), + OSMO_VALUE_STRING(VLR_AUTH_RES_AUTH_FAILED), + OSMO_VALUE_STRING(VLR_AUTH_RES_PASSED), + {0, NULL} +}; + +/* private state of the auth_fsm_instance */ +struct auth_fsm_priv { + struct vlr_subscr *vsub; + bool by_imsi; + bool is_r99; + bool is_utran; + bool auth_requested; + + int auth_tuple_max_use_count; /* see vlr->cfg instead */ +}; + +/*********************************************************************** + * Utility functions + ***********************************************************************/ + +/* Always use either vlr_subscr_get_auth_tuple() or vlr_subscr_has_auth_tuple() + * instead, to ensure proper use count. + * Return an auth tuple with the lowest use_count among the auth tuples. If + * max_use_count >= 0, return NULL if all available auth tuples have a use + * count > max_use_count. If max_use_count is negative, return a currently + * least used auth tuple without enforcing a maximum use count. If there are + * no auth tuples, return NULL. + */ +static struct gsm_auth_tuple * +_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + unsigned int count; + unsigned int idx; + struct gsm_auth_tuple *at = NULL; + unsigned int key_seq = GSM_KEY_SEQ_INVAL; + + if (!vsub) + return NULL; + + if (vsub->last_tuple) + key_seq = vsub->last_tuple->key_seq; + + if (key_seq == GSM_KEY_SEQ_INVAL) + /* Start with 0 after increment modulo array size */ + idx = ARRAY_SIZE(vsub->auth_tuples) - 1; + else + idx = key_seq; + + for (count = ARRAY_SIZE(vsub->auth_tuples); count > 0; count--) { + idx = (idx + 1) % ARRAY_SIZE(vsub->auth_tuples); + + if (vsub->auth_tuples[idx].key_seq == GSM_KEY_SEQ_INVAL) + continue; + + if (!at || vsub->auth_tuples[idx].use_count < at->use_count) + at = &vsub->auth_tuples[idx]; + } + + if (!at || (max_use_count >= 0 && at->use_count > max_use_count)) + return NULL; + + return at; +} + +/* Return an auth tuple and increment its use count. */ +static struct gsm_auth_tuple * +vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + struct gsm_auth_tuple *at = _vlr_subscr_next_auth_tuple(vsub, + max_use_count); + if (!at) + return NULL; + at->use_count++; + return at; +} + +/* Return whether an auth tuple with the given max_use_count is available. */ +static bool vlr_subscr_has_auth_tuple(struct vlr_subscr *vsub, + int max_use_count) +{ + return _vlr_subscr_next_auth_tuple(vsub, max_use_count) != NULL; +} + +static bool check_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, + uint8_t res_len) +{ + struct gsm_auth_tuple *at = vsub->last_tuple; + struct osmo_auth_vector *vec = &at->vec; + bool check_umts; + OSMO_ASSERT(at); + + LOGVSUBP(LOGL_DEBUG, vsub, "received res: %s\n", + osmo_hexdump(res, res_len)); + + /* RES must be present and at least 32bit */ + if (!res || res_len < sizeof(vec->sres)) { + LOGVSUBP(LOGL_NOTICE, vsub, "AUTH RES missing or too short " + "(%u)\n", res_len); + goto out_false; + } + + check_umts = false; + if (is_r99 && (vec->auth_types & OSMO_AUTH_TYPE_UMTS)) { + check_umts = true; + /* We have a R99 capable UE and have a UMTS AKA capable USIM. + * However, the ME may still choose to only perform GSM AKA, as + * long as the bearer is GERAN */ + if (res_len != vec->res_len) { + if (is_utran) { + LOGVSUBP(LOGL_NOTICE, vsub, + "AUTH via UTRAN but " + "res_len(%u) != vec->res_len(%u)\n", + res_len, vec->res_len); + goto out_false; + } + check_umts = false; + } + } + + if (check_umts) { + if (res_len != vec->res_len + || memcmp(res, vec->res, res_len)) { + LOGVSUBP(LOGL_INFO, vsub, "UMTS AUTH failure:" + " mismatching res (expected res=%s)\n", + osmo_hexdump(vec->res, vec->res_len)); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established UMTS security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_UMTS; + return true; + } else { + if (res_len != sizeof(vec->sres) + || memcmp(res, vec->sres, sizeof(vec->sres))) { + LOGVSUBP(LOGL_INFO, vsub, "GSM AUTH failure:" + " mismatching sres (expected sres=%s)\n", + osmo_hexdump(vec->sres, sizeof(vec->sres))); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established GSM security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_GSM; + return true; + } + +out_false: + vsub->sec_ctx = VLR_SEC_CTX_NONE; + return false; +} + +static void auth_fsm_onenter_failed(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + /* If authentication hasn't even started, e.g. the HLR sent no auth + * info, then we also don't need to tell the HLR about an auth failure. + */ + if (afp->auth_requested) + vlr_subscr_tx_auth_fail_rep(vsub); +} + +static bool is_umts_auth(struct auth_fsm_priv *afp, + uint32_t auth_types) +{ + if (!afp->is_r99) + return false; + if (!(auth_types & OSMO_AUTH_TYPE_UMTS)) + return false; + return true; +} + +/* Terminate the Auth FSM Instance and notify parent */ +static void auth_fsm_term(struct osmo_fsm_inst *fi, enum vlr_auth_fsm_result res) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + LOGPFSM(fi, "Authentication terminating with result %s\n", + vlr_auth_fsm_result_name(res)); + + /* Do one final state transition (mostly for logging purpose) */ + if (res == VLR_AUTH_RES_PASSED) + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTHENTICATED, 0, 0); + else + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTH_FAILED, 0, 0); + + /* return the result to the parent FSM */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, &res); + vsub->auth_fsm = NULL; +} + +/* back-end function transmitting authentication. Caller ensures we have valid + * tuple */ +static int _vlr_subscr_authenticate(struct osmo_fsm_inst *fi) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct gsm_auth_tuple *at; + + /* Caller ensures we have vectors available */ + at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_use_count); + if (!at) { + LOGPFSML(fi, LOGL_ERROR, "A previous check ensured that an" + " auth tuple was available, but now there is in fact" + " none.\n"); + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return -1; + } + + LOGPFSM(fi, "got auth tuple: use_count=%d key_seq=%d\n", + at->use_count, at->key_seq); + + OSMO_ASSERT(at); + + /* Transmit auth req to subscriber */ + afp->auth_requested = true; + vsub->last_tuple = at; + vsub->vlr->ops.tx_auth_req(vsub->msc_conn_ref, at, + is_umts_auth(afp, at->vec.auth_types)); + return 0; +} + +/*********************************************************************** + * FSM State Action functions + ***********************************************************************/ + +/* Initial State of TS 23.018 AUT_VLR */ +static void auth_fsm_needs_auth(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + OSMO_ASSERT(event == VLR_AUTH_E_START); + + /* Start off with the default max_use_count, possibly change that if we + * need to re-use an old tuple. */ + afp->auth_tuple_max_use_count = vsub->vlr->cfg.auth_tuple_max_use_count; + + /* Check if we have vectors available */ + if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_use_count)) { + /* Obtain_Authentication_Sets_VLR */ + vlr_subscr_req_sai(vsub, NULL, NULL); + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + GSM_29002_TIMER_M, 0); + } else { + /* go straight ahead with sending auth request */ + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); + } +} + +/* Waiting for Authentication Info from HLR */ +static void auth_fsm_wait_ai(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + if (event == VLR_AUTH_E_HLR_SAI_NACK) + LOGPFSM(fi, "GSUP: rx Auth Info Error cause: %d: %s\n", + gsup->cause, + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) + || (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) + || (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + if (vsub->vlr->cfg.auth_reuse_old_sets_on_error + && vlr_subscr_has_auth_tuple(vsub, -1)) { + /* To re-use an old tuple, disable the max_use_count + * constraint. */ + afp->auth_tuple_max_use_count = -1; + goto pass; + } + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return; + } + + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for Authentication Response from MS */ +static void auth_fsm_wait_auth_resp(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_instance *vlr = vsub->vlr; + struct vlr_auth_resp_par *par = data; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + } + } else { + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + if (par->auts) { + /* First failure, start re-sync attempt */ + vlr_subscr_req_sai(vsub, par->auts, + vsub->last_tuple->vec.rand); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + GSM_29002_TIMER_M, 0); + } else + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* Waiting for Authentication Info from HLR (resync case) */ +static void auth_fsm_wait_ai_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) || + (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) || + (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + } + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP_RESYNC, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for AUTH RESP from MS (re-sync case) */ +static void auth_fsm_wait_auth_resp_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_auth_resp_par *par = data; + struct vlr_instance *vlr = vsub->vlr; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + /* Result = Aborted */ + auth_fsm_term(fi, VLR_AUTH_RES_ABORTED); + } + } else { + /* Result = Pass */ + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + /* Second failure: Result = Fail */ + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* AUT_VLR waiting for Obtain_IMSI_VLR result */ +static void auth_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + const char *mi_string = data; + + switch (event) { + case VLR_AUTH_E_MS_ID_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else { + strncpy(vsub->imsi, mi_string, sizeof(vsub->imsi)); + vsub->imsi[sizeof(vsub->imsi)-1] = '\0'; + } + /* retry with identity=IMSI */ + afp->by_imsi = true; + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH, 0, 0); + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + break; + } +} + +static const struct osmo_fsm_state auth_fsm_states[] = { + [VLR_SUB_AS_NEEDS_AUTH] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH), + .in_event_mask = S(VLR_AUTH_E_START), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_needs_auth, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_AI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_wait_ai, + }, + [VLR_SUB_AS_WAIT_RESP] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_WAIT_ID_IMSI) | + S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED) | + S(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .action = auth_fsm_wait_auth_resp, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP_RESYNC), + .action = auth_fsm_wait_ai_resync, + }, + [VLR_SUB_AS_WAIT_RESP_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP_RESYNC), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED), + .action = auth_fsm_wait_auth_resp_resync, + }, + [VLR_SUB_AS_WAIT_ID_IMSI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_ID_IMSI), + .in_event_mask = S(VLR_AUTH_E_MS_ID_IMSI), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH), + .action = auth_fsm_wait_imsi, + }, + [VLR_SUB_AS_AUTHENTICATED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTHENTICATED), + .in_event_mask = 0, + .out_state_mask = 0, + }, + [VLR_SUB_AS_AUTH_FAILED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTH_FAILED), + .in_event_mask = 0, + .out_state_mask = 0, + .onenter = auth_fsm_onenter_failed, + }, +}; + +struct osmo_fsm vlr_auth_fsm = { + .name = "VLR_Authenticate", + .states = auth_fsm_states, + .num_states = ARRAY_SIZE(auth_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_auth_event_names, +}; + +/*********************************************************************** + * User API (for SGSN/MSC code) + ***********************************************************************/ + +/* MSC->VLR: Start Procedure Authenticate_VLR (TS 23.012 Ch. 4.1.2.2) */ +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct auth_fsm_priv *afp; + + fi = osmo_fsm_inst_alloc_child(&vlr_auth_fsm, parent, + parent_term_event); + + + afp = talloc_zero(fi, struct auth_fsm_priv); + if (!afp) { + osmo_fsm_inst_dispatch(parent, parent_term_event, 0); + return NULL; + } + + afp->vsub = vsub; + if (vsub->imsi[0]) + afp->by_imsi = true; + afp->is_r99 = is_r99; + afp->is_utran = is_utran; + fi->priv = afp; + vsub->auth_fsm = fi; + + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + + return fi; +} diff --git a/src/libvlr/vlr_auth_fsm.h b/src/libvlr/vlr_auth_fsm.h new file mode 100644 index 0000000..226435f --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.h @@ -0,0 +1,52 @@ +#pragma once + +#include + +/* Parameters to VLR_AUTH_E_MS_AUTH_RESP */ +struct vlr_auth_resp_par { + bool is_r99; + bool is_utran; + const uint8_t *res; + unsigned int res_len; + const uint8_t *auts; +}; + +/* Result communicated back to parent FMS */ +enum vlr_auth_fsm_result { + VLR_AUTH_RES_ABORTED, + VLR_AUTH_RES_UNKNOWN_SUBSCR, + VLR_AUTH_RES_PROC_ERR, + VLR_AUTH_RES_AUTH_FAILED, + VLR_AUTH_RES_PASSED, +}; + +extern const struct value_string vlr_auth_fsm_result_names[]; +static inline const char *vlr_auth_fsm_result_name(enum vlr_auth_fsm_result val) +{ + return get_value_string(vlr_auth_fsm_result_names, val); +} + +enum vlr_fsm_auth_event { + VLR_AUTH_E_START, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo ACK from HLR */ + VLR_AUTH_E_HLR_SAI_ACK, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo NACK from HLR */ + VLR_AUTH_E_HLR_SAI_NACK, + /* FIXME: merge with NACK? */ + VLR_AUTH_E_HLR_SAI_ABORT, + /* Authentication Response from MS */ + VLR_AUTH_E_MS_AUTH_RESP, + /* Authentication Failure from MS */ + VLR_AUTH_E_MS_AUTH_FAIL, + /* Identity Response (IMSI) from MS */ + VLR_AUTH_E_MS_ID_IMSI, +}; + +struct osmo_fsm vlr_auth_fsm; + +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran); diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h new file mode 100644 index 0000000..0e63c7e --- /dev/null +++ b/src/libvlr/vlr_core.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#define LOGGSUPP(level, gsup, fmt, args...) \ + LOGP(DVLR, level, "GSUP(%s) " fmt, \ + (gsup)->imsi, \ + ## args) + +#define LOGVSUBP(level, vsub, fmt, args...) \ + LOGP(DVLR, level, "SUBSCR(%s) " fmt, \ + vlr_subscr_name(vsub), ## args) + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps); +int vlr_subscr_req_sai(struct vlr_subscr *vsub, const uint8_t *auts, + const uint8_t *auts_rand); +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c new file mode 100644 index 0000000..d32659f --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.c @@ -0,0 +1,1424 @@ +/* Osmocom Visitor Location Register (VLR): Location Update FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" + +#define S(x) (1 << (x)) + +#define LU_TIMEOUT_LONG 30 + +enum vlr_fsm_result { + VLR_FSM_RESULT_NONE, + VLR_FSM_RESULT_SUCCESS, + VLR_FSM_RESULT_FAILURE, +}; + + +/*********************************************************************** + * Update_HLR_VLR, TS 23.012 Chapter 4.1.2.4 + ***********************************************************************/ + +enum upd_hlr_vlr_state { + UPD_HLR_VLR_S_INIT, + UPD_HLR_VLR_S_WAIT_FOR_DATA, + UPD_HLR_VLR_S_DONE, +}; + +enum upd_hlr_vlr_evt { + UPD_HLR_VLR_E_START, + UPD_HLR_VLR_E_INS_SUB_DATA, + UPD_HLR_VLR_E_ACT_TRACE_MODE, + UPD_HLR_VLR_E_FW_CHECK_SS_IND, + UPD_HLR_VLR_E_UPD_LOC_ACK, + UPD_HLR_VLR_E_UPD_LOC_NACK, +}; + +static const struct value_string upd_hlr_vlr_event_names[] = { + OSMO_VALUE_STRING(UPD_HLR_VLR_E_START), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_INS_SUB_DATA), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_ACT_TRACE_MODE), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_FW_CHECK_SS_IND), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_ACK), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_NACK), + { 0, NULL } +}; + +static void upd_hlr_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + OSMO_ASSERT(event == UPD_HLR_VLR_E_START); + + /* Send UpdateLocation to HLR */ + vlr_subscr_req_lu(vsub, vsub->vlr->cfg.is_ps); + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_WAIT_FOR_DATA, + LU_TIMEOUT_LONG, 0); +} + +static void upd_hlr_vlr_fsm_wait_data(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case UPD_HLR_VLR_E_INS_SUB_DATA: + /* FIXME: Insert_Subscr_Data_VLR */ + break; + case UPD_HLR_VLR_E_ACT_TRACE_MODE: + /* TODO: Activate_Tracing_VLR */ + break; + case UPD_HLR_VLR_E_FW_CHECK_SS_IND: + /* TODO: Forward Check SS Ind to MSC */ + break; + case UPD_HLR_VLR_E_UPD_LOC_ACK: + /* Inside Update_HLR_VLR after UpdateLocationAck */ + vsub->sub_dataconf_by_hlr_ind = true; + vsub->loc_conf_in_hlr_ind = true; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + case UPD_HLR_VLR_E_UPD_LOC_NACK: + /* Inside Update_HLR_VLR after UpdateLocationNack */ + /* TODO: Check_User_Error_In_Serving_Network_Entity */ + vsub->sub_dataconf_by_hlr_ind = false; + vsub->loc_conf_in_hlr_ind = false; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + /* Data is a pointer to a gsm48_gmm_cause which we + * simply pass through */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, data); + break; + } +} + +static const struct osmo_fsm_state upd_hlr_vlr_states[] = { + [UPD_HLR_VLR_S_INIT] = { + .in_event_mask = S(UPD_HLR_VLR_E_START), + .out_state_mask = S(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_INIT), + .action = upd_hlr_vlr_fsm_init, + }, + [UPD_HLR_VLR_S_WAIT_FOR_DATA] = { + .in_event_mask = S(UPD_HLR_VLR_E_INS_SUB_DATA) | + S(UPD_HLR_VLR_E_ACT_TRACE_MODE) | + S(UPD_HLR_VLR_E_FW_CHECK_SS_IND) | + S(UPD_HLR_VLR_E_UPD_LOC_ACK) | + S(UPD_HLR_VLR_E_UPD_LOC_NACK), + .out_state_mask = S(UPD_HLR_VLR_S_DONE), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .action = upd_hlr_vlr_fsm_wait_data, + }, + [UPD_HLR_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_DONE), + }, +}; + +static struct osmo_fsm upd_hlr_vlr_fsm = { + .name = "upd_hlr_vlr_fsm", + .states = upd_hlr_vlr_states, + .num_states = ARRAY_SIZE(upd_hlr_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = upd_hlr_vlr_event_names, +}; + +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&upd_hlr_vlr_fsm, parent, + parent_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, UPD_HLR_VLR_E_START, NULL); + + return fi; +} + + +/*********************************************************************** + * Subscriber_Present_VLR, TS 29.002 Chapter 25.10.1 + ***********************************************************************/ + +enum sub_pres_vlr_state { + SUB_PRES_VLR_S_INIT, + SUB_PRES_VLR_S_WAIT_FOR_HLR, + SUB_PRES_VLR_S_DONE, +}; + +enum sub_pres_vlr_event { + SUB_PRES_VLR_E_START, + SUB_PRES_VLR_E_READY_SM_CNF, + SUB_PRES_VLR_E_READY_SM_ERR, +}; + +static const struct value_string sub_pres_vlr_event_names[] = { + OSMO_VALUE_STRING(SUB_PRES_VLR_E_START), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_CNF), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_ERR), + { 0, NULL } +}; + +static void sub_pres_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + OSMO_ASSERT(event == SUB_PRES_VLR_E_START); + + if (!vsub->ms_not_reachable_flag) { + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + return; + } + /* FIXME: Send READY_FOR_SM via GSUP */ + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_WAIT_FOR_HLR, + LU_TIMEOUT_LONG, 0); +} + +static void sub_pres_vlr_fsm_wait_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case SUB_PRES_VLR_E_READY_SM_CNF: + vsub->ms_not_reachable_flag = false; + break; + case SUB_PRES_VLR_E_READY_SM_ERR: + break; + } + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +static const struct osmo_fsm_state sub_pres_vlr_states[] = { + [SUB_PRES_VLR_S_INIT] = { + .in_event_mask = S(SUB_PRES_VLR_E_START), + .out_state_mask = S(SUB_PRES_VLR_S_WAIT_FOR_HLR) | + S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_INIT), + .action = sub_pres_vlr_fsm_init, + }, + [SUB_PRES_VLR_S_WAIT_FOR_HLR] = { + .in_event_mask = S(SUB_PRES_VLR_E_READY_SM_CNF) | + S(SUB_PRES_VLR_E_READY_SM_ERR), + .out_state_mask = S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_WAIT_FOR_HLR), + .action = sub_pres_vlr_fsm_wait_hlr, + }, + [SUB_PRES_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_DONE), + }, +}; + +static struct osmo_fsm sub_pres_vlr_fsm = { + .name = "sub_pres_vlr_fsm", + .states = sub_pres_vlr_states, + .num_states = ARRAY_SIZE(sub_pres_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = sub_pres_vlr_event_names, +}; + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&sub_pres_vlr_fsm, parent, + term_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, SUB_PRES_VLR_E_START, NULL); + + return fi; +} + +/*********************************************************************** + * Location_Update_Completion_VLR, TS 23.012 Chapter 4.1.2.3 + ***********************************************************************/ + +enum lu_compl_vlr_state { + LU_COMPL_VLR_S_INIT, + LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_COMPL_VLR_S_WAIT_IMEI, + LU_COMPL_VLR_S_WAIT_IMEI_TMSI, + LU_COMPL_VLR_S_WAIT_TMSI_CNF, + LU_COMPL_VLR_S_DONE, +}; + +enum lu_compl_vlr_event { + LU_COMPL_VLR_E_START, + LU_COMPL_VLR_E_SUB_PRES_COMPL, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, + LU_COMPL_VLR_E_IMEI_CHECK_NACK, + LU_COMPL_VLR_E_NEW_TMSI_ACK, +}; + +static const struct value_string lu_compl_vlr_event_names[] = { + OSMO_VALUE_STRING(LU_COMPL_VLR_E_START), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_SUB_PRES_COMPL), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_ACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_compl_vlr_priv { + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t cause; + bool assign_tmsi; +}; + +static void _vlr_lu_compl_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result, + uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->result = result; + lcvp->cause = cause; + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_DONE, 0, 0); +} + +static void vlr_lu_compl_fsm_success(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + if (!vsub->lu_complete) { + vsub->lu_complete = true; + /* Balanced by vlr_subscr_rx_imsi_detach() */ + vlr_subscr_get(vsub); + } + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_SUCCESS, 0); +} + +static void vlr_lu_compl_fsm_failure(struct osmo_fsm_inst *fi, uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->vsub->vlr->ops.tx_lu_rej(lcvp->msc_conn_ref, cause); + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_FAILURE, cause); +} + +static void vlr_lu_compl_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lcvp->result == VLR_FSM_RESULT_SUCCESS) + ? lcvp->parent_event_success + : lcvp->parent_event_failure, + &lcvp->cause); +} + +static void lu_compl_vlr_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr; + OSMO_ASSERT(vsub); + vlr = vsub->vlr; + OSMO_ASSERT(vlr); + + OSMO_ASSERT(event == LU_COMPL_VLR_E_START); + + /* TODO: National Roaming restrictions? */ + /* TODO: Roaming restriction due to unsupported feature in subscriber + * data? */ + /* TODO: Regional subscription restriction? */ + /* TODO: Administrative restriction of subscribres' access feature? */ + /* TODO: AccessRestrictuionData parameter available? */ + /* TODO: AccessRestrictionData permits RAT? */ + /* Node 1 */ + /* TODO: Autonomous CSG supported in VPLMN and allowed by HPLMN? */ + /* TODO: Hybrid Cel / CSG Cell */ + /* Node 2 */ + vsub->la_allowed = true; + vsub->imsi_detached_flag = false; + /* Start Subscriber_Present_VLR Procedure */ + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_TIMEOUT_LONG, 0); + + lcvp->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + LU_COMPL_VLR_E_SUB_PRES_COMPL); + +} + +static void lu_compl_vlr_new_tmsi(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + if (vlr_subscr_alloc_tmsi(vsub)) { + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_TMSI_CNF, + vlr_timer(vlr, 3250), 3250); + + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, vsub->tmsi_new); +} + +/* After completion of Subscriber_Present_VLR */ +static void lu_compl_vlr_wait_subscr_pres(struct osmo_fsm_inst *fi, + uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_SUB_PRES_COMPL); + + lcvp->sub_pres_vlr_fsm = NULL; + + /* TODO: Trace_Subscriber_Activity_VLR */ + + if (vlr->cfg.check_imei_rqd) { + /* Check IMEI VLR */ + osmo_fsm_inst_state_chg(fi, + lcvp->assign_tmsi ? + LU_COMPL_VLR_S_WAIT_IMEI_TMSI + : LU_COMPL_VLR_S_WAIT_IMEI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lcvp->msc_conn_ref, GSM_MI_TYPE_IMEI); + return; + } + + /* Do we need to allocate a TMSI? */ + if (lcvp->assign_tmsi) { + lu_compl_vlr_new_tmsi(fi); + return; + } + + /* Location Updating Accept */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for completion of CHECK_IMEI_VLR */ +static void lu_compl_vlr_wait_imei(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + switch (event) { + case LU_COMPL_VLR_E_IMEI_CHECK_ACK: + if (!vsub->imei[0]) { + /* Abort: Do nothing */ + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_PROTOCOL_ERROR); + return; + } + /* Pass */ + break; + + case LU_COMPL_VLR_E_IMEI_CHECK_NACK: + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_ILLEGAL_ME); + /* FIXME: IMEI Check Fail to VLR Application (Detach IMSI VLR) */ + return; + } + + /* IMEI is available. Allocate TMSI if needed. */ + if (lcvp->assign_tmsi) { + if (fi->state != LU_COMPL_VLR_S_WAIT_IMEI_TMSI) + LOGPFSML(fi, LOGL_ERROR, + "TMSI required, expected to be in state" + " LU_COMPL_VLR_S_WAIT_IMEI_TMSI," + " am in %s instead\n", + osmo_fsm_state_name(fi->fsm, fi->state)); + /* Logged an error, continue anyway. */ + + lu_compl_vlr_new_tmsi(fi); + + /* Wait for TMSI ack */ + return; + } + + /* No TMSI needed, accept now. */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for TMSI confirmation */ +static void lu_compl_vlr_wait_tmsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_NEW_TMSI_ACK); + + if (!vsub || vsub->tmsi_new == GSM_RESERVED_TMSI) { + LOGPFSML(fi, LOGL_ERROR, "TMSI Realloc Compl implies that" + " the subscriber has a new TMSI allocated, but" + " the new TMSI is unset.\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + vsub->tmsi = vsub->tmsi_new; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + vlr_lu_compl_fsm_success(fi); +} + +static const struct osmo_fsm_state lu_compl_vlr_states[] = { + [LU_COMPL_VLR_S_INIT] = { + .in_event_mask = S(LU_COMPL_VLR_E_START), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_SUB_PRES) | + S(LU_COMPL_VLR_S_WAIT_IMEI), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_INIT), + .action = lu_compl_vlr_init, + }, + [LU_COMPL_VLR_S_WAIT_SUB_PRES] = { + .in_event_mask = S(LU_COMPL_VLR_E_SUB_PRES_COMPL), + .out_state_mask = S(LU_COMPL_VLR_S_WAIT_IMEI) | + S(LU_COMPL_VLR_S_WAIT_IMEI_TMSI) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF) | + S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_SUB_PRES), + .action = lu_compl_vlr_wait_subscr_pres, + }, + [LU_COMPL_VLR_S_WAIT_IMEI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_IMEI_TMSI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI_TMSI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_TMSI_CNF] = { + .in_event_mask = S(LU_COMPL_VLR_E_NEW_TMSI_ACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .action = lu_compl_vlr_wait_tmsi, + }, + [LU_COMPL_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_DONE), + .onenter = vlr_lu_compl_fsm_dispatch_result, + }, +}; + +static struct osmo_fsm lu_compl_vlr_fsm = { + .name = "lu_compl_vlr_fsm", + .states = lu_compl_vlr_states, + .num_states = ARRAY_SIZE(lu_compl_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = lu_compl_vlr_event_names, +}; + +struct osmo_fsm_inst * +lu_compl_vlr_proc_alloc(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_compl_vlr_priv *lcvp; + + fi = osmo_fsm_inst_alloc_child(&lu_compl_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return NULL; + + lcvp = talloc_zero(fi, struct lu_compl_vlr_priv); + lcvp->vsub = vsub; + lcvp->msc_conn_ref = msc_conn_ref; + lcvp->parent_event_success = parent_event_success; + lcvp->parent_event_failure = parent_event_failure; + lcvp->assign_tmsi = assign_tmsi; + fi->priv = lcvp; + + return fi; +} + + +/*********************************************************************** + * Update_Location_Area_VLR, TS 23.012 Chapter 4.1.2.1 + ***********************************************************************/ + +static const struct value_string fsm_lu_event_names[] = { + OSMO_VALUE_STRING(VLR_ULA_E_UPDATE_LA), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_ACK), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_NACK), + OSMO_VALUE_STRING(VLR_ULA_E_AUTH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_CIPH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMSI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEISV), + OSMO_VALUE_STRING(VLR_ULA_E_HLR_LU_RES), + OSMO_VALUE_STRING(VLR_ULA_E_UPD_HLR_COMPL), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_SUCCESS), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_FAILURE), + OSMO_VALUE_STRING(VLR_ULA_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_fsm_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *upd_hlr_vlr_fsm; + struct osmo_fsm_inst *lu_compl_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t rej_cause; + + enum vlr_lu_type type; + bool lu_by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id old_lai; + struct osmo_location_area_id new_lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool assign_tmsi; +}; + + +/* Determine if given location area is served by this VLR */ +static bool lai_in_this_vlr(struct vlr_instance *vlr, + const struct osmo_location_area_id *lai) +{ + /* TODO: VLR needs to keep a locally configued list of LAIs */ + return true; +} + +/* Determine if authentication is required */ +static bool is_auth_required(struct lu_fsm_priv *lfp) +{ + /* 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); +} + +/* Determine if ciphering is required */ +static bool is_ciph_required(struct lu_fsm_priv *lfp) +{ + return lfp->ciphering_required != VLR_CIPH_NONE; +} + +/* Determine if a HLR Update is required */ +static bool hlr_update_needed(struct vlr_subscr *vsub) +{ + /* TODO: properly decide this, rather than always assuming we + * need to update the HLR. */ + return true; +} + +static void lu_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lfp->result == VLR_FSM_RESULT_SUCCESS) + ? lfp->parent_event_success + : lfp->parent_event_failure, + lfp->parent_event_data); +} + +static void _lu_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->result = result; + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_DONE, 0, 0); +} + +static void lu_fsm_success(struct osmo_fsm_inst *fi) +{ + _lu_fsm_done(fi, VLR_FSM_RESULT_SUCCESS); +} + +static void lu_fsm_failure(struct osmo_fsm_inst *fi, uint8_t rej_cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (rej_cause) + lfp->vlr->ops.tx_lu_rej(lfp->msc_conn_ref, rej_cause); + _lu_fsm_done(fi, VLR_FSM_RESULT_FAILURE); +} + +static void vlr_loc_upd_start_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->lu_compl_vlr_fsm = + lu_compl_vlr_proc_alloc(fi, lfp->vsub, lfp->msc_conn_ref, + VLR_ULA_E_LU_COMPL_SUCCESS, + VLR_ULA_E_LU_COMPL_FAILURE, + lfp->assign_tmsi); + + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, LU_COMPL_VLR_E_START, NULL); +} + +static void lu_fsm_discard_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!lfp->lu_compl_vlr_fsm) + return; + osmo_fsm_inst_term(lfp->lu_compl_vlr_fsm, OSMO_FSM_TERM_PARENT, NULL); +} + +/* 4.1.2.1 Node 4 */ +static void vlr_loc_upd_node_4(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + bool hlr_unknown = false; + + LOGPFSM(fi, "%s()\n", __func__); + + if (hlr_unknown) { + /* FIXME: Delete subscriber record */ + /* LU REJ: Roaming not allowed */ + lu_fsm_failure(fi, GSM48_REJECT_ROAMING_NOT_ALLOWED); + } else { + /* Update_HLR_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_HLR_UPD, + LU_TIMEOUT_LONG, 0); + lfp->upd_hlr_vlr_fsm = + upd_hlr_vlr_proc_start(fi, vsub, VLR_ULA_E_UPD_HLR_COMPL); + } +} + +/* 4.1.2.1 Node B */ +static void vlr_loc_upd_node_b(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + + /* FIXME */ + if (0) { /* IMEISV or PgA to send */ + vlr_loc_upd_node_4(fi); + } else { + /* Location_Update_Completion */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } +} + +/* Non-standard: after Ciphering Mode Complete (or no ciph required) */ +static void vlr_loc_upd_post_ciph(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + vsub->conf_by_radio_contact_ind = true; + /* Update LAI */ + vsub->cgi.lai = lfp->new_lai; + vsub->dormant_ind = false; + vsub->cancel_loc_rx = false; + if (hlr_update_needed(vsub)) { + vlr_loc_upd_node_4(fi); + } else { + /* TODO: ADD Support */ + /* TODO: Node A: PgA Support */ + vlr_loc_upd_node_b(fi); + } +} + +/* 4.1.2.1 after Authentication successful (or no auth rqd) */ +static void vlr_loc_upd_post_auth(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (!is_ciph_required(lfp)) { + vlr_loc_upd_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, lfp->msc_conn_ref, + lfp->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_CIPH, LU_TIMEOUT_LONG, 0); +} + +static void vlr_loc_upd_node1(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (is_auth_required(lfp)) { + /* Authenticate_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_AUTH, + LU_TIMEOUT_LONG, 0); + vsub->auth_fsm = auth_fsm_start(lfp->vsub, fi->log_level, + fi, VLR_ULA_E_AUTH_RES, + lfp->is_r99, + lfp->is_utran); + } else { + /* no need for authentication */ + vlr_loc_upd_post_auth(fi); + } +} + +static void vlr_loc_upd_want_imsi(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(lfp->vsub); + + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMSI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMSI); + /* will continue at vlr_loc_upd_node1() once IMSI arrives */ +} + +static int assoc_lfp_with_sub(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + if (vsub->lu_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "A Location Updating process is already pending for" + " this subscriber. Aborting.\n"); + /* Also get rid of the other pending LU attempt? */ + /*lu_fsm_failure(vsub->lu_fsm, GSM48_REJECT_CONGESTION);*/ + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); + return -EINVAL; + } + vsub->lu_fsm = fi; + vsub->msc_conn_ref = lfp->msc_conn_ref; + /* FIXME: send new LAC to HLR? */ + vsub->lac = lfp->new_lai.lac; + lfp->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(lfp->msc_conn_ref, lfp->vsub); + return 0; +} + +static const char *lai_name(struct osmo_location_area_id *lai) +{ + static char buf[64]; + snprintf(buf, sizeof(buf),"MCC:%u, MNC:%u, LAC:%u", + lai->plmn.mcc, lai->plmn.mnc, lai->lac); + return buf; +} + +/* 4.1.2.1: Subscriber (via MSC/SGSN) requests location update */ +static void _start_lu_main(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + struct vlr_subscr *vsub = NULL; + bool created; + + /* TODO: PUESBINE related handling */ + + /* Is previous LAI in this VLR? */ + if (!lai_in_this_vlr(vlr, &lfp->old_lai)) { +#if 0 + /* FIXME: check previous VLR, (3) */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_PVLR, + LU_TIMEOUT_LONG, 0); + return; +#endif + LOGPFSML(fi, LOGL_NOTICE, "LAI change from %s," + " but checking previous VLR not implemented\n", + lai_name(&lfp->old_lai)); + } + + if (!lfp->imsi[0]) { + /* TMSI was used */ + lfp->lu_by_tmsi = true; + /* TMSI clash: if a different subscriber already has this TMSI, + * we will find that other subscriber in the VLR. So the IMSIs + * would mismatch, but we don't know about it. Theoretically, + * an authentication process would thwart any attempt to use + * someone else's TMSI. + * TODO: Otherwise we can ask for the IMSI and verify that it + * matches the IMSI on record. */ + vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, + &created); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + + if (created) + vlr_loc_upd_want_imsi(fi); + else + vlr_loc_upd_node1(fi); + /* We cannot have MSC area change, as the VLR + * serves only one MSC */ + vlr_subscr_put(vsub); + } else { + /* IMSI was used */ + vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + vlr_subscr_put(vsub); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + vlr_loc_upd_node1(fi); + vlr_subscr_put(vsub); + } +} + + +static void lu_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + OSMO_ASSERT(event == VLR_ULA_E_UPDATE_LA); + + if (1) { // FIXME + //if (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0]) + /* R_IMEISV_IR1 passed */ + _start_lu_main(fi); + } else { + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMEISV); + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMEISV, + vlr_timer(vlr, 3270), 3270); + } +} + +static void lu_fsm_wait_imeisv(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_ID_IMEISV: + /* FIXME: copy IMEISV */ + _start_lu_main(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for response from Send_Identification to PVLR */ +static void lu_fsm_wait_pvlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_SEND_ID_ACK: + vlr_loc_upd_node1(fi); + break; + case VLR_ULA_E_SEND_ID_NACK: + vlr_loc_upd_want_imsi(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for result of Authenticate_VLR procedure */ +static void lu_fsm_wait_auth(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + enum vlr_auth_fsm_result *res = data; + uint8_t rej_cause = 0; + + OSMO_ASSERT(event == VLR_ULA_E_AUTH_RES); + + lfp->upd_hlr_vlr_fsm = NULL; + + if (res) { + switch (*res) { + case VLR_AUTH_RES_PASSED: + /* Result == Pass */ + vlr_loc_upd_post_auth(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* go to Idle with no response */ + rej_cause = 0; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* FIXME: delete subscribe record */ + rej_cause = GSM48_REJECT_IMSI_UNKNOWN_IN_HLR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* cause = illegal subscriber */ + rej_cause = GSM48_REJECT_ILLEGAL_MS; + break; + case VLR_AUTH_RES_PROC_ERR: + /* cause = system failure */ + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } + } else + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + + lu_fsm_failure(fi, rej_cause); +} + +static void lu_fsm_wait_ciph(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == VLR_ULA_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + } + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + vlr_loc_upd_post_ciph(fi); +} + +static void lu_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + char *mi_string = data; + + switch (event) { + case VLR_ULA_E_ID_IMSI: + vlr_subscr_set_imsi(vsub, mi_string); + vlr_loc_upd_node1(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* At the end of Update_HLR_VLR */ +static void lu_fsm_wait_hlr_ul_res(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + + switch (event) { + case VLR_ULA_E_HLR_LU_RES: + /* pass-through this event to Update_HLR_VLR */ + if (data == NULL) + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_ACK, NULL); + else + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_NACK, data); + break; + case VLR_ULA_E_UPD_HLR_COMPL: + if (data == NULL) { + /* successful case */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + /* continue in MSC ?!? */ + } else { + /* unsuccessful case */ + enum gsm48_gmm_cause cause = + *(enum gsm48_gmm_cause *)data; + if (0 /* procedure_error && vlr->cfg.standalone_mode */) { + osmo_fsm_inst_state_chg(fi, + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } else { + lu_fsm_failure(fi, cause); + } + } + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR */ +static void lu_fsm_wait_lu_compl(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_ID_IMEI: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + + /* Update Register */ + /* TODO: Set_Notification_Type 23.078 */ + /* TODO: Notify_gsmSCF 23.078 */ + /* TODO: Authenticated Radio Contact Established -> ARC */ + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR (standalone case) */ +static void lu_fsm_wait_lu_compl_standalone(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + vsub->sub_dataconf_by_hlr_ind = false; + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + vsub->sub_dataconf_by_hlr_ind = false; + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +static const struct osmo_fsm_state vlr_lu_fsm_states[] = { + [VLR_ULA_S_IDLE] = { + .in_event_mask = S(VLR_ULA_E_UPDATE_LA), + .out_state_mask = S(VLR_ULA_S_WAIT_IMEISV) | + S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_IDLE), + .action = lu_fsm_idle, + }, + [VLR_ULA_S_WAIT_IMEISV] = { + .in_event_mask = S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMEISV), + .action = lu_fsm_wait_imeisv, + }, + [VLR_ULA_S_WAIT_PVLR] = { + .in_event_mask = S(VLR_ULA_E_SEND_ID_ACK) | + S(VLR_ULA_E_SEND_ID_NACK), + .out_state_mask = S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_PVLR), + .action = lu_fsm_wait_pvlr, + }, + [VLR_ULA_S_WAIT_AUTH] = { + .in_event_mask = S(VLR_ULA_E_AUTH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_CIPH) | + S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_AUTH), + .action = lu_fsm_wait_auth, + }, + [VLR_ULA_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_CIPH), + .in_event_mask = S(VLR_ULA_E_CIPH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .action = lu_fsm_wait_ciph, + }, + [VLR_ULA_S_WAIT_IMSI] = { + .in_event_mask = S(VLR_ULA_E_ID_IMSI), + .out_state_mask = S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMSI), + .action = lu_fsm_wait_imsi, + }, + [VLR_ULA_S_WAIT_HLR_UPD] = { + .in_event_mask = S(VLR_ULA_E_HLR_LU_RES) | + S(VLR_ULA_E_UPD_HLR_COMPL), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_HLR_UPD), + .action = lu_fsm_wait_hlr_ul_res, + }, + [VLR_ULA_S_WAIT_LU_COMPL] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK) | + S(VLR_ULA_E_ID_IMEI) | + S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL), + .action = lu_fsm_wait_lu_compl, + }, + [VLR_ULA_S_WAIT_LU_COMPL_STANDALONE] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE), + .action = lu_fsm_wait_lu_compl_standalone, + }, + [VLR_ULA_S_DONE] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_DONE), + .onenter = lu_fsm_dispatch_result, + }, +}; + +static void fsm_lu_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "fsm_lu_cleanup called with cause %s\n", + osmo_fsm_term_cause_name(cause)); + if (vsub && vsub->lu_fsm == fi) + vsub->lu_fsm = NULL; +} + +static struct osmo_fsm vlr_lu_fsm = { + .name = "vlr_lu_fsm", + .states = vlr_lu_fsm_states, + .num_states = ARRAY_SIZE(vlr_lu_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_lu_event_names, + .cleanup = fsm_lu_cleanup, +}; + +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_fsm_priv *lfp; + + fi = osmo_fsm_inst_alloc_child(&vlr_lu_fsm, parent, parent_event_failure); + if (!fi) + return NULL; + + lfp = talloc_zero(fi, struct lu_fsm_priv); + lfp->vlr = vlr; + lfp->msc_conn_ref = msc_conn_ref; + lfp->tmsi = tmsi; + lfp->type = type; + lfp->old_lai = *old_lai; + lfp->new_lai = *new_lai; + lfp->lu_by_tmsi = true; + lfp->parent_event_success = parent_event_success; + lfp->parent_event_failure = parent_event_failure; + lfp->parent_event_data = parent_event_data; + lfp->authentication_required = authentication_required; + lfp->ciphering_required = ciphering_required; + lfp->is_r99 = is_r99; + lfp->is_utran = is_utran; + lfp->assign_tmsi = assign_tmsi; + if (imsi) { + strncpy(lfp->imsi, imsi, sizeof(lfp->imsi)-1); + lfp->imsi[sizeof(lfp->imsi)-1] = '\0'; + lfp->lu_by_tmsi = false; + } + fi->priv = lfp; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + osmo_fsm_inst_dispatch(fi, VLR_ULA_E_UPDATE_LA, NULL); + + return fi; +} + +/* Gracefully terminate an FSM created by vlr_loc_update() in case of external + * timeout (i.e. from MSC). */ +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == VLR_ULA_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); +} + +void vlr_lu_fsm_init(void) +{ + osmo_fsm_register(&vlr_lu_fsm); + osmo_fsm_register(&upd_hlr_vlr_fsm); + osmo_fsm_register(&sub_pres_vlr_fsm); + osmo_fsm_register(&lu_compl_vlr_fsm); +} diff --git a/src/libvlr/vlr_lu_fsm.h b/src/libvlr/vlr_lu_fsm.h new file mode 100644 index 0000000..5cf13c7 --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +enum vlr_lu_state { + VLR_ULA_S_IDLE, + VLR_ULA_S_WAIT_IMEISV, + VLR_ULA_S_WAIT_PVLR, /* Waiting for ID from PVLR */ + VLR_ULA_S_WAIT_AUTH, /* Waiting for Authentication */ + VLR_ULA_S_WAIT_CIPH, /* Waiting for Ciphering Complete */ + VLR_ULA_S_WAIT_IMSI, /* Waiting for IMSI from MS */ + VLR_ULA_S_WAIT_HLR_UPD, /* Waiting for end of HLR update */ + VLR_ULA_S_WAIT_LU_COMPL,/* Waiting for LU complete */ + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, /* Standalone VLR */ + VLR_ULA_S_DONE +}; + +void vlr_lu_fsm_init(void); diff --git a/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am index f4ef487..a99334d 100644 --- a/src/osmo-nitb/Makefile.am +++ b/src/osmo-nitb/Makefile.am @@ -32,6 +32,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libvlr/libvlr.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 16:01:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 16:01:08 +0000 Subject: [PATCH] osmo-msc[master]: Use libvlr in libmsc (large refactoring) 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/3195 to look at the new patch set (#4). Use libvlr in libmsc (large refactoring) Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Related: OS#1592 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 --- M configure.ac M include/openbsc/abis_rsl.h M include/openbsc/auth.h M include/openbsc/bsc_api.h M include/openbsc/chan_alloc.h M include/openbsc/db.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/gsm_subscriber.h M include/openbsc/osmo_msc.h M include/openbsc/signal.h M include/openbsc/silent_call.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/paging.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/meas_feed.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c M src/libmsc/token_auth.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr_access_req_fsm.c M src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/db/db_test.c M tests/mm_auth/mm_auth_test.c M tests/mm_auth/mm_auth_test.ok A tests/sms_queue/Makefile.am A tests/sms_queue/sms_queue_test.c A tests/sms_queue/sms_queue_test.err A tests/sms_queue/sms_queue_test.ok M tests/subscr/Makefile.am D tests/subscr/subscr_test.c D tests/subscr/subscr_test.ok M tests/testsuite.at M tests/vty_test_runner.py 66 files changed, 2,169 insertions(+), 3,860 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3195/4 -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 4 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 Thu Jul 20 16:01:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 16:01:08 +0000 Subject: [PATCH] osmo-msc[master]: Add msc_vlr test suite for MSC+VLR end-to-end 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/3196 to look at the new patch set (#4). Add msc_vlr test suite for MSC+VLR end-to-end tests Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd --- M .gitignore M configure.ac M tests/Makefile.am A tests/msc_vlr/Makefile.am A tests/msc_vlr/msc_vlr_test_gsm_authen.c A tests/msc_vlr/msc_vlr_test_gsm_authen.err A tests/msc_vlr/msc_vlr_test_gsm_authen.ok A tests/msc_vlr/msc_vlr_test_gsm_ciph.c A tests/msc_vlr/msc_vlr_test_gsm_ciph.err A tests/msc_vlr/msc_vlr_test_gsm_ciph.ok A tests/msc_vlr/msc_vlr_test_hlr_reject.c A tests/msc_vlr/msc_vlr_test_hlr_reject.err A tests/msc_vlr/msc_vlr_test_hlr_reject.ok A tests/msc_vlr/msc_vlr_test_hlr_timeout.c A tests/msc_vlr/msc_vlr_test_hlr_timeout.err A tests/msc_vlr/msc_vlr_test_hlr_timeout.ok A tests/msc_vlr/msc_vlr_test_ms_timeout.c A tests/msc_vlr/msc_vlr_test_ms_timeout.err A tests/msc_vlr/msc_vlr_test_ms_timeout.ok A tests/msc_vlr/msc_vlr_test_no_authen.c A tests/msc_vlr/msc_vlr_test_no_authen.err A tests/msc_vlr/msc_vlr_test_no_authen.ok A tests/msc_vlr/msc_vlr_test_reject_concurrency.c A tests/msc_vlr/msc_vlr_test_reject_concurrency.err A tests/msc_vlr/msc_vlr_test_reject_concurrency.ok A tests/msc_vlr/msc_vlr_test_rest.c A tests/msc_vlr/msc_vlr_test_rest.err A tests/msc_vlr/msc_vlr_test_rest.ok A tests/msc_vlr/msc_vlr_test_umts_authen.c A tests/msc_vlr/msc_vlr_test_umts_authen.err A tests/msc_vlr/msc_vlr_test_umts_authen.ok A tests/msc_vlr/msc_vlr_tests.c A tests/msc_vlr/msc_vlr_tests.h M tests/testsuite.at 34 files changed, 15,306 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/3196/4 -- To view, visit https://gerrit.osmocom.org/3196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd Gerrit-PatchSet: 4 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 Thu Jul 20 16:02:17 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 20 Jul 2017 16:02:17 +0000 Subject: [MERGED] libosmo-sccp[master]: cosmetic: remove comment In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: cosmetic: remove comment ...................................................................... cosmetic: remove comment The vty command string already says it all, remove the comment entirely. Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d --- M src/osmo_ss7_vty.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 9a4e963..7e6f9ee 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1195,7 +1195,6 @@ return CMD_SUCCESS; } -/* Create a new addressbook entry and switch nodes */ DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, "no sccp-address NAME", NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") -- To view, visit https://gerrit.osmocom.org/3264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ecad584a1bc9b97693b199abd1ec2e5f6ce156d Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Jul 20 16:05:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 16:05:04 +0000 Subject: osmo-msc[master]: Add msc_vlr test suite for MSC+VLR end-to-end tests In-Reply-To: References: Message-ID: Patch Set 4: wow, this patch actually adds 15k lines D: (but they're worth it) -- To view, visit https://gerrit.osmocom.org/3196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 20 16:13:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 16:13:25 +0000 Subject: osmo-gsm-tester[master]: Improve SMPP supported features and test coverage In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 20 16:38:09 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 20 Jul 2017 16:38:09 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: ensure addressbook entry names are unique 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/3292 to look at the new patch set (#3). sccp: ensure addressbook entry names are unique It is possible to add two (or more) different sccp-addresses under the same name, when the addresses are defined in different cs7 instances. Add a check to make sure an address name is not used multiple times Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 --- M src/osmo_ss7_vty.c 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/92/3292/3 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 8a03303..c859eb9 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1205,6 +1205,16 @@ return CMD_WARNING; } + /* Ensure that we do not use address names that + * are already used in other ss7 instances. */ + entry = addr_entry_by_name_global(name); + if (entry != NULL) { + vty_out(vty, + "address name (%s) already used in ss7 instance %u%s", + entry->name, entry->inst->cfg.id, VTY_NEWLINE); + return CMD_WARNING; + } + entry = addr_entry_by_name_local(name, inst); /* Create a new addressbook entry if we can not find an -- To view, visit https://gerrit.osmocom.org/3292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 16:55:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:55:54 +0000 Subject: openbsc[master]: remove code disabling T3109 if configured to 0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0 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 Thu Jul 20 16:55:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:55:55 +0000 Subject: [MERGED] openbsc[master]: remove code disabling T3109 if configured to 0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove code disabling T3109 if configured to 0 ...................................................................... remove code disabling T3109 if configured to 0 We no longer permit timers with a 0 value, so this case can never happen. Also, if it should happen, I'd rather have a timter expiring immediately (and breaking something) than not being started in the first place. Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index f537cf2..f4fd6de 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -2899,10 +2899,6 @@ { struct gsm_bts *bts = lchan->ts->trx->bts; - /* Disabled, mostly legacy code */ - if (bts->network->T3109 == 0) - return -1; - osmo_timer_setup(&lchan->T3109, t3109_expired, lchan); osmo_timer_schedule(&lchan->T3109, bts->network->T3109, 0); return 0; -- To view, visit https://gerrit.osmocom.org/3309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0 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 Thu Jul 20 16:56:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 20 Jul 2017 16:56:08 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Improve SMPP supported features and test coverage In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Improve SMPP supported features and test coverage ...................................................................... Improve SMPP supported features and test coverage esme: Add several bits to handle logic required by tests: - Allow specifying the mode used to send an sms - Add a parameter to ask to receive a Delivery receipt for that message - Add sms_send_wait_resp API, which waits until the response message for a given smpp message is received when sending an sms. - Add receipt_was_received API, which together with message_received_handler maintains state of the delivery receipts we asked for and were still not received. However, the check needs to be disabled for now because OsmoNITB doens't seem to be sending stuff properly, see OsmoNITB #2353. - On message_received_handler, also print alert_notification messages, to show that there's actually a bug in OsmoNITB, see #2352. Move old esme_ms_sms to esme_ms_sms_transaction, and explicitly state that we are using that mode. On the same test, we can now enable the part which asserts that sending an SMS to an msisdn with unknown destination triggers an error. The issue was mainly that the error had to come from the SMSC server response, not from the sent message, so we have to wait for the response to have the failure triggered. Finally, add esme_ms_sms_storeforward, which tests features for sms sent using that mode, and uses the APIs described above. Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e --- M src/osmo_gsm_tester/esme.py A suites/aoip_smpp/esme_ms_sms_storeforward.py R suites/aoip_smpp/esme_ms_sms_transaction.py A suites/smpp/esme_ms_sms_storeforward.py R suites/smpp/esme_ms_sms_transaction.py 5 files changed, 178 insertions(+), 24 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index f92863d..ff403c0 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -19,6 +19,7 @@ import smpplib.gsm import smpplib.client +import smpplib.command import smpplib.consts import smpplib.exceptions @@ -35,6 +36,9 @@ client = None smsc = None + MSGMODE_TRANSACTION = smpplib.consts.SMPP_MSGMODE_FORWARD + MSGMODE_STOREFORWARD = smpplib.consts.SMPP_MSGMODE_STOREFORWARD + def __init__(self, msisdn): self.msisdn = msisdn # Get last characters of msisdn to stay inside MAX_SYS_ID_LEN. Similar to modulus operator. @@ -44,6 +48,8 @@ self.connected = False self.bound = False self.listening = False + self.references_pending_receipt = [] + self.next_user_message_reference = 1 def __del__(self): try: @@ -89,9 +95,8 @@ self.disconnect() self.client = smpplib.client.Client(host, port, timeout=None) self.client.set_message_sent_handler( - lambda pdu: self.dbg('message sent:', repr(pdu)) ) - self.client.set_message_received_handler( - lambda pdu: self.dbg('message received:', repr(pdu)) ) + lambda pdu: self.dbg('Unhandled submit_sm_resp message:', pdu.sequence) ) + self.client.set_message_received_handler(self._message_received_handler) self.client.connect() self.connected = True self.client.bind_transceiver(system_id=self.system_id, password=self.password) @@ -108,6 +113,19 @@ self.client.disconnect() self.connected = False + def _message_received_handler(self, pdu, *args): + self.dbg('message received:', seq=pdu.sequence) + if isinstance(pdu, smpplib.command.AlertNotification): + self.dbg('message received: AlertNotification:', ms_availability_status=pdu.ms_availability_status) + elif isinstance(pdu, smpplib.command.DeliverSM): + self.dbg('message received:', user_message_reference=pdu.user_message_reference, references_pending_receipt=self.references_pending_receipt) + self.references_pending_receipt.remove(pdu.user_message_reference) + + def receipt_was_received(self, umref): + # return umref not in self.references_pending_receipt + self.log('FIXME: wait_receipt disabled because receipts are not received, see OsmoNITB #2353') + return True + def run_method_expect_failure(self, errcode, method, *args): try: method(*args) @@ -116,11 +134,14 @@ except smpplib.exceptions.PDUError as e: if e.args[1] != errcode: raise e + self.dbg('Expected failure triggered: %d' % errcode) - def sms_send(self, sms_obj): + def sms_send(self, sms_obj, mode, receipt=False): parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) - + seqs = [] self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) + umref = self.next_user_message_reference + self.next_user_message_reference += 1 for part in parts: pdu = self.client.send_message( source_addr_ton=smpplib.consts.SMPP_TON_INTL, @@ -131,8 +152,30 @@ destination_addr=sms_obj.dst_msisdn(), short_message=part, data_coding=encoding_flag, - esm_class=smpplib.consts.SMPP_MSGMODE_FORWARD, - registered_delivery=False, + esm_class=mode, + registered_delivery=receipt, + user_message_reference=umref, ) + self.dbg('sent part with seq', pdu.sequence) + seqs.append(pdu.sequence) + if receipt: + self.references_pending_receipt.append(umref) + return umref, seqs + + def _process_pdus_pending(self, pdu, **kwargs): + self.dbg('message sent resp with seq', pdu.sequence, ', pdus_pending:', self.pdus_pending) + self.pdus_pending.remove(pdu.sequence) + + def sms_send_wait_resp(self, sms_obj, mode, receipt=False): + old_func = self.client.message_sent_handler + try: + umref, self.pdus_pending = self.sms_send(sms_obj, mode, receipt) + self.dbg('pdus_pending:', self.pdus_pending) + self.client.set_message_sent_handler(self._process_pdus_pending) + event_loop.wait(self, lambda: len(self.pdus_pending) == 0, timeout=10) + return umref + finally: + self.client.set_message_sent_handler(old_func) + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py new file mode 100755 index 0000000..3e7e4f8 --- /dev/null +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * When SMS is sent in 'store & forward' mode, ESME fails to send an SMS to non registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to a not yet registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'store & forward' mode, ESME receives a SMS receipt if it asked for it. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +bsc.bts_add(bts) + +ms = suite.modem() +esme = suite.esme() +msc.smsc.esme_add(esme) + +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +esme.connect() +hlr.subscriber_add(ms) + +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending sms with wrong msisdn %s, it will fail' % 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) + +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) + +print('checking MS can receive SMS while registered...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send already-registered message') +umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) +wait(ms.sms_was_received, msg) +print('Waiting to receive and consume sms receipt with reference', umref) +wait(esme.receipt_was_received, umref) +esme.disconnect() diff --git a/suites/aoip_smpp/esme_ms_sms.py b/suites/aoip_smpp/esme_ms_sms_transaction.py similarity index 65% rename from suites/aoip_smpp/esme_ms_sms.py rename to suites/aoip_smpp/esme_ms_sms_transaction.py index 7f9ef18..8bcfb6b 100755 --- a/suites/aoip_smpp/esme_ms_sms.py +++ b/suites/aoip_smpp/esme_ms_sms_transaction.py @@ -3,7 +3,8 @@ # This test checks following use-cases: # * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously # defined in its configuration file. -# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. +# * When SMS is sent in 'transaction' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'transaction' mode, ESME fails to send an SMS to non registered MS. from osmo_gsm_tester.test import * @@ -39,18 +40,17 @@ print('sending first sms...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) print('sending second sms (unicode chars not in gsm aplhabet)...') msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) -# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) -# wrong_msisdn = ms.msisdn + esme.msisdn -# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) -# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_TRANSACTION) esme.disconnect() diff --git a/suites/smpp/esme_ms_sms_storeforward.py b/suites/smpp/esme_ms_sms_storeforward.py new file mode 100755 index 0000000..5ff6ad3 --- /dev/null +++ b/suites/smpp/esme_ms_sms_storeforward.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * When SMS is sent in 'store & forward' mode, ESME fails to send an SMS to non registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to a not yet registered MS. +# * When SMS is sent in 'store & forward' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'store & forward' mode, ESME receives a SMS receipt if it asked for it. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() +esme = suite.esme() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.smsc.esme_add(esme) +nitb.start() +bts.start() + +esme.connect() +nitb.subscriber_add(ms) + +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending sms with wrong msisdn %s, it will fail' % 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) + +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(nitb.mcc_mnc()) +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.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) + +print('checking MS can receive SMS while registered...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send already-registered message') +umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) +wait(ms.sms_was_received, msg) +print('Waiting to receive and consume sms receipt with reference', umref) +wait(esme.receipt_was_received, umref) +esme.disconnect() diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms_transaction.py similarity index 62% rename from suites/smpp/esme_ms_sms.py rename to suites/smpp/esme_ms_sms_transaction.py index bc9d7d4..a147754 100755 --- a/suites/smpp/esme_ms_sms.py +++ b/suites/smpp/esme_ms_sms_transaction.py @@ -3,7 +3,8 @@ # This test checks following use-cases: # * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously # defined in its configuration file. -# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. +# * When SMS is sent in 'transaction' mode, ESME can send an SMS to an already registered MS. +# * When SMS is sent in 'transaction' mode, ESME fails to send an SMS to non registered MS. from osmo_gsm_tester.test import * @@ -31,19 +32,17 @@ print('sending first sms...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) print('sending second sms (unicode chars not in gsm aplhabet)...') msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') -esme.sms_send(msg) +esme.sms_send(msg, esme.MSGMODE_TRANSACTION) wait(ms.sms_was_received, msg) - -# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) -# wrong_msisdn = ms.msisdn + esme.msisdn -# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) -# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) +wrong_msisdn = ms.msisdn + esme.msisdn +print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_TRANSACTION) esme.disconnect() -- To view, visit https://gerrit.osmocom.org/3129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 20 16:56:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 20 Jul 2017 16:56:08 +0000 Subject: [MERGED] osmo-gsm-tester[master]: aoip_smpp: Disable check in esme_ms_sms_storeforward due to ... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: aoip_smpp: Disable check in esme_ms_sms_storeforward due to known issue ...................................................................... aoip_smpp: Disable check in esme_ms_sms_storeforward due to known issue A test case checked in that test is known to be failing at the moment due to missing correct implementation bits for AoIP software. Comment it in a separate commit so that is easy to revert it once we have it implemented. See OsmoSMSC #2354 for more information. Change-Id: I12f8dbe1d6dc9a554438fda1e38b2e5e3245c320 --- M suites/aoip_smpp/esme_ms_sms_storeforward.py 1 file changed, 7 insertions(+), 6 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 3e7e4f8..308ebf3 100755 --- a/suites/aoip_smpp/esme_ms_sms_storeforward.py +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -39,17 +39,18 @@ 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) -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) +# 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('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/3146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I12f8dbe1d6dc9a554438fda1e38b2e5e3245c320 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 20 16:56:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:56:25 +0000 Subject: osmo-msc[master]: SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I796e1f4281628061f4522c43c549de9e751bc045 Gerrit-PatchSet: 2 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 Thu Jul 20 16:56:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:56:50 +0000 Subject: osmo-msc[master]: osmo-nitb: change default db name to sms.db In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197 Gerrit-PatchSet: 2 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 Thu Jul 20 16:57:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:57:09 +0000 Subject: osmo-msc[master]: IuPS: explicitly check RAN type; move comment In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I054d72590dfb2012f6f8506d3a5f8fd2953194e1 Gerrit-PatchSet: 2 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 Thu Jul 20 16:57:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:57:32 +0000 Subject: osmo-msc[master]: IuPS: don't require an MM context for Iu Release In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3 Gerrit-PatchSet: 2 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 Thu Jul 20 16:57:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:57:48 +0000 Subject: osmo-msc[master]: SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd9ff4342de342475609bad0257a23c50290e23b Gerrit-PatchSet: 2 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 Thu Jul 20 16:58:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:58:46 +0000 Subject: osmo-gsm-manuals[master]: Makefile: Add check-deps target and run it by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b86aedd3bfccd7ac00343c16b9d25adc605808d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jul 20 16:58:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:58:47 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Makefile: Add check-deps target and run it by default In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Makefile: Add check-deps target and run it by default ...................................................................... Makefile: Add check-deps target and run it by default This target will do several quick tests to ensure all the required dependencies needed to build all documents are installed on the system. If a dependency is missing, we abort the build early. Otherwise we can end up building documents which some content missing. Change-Id: I9b86aedd3bfccd7ac00343c16b9d25adc605808d --- M Makefile 1 file changed, 20 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile b/Makefile index fc8ebbf..a870bef 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: +all: check-deps cd OsmoBTS; $(MAKE) cd OsmoNITB; $(MAKE) cd OsmoBSC; $(MAKE) @@ -38,3 +38,22 @@ #cd OsmoMGCP; $(MAKE) check #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check + +define check_dep_bin + @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } +endef +define check_dep_python2_module + @echo "import $(1)" | python2 - >/dev/null 2>&1 || { echo >&2 "Failed to import '$(1)' module, please install $(2)."; exit 1; } +endef + +check-deps: + $(call check_dep_bin,mscgen,mscgen) + $(call check_dep_bin,xsltproc,libxslt) + $(call check_dep_bin,git,git) + $(call check_dep_bin,a2x,asciidoc) + $(call check_dep_bin,asciidoc,asciidoc) + $(call check_dep_bin,dblatex,dblatex) + $(call check_dep_bin,packetdiag,nwdiag) + $(call check_dep_bin,dot,graphviz) + $(call check_dep_bin,python2,python2) + $(call check_dep_python2_module,pychart,python2-pychart) -- To view, visit https://gerrit.osmocom.org/3315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b86aedd3bfccd7ac00343c16b9d25adc605808d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 20 16:59:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:59:17 +0000 Subject: osmo-gsm-manuals[master]: update osmo-bts-virtual documentation, now that code is merged In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icd8706d29ca0e96cb89b7736dbb62f9ce159382d 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 Jul 20 16:59:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 16:59:19 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: update osmo-bts-virtual documentation, now that code is merged In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update osmo-bts-virtual documentation, now that code is merged ...................................................................... update osmo-bts-virtual documentation, now that code is merged Change-Id: Icd8706d29ca0e96cb89b7736dbb62f9ce159382d --- M OsmoBTS/chapters/bts-models.adoc 1 file changed, 41 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/chapters/bts-models.adoc b/OsmoBTS/chapters/bts-models.adoc index 40a86e2..5e51009 100644 --- a/OsmoBTS/chapters/bts-models.adoc +++ b/OsmoBTS/chapters/bts-models.adoc @@ -381,13 +381,32 @@ Rather than communicating over a wireless RF interface, the GSM Um messages are encapsulated over GSMTAP/UDP/IP. -At the time of writing, this functionality is not fully completed. It -is the idea to adopt the OsmocomBB MS-side GSM implementation to -interface with this virtual Um interface, so that many instances of -virtual MS can connect to some instances of OsmoBTS, testing MS, BTS, -BSC and core network functionality. +The Virtual Um interface (i.e. virtual radio layer) between OsmoBTS and +OsmocomBB allows us to run a complete GSM network with 1-N BTSs and 1-M +MSs without any actual radio hardware, which is of course excellent for +all kinds of testing scenarios. -=== `osmo-bts-trx` specific VTY commands +The Virtual Um layer is based on sending L2 frames (blocks) encapsulated +via GSMTAP UDP multicast packets. There are two separate multicast +groups, one for uplink and one for downlink. The multicast nature +simulates the shared medium and enables any simulated phone to receive +the signal from multiple BTSs via the downlink multicast group. + +In OsmoBTS, this is implemented via the `osmo-bts-virtual` BTS model. + +Setting up OsmoBTS in its `osmo-bts-virtual` flavor isn't really much +different from setting it up with real hardware. The amount of required +configuration at the BTS configuration file is (as always) very minimal, +as in the GSM network architecture provides almost all relevant +configuration to the BTS from the BSC. + +An example configuratin file is provided as part of the osmo-bts source +code: `doc/examples/virtual/osmobts-virtual.cfg` + +For more information see +http://osmocom.org/projects/cellular-infrastructure/wiki/Virtual_Um + +=== `osmo-bts-virtual` specific VTY commands For a auto-generated complete syntax reference of the VTY commands, please see the associated _OsmoBTS VTY reference manual_ @@ -401,12 +420,22 @@ Configure the network device used for sending/receiving the virtual Um interface messages (e.g. `eth0`). -===== `virtual-um udp-port <0-65535>` +===== `virtual-um ms-udp-port <0-65535>` -Configure the UDP port used for sending/receiving the virtual Um -interface messages (default: GSMTAP 2775). +Configure the UDP port used for sending virtual Um +downlink messages towards the MS (default: GSMTAP 4729). -===== `virtual-um multicast-group GROUP` +===== `virtual-um ms-multicast-group GROUP` -Configure the IP multicast group used for sending/receiving the virtual -Um interface messages. +Configure the IP multicast group used for sending virtual +Um downlink messages towards the MS (default: 239.193.23.1) + +===== `virtual-um bts-udp-port <0-65535>` + +Configure the UDP port used for receiving virtual Um +uplink messages from the MS (default: GSMTAP 4729). + +===== `virtual-um bts-multicast-group GROUP` + +Configure the IP multicast group used for receiving virtual +Um uplink messages from the MS (default: 239.193.23.2) -- To view, visit https://gerrit.osmocom.org/3304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icd8706d29ca0e96cb89b7736dbb62f9ce159382d Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 20 17:02:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 20 Jul 2017 17:02:37 +0000 Subject: openbsc[master]: sgsn: Convert cch_pdp to host order for libgtp In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3307/1/openbsc/src/gprs/sgsn_libgtp.c File openbsc/src/gprs/sgsn_libgtp.c: Line 240: memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), don't we have something like a "TLV as uint32_t in network byte order" rather than doing a memcpy followed by an in-place ntohs? Seems we only have it for msgb's as msgb_get_u16. But what about osmo_load16be(TLVP_VAL(...)) ? -- To view, visit https://gerrit.osmocom.org/3307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 20 17:28:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 17:28:15 +0000 Subject: [PATCH] osmo-msc[master]: fix make distcheck with python tests Message-ID: Review at https://gerrit.osmocom.org/3318 fix make distcheck with python tests - bscs.config needed by the vty tests was not picked up as a dist file, because its suffix is not 'cfg'. Rename it, also indicating its relation to the vty tests: bscs-for-vty-tests.cfg. Apply this rename in vty_test_runner.py. - Add CLEANFILES for restart counters. - Add contrib/ipa.py to EXTRA_DIST, hence add a Makefile.am to contrib/. Otherwise the python tests cannot find that dependency. Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 --- M Makefile.am M configure.ac D doc/examples/osmo-bsc_nat/bscs.config M doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg M tests/vty_test_runner.py 5 files changed, 8 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/18/3318/1 diff --git a/Makefile.am b/Makefile.am index 31a54ea..ab51194 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,7 @@ include \ src \ tests \ + contrib \ $(NULL) pkgconfigdir = $(libdir)/pkgconfig @@ -24,3 +25,7 @@ echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + +# The vty tests may create these restart counter files. 'make distcheck' needs +# them to be cleaned to succeed. +CLEANFILES = gsn_restart gtphub_restart_count diff --git a/configure.ac b/configure.ac index ff51ccf..adae598 100644 --- a/configure.ac +++ b/configure.ac @@ -263,4 +263,5 @@ tests/nanobts_omlattr/Makefile doc/Makefile doc/examples/Makefile + contrib/Makefile Makefile) diff --git a/doc/examples/osmo-bsc_nat/bscs.config b/doc/examples/osmo-bsc_nat/bscs.config deleted file mode 100644 index 176debe..0000000 --- a/doc/examples/osmo-bsc_nat/bscs.config +++ /dev/null @@ -1,13 +0,0 @@ -nat - bsc 0 - token lol - location_area_code 1234 - description bsc - max-endpoints 32 - paging forbidden 0 - bsc 1 - token wat - location_area_code 5678 - description bsc - max-endpoints 32 - paging forbidden 0 diff --git a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg index 6b48e97..efbb64d 100644 --- a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg +++ b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg @@ -62,5 +62,5 @@ timeout ping 20 timeout pong 5 ip-dscp 0 - bscs-config-file bscs.config + bscs-config-file bscs-for-vty-tests.cfg access-list bla imsi-allow ^11$ diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 92775d5..7d84e21 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -1220,7 +1220,7 @@ def nat_bsc_reload(x): x.vty.command("configure terminal") x.vty.command("nat") - x.vty.command("bscs-config-file bscs.config") + x.vty.command("bscs-config-file bscs-for-vty-tests.cfg") x.vty.command("end") def nat_msc_ip(x, ip, port): -- To view, visit https://gerrit.osmocom.org/3318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 17:28:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 17:28:15 +0000 Subject: [PATCH] osmo-msc[master]: jenkins: pass proper configure flags to make distcheck Message-ID: Review at https://gerrit.osmocom.org/3319 jenkins: pass proper configure flags to make distcheck Enable various components according to the build matrix during make distcheck. Add python tests, osmo-bsc, nat, ... Change-Id: Ic724cf61d44409337414dc58c8795896b4b97a8a --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/19/3319/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6650b5d..5903429 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -48,5 +48,7 @@ $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh -LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \ +LD_LIBRARY_PATH="$inst/lib" \ + DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic724cf61d44409337414dc58c8795896b4b97a8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 17:30:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 17:30:25 +0000 Subject: [ABANDON] osmo-msc[master]: jenkins: actually pass proper configure flags to make distcheck In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: jenkins: actually pass proper configure flags to make distcheck ...................................................................... Abandoned change id got modified accidentally. see now at Ic724cf61d44409337414dc58c8795896b4b97a8a https://gerrit.osmocom.org/3319 -- To view, visit https://gerrit.osmocom.org/3317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I8cf2baa60a2a1fa5ad1933b34080c18cd05ba1c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 20 17:32:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 17:32:20 +0000 Subject: osmo-msc[master]: fix make distcheck with python tests In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3318/1/Makefile.am File Makefile.am: Line 31: CLEANFILES = gsn_restart gtphub_restart_count hmm maybe this should rather go into some 'make check' target -- To view, visit https://gerrit.osmocom.org/3318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 20 17:38:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 17:38:18 +0000 Subject: [PATCH] osmo-msc[master]: fix make distcheck with python tests In-Reply-To: References: Message-ID: fix make distcheck with python tests - bscs.config needed by the vty tests was not picked up as a dist file, because its suffix is not 'cfg'. Rename it, also indicating its relation to the vty tests: bscs-for-vty-tests.cfg. Apply this rename in vty_test_runner.py. - Remove restart counters after external tests, otherwise distcheck complains about uncleaned files. - Add contrib/ipa.py to EXTRA_DIST, hence add a Makefile.am to contrib/. Otherwise the python tests cannot find that dependency. Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 --- M Makefile.am M configure.ac D doc/examples/osmo-bsc_nat/bscs.config M doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg M tests/Makefile.am M tests/vty_test_runner.py 6 files changed, 5 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/18/3318/2 diff --git a/Makefile.am b/Makefile.am index 31a54ea..4a1f65d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,7 @@ include \ src \ tests \ + contrib \ $(NULL) pkgconfigdir = $(libdir)/pkgconfig diff --git a/configure.ac b/configure.ac index ff51ccf..adae598 100644 --- a/configure.ac +++ b/configure.ac @@ -263,4 +263,5 @@ tests/nanobts_omlattr/Makefile doc/Makefile doc/examples/Makefile + contrib/Makefile Makefile) diff --git a/doc/examples/osmo-bsc_nat/bscs.config b/doc/examples/osmo-bsc_nat/bscs.config deleted file mode 100644 index 176debe..0000000 --- a/doc/examples/osmo-bsc_nat/bscs.config +++ /dev/null @@ -1,13 +0,0 @@ -nat - bsc 0 - token lol - location_area_code 1234 - description bsc - max-endpoints 32 - paging forbidden 0 - bsc 1 - token wat - location_area_code 5678 - description bsc - max-endpoints 32 - paging forbidden 0 diff --git a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg index 6b48e97..efbb64d 100644 --- a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg +++ b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg @@ -62,5 +62,5 @@ timeout ping 20 timeout pong 5 ip-dscp 0 - bscs-config-file bscs.config + bscs-config-file bscs-for-vty-tests.cfg access-list bla imsi-allow ^11$ diff --git a/tests/Makefile.am b/tests/Makefile.am index 9cbc1c1..72161ee 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -87,7 +87,7 @@ if BUILD_SMPP $(PYTHON) $(srcdir)/smpp_test_runner.py -w $(abs_top_builddir) -v endif - rm -f $(top_builddir)/hlr.sqlite3 + rm -f $(top_builddir)/hlr.sqlite3 $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 92775d5..7d84e21 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -1220,7 +1220,7 @@ def nat_bsc_reload(x): x.vty.command("configure terminal") x.vty.command("nat") - x.vty.command("bscs-config-file bscs.config") + x.vty.command("bscs-config-file bscs-for-vty-tests.cfg") x.vty.command("end") def nat_msc_ip(x, ip, port): -- To view, visit https://gerrit.osmocom.org/3318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 20 17:41:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 17:41:24 +0000 Subject: osmo-msc[master]: fix make distcheck with python tests In-Reply-To: References: Message-ID: Patch Set 2: argh, file additions missing. I should go home. -- To view, visit https://gerrit.osmocom.org/3318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 Gerrit-PatchSet: 2 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 Thu Jul 20 17:41:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 17:41:37 +0000 Subject: [PATCH] osmo-msc[master]: fix make distcheck with python tests In-Reply-To: References: Message-ID: fix make distcheck with python tests - bscs.config needed by the vty tests was not picked up as a dist file, because its suffix is not 'cfg'. Rename it, also indicating its relation to the vty tests: bscs-for-vty-tests.cfg. Apply this rename in vty_test_runner.py. - Remove restart counters after external tests, otherwise distcheck complains about uncleaned files. - Add contrib/ipa.py to EXTRA_DIST, hence add a Makefile.am to contrib/. Otherwise the python tests cannot find that dependency. Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 --- M Makefile.am M configure.ac A contrib/Makefile.am R doc/examples/osmo-bsc_nat/bscs-for-vty-tests.cfg M doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg M tests/Makefile.am M tests/vty_test_runner.py 7 files changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/18/3318/3 diff --git a/Makefile.am b/Makefile.am index 31a54ea..4a1f65d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,7 @@ include \ src \ tests \ + contrib \ $(NULL) pkgconfigdir = $(libdir)/pkgconfig diff --git a/configure.ac b/configure.ac index ff51ccf..adae598 100644 --- a/configure.ac +++ b/configure.ac @@ -263,4 +263,5 @@ tests/nanobts_omlattr/Makefile doc/Makefile doc/examples/Makefile + contrib/Makefile Makefile) diff --git a/contrib/Makefile.am b/contrib/Makefile.am new file mode 100644 index 0000000..db6d0f5 --- /dev/null +++ b/contrib/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = ipa.py diff --git a/doc/examples/osmo-bsc_nat/bscs.config b/doc/examples/osmo-bsc_nat/bscs-for-vty-tests.cfg similarity index 100% rename from doc/examples/osmo-bsc_nat/bscs.config rename to doc/examples/osmo-bsc_nat/bscs-for-vty-tests.cfg diff --git a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg index 6b48e97..efbb64d 100644 --- a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg +++ b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg @@ -62,5 +62,5 @@ timeout ping 20 timeout pong 5 ip-dscp 0 - bscs-config-file bscs.config + bscs-config-file bscs-for-vty-tests.cfg access-list bla imsi-allow ^11$ diff --git a/tests/Makefile.am b/tests/Makefile.am index 9cbc1c1..72161ee 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -87,7 +87,7 @@ if BUILD_SMPP $(PYTHON) $(srcdir)/smpp_test_runner.py -w $(abs_top_builddir) -v endif - rm -f $(top_builddir)/hlr.sqlite3 + rm -f $(top_builddir)/hlr.sqlite3 $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 92775d5..7d84e21 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -1220,7 +1220,7 @@ def nat_bsc_reload(x): x.vty.command("configure terminal") x.vty.command("nat") - x.vty.command("bscs-config-file bscs.config") + x.vty.command("bscs-config-file bscs-for-vty-tests.cfg") x.vty.command("end") def nat_msc_ip(x, ip, port): -- To view, visit https://gerrit.osmocom.org/3318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 Gerrit-PatchSet: 3 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 Thu Jul 20 17:43:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 17:43:44 +0000 Subject: osmo-msc[master]: fix make distcheck with python tests In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3318/3/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg File doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg: Line 65: bscs-config-file bscs-for-vty-tests.cfg maybe the name 'for-vty-tests' isn't fitting after all :/ -- To view, visit https://gerrit.osmocom.org/3318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 20 18:35:26 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 20 Jul 2017 18:35:26 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 20 18:35:38 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 20 Jul 2017 18:35:38 +0000 Subject: osmo-trx[master]: Remove redundant explicit dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd9cfc3673d828122edb85ba9de7ceb77f0299d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 20 18:36:01 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 20 Jul 2017 18:36:01 +0000 Subject: [MERGED] osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: Add '-t' command line option to enable SCHED_RR ...................................................................... Add '-t' command line option to enable SCHED_RR SCHED_RR allows us to operate osmo-trx reliable even under exceptionally high system load, as the realtime scheduler priority will have higher priority than the other "regular" tasks on the system. Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Closes: OS#2344 --- M Transceiver52M/osmo-trx.cpp 1 file changed, 29 insertions(+), 2 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Jenkins Builder: Verified Holger Freyther: Looks good to me, but someone else must approve diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 31a99cf..61b3098 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -77,6 +78,7 @@ double rssi_offset; bool swap_channels; bool edge; + int sched_rr; }; ConfigurationTable gConfig; @@ -259,7 +261,8 @@ " -r Random Normal Burst test mode with TSC\n" " -A Random Access Burst test mode with delay\n" " -R RSSI to dBm offset in dB (default=0)\n" - " -S Swap channels (UmTRX only)\n", + " -S Swap channels (UmTRX only)\n" + " -t SCHED_RR real-time priority (1..32)\n", "EMERG, ALERT, CRT, ERR, WARNING, NOTICE, INFO, DEBUG"); } @@ -283,8 +286,9 @@ config->rssi_offset = 0.0; config->swap_channels = false; config->edge = false; + config->sched_rr = -1; - while ((option = getopt(argc, argv, "ha:l:i:p:c:dmxgfo:s:b:r:A:R:Se")) != -1) { + while ((option = getopt(argc, argv, "ha:l:i:p:c:dmxgfo:s:b:r:A:R:Set:")) != -1) { switch (option) { case 'h': print_help(); @@ -343,6 +347,9 @@ case 'e': config->edge = true; break; + case 't': + config->sched_rr = atoi(optarg); + break; default: print_help(); exit(0); @@ -386,6 +393,21 @@ exit(0); } +static int set_sched_rr(int prio) +{ + struct sched_param param; + int rc; + memset(¶m, 0, sizeof(param)); + param.sched_priority = prio; + printf("Setting SCHED_RR priority(%d)\n", param.sched_priority); + rc = sched_setscheduler(getpid(), SCHED_RR, ¶m); + if (rc != 0) { + std::cerr << "Config: Setting SCHED_RR failed" << std::endl; + return -1; + } + return 0; +} + int main(int argc, char *argv[]) { int type, chans, ref; @@ -424,6 +446,11 @@ handle_options(argc, argv, &config); + if (config.sched_rr != -1) { + if (set_sched_rr(config.sched_rr) < 0) + return EXIT_FAILURE; + } + setup_signal_handlers(); /* Check database sanity */ -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Jul 20 18:36:11 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 20 Jul 2017 18:36:11 +0000 Subject: [MERGED] osmo-trx[master]: Remove redundant explicit dependency In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: Remove redundant explicit dependency ...................................................................... Remove redundant explicit dependency There's no need to explicitly mention library package because ${shlibs:Depends} will take care of it automatically. Change-Id: Ibd9cfc3673d828122edb85ba9de7ceb77f0299d0 --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified Holger Freyther: Looks good to me, but someone else must approve diff --git a/debian/control b/debian/control index 12da64a..b9ed72a 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ Package: osmo-trx Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libsqlite3-0 +Depends: ${shlibs:Depends}, ${misc:Depends} Description: SDR transceiver that implements Layer 1 of a GSM BTS OsmoTRX is a software-defined radio transceiver that implements the Layer 1 physical layer of a BTS comprising the following 3GPP specifications: -- To view, visit https://gerrit.osmocom.org/3163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibd9cfc3673d828122edb85ba9de7ceb77f0299d0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From admin at opensuse.org Thu Jul 20 19:54:16 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 20 Jul 2017 19:54:16 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59710a75daeb4_294212d6f9411127a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 215s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 215s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 215s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 215s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 215s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 215s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 215s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 215s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 215s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 215s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 215s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 215s] -Success [ 215s] ./testsuite.at:63: exit code was 132, expected 0 [ 215s] 10. testsuite.at:60: 10. coding (testsuite.at:60): FAILED (testsuite.at:63) [ 215s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 215s] make[1]: *** [override_dh_auto_test] Error 1 [ 215s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 215s] debian/rules:15: recipe for target 'build' failed [ 215s] make: *** [build] Error 2 [ 215s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 215s] [ 215s] build34 failed "build libosmocore_0.9.6.20170720.dsc" at Thu Jul 20 19:54:10 UTC 2017. [ 215s] [ 215s] ### VM INTERACTION START ### [ 218s] [ 201.060296] reboot: Power down [ 219s] ### VM INTERACTION END ### [ 219s] [ 219s] build34 failed "build libosmocore_0.9.6.20170720.dsc" at Thu Jul 20 19:54:14 UTC 2017. [ 219s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Thu Jul 20 20:37:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 20:37:38 +0000 Subject: [PATCH] osmo-msc[master]: IuPS: don't require an MM context for Iu Release 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/3311 to look at the new patch set (#5). IuPS: don't require an MM context for Iu Release Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3 --- M src/gprs/gprs_gmm.c 1 file changed, 13 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/3311/5 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index dfec604..83b1a70 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -180,25 +180,33 @@ int rc = -1; mm = sgsn_mm_ctx_by_ue_ctx(ctx); - if (!mm) { - LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event %i!\n", type); - return rc; + +#define REQUIRE_MM \ + if (!mm) { \ + LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event %d\n", type); \ + return rc; \ } switch (type) { case IU_EVENT_RAB_ASSIGN: + REQUIRE_MM rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; case IU_EVENT_IU_RELEASE: /* fall thru */ case IU_EVENT_LINK_INVALIDATED: /* Clean up ue_conn_ctx here */ - LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); - if (mm->pmm_state == PMM_CONNECTED) + if (mm) + LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); + else + LOGMMCTXP(LOGL_INFO, mm, "IU release for UE conn 0x%x\n", + ctx->conn_id); + if (mm && mm->pmm_state == PMM_CONNECTED) mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; case IU_EVENT_SECURITY_MODE_COMPLETE: + REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; rc = gsm48_gmm_authorize(mm); -- To view, visit https://gerrit.osmocom.org/3311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3 Gerrit-PatchSet: 5 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 Thu Jul 20 20:52:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 20 Jul 2017 20:52:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: esme: Fix race condition waiting for message response Message-ID: Review at https://gerrit.osmocom.org/3320 esme: Fix race condition waiting for message response Sometimes in test esme_ms_sms_transaction.py we get the following error: esme_ms_sms_transaction.py:54: ERR: ValueError: list.remove(x): x not in list This appears due to a race condition because sms_send is used several times, which means we don't wait or sync until we receive the response before calling sms_send_wait_resp. That means when we wait for response of message with seqnum X, we may receive response from message seqnum X-1 which was initiated by sms_send and thus was not stored in the self.pdus_pending array. As it's not there, trying to remove it triggers an exception. Change-Id: Idf49f40eb46be1448b328a5c338ddbc4547148ff --- M src/osmo_gsm_tester/esme.py 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/20/3320/1 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index ff403c0..89eaa39 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -165,7 +165,8 @@ def _process_pdus_pending(self, pdu, **kwargs): self.dbg('message sent resp with seq', pdu.sequence, ', pdus_pending:', self.pdus_pending) - self.pdus_pending.remove(pdu.sequence) + if pdu.sequence in self.pdus_pending: + self.pdus_pending.remove(pdu.sequence) def sms_send_wait_resp(self, sms_obj, mode, receipt=False): old_func = self.client.message_sent_handler -- To view, visit https://gerrit.osmocom.org/3320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf49f40eb46be1448b328a5c338ddbc4547148ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jul 20 21:57:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 21:57:34 +0000 Subject: [PATCH] osmo-msc[master]: Use libvlr in libmsc (large refactoring) 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/3195 to look at the new patch set (#7). Use libvlr in libmsc (large refactoring) Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Disable VTY and CTRL commands to create subscribers, which is now a task of the OsmoHLR. Adjust the python tests accordingly. Related: OS#1592 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 --- M configure.ac M include/openbsc/abis_rsl.h M include/openbsc/auth.h M include/openbsc/bsc_api.h M include/openbsc/chan_alloc.h M include/openbsc/db.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/gsm_subscriber.h M include/openbsc/osmo_msc.h M include/openbsc/signal.h M include/openbsc/silent_call.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/paging.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/meas_feed.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c M src/libmsc/token_auth.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr_access_req_fsm.c M src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/ctrl_test_runner.py M tests/db/db_test.c M tests/mm_auth/mm_auth_test.c M tests/mm_auth/mm_auth_test.ok A tests/sms_queue/Makefile.am A tests/sms_queue/sms_queue_test.c A tests/sms_queue/sms_queue_test.err A tests/sms_queue/sms_queue_test.ok M tests/subscr/Makefile.am D tests/subscr/subscr_test.c D tests/subscr/subscr_test.ok M tests/testsuite.at M tests/vty_test_runner.py 67 files changed, 2,174 insertions(+), 3,942 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3195/7 -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 7 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 Thu Jul 20 21:57:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 20 Jul 2017 21:57:50 +0000 Subject: [PATCH] osmo-msc[master]: cosmetic: make osmo-python-tests dependency more accurate Message-ID: Review at https://gerrit.osmocom.org/3321 cosmetic: make osmo-python-tests dependency more accurate Change-Id: I4f84a13b7fa6ec4173bdc155e6114d4d7328b619 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/21/3321/1 diff --git a/configure.ac b/configure.ac index 2dda6a1..d30105a 100644 --- a/configure.ac +++ b/configure.ac @@ -207,7 +207,7 @@ AM_PATH_PYTHON AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then - AC_MSG_ERROR([Please install osmocom-python to run the VTY/CTRL tests.]) + AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) fi fi AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) -- To view, visit https://gerrit.osmocom.org/3321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f84a13b7fa6ec4173bdc155e6114d4d7328b619 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jul 21 01:34:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 21 Jul 2017 01:34:37 +0000 Subject: [PATCH] osmo-msc[master]: osmo-nitb: change default db name to sms.db 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/3314 to look at the new patch set (#6). osmo-nitb: change default db name to sms.db libvlr now delegates subscriber management to osmo-hlr, so the database no longer represents a HLR. It basically only stores SMS, so reflect that fact in the default database name. Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197 --- M src/osmo-nitb/bsc_hack.c M tests/Makefile.am 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/14/3314/6 diff --git a/src/osmo-nitb/bsc_hack.c b/src/osmo-nitb/bsc_hack.c index ab118d3..9103116 100644 --- a/src/osmo-nitb/bsc_hack.c +++ b/src/osmo-nitb/bsc_hack.c @@ -58,7 +58,7 @@ /* MCC and MNC for the Location Area Identifier */ struct gsm_network *bsc_gsmnet = 0; -static const char *database_name = "hlr.sqlite3"; +static const char *database_name = "sms.db"; static const char *config_file = "openbsc.cfg"; static const char *rf_ctrl_path = NULL; extern const char *openbsc_copyright; diff --git a/tests/Makefile.am b/tests/Makefile.am index 8113787..3fe3ce0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -88,7 +88,7 @@ if BUILD_SMPP $(PYTHON) $(srcdir)/smpp_test_runner.py -w $(abs_top_builddir) -v endif - rm -f $(top_builddir)/hlr.sqlite3 $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count + rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" -- To view, visit https://gerrit.osmocom.org/3314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197 Gerrit-PatchSet: 6 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 Fri Jul 21 01:49:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 21 Jul 2017 01:49:13 +0000 Subject: [PATCH] osmo-msc[master]: fix make distcheck with python tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3318 to look at the new patch set (#4). fix make distcheck with python tests - bscs.config needed by the vty tests was not picked up as a dist file, because its suffix is not 'cfg'. Rename to *.cfg. Apply this rename in vty_test_runner.py and osmo-bsc_nat.cfg. - Remove restart counters after external tests, otherwise distcheck complains about uncleaned files. - Add contrib/ipa.py to EXTRA_DIST, hence add a Makefile.am to contrib/. Otherwise the python tests cannot find that dependency. Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 --- M Makefile.am M configure.ac A contrib/Makefile.am R doc/examples/osmo-bsc_nat/bscs.cfg M doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg M tests/Makefile.am M tests/vty_test_runner.py 7 files changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/18/3318/4 diff --git a/Makefile.am b/Makefile.am index 31a54ea..4a1f65d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,7 @@ include \ src \ tests \ + contrib \ $(NULL) pkgconfigdir = $(libdir)/pkgconfig diff --git a/configure.ac b/configure.ac index ff51ccf..adae598 100644 --- a/configure.ac +++ b/configure.ac @@ -263,4 +263,5 @@ tests/nanobts_omlattr/Makefile doc/Makefile doc/examples/Makefile + contrib/Makefile Makefile) diff --git a/contrib/Makefile.am b/contrib/Makefile.am new file mode 100644 index 0000000..db6d0f5 --- /dev/null +++ b/contrib/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = ipa.py diff --git a/doc/examples/osmo-bsc_nat/bscs.config b/doc/examples/osmo-bsc_nat/bscs.cfg similarity index 100% rename from doc/examples/osmo-bsc_nat/bscs.config rename to doc/examples/osmo-bsc_nat/bscs.cfg diff --git a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg index 6b48e97..e835e06 100644 --- a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg +++ b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg @@ -62,5 +62,5 @@ timeout ping 20 timeout pong 5 ip-dscp 0 - bscs-config-file bscs.config + bscs-config-file bscs.cfg access-list bla imsi-allow ^11$ diff --git a/tests/Makefile.am b/tests/Makefile.am index 9cbc1c1..72161ee 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -87,7 +87,7 @@ if BUILD_SMPP $(PYTHON) $(srcdir)/smpp_test_runner.py -w $(abs_top_builddir) -v endif - rm -f $(top_builddir)/hlr.sqlite3 + rm -f $(top_builddir)/hlr.sqlite3 $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 92775d5..68a697d 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -1220,7 +1220,7 @@ def nat_bsc_reload(x): x.vty.command("configure terminal") x.vty.command("nat") - x.vty.command("bscs-config-file bscs.config") + x.vty.command("bscs-config-file bscs.cfg") x.vty.command("end") def nat_msc_ip(x, ip, port): -- To view, visit https://gerrit.osmocom.org/3318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 Gerrit-PatchSet: 4 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 Fri Jul 21 01:52:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 21 Jul 2017 01:52:31 +0000 Subject: libosmo-sccp[master]: sccp: ensure addressbook entry names are unique In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 08:37:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 21 Jul 2017 08:37:57 +0000 Subject: osmo-gsm-tester[master]: esme: Fix race condition waiting for message response In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf49f40eb46be1448b328a5c338ddbc4547148ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 08:38:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 21 Jul 2017 08:38:40 +0000 Subject: osmo-gsm-tester[master]: esme: Fix race condition waiting for message response In-Reply-To: References: Message-ID: Patch Set 1: Tested in a loop. It's a small fix so I merge it with fast track. -- To view, visit https://gerrit.osmocom.org/3320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf49f40eb46be1448b328a5c338ddbc4547148ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 08:38:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 21 Jul 2017 08:38:48 +0000 Subject: [MERGED] osmo-gsm-tester[master]: esme: Fix race condition waiting for message response In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: esme: Fix race condition waiting for message response ...................................................................... esme: Fix race condition waiting for message response Sometimes in test esme_ms_sms_transaction.py we get the following error: esme_ms_sms_transaction.py:54: ERR: ValueError: list.remove(x): x not in list This appears due to a race condition because sms_send is used several times, which means we don't wait or sync until we receive the response before calling sms_send_wait_resp. That means when we wait for response of message with seqnum X, we may receive response from message seqnum X-1 which was initiated by sms_send and thus was not stored in the self.pdus_pending array. As it's not there, trying to remove it triggers an exception. Change-Id: Idf49f40eb46be1448b328a5c338ddbc4547148ff --- M src/osmo_gsm_tester/esme.py 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index ff403c0..89eaa39 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -165,7 +165,8 @@ def _process_pdus_pending(self, pdu, **kwargs): self.dbg('message sent resp with seq', pdu.sequence, ', pdus_pending:', self.pdus_pending) - self.pdus_pending.remove(pdu.sequence) + if pdu.sequence in self.pdus_pending: + self.pdus_pending.remove(pdu.sequence) def sms_send_wait_resp(self, sms_obj, mode, receipt=False): old_func = self.client.message_sent_handler -- To view, visit https://gerrit.osmocom.org/3320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf49f40eb46be1448b328a5c338ddbc4547148ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jul 21 10:07:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 10:07:15 +0000 Subject: [PATCH] osmo-pcap[master]: Rename osmo_pcap_{client_server} executables to osmo-pcap-{c... Message-ID: Review at https://gerrit.osmocom.org/3322 Rename osmo_pcap_{client_server} executables to osmo-pcap-{client,server} This naming is more in line with what all the other osmocom programs are doing (e.g. osmo-pcu, osmo-bts-sysmo, osmo-bsc, ...). We don't generally use osmo_ anywhere else, so I suggest to change it for more uniformity. Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 --- M src/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/22/3322/1 diff --git a/src/Makefile.am b/src/Makefile.am index 0532acf..17ed4e3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(PCAP_CFLAGS) $(LIBGNUTLS_CFLAGS) -bin_PROGRAMS = osmo_pcap_client osmo_pcap_server +bin_PROGRAMS = osmo-pcap-client osmo-pcap-server osmo_pcap_client_SOURCES = osmo_client_main.c osmo_common.c \ osmo_client_core.c osmo_client_vty.c \ -- To view, visit https://gerrit.osmocom.org/3322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 21 10:07:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 10:07:15 +0000 Subject: [PATCH] osmo-pcap[master]: Use TCP port numbers for VTY that don't overlap with other O... Message-ID: Review at https://gerrit.osmocom.org/3323 Use TCP port numbers for VTY that don't overlap with other Osmocom Software osmo-pcap historically was using port numbers that ware already used by OsmoPCU and OsmoBTS. This leads to problems when wanting to run related software together on one system. Let's break the historical assumptions and start with non-overlapping port numbers that are allocated/assigned from https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7 --- M include/osmo-pcap/common.h M osmoappdesc.py M src/osmo_client_main.c M src/osmo_server_main.c 4 files changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/23/3323/1 diff --git a/include/osmo-pcap/common.h b/include/osmo-pcap/common.h index 13c76e1..27fd514 100644 --- a/include/osmo-pcap/common.h +++ b/include/osmo-pcap/common.h @@ -28,6 +28,15 @@ #include #include #include +#include + +/* support old versions of libosmocore */ +#ifndef OSMO_VTY_PORT_PCAP_CLIENT +#define OSMO_VTY_PORT_PCAP_CLIENT 4237 +#endif +#ifndef OSMO_VTY_PORT_PCAP_SERVER +#define OSMO_VTY_PORT_PCAP_SERVER 4238 +#endif enum { DPCAP, diff --git a/osmoappdesc.py b/osmoappdesc.py index 39928eb..6f66702 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -20,8 +20,8 @@ } apps = [ - (4241, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), - (4240, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), + (4238, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), + (4237, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), ] vty_command = ["src/osmo_pcap_server", "-c", "contrib/osmo-pcap-server.cfg"] diff --git a/src/osmo_client_main.c b/src/osmo_client_main.c index 89d7e04..46a49b5 100644 --- a/src/osmo_client_main.c +++ b/src/osmo_client_main.c @@ -206,7 +206,7 @@ osmo_tls_init(); - rc = telnet_init(tall_bsc_ctx, NULL, 4240); + rc = telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_PCAP_CLIENT); if (rc < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n"); exit(1); diff --git a/src/osmo_server_main.c b/src/osmo_server_main.c index 37a9632..95f3ce1 100644 --- a/src/osmo_server_main.c +++ b/src/osmo_server_main.c @@ -219,7 +219,7 @@ osmo_tls_init(); - rc = telnet_init(tall_bsc_ctx, NULL, 4241); + rc = telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_PCAP_SERVER); if (rc < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n"); exit(1); -- To view, visit https://gerrit.osmocom.org/3323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 21 10:08:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 10:08:06 +0000 Subject: osmo-msc[master]: IuPS: don't require an MM context for Iu Release In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 10:08:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 10:08:38 +0000 Subject: osmo-msc[master]: osmo-nitb: change default db name to sms.db In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 10:12:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 10:12:15 +0000 Subject: osmo-msc[master]: Add libvlr implementation In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3194/8/src/libvlr/vlr_access_req_fsm.c File src/libvlr/vlr_access_req_fsm.c: Line 412: we're introducing a new whitespace issue. -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jul 21 10:19:15 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 10:19:15 +0000 Subject: osmo-pcap[master]: Rename osmo_pcap_{client_server} executables to osmo-pcap-{c... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 If you upgrade and test the debian package, we can do that. -- To view, visit https://gerrit.osmocom.org/3322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 11:11:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 11:11:30 +0000 Subject: [PATCH] osmo-pcap[master]: Rename osmo_pcap_{client_server} executables to osmo-pcap-{c... 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/3322 to look at the new patch set (#2). Rename osmo_pcap_{client_server} executables to osmo-pcap-{client,server} This naming is more in line with what all the other osmocom programs are doing (e.g. osmo-pcu, osmo-bts-sysmo, osmo-bsc, ...). We don't generally use osmo_ anywhere else, so I suggest to change it for more uniformity. Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 --- M debian/osmo-pcap-client.install M debian/osmo-pcap-server.install M src/Makefile.am 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/22/3322/2 diff --git a/debian/osmo-pcap-client.install b/debian/osmo-pcap-client.install index a1f9f59..f149b14 100644 --- a/debian/osmo-pcap-client.install +++ b/debian/osmo-pcap-client.install @@ -1 +1 @@ -usr/bin/osmo_pcap_client +usr/bin/osmo-pcap-client diff --git a/debian/osmo-pcap-server.install b/debian/osmo-pcap-server.install index 1157484..ad58c8e 100644 --- a/debian/osmo-pcap-server.install +++ b/debian/osmo-pcap-server.install @@ -1 +1 @@ -usr/bin/osmo_pcap_server +usr/bin/osmo-pcap-server diff --git a/src/Makefile.am b/src/Makefile.am index 0532acf..17ed4e3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(PCAP_CFLAGS) $(LIBGNUTLS_CFLAGS) -bin_PROGRAMS = osmo_pcap_client osmo_pcap_server +bin_PROGRAMS = osmo-pcap-client osmo-pcap-server osmo_pcap_client_SOURCES = osmo_client_main.c osmo_common.c \ osmo_client_core.c osmo_client_vty.c \ -- To view, visit https://gerrit.osmocom.org/3322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 21 11:11:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 11:11:31 +0000 Subject: [PATCH] osmo-pcap[master]: sock_src_init(): Don't freeaddrinfo() undefined src_result Message-ID: Review at https://gerrit.osmocom.org/3324 sock_src_init(): Don't freeaddrinfo() undefined src_result src_result is only valid "if (src)", so we cannot unconditionally free it: (gdb) bt host=0x52 , src=0x0) at /usr/src/debug/osmo-pcap/0.0.6+gitrAUTOINC+4776b2972e-r1d/git/src/osmo_client_network.c:165 Change-Id: I3b6778d9110583ecb1daec59ef2c86465d5818b9 --- M src/osmo_client_network.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/24/3324/1 diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index 937caa0..27c649a 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -162,7 +162,8 @@ close(sfd); } freeaddrinfo(result); - freeaddrinfo(src_result); + if (src) + freeaddrinfo(src_result); if (rp == NULL) { fprintf(stderr, "unable to connect/bind socket: %s:%u: %s\n", -- To view, visit https://gerrit.osmocom.org/3324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3b6778d9110583ecb1daec59ef2c86465d5818b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 21 11:35:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 21 Jul 2017 11:35:28 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: make simple client configurable via VTY 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/3303 to look at the new patch set (#2). sccp: make simple client configurable via VTY The osmo_sccp_simple_client_on_ss7_id and osmo_sccp_simple_client are not entirely configurable via VTY commands. Add additional logic that checks for a still existing, valid configuration. If no or an insufficient configuration is detected, assume use the caller supplied parameters as standard configuration. Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c M src/sccp_user.c 3 files changed, 153 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/3303/2 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 57a4e06..87ace4a 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -307,6 +307,8 @@ osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx); struct osmo_ss7_as * osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id); +struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, + enum osmo_ss7_asp_protocol proto); struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto); @@ -383,6 +385,9 @@ struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name); +struct osmo_ss7_asp +*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, + enum osmo_ss7_asp_protocol proto); struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index c13c588..eb5a4ef 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -833,6 +833,41 @@ return NULL; } +/*! \brief Find Application Server (AS) by given protocol. + * \param[in] inst SS7 Instance on which we operate + * \param[in] proto Protocol identifier that must match + * \returns pointer to AS on success; NULL otherwise + * If an AS has an ASP also matching the given protocol, that AS is preferred. + * If there are multiple matches, return the first matching AS. */ +struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, + enum osmo_ss7_asp_protocol proto) +{ + struct osmo_ss7_as *as; + struct osmo_ss7_as *as_without_asp = NULL; + + OSMO_ASSERT(ss7_initialized); + + /* Loop through the list with AS and try to find one where the proto + matches up */ + llist_for_each_entry(as, &inst->as_list, list) { + if (as->cfg.proto == proto) { + + /* Put down the first AS that matches the proto, just in + * case we will not find any matching ASP */ + if (!as_without_asp) + as_without_asp = as; + + /* Check if the candicate we have here has any suitable + * ASP */ + if (osmo_ss7_asp_find_by_proto(as, proto)) + return as; + } + } + + /* Return with the second best find, if there is any */ + return as_without_asp; +} + /*! \brief Find or Create Application Server * \param[in] inst SS7 Instance on which we operate * \param[in] name Name of Application Server @@ -1044,6 +1079,23 @@ return NULL; } +/*! \brief Find an ASP that matches the given protocol. + * \param[in] as Application Server in which to look for \ref asp + * \returns SS7 ASP in case a matching one is found; NULL otherwise */ +struct osmo_ss7_asp +*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, + enum osmo_ss7_asp_protocol proto) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { + if (as->cfg.asps[i] && as->cfg.asps[i]->cfg.proto == proto) + return as->cfg.asps[i]; + } + + return NULL; +} + struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, diff --git a/src/sccp_user.c b/src/sccp_user.c index b21a756..c9443a2 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -242,54 +242,113 @@ int remote_port, const char *remote_ip) { struct osmo_ss7_instance *ss7; + bool ss7_created = false; struct osmo_ss7_as *as; + bool as_created = false; struct osmo_ss7_route *rt; + bool rt_created = false; struct osmo_ss7_asp *asp; - char *as_name, *asp_name; + bool asp_created = false; + char *as_name, *asp_name = NULL; + /* Choose default ports when the caller does not supply valid port + * numbers. */ if (!remote_port || remote_port < 0) remote_port = osmo_ss7_asp_protocol_port(prot); if (local_port < 0) local_port = osmo_ss7_asp_protocol_port(prot); - /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); + /* Check if there is already an ss7 instance present under + * the given id. If not, we will create a new one. */ + ss7 = osmo_ss7_instance_find(ss7_id); if (!ss7) { - LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); - return NULL; + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SS7 instance\n", + name); + + /* Create a new ss7 instance */ + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); + if (!ss7) { + LOGP(DLSCCP, LOGL_ERROR, + "Failed to find or create SS7 instance\n"); + return NULL; + } + + /* Setup primary pointcode + * NOTE: This means that the user must set the pointcode to a + * proper value when a cs7 instance is defined via the VTY. */ + ss7->cfg.primary_pc = pc; + ss7_created = true; } - ss7->cfg.primary_pc = pc; + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, + ss7->cfg.id, osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc)); - as_name = talloc_asprintf(ctx, "as-clnt-%s", name); - asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); + /* There must not be an existing SCCP istance, regarless if the simple + * client has created the SS7 instance or if it was already present. + * An already existing SCCP instance would be an indication that this + * function has been called twice with the same SS7 instance, which + * must not be the case! */ + OSMO_ASSERT(ss7->sccp == NULL); - /* application server */ - as = osmo_ss7_as_find_or_create(ss7, as_name, prot); - if (!as) - goto out_strings; + /* Check if there is already an application server that matches + * the protocol we intend to use. If not, we will create one. */ + as = osmo_ss7_as_find_by_proto(ss7, prot); + if (!as) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating AS instance\n", + name); + as_name = talloc_asprintf(ctx, "as-clnt-%s", name); + as = osmo_ss7_as_find_or_create(ss7, as_name, prot); + talloc_free(as_name); + if (!as) + goto out_ss7; + as_created = true; - as->cfg.routing_key.pc = pc; + as->cfg.routing_key.pc = ss7->cfg.primary_pc; - /* install default route */ - rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, as_name); - if (!rt) - goto out_as; - talloc_free(as_name); + /* install default route */ + rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, + as->cfg.name); + if (!rt) + goto out_as; + rt_created = true; + } + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, + as->cfg.name); - /* application server process */ - asp = osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, local_port, - prot); - if (!asp) - goto out_rt; - asp->cfg.local.host = talloc_strdup(asp, local_ip); - asp->cfg.remote.host = talloc_strdup(asp, remote_ip); - osmo_ss7_as_add_asp(as, asp_name); + /* Check if we do already have an application server process + * that is associated with the application server we have choosen + * the application server process must also match the protocol + * we intend to use. */ + asp = osmo_ss7_asp_find_by_proto(as, prot); + if (!asp) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating ASP instance\n", + name); + asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); + asp = + osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, + local_port, prot); + talloc_free(asp_name); + if (!asp) + goto out_rt; + asp_created = true; + + asp->cfg.local.host = talloc_strdup(asp, local_ip); + asp->cfg.remote.host = talloc_strdup(asp, remote_ip); + + osmo_ss7_as_add_asp(as, asp->cfg.name); + } + + /* Ensure that the ASP we use is set to client mode. */ + asp->cfg.is_server = false; + + /* Restart ASP */ if (prot != OSMO_SS7_ASP_PROT_IPA) osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG); - talloc_free(asp_name); osmo_ss7_asp_restart(asp); + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using ASP instance %s\n", name, + asp->cfg.name); - /* Allocate SCCP stack + SCCP user */ + /* Allocate SCCP instance */ + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SCCP instance\n", name); ss7->sccp = osmo_sccp_instance_create(ss7, NULL); if (!ss7->sccp) goto out_asp; @@ -297,15 +356,17 @@ return ss7->sccp; out_asp: - osmo_ss7_asp_destroy(asp); + if (asp_created) + osmo_ss7_asp_destroy(asp); out_rt: - osmo_ss7_route_destroy(rt); + if (rt_created) + osmo_ss7_route_destroy(rt); out_as: - osmo_ss7_as_destroy(as); -out_strings: - talloc_free(as_name); - talloc_free(asp_name); - osmo_ss7_instance_destroy(ss7); + if (as_created) + osmo_ss7_as_destroy(as); +out_ss7: + if (ss7_created) + osmo_ss7_instance_destroy(ss7); return NULL; } -- To view, visit https://gerrit.osmocom.org/3303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jul 21 11:35:29 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 21 Jul 2017 11:35:29 +0000 Subject: [PATCH] libosmo-sccp[master]: xua: fix possible memory leak in seems osmo_ss7_asp_use_defa... Message-ID: Review at https://gerrit.osmocom.org/3325 xua: fix possible memory leak in seems osmo_ss7_asp_use_default_lm() The function seems osmo_ss7_asp_use_default_lm() does not guard against an asp->lm_priv FSM instance already existing. If this function is called a second time, it will overwrite asp->lm_priv, causing the original fsm instance to leaked. Check if asp->lm_priv already exists and terminate (free) the FSM if present. Change-Id: I4ad435c042a435c4e641c6e5c53b91265dd23d40 --- M src/xua_default_lm_fsm.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/25/3325/1 diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c index 9308de4..2a03cbc 100644 --- a/src/xua_default_lm_fsm.c +++ b/src/xua_default_lm_fsm.c @@ -366,6 +366,11 @@ struct lm_fsm_priv *lmp; struct osmo_fsm_inst *fi; + if (asp->lm_priv) { + osmo_fsm_inst_term(asp->lm_priv, OSMO_FSM_TERM_ERROR, NULL); + asp->lm_priv = NULL; + } + fi = osmo_fsm_inst_alloc(&xua_default_lm_fsm, asp, NULL, log_level, asp->cfg.name); lmp = talloc_zero(fi, struct lm_fsm_priv); -- To view, visit https://gerrit.osmocom.org/3325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ad435c042a435c4e641c6e5c53b91265dd23d40 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jul 21 11:38:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 21 Jul 2017 11:38:32 +0000 Subject: [PATCH] osmo-msc[master]: Use libvlr in libmsc (large refactoring) 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/3195 to look at the new patch set (#8). Use libvlr in libmsc (large refactoring) Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Disable VTY and CTRL commands to create subscribers, which is now a task of the OsmoHLR. Adjust the python tests accordingly. Related: OS#1592 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 --- M configure.ac M include/openbsc/abis_rsl.h M include/openbsc/auth.h M include/openbsc/bsc_api.h M include/openbsc/chan_alloc.h M include/openbsc/db.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/gsm_subscriber.h M include/openbsc/osmo_msc.h M include/openbsc/signal.h M include/openbsc/silent_call.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/paging.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/meas_feed.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c M src/libmsc/token_auth.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr_access_req_fsm.c M src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/ctrl_test_runner.py M tests/db/db_test.c M tests/mm_auth/mm_auth_test.c M tests/mm_auth/mm_auth_test.ok A tests/sms_queue/Makefile.am A tests/sms_queue/sms_queue_test.c A tests/sms_queue/sms_queue_test.err A tests/sms_queue/sms_queue_test.ok M tests/subscr/Makefile.am D tests/subscr/subscr_test.c D tests/subscr/subscr_test.ok M tests/testsuite.at M tests/vty_test_runner.py 67 files changed, 2,167 insertions(+), 3,942 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3195/8 -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 8 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 Fri Jul 21 11:51:58 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 11:51:58 +0000 Subject: osmo-pcap[master]: Rename osmo_pcap_{client_server} executables to osmo-pcap-{c... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 One more file to go. sorry. debian/osmo-pcap-client.init (at least DAEMON) -- To view, visit https://gerrit.osmocom.org/3322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 11:53:41 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 11:53:41 +0000 Subject: osmo-pcap[master]: Use TCP port numbers for VTY that don't overlap with other O... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Strictly speaking osmo-pcap was first and OsmoPCU and OsmoBTS used them besides they were already being used. ;) Anyway, I don't know any big consumers of the pcap-client VTY -- To view, visit https://gerrit.osmocom.org/3323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 11:54:01 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 21 Jul 2017 11:54:01 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: make simple client configurable via VTY 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/3303 to look at the new patch set (#3). sccp: make simple client configurable via VTY The osmo_sccp_simple_client_on_ss7_id and osmo_sccp_simple_client are not entirely configurable via VTY commands. The relation to the VTY is implicit. The user may set up instance objects via VTY (cs7/ss7, AS, ASP), which are then automatically created on startup. Each cs7 instance gets its own ID via the VTY configuration. When osmo_sccp_simple_client_on_ss7_id() is called with the cs7 instance id. (for osmo_sccp_simple_client() the ID will be hardcoded to 1), the function automatically checks if the CS7 instance is present, if not it will create one automatically using the caller supplied parameters as a defult. If a CS7 instance is present, the function checks for the presence of an AS and an ASP. These objects are present, they will be used. If not, new objects will be created. Both functions must not be called if an SCCP instance is already present. Since there can only be one SCCP instance per CS7 instance, this is an error condition. Add additional logic that checks to detect an already existing, valid configuration. If no or an insufficient configuration is detected, use the caller supplied parameters as default configuration. Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c M src/sccp_user.c 3 files changed, 153 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/3303/3 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 57a4e06..87ace4a 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -307,6 +307,8 @@ osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx); struct osmo_ss7_as * osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id); +struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, + enum osmo_ss7_asp_protocol proto); struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto); @@ -383,6 +385,9 @@ struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name); +struct osmo_ss7_asp +*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, + enum osmo_ss7_asp_protocol proto); struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index c13c588..eb5a4ef 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -833,6 +833,41 @@ return NULL; } +/*! \brief Find Application Server (AS) by given protocol. + * \param[in] inst SS7 Instance on which we operate + * \param[in] proto Protocol identifier that must match + * \returns pointer to AS on success; NULL otherwise + * If an AS has an ASP also matching the given protocol, that AS is preferred. + * If there are multiple matches, return the first matching AS. */ +struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, + enum osmo_ss7_asp_protocol proto) +{ + struct osmo_ss7_as *as; + struct osmo_ss7_as *as_without_asp = NULL; + + OSMO_ASSERT(ss7_initialized); + + /* Loop through the list with AS and try to find one where the proto + matches up */ + llist_for_each_entry(as, &inst->as_list, list) { + if (as->cfg.proto == proto) { + + /* Put down the first AS that matches the proto, just in + * case we will not find any matching ASP */ + if (!as_without_asp) + as_without_asp = as; + + /* Check if the candicate we have here has any suitable + * ASP */ + if (osmo_ss7_asp_find_by_proto(as, proto)) + return as; + } + } + + /* Return with the second best find, if there is any */ + return as_without_asp; +} + /*! \brief Find or Create Application Server * \param[in] inst SS7 Instance on which we operate * \param[in] name Name of Application Server @@ -1044,6 +1079,23 @@ return NULL; } +/*! \brief Find an ASP that matches the given protocol. + * \param[in] as Application Server in which to look for \ref asp + * \returns SS7 ASP in case a matching one is found; NULL otherwise */ +struct osmo_ss7_asp +*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, + enum osmo_ss7_asp_protocol proto) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { + if (as->cfg.asps[i] && as->cfg.asps[i]->cfg.proto == proto) + return as->cfg.asps[i]; + } + + return NULL; +} + struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, diff --git a/src/sccp_user.c b/src/sccp_user.c index b21a756..c9443a2 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -242,54 +242,113 @@ int remote_port, const char *remote_ip) { struct osmo_ss7_instance *ss7; + bool ss7_created = false; struct osmo_ss7_as *as; + bool as_created = false; struct osmo_ss7_route *rt; + bool rt_created = false; struct osmo_ss7_asp *asp; - char *as_name, *asp_name; + bool asp_created = false; + char *as_name, *asp_name = NULL; + /* Choose default ports when the caller does not supply valid port + * numbers. */ if (!remote_port || remote_port < 0) remote_port = osmo_ss7_asp_protocol_port(prot); if (local_port < 0) local_port = osmo_ss7_asp_protocol_port(prot); - /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); + /* Check if there is already an ss7 instance present under + * the given id. If not, we will create a new one. */ + ss7 = osmo_ss7_instance_find(ss7_id); if (!ss7) { - LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); - return NULL; + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SS7 instance\n", + name); + + /* Create a new ss7 instance */ + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); + if (!ss7) { + LOGP(DLSCCP, LOGL_ERROR, + "Failed to find or create SS7 instance\n"); + return NULL; + } + + /* Setup primary pointcode + * NOTE: This means that the user must set the pointcode to a + * proper value when a cs7 instance is defined via the VTY. */ + ss7->cfg.primary_pc = pc; + ss7_created = true; } - ss7->cfg.primary_pc = pc; + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, + ss7->cfg.id, osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc)); - as_name = talloc_asprintf(ctx, "as-clnt-%s", name); - asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); + /* There must not be an existing SCCP istance, regarless if the simple + * client has created the SS7 instance or if it was already present. + * An already existing SCCP instance would be an indication that this + * function has been called twice with the same SS7 instance, which + * must not be the case! */ + OSMO_ASSERT(ss7->sccp == NULL); - /* application server */ - as = osmo_ss7_as_find_or_create(ss7, as_name, prot); - if (!as) - goto out_strings; + /* Check if there is already an application server that matches + * the protocol we intend to use. If not, we will create one. */ + as = osmo_ss7_as_find_by_proto(ss7, prot); + if (!as) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating AS instance\n", + name); + as_name = talloc_asprintf(ctx, "as-clnt-%s", name); + as = osmo_ss7_as_find_or_create(ss7, as_name, prot); + talloc_free(as_name); + if (!as) + goto out_ss7; + as_created = true; - as->cfg.routing_key.pc = pc; + as->cfg.routing_key.pc = ss7->cfg.primary_pc; - /* install default route */ - rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, as_name); - if (!rt) - goto out_as; - talloc_free(as_name); + /* install default route */ + rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, + as->cfg.name); + if (!rt) + goto out_as; + rt_created = true; + } + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, + as->cfg.name); - /* application server process */ - asp = osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, local_port, - prot); - if (!asp) - goto out_rt; - asp->cfg.local.host = talloc_strdup(asp, local_ip); - asp->cfg.remote.host = talloc_strdup(asp, remote_ip); - osmo_ss7_as_add_asp(as, asp_name); + /* Check if we do already have an application server process + * that is associated with the application server we have choosen + * the application server process must also match the protocol + * we intend to use. */ + asp = osmo_ss7_asp_find_by_proto(as, prot); + if (!asp) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating ASP instance\n", + name); + asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); + asp = + osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, + local_port, prot); + talloc_free(asp_name); + if (!asp) + goto out_rt; + asp_created = true; + + asp->cfg.local.host = talloc_strdup(asp, local_ip); + asp->cfg.remote.host = talloc_strdup(asp, remote_ip); + + osmo_ss7_as_add_asp(as, asp->cfg.name); + } + + /* Ensure that the ASP we use is set to client mode. */ + asp->cfg.is_server = false; + + /* Restart ASP */ if (prot != OSMO_SS7_ASP_PROT_IPA) osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG); - talloc_free(asp_name); osmo_ss7_asp_restart(asp); + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using ASP instance %s\n", name, + asp->cfg.name); - /* Allocate SCCP stack + SCCP user */ + /* Allocate SCCP instance */ + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SCCP instance\n", name); ss7->sccp = osmo_sccp_instance_create(ss7, NULL); if (!ss7->sccp) goto out_asp; @@ -297,15 +356,17 @@ return ss7->sccp; out_asp: - osmo_ss7_asp_destroy(asp); + if (asp_created) + osmo_ss7_asp_destroy(asp); out_rt: - osmo_ss7_route_destroy(rt); + if (rt_created) + osmo_ss7_route_destroy(rt); out_as: - osmo_ss7_as_destroy(as); -out_strings: - talloc_free(as_name); - talloc_free(asp_name); - osmo_ss7_instance_destroy(ss7); + if (as_created) + osmo_ss7_as_destroy(as); +out_ss7: + if (ss7_created) + osmo_ss7_instance_destroy(ss7); return NULL; } -- To view, visit https://gerrit.osmocom.org/3303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jul 21 11:54:01 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 21 Jul 2017 11:54:01 +0000 Subject: [PATCH] libosmo-sccp[master]: xua: fix possible memory leak in seems osmo_ss7_asp_use_defa... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3325 to look at the new patch set (#2). xua: fix possible memory leak in seems osmo_ss7_asp_use_default_lm() The function seems osmo_ss7_asp_use_default_lm() does not guard against an asp->lm_priv FSM instance already existing. If this function is called a second time, it will overwrite asp->lm_priv, causing the original fsm instance to leaked. Check if asp->lm_priv already exists and terminate (free) the FSM if present. Change-Id: I4ad435c042a435c4e641c6e5c53b91265dd23d40 --- M src/xua_default_lm_fsm.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/25/3325/2 diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c index 9308de4..2a03cbc 100644 --- a/src/xua_default_lm_fsm.c +++ b/src/xua_default_lm_fsm.c @@ -366,6 +366,11 @@ struct lm_fsm_priv *lmp; struct osmo_fsm_inst *fi; + if (asp->lm_priv) { + osmo_fsm_inst_term(asp->lm_priv, OSMO_FSM_TERM_ERROR, NULL); + asp->lm_priv = NULL; + } + fi = osmo_fsm_inst_alloc(&xua_default_lm_fsm, asp, NULL, log_level, asp->cfg.name); lmp = talloc_zero(fi, struct lm_fsm_priv); -- To view, visit https://gerrit.osmocom.org/3325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4ad435c042a435c4e641c6e5c53b91265dd23d40 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 21 11:55:09 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 11:55:09 +0000 Subject: osmo-pcap[master]: sock_src_init(): Don't freeaddrinfo() undefined src_result In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/3324/1/src/osmo_client_network.c File src/osmo_client_network.c: Line 47: * Move to libosmocore... if the api makes source s/source/sense/ lol... Line 165: if (src) Why not src_result directly? -- To view, visit https://gerrit.osmocom.org/3324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3b6778d9110583ecb1daec59ef2c86465d5818b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jul 21 12:36:28 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 12:36:28 +0000 Subject: [PATCH] openbsc[master]: sgsn: Convert cch_pdp to host order for libgtp 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/3307 to look at the new patch set (#2). sgsn: Convert cch_pdp to host order for libgtp libgtp is calling gtpie_tv2 which will convert this uint16_t from host to network order. So far libosmogsm and the sgsn treated the charging characteristics as opaque data. So when moving from byte array to the uint16_t do the swapping. Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 2 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/07/3307/2 diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 90ac48a..387b95f 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -235,11 +235,8 @@ } /* charging characteristics if present */ - if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) { - OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); - memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), - TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); - } + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) >= sizeof(pdp->cch_pdp)) + pdp->cch_pdp = tlvp_val16be(tp, OSMO_IE_GSM_CHARG_CHAR); /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); -- To view, visit https://gerrit.osmocom.org/3307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 21 12:37:23 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 12:37:23 +0000 Subject: openbsc[master]: sgsn: Convert cch_pdp to host order for libgtp In-Reply-To: References: Message-ID: Patch Set 2: > (1 comment) Good point. It looks better and is more short now. Reason is that if TLVP_LEN is at least 16bit we can load it.. -- To view, visit https://gerrit.osmocom.org/3307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 12:39:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 21 Jul 2017 12:39:55 +0000 Subject: osmo-msc[master]: Use libvlr in libmsc (large refactoring) In-Reply-To: References: Message-ID: Patch Set 2: (5 comments) https://gerrit.osmocom.org/#/c/3195/2/include/openbsc/gsm_data.h File include/openbsc/gsm_data.h: Line 117: uint8_t classmark3[14]; > classmark3 length gets extended every so often when new 3GPP releases are c Indeed the code did not handle over-length well. Fixed in upcoming patch set. See osmo_msc.c: msc_classmark_chg() https://gerrit.osmocom.org/#/c/3195/2/include/openbsc/osmo_msc.h File include/openbsc/osmo_msc.h: Line 13: #define MSC_HLR_REMOTE_PORT_DEFAULT 2222 > we should probably go for a more 'reasonable' port number closer to the oth pending discussion and/or change in osmo-hlr https://gerrit.osmocom.org/#/c/3195/2/src/libbsc/bsc_vty.c File src/libbsc/bsc_vty.c: Line 840: TODO: add in libvlr? > a VLR by definition holds all of its state in volatile memory (i.e. RAM). S I interpret the keep-in-ram as "don't discard the subscriber info even when it is not needed anymore and would normally be cleaned out of the RAM (to possibly be retrieved from the HLR later)". The purpose I guess to be able to query its properties from the vty easily, like MSISDN or pending SMS, and set it as log context without fear of it getting removed... but yes, since we don't ever remove any subscr info yet, we can drop the comment now, and worry about non-deletion when there is a gc mechanism in the VLR (OS#1974). https://gerrit.osmocom.org/#/c/3195/2/src/libmsc/gsm_04_08.c File src/libmsc/gsm_04_08.c: Line 1112: lai.lac = 23; /* FIXME bts->location_area_code; */ > I'm really not sure we can simply use hard-coded location area information whoa, this is certainly a dev hack. Need to check how we *should* know the LAC. https://gerrit.osmocom.org/#/c/3195/2/src/libmsc/transaction.c File src/libmsc/transaction.c: Line 194: void trans_conn_closed(struct gsm_subscriber_connection *conn) > all other functions have received nice doxygen documentation, not this one? heh, since we don't even generate doxygen from openbsc.git / osmo-msc.git it's academic :) Also I notice those others lack the doxygen comment marker. Might as well keep them :) -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jul 21 13:15:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 13:15:54 +0000 Subject: openbsc[master]: sgsn: Convert cch_pdp to host order for libgtp In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 13:15:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 13:15:55 +0000 Subject: [MERGED] openbsc[master]: sgsn: Convert cch_pdp to host order for libgtp In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsn: Convert cch_pdp to host order for libgtp ...................................................................... sgsn: Convert cch_pdp to host order for libgtp libgtp is calling gtpie_tv2 which will convert this uint16_t from host to network order. So far libosmogsm and the sgsn treated the charging characteristics as opaque data. So when moving from byte array to the uint16_t do the swapping. Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 2 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 90ac48a..387b95f 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -235,11 +235,8 @@ } /* charging characteristics if present */ - if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) { - OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); - memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), - TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); - } + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) >= sizeof(pdp->cch_pdp)) + pdp->cch_pdp = tlvp_val16be(tp, OSMO_IE_GSM_CHARG_CHAR); /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); -- To view, visit https://gerrit.osmocom.org/3307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 21 13:17:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 13:17:44 +0000 Subject: osmo-pcap[master]: sock_src_init(): Don't freeaddrinfo() undefined src_result In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3324/1/src/osmo_client_network.c File src/osmo_client_network.c: Line 165: if (src) > Why not src_result directly? because it's not initialized with NULL, so we cannot check if it contains random chunk or valid data. Hence I used the same condition that you use before getaddrinfo(). -- To view, visit https://gerrit.osmocom.org/3324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3b6778d9110583ecb1daec59ef2c86465d5818b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jul 21 13:21:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 13:21:37 +0000 Subject: [PATCH] osmo-pcap[master]: Rename osmo_pcap_{client_server} executables to osmo-pcap-{c... 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/3322 to look at the new patch set (#3). Rename osmo_pcap_{client_server} executables to osmo-pcap-{client,server} This naming is more in line with what all the other osmocom programs are doing (e.g. osmo-pcu, osmo-bts-sysmo, osmo-bsc, ...). We don't generally use osmo_ anywhere else, so I suggest to change it for more uniformity. Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 --- M debian/osmo-pcap-client.init M debian/osmo-pcap-client.install M debian/osmo-pcap-server.install M osmoappdesc.py M src/Makefile.am 5 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/22/3322/3 diff --git a/debian/osmo-pcap-client.init b/debian/osmo-pcap-client.init index 29a51e6..6bfee7a 100755 --- a/debian/osmo-pcap-client.init +++ b/debian/osmo-pcap-client.init @@ -15,7 +15,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC=osmo-pcap-client # Introduce a short description here NAME=osmo-pcap-client # Introduce the short server's name here -DAEMON=/usr/bin/osmo_pcap_client # Introduce the server's location here +DAEMON=/usr/bin/osmo-pcap-client # Introduce the server's location here DAEMON_ARGS="-c /etc/osmo-pcap/osmo-pcap-client.cfg" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME diff --git a/debian/osmo-pcap-client.install b/debian/osmo-pcap-client.install index a1f9f59..f149b14 100644 --- a/debian/osmo-pcap-client.install +++ b/debian/osmo-pcap-client.install @@ -1 +1 @@ -usr/bin/osmo_pcap_client +usr/bin/osmo-pcap-client diff --git a/debian/osmo-pcap-server.install b/debian/osmo-pcap-server.install index 1157484..ad58c8e 100644 --- a/debian/osmo-pcap-server.install +++ b/debian/osmo-pcap-server.install @@ -1 +1 @@ -usr/bin/osmo_pcap_server +usr/bin/osmo-pcap-server diff --git a/osmoappdesc.py b/osmoappdesc.py index 6f66702..2be96db 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -20,11 +20,11 @@ } apps = [ - (4238, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), - (4237, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), + (4238, "src/osmo-pcap-server", "OsmoPCAPServer", "osmo-pcap-server"), + (4237, "src/osmo-pcap-client", "OsmoPCAPClient", "osmo-pcap-client"), ] -vty_command = ["src/osmo_pcap_server", "-c", "contrib/osmo-pcap-server.cfg"] +vty_command = ["src/osmo-pcap-server", "-c", "contrib/osmo-pcap-server.cfg"] vty_app = apps[0] diff --git a/src/Makefile.am b/src/Makefile.am index 0532acf..17ed4e3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(PCAP_CFLAGS) $(LIBGNUTLS_CFLAGS) -bin_PROGRAMS = osmo_pcap_client osmo_pcap_server +bin_PROGRAMS = osmo-pcap-client osmo-pcap-server osmo_pcap_client_SOURCES = osmo_client_main.c osmo_common.c \ osmo_client_core.c osmo_client_vty.c \ -- To view, visit https://gerrit.osmocom.org/3322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 21 13:21:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 13:21:37 +0000 Subject: [PATCH] osmo-pcap[master]: Use TCP port numbers for VTY that don't overlap with other O... 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/3323 to look at the new patch set (#3). Use TCP port numbers for VTY that don't overlap with other Osmocom Software osmo-pcap for historical reasons uses the same port numbers as OsmoPCU and OsmoBTS. This leads to problems when wanting to run related software together on one system. Let's break the historical assumptions and start with non-overlapping port numbers that are allocated/assigned from https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7 --- M include/osmo-pcap/common.h M osmoappdesc.py M src/osmo_client_main.c M src/osmo_server_main.c 4 files changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/23/3323/3 diff --git a/include/osmo-pcap/common.h b/include/osmo-pcap/common.h index 13c76e1..27fd514 100644 --- a/include/osmo-pcap/common.h +++ b/include/osmo-pcap/common.h @@ -28,6 +28,15 @@ #include #include #include +#include + +/* support old versions of libosmocore */ +#ifndef OSMO_VTY_PORT_PCAP_CLIENT +#define OSMO_VTY_PORT_PCAP_CLIENT 4237 +#endif +#ifndef OSMO_VTY_PORT_PCAP_SERVER +#define OSMO_VTY_PORT_PCAP_SERVER 4238 +#endif enum { DPCAP, diff --git a/osmoappdesc.py b/osmoappdesc.py index 39928eb..6f66702 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -20,8 +20,8 @@ } apps = [ - (4241, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), - (4240, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), + (4238, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), + (4237, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), ] vty_command = ["src/osmo_pcap_server", "-c", "contrib/osmo-pcap-server.cfg"] diff --git a/src/osmo_client_main.c b/src/osmo_client_main.c index 89d7e04..46a49b5 100644 --- a/src/osmo_client_main.c +++ b/src/osmo_client_main.c @@ -206,7 +206,7 @@ osmo_tls_init(); - rc = telnet_init(tall_bsc_ctx, NULL, 4240); + rc = telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_PCAP_CLIENT); if (rc < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n"); exit(1); diff --git a/src/osmo_server_main.c b/src/osmo_server_main.c index 37a9632..95f3ce1 100644 --- a/src/osmo_server_main.c +++ b/src/osmo_server_main.c @@ -219,7 +219,7 @@ osmo_tls_init(); - rc = telnet_init(tall_bsc_ctx, NULL, 4241); + rc = telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_PCAP_SERVER); if (rc < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n"); exit(1); -- To view, visit https://gerrit.osmocom.org/3323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 21 13:22:40 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 13:22:40 +0000 Subject: osmo-pcap[master]: Rename osmo_pcap_{client_server} executables to osmo-pcap-{c... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 13:23:25 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 13:23:25 +0000 Subject: osmo-pcap[master]: Use TCP port numbers for VTY that don't overlap with other O... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3323/3//COMMIT_MSG Commit Message: Line 9: osmo-pcap for historical reasons uses the same port numbers as That was not necessary but thank you. -- To view, visit https://gerrit.osmocom.org/3323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jul 21 13:24:47 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 13:24:47 +0000 Subject: osmo-pcap[master]: sock_src_init(): Don't freeaddrinfo() undefined src_result In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 > (1 comment) This explains the crash. Do you have a backtrace as well? It would be interesting to see why it is NULL. But very minor issue so let's not lose too much time here. -- To view, visit https://gerrit.osmocom.org/3324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3b6778d9110583ecb1daec59ef2c86465d5818b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 13:59:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 21 Jul 2017 13:59:36 +0000 Subject: [PATCH] libosmocore[master]: GSUP: define default GSUP port as 4222 Message-ID: Review at https://gerrit.osmocom.org/3326 GSUP: define default GSUP port as 4222 See also: https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers https://gerrit.osmocom.org/#/c/3195/2/include/openbsc/osmo_msc.h at 13 (change-id I639544a6cdda77a3aafc4e3446a55393f60e4050) Change-Id: I4222e21686c823985be8ff1f16b1182be8ad6175 --- M include/osmocom/gsm/gsup.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/3326/1 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 890bff3..36e5c84 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -27,6 +27,8 @@ #include #include +#define OSMO_GSUP_PORT 4222 + /*! Maximum nubmer of PDP inside \ref osmo_gsup_message */ #define OSMO_GSUP_MAX_NUM_PDP_INFO 10 /* GSM 09.02 limits this to 50 */ /*! Maximum number of auth info inside \ref osmo_gsup_message */ -- To view, visit https://gerrit.osmocom.org/3326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4222e21686c823985be8ff1f16b1182be8ad6175 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jul 21 14:26:29 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 14:26:29 +0000 Subject: [PATCH] osmo-pcap[refs/meta/config]: Edit Project Config In-Reply-To: References: Message-ID: Edit Project Config Change-Id: I343a8f967e7d07d543807f292e5be60af61a0c97 --- M project.config 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/28/3328/2 diff --git a/project.config b/project.config index ab43d3d..cebf266 100644 --- a/project.config +++ b/project.config @@ -3,5 +3,3 @@ [submit] action = rebase if necessary mergeContent = false -[notify "team"] - email = openbsc at lists.osmocom.org -- To view, visit https://gerrit.osmocom.org/3328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I343a8f967e7d07d543807f292e5be60af61a0c97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: refs/meta/config Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Fri Jul 21 14:26:33 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 14:26:33 +0000 Subject: [PATCH] osmo-pcap[refs/meta/config]: Edit Project Config Message-ID: Review at https://gerrit.osmocom.org/3328 Edit Project Config Change-Id: I343a8f967e7d07d543807f292e5be60af61a0c97 --- M project.config 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/28/3328/2 diff --git a/project.config b/project.config index ab43d3d..cebf266 100644 --- a/project.config +++ b/project.config @@ -3,5 +3,3 @@ [submit] action = rebase if necessary mergeContent = false -[notify "team"] - email = openbsc at lists.osmocom.org -- To view, visit https://gerrit.osmocom.org/3328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I343a8f967e7d07d543807f292e5be60af61a0c97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: refs/meta/config Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Fri Jul 21 14:26:35 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 14:26:35 +0000 Subject: osmo-pcap[refs/meta/config]: Edit Project Config In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I343a8f967e7d07d543807f292e5be60af61a0c97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: refs/meta/config Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 14:26:44 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 21 Jul 2017 14:26:44 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: drive local address from given sccp instance Message-ID: Review at https://gerrit.osmocom.org/3330 sccp: drive local address from given sccp instance The most important parts of an SCCP address are the routing indicator and the pointcode. The latter one is always available via the SS7 instance, so a basic local address can be derived from there. Add function osmo_sccp_local_addr_by_instance() to derive a basic local SCCP address from a given SCCP instance Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/30/3330/1 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 2258b0d..9cfdeb2 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -253,3 +253,6 @@ char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, const struct osmo_ss7_instance *ss7); + +void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, + const struct osmo_sccp_instance *inst); diff --git a/src/sccp_user.c b/src/sccp_user.c index c9443a2..d23cdef 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -22,6 +22,7 @@ */ #include +#include #include #include @@ -231,6 +232,26 @@ talloc_free(inst); } +/*! \brief derive a basic local SCCP-Address from a given SCCP instance. + * \param[out] dest_addr pointer to output address memory + * \param[in] inst SCCP instance */ +void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, + const struct osmo_sccp_instance *inst) +{ + struct osmo_ss7_instance *ss7; + + OSMO_ASSERT(dest_addr); + OSMO_ASSERT(inst); + ss7 = inst->ss7; + OSMO_ASSERT(ss7); + + memset(dest_addr, 0, sizeof(*dest_addr)); + + dest_addr->ri = OSMO_SCCP_RI_SSN_PC; + dest_addr->presence |= OSMO_SCCP_ADDR_T_PC; + dest_addr->pc = ss7->cfg.primary_pc; +} + /*********************************************************************** * Convenience function for CLIENT ***********************************************************************/ -- To view, visit https://gerrit.osmocom.org/3330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jul 21 14:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 14:28:08 +0000 Subject: osmo-pcap[refs/meta/config]: Edit Project Config In-Reply-To: References: Message-ID: Patch Set 2: Trying to figure out how to submit it.. -- To view, visit https://gerrit.osmocom.org/3328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I343a8f967e7d07d543807f292e5be60af61a0c97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: refs/meta/config Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 14:32:42 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 21 Jul 2017 14:32:42 +0000 Subject: [MERGED] osmo-pcap[refs/meta/config]: Edit Project Config In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: Edit Project Config ...................................................................... Edit Project Config Change-Id: I343a8f967e7d07d543807f292e5be60af61a0c97 --- M project.config 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Holger Freyther: Looks good to me, approved diff --git a/project.config b/project.config index ab43d3d..cebf266 100644 --- a/project.config +++ b/project.config @@ -3,5 +3,3 @@ [submit] action = rebase if necessary mergeContent = false -[notify "team"] - email = openbsc at lists.osmocom.org -- To view, visit https://gerrit.osmocom.org/3328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I343a8f967e7d07d543807f292e5be60af61a0c97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: refs/meta/config Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Fri Jul 21 14:33:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 14:33:03 +0000 Subject: libosmocore[master]: GSUP: define default GSUP port as 4222 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4222e21686c823985be8ff1f16b1182be8ad6175 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 Fri Jul 21 14:34:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 14:34:40 +0000 Subject: libosmo-sccp[master]: sccp: drive local address from given sccp instance In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Jul 21 14:35:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 14:35:14 +0000 Subject: libosmo-sccp[master]: xua: fix possible memory leak in seems osmo_ss7_asp_use_defa... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4ad435c042a435c4e641c6e5c53b91265dd23d40 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jul 21 14:36:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 14:36:13 +0000 Subject: libosmo-sccp[master]: sccp: make simple client configurable via VTY In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 21 14:53:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 14:53:56 +0000 Subject: [PATCH] libosmocore[master]: osmo_sock_init2(): Fix creation of non-bound sockets Message-ID: Review at https://gerrit.osmocom.org/3333 osmo_sock_init2(): Fix creation of non-bound sockets If osmo_sock_init2() was used with CONNECT flag but without BIND flag, an invalid check for "did we create a socket yet" caused the socket to never be created, and subsequently the entire function to return an error. Change-Id: I0206dbb9c5b8f74d7fb088576941b092acd2ca22 --- M src/socket.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/33/3333/1 diff --git a/src/socket.c b/src/socket.c index ca50b6f..457c991 100644 --- a/src/socket.c +++ b/src/socket.c @@ -239,7 +239,7 @@ rp->ai_protocol = proto; } - if (!sfd) { + if (sfd < 0) { sfd = socket_helper(rp, flags); if (sfd < 0) continue; -- To view, visit https://gerrit.osmocom.org/3333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0206dbb9c5b8f74d7fb088576941b092acd2ca22 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 21 15:15:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 21 Jul 2017 15:15:28 +0000 Subject: [PATCH] osmo-bts[master]: lc15bts-mgr: separate service file Message-ID: Review at https://gerrit.osmocom.org/3334 lc15bts-mgr: separate service file The sysmobts- and lc15bts- mgr have different semantics for the same command line option (-n: writing to EEPROM vs writing to ROM). and different default value. Hence it make sense to use separate files, similar to osmo-bts-*.service Change-Id: I645a81e30d7146ff26720391db763b6d585037e6 Related: SYS#3728 --- A contrib/lc15bts-mgr.service M contrib/sysmobts-mgr.service 2 files changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/34/3334/1 diff --git a/contrib/lc15bts-mgr.service b/contrib/lc15bts-mgr.service new file mode 100644 index 0000000..5790abe --- /dev/null +++ b/contrib/lc15bts-mgr.service @@ -0,0 +1,12 @@ +[Unit] +Description=osmo-bts manager for LC15 / sysmoBTS 2100 + +[Service] +Type=simple +ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg +Restart=always +RestartSec=2 + +[Install] +WantedBy=multi-user.target +Alias=osmo-bts-mgr.service diff --git a/contrib/sysmobts-mgr.service b/contrib/sysmobts-mgr.service index 151c821..4346991 100644 --- a/contrib/sysmobts-mgr.service +++ b/contrib/sysmobts-mgr.service @@ -1,9 +1,9 @@ [Unit] -Description=osmo-bts manager for %p +Description=osmo-bts manager for sysmoBTS [Service] Type=simple -ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/%p.cfg +ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/sysmobts-mgr.cfg Restart=always RestartSec=2 -- To view, visit https://gerrit.osmocom.org/3334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I645a81e30d7146ff26720391db763b6d585037e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jul 21 15:25:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 21 Jul 2017 15:25:25 +0000 Subject: [PATCH] osmo-bts[master]: lc15: port lc15bts-mgr dependency changes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3316 to look at the new patch set (#2). lc15: port lc15bts-mgr dependency changes That's mostly changes related to lc15bts-mgr from https://gitlab.com/nrw_noa/osmo-bts branch nrw/litecell15 based on eb5b7f80510b603579f7af6d7d5ead296c2fa260 commit: * adjust comments to simplify further diffs * add libsystemd dependency to lc15bts-mgr * add software watchdog which uses it * ocxo calibration and gps related code Change-Id: I475a330af771891ba3c897294ce0dd57ec2ba8db Related: SYS#3732 --- M configure.ac M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/calib_file.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c A src/osmo-bts-litecell15/misc/lc15bts_swd.c A src/osmo-bts-litecell15/misc/lc15bts_swd.h 8 files changed, 327 insertions(+), 85 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/16/3316/2 diff --git a/configure.ac b/configure.ac index 0ceb8eb..bc36456 100644 --- a/configure.ac +++ b/configure.ac @@ -143,6 +143,7 @@ AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], [#include ]) + PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd) CPPFLAGS=$oldCPPFLAGS fi diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 90e6c46..78a770a 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,14 +1,14 @@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(LITECELL15_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +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) AM_CFLAGS += -DENABLE_LC15BTS EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h misc/lc15bts_led.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ - misc/lc15bts_bid.h misc/lc15bts_nl.h misc/lc15bts_bts.h \ + misc/lc15bts_bid.h misc/lc15bts_nl.h misc/lc15bts_bts.h misc/lc15bts_swd.h \ hw_misc.h l1_if.h l1_transp.h lc15bts.h oml_router.h utils.h bin_PROGRAMS = osmo-bts-lc15 lc15bts-mgr lc15bts-util @@ -29,9 +29,10 @@ misc/lc15bts_mgr_temp.c \ misc/lc15bts_mgr_calib.c \ misc/lc15bts_led.c \ - misc/lc15bts_bts.c + misc/lc15bts_bts.c \ + misc/lc15bts_swd.c -lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(COMMON_LDADD) +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBSYSTEMD_LIBS) $(COMMON_LDADD) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index ac39e46..b7049df 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -42,10 +42,9 @@ #include "lc15bts.h" #include "utils.h" -/** - * * Maximum calibration data chunk size - * */ +/* Maximum calibration data chunk size */ #define MAX_CALIB_TBL_SIZE 65536 +/* Calibration header version */ #define CALIB_HDR_V1 0x01 struct calib_file_desc { @@ -93,19 +92,19 @@ { struct { - uint8_t u8Version; // Header version (1) - uint8_t u8Parity; // Parity byte (xor) - uint8_t u8Type; // Table type (0:TX Downlink, 1:RX-A Uplink, 2:RX-B Uplink) - uint8_t u8Band; // GSM Band (0:GSM-850, 1:EGSM-900, 2:DCS-1800, 3:PCS-1900) - uint32_t u32Len; // Table length in bytes including the header + uint8_t u8Version; /* Header version (1) */ + uint8_t u8Parity; /* Parity byte (xor) */ + uint8_t u8Type; /* Table type (0:TX Downlink, 1:RX-A Uplink, 2:RX-B Uplink) */ + uint8_t u8Band; /* GSM Band (0:GSM-850, 1:EGSM-900, 2:DCS-1800, 3:PCS-1900) */ + uint32_t u32Len; /* Table length in bytes including the header */ struct { - uint32_t u32DescOfst; // Description section offset - uint32_t u32DateOfst; // Date section offset - uint32_t u32StationOfst; // Calibration test station section offset - uint32_t u32FpgaFwVerOfst; // Calibration FPGA firmware version section offset - uint32_t u32DspFwVerOfst; // Calibration DSP firmware section offset - uint32_t u32DataOfst; // Calibration data section offset + uint32_t u32DescOfst; /* Description section offset */ + uint32_t u32DateOfst; /* Date section offset */ + uint32_t u32StationOfst; /* Calibration test station section offset */ + uint32_t u32FpgaFwVerOfst; /* Calibration FPGA firmware version section offset */ + uint32_t u32DspFwVerOfst; /* Calibration DSP firmware section offset */ + uint32_t u32DataOfst; /* Calibration data section offset */ } toc; } v1; } hdr; @@ -314,15 +313,14 @@ struct calTbl_t *calTbl; char calChkSum ; - - //calculate file size in bytes + /* calculate file size in bytes */ fseek(st->fp, 0L, SEEK_END); sz = ftell(st->fp); - //rewind read poiner + /* rewind read poiner */ fseek(st->fp, 0L, SEEK_SET); - //read file + /* read file */ rbuf = (char *) malloc( sizeof(char) * sz ); rc = fread(rbuf, 1, sizeof(char) * sz, st->fp); @@ -331,7 +329,7 @@ LOGP(DL1C, LOGL_ERROR, "%s reading error\n", desc->fname); free(rbuf); - //close file + /* close file */ rc = calib_file_close(fl1h); if (rc < 0 ) { LOGP(DL1C, LOGL_ERROR, "%s can not close\n", desc->fname); @@ -341,33 +339,32 @@ return -2; } - calTbl = (struct calTbl_t*) rbuf; - //calcualte file checksum + /* calculate file checksum */ calChkSum = 0; while ( sz-- ) { calChkSum ^= rbuf[sz]; } - //validate Tx calibration parity + /* validate Tx calibration parity */ if ( calChkSum ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid checksum %x.\n", desc->fname, calChkSum); return -4; } - //validate Tx calibration header + /* validate Tx calibration header */ if ( calTbl->hdr.v1.u8Version != CALIB_HDR_V1 ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid header version %u.\n", desc->fname, calTbl->hdr.v1.u8Version); return -5; } - //validate calibration description + /* validate calibration description */ if ( calTbl->hdr.v1.toc.u32DescOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration description offset.\n", desc->fname); return -6; } - //validate calibration date + /* validate calibration date */ if ( calTbl->hdr.v1.toc.u32DateOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration date offset.\n", desc->fname); return -7; @@ -377,24 +374,25 @@ desc->fname, calTbl->u8RawData + calTbl->hdr.v1.toc.u32DateOfst); - //validate calibration station + /* validate calibration station */ if ( calTbl->hdr.v1.toc.u32StationOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration station ID offset.\n", desc->fname); return -8; } - //validate FPGA FW version + /* validate FPGA FW version */ if ( calTbl->hdr.v1.toc.u32FpgaFwVerOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid FPGA FW version offset.\n", desc->fname); return -9; } - //validate DSP FW version + + /* validate DSP FW version */ if ( calTbl->hdr.v1.toc.u32DspFwVerOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid DSP FW version offset.\n", desc->fname); return -10; } - //validate Tx calibration data offset + /* validate Tx calibration data offset */ if ( calTbl->hdr.v1.toc.u32DataOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration data offset.\n", desc->fname); return -11; @@ -402,11 +400,11 @@ if ( !desc->rx ) { - //parse min/max Tx power + /* parse min/max Tx power */ fl1h->phy_inst->u.lc15.minTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (5 << 2)]; fl1h->phy_inst->u.lc15.maxTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (6 << 2)]; - //override nominal Tx power of given TRX if needed + /* override nominal Tx power of given TRX if needed */ if ( fl1h->phy_inst->trx->nominal_power > fl1h->phy_inst->u.lc15.maxTxPower) { LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", plink->num, @@ -449,7 +447,7 @@ fl1h->phy_inst->u.lc15.maxTxPower ); } - //rewind read poiner for subsequence tasks + /* rewind read pointer for subsequence tasks */ fseek(st->fp, 0L, SEEK_SET); free(rbuf); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index 51a05f9..cec9a82 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -46,6 +46,8 @@ #include "misc/lc15bts_par.h" #include "misc/lc15bts_bid.h" #include "misc/lc15bts_power.h" +#include "misc/lc15bts_swd.h" + #include "lc15bts_led.h" static int no_rom_write = 0; @@ -163,6 +165,7 @@ lc15bts_check_vswr(no_rom_write); osmo_timer_schedule(&sensor_timer, SENSOR_TIMER_SECS, 0); /* TODO checks if lc15bts_check_temp/lc15bts_check_power/lc15bts_check_vswr went ok */ + lc15bts_swd_event(&manager, SWD_CHECK_SENSOR); } static struct osmo_timer_list hours_timer; @@ -172,6 +175,7 @@ osmo_timer_schedule(&hours_timer, HOURS_TIMER_SECS, 0); /* TODO: validates if lc15bts_update_hours went correctly */ + lc15bts_swd_event(&manager, SWD_UPDATE_HOURS); } static void print_help(void) @@ -317,6 +321,10 @@ INIT_LLIST_HEAD(&manager.lc15bts_leds.list); INIT_LLIST_HEAD(&manager.alarms.list); + /* Initialize the service watchdog notification for SWD_LAST event(s) */ + if (lc15bts_swd_init(&manager, (int)(SWD_LAST)) != 0) + exit(3); + /* start temperature check timer */ sensor_timer.cb = check_sensor_timer_cb; check_sensor_timer_cb(NULL); @@ -357,5 +365,6 @@ while (1) { log_reset_context(); osmo_select_main(0); + lc15bts_swd_event(&manager, SWD_MAINLOOP); } } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c index fb49477..badb545 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c @@ -27,6 +27,9 @@ #include "misc/lc15bts_mgr.h" #include "misc/lc15bts_misc.h" #include "misc/lc15bts_clock.h" +#include "misc/lc15bts_swd.h" +#include "misc/lc15bts_par.h" +#include "misc/lc15bts_led.h" #include "osmo-bts/msg_utils.h" #include @@ -41,9 +44,13 @@ #include #include +#include + static void calib_adjust(struct lc15bts_mgr_instance *mgr); static void calib_state_reset(struct lc15bts_mgr_instance *mgr, int reason); static void calib_loop_run(void *_data); + +static int ocxodac_saved_value = -1; enum calib_state { CALIB_INITIAL, @@ -88,7 +95,9 @@ int interval_sec; int dac_value; int new_dac_value; - double dac_correction; + int dac_correction; + time_t now; + time_t last_gps_fix; rc = lc15bts_clock_err_get(&fault, &error_ppt, &accuracy_ppq, &interval_sec); @@ -99,11 +108,31 @@ return; } + /* get current time */ + now = time(NULL); + + /* first time after start of manager program */ + if (mgr->gps.last_update == 0) + mgr->gps.last_update = now; + + /* read last GPS 3D fix from storage */ + rc = lc15bts_par_get_gps_fix(&last_gps_fix); + if (rc < 0) { + LOGP(DCALIB, LOGL_NOTICE, "Last GPS 3D fix can not read (%d). Last GPS 3D fix sets to zero\n", rc); + last_gps_fix = 0; + } + if (fault) { LOGP(DCALIB, LOGL_NOTICE, "GPS has no fix\n"); calib_state_reset(mgr, CALIB_FAIL_GPSFIX); return; } + + /* We got GPS 3D fix */ + LOGP(DCALIB, LOGL_DEBUG, "Got GPS 3D fix warn_flags=0x%08x, last=%lld, now=%lld\n", + mgr->lc15bts_ctrl.warn_flags, + (long long)last_gps_fix, + (long long)now); rc = lc15bts_clock_dac_get(&dac_value); if (rc < 0) { @@ -113,60 +142,74 @@ return; } + /* Set OCXO initial dac value */ + if (ocxodac_saved_value < 0) + ocxodac_saved_value = dac_value; + LOGP(DCALIB, LOGL_NOTICE, "Calibration ERR(%f PPB) ACC(%f PPB) INT(%d) DAC(%d)\n", error_ppt / 1000., accuracy_ppq / 1000000., interval_sec, dac_value); - /* 1 unit of correction equal about 0.5 - 1 PPB correction */ - dac_correction = (int)(-error_ppt * 0.00056); - new_dac_value = dac_value + dac_correction + 0.5; - - /* We have a fix, make sure the measured error is - meaningful (10 times the accuracy) */ - if ((new_dac_value != dac_value) && ((100l * abs(error_ppt)) > accuracy_ppq)) { - + /* Need integration time to correct */ + if (interval_sec) { + /* 1 unit of correction equal about 0.5 - 1 PPB correction */ + dac_correction = (int)(-error_ppt * 0.0015); + new_dac_value = dac_value + dac_correction; + if (new_dac_value > 4095) - dac_value = 4095; + new_dac_value = 4095; else if (new_dac_value < 0) - dac_value = 0; - else - dac_value = new_dac_value; - - LOGP(DCALIB, LOGL_NOTICE, - "Going to apply %d as new clock setting.\n", - dac_value); - - rc = lc15bts_clock_dac_set(dac_value); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to set OCXO dac value %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_OCXODAC); - return; - } - rc = lc15bts_clock_err_reset(); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to set reset clock error module %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_CLKERR); - return; - } - } + new_dac_value = 0; - /* Save the correction value in the DAC eeprom if the - frequency has been stable for 24 hours */ - else if (interval_sec >= (24 * 60 * 60)) { - rc = lc15bts_clock_dac_save(); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to save OCXO dac value %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_OCXODAC); + /* We have a fix, make sure the measured error is + meaningful (10 times the accuracy) */ + if ((new_dac_value != dac_value) && ((100l * abs(error_ppt)) > accuracy_ppq)) { + + LOGP(DCALIB, LOGL_NOTICE, + "Going to apply %d as new clock setting.\n", + new_dac_value); + + rc = lc15bts_clock_dac_set(new_dac_value); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to set OCXO dac value %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_OCXODAC); + return; + } + rc = lc15bts_clock_err_reset(); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to reset clock error module %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_CLKERR); + return; + } } - rc = lc15bts_clock_err_reset(); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to set reste clock error module %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_CLKERR); + /* New conditions to store DAC value: + * - Resolution accuracy less or equal than 0.01PPB (or 10000 PPQ) + * - Error less or equal than 2PPB (or 2000PPT) + * - Solution different than the last one */ + else if (accuracy_ppq <= 10000) { + if((dac_value != ocxodac_saved_value) && (abs(error_ppt) < 2000)) { + LOGP(DCALIB, LOGL_NOTICE, "Saving OCXO DAC value to memory... val = %d\n", dac_value); + rc = lc15bts_clock_dac_save(); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to save OCXO dac value %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_OCXODAC); + } else { + ocxodac_saved_value = dac_value; + } + } + + rc = lc15bts_clock_err_reset(); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to reset clock error module %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_CLKERR); + } } + } else { + LOGP(DCALIB, LOGL_NOTICE, "Skipping this iteration, no integration time\n"); } calib_state_reset(mgr, CALIB_SUCCESS); @@ -197,6 +240,8 @@ mgr->calib.calib_timeout.data = mgr; mgr->calib.calib_timeout.cb = calib_loop_run; osmo_timer_schedule(&mgr->calib.calib_timeout, timeout, 0); + /* TODO: do we want to notify if we got a calibration error, like no gps fix? */ + lc15bts_swd_event(mgr, SWD_CHECK_CALIB); } mgr->calib.state = CALIB_INITIAL; @@ -241,6 +286,7 @@ mgr->calib.calib_timeout.data = mgr; mgr->calib.calib_timeout.cb = calib_loop_run; osmo_timer_schedule(&mgr->calib.calib_timeout, 0, 0); - return 0; + + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 9d2dfec..9665e1d 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -28,6 +28,7 @@ #include "misc/lc15bts_temp.h" #include "misc/lc15bts_power.h" #include "misc/lc15bts_led.h" +#include "misc/lc15bts_swd.h" #include "limits.h" #include @@ -116,7 +117,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl start lc15bts.service"); + system("/bin/systemctl start osmo-bts.service"); } } @@ -151,7 +152,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl stop lc15bts.service"); + system("/bin/systemctl stop osmo-bts.service"); } } @@ -364,6 +365,7 @@ osmo_timer_schedule(&sensor_ctrl_timer, LC15BTS_SENSOR_TIMER_DURATION, 0); LOGP(DTEMP, LOGL_DEBUG,"Check sensors timer expired\n"); /* TODO: do we want to notify if some sensors could not be read? */ + lc15bts_swd_event(mgr, SWD_CHECK_TEMP_SENSOR); } int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr) diff --git a/src/osmo-bts-litecell15/misc/lc15bts_swd.c b/src/osmo-bts-litecell15/misc/lc15bts_swd.c new file mode 100644 index 0000000..59c7b61 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_swd.c @@ -0,0 +1,178 @@ +/* Systemd service wd notification for Litecell 1.5 BTS management daemon */ + +/* Copyright (C) 2015 by Yves Godin + * + * 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 "misc/lc15bts_mgr.h" +#include "misc/lc15bts_swd.h" +#include + +/* Needed for service watchdog notification */ +#include + +/* This is the period used to verify if all events have been registered to be allowed + to notify the systemd service watchdog +*/ +#define SWD_PERIOD 30 + +static void swd_start(struct lc15bts_mgr_instance *mgr); +static void swd_process(struct lc15bts_mgr_instance *mgr); +static void swd_close(struct lc15bts_mgr_instance *mgr); +static void swd_state_reset(struct lc15bts_mgr_instance *mgr, int reason); +static int swd_run(struct lc15bts_mgr_instance *mgr, int from_loop); +static void swd_loop_run(void *_data); + +enum swd_state { + SWD_INITIAL, + SWD_IN_PROGRESS, +}; + +enum swd_result { + SWD_FAIL_START, + SWD_FAIL_NOTIFY, + SWD_SUCCESS, +}; + +static void swd_start(struct lc15bts_mgr_instance *mgr) +{ + swd_process(mgr); +} + +static void swd_process(struct lc15bts_mgr_instance *mgr) +{ + int rc = 0, notify = 0; + + /* Did we get all needed conditions ? */ + if (mgr->swd.swd_eventmasks == mgr->swd.swd_events) { + /* Ping systemd service wd if enabled */ + rc = sd_notify(0, "WATCHDOG=1"); + LOGP(DSWD, LOGL_NOTICE, "Watchdog notification attempt\n"); + notify = 1; + } + else { + LOGP(DSWD, LOGL_NOTICE, "Missing watchdog events: e:0x%016llx,m:0x%016llx\n",mgr->swd.swd_events,mgr->swd.swd_eventmasks); + } + + if (rc < 0) { + LOGP(DSWD, LOGL_ERROR, + "Failed to notify system service watchdog: %d\n", rc); + swd_state_reset(mgr, SWD_FAIL_NOTIFY); + return; + } + else { + /* Did we notified the watchdog? */ + if (notify) { + mgr->swd.swd_events = 0; + /* Makes sure we really cleared it in case any event was notified at this same moment (it would be lost) */ + if (mgr->swd.swd_events != 0) + mgr->swd.swd_events = 0; + } + } + + swd_state_reset(mgr, SWD_SUCCESS); + return; +} + +static void swd_close(struct lc15bts_mgr_instance *mgr) +{ +} + +static void swd_state_reset(struct lc15bts_mgr_instance *mgr, int outcome) +{ + if (mgr->swd.swd_from_loop) { + mgr->swd.swd_timeout.data = mgr; + mgr->swd.swd_timeout.cb = swd_loop_run; + osmo_timer_schedule(&mgr->swd.swd_timeout, SWD_PERIOD, 0); + } + + mgr->swd.state = SWD_INITIAL; + swd_close(mgr); +} + +static int swd_run(struct lc15bts_mgr_instance *mgr, int from_loop) +{ + if (mgr->swd.state != SWD_INITIAL) { + LOGP(DSWD, LOGL_ERROR, "Swd is already in progress.\n"); + return -1; + } + + mgr->swd.swd_from_loop = from_loop; + + /* From now on everything will be handled from the failure */ + mgr->swd.state = SWD_IN_PROGRESS; + swd_start(mgr); + return 0; +} + +static void swd_loop_run(void *_data) +{ + int rc; + struct lc15bts_mgr_instance *mgr = _data; + + LOGP(DSWD, LOGL_NOTICE, "Going to check for watchdog notification.\n"); + rc = swd_run(mgr, 1); + if (rc != 0) { + swd_state_reset(mgr, SWD_FAIL_START); + } +} + +/* 'swd_num_events' configures the number of events to be monitored before notifying the + systemd service watchdog. It must be in the range of [1,64]. Events are notified + through the function 'lc15bts_swd_event' +*/ +int lc15bts_swd_init(struct lc15bts_mgr_instance *mgr, int swd_num_events) +{ + /* Checks for a valid number of events to validate */ + if (swd_num_events < 1 || swd_num_events > 64) + return(-1); + + mgr->swd.state = SWD_INITIAL; + mgr->swd.swd_timeout.data = mgr; + mgr->swd.swd_timeout.cb = swd_loop_run; + osmo_timer_schedule(&mgr->swd.swd_timeout, 0, 0); + + if (swd_num_events == 64){ + mgr->swd.swd_eventmasks = 0xffffffffffffffffULL; + } + else { + mgr->swd.swd_eventmasks = ((1ULL << swd_num_events) - 1); + } + mgr->swd.swd_events = 0; + mgr->swd.num_events = swd_num_events; + + return 0; +} + +/* Notifies that the specified event 'swd_event' happened correctly; + the value must be in the range of [0,'swd_num_events'[ (see lc15bts_swd_init). + For example, if 'swd_num_events' was 64, 'swd_event' events are numbered 0 to 63. + WARNING: if this function can be used from multiple threads at the same time, + it must be protected with a kind of mutex to avoid loosing event notification. +*/ +int lc15bts_swd_event(struct lc15bts_mgr_instance *mgr, enum mgr_swd_events swd_event) +{ + /* Checks for a valid specified event (smaller than max possible) */ + if ((int)(swd_event) < 0 || (int)(swd_event) >= mgr->swd.num_events) + return(-1); + + mgr->swd.swd_events = mgr->swd.swd_events | ((unsigned long long int)(1) << (int)(swd_event)); + + /* !!! Uncomment following line to debug events notification */ + LOGP(DSWD, LOGL_DEBUG,"Swd event notified: %d\n", (int)(swd_event)); + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_swd.h b/src/osmo-bts-litecell15/misc/lc15bts_swd.h new file mode 100644 index 0000000..b78a2c2 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_swd.h @@ -0,0 +1,7 @@ +#ifndef _LC15BTS_SWD_H +#define _LC15BTS_SWD_H + +int lc15bts_swd_init(struct lc15bts_mgr_instance *mgr, int swd_num_events); +int lc15bts_swd_event(struct lc15bts_mgr_instance *mgr, enum mgr_swd_events swd_event); + +#endif -- To view, visit https://gerrit.osmocom.org/3316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I475a330af771891ba3c897294ce0dd57ec2ba8db 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 Fri Jul 21 16:08:08 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 21 Jul 2017 16:08:08 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: global addressbook search + api fix In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: sccp: global addressbook search + api fix ...................................................................... sccp: global addressbook search + api fix The sccp-addressbook only allows defining addresses for a specific ss7 instance. It is not possible to use an sscp-address, that is defined in the one ss7 instance in another ss7 instance. Add a second global list where all sscp-addresses are added, regardless on which instance they are defined. Fixup the search functions so that they always search the global list. Change the API, so that the address data is written to a destination pointer. This protects the stored address from unintentional changes. Also return the ss7 instance, where the address is associated with. Change-Id: I5acc1e5abc3b3081149a9f476038e4e53d23b763 --- M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7_vty.c 2 files changed, 54 insertions(+), 24 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 2258b0d..24d64d9 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -248,8 +248,8 @@ int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); -struct osmo_sccp_addr * -osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); +struct osmo_ss7_instance * +osmo_sccp_addr_by_name(struct osmo_sccp_addr *dest_addr, + const char *name); -char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, - const struct osmo_ss7_instance *ss7); +const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr); diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 7e6f9ee..8a03303 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -934,6 +934,7 @@ /* SCCP addressbook */ struct osmo_sccp_addr_entry { struct llist_head list; + struct llist_head list_global; struct osmo_ss7_instance *inst; char name[512]; struct osmo_sccp_addr addr; @@ -951,45 +952,72 @@ 1, }; -/* Pick an SCCP address entry from the addressbook by its name */ -struct osmo_sccp_addr_entry *addr_entry_by_name(const char *name, - const struct osmo_ss7_instance - *inst) +/* A global list that holds all addressbook entries at once + * (see also .cfg in struct osmo_ss7_instance) */ +LLIST_HEAD(sccp_address_book_global); + +/* Pick an SCCP address entry from the addressbook list by its name */ +static struct osmo_sccp_addr_entry +*addr_entry_by_name_local(const char *name, + const struct osmo_ss7_instance *inst) { struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) { + OSMO_ASSERT(entry->inst == inst); + return entry; + } + } + + return NULL; +} + +/* Pick an SCCP address entry from the global addressbook + * list by its name */ +static struct osmo_sccp_addr_entry +*addr_entry_by_name_global(const char *name) +{ + struct osmo_sccp_addr_entry *entry; + + llist_for_each_entry(entry, &sccp_address_book_global, + list_global) { if (strcmp(entry->name, name) == 0) return entry; } + return NULL; } /*! \brief Lookup an SCCP address from the addressbook by its name. - * \param[in] lookup-name of the address to lookup - * \param[in] ss7 instance - * \returns SCCP address; NULL on error */ -struct osmo_sccp_addr *osmo_sccp_addr_by_name(const char *name, - const struct osmo_ss7_instance - *ss7) + * \param[out] dest_addr pointer to output the resulting sccp-address; + * (set to NULL if not interested) + * \param[in] name of the address to lookup + * \returns SS7 instance; NULL on error */ +struct osmo_ss7_instance * +osmo_sccp_addr_by_name(struct osmo_sccp_addr *dest_addr, + const char *name) { struct osmo_sccp_addr_entry *entry; - entry = addr_entry_by_name(name, ss7); - if (entry) - return &entry->addr; + entry = addr_entry_by_name_global(name); + if (!entry) + return NULL; - return NULL; + if (dest_addr) + *dest_addr = entry->addr; + + return entry->inst; } /*! \brief Reverse lookup the lookup-name of a specified SCCP address. * \param[in] name of the address to lookup - * \param[in] ss7 instance * \returns char pointer to the lookup-name; NULL on error */ -char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, - const struct osmo_ss7_instance *ss7) +const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr) { struct osmo_sccp_addr_entry *entry; - llist_for_each_entry(entry, &ss7->cfg.sccp_address_book, list) { + + llist_for_each_entry(entry, &sccp_address_book_global, list_global) { if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) return entry->name; } @@ -1177,7 +1205,7 @@ return CMD_WARNING; } - entry = addr_entry_by_name(name, inst); + entry = addr_entry_by_name_local(name, inst); /* Create a new addressbook entry if we can not find an * already existing entry */ @@ -1185,6 +1213,7 @@ entry = talloc_zero(inst, struct osmo_sccp_addr_entry); osmo_strlcpy(entry->name, name, sizeof(entry->name)); llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + llist_add_tail(&entry->list_global, &sccp_address_book_global); entry->addr.ri = OSMO_SCCP_RI_SSN_PC; } @@ -1203,9 +1232,10 @@ struct osmo_sccp_addr_entry *entry; const char *name = argv[0]; - entry = addr_entry_by_name(name, inst); + entry = addr_entry_by_name_local(name, inst); if (entry) { llist_del(&entry->list); + llist_del(&entry->list_global); talloc_free(entry); } else { vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/3265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5acc1e5abc3b3081149a9f476038e4e53d23b763 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Jul 21 16:27:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 16:27:32 +0000 Subject: [PATCH] osmo-pcap[master]: Use libosmocore osmo_sock_init2() instead of local implement... Message-ID: Review at https://gerrit.osmocom.org/3335 Use libosmocore osmo_sock_init2() instead of local implementation A related function for "create a socket, bind it locally and connect remotely" has meanwhile been introduced in libosmocore, so the local implementation can go. Change-Id: Ieda77ad8b3f7b89faa09882c0037562ce4d0fc89 --- M src/osmo_client_network.c 1 file changed, 2 insertions(+), 134 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/35/3335/1 diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index 27c649a..03cb281 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -43,138 +43,6 @@ #include -/* - * Move to libosmocore... if the api makes source - */ -static int sock_src_init(uint16_t family, uint16_t type, uint8_t proto, - const char *src, uint16_t src_port, - const char *host, uint16_t port, unsigned int flags) -{ - struct addrinfo hints, *result, *rp; - struct addrinfo *src_result, *src_rp = NULL; - int sfd, rc, on = 1; - char portbuf[16]; - char src_portbuf[16]; - - sprintf(portbuf, "%u", port); - sprintf(src_portbuf, "%u", src_port); - memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = family; - if (type == SOCK_RAW) { - /* Workaround for glibc, that returns EAI_SERVICE (-8) if - * SOCK_RAW and IPPROTO_GRE is used. - */ - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - } else { - hints.ai_socktype = type; - hints.ai_protocol = proto; - } - - rc = getaddrinfo(host, portbuf, &hints, &result); - if (rc != 0) { - fprintf(stderr, "getaddrinfo returned NULL: %s:%u: %s\n", - host, port, strerror(errno)); - return -EINVAL; - } - - if (src) { - rc = getaddrinfo(src, src_portbuf, &hints, &src_result); - if (rc != 0) { - fprintf(stderr, "getaddrinfo returned NULL: %s:%u: %s\n", - src, src_port, strerror(errno)); - freeaddrinfo(result); - return -EINVAL; - } - - /* select an address */ - for (src_rp = src_result; src_rp != NULL; src_rp = src_rp->ai_next) { - /* Workaround for glibc again */ - if (type == SOCK_RAW) { - src_rp->ai_socktype = SOCK_RAW; - src_rp->ai_protocol = proto; - } - break; - } - - if (!src_rp) { - fprintf(stderr, "Failed to get src: %s:%u %s\n", - src, src_port, strerror(errno)); - freeaddrinfo(result); - freeaddrinfo(src_result); - return -EINVAL; - } - } - - - for (rp = result; rp != NULL; rp = rp->ai_next) { - /* Workaround for glibc again */ - if (type == SOCK_RAW) { - rp->ai_socktype = SOCK_RAW; - rp->ai_protocol = proto; - } - - sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); - if (sfd == -1) - continue; - if (flags & OSMO_SOCK_F_NONBLOCK) { - if (ioctl(sfd, FIONBIO, (unsigned char *)&on) < 0) { - fprintf(stderr, - "cannot set this socket unblocking:" - " %s:%u: %s\n", - host, port, strerror(errno)); - close(sfd); - freeaddrinfo(result); - return -EINVAL; - } - } - - - if (src_rp) { - rc = bind(sfd, src_rp->ai_addr, src_rp->ai_addrlen); - if (rc != 0) { - fprintf(stderr, - "cannot bind socket:" - " %s:%u: %s\n", - src, src_port, strerror(errno)); - close(sfd); - continue; - } - } - - if (flags & OSMO_SOCK_F_CONNECT) { - rc = connect(sfd, rp->ai_addr, rp->ai_addrlen); - if (rc != -1 || (rc == -1 && errno == EINPROGRESS)) - break; - } else { - rc = setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, - &on, sizeof(on)); - if (rc < 0) { - fprintf(stderr, - "cannot setsockopt socket:" - " %s:%u: %s\n", - host, port, strerror(errno)); - break; - } - if (bind(sfd, rp->ai_addr, rp->ai_addrlen) != -1) - break; - } - close(sfd); - } - freeaddrinfo(result); - if (src) - freeaddrinfo(src_result); - - if (rp == NULL) { - fprintf(stderr, "unable to connect/bind socket: %s:%u: %s\n", - host, port, strerror(errno)); - return -ENODEV; - } - - setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - return sfd; -} - static void _osmo_client_connect(void *_data) { osmo_client_connect((struct osmo_pcap_client_conn *) _data); @@ -369,10 +237,10 @@ conn->wqueue.bfd.when = BSC_FD_READ; osmo_wqueue_clear(&conn->wqueue); - fd = sock_src_init(AF_INET, SOCK_STREAM, IPPROTO_TCP, + fd = osmo_sock_init2(AF_INET, SOCK_STREAM, IPPROTO_TCP, conn->source_ip, 0, conn->srv_ip, conn->srv_port, - OSMO_SOCK_F_CONNECT | OSMO_SOCK_F_NONBLOCK); + OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT | OSMO_SOCK_F_NONBLOCK); if (fd < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to connect conn=%s to %s:%d\n", -- To view, visit https://gerrit.osmocom.org/3335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieda77ad8b3f7b89faa09882c0037562ce4d0fc89 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 21 16:27:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 16:27:32 +0000 Subject: [PATCH] osmo-pcap[master]: client: Move to osmo_sock_init2_ofd() Message-ID: Review at https://gerrit.osmocom.org/3336 client: Move to osmo_sock_init2_ofd() We can simplify the code even further by using the osmo_fd version of osmo_sock_init2() called osmo_sock_init2_ofd(), which takes care of filling the osmo_fd.fd member and registering the socket in the select loop. Change-Id: Ibf1480e7dee287db77a19bb9f0254edddf7706ab --- M src/osmo_client_network.c 1 file changed, 3 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/36/3336/1 diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index 03cb281..402e1cb 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -228,31 +228,22 @@ void osmo_client_connect(struct osmo_pcap_client_conn *conn) { - int fd; + int rc; osmo_client_disconnect(conn); conn->wqueue.read_cb = read_cb; conn->wqueue.write_cb = write_cb; - conn->wqueue.bfd.when = BSC_FD_READ; osmo_wqueue_clear(&conn->wqueue); - fd = osmo_sock_init2(AF_INET, SOCK_STREAM, IPPROTO_TCP, + rc = osmo_sock_init2_ofd(&conn->wqueue.bfd, AF_INET, SOCK_STREAM, IPPROTO_TCP, conn->source_ip, 0, conn->srv_ip, conn->srv_port, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT | OSMO_SOCK_F_NONBLOCK); - if (fd < 0) { + if (rc < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to connect conn=%s to %s:%d\n", conn->name, conn->srv_ip, conn->srv_port); - lost_connection(conn); - return; - } - - conn->wqueue.bfd.fd = fd; - if (osmo_fd_register(&conn->wqueue.bfd) != 0) { - LOGP(DCLIENT, LOGL_ERROR, - "Failed to register to BFD conn=%s\n", conn->name); lost_connection(conn); return; } -- To view, visit https://gerrit.osmocom.org/3336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf1480e7dee287db77a19bb9f0254edddf7706ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 21 16:37:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 21 Jul 2017 16:37:10 +0000 Subject: [PATCH] osmo-msc[master]: Add libvlr implementation 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/3194 to look at the new patch set (#10). Add libvlr implementation Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/debug.h M include/openbsc/iu.h A include/openbsc/vlr.h M src/Makefile.am M src/libcommon/debug.c A src/libmsc/subscr_conn.c M src/libmsc/vty_interface_layer3.c A src/libvlr/Makefile.am A src/libvlr/vlr.c A src/libvlr/vlr_access_req_fsm.c A src/libvlr/vlr_access_req_fsm.h A src/libvlr/vlr_auth_fsm.c A src/libvlr/vlr_auth_fsm.h A src/libvlr/vlr_core.h A src/libvlr/vlr_lu_fsm.c A src/libvlr/vlr_lu_fsm.h M src/osmo-nitb/Makefile.am 19 files changed, 4,734 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/3194/10 diff --git a/configure.ac b/configure.ac index adae598..63a087f 100644 --- a/configure.ac +++ b/configure.ac @@ -225,6 +225,7 @@ src/libtrau/Makefile src/libbsc/Makefile src/libmsc/Makefile + src/libvlr/Makefile src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 2740a5d..532328c 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -84,6 +84,7 @@ trau_mux.h \ trau_upqueue.h \ ussd.h \ + vlr.h \ vty.h \ v42bis.h \ v42bis_private.h \ diff --git a/include/openbsc/debug.h b/include/openbsc/debug.h index 8a4247b..3feb7c3 100644 --- a/include/openbsc/debug.h +++ b/include/openbsc/debug.h @@ -38,12 +38,8 @@ DSUA, DV42BIS, DPCU, + DVLR, Debug_LastEntry, }; - -struct gsm_subscriber; - -void log_set_filter_vlr_subscr(struct log_target *target, - struct gsm_subscriber *vlr_subscr); extern const struct log_info log_info; diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h index f973ac1..8cf830e 100644 --- a/include/openbsc/iu.h +++ b/include/openbsc/iu.h @@ -22,9 +22,6 @@ IU_EVENT_SECURITY_MODE_COMPLETE, IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ - /* FIXME: maybe IU_EVENT_IU_RELEASE and IU_EVENT_LINK_INVALIDATED - * should be combined to one generic event that simply means the - * ue_conn_ctx should no longer be used, for whatever reason. */ }; extern const struct value_string iu_event_type_names[]; @@ -35,7 +32,6 @@ /* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, - /* TODO "gprs_" in generic CS+PS domain ^ */ uint16_t *sai); typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, diff --git a/include/openbsc/vlr.h b/include/openbsc/vlr.h new file mode 100644 index 0000000..90e3d7a --- /dev/null +++ b/include/openbsc/vlr.h @@ -0,0 +1,413 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +// for GSM_NAME_LENGTH +#include + +/* from 3s to 10s */ +#define GSM_29002_TIMER_S 10 +/* from 15s to 30s */ +#define GSM_29002_TIMER_M 30 +/* from 1min to 10min */ +#define GSM_29002_TIMER_ML (10*60) +/* from 28h to 38h */ +#define GSM_29002_TIMER_L (32*60*60) + + +/* VLR subscriber authentication state */ +enum vlr_subscr_auth_state { + /* subscriber needs to be autenticated */ + VLR_SUB_AS_NEEDS_AUTH, + /* waiting for AuthInfo from HLR/AUC */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + /* waiting for response from subscriber */ + VLR_SUB_AS_WAIT_RESP, + /* successfully authenticated */ + VLR_SUB_AS_AUTHENTICATED, + /* subscriber needs re-sync */ + VLR_SUB_AS_NEEDS_RESYNC, + /* waiting for AuthInfo with ReSync */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + /* waiting for response from subscr, resync case */ + VLR_SUB_AS_WAIT_RESP_RESYNC, + /* waiting for IMSI from subscriber */ + VLR_SUB_AS_WAIT_ID_IMSI, + /* authentication has failed */ + VLR_SUB_AS_AUTH_FAILED, +}; + +enum vlr_lu_event { + VLR_ULA_E_UPDATE_LA, /* Initial trigger (LU from MS) */ + VLR_ULA_E_SEND_ID_ACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_SEND_ID_NACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_AUTH_RES, /* Result of auth procedure */ + VLR_ULA_E_CIPH_RES, /* Result of Ciphering Mode Command */ + VLR_ULA_E_ID_IMSI, /* IMSI recieved from MS */ + VLR_ULA_E_ID_IMEI, /* IMEI received from MS */ + VLR_ULA_E_ID_IMEISV, /* IMEISV received from MS */ + VLR_ULA_E_HLR_LU_RES, /* HLR UpdateLocation result */ + VLR_ULA_E_UPD_HLR_COMPL,/* UpdatE_HLR_VLR result */ + VLR_ULA_E_LU_COMPL_SUCCESS,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_LU_COMPL_FAILURE,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_NEW_TMSI_ACK, /* TMSI Reallocation Complete */ +}; + +enum vlr_ciph_result_cause { + VLR_CIPH_REJECT, /* ? */ + VLR_CIPH_COMPL, +}; + +struct vlr_ciph_result { + enum vlr_ciph_result_cause cause; + const char *imeisv; +}; + +enum vlr_subscr_security_context { + VLR_SEC_CTX_NONE, + VLR_SEC_CTX_GSM, + VLR_SEC_CTX_UMTS, +}; + +enum vlr_lu_type { + VLR_LU_TYPE_PERIODIC, + VLR_LU_TYPE_IMSI_ATTACH, + VLR_LU_TYPE_REGULAR, +}; + +#define OSMO_LBUF_DECL(name, xlen) \ + struct { \ + uint8_t buf[xlen]; \ + size_t len; \ + } name + +struct sgsn_mm_ctx; +struct vlr_instance; + +/* The VLR subscriber is the part of the GSM subscriber state in VLR (CS) or + * SGSN (PS), particularly while interacting with the HLR via GSUP */ +struct vlr_subscr { + struct llist_head list; + struct vlr_instance *vlr; + + /* TODO either populate from HLR or drop this completely? */ + long long unsigned int id; + + /* Data from HLR */ /* 3GPP TS 23.008 */ + /* Always use vlr_subscr_set_imsi() to write to imsi[] */ + char imsi[GSM23003_IMSI_MAX_DIGITS+1]; /* 2.1.1.1 */ + char msisdn[GSM_EXTENSION_LENGTH+1]; /* 2.1.2 */ + char name[GSM_NAME_LENGTH+1]; /* proprietary */ + OSMO_LBUF_DECL(hlr, 16); /* 2.4.7 */ + uint32_t periodic_lu_timer; /* 2.4.24 */ + uint32_t age_indicator; /* 2.17.1 */ + + /* Authentication Data */ + struct gsm_auth_tuple auth_tuples[5]; /* 2.3.1-2.3.4 */ + struct gsm_auth_tuple *last_tuple; + enum vlr_subscr_security_context sec_ctx; + + /* Data local to VLR is below */ + uint32_t tmsi; /* 2.1.4 */ + /* Newly allocated TMSI that was not yet acked by MS */ + uint32_t tmsi_new; + + /* some redundancy in information below? */ + struct osmo_cell_global_id cgi; /* 2.4.16 */ + uint16_t lac; /* 2.4.2 */ + + char imeisv[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.2.3 */ + char imei[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.1.9 */ + bool imsi_detached_flag; /* 2.7.1 */ + bool conf_by_radio_contact_ind; /* 2.7.4.1 */ + bool sub_dataconf_by_hlr_ind; /* 2.7.4.2 */ + bool loc_conf_in_hlr_ind; /* 2.7.4.3 */ + bool dormant_ind; /* 2.7.8 */ + bool cancel_loc_rx; /* 2.7.8A */ + bool ms_not_reachable_flag; /* 2.10.2 (MNRF) */ + bool la_allowed; + + int use_count; + time_t expire_lu; /* FIXME: overlap with periodic_lu_timer/age_indicator */ + + struct osmo_fsm_inst *lu_fsm; + struct osmo_fsm_inst *auth_fsm; + struct osmo_fsm_inst *proc_arq_fsm; + + bool lu_complete; + + void *msc_conn_ref; + + /* PS (SGSN) specific parts */ + struct { + struct llist_head pdp_list; + uint8_t rac; + uint8_t sac; + struct gprs_mm_ctx *mmctx; + } ps; + /* CS (NITB/CSCN) specific parts */ + struct { + /* pending requests */ + bool is_paging; + struct llist_head requests; + } cs; +}; + +enum vlr_proc_arq_result; + +enum vlr_ciph { + VLR_CIPH_NONE, /*< A5/0, no encryption */ + VLR_CIPH_A5_1, /*< A5/1, encryption */ + VLR_CIPH_A5_2, /*< A5/2, deprecated export-grade encryption */ + VLR_CIPH_A5_3, /*< A5/3, 'new secure' encryption */ +}; + +struct vlr_ops { + /* encode + transmit an AUTH REQ towards the MS. + * \param[in] at auth tuple providing rand, key_seq and autn. + * \param[in] send_autn True to send AUTN, for r99 UMTS auth. + */ + int (*tx_auth_req)(void *msc_conn_ref, struct gsm_auth_tuple *at, + bool send_autn); + /* encode + transmit an AUTH REJECT towards the MS */ + int (*tx_auth_rej)(void *msc_conn_ref); + + /* encode + transmit an IDENTITY REQUEST towards the MS */ + int (*tx_id_req)(void *msc_conn_ref, uint8_t mi_type); + + int (*tx_lu_acc)(void *msc_conn_ref, uint32_t send_tmsi); + int (*tx_lu_rej)(void *msc_conn_ref, uint8_t cause); + 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 retrieve_imeisv); + + /* notify MSC/SGSN that the subscriber data in VLR has been updated */ + void (*subscr_update)(struct vlr_subscr *vsub); + /* notify MSC/SGSN that the given subscriber has been associated + * with this msc_conn_ref */ + void (*subscr_assoc)(void *msc_conn_ref, struct vlr_subscr *vsub); +}; + +enum vlr_timer { + VLR_T_3250, + VLR_T_3260, + VLR_T_3270, + _NUM_VLR_TIMERS +}; + +/* An instance of the VLR codebase */ +struct vlr_instance { + struct llist_head subscribers; + struct llist_head operations; + struct gsup_client *gsup_client; + struct vlr_ops ops; + struct { + bool retrieve_imeisv; + bool assign_tmsi; + bool check_imei_rqd; + int auth_tuple_max_use_count; + bool auth_reuse_old_sets_on_error; + bool parq_retrieve_imsi; + bool is_ps; + uint32_t timer[_NUM_VLR_TIMERS]; + } cfg; + /* A free-form pointer for use by the caller */ + void *user_ctx; +}; + +extern const struct value_string vlr_ciph_names[]; +static inline const char *vlr_ciph_name(enum vlr_ciph val) +{ + return get_value_string(vlr_ciph_names, val); +} + +/* Location Updating request */ +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi); + +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi); + +/* tell the VLR that the subscriber connection is gone */ +int vlr_subscr_disconnected(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); +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); +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); +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub); + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops); +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port); + +/* internal use only */ + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event); +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event); + +struct osmo_fsm_inst * +lu_compl_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure); + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +const char *vlr_subscr_msisdn_or_name(struct vlr_subscr *vsub); + +#define vlr_subscr_find_by_imsi(vlr, imsi) \ + _vlr_subscr_find_by_imsi(vlr, imsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_imsi(vlr, imsi, created) \ + _vlr_subscr_find_or_create_by_imsi(vlr, imsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_tmsi(vlr, tmsi) \ + _vlr_subscr_find_by_tmsi(vlr, tmsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created) \ + _vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_msisdn(vlr, msisdn) \ + _vlr_subscr_find_by_msisdn(vlr, msisdn, __BASE_FILE__, __LINE__) + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line); + +#define vlr_subscr_get(sub) _vlr_subscr_get(sub, __BASE_FILE__, __LINE__) +#define vlr_subscr_put(sub) _vlr_subscr_put(sub, __BASE_FILE__, __LINE__) +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line); +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line); + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_free(struct vlr_subscr *vsub); +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub); + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi); +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei); +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv); +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn); + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi); +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi); +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn); +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei); + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer); + +int vlr_subscr_changed(struct vlr_subscr *vsub); +int vlr_subscr_purge(struct vlr_subscr *vsub); +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause); + + +/* Process Acccess Request FSM */ + +enum vlr_proc_arq_result { + VLR_PR_ARQ_RES_NONE, + VLR_PR_ARQ_RES_SYSTEM_FAILURE, + VLR_PR_ARQ_RES_ILLEGAL_SUBSCR, + VLR_PR_ARQ_RES_UNIDENT_SUBSCR, + VLR_PR_ARQ_RES_ROAMING_NOTALLOWED, + VLR_PR_ARQ_RES_ILLEGAL_EQUIP, + VLR_PR_ARQ_RES_UNKNOWN_ERROR, + VLR_PR_ARQ_RES_TIMEOUT, + VLR_PR_ARQ_RES_PASSED, +}; + +extern const struct value_string vlr_proc_arq_result_names[]; +static inline const char *vlr_proc_arq_result_name(enum vlr_proc_arq_result res) +{ + return get_value_string(vlr_proc_arq_result_names, res); +} + +enum proc_arq_vlr_event { + PR_ARQ_E_START, + PR_ARQ_E_ID_IMSI, + PR_ARQ_E_AUTH_RES, + PR_ARQ_E_CIPH_RES, + PR_ARQ_E_UPD_LOC_RES, + PR_ARQ_E_TRACE_RES, + PR_ARQ_E_IMEI_RES, + PR_ARQ_E_PRES_RES, + PR_ARQ_E_TMSI_ACK, +}; + +enum vlr_parq_type { + VLR_PR_ARQ_T_INVALID = 0, /* to guard against unset vars */ + VLR_PR_ARQ_T_CM_SERV_REQ, + VLR_PR_ARQ_T_PAGING_RESP, + /* FIXME: differentiate between services of 24.008 10.5.3.3 */ +}; + +/* Process Access Request (CM SERV REQ / PAGING RESP) */ +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran); + +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi); + +void vlr_parq_fsm_init(void); + +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv); + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr); diff --git a/src/Makefile.am b/src/Makefile.am index cfad7df..c66f9e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,7 @@ # Libraries SUBDIRS = \ libcommon \ + libvlr \ libmgcp \ libbsc \ libmsc \ diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index f29f168..088902a 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -180,6 +180,11 @@ .description = "PCU Interface", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DVLR] = { + .name = "DVLR", + .description = "Visitor Location Register", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static int filter_fn(const struct log_context *ctx, struct log_target *tar) diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c new file mode 100644 index 0000000..91ffe40 --- /dev/null +++ b/src/libmsc/subscr_conn.c @@ -0,0 +1,269 @@ +/* MSC subscriber connection implementation */ + +/* + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +static const struct value_string subscr_conn_fsm_event_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_E_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_E_ACCEPTED), + OSMO_VALUE_STRING(SUBSCR_CONN_E_BUMP), + OSMO_VALUE_STRING(SUBSCR_CONN_E_MO_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CN_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CLOSE_CONF), + { 0, NULL } +}; + +const struct value_string subscr_conn_from_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_LU), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_CM_SERVICE_REQ), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_PAGING_RESP), + { 0, NULL } +}; + +static void paging_resp(struct gsm_subscriber_connection *conn, + enum gsm_paging_event pe) +{ + subscr_paging_dispatch(GSM_HOOK_RR_PAGING, pe, NULL, conn, conn->subscr); +} + +void subscr_conn_fsm_new(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + enum subscr_conn_from from = SUBSCR_CONN_FROM_INVALID; + enum gsm_paging_event pe; + + if (data) { + from = *(enum subscr_conn_from*)data; + LOGPFSM(fi, "%s\n", subscr_conn_from_name(from)); + } + + /* If accepted, transition the state, all other cases mean failure. */ + switch (event) { + case SUBSCR_CONN_E_ACCEPTED: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + break; + + case SUBSCR_CONN_E_MO_CLOSE: + case SUBSCR_CONN_E_CN_CLOSE: + case SUBSCR_CONN_E_CLOSE_CONF: + break; + + default: + LOGPFSM(fi, "Unexpected event: %d %s\n", + event, osmo_fsm_event_name(fi->fsm, event)); + break; + } + + /* if appropriate, signal paging success or failure */ + if (from == SUBSCR_CONN_FROM_PAGING_RESP) { + pe = (fi->state == SUBSCR_CONN_S_ACCEPTED)? + GSM_PAGING_SUCCEEDED : GSM_PAGING_EXPIRED; + paging_resp(conn, pe); + } + + /* On failure, discard the conn */ + if (fi->state != SUBSCR_CONN_S_ACCEPTED) { + /* TODO: on MO_CLOSE or CN_CLOSE, first go to RELEASING and + * await BSC confirmation? */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); + return; + } + + /* On success, handle pending requests and/or close conn */ + + if (from == SUBSCR_CONN_FROM_CM_SERVICE_REQ) { + conn->received_cm_service_request = true; + LOGPFSM(fi, "received_cm_service_request = true\n"); + } + + osmo_fsm_inst_dispatch(fi, SUBSCR_CONN_E_BUMP, data); +} + +#if 0 + case SUBSCR_CONN_E_PARQ_SUCCESS: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + accept_conn = true; + /* fall through */ + case SUBSCR_CONN_E_PARQ_FAILURE: + parq_type = data ? *(enum vlr_parq_type*)data : VLR_PR_ARQ_T_INVALID; + switch (parq_type) { + + case VLR_PR_ARQ_T_CM_SERV_REQ: + accept_conn = handle_cm_serv_result(fi, accept_conn); + break; + + case VLR_PR_ARQ_T_PAGING_RESP: + accept_conn = handle_paging_result(fi, accept_conn); + break; + + default: + LOGPFSML(fi, LOGL_ERROR, + "Invalid VLR Process Access Request type" + " %d\n", parq_type); + accept_conn = false; + break; + } + break; +#endif + +static void subscr_conn_fsm_bump(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + + if (conn->silent_call) + return; + + if (conn->received_cm_service_request) + return; + + /* is this needed? */ + if (conn->subscr && !llist_empty(&conn->subscr->requests)) + return; + + if (trans_has_conn(conn)) + return; + + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_accepted(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case SUBSCR_CONN_E_BUMP: + subscr_conn_fsm_bump(fi, event, data); + return; + + default: + break; + } + /* Whatever unexpected happens in the accepted state, it means release. + * Even if an unexpected event is passed, the safest thing to do is + * discard the conn. We don't expect another SUBSCR_CONN_E_ACCEPTED. */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_release(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = fi->priv; + if (!conn) + return; + + /* temporary hack, see owned_by_msc */ + if (!conn->owned_by_msc) { + DEBUGP(DMM, "%s leaving bsc_subscr_con_free() to bsc_api.c, owned_by_msc = false\n", + subscr_name(conn->subscr)); + return; + } + + DEBUGP(DMM, "%s calling bsc_subscr_con_free(), owned_by_msc = true\n", + subscr_name(conn->subscr)); + gsm0808_clear(conn); + bsc_subscr_con_free(conn); +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state subscr_conn_fsm_states[] = { + [SUBSCR_CONN_S_NEW] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_NEW), + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_ACCEPTED) | + S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_new, + }, + [SUBSCR_CONN_S_ACCEPTED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_ACCEPTED), + /* allow everything to release for any odd behavior */ + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_BUMP) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_accepted, + }, + [SUBSCR_CONN_S_RELEASED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_RELEASED), + .onenter = subscr_conn_fsm_release, + }, +}; + +static struct osmo_fsm subscr_conn_fsm = { + .name = "Subscr_Conn", + .states = subscr_conn_fsm_states, + .num_states = ARRAY_SIZE(subscr_conn_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = subscr_conn_fsm_event_names, +}; + +int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id) +{ + struct osmo_fsm_inst *fi; + OSMO_ASSERT(conn); + + if (conn->conn_fsm) { + LOGP(DMM, LOGL_ERROR, + "%s: Error: connection already in use\n", id); + return -EINVAL; + } + + fi = osmo_fsm_inst_alloc(&subscr_conn_fsm, conn, conn, LOGL_DEBUG, id); + + if (!fi) { + LOGP(DMM, LOGL_ERROR, + "%s: Failed to allocate subscr conn master FSM\n", id); + return -ENOMEM; + } + conn->conn_fsm = fi; + return 0; +} + +bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn) +{ + if (!conn) + return false; + if (!conn->subscr) + return false; + if (!conn->conn_fsm) + return false; + if (conn->conn_fsm->state != SUBSCR_CONN_S_ACCEPTED) + return false; + return true; +} + +void msc_subscr_conn_init(void) +{ + osmo_fsm_register(&subscr_conn_fsm); +} diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index e503291..99d7fb9 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -1053,7 +1053,6 @@ return CMD_WARNING; } - log_set_filter_vlr_subscr(tgt, vlr_subscr); log_set_filter_bsc_subscr(tgt, bsc_subscr); return CMD_SUCCESS; } diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am new file mode 100644 index 0000000..17ad411 --- /dev/null +++ b/src/libvlr/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) + +noinst_HEADERS = \ + vlr_access_req_fsm.h \ + vlr_auth_fsm.h \ + vlr_core.h \ + vlr_lu_fsm.h \ + $(NULL) + +noinst_LIBRARIES = libvlr.a + +libvlr_a_SOURCES = \ + vlr.c \ + vlr_access_req_fsm.c \ + vlr_auth_fsm.c \ + vlr_lu_fsm.c \ + $(NULL) diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c new file mode 100644 index 0000000..0e0d31c --- /dev/null +++ b/src/libvlr/vlr.c @@ -0,0 +1,1108 @@ +/* Osmocom Visitor Location Register (VLR) code base */ + +/* (C) 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define SGSN_SUBSCR_MAX_RETRIES 3 +#define SGSN_SUBSCR_RETRY_INTERVAL 10 + +/*********************************************************************** + * Convenience functions + ***********************************************************************/ + +const struct value_string vlr_ciph_names[] = { + OSMO_VALUE_STRING(VLR_CIPH_NONE), + OSMO_VALUE_STRING(VLR_CIPH_A5_1), + OSMO_VALUE_STRING(VLR_CIPH_A5_2), + OSMO_VALUE_STRING(VLR_CIPH_A5_3), + { 0, NULL } +}; + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer) +{ + uint32_t tidx = 0xffffffff; + + switch (timer) { + case 3270: + tidx = VLR_T_3270; + break; + case 3260: + tidx = VLR_T_3260; + break; + case 3250: + tidx = VLR_T_3250; + break; + } + + OSMO_ASSERT(tidx < sizeof(vlr->cfg.timer)); + return vlr->cfg.timer[tidx]; +} + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!imsi || !*imsi) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_imsi(vsub, imsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (tmsi == GSM_RESERVED_TMSI) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_tmsi(vsub, tmsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!msisdn || !*msisdn) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_msisdn(vsub, msisdn)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +/* Transmit GSUP message to HLR */ +static int vlr_tx_gsup_message(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + struct msgb *msg = gsup_client_msgb_alloc(); + + osmo_gsup_encode(msg, gsup_msg); + + if (!vlr->gsup_client) { + LOGP(DVLR, LOGL_NOTICE, "GSUP link is down, cannot " + "send GSUP: %s\n", msgb_hexdump(msg)); + msgb_free(msg); + return -ENOTSUP; + } + + LOGP(DVLR, LOGL_DEBUG, "GSUP tx: %s\n", + osmo_hexdump_nospc(msg->data, msg->len)); + + return gsup_client_send(vlr->gsup_client, msg); +} + +/* Transmit GSUP message for subscriber to HLR, using IMSI from subscriber */ +static int vlr_subscr_tx_gsup_message(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct vlr_instance *vlr = vsub->vlr; + + if (strlen(gsup_msg->imsi) == 0) + osmo_strlcpy(gsup_msg->imsi, vsub->imsi, sizeof(gsup_msg->imsi)); + + return vlr_tx_gsup_message(vlr, gsup_msg); +} + +/* Transmit GSUP error in response to original message */ +static int vlr_tx_gsup_error_reply(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_orig, + enum gsm48_gmm_cause cause) +{ + struct osmo_gsup_message gsup_reply = {0}; + + osmo_strlcpy(gsup_reply.imsi, gsup_orig->imsi, sizeof(gsup_reply.imsi)); + gsup_reply.cause = cause; + gsup_reply.message_type = + OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type); + + return vlr_tx_gsup_message(vlr, &gsup_reply); +} + +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + OSMO_ASSERT(sub->use_count < INT_MAX); + sub->use_count++; + LOGPSRC(DREF, LOGL_DEBUG, file, line, + "VLR subscr %s usage increases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + return sub; +} + +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + sub->use_count--; + LOGPSRC(DREF, sub->use_count >= 0? LOGL_DEBUG : LOGL_ERROR, + file, line, + "VLR subscr %s usage decreases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + if (sub->use_count <= 0) + vlr_subscr_free(sub); + return NULL; +} + +/* Allocate a new subscriber and insert it into list */ +static struct vlr_subscr *_vlr_subscr_alloc(struct vlr_instance *vlr) +{ + struct vlr_subscr *vsub; + int i; + + vsub = talloc_zero(vlr, struct vlr_subscr); + vsub->vlr = vlr; + vsub->tmsi = GSM_RESERVED_TMSI; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + + INIT_LLIST_HEAD(&vsub->cs.requests); + INIT_LLIST_HEAD(&vsub->ps.pdp_list); + + llist_add_tail(&vsub->list, &vlr->subscribers); + return vsub; +} + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr) +{ + return vlr_subscr_get(_vlr_subscr_alloc(vlr)); +} + +/* Send a GSUP Purge MS request. + * TODO: this should be sent to the *previous* VLR when this VLR is "taking" + * this subscriber, not to the HLR? */ +int vlr_subscr_purge(struct vlr_subscr *vsub) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_PURGE_MS_REQUEST; + + /* provide HLR number in case we know it */ + gsup_msg.hlr_enc_len = vsub->hlr.len; + gsup_msg.hlr_enc = vsub->hlr.buf; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause) +{ + if (!vsub) + return; + + if (vsub->lu_fsm) { + if (vsub->lu_fsm->state == VLR_ULA_S_WAIT_HLR_UPD) + osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_HLR_LU_RES, + (void*)&cause); + else + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_ERROR, + 0); + } + + if (vsub->proc_arq_fsm) + osmo_fsm_inst_term(vsub->proc_arq_fsm, OSMO_FSM_TERM_ERROR, 0); +} + +/* Call vlr_subscr_cancel(), then completely drop the entry from the VLR */ +void vlr_subscr_free(struct vlr_subscr *vsub) +{ + llist_del(&vsub->list); + DEBUGP(DREF, "freeing VLR subscr %s\n", vlr_subscr_name(vsub)); + talloc_free(vsub); +} + +/* Generate a new TMSI and store in vsub->tmsi_new. + * Search all known subscribers to ensure that the TMSI is unique. */ +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub) +{ + struct vlr_instance *vlr = vsub->vlr; + uint32_t tmsi; + int tried; + + for (tried = 0; tried < 100; tried++) { + if (RAND_bytes((uint8_t *) &tmsi, sizeof(tmsi)) != 1) { + LOGP(DVLR, LOGL_ERROR, "RAND_bytes failed\n"); + return -1; + } + /* throw the dice again, if the TSMI doesn't fit */ + if (tmsi == GSM_RESERVED_TMSI) + continue; + + /* Section 2.4 of 23.003: MSC has two MSB 00/01/10, SGSN 11 */ + if (vlr->cfg.is_ps) { + /* SGSN */ + tmsi |= 0xC000000; + } else { + /* MSC */ + if ((tmsi & 0xC0000000) == 0xC0000000) + tmsi &= ~0xC0000000; + } + + /* If this TMSI is already in use, try another one. */ + if (vlr_subscr_find_by_tmsi(vlr, tmsi)) + continue; + + vsub->tmsi_new = tmsi; + return 0; + } + + LOGP(DVLR, LOGL_ERROR, "subscr %s: unable to generate valid TMSI" + " after %d tries\n", vlr_subscr_name(vsub), tried); + return -1; +} + +/* Find subscriber by IMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] imsi IMSI string. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_imsi(vlr, imsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vlr_subscr_set_imsi(vsub, imsi); + LOGP(DVLR, LOGL_INFO, "New subscr, IMSI: %s\n", vsub->imsi); + if (created) + *created = true; + return vsub; +} + +/* Find subscriber by TMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] tmsi TMSI. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_tmsi(vlr, tmsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vsub->tmsi = tmsi; + LOGP(DVLR, LOGL_INFO, "New subscr, TMSI: 0x%08x\n", vsub->tmsi); + if (created) + *created = true; + return vsub; +} + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + vsub->id = atoll(vsub->imsi); + DEBUGP(DVLR, "set IMSI on subscriber; IMSI=%s id=%llu\n", + vsub->imsi, vsub->id); +} + +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imei, imei, sizeof(vsub->imei)); + DEBUGP(DVLR, "set IMEI on subscriber; IMSI=%s IMEI=%s\n", + vsub->imsi, vsub->imei); +} + +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imeisv, imeisv, sizeof(vsub->imeisv)); + DEBUGP(DVLR, "set IMEISV on subscriber; IMSI=%s IMEISV=%s\n", + vsub->imsi, vsub->imeisv); +} + +/* Safely copy the given MSISDN string to vsub->msisdn */ +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->msisdn, msisdn, sizeof(vsub->msisdn)); + DEBUGP(DVLR, "set MSISDN on subscriber; IMSI=%s MSISDN=%s\n", + vsub->imsi, vsub->msisdn); +} + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + return vsub && imsi && vsub->imsi[0] && !strcmp(vsub->imsi, imsi); +} + +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi) +{ + return vsub && tmsi != GSM_RESERVED_TMSI + && (vsub->tmsi == tmsi || vsub->tmsi_new == tmsi); +} + +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + return vsub && msisdn && vsub->msisdn[0] + && !strcmp(vsub->msisdn, msisdn); +} + +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei) +{ + return vsub && imei && vsub->imei[0] + && !strcmp(vsub->imei, imei); +} + +/* Send updated subscriber information to HLR */ +int vlr_subscr_changed(struct vlr_subscr *vsub) +{ + /* FIXME */ + LOGP(DVLR, LOGL_ERROR, "Not implemented: %s\n", __func__); + return 0; +} + +/*********************************************************************** + * PDP context data + ***********************************************************************/ + +struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_alloc(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data* pdata; + + pdata = talloc_zero(vsub, struct sgsn_subscriber_pdp_data); + + llist_add_tail(&pdata->list, &vsub->ps.pdp_list); + + return pdata; +} + +static int vlr_subscr_pdp_data_clear(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data *pdp, *pdp2; + int count = 0; + + llist_for_each_entry_safe(pdp, pdp2, &vsub->ps.pdp_list, list) { + llist_del(&pdp->list); + talloc_free(pdp); + count += 1; + } + + return count; +} + +static struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_get_by_id(struct vlr_subscr *vsub, unsigned context_id) +{ + struct sgsn_subscriber_pdp_data *pdp; + + llist_for_each_entry(pdp, &vsub->ps.pdp_list, list) { + if (pdp->context_id == context_id) + return pdp; + } + + return NULL; +} + +/*********************************************************************** + * Actual Implementation + ***********************************************************************/ + +static int vlr_rx_gsup_unknown_imsi(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup_msg->message_type)) { + vlr_tx_gsup_error_reply(vlr, gsup_msg, + GMM_CAUSE_IMSI_UNKNOWN); + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP request " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } else if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP error " + "of type 0x%02x, cause '%s' (%d)\n", + gsup_msg->imsi, gsup_msg->message_type, + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + } else { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP response " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } + + return -GMM_CAUSE_IMSI_UNKNOWN; +} + +static int vlr_rx_gsup_purge_no_subscr(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGGSUPP(LOGL_NOTICE, gsup_msg, + "Purge MS has failed with cause '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + return -gsup_msg->cause; + } + LOGGSUPP(LOGL_INFO, gsup_msg, "Completing purge MS\n"); + return 0; +} + +/* VLR internal call to request UpdateLocation from HLR */ +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps) +{ + struct osmo_gsup_message gsup_msg = {0}; + int rc; + + gsup_msg.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; + rc = vlr_subscr_tx_gsup_message(vsub, &gsup_msg); + + return rc; +} + +/* VLR internal call to request tuples from HLR */ +int vlr_subscr_req_sai(struct vlr_subscr *vsub, + const uint8_t *auts, const uint8_t *auts_rand) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; + gsup_msg.auts = auts; + gsup_msg.rand = auts_rand; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +/* Tell HLR that authentication failure occurred */ +int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub) +{ + 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)); + return vlr_tx_gsup_message(vsub->vlr, &gsup_msg); +} + +/* Update the subscriber with GSUP-received auth tuples */ +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + unsigned int i; + unsigned int got_tuples; + + if (gsup->num_auth_vectors) { + memset(&vsub->auth_tuples, 0, sizeof(vsub->auth_tuples)); + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + } + + got_tuples = 0; + for (i = 0; i < gsup->num_auth_vectors; i++) { + size_t key_seq = i; + + if (key_seq >= ARRAY_SIZE(vsub->auth_tuples)) { + LOGVSUBP(LOGL_NOTICE, vsub, + "Skipping auth tuple wih invalid cksn %zu\n", + key_seq); + continue; + } + vsub->auth_tuples[i].vec = gsup->auth_vectors[i]; + vsub->auth_tuples[i].key_seq = key_seq; + got_tuples ++; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "Received %u auth tuples\n", got_tuples); + + if (!got_tuples) { + /* FIXME what now? */ + // vlr_subscr_cancel(vsub, GMM_CAUSE_GSM_AUTH_UNACCEPT); ? + } + + /* New tuples means last_tuple becomes invalid */ + vsub->last_tuple = NULL; +} + +/* Handle SendAuthInfo Result/Error from HLR */ +static int vlr_subscr_handle_sai_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + void *data = (void *) gsup; + + switch (gsup->message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_ACK, data); + break; + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_NACK, data); + break; + default: + return -1; + } + + return 0; +} + +static int decode_bcd_number_safe(char *output, int output_len, + const uint8_t *bcd_lv, int input_len, + int h_len) +{ + uint8_t len; + OSMO_ASSERT(output_len >= 1); + *output = '\0'; + if (input_len < 1) + return -EIO; + len = bcd_lv[0]; + if (input_len < len) + return -EIO; + return gsm48_decode_bcd_number(output, output_len, bcd_lv, h_len); +} + +static void vlr_subscr_gsup_insert_data(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup_msg) +{ + unsigned idx; + int rc; + + if (gsup_msg->msisdn_enc) { + decode_bcd_number_safe(vsub->msisdn, sizeof(vsub->msisdn), + gsup_msg->msisdn_enc, + gsup_msg->msisdn_enc_len, 0); + LOGP(DVLR, LOGL_DEBUG, "IMSI:%s has MSISDN:%s\n", + vsub->imsi, vsub->msisdn); + } + + if (gsup_msg->hlr_enc) { + if (gsup_msg->hlr_enc_len > sizeof(vsub->hlr.buf)) { + LOGP(DVLR, LOGL_ERROR, "HLR-Number too long (%zu)\n", + gsup_msg->hlr_enc_len); + vsub->hlr.len = 0; + } else { + memcpy(vsub->hlr.buf, gsup_msg->hlr_enc, + gsup_msg->hlr_enc_len); + vsub->hlr.len = gsup_msg->hlr_enc_len; + } + } + + if (gsup_msg->pdp_info_compl) { + rc = vlr_subscr_pdp_data_clear(vsub); + if (rc > 0) + LOGP(DVLR, LOGL_INFO, "Cleared existing PDP info\n"); + } + + for (idx = 0; idx < gsup_msg->num_pdp_infos; idx++) { + const struct osmo_gsup_pdp_info *pdp_info = &gsup_msg->pdp_infos[idx]; + size_t ctx_id = pdp_info->context_id; + struct sgsn_subscriber_pdp_data *pdp_data; + + if (pdp_info->apn_enc_len >= sizeof(pdp_data->apn_str)-1) { + LOGVSUBP(LOGL_ERROR, vsub, + "APN too long, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, + pdp_info->apn_enc_len)); + continue; + } + + if (pdp_info->qos_enc_len > sizeof(pdp_data->qos_subscribed)) { + LOGVSUBP(LOGL_ERROR, vsub, + "QoS info too long (%zu)\n", + pdp_info->qos_enc_len); + continue; + } + + LOGVSUBP(LOGL_INFO, vsub, + "Will set PDP info, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, pdp_info->apn_enc_len)); + + /* Set PDP info [ctx_id] */ + pdp_data = vlr_subscr_pdp_data_get_by_id(vsub, ctx_id); + if (!pdp_data) { + pdp_data = vlr_subscr_pdp_data_alloc(vsub); + pdp_data->context_id = ctx_id; + } + + OSMO_ASSERT(pdp_data != NULL); + pdp_data->pdp_type = pdp_info->pdp_type; + osmo_apn_to_str(pdp_data->apn_str, + pdp_info->apn_enc, pdp_info->apn_enc_len); + memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); + pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + } +} + + +/* Handle InsertSubscrData Result from HLR */ +static int vlr_subscr_handle_isd_req(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_gsup_message gsup_reply = {0}; + + vlr_subscr_gsup_insert_data(vsub, gsup); + vsub->vlr->ops.subscr_update(vsub); + + gsup_reply.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; + return vlr_subscr_tx_gsup_message(vsub, &gsup_reply); +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Result " + "without LU in progress\n"); + return -ENODEV; + } + + /* contrary to MAP, we allow piggy-backing subscriber data onto the + * UPDATE LOCATION RESULT, and don't mandate the use of a separate + * nested INSERT SUBSCRIBER DATA transaction */ + vlr_subscr_gsup_insert_data(vsub, gsup); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, NULL); + + return 0; +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_err(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Error " + "without LU in progress\n"); + return -ENODEV; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "UpdateLocation failed; gmm_cause: %s\n", + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, + (void *)&gsup->cause); + + return 0; +} + +/* Handle LOCATION CANCEL request from HLR */ +static int vlr_subscr_handle_cancel_req(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct osmo_gsup_message gsup_reply = {0}; + int is_update_procedure = !gsup_msg->cancel_type || + gsup_msg->cancel_type == OSMO_GSUP_CANCEL_TYPE_UPDATE; + + LOGVSUBP(LOGL_INFO, vsub, "Cancelling MS subscriber (%s)\n", + is_update_procedure ? + "update procedure" : "subscription withdraw"); + + gsup_reply.message_type = OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT; + vlr_subscr_tx_gsup_message(vsub, &gsup_reply); + + vlr_subscr_cancel(vsub, gsup_msg->cause); + + return 0; +} + +/* Incoming handler for GSUP from HLR. + * Keep this function non-static for direct invocation by unit tests. */ +int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +{ + struct vlr_instance *vlr = (struct vlr_instance *) gsupc->data; + struct vlr_subscr *vsub; + struct osmo_gsup_message gsup; + int rc; + + DEBUGP(DVLR, "GSUP rx %u: %s\n", msgb_l2len(msg), + osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup); + if (rc < 0) { + LOGP(DVLR, LOGL_ERROR, + "decoding GSUP message fails with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return rc; + } + + if (!gsup.imsi[0]) { + LOGP(DVLR, LOGL_ERROR, "Missing IMSI in GSUP message\n"); + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup.message_type)) + vlr_tx_gsup_error_reply(vlr, &gsup, + GMM_CAUSE_INV_MAND_INFO); + return -GMM_CAUSE_INV_MAND_INFO; + } + + vsub = vlr_subscr_find_by_imsi(vlr, gsup.imsi); + if (!vsub) { + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + return vlr_rx_gsup_purge_no_subscr(vlr, &gsup); + default: + return vlr_rx_gsup_unknown_imsi(vlr, &gsup); + } + } + + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + rc = vlr_subscr_handle_sai_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: + rc = vlr_subscr_handle_isd_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST: + rc = vlr_subscr_handle_cancel_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: + rc = vlr_subscr_handle_lu_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: + rc = vlr_subscr_handle_lu_err(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_DELETE_DATA_REQUEST: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not yet implemented\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + default: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not valid at VLR/SGSN side\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + } + + vlr_subscr_put(vsub); + return rc; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_id_resp(struct vlr_subscr *vsub, + const uint8_t *mi, size_t mi_len) +{ + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type = mi[0] & GSM_MI_TYPE_MASK; + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); + + /* update the vlr_subscr with the given identity */ + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else + vlr_subscr_set_imsi(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEI: + vlr_subscr_set_imei(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEISV: + vlr_subscr_set_imeisv(vsub, mi_string); + break; + } + + if (vsub->auth_fsm) { + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + osmo_fsm_inst_dispatch(vsub->auth_fsm, + VLR_AUTH_E_MS_ID_IMSI, mi_string); + break; + } + } + + if (vsub->lu_fsm) { + uint32_t event = 0; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + event = VLR_ULA_E_ID_IMSI; + break; + case GSM_MI_TYPE_IMEI: + event = VLR_ULA_E_ID_IMEI; + break; + case GSM_MI_TYPE_IMEISV: + event = VLR_ULA_E_ID_IMEISV; + break; + default: + OSMO_ASSERT(0); + break; + } + osmo_fsm_inst_dispatch(vsub->lu_fsm, event, mi_string); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, "gratuitous ID RESPONSE?!?\n"); + } + + return 0; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_tmsi_reall_compl(struct vlr_subscr *vsub) +{ + if (vsub->lu_fsm) { + return osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_NEW_TMSI_ACK, NULL); + } else if (vsub->proc_arq_fsm) { + return osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, + PR_ARQ_E_TMSI_ACK, NULL); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, + "gratuitous TMSI REALLOC COMPL"); + return -EINVAL; + } +} + +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); + } + return 0; +} + +/* Tear down any running FSMs due to MSC connection timeout. + * Visit all vsub->*_fsm pointers and give them a queue to send a final reject + * message before the entire connection is torn down. + * \param[in] vsub subscriber to tear down + */ +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub) +{ + if (!vsub) + return; + + vlr_loc_update_conn_timeout(vsub->lu_fsm); + vlr_parq_conn_timeout(vsub->proc_arq_fsm); +} + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops) +{ + struct vlr_instance *vlr = talloc_zero(ctx, struct vlr_instance); + OSMO_ASSERT(vlr); + OSMO_ASSERT(ops->tx_auth_req); + OSMO_ASSERT(ops->tx_auth_rej); + OSMO_ASSERT(ops->tx_id_req); + OSMO_ASSERT(ops->tx_lu_acc); + OSMO_ASSERT(ops->tx_lu_rej); + OSMO_ASSERT(ops->tx_cm_serv_acc); + OSMO_ASSERT(ops->tx_cm_serv_rej); + OSMO_ASSERT(ops->set_ciph_mode); + OSMO_ASSERT(ops->subscr_update); + OSMO_ASSERT(ops->subscr_assoc); + + INIT_LLIST_HEAD(&vlr->subscribers); + INIT_LLIST_HEAD(&vlr->operations); + memcpy(&vlr->ops, ops, sizeof(vlr->ops)); + + /* osmo_auth_fsm.c */ + osmo_fsm_register(&vlr_auth_fsm); + /* osmo_lu_fsm.c */ + vlr_lu_fsm_init(); + /* vlr_access_request_fsm.c */ + vlr_parq_fsm_init(); + + return vlr; +} + +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port) +{ + OSMO_ASSERT(vlr); + + vlr->gsup_client = gsup_client_create(gsup_unit_name, + gsup_server_addr_str, + gsup_server_port, + &vlr_gsupc_read_cb, NULL); + if (!vlr->gsup_client) + return -ENOMEM; + vlr->gsup_client->data = vlr; + + return 0; +} + +/* MSC->VLR: Subscribre has disconnected */ +int vlr_subscr_disconnected(struct vlr_subscr *vsub) +{ + /* This corresponds to a MAP-ABORT from MSC->VLR on a classic B + * interface */ + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_REQUEST, NULL); + osmo_fsm_inst_term(vsub->auth_fsm, OSMO_FSM_TERM_REQUEST, NULL); + vsub->msc_conn_ref = NULL; + + return 0; +} + +/* MSC->VLR: Receive Authentication Failure from Subscriber */ +int vlr_subscr_rx_auth_fail(struct vlr_subscr *vsub, const uint8_t *auts) +{ + struct vlr_auth_resp_par par = {0}; + par.auts = auts; + + osmo_fsm_inst_dispatch(vsub->auth_fsm, VLR_AUTH_E_MS_AUTH_FAIL, &par); + return 0; +} + +/* MSC->VLR: Receive Authentication Response from MS + * \returns 1 in case of success, 0 in case of delay, -1 on auth error */ +int vlr_subscr_rx_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, uint8_t res_len) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + struct vlr_auth_resp_par par; + + par.is_r99 = is_r99; + par.is_utran = is_utran; + par.res = res; + par.res_len = res_len; + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_MS_AUTH_RESP, (void *) &par); + + return 0; +} + +/* MSC->VLR: Receive result of Ciphering Mode Command from MS */ +void vlr_subscr_rx_ciph_res(struct vlr_subscr *vsub, struct vlr_ciph_result *res) +{ + if (vsub->lu_fsm && vsub->lu_fsm->state == VLR_ULA_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_CIPH_RES, res); + if (vsub->proc_arq_fsm + && vsub->proc_arq_fsm->state == PR_ARQ_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, PR_ARQ_E_CIPH_RES, + res); +} + +/* Internal evaluation of requested ciphering mode. + * Send set_ciph_mode() to MSC depending on the ciph_mode argument. + * \param[in] vlr VLR instance. + * \param[in] fi Calling FSM instance, for logging. + * \param[in] msc_conn_ref MSC conn to send to. + * \param[in] ciph_mode Ciphering config, to decide whether to do ciphering. + * \returns 0 if no ciphering is needed or message was sent successfully, + * or a negative value if ciph_mode is invalid or sending failed. + */ +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv) +{ + switch (ciph_mode) { + case VLR_CIPH_NONE: + return 0; + + case VLR_CIPH_A5_1: + case VLR_CIPH_A5_3: + return vlr->ops.set_ciph_mode(msc_conn_ref, + ciph_mode, + 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; + } +} + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr) +{ + struct vlr_subscr **fsub = (void*)&target->filter_data[LOG_FLT_VLR_SUBSCR]; + + /* free the old data */ + if (*fsub) { + vlr_subscr_put(*fsub); + *fsub = NULL; + } + + if (vlr_subscr) { + target->filter_map |= (1 << LOG_FLT_VLR_SUBSCR); + *fsub = vlr_subscr_get(vlr_subscr); + } else + target->filter_map &= ~(1 << LOG_FLT_VLR_SUBSCR); +} diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c new file mode 100644 index 0000000..4e63e29 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.c @@ -0,0 +1,778 @@ +/* Osmocom Visitor Location Register (VLR): Access Request FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define S(x) (1 << (x)) + +/*********************************************************************** + * Process_Access_Request_VLR, TS 29.002 Chapter 25.4.2 + ***********************************************************************/ + +const struct value_string vlr_proc_arq_result_names[] = { + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_NONE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_SYSTEM_FAILURE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNIDENT_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ROAMING_NOTALLOWED), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_EQUIP), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNKNOWN_ERROR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_TIMEOUT), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_PASSED), + { 0, NULL } +}; + +static const struct value_string proc_arq_vlr_event_names[] = { + OSMO_VALUE_STRING(PR_ARQ_E_START), + OSMO_VALUE_STRING(PR_ARQ_E_ID_IMSI), + OSMO_VALUE_STRING(PR_ARQ_E_AUTH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_CIPH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_UPD_LOC_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TRACE_RES), + OSMO_VALUE_STRING(PR_ARQ_E_IMEI_RES), + OSMO_VALUE_STRING(PR_ARQ_E_PRES_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TMSI_ACK), + { 0, NULL } +}; + +struct proc_arq_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *ul_child_fsm; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + + enum vlr_parq_type type; + enum vlr_proc_arq_result result; + bool by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool implicitly_accepted_parq_by_ciphering_cmd; +}; + +static void assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + + vsub->msc_conn_ref = par->msc_conn_ref; + par->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(par->msc_conn_ref, par->vsub); +} + +#define proc_arq_fsm_done(fi, res) _proc_arq_fsm_done(fi, res, __FILE__, __LINE__) +static void _proc_arq_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_proc_arq_result res, + const char *file, int line) +{ + struct proc_arq_priv *par = fi->priv; + LOGPFSMSRC(fi, file, line, "proc_arq_fsm_done(%s)\n", + vlr_proc_arq_result_name(res)); + par->result = res; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_DONE, 0, 0); +} + +static void proc_arq_vlr_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct proc_arq_priv *par = fi->priv; + bool success; + int rc; + LOGPFSM(fi, "Process Access Request result: %s\n", + vlr_proc_arq_result_name(par->result)); + + success = (par->result == VLR_PR_ARQ_RES_PASSED); + + /* It would be logical to first dispatch the success event to the + * parent FSM, but that could start actions that send messages to the + * MS. Rather send the CM Service Accept message first and then signal + * success. Since messages are handled synchronously, the success event + * will be processed before we handle new incoming data from the MS. */ + + if (par->type == VLR_PR_ARQ_T_CM_SERV_REQ) { + if (success + && !par->implicitly_accepted_parq_by_ciphering_cmd) { + rc = par->vlr->ops.tx_cm_serv_acc(par->msc_conn_ref); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Accept\n"); + success = false; + } + } + if (!success) { + rc = par->vlr->ops.tx_cm_serv_rej(par->msc_conn_ref, + par->result); + if (rc) + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Reject\n"); + } + } + + /* For VLR_PR_ARQ_T_PAGING_RESP, there is nothing to send. The conn_fsm + * will start handling pending paging transactions. */ + + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + success ? par->parent_event_success + : par->parent_event_failure, + par->parent_event_data); +} + +void proc_arq_vlr_cleanup(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause) +{ + struct proc_arq_priv *par = fi->priv; + if (par->vsub && par->vsub->proc_arq_fsm == fi) + par->vsub->proc_arq_fsm = NULL; +} + +static void _proc_arq_vlr_post_imei(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + /* TODO: Identity := IMSI */ + if (0 /* TODO: TMSI reallocation at access: vlr->cfg.alloc_tmsi_arq */) { + vlr_subscr_alloc_tmsi(vsub); + /* TODO: forward TMSI to MS, wait for TMSI + * REALLOC COMPLETE */ + /* TODO: Freeze old TMSI */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TMSI_ACK, 0, 0); + return; + } + + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static void _proc_arq_vlr_post_trace(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + /* Node 3 */ + if (0 /* IMEI check required */) { + /* Chck_IMEI_VLR */ + vlr->ops.tx_id_req(par->msc_conn_ref, GSM_MI_TYPE_IMEI); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CHECK_IMEI, + vlr_timer(vlr, 3270), 3270); + } else + _proc_arq_vlr_post_imei(fi); +} + +/* After Subscriber_Present_VLR */ +static void _proc_arq_vlr_post_pres(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + if (0 /* TODO: tracing required */) { + /* TODO: Trace_Subscriber_Activity_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TRACE_SUB, 0, 0); + } + _proc_arq_vlr_post_trace(fi); +} + +/* After Update_Location_Child_VLR */ +static void _proc_arq_vlr_node2_post_vlr(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!vsub->sub_dataconf_by_hlr_ind) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + if (0 /* roaming not allowed in LA */) { + /* Set User Error: Roaming not allowed in this LA */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ROAMING_NOTALLOWED); + return; + } + vsub->imsi_detached_flag = false; + if (vsub->ms_not_reachable_flag) { + /* Start Subscriber_Present_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_SUB_PRES, 0, 0); + par->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + PR_ARQ_E_PRES_RES); + return; + } + _proc_arq_vlr_post_pres(fi); +} + +static void _proc_arq_vlr_node2_post_ciph(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + vsub->conf_by_radio_contact_ind = true; + if (vsub->loc_conf_in_hlr_ind == false) { + /* start Update_Location_Child_VLR. WE use + * Update_HLR_VLR instead, the differences appear + * insignificant for now. */ + par->ul_child_fsm = upd_hlr_vlr_proc_start(fi, vsub, + PR_ARQ_E_UPD_LOC_RES); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_UPD_LOC_CHILD, 0, 0); + return; + } + _proc_arq_vlr_node2_post_vlr(fi); +} + +static bool is_ciph_required(struct proc_arq_priv *par) +{ + return par->ciphering_required != VLR_CIPH_NONE; +} + +static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!is_ciph_required(par)) { + _proc_arq_vlr_node2_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, par->msc_conn_ref, + par->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_SYSTEM_FAILURE); + return; + } + + par->implicitly_accepted_parq_by_ciphering_cmd = true; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CIPH, 0, 0); +} + +static bool is_auth_required(struct proc_arq_priv *par) +{ + /* 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); +} + +/* after the IMSI is known */ +static void proc_arq_vlr_fn_post_imsi(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + /* TODO: Identity IMEI -> System Failure */ + if (is_auth_required(par)) { + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_AUTH, + 0, 0); + vsub->auth_fsm = auth_fsm_start(vsub, fi->log_level, fi, + PR_ARQ_E_AUTH_RES, + par->is_r99, + par->is_utran); + } else { + _proc_arq_vlr_node2(fi); + } +} + +static void proc_arq_vlr_fn_init(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub = NULL; + + OSMO_ASSERT(event == PR_ARQ_E_START); + + /* Obtain_Identity_VLR */ + if (!par->by_tmsi) { + /* IMSI was included */ + vsub = vlr_subscr_find_by_imsi(par->vlr, par->imsi); + } else { + /* TMSI was included */ + vsub = vlr_subscr_find_by_tmsi(par->vlr, par->tmsi); + } + if (vsub) { + if (vsub->proc_arq_fsm && fi != vsub->proc_arq_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "Another proc_arq_fsm is already" + " associated with subscr %s," + " terminating the other FSM.\n", + vlr_subscr_name(vsub)); + proc_arq_fsm_done(vsub->proc_arq_fsm, + VLR_PR_ARQ_RES_SYSTEM_FAILURE); + } + vsub->proc_arq_fsm = fi; + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); + return; + } + /* No VSUB could be resolved. What now? */ + + if (!par->by_tmsi) { + /* We couldn't find a subscriber even by IMSI, + * Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } else { + /* TMSI was included, are we permitted to use it? */ + if (vlr->cfg.parq_retrieve_imsi) { + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_OBTAIN_IMSI, + vlr_timer(vlr, 3270), 3270); + return; + } else { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + } +} + +/* ID REQ(IMSI) has returned */ +static void proc_arq_vlr_fn_w_obt_imsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub; + + OSMO_ASSERT(event == PR_ARQ_E_ID_IMSI); + + vsub = vlr_subscr_find_by_imsi(vlr, par->imsi); + if (!vsub) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); +} + +/* Authenticate_VLR has completed */ +static void proc_arq_vlr_fn_w_auth(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + enum vlr_auth_fsm_result res; + enum vlr_proc_arq_result ret; + + OSMO_ASSERT(event == PR_ARQ_E_AUTH_RES); + + res = data ? *(enum vlr_auth_fsm_result*)data : -1; + LOGPFSM(fi, "got %s\n", vlr_auth_fsm_result_name(res)); + + switch (res) { + case VLR_AUTH_RES_PASSED: + /* Node 2 */ + _proc_arq_vlr_node2(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* Error */ + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* Set User Error: Unidentified Subscriber */ + ret = VLR_PR_ARQ_RES_UNIDENT_SUBSCR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* Set User Error: Illegal Subscriber */ + ret = VLR_PR_ARQ_RES_ILLEGAL_SUBSCR; + break; + case VLR_AUTH_RES_PROC_ERR: + /* Set User Error: System failure */ + ret = VLR_PR_ARQ_RES_SYSTEM_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "Unexpected vlr_auth_fsm_result value: %d (data=%p)\n", res, data); + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + } + + /* send process_access_req response to caller, enter error state */ + proc_arq_fsm_done(fi, ret); +} + +static void proc_arq_vlr_fn_w_ciph(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == PR_ARQ_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + } + + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + _proc_arq_vlr_node2_post_ciph(fi); +} + +/* Update_Location_Child_VLR has completed */ +static void proc_arq_vlr_fn_w_upd_loc(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_UPD_LOC_RES); + + _proc_arq_vlr_node2_post_vlr(fi); +} + +/* Subscriber_Present_VLR has completed */ +static void proc_arq_vlr_fn_w_pres(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_PRES_RES); + + _proc_arq_vlr_post_pres(fi); +} + +static void proc_arq_vlr_fn_w_trace(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TRACE_RES); + + _proc_arq_vlr_post_trace(fi); +} + +/* we have received the ID RESPONSE (IMEI) */ +static void proc_arq_vlr_fn_w_imei(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_IMEI_RES); + + _proc_arq_vlr_post_imei(fi); +} + +/* MSC tells us that MS has acknowleded TMSI re-allocation */ +static void proc_arq_vlr_fn_w_tmsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TMSI_ACK); + + /* FIXME: check confirmation? unfreeze? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static const struct osmo_fsm_state proc_arq_vlr_states[] = { + [PR_ARQ_S_INIT] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_INIT), + .in_event_mask = S(PR_ARQ_E_START), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_OBTAIN_IMSI) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_init, + }, + [PR_ARQ_S_WAIT_OBTAIN_IMSI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_OBTAIN_IMSI), + .in_event_mask = S(PR_ARQ_E_ID_IMSI), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_obt_imsi, + }, + [PR_ARQ_S_WAIT_AUTH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_AUTH), + .in_event_mask = S(PR_ARQ_E_AUTH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CIPH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_auth, + }, + [PR_ARQ_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CIPH), + .in_event_mask = S(PR_ARQ_E_CIPH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_ciph, + }, + [PR_ARQ_S_WAIT_UPD_LOC_CHILD] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_UPD_LOC_CHILD), + .in_event_mask = S(PR_ARQ_E_UPD_LOC_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_upd_loc, + }, + [PR_ARQ_S_WAIT_SUB_PRES] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_SUB_PRES), + .in_event_mask = S(PR_ARQ_E_PRES_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_pres, + }, + [PR_ARQ_S_WAIT_TRACE_SUB] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TRACE_SUB), + .in_event_mask = S(PR_ARQ_E_TRACE_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_trace, + }, + [PR_ARQ_S_WAIT_CHECK_IMEI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CHECK_IMEI), + .in_event_mask = S(PR_ARQ_E_IMEI_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_imei, + }, + [PR_ARQ_S_WAIT_TMSI_ACK] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TMSI_ACK), + .in_event_mask = S(PR_ARQ_E_TMSI_ACK), + .out_state_mask = S(PR_ARQ_S_DONE), + .action = proc_arq_vlr_fn_w_tmsi, + }, + [PR_ARQ_S_DONE] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_DONE), + .onenter = proc_arq_vlr_dispatch_result, + }, +}; + +static struct osmo_fsm proc_arq_vlr_fsm = { + .name = "Process_Access_Request_VLR", + .states = proc_arq_vlr_states, + .num_states = ARRAY_SIZE(proc_arq_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = proc_arq_vlr_event_names, + .cleanup = proc_arq_vlr_cleanup, +}; + +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct proc_arq_priv *par; + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type; + + fi = osmo_fsm_inst_alloc_child(&proc_arq_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return; + + par = talloc_zero(fi, struct proc_arq_priv); + fi->priv = par; + par->vlr = vlr; + par->msc_conn_ref = msc_conn_ref; + par->type = type; + par->lai = *lai; + par->parent_event_success = parent_event_success; + par->parent_event_failure = parent_event_failure; + par->parent_event_data = parent_event_data; + par->authentication_required = authentication_required; + par->ciphering_required = ciphering_required; + par->is_r99 = is_r99; + par->is_utran = is_utran; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi_lv+1, mi_lv[0]); + mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); + par->imsi[sizeof(par->imsi)-1] = '\0'; + par->by_tmsi = false; + break; + case GSM_MI_TYPE_TMSI: + par->by_tmsi = true; + par->tmsi = osmo_load32be(mi_lv+2); + break; + case GSM_MI_TYPE_IMEI: + /* TODO: IMEI (emergency call) */ + default: + /* FIXME: directly send reject? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + + osmo_fsm_inst_dispatch(fi, PR_ARQ_E_START, NULL); +} + +/* Gracefully terminate an FSM created by vlr_proc_acc_req() in case of + * external timeout (i.e. from MSC). */ +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == PR_ARQ_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_TIMEOUT); +} + + +#if 0 +/*********************************************************************** + * Update_Location_Child_VLR, TS 29.002 Chapter 25.4.4 + ***********************************************************************/ + +enum upd_loc_child_vlr_state { + ULC_S_IDLE, + ULC_S_WAIT_HLR_RESP, + ULC_S_DONE, +}; + +enum upd_loc_child_vlr_event { + ULC_E_START, +}; + +static const struct value_string upd_loc_child_vlr_event_names[] = { + { ULC_E_START, "START" }, + { 0, NULL } +}; + +static void upd_loc_child_f_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + OSMO_ASSERT(event == ULC_E_START); + + /* send update location */ +} + +static void upd_loc_child_f_w_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ +} + +static const struct osmo_fsm_state upd_loc_child_vlr_states[] = { + [ULC_S_IDLE] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_WAIT_HLR_RESP) | + S(ULC_S_DONE), + .name = "IDLE", + .action = upd_loc_child_f_idle, + }, + [ULC_S_WAIT_HLR_RESP] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_DONE), + .name = "WAIT-HLR-RESP", + .action = upd_loc_child_f_w_hlr, + }, + [ULC_S_DONE] = { + .name = "DONE", + }, +}; + +static struct osmo_fsm upd_loc_child_vlr_fsm = { + .name = "Update_Location_Child_VLR", + .states = upd_loc_child_vlr_states, + .num_states = ARRAY_SIZE(upd_loc_child_vlr_states), + .log_subsys = DVLR, + .event_names = upd_loc_child_vlr_event_names, +}; +#endif + +void vlr_parq_fsm_init(void) +{ + //osmo_fsm_register(&upd_loc_child_vlr_fsm); + osmo_fsm_register(&proc_arq_vlr_fsm); +} diff --git a/src/libvlr/vlr_access_req_fsm.h b/src/libvlr/vlr_access_req_fsm.h new file mode 100644 index 0000000..8386da6 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.h @@ -0,0 +1,17 @@ +#pragma once + +enum proc_arq_vlr_state { + PR_ARQ_S_INIT, + /* Waiting for Obtain_Identity_VLR (IMSI) result */ + PR_ARQ_S_WAIT_OBTAIN_IMSI, + /* Waiting for Authenticate_VLR result */ + PR_ARQ_S_WAIT_AUTH, + PR_ARQ_S_WAIT_CIPH, + PR_ARQ_S_WAIT_UPD_LOC_CHILD, + PR_ARQ_S_WAIT_SUB_PRES, + PR_ARQ_S_WAIT_TRACE_SUB, + PR_ARQ_S_WAIT_CHECK_IMEI, + PR_ARQ_S_WAIT_TMSI_ACK, + PR_ARQ_S_WAIT_CECK_CONF, + PR_ARQ_S_DONE, +}; diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c new file mode 100644 index 0000000..0eb86e7 --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.c @@ -0,0 +1,605 @@ +/* Osmocom Visitor Location Register (VLR) Autentication FSM */ + +/* (C) 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 +#include +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" + +#define S(x) (1 << (x)) + +static const struct value_string fsm_auth_event_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_E_START), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_NACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ABORT), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_RESP), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_FAIL), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_ID_IMSI), + { 0, NULL } +}; + +const struct value_string vlr_auth_fsm_result_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_RES_ABORTED), + OSMO_VALUE_STRING(VLR_AUTH_RES_UNKNOWN_SUBSCR), + OSMO_VALUE_STRING(VLR_AUTH_RES_PROC_ERR), + OSMO_VALUE_STRING(VLR_AUTH_RES_AUTH_FAILED), + OSMO_VALUE_STRING(VLR_AUTH_RES_PASSED), + {0, NULL} +}; + +/* private state of the auth_fsm_instance */ +struct auth_fsm_priv { + struct vlr_subscr *vsub; + bool by_imsi; + bool is_r99; + bool is_utran; + bool auth_requested; + + int auth_tuple_max_use_count; /* see vlr->cfg instead */ +}; + +/*********************************************************************** + * Utility functions + ***********************************************************************/ + +/* Always use either vlr_subscr_get_auth_tuple() or vlr_subscr_has_auth_tuple() + * instead, to ensure proper use count. + * Return an auth tuple with the lowest use_count among the auth tuples. If + * max_use_count >= 0, return NULL if all available auth tuples have a use + * count > max_use_count. If max_use_count is negative, return a currently + * least used auth tuple without enforcing a maximum use count. If there are + * no auth tuples, return NULL. + */ +static struct gsm_auth_tuple * +_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + unsigned int count; + unsigned int idx; + struct gsm_auth_tuple *at = NULL; + unsigned int key_seq = GSM_KEY_SEQ_INVAL; + + if (!vsub) + return NULL; + + if (vsub->last_tuple) + key_seq = vsub->last_tuple->key_seq; + + if (key_seq == GSM_KEY_SEQ_INVAL) + /* Start with 0 after increment modulo array size */ + idx = ARRAY_SIZE(vsub->auth_tuples) - 1; + else + idx = key_seq; + + for (count = ARRAY_SIZE(vsub->auth_tuples); count > 0; count--) { + idx = (idx + 1) % ARRAY_SIZE(vsub->auth_tuples); + + if (vsub->auth_tuples[idx].key_seq == GSM_KEY_SEQ_INVAL) + continue; + + if (!at || vsub->auth_tuples[idx].use_count < at->use_count) + at = &vsub->auth_tuples[idx]; + } + + if (!at || (max_use_count >= 0 && at->use_count > max_use_count)) + return NULL; + + return at; +} + +/* Return an auth tuple and increment its use count. */ +static struct gsm_auth_tuple * +vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + struct gsm_auth_tuple *at = _vlr_subscr_next_auth_tuple(vsub, + max_use_count); + if (!at) + return NULL; + at->use_count++; + return at; +} + +/* Return whether an auth tuple with the given max_use_count is available. */ +static bool vlr_subscr_has_auth_tuple(struct vlr_subscr *vsub, + int max_use_count) +{ + return _vlr_subscr_next_auth_tuple(vsub, max_use_count) != NULL; +} + +static bool check_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, + uint8_t res_len) +{ + struct gsm_auth_tuple *at = vsub->last_tuple; + struct osmo_auth_vector *vec = &at->vec; + bool check_umts; + OSMO_ASSERT(at); + + LOGVSUBP(LOGL_DEBUG, vsub, "received res: %s\n", + osmo_hexdump(res, res_len)); + + /* RES must be present and at least 32bit */ + if (!res || res_len < sizeof(vec->sres)) { + LOGVSUBP(LOGL_NOTICE, vsub, "AUTH RES missing or too short " + "(%u)\n", res_len); + goto out_false; + } + + check_umts = false; + if (is_r99 && (vec->auth_types & OSMO_AUTH_TYPE_UMTS)) { + check_umts = true; + /* We have a R99 capable UE and have a UMTS AKA capable USIM. + * However, the ME may still choose to only perform GSM AKA, as + * long as the bearer is GERAN */ + if (res_len != vec->res_len) { + if (is_utran) { + LOGVSUBP(LOGL_NOTICE, vsub, + "AUTH via UTRAN but " + "res_len(%u) != vec->res_len(%u)\n", + res_len, vec->res_len); + goto out_false; + } + check_umts = false; + } + } + + if (check_umts) { + if (res_len != vec->res_len + || memcmp(res, vec->res, res_len)) { + LOGVSUBP(LOGL_INFO, vsub, "UMTS AUTH failure:" + " mismatching res (expected res=%s)\n", + osmo_hexdump(vec->res, vec->res_len)); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established UMTS security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_UMTS; + return true; + } else { + if (res_len != sizeof(vec->sres) + || memcmp(res, vec->sres, sizeof(vec->sres))) { + LOGVSUBP(LOGL_INFO, vsub, "GSM AUTH failure:" + " mismatching sres (expected sres=%s)\n", + osmo_hexdump(vec->sres, sizeof(vec->sres))); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established GSM security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_GSM; + return true; + } + +out_false: + vsub->sec_ctx = VLR_SEC_CTX_NONE; + return false; +} + +static void auth_fsm_onenter_failed(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + /* If authentication hasn't even started, e.g. the HLR sent no auth + * info, then we also don't need to tell the HLR about an auth failure. + */ + if (afp->auth_requested) + vlr_subscr_tx_auth_fail_rep(vsub); +} + +static bool is_umts_auth(struct auth_fsm_priv *afp, + uint32_t auth_types) +{ + if (!afp->is_r99) + return false; + if (!(auth_types & OSMO_AUTH_TYPE_UMTS)) + return false; + return true; +} + +/* Terminate the Auth FSM Instance and notify parent */ +static void auth_fsm_term(struct osmo_fsm_inst *fi, enum vlr_auth_fsm_result res) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + LOGPFSM(fi, "Authentication terminating with result %s\n", + vlr_auth_fsm_result_name(res)); + + /* Do one final state transition (mostly for logging purpose) */ + if (res == VLR_AUTH_RES_PASSED) + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTHENTICATED, 0, 0); + else + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTH_FAILED, 0, 0); + + /* return the result to the parent FSM */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, &res); + vsub->auth_fsm = NULL; +} + +/* back-end function transmitting authentication. Caller ensures we have valid + * tuple */ +static int _vlr_subscr_authenticate(struct osmo_fsm_inst *fi) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct gsm_auth_tuple *at; + + /* Caller ensures we have vectors available */ + at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_use_count); + if (!at) { + LOGPFSML(fi, LOGL_ERROR, "A previous check ensured that an" + " auth tuple was available, but now there is in fact" + " none.\n"); + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return -1; + } + + LOGPFSM(fi, "got auth tuple: use_count=%d key_seq=%d\n", + at->use_count, at->key_seq); + + OSMO_ASSERT(at); + + /* Transmit auth req to subscriber */ + afp->auth_requested = true; + vsub->last_tuple = at; + vsub->vlr->ops.tx_auth_req(vsub->msc_conn_ref, at, + is_umts_auth(afp, at->vec.auth_types)); + return 0; +} + +/*********************************************************************** + * FSM State Action functions + ***********************************************************************/ + +/* Initial State of TS 23.018 AUT_VLR */ +static void auth_fsm_needs_auth(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + OSMO_ASSERT(event == VLR_AUTH_E_START); + + /* Start off with the default max_use_count, possibly change that if we + * need to re-use an old tuple. */ + afp->auth_tuple_max_use_count = vsub->vlr->cfg.auth_tuple_max_use_count; + + /* Check if we have vectors available */ + if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_use_count)) { + /* Obtain_Authentication_Sets_VLR */ + vlr_subscr_req_sai(vsub, NULL, NULL); + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + GSM_29002_TIMER_M, 0); + } else { + /* go straight ahead with sending auth request */ + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); + } +} + +/* Waiting for Authentication Info from HLR */ +static void auth_fsm_wait_ai(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + if (event == VLR_AUTH_E_HLR_SAI_NACK) + LOGPFSM(fi, "GSUP: rx Auth Info Error cause: %d: %s\n", + gsup->cause, + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) + || (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) + || (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + if (vsub->vlr->cfg.auth_reuse_old_sets_on_error + && vlr_subscr_has_auth_tuple(vsub, -1)) { + /* To re-use an old tuple, disable the max_use_count + * constraint. */ + afp->auth_tuple_max_use_count = -1; + goto pass; + } + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return; + } + + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for Authentication Response from MS */ +static void auth_fsm_wait_auth_resp(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_instance *vlr = vsub->vlr; + struct vlr_auth_resp_par *par = data; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + } + } else { + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + if (par->auts) { + /* First failure, start re-sync attempt */ + vlr_subscr_req_sai(vsub, par->auts, + vsub->last_tuple->vec.rand); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + GSM_29002_TIMER_M, 0); + } else + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* Waiting for Authentication Info from HLR (resync case) */ +static void auth_fsm_wait_ai_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) || + (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) || + (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + } + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP_RESYNC, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for AUTH RESP from MS (re-sync case) */ +static void auth_fsm_wait_auth_resp_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_auth_resp_par *par = data; + struct vlr_instance *vlr = vsub->vlr; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + /* Result = Aborted */ + auth_fsm_term(fi, VLR_AUTH_RES_ABORTED); + } + } else { + /* Result = Pass */ + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + /* Second failure: Result = Fail */ + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* AUT_VLR waiting for Obtain_IMSI_VLR result */ +static void auth_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + const char *mi_string = data; + + switch (event) { + case VLR_AUTH_E_MS_ID_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else { + strncpy(vsub->imsi, mi_string, sizeof(vsub->imsi)); + vsub->imsi[sizeof(vsub->imsi)-1] = '\0'; + } + /* retry with identity=IMSI */ + afp->by_imsi = true; + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH, 0, 0); + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + break; + } +} + +static const struct osmo_fsm_state auth_fsm_states[] = { + [VLR_SUB_AS_NEEDS_AUTH] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH), + .in_event_mask = S(VLR_AUTH_E_START), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_needs_auth, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_AI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_wait_ai, + }, + [VLR_SUB_AS_WAIT_RESP] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_WAIT_ID_IMSI) | + S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED) | + S(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .action = auth_fsm_wait_auth_resp, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP_RESYNC), + .action = auth_fsm_wait_ai_resync, + }, + [VLR_SUB_AS_WAIT_RESP_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP_RESYNC), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED), + .action = auth_fsm_wait_auth_resp_resync, + }, + [VLR_SUB_AS_WAIT_ID_IMSI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_ID_IMSI), + .in_event_mask = S(VLR_AUTH_E_MS_ID_IMSI), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH), + .action = auth_fsm_wait_imsi, + }, + [VLR_SUB_AS_AUTHENTICATED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTHENTICATED), + .in_event_mask = 0, + .out_state_mask = 0, + }, + [VLR_SUB_AS_AUTH_FAILED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTH_FAILED), + .in_event_mask = 0, + .out_state_mask = 0, + .onenter = auth_fsm_onenter_failed, + }, +}; + +struct osmo_fsm vlr_auth_fsm = { + .name = "VLR_Authenticate", + .states = auth_fsm_states, + .num_states = ARRAY_SIZE(auth_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_auth_event_names, +}; + +/*********************************************************************** + * User API (for SGSN/MSC code) + ***********************************************************************/ + +/* MSC->VLR: Start Procedure Authenticate_VLR (TS 23.012 Ch. 4.1.2.2) */ +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct auth_fsm_priv *afp; + + fi = osmo_fsm_inst_alloc_child(&vlr_auth_fsm, parent, + parent_term_event); + + + afp = talloc_zero(fi, struct auth_fsm_priv); + if (!afp) { + osmo_fsm_inst_dispatch(parent, parent_term_event, 0); + return NULL; + } + + afp->vsub = vsub; + if (vsub->imsi[0]) + afp->by_imsi = true; + afp->is_r99 = is_r99; + afp->is_utran = is_utran; + fi->priv = afp; + vsub->auth_fsm = fi; + + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + + return fi; +} diff --git a/src/libvlr/vlr_auth_fsm.h b/src/libvlr/vlr_auth_fsm.h new file mode 100644 index 0000000..226435f --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.h @@ -0,0 +1,52 @@ +#pragma once + +#include + +/* Parameters to VLR_AUTH_E_MS_AUTH_RESP */ +struct vlr_auth_resp_par { + bool is_r99; + bool is_utran; + const uint8_t *res; + unsigned int res_len; + const uint8_t *auts; +}; + +/* Result communicated back to parent FMS */ +enum vlr_auth_fsm_result { + VLR_AUTH_RES_ABORTED, + VLR_AUTH_RES_UNKNOWN_SUBSCR, + VLR_AUTH_RES_PROC_ERR, + VLR_AUTH_RES_AUTH_FAILED, + VLR_AUTH_RES_PASSED, +}; + +extern const struct value_string vlr_auth_fsm_result_names[]; +static inline const char *vlr_auth_fsm_result_name(enum vlr_auth_fsm_result val) +{ + return get_value_string(vlr_auth_fsm_result_names, val); +} + +enum vlr_fsm_auth_event { + VLR_AUTH_E_START, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo ACK from HLR */ + VLR_AUTH_E_HLR_SAI_ACK, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo NACK from HLR */ + VLR_AUTH_E_HLR_SAI_NACK, + /* FIXME: merge with NACK? */ + VLR_AUTH_E_HLR_SAI_ABORT, + /* Authentication Response from MS */ + VLR_AUTH_E_MS_AUTH_RESP, + /* Authentication Failure from MS */ + VLR_AUTH_E_MS_AUTH_FAIL, + /* Identity Response (IMSI) from MS */ + VLR_AUTH_E_MS_ID_IMSI, +}; + +struct osmo_fsm vlr_auth_fsm; + +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran); diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h new file mode 100644 index 0000000..0e63c7e --- /dev/null +++ b/src/libvlr/vlr_core.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#define LOGGSUPP(level, gsup, fmt, args...) \ + LOGP(DVLR, level, "GSUP(%s) " fmt, \ + (gsup)->imsi, \ + ## args) + +#define LOGVSUBP(level, vsub, fmt, args...) \ + LOGP(DVLR, level, "SUBSCR(%s) " fmt, \ + vlr_subscr_name(vsub), ## args) + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps); +int vlr_subscr_req_sai(struct vlr_subscr *vsub, const uint8_t *auts, + const uint8_t *auts_rand); +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c new file mode 100644 index 0000000..d32659f --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.c @@ -0,0 +1,1424 @@ +/* Osmocom Visitor Location Register (VLR): Location Update FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" + +#define S(x) (1 << (x)) + +#define LU_TIMEOUT_LONG 30 + +enum vlr_fsm_result { + VLR_FSM_RESULT_NONE, + VLR_FSM_RESULT_SUCCESS, + VLR_FSM_RESULT_FAILURE, +}; + + +/*********************************************************************** + * Update_HLR_VLR, TS 23.012 Chapter 4.1.2.4 + ***********************************************************************/ + +enum upd_hlr_vlr_state { + UPD_HLR_VLR_S_INIT, + UPD_HLR_VLR_S_WAIT_FOR_DATA, + UPD_HLR_VLR_S_DONE, +}; + +enum upd_hlr_vlr_evt { + UPD_HLR_VLR_E_START, + UPD_HLR_VLR_E_INS_SUB_DATA, + UPD_HLR_VLR_E_ACT_TRACE_MODE, + UPD_HLR_VLR_E_FW_CHECK_SS_IND, + UPD_HLR_VLR_E_UPD_LOC_ACK, + UPD_HLR_VLR_E_UPD_LOC_NACK, +}; + +static const struct value_string upd_hlr_vlr_event_names[] = { + OSMO_VALUE_STRING(UPD_HLR_VLR_E_START), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_INS_SUB_DATA), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_ACT_TRACE_MODE), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_FW_CHECK_SS_IND), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_ACK), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_NACK), + { 0, NULL } +}; + +static void upd_hlr_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + OSMO_ASSERT(event == UPD_HLR_VLR_E_START); + + /* Send UpdateLocation to HLR */ + vlr_subscr_req_lu(vsub, vsub->vlr->cfg.is_ps); + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_WAIT_FOR_DATA, + LU_TIMEOUT_LONG, 0); +} + +static void upd_hlr_vlr_fsm_wait_data(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case UPD_HLR_VLR_E_INS_SUB_DATA: + /* FIXME: Insert_Subscr_Data_VLR */ + break; + case UPD_HLR_VLR_E_ACT_TRACE_MODE: + /* TODO: Activate_Tracing_VLR */ + break; + case UPD_HLR_VLR_E_FW_CHECK_SS_IND: + /* TODO: Forward Check SS Ind to MSC */ + break; + case UPD_HLR_VLR_E_UPD_LOC_ACK: + /* Inside Update_HLR_VLR after UpdateLocationAck */ + vsub->sub_dataconf_by_hlr_ind = true; + vsub->loc_conf_in_hlr_ind = true; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + case UPD_HLR_VLR_E_UPD_LOC_NACK: + /* Inside Update_HLR_VLR after UpdateLocationNack */ + /* TODO: Check_User_Error_In_Serving_Network_Entity */ + vsub->sub_dataconf_by_hlr_ind = false; + vsub->loc_conf_in_hlr_ind = false; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + /* Data is a pointer to a gsm48_gmm_cause which we + * simply pass through */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, data); + break; + } +} + +static const struct osmo_fsm_state upd_hlr_vlr_states[] = { + [UPD_HLR_VLR_S_INIT] = { + .in_event_mask = S(UPD_HLR_VLR_E_START), + .out_state_mask = S(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_INIT), + .action = upd_hlr_vlr_fsm_init, + }, + [UPD_HLR_VLR_S_WAIT_FOR_DATA] = { + .in_event_mask = S(UPD_HLR_VLR_E_INS_SUB_DATA) | + S(UPD_HLR_VLR_E_ACT_TRACE_MODE) | + S(UPD_HLR_VLR_E_FW_CHECK_SS_IND) | + S(UPD_HLR_VLR_E_UPD_LOC_ACK) | + S(UPD_HLR_VLR_E_UPD_LOC_NACK), + .out_state_mask = S(UPD_HLR_VLR_S_DONE), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .action = upd_hlr_vlr_fsm_wait_data, + }, + [UPD_HLR_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_DONE), + }, +}; + +static struct osmo_fsm upd_hlr_vlr_fsm = { + .name = "upd_hlr_vlr_fsm", + .states = upd_hlr_vlr_states, + .num_states = ARRAY_SIZE(upd_hlr_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = upd_hlr_vlr_event_names, +}; + +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&upd_hlr_vlr_fsm, parent, + parent_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, UPD_HLR_VLR_E_START, NULL); + + return fi; +} + + +/*********************************************************************** + * Subscriber_Present_VLR, TS 29.002 Chapter 25.10.1 + ***********************************************************************/ + +enum sub_pres_vlr_state { + SUB_PRES_VLR_S_INIT, + SUB_PRES_VLR_S_WAIT_FOR_HLR, + SUB_PRES_VLR_S_DONE, +}; + +enum sub_pres_vlr_event { + SUB_PRES_VLR_E_START, + SUB_PRES_VLR_E_READY_SM_CNF, + SUB_PRES_VLR_E_READY_SM_ERR, +}; + +static const struct value_string sub_pres_vlr_event_names[] = { + OSMO_VALUE_STRING(SUB_PRES_VLR_E_START), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_CNF), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_ERR), + { 0, NULL } +}; + +static void sub_pres_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + OSMO_ASSERT(event == SUB_PRES_VLR_E_START); + + if (!vsub->ms_not_reachable_flag) { + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + return; + } + /* FIXME: Send READY_FOR_SM via GSUP */ + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_WAIT_FOR_HLR, + LU_TIMEOUT_LONG, 0); +} + +static void sub_pres_vlr_fsm_wait_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case SUB_PRES_VLR_E_READY_SM_CNF: + vsub->ms_not_reachable_flag = false; + break; + case SUB_PRES_VLR_E_READY_SM_ERR: + break; + } + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +static const struct osmo_fsm_state sub_pres_vlr_states[] = { + [SUB_PRES_VLR_S_INIT] = { + .in_event_mask = S(SUB_PRES_VLR_E_START), + .out_state_mask = S(SUB_PRES_VLR_S_WAIT_FOR_HLR) | + S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_INIT), + .action = sub_pres_vlr_fsm_init, + }, + [SUB_PRES_VLR_S_WAIT_FOR_HLR] = { + .in_event_mask = S(SUB_PRES_VLR_E_READY_SM_CNF) | + S(SUB_PRES_VLR_E_READY_SM_ERR), + .out_state_mask = S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_WAIT_FOR_HLR), + .action = sub_pres_vlr_fsm_wait_hlr, + }, + [SUB_PRES_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_DONE), + }, +}; + +static struct osmo_fsm sub_pres_vlr_fsm = { + .name = "sub_pres_vlr_fsm", + .states = sub_pres_vlr_states, + .num_states = ARRAY_SIZE(sub_pres_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = sub_pres_vlr_event_names, +}; + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&sub_pres_vlr_fsm, parent, + term_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, SUB_PRES_VLR_E_START, NULL); + + return fi; +} + +/*********************************************************************** + * Location_Update_Completion_VLR, TS 23.012 Chapter 4.1.2.3 + ***********************************************************************/ + +enum lu_compl_vlr_state { + LU_COMPL_VLR_S_INIT, + LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_COMPL_VLR_S_WAIT_IMEI, + LU_COMPL_VLR_S_WAIT_IMEI_TMSI, + LU_COMPL_VLR_S_WAIT_TMSI_CNF, + LU_COMPL_VLR_S_DONE, +}; + +enum lu_compl_vlr_event { + LU_COMPL_VLR_E_START, + LU_COMPL_VLR_E_SUB_PRES_COMPL, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, + LU_COMPL_VLR_E_IMEI_CHECK_NACK, + LU_COMPL_VLR_E_NEW_TMSI_ACK, +}; + +static const struct value_string lu_compl_vlr_event_names[] = { + OSMO_VALUE_STRING(LU_COMPL_VLR_E_START), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_SUB_PRES_COMPL), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_ACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_compl_vlr_priv { + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t cause; + bool assign_tmsi; +}; + +static void _vlr_lu_compl_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result, + uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->result = result; + lcvp->cause = cause; + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_DONE, 0, 0); +} + +static void vlr_lu_compl_fsm_success(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + if (!vsub->lu_complete) { + vsub->lu_complete = true; + /* Balanced by vlr_subscr_rx_imsi_detach() */ + vlr_subscr_get(vsub); + } + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_SUCCESS, 0); +} + +static void vlr_lu_compl_fsm_failure(struct osmo_fsm_inst *fi, uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->vsub->vlr->ops.tx_lu_rej(lcvp->msc_conn_ref, cause); + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_FAILURE, cause); +} + +static void vlr_lu_compl_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lcvp->result == VLR_FSM_RESULT_SUCCESS) + ? lcvp->parent_event_success + : lcvp->parent_event_failure, + &lcvp->cause); +} + +static void lu_compl_vlr_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr; + OSMO_ASSERT(vsub); + vlr = vsub->vlr; + OSMO_ASSERT(vlr); + + OSMO_ASSERT(event == LU_COMPL_VLR_E_START); + + /* TODO: National Roaming restrictions? */ + /* TODO: Roaming restriction due to unsupported feature in subscriber + * data? */ + /* TODO: Regional subscription restriction? */ + /* TODO: Administrative restriction of subscribres' access feature? */ + /* TODO: AccessRestrictuionData parameter available? */ + /* TODO: AccessRestrictionData permits RAT? */ + /* Node 1 */ + /* TODO: Autonomous CSG supported in VPLMN and allowed by HPLMN? */ + /* TODO: Hybrid Cel / CSG Cell */ + /* Node 2 */ + vsub->la_allowed = true; + vsub->imsi_detached_flag = false; + /* Start Subscriber_Present_VLR Procedure */ + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_TIMEOUT_LONG, 0); + + lcvp->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + LU_COMPL_VLR_E_SUB_PRES_COMPL); + +} + +static void lu_compl_vlr_new_tmsi(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + if (vlr_subscr_alloc_tmsi(vsub)) { + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_TMSI_CNF, + vlr_timer(vlr, 3250), 3250); + + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, vsub->tmsi_new); +} + +/* After completion of Subscriber_Present_VLR */ +static void lu_compl_vlr_wait_subscr_pres(struct osmo_fsm_inst *fi, + uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_SUB_PRES_COMPL); + + lcvp->sub_pres_vlr_fsm = NULL; + + /* TODO: Trace_Subscriber_Activity_VLR */ + + if (vlr->cfg.check_imei_rqd) { + /* Check IMEI VLR */ + osmo_fsm_inst_state_chg(fi, + lcvp->assign_tmsi ? + LU_COMPL_VLR_S_WAIT_IMEI_TMSI + : LU_COMPL_VLR_S_WAIT_IMEI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lcvp->msc_conn_ref, GSM_MI_TYPE_IMEI); + return; + } + + /* Do we need to allocate a TMSI? */ + if (lcvp->assign_tmsi) { + lu_compl_vlr_new_tmsi(fi); + return; + } + + /* Location Updating Accept */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for completion of CHECK_IMEI_VLR */ +static void lu_compl_vlr_wait_imei(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + switch (event) { + case LU_COMPL_VLR_E_IMEI_CHECK_ACK: + if (!vsub->imei[0]) { + /* Abort: Do nothing */ + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_PROTOCOL_ERROR); + return; + } + /* Pass */ + break; + + case LU_COMPL_VLR_E_IMEI_CHECK_NACK: + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_ILLEGAL_ME); + /* FIXME: IMEI Check Fail to VLR Application (Detach IMSI VLR) */ + return; + } + + /* IMEI is available. Allocate TMSI if needed. */ + if (lcvp->assign_tmsi) { + if (fi->state != LU_COMPL_VLR_S_WAIT_IMEI_TMSI) + LOGPFSML(fi, LOGL_ERROR, + "TMSI required, expected to be in state" + " LU_COMPL_VLR_S_WAIT_IMEI_TMSI," + " am in %s instead\n", + osmo_fsm_state_name(fi->fsm, fi->state)); + /* Logged an error, continue anyway. */ + + lu_compl_vlr_new_tmsi(fi); + + /* Wait for TMSI ack */ + return; + } + + /* No TMSI needed, accept now. */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for TMSI confirmation */ +static void lu_compl_vlr_wait_tmsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_NEW_TMSI_ACK); + + if (!vsub || vsub->tmsi_new == GSM_RESERVED_TMSI) { + LOGPFSML(fi, LOGL_ERROR, "TMSI Realloc Compl implies that" + " the subscriber has a new TMSI allocated, but" + " the new TMSI is unset.\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + vsub->tmsi = vsub->tmsi_new; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + vlr_lu_compl_fsm_success(fi); +} + +static const struct osmo_fsm_state lu_compl_vlr_states[] = { + [LU_COMPL_VLR_S_INIT] = { + .in_event_mask = S(LU_COMPL_VLR_E_START), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_SUB_PRES) | + S(LU_COMPL_VLR_S_WAIT_IMEI), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_INIT), + .action = lu_compl_vlr_init, + }, + [LU_COMPL_VLR_S_WAIT_SUB_PRES] = { + .in_event_mask = S(LU_COMPL_VLR_E_SUB_PRES_COMPL), + .out_state_mask = S(LU_COMPL_VLR_S_WAIT_IMEI) | + S(LU_COMPL_VLR_S_WAIT_IMEI_TMSI) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF) | + S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_SUB_PRES), + .action = lu_compl_vlr_wait_subscr_pres, + }, + [LU_COMPL_VLR_S_WAIT_IMEI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_IMEI_TMSI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI_TMSI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_TMSI_CNF] = { + .in_event_mask = S(LU_COMPL_VLR_E_NEW_TMSI_ACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .action = lu_compl_vlr_wait_tmsi, + }, + [LU_COMPL_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_DONE), + .onenter = vlr_lu_compl_fsm_dispatch_result, + }, +}; + +static struct osmo_fsm lu_compl_vlr_fsm = { + .name = "lu_compl_vlr_fsm", + .states = lu_compl_vlr_states, + .num_states = ARRAY_SIZE(lu_compl_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = lu_compl_vlr_event_names, +}; + +struct osmo_fsm_inst * +lu_compl_vlr_proc_alloc(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_compl_vlr_priv *lcvp; + + fi = osmo_fsm_inst_alloc_child(&lu_compl_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return NULL; + + lcvp = talloc_zero(fi, struct lu_compl_vlr_priv); + lcvp->vsub = vsub; + lcvp->msc_conn_ref = msc_conn_ref; + lcvp->parent_event_success = parent_event_success; + lcvp->parent_event_failure = parent_event_failure; + lcvp->assign_tmsi = assign_tmsi; + fi->priv = lcvp; + + return fi; +} + + +/*********************************************************************** + * Update_Location_Area_VLR, TS 23.012 Chapter 4.1.2.1 + ***********************************************************************/ + +static const struct value_string fsm_lu_event_names[] = { + OSMO_VALUE_STRING(VLR_ULA_E_UPDATE_LA), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_ACK), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_NACK), + OSMO_VALUE_STRING(VLR_ULA_E_AUTH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_CIPH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMSI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEISV), + OSMO_VALUE_STRING(VLR_ULA_E_HLR_LU_RES), + OSMO_VALUE_STRING(VLR_ULA_E_UPD_HLR_COMPL), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_SUCCESS), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_FAILURE), + OSMO_VALUE_STRING(VLR_ULA_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_fsm_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *upd_hlr_vlr_fsm; + struct osmo_fsm_inst *lu_compl_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t rej_cause; + + enum vlr_lu_type type; + bool lu_by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id old_lai; + struct osmo_location_area_id new_lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool assign_tmsi; +}; + + +/* Determine if given location area is served by this VLR */ +static bool lai_in_this_vlr(struct vlr_instance *vlr, + const struct osmo_location_area_id *lai) +{ + /* TODO: VLR needs to keep a locally configued list of LAIs */ + return true; +} + +/* Determine if authentication is required */ +static bool is_auth_required(struct lu_fsm_priv *lfp) +{ + /* 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); +} + +/* Determine if ciphering is required */ +static bool is_ciph_required(struct lu_fsm_priv *lfp) +{ + return lfp->ciphering_required != VLR_CIPH_NONE; +} + +/* Determine if a HLR Update is required */ +static bool hlr_update_needed(struct vlr_subscr *vsub) +{ + /* TODO: properly decide this, rather than always assuming we + * need to update the HLR. */ + return true; +} + +static void lu_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lfp->result == VLR_FSM_RESULT_SUCCESS) + ? lfp->parent_event_success + : lfp->parent_event_failure, + lfp->parent_event_data); +} + +static void _lu_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->result = result; + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_DONE, 0, 0); +} + +static void lu_fsm_success(struct osmo_fsm_inst *fi) +{ + _lu_fsm_done(fi, VLR_FSM_RESULT_SUCCESS); +} + +static void lu_fsm_failure(struct osmo_fsm_inst *fi, uint8_t rej_cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (rej_cause) + lfp->vlr->ops.tx_lu_rej(lfp->msc_conn_ref, rej_cause); + _lu_fsm_done(fi, VLR_FSM_RESULT_FAILURE); +} + +static void vlr_loc_upd_start_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->lu_compl_vlr_fsm = + lu_compl_vlr_proc_alloc(fi, lfp->vsub, lfp->msc_conn_ref, + VLR_ULA_E_LU_COMPL_SUCCESS, + VLR_ULA_E_LU_COMPL_FAILURE, + lfp->assign_tmsi); + + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, LU_COMPL_VLR_E_START, NULL); +} + +static void lu_fsm_discard_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!lfp->lu_compl_vlr_fsm) + return; + osmo_fsm_inst_term(lfp->lu_compl_vlr_fsm, OSMO_FSM_TERM_PARENT, NULL); +} + +/* 4.1.2.1 Node 4 */ +static void vlr_loc_upd_node_4(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + bool hlr_unknown = false; + + LOGPFSM(fi, "%s()\n", __func__); + + if (hlr_unknown) { + /* FIXME: Delete subscriber record */ + /* LU REJ: Roaming not allowed */ + lu_fsm_failure(fi, GSM48_REJECT_ROAMING_NOT_ALLOWED); + } else { + /* Update_HLR_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_HLR_UPD, + LU_TIMEOUT_LONG, 0); + lfp->upd_hlr_vlr_fsm = + upd_hlr_vlr_proc_start(fi, vsub, VLR_ULA_E_UPD_HLR_COMPL); + } +} + +/* 4.1.2.1 Node B */ +static void vlr_loc_upd_node_b(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + + /* FIXME */ + if (0) { /* IMEISV or PgA to send */ + vlr_loc_upd_node_4(fi); + } else { + /* Location_Update_Completion */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } +} + +/* Non-standard: after Ciphering Mode Complete (or no ciph required) */ +static void vlr_loc_upd_post_ciph(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + vsub->conf_by_radio_contact_ind = true; + /* Update LAI */ + vsub->cgi.lai = lfp->new_lai; + vsub->dormant_ind = false; + vsub->cancel_loc_rx = false; + if (hlr_update_needed(vsub)) { + vlr_loc_upd_node_4(fi); + } else { + /* TODO: ADD Support */ + /* TODO: Node A: PgA Support */ + vlr_loc_upd_node_b(fi); + } +} + +/* 4.1.2.1 after Authentication successful (or no auth rqd) */ +static void vlr_loc_upd_post_auth(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (!is_ciph_required(lfp)) { + vlr_loc_upd_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, lfp->msc_conn_ref, + lfp->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_CIPH, LU_TIMEOUT_LONG, 0); +} + +static void vlr_loc_upd_node1(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (is_auth_required(lfp)) { + /* Authenticate_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_AUTH, + LU_TIMEOUT_LONG, 0); + vsub->auth_fsm = auth_fsm_start(lfp->vsub, fi->log_level, + fi, VLR_ULA_E_AUTH_RES, + lfp->is_r99, + lfp->is_utran); + } else { + /* no need for authentication */ + vlr_loc_upd_post_auth(fi); + } +} + +static void vlr_loc_upd_want_imsi(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(lfp->vsub); + + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMSI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMSI); + /* will continue at vlr_loc_upd_node1() once IMSI arrives */ +} + +static int assoc_lfp_with_sub(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + if (vsub->lu_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "A Location Updating process is already pending for" + " this subscriber. Aborting.\n"); + /* Also get rid of the other pending LU attempt? */ + /*lu_fsm_failure(vsub->lu_fsm, GSM48_REJECT_CONGESTION);*/ + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); + return -EINVAL; + } + vsub->lu_fsm = fi; + vsub->msc_conn_ref = lfp->msc_conn_ref; + /* FIXME: send new LAC to HLR? */ + vsub->lac = lfp->new_lai.lac; + lfp->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(lfp->msc_conn_ref, lfp->vsub); + return 0; +} + +static const char *lai_name(struct osmo_location_area_id *lai) +{ + static char buf[64]; + snprintf(buf, sizeof(buf),"MCC:%u, MNC:%u, LAC:%u", + lai->plmn.mcc, lai->plmn.mnc, lai->lac); + return buf; +} + +/* 4.1.2.1: Subscriber (via MSC/SGSN) requests location update */ +static void _start_lu_main(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + struct vlr_subscr *vsub = NULL; + bool created; + + /* TODO: PUESBINE related handling */ + + /* Is previous LAI in this VLR? */ + if (!lai_in_this_vlr(vlr, &lfp->old_lai)) { +#if 0 + /* FIXME: check previous VLR, (3) */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_PVLR, + LU_TIMEOUT_LONG, 0); + return; +#endif + LOGPFSML(fi, LOGL_NOTICE, "LAI change from %s," + " but checking previous VLR not implemented\n", + lai_name(&lfp->old_lai)); + } + + if (!lfp->imsi[0]) { + /* TMSI was used */ + lfp->lu_by_tmsi = true; + /* TMSI clash: if a different subscriber already has this TMSI, + * we will find that other subscriber in the VLR. So the IMSIs + * would mismatch, but we don't know about it. Theoretically, + * an authentication process would thwart any attempt to use + * someone else's TMSI. + * TODO: Otherwise we can ask for the IMSI and verify that it + * matches the IMSI on record. */ + vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, + &created); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + + if (created) + vlr_loc_upd_want_imsi(fi); + else + vlr_loc_upd_node1(fi); + /* We cannot have MSC area change, as the VLR + * serves only one MSC */ + vlr_subscr_put(vsub); + } else { + /* IMSI was used */ + vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + vlr_subscr_put(vsub); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + vlr_loc_upd_node1(fi); + vlr_subscr_put(vsub); + } +} + + +static void lu_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + OSMO_ASSERT(event == VLR_ULA_E_UPDATE_LA); + + if (1) { // FIXME + //if (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0]) + /* R_IMEISV_IR1 passed */ + _start_lu_main(fi); + } else { + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMEISV); + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMEISV, + vlr_timer(vlr, 3270), 3270); + } +} + +static void lu_fsm_wait_imeisv(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_ID_IMEISV: + /* FIXME: copy IMEISV */ + _start_lu_main(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for response from Send_Identification to PVLR */ +static void lu_fsm_wait_pvlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_SEND_ID_ACK: + vlr_loc_upd_node1(fi); + break; + case VLR_ULA_E_SEND_ID_NACK: + vlr_loc_upd_want_imsi(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for result of Authenticate_VLR procedure */ +static void lu_fsm_wait_auth(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + enum vlr_auth_fsm_result *res = data; + uint8_t rej_cause = 0; + + OSMO_ASSERT(event == VLR_ULA_E_AUTH_RES); + + lfp->upd_hlr_vlr_fsm = NULL; + + if (res) { + switch (*res) { + case VLR_AUTH_RES_PASSED: + /* Result == Pass */ + vlr_loc_upd_post_auth(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* go to Idle with no response */ + rej_cause = 0; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* FIXME: delete subscribe record */ + rej_cause = GSM48_REJECT_IMSI_UNKNOWN_IN_HLR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* cause = illegal subscriber */ + rej_cause = GSM48_REJECT_ILLEGAL_MS; + break; + case VLR_AUTH_RES_PROC_ERR: + /* cause = system failure */ + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } + } else + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + + lu_fsm_failure(fi, rej_cause); +} + +static void lu_fsm_wait_ciph(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == VLR_ULA_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + } + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + vlr_loc_upd_post_ciph(fi); +} + +static void lu_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + char *mi_string = data; + + switch (event) { + case VLR_ULA_E_ID_IMSI: + vlr_subscr_set_imsi(vsub, mi_string); + vlr_loc_upd_node1(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* At the end of Update_HLR_VLR */ +static void lu_fsm_wait_hlr_ul_res(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + + switch (event) { + case VLR_ULA_E_HLR_LU_RES: + /* pass-through this event to Update_HLR_VLR */ + if (data == NULL) + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_ACK, NULL); + else + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_NACK, data); + break; + case VLR_ULA_E_UPD_HLR_COMPL: + if (data == NULL) { + /* successful case */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + /* continue in MSC ?!? */ + } else { + /* unsuccessful case */ + enum gsm48_gmm_cause cause = + *(enum gsm48_gmm_cause *)data; + if (0 /* procedure_error && vlr->cfg.standalone_mode */) { + osmo_fsm_inst_state_chg(fi, + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } else { + lu_fsm_failure(fi, cause); + } + } + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR */ +static void lu_fsm_wait_lu_compl(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_ID_IMEI: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + + /* Update Register */ + /* TODO: Set_Notification_Type 23.078 */ + /* TODO: Notify_gsmSCF 23.078 */ + /* TODO: Authenticated Radio Contact Established -> ARC */ + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR (standalone case) */ +static void lu_fsm_wait_lu_compl_standalone(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + vsub->sub_dataconf_by_hlr_ind = false; + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + vsub->sub_dataconf_by_hlr_ind = false; + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +static const struct osmo_fsm_state vlr_lu_fsm_states[] = { + [VLR_ULA_S_IDLE] = { + .in_event_mask = S(VLR_ULA_E_UPDATE_LA), + .out_state_mask = S(VLR_ULA_S_WAIT_IMEISV) | + S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_IDLE), + .action = lu_fsm_idle, + }, + [VLR_ULA_S_WAIT_IMEISV] = { + .in_event_mask = S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMEISV), + .action = lu_fsm_wait_imeisv, + }, + [VLR_ULA_S_WAIT_PVLR] = { + .in_event_mask = S(VLR_ULA_E_SEND_ID_ACK) | + S(VLR_ULA_E_SEND_ID_NACK), + .out_state_mask = S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_PVLR), + .action = lu_fsm_wait_pvlr, + }, + [VLR_ULA_S_WAIT_AUTH] = { + .in_event_mask = S(VLR_ULA_E_AUTH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_CIPH) | + S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_AUTH), + .action = lu_fsm_wait_auth, + }, + [VLR_ULA_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_CIPH), + .in_event_mask = S(VLR_ULA_E_CIPH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .action = lu_fsm_wait_ciph, + }, + [VLR_ULA_S_WAIT_IMSI] = { + .in_event_mask = S(VLR_ULA_E_ID_IMSI), + .out_state_mask = S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMSI), + .action = lu_fsm_wait_imsi, + }, + [VLR_ULA_S_WAIT_HLR_UPD] = { + .in_event_mask = S(VLR_ULA_E_HLR_LU_RES) | + S(VLR_ULA_E_UPD_HLR_COMPL), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_HLR_UPD), + .action = lu_fsm_wait_hlr_ul_res, + }, + [VLR_ULA_S_WAIT_LU_COMPL] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK) | + S(VLR_ULA_E_ID_IMEI) | + S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL), + .action = lu_fsm_wait_lu_compl, + }, + [VLR_ULA_S_WAIT_LU_COMPL_STANDALONE] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE), + .action = lu_fsm_wait_lu_compl_standalone, + }, + [VLR_ULA_S_DONE] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_DONE), + .onenter = lu_fsm_dispatch_result, + }, +}; + +static void fsm_lu_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "fsm_lu_cleanup called with cause %s\n", + osmo_fsm_term_cause_name(cause)); + if (vsub && vsub->lu_fsm == fi) + vsub->lu_fsm = NULL; +} + +static struct osmo_fsm vlr_lu_fsm = { + .name = "vlr_lu_fsm", + .states = vlr_lu_fsm_states, + .num_states = ARRAY_SIZE(vlr_lu_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_lu_event_names, + .cleanup = fsm_lu_cleanup, +}; + +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_fsm_priv *lfp; + + fi = osmo_fsm_inst_alloc_child(&vlr_lu_fsm, parent, parent_event_failure); + if (!fi) + return NULL; + + lfp = talloc_zero(fi, struct lu_fsm_priv); + lfp->vlr = vlr; + lfp->msc_conn_ref = msc_conn_ref; + lfp->tmsi = tmsi; + lfp->type = type; + lfp->old_lai = *old_lai; + lfp->new_lai = *new_lai; + lfp->lu_by_tmsi = true; + lfp->parent_event_success = parent_event_success; + lfp->parent_event_failure = parent_event_failure; + lfp->parent_event_data = parent_event_data; + lfp->authentication_required = authentication_required; + lfp->ciphering_required = ciphering_required; + lfp->is_r99 = is_r99; + lfp->is_utran = is_utran; + lfp->assign_tmsi = assign_tmsi; + if (imsi) { + strncpy(lfp->imsi, imsi, sizeof(lfp->imsi)-1); + lfp->imsi[sizeof(lfp->imsi)-1] = '\0'; + lfp->lu_by_tmsi = false; + } + fi->priv = lfp; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + osmo_fsm_inst_dispatch(fi, VLR_ULA_E_UPDATE_LA, NULL); + + return fi; +} + +/* Gracefully terminate an FSM created by vlr_loc_update() in case of external + * timeout (i.e. from MSC). */ +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == VLR_ULA_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); +} + +void vlr_lu_fsm_init(void) +{ + osmo_fsm_register(&vlr_lu_fsm); + osmo_fsm_register(&upd_hlr_vlr_fsm); + osmo_fsm_register(&sub_pres_vlr_fsm); + osmo_fsm_register(&lu_compl_vlr_fsm); +} diff --git a/src/libvlr/vlr_lu_fsm.h b/src/libvlr/vlr_lu_fsm.h new file mode 100644 index 0000000..5cf13c7 --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +enum vlr_lu_state { + VLR_ULA_S_IDLE, + VLR_ULA_S_WAIT_IMEISV, + VLR_ULA_S_WAIT_PVLR, /* Waiting for ID from PVLR */ + VLR_ULA_S_WAIT_AUTH, /* Waiting for Authentication */ + VLR_ULA_S_WAIT_CIPH, /* Waiting for Ciphering Complete */ + VLR_ULA_S_WAIT_IMSI, /* Waiting for IMSI from MS */ + VLR_ULA_S_WAIT_HLR_UPD, /* Waiting for end of HLR update */ + VLR_ULA_S_WAIT_LU_COMPL,/* Waiting for LU complete */ + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, /* Standalone VLR */ + VLR_ULA_S_DONE +}; + +void vlr_lu_fsm_init(void); diff --git a/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am index f4ef487..a99334d 100644 --- a/src/osmo-nitb/Makefile.am +++ b/src/osmo-nitb/Makefile.am @@ -32,6 +32,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libvlr/libvlr.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 10 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jul 21 16:37:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 21 Jul 2017 16:37:10 +0000 Subject: [PATCH] osmo-msc[master]: Use libvlr in libmsc (large refactoring) 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/3195 to look at the new patch set (#9). Use libvlr in libmsc (large refactoring) Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Remove/Disable VTY and CTRL commands to create subscribers, which is now a task of the OsmoHLR. Adjust the python tests accordingly. Remove VTY cmd subscriber-keep-in-ram. Use OSMO_GSUP_PORT = 4222 instead of 2222. See I4222e21686c823985be8ff1f16b1182be8ad6175. So far use the LAC from conn->bts, will be replaced by conn->lac in Id3705236350d5f69e447046b0a764bbabc3d493c. Related: OS#1592 OS#1974 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 --- M configure.ac M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-nitb/rbs2308/openbsc.cfg M include/openbsc/Makefile.am M include/openbsc/abis_rsl.h M include/openbsc/auth.h M include/openbsc/bsc_api.h M include/openbsc/chan_alloc.h M include/openbsc/db.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/gsm_subscriber.h M include/openbsc/osmo_msc.h M include/openbsc/signal.h M include/openbsc/silent_call.h D include/openbsc/token_auth.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M src/gprs/sgsn_main.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/paging.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/meas_feed.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c D src/libmsc/token_auth.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr_access_req_fsm.c M src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/ctrl_test_runner.py M tests/db/db_test.c D tests/mm_auth/Makefile.am D tests/mm_auth/mm_auth_test.c D tests/mm_auth/mm_auth_test.ok A tests/sms_queue/Makefile.am A tests/sms_queue/sms_queue_test.c A tests/sms_queue/sms_queue_test.err A tests/sms_queue/sms_queue_test.ok M tests/subscr/Makefile.am D tests/subscr/subscr_test.c D tests/subscr/subscr_test.ok M tests/testsuite.at M tests/vty_test_runner.py 74 files changed, 2,166 insertions(+), 4,244 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3195/9 -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From admin at opensuse.org Fri Jul 21 19:53:44 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 21 Jul 2017 19:53:44 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59725be19236d_5ccba0cf80204310@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 214s] -[..] Encoding / Decoding cycle : OK [ 214s] -[..] Encoding / Decoding cycle : OK [ 214s] -[..] Encoding / Decoding cycle : OK [ 214s] - [ 214s] -[+] Testing: gsm0503_mcs9 [ 214s] -[.] Input length : ret = 606 exp = 606 -> OK [ 214s] -[.] Output length : ret = 1836 exp = 1836 -> OK [ 214s] -[.] Random vector checks: [ 214s] -[..] Encoding / Decoding cycle : OK [ 214s] -[..] Encoding / Decoding cycle : OK [ 214s] -[..] Encoding / Decoding cycle : OK [ 214s] - [ 214s] ./testsuite.at:57: exit code was 132, expected 0 [ 214s] 9. testsuite.at:54: 9. conv_gsm0503 (testsuite.at:54): FAILED (testsuite.at:57) [ 214s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 214s] make[1]: *** [override_dh_auto_test] Error 1 [ 214s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 214s] debian/rules:15: recipe for target 'build' failed [ 214s] make: *** [build] Error 2 [ 214s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 214s] [ 214s] build36 failed "build libosmocore_0.9.6.20170721.dsc" at Fri Jul 21 19:53:22 UTC 2017. [ 214s] [ 214s] ### VM INTERACTION START ### [ 217s] [ 199.283855] reboot: Power down [ 219s] ### VM INTERACTION END ### [ 219s] [ 219s] build36 failed "build libosmocore_0.9.6.20170721.dsc" at Fri Jul 21 19:53:29 UTC 2017. [ 219s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 21 21:00:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 21:00:01 +0000 Subject: [PATCH] osmo-pcu[master]: Introduce GSMTAP categories Message-ID: Review at https://gerrit.osmocom.org/3337 Introduce GSMTAP categories When looking at GSMTAP output so far, one is easily overwhelmed by way too much information being presented. A lot of is consists of DUMMY frames, which are probably of lowest interest, ever. A concept similar to the "gsmtap-sapi" of OsmoBTS is introduced, by which the user can configure which particular categories (uplink or downlink control or data, gprs or egprs, ...) he actually wants to see in his logs. Change-Id: I297183690e98a7234dfc1608c18847d8981306e4 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_sched.cpp M src/osmo-bts-litecell15/lc15_l1_if.c M src/osmo-bts-sysmo/sysmo_l1_if.c M src/pcu_l1_if.cpp M src/pcu_vty.c 7 files changed, 182 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/37/3337/1 diff --git a/src/bts.cpp b/src/bts.cpp index 2d289d7..5d1a500 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -35,6 +35,7 @@ #include #include #include + #include } #include @@ -360,6 +361,23 @@ LOGP(DRLCMAC, LOGL_INFO, "No paging, because no TBF\n"); return 0; +} + +void BTS::send_gsmtap(enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no, + uint8_t ts_no, uint8_t channel, uint32_t fn, + const uint8_t *data, unsigned int len) +{ + uint16_t arfcn; + + /* check if category is activated at all */ + if (!(m_bts.gsmtap_categ_mask & (1 << categ))) + return; + + arfcn = m_bts.trx[trx_no].arfcn; + if (uplink) + arfcn |= GSMTAP_ARFCN_F_UPLINK; + + gsmtap_send(m_bts.gsmtap, arfcn, ts_no, channel, 0, fn, 0, 0, data, len); } gprs_rlcmac_dl_tbf *BTS::dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) @@ -1488,13 +1506,19 @@ /* Received Uplink RLC control block. */ int gprs_rlcmac_pdch::rcv_control_block( - bitvec *rlc_block, uint32_t fn) + 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: @@ -1544,10 +1568,10 @@ "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); if (cs.isGprs()) - return rcv_block_gprs(data, fn, meas, cs); + return rcv_block_gprs(data, len, fn, meas, cs); if (cs.isEgprs()) - return rcv_data_block(data, fn, meas, cs); + return rcv_data_block(data, len, fn, meas, cs); bts()->decode_error(); LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", @@ -1556,7 +1580,7 @@ } /*! \brief process egprs and gprs data blocks */ -int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint32_t fn, +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; @@ -1574,6 +1598,9 @@ cs.name()); return -EINVAL; } + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + } else { + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); } LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); @@ -1606,7 +1633,7 @@ return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); } -int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint32_t fn, +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; @@ -1616,14 +1643,14 @@ switch (payload) { case GPRS_RLCMAC_DATA_BLOCK: - rc = rcv_data_block(data, fn, meas, cs); + 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(block, fn); + rc = rcv_control_block(data, data_len, block, fn); bitvec_free(block); break; case GPRS_RLCMAC_CONTROL_BLOCK_OPT: diff --git a/src/bts.h b/src/bts.h index 78ed002..66875f1 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,20 @@ #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +/* see bts->gsmtap_categ_mask */ +enum pcu_gsmtap_category { + PCU_GSMTAP_C_DL_UNKNOWN = 0, /* unknown or undecodable downlink blocks */ + PCU_GSMTAP_C_DL_DUMMY = 1, /* downlink dummy blocks */ + PCU_GSMTAP_C_DL_CTRL = 2, /* downlink control blocks */ + PCU_GSMTAP_C_DL_DATA_GPRS = 3, /* downlink GPRS data blocks */ + PCU_GSMTAP_C_DL_DATA_EGPRS = 4, /* downlink EGPRS data blocks */ + + PCU_GSMTAP_C_UL_UNKNOWN = 15, /* unknown or undecodable uplink blocks */ + PCU_GSMTAP_C_UL_DUMMY = 16, /* uplink dummy blocks */ + PCU_GSMTAP_C_UL_CTRL = 17, /* uplink control blocks */ + PCU_GSMTAP_C_UL_DATA_GPRS = 18, /* uplink GPRS data blocks */ + PCU_GSMTAP_C_UL_DATA_EGPRS = 19, /* uplink EGPRS data blocks */ +}; struct BTS; struct GprsMs; @@ -68,9 +82,9 @@ /* 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, uint32_t fn, + 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, uint32_t fn, + 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; @@ -107,7 +121,7 @@ #ifdef __cplusplus private: - int rcv_control_block(bitvec *rlc_block, uint32_t fn); + 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); @@ -186,6 +200,7 @@ uint8_t n3103; uint8_t n3105; 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, @@ -362,6 +377,10 @@ GprsMs *ms_by_imsi(const char *imsi); GprsMs *ms_alloc(uint8_t ms_class, uint8_t egprs_ms_class = 0); + void send_gsmtap(enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no, + uint8_t ts_no, uint8_t channel, uint32_t fn, + const uint8_t *data, unsigned int len); + /* * Statistics */ diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a21c023..e5c8ec8 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -356,22 +356,29 @@ /* Prio 1: select control message */ msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); - if (msg) + if (msg) { bts->bts->rlc_sent_control(); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + } /* Prio 2: select data message for downlink */ if (!msg) { msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); - if (msg) + if (msg) { bts->bts->rlc_sent(); + /* FIXME: distinguish between GPRS and EGPRS */ + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + } } /* Prio 3: send dummy contol message */ if (!msg) { /* increase counter */ msg = sched_dummy(); - if (msg) + if (msg) { bts->bts->rlc_sent_dummy(); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + } } if (!msg) diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c index 12a977b..c82ddba 100644 --- a/src/osmo-bts-litecell15/lc15_l1_if.c +++ b/src/osmo-bts-litecell15/lc15_l1_if.c @@ -199,11 +199,6 @@ if (data_ind->msgUnitParam.u8Size == 0) return -1; - gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, - data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, - data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, - data_ind->msgUnitParam.u8Size-1); - get_meas(&meas, &data_ind->measParam); bts_update_tbf_ta("PH-DATA", data_ind->u32Fn, fl1h->trx_no, data_ind->u8Tn, qta2ta(meas.bto)); @@ -216,7 +211,7 @@ != GsmL1_PdtchPlType_Full) break; /* PDTCH / PACCH frame handling */ - pcu_rx_data_ind_pdtch(fl1h->trx_no, data_ind->u8Tn, + rc = pcu_rx_data_ind_pdtch(fl1h->trx_no, data_ind->u8Tn, data_ind->msgUnitParam.u8Buffer + 1, data_ind->msgUnitParam.u8Size - 1, data_ind->u32Fn, @@ -224,11 +219,19 @@ break; case GsmL1_Sapi_Ptcch: // FIXME + rc = -1; break; default: LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", get_value_string(lc15bts_l1sapi_names, data_ind->sapi)); break; + } + + if (rc < 0) { + gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, + data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, + data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, + data_ind->msgUnitParam.u8Size-1); } return rc; @@ -321,12 +324,6 @@ msu_param = &data_req->msgUnitParam; msu_param->u8Size = len; memcpy(msu_param->u8Buffer, data, len); - - gsmtap_send(fl1h->gsmtap, arfcn, data_req->u8Tn, GSMTAP_CHANNEL_PACCH, - 0, data_req->u32Fn, 0, 0, - data_req->msgUnitParam.u8Buffer, - data_req->msgUnitParam.u8Size); - /* transmit */ if (osmo_wqueue_enqueue(&fl1h->write_q[MQ_PDTCH_WRITE], msg) != 0) { diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index 8994ac3..9170972 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -184,11 +184,6 @@ if (data_ind->msgUnitParam.u8Size == 0) return -1; - gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, - data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, - data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, - data_ind->msgUnitParam.u8Size-1); - get_meas(&meas, &data_ind->measParam); bts_update_tbf_ta("PH-DATA", data_ind->u32Fn, fl1h->trx_no, data_ind->u8Tn, qta2ta(meas.bto)); @@ -209,11 +204,21 @@ break; case GsmL1_Sapi_Ptcch: // FIXME + rc = -1; break; default: LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", get_value_string(femtobts_l1sapi_names, data_ind->sapi)); + rc = -1; break; + } + + if (rc < 0) { + gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, + data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, + data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, + data_ind->msgUnitParam.u8Size-1); + //send_gsmtap(PCU_GSMTAP_C_UL_UNKNOWN, true, 0, date_ind->u8Tn, GSMTAP_CHANNEL_PACCH, data_ind->u32Fn, data_ind->msgUnitParam.u8Buffer+1, data_ind->msgUnitParam.u8Size-1); } return rc; @@ -308,12 +313,6 @@ msu_param = &data_req->msgUnitParam; msu_param->u8Size = len; memcpy(msu_param->u8Buffer, data, len); - - gsmtap_send(fl1h->gsmtap, arfcn, data_req->u8Tn, GSMTAP_CHANNEL_PACCH, - 0, data_req->u32Fn, 0, 0, - data_req->msgUnitParam.u8Buffer, - data_req->msgUnitParam.u8Size); - /* transmit */ if (osmo_wqueue_enqueue(&fl1h->write_q[MQ_PDTCH_WRITE], msg) != 0) { diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index c2c6cc6..420bca0 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -165,7 +165,6 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr, @@ -245,8 +244,9 @@ return pdch->rcv_block(data, len, fn, meas); } -static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind, struct gsmtap_inst *gsmtap) +static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind) { + struct gprs_rlcmac_bts *bts = bts_main_data(); int rc; pcu_l1_meas meas; meas.set_rssi(data_ind->rssi); @@ -264,13 +264,6 @@ data_ind->arfcn, data_ind->block_nr, osmo_hexdump(data_ind->data, data_ind->len)); - rc = gsmtap_send(gsmtap, data_ind->arfcn | GSMTAP_ARFCN_F_UPLINK, data_ind->ts_nr, - GSMTAP_CHANNEL_PACCH, 0, data_ind->fn, 0, 0, data_ind->data, data_ind->len); - if (rc < 0) - LOGP(DL1IF, LOGL_ERROR, "Sending RX data via GSMTAP failed: %d\n", rc); - - rc = 0; - switch (data_ind->sapi) { case PCU_IF_SAPI_PDTCH: rc = pcu_rx_data_ind_pdtch(data_ind->trx_nr, data_ind->ts_nr, @@ -281,6 +274,11 @@ LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with " "unsupported sapi %d\n", data_ind->sapi); rc = -EINVAL; + } + + if (rc < 0 && (bts->gsmtap_categ_mask & PCU_GSMTAP_C_UL_UNKNOWN)) { + gsmtap_send(bts->gsmtap, data_ind->arfcn | GSMTAP_ARFCN_F_UPLINK, data_ind->ts_nr, + GSMTAP_CHANNEL_PACCH, 0, data_ind->fn, 0, 0, data_ind->data, data_ind->len); } return rc; @@ -568,11 +566,10 @@ int pcu_rx(uint8_t msg_type, struct gsm_pcu_if *pcu_prim) { int rc = 0; - struct gprs_rlcmac_bts *bts = bts_main_data(); switch (msg_type) { case PCU_IF_MSG_DATA_IND: - rc = pcu_rx_data_ind(&pcu_prim->u.data_ind, bts->gsmtap); + rc = pcu_rx_data_ind(&pcu_prim->u.data_ind); break; case PCU_IF_MSG_DATA_CNF: rc = pcu_rx_data_cnf(&pcu_prim->u.data_cnf); @@ -597,6 +594,6 @@ msg_type); rc = -EINVAL; } - +; return rc; } diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 3b5996c..fc57a5f 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -16,6 +16,70 @@ #include "pcu_vty_functions.h" +extern void *tall_pcu_ctx; + +static const struct value_string pcu_gsmtap_categ_names[] = { + { PCU_GSMTAP_C_DL_UNKNOWN, "dl-unknown" }, + { PCU_GSMTAP_C_DL_DUMMY, "dl-dummy" }, + { PCU_GSMTAP_C_DL_CTRL, "dl-ctrl" }, + { PCU_GSMTAP_C_DL_DATA_GPRS, "dl-data-gprs" }, + { PCU_GSMTAP_C_DL_DATA_EGPRS, "dl-data-egprs" }, + + { PCU_GSMTAP_C_UL_UNKNOWN, "ul-unknown" }, + { PCU_GSMTAP_C_UL_DUMMY, "ul-dummy" }, + { PCU_GSMTAP_C_UL_CTRL, "ul-ctrl" }, + { PCU_GSMTAP_C_UL_DATA_GPRS, "ul-data-gprs" }, + { PCU_GSMTAP_C_UL_DATA_EGPRS, "ul-data-egprs" }, + + { 0, NULL } +}; + +static const struct value_string pcu_gsmtap_categ_help[] = { + { PCU_GSMTAP_C_DL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" }, + { PCU_GSMTAP_C_DL_DUMMY, "Downlink Dummy Blocks" }, + { PCU_GSMTAP_C_DL_CTRL, "Downlink Control Blocks" }, + { PCU_GSMTAP_C_DL_DATA_GPRS, "Downlink Data Blocks (GPRS)" }, + { PCU_GSMTAP_C_DL_DATA_EGPRS, "Downlink Data Blocks (EGPRS)" }, + + { PCU_GSMTAP_C_UL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" }, + { PCU_GSMTAP_C_UL_DUMMY, "Uplink Dummy Blocks" }, + { PCU_GSMTAP_C_UL_CTRL, "Uplink Control Blocks" }, + { PCU_GSMTAP_C_UL_DATA_GPRS, "Uplink Data Blocks (GPRS)" }, + { PCU_GSMTAP_C_UL_DATA_EGPRS, "Uplink Data Blocks (EGPRS)" }, + + { 0, NULL } +}; + + +DEFUN(cfg_pcu_gsmtap_categ, cfg_pcu_gsmtap_categ_cmd, "HIDDEN", "HIDDEN") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + int categ; + + categ = get_string_value(pcu_gsmtap_categ_names, argv[0]); + if (categ < 0) + return CMD_WARNING; + + bts->gsmtap_categ_mask |= (1 << categ); + + return CMD_SUCCESS; +} + +DEFUN(cfg_pcu_no_gsmtap_categ, cfg_pcu_no_gsmtap_categ_cmd, "HIDDEN", "HIDDEN") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + int categ; + + categ = get_string_value(pcu_gsmtap_categ_names, argv[0]); + if (categ < 0) + return CMD_WARNING; + + bts->gsmtap_categ_mask &= ~(1 << categ); + + return CMD_SUCCESS; +} + + int pcu_vty_go_parent(struct vty *vty) { switch (vty->node) { @@ -53,6 +117,7 @@ static int config_write_pcu(struct vty *vty) { struct gprs_rlcmac_bts *bts = bts_main_data(); + unsigned int i; vty_out(vty, "pcu%s", VTY_NEWLINE); if (bts->egprs_enabled) @@ -166,6 +231,14 @@ if (bts->dl_tbf_idle_msec) vty_out(vty, " dl-tbf-idle-time %d%s", bts->dl_tbf_idle_msec, VTY_NEWLINE); + + for (i = 0; i < 32; i++) { + unsigned int cs = (1 << i); + if (bts->gsmtap_categ_mask & cs) { + vty_out(vty, " gsmtap-category %s%s", + get_value_string(pcu_gsmtap_categ_names, i), VTY_NEWLINE); + } + } return pcu_vty_config_write_pcu_ext(vty); } @@ -953,6 +1026,19 @@ { // install_element_ve(&show_pcu_cmd); + cfg_pcu_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names, + "gsmtap-category (", + "|",")", VTY_DO_LOWER); + cfg_pcu_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help, + "GSMTAP Category\n", + "\n", "", 0); + cfg_pcu_no_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names, + "no gsmtap-category (", + "|",")", VTY_DO_LOWER); + cfg_pcu_no_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help, + NO_STR "GSMTAP Category\n", + "\n", "", 0); + logging_vty_add_cmds(cat); osmo_stats_vty_add_cmds(cat); @@ -1006,6 +1092,8 @@ install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_ms_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd); + install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd); + install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd); install_element_ve(&show_bts_stats_cmd); install_element_ve(&show_tbf_cmd); -- To view, visit https://gerrit.osmocom.org/3337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I297183690e98a7234dfc1608c18847d8981306e4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 21 21:26:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 21:26:41 +0000 Subject: [MERGED] osmo-pcap[master]: sock_src_init(): Don't freeaddrinfo() undefined src_result In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sock_src_init(): Don't freeaddrinfo() undefined src_result ...................................................................... sock_src_init(): Don't freeaddrinfo() undefined src_result src_result is only valid "if (src)", so we cannot unconditionally free it: (gdb) bt host=0x52 , src=0x0) at /usr/src/debug/osmo-pcap/0.0.6+gitrAUTOINC+4776b2972e-r1d/git/src/osmo_client_network.c:165 Change-Id: I3b6778d9110583ecb1daec59ef2c86465d5818b9 --- M src/osmo_client_network.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index 937caa0..27c649a 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -162,7 +162,8 @@ close(sfd); } freeaddrinfo(result); - freeaddrinfo(src_result); + if (src) + freeaddrinfo(src_result); if (rp == NULL) { fprintf(stderr, "unable to connect/bind socket: %s:%u: %s\n", -- To view, visit https://gerrit.osmocom.org/3324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3b6778d9110583ecb1daec59ef2c86465d5818b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 21 21:26:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 21:26:41 +0000 Subject: [MERGED] osmo-pcap[master]: Use TCP port numbers for VTY that don't overlap with other O... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use TCP port numbers for VTY that don't overlap with other Osmocom Software ...................................................................... Use TCP port numbers for VTY that don't overlap with other Osmocom Software osmo-pcap for historical reasons uses the same port numbers as OsmoPCU and OsmoBTS. This leads to problems when wanting to run related software together on one system. Let's break the historical assumptions and start with non-overlapping port numbers that are allocated/assigned from https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7 --- M include/osmo-pcap/common.h M osmoappdesc.py M src/osmo_client_main.c M src/osmo_server_main.c 4 files changed, 13 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/include/osmo-pcap/common.h b/include/osmo-pcap/common.h index 13c76e1..27fd514 100644 --- a/include/osmo-pcap/common.h +++ b/include/osmo-pcap/common.h @@ -28,6 +28,15 @@ #include #include #include +#include + +/* support old versions of libosmocore */ +#ifndef OSMO_VTY_PORT_PCAP_CLIENT +#define OSMO_VTY_PORT_PCAP_CLIENT 4237 +#endif +#ifndef OSMO_VTY_PORT_PCAP_SERVER +#define OSMO_VTY_PORT_PCAP_SERVER 4238 +#endif enum { DPCAP, diff --git a/osmoappdesc.py b/osmoappdesc.py index 39928eb..6f66702 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -20,8 +20,8 @@ } apps = [ - (4241, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), - (4240, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), + (4238, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), + (4237, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), ] vty_command = ["src/osmo_pcap_server", "-c", "contrib/osmo-pcap-server.cfg"] diff --git a/src/osmo_client_main.c b/src/osmo_client_main.c index 89d7e04..46a49b5 100644 --- a/src/osmo_client_main.c +++ b/src/osmo_client_main.c @@ -206,7 +206,7 @@ osmo_tls_init(); - rc = telnet_init(tall_bsc_ctx, NULL, 4240); + rc = telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_PCAP_CLIENT); if (rc < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n"); exit(1); diff --git a/src/osmo_server_main.c b/src/osmo_server_main.c index 37a9632..95f3ce1 100644 --- a/src/osmo_server_main.c +++ b/src/osmo_server_main.c @@ -219,7 +219,7 @@ osmo_tls_init(); - rc = telnet_init(tall_bsc_ctx, NULL, 4241); + rc = telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_PCAP_SERVER); if (rc < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n"); exit(1); -- To view, visit https://gerrit.osmocom.org/3323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 21 21:26:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 21:26:42 +0000 Subject: [MERGED] osmo-pcap[master]: Rename osmo_pcap_{client_server} executables to osmo-pcap-{c... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Rename osmo_pcap_{client_server} executables to osmo-pcap-{client,server} ...................................................................... Rename osmo_pcap_{client_server} executables to osmo-pcap-{client,server} This naming is more in line with what all the other osmocom programs are doing (e.g. osmo-pcu, osmo-bts-sysmo, osmo-bsc, ...). We don't generally use osmo_ anywhere else, so I suggest to change it for more uniformity. Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 --- M debian/osmo-pcap-client.init M debian/osmo-pcap-client.install M debian/osmo-pcap-server.install M osmoappdesc.py M src/Makefile.am 5 files changed, 7 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/debian/osmo-pcap-client.init b/debian/osmo-pcap-client.init index 29a51e6..6bfee7a 100755 --- a/debian/osmo-pcap-client.init +++ b/debian/osmo-pcap-client.init @@ -15,7 +15,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC=osmo-pcap-client # Introduce a short description here NAME=osmo-pcap-client # Introduce the short server's name here -DAEMON=/usr/bin/osmo_pcap_client # Introduce the server's location here +DAEMON=/usr/bin/osmo-pcap-client # Introduce the server's location here DAEMON_ARGS="-c /etc/osmo-pcap/osmo-pcap-client.cfg" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME diff --git a/debian/osmo-pcap-client.install b/debian/osmo-pcap-client.install index a1f9f59..f149b14 100644 --- a/debian/osmo-pcap-client.install +++ b/debian/osmo-pcap-client.install @@ -1 +1 @@ -usr/bin/osmo_pcap_client +usr/bin/osmo-pcap-client diff --git a/debian/osmo-pcap-server.install b/debian/osmo-pcap-server.install index 1157484..ad58c8e 100644 --- a/debian/osmo-pcap-server.install +++ b/debian/osmo-pcap-server.install @@ -1 +1 @@ -usr/bin/osmo_pcap_server +usr/bin/osmo-pcap-server diff --git a/osmoappdesc.py b/osmoappdesc.py index 6f66702..2be96db 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -20,11 +20,11 @@ } apps = [ - (4238, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), - (4237, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), + (4238, "src/osmo-pcap-server", "OsmoPCAPServer", "osmo-pcap-server"), + (4237, "src/osmo-pcap-client", "OsmoPCAPClient", "osmo-pcap-client"), ] -vty_command = ["src/osmo_pcap_server", "-c", "contrib/osmo-pcap-server.cfg"] +vty_command = ["src/osmo-pcap-server", "-c", "contrib/osmo-pcap-server.cfg"] vty_app = apps[0] diff --git a/src/Makefile.am b/src/Makefile.am index 0532acf..17ed4e3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(PCAP_CFLAGS) $(LIBGNUTLS_CFLAGS) -bin_PROGRAMS = osmo_pcap_client osmo_pcap_server +bin_PROGRAMS = osmo-pcap-client osmo-pcap-server osmo_pcap_client_SOURCES = osmo_client_main.c osmo_common.c \ osmo_client_core.c osmo_client_vty.c \ -- To view, visit https://gerrit.osmocom.org/3322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jul 21 21:27:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 21:27:05 +0000 Subject: osmo-pcap[master]: Use libosmocore osmo_sock_init2() instead of local implement... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieda77ad8b3f7b89faa09882c0037562ce4d0fc89 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: 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 Jul 21 21:27:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 21 Jul 2017 21:27:08 +0000 Subject: osmo-pcap[master]: client: Move to osmo_sock_init2_ofd() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf1480e7dee287db77a19bb9f0254edddf7706ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: 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 Jul 22 09:05:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 22 Jul 2017 09:05:59 +0000 Subject: libosmocore[master]: osmo_sock_init2(): Fix creation of non-bound sockets In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0206dbb9c5b8f74d7fb088576941b092acd2ca22 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 Jul 22 09:06:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 22 Jul 2017 09:06:20 +0000 Subject: [MERGED] libosmocore[master]: osmo_sock_init2(): Fix creation of non-bound sockets In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_sock_init2(): Fix creation of non-bound sockets ...................................................................... osmo_sock_init2(): Fix creation of non-bound sockets If osmo_sock_init2() was used with CONNECT flag but without BIND flag, an invalid check for "did we create a socket yet" caused the socket to never be created, and subsequently the entire function to return an error. Change-Id: I0206dbb9c5b8f74d7fb088576941b092acd2ca22 --- M src/socket.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/socket.c b/src/socket.c index ca50b6f..457c991 100644 --- a/src/socket.c +++ b/src/socket.c @@ -239,7 +239,7 @@ rp->ai_protocol = proto; } - if (!sfd) { + if (sfd < 0) { sfd = socket_helper(rp, flags); if (sfd < 0) continue; -- To view, visit https://gerrit.osmocom.org/3333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0206dbb9c5b8f74d7fb088576941b092acd2ca22 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 Jul 22 09:06:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 22 Jul 2017 09:06:40 +0000 Subject: osmo-bts[master]: lc15bts-mgr: separate service file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I645a81e30d7146ff26720391db763b6d585037e6 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 Sat Jul 22 09:06:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 22 Jul 2017 09:06:58 +0000 Subject: [MERGED] osmo-bts[master]: lc15bts-mgr: separate service file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15bts-mgr: separate service file ...................................................................... lc15bts-mgr: separate service file The sysmobts- and lc15bts- mgr have different semantics for the same command line option (-n: writing to EEPROM vs writing to ROM). and different default value. Hence it make sense to use separate files, similar to osmo-bts-*.service Change-Id: I645a81e30d7146ff26720391db763b6d585037e6 Related: SYS#3728 --- A contrib/lc15bts-mgr.service M contrib/sysmobts-mgr.service 2 files changed, 14 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/lc15bts-mgr.service b/contrib/lc15bts-mgr.service new file mode 100644 index 0000000..5790abe --- /dev/null +++ b/contrib/lc15bts-mgr.service @@ -0,0 +1,12 @@ +[Unit] +Description=osmo-bts manager for LC15 / sysmoBTS 2100 + +[Service] +Type=simple +ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg +Restart=always +RestartSec=2 + +[Install] +WantedBy=multi-user.target +Alias=osmo-bts-mgr.service diff --git a/contrib/sysmobts-mgr.service b/contrib/sysmobts-mgr.service index 151c821..4346991 100644 --- a/contrib/sysmobts-mgr.service +++ b/contrib/sysmobts-mgr.service @@ -1,9 +1,9 @@ [Unit] -Description=osmo-bts manager for %p +Description=osmo-bts manager for sysmoBTS [Service] Type=simple -ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/%p.cfg +ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/sysmobts-mgr.cfg Restart=always RestartSec=2 -- To view, visit https://gerrit.osmocom.org/3334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I645a81e30d7146ff26720391db763b6d585037e6 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 Sat Jul 22 09:07:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 22 Jul 2017 09:07:42 +0000 Subject: osmo-bts[master]: lc15: port lc15bts-mgr dependency changes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I475a330af771891ba3c897294ce0dd57ec2ba8db 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 Sat Jul 22 09:07:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 22 Jul 2017 09:07:45 +0000 Subject: [MERGED] osmo-bts[master]: lc15: port lc15bts-mgr dependency changes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: port lc15bts-mgr dependency changes ...................................................................... lc15: port lc15bts-mgr dependency changes That's mostly changes related to lc15bts-mgr from https://gitlab.com/nrw_noa/osmo-bts branch nrw/litecell15 based on eb5b7f80510b603579f7af6d7d5ead296c2fa260 commit: * adjust comments to simplify further diffs * add libsystemd dependency to lc15bts-mgr * add software watchdog which uses it * ocxo calibration and gps related code Change-Id: I475a330af771891ba3c897294ce0dd57ec2ba8db Related: SYS#3732 --- M configure.ac M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/calib_file.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c A src/osmo-bts-litecell15/misc/lc15bts_swd.c A src/osmo-bts-litecell15/misc/lc15bts_swd.h 8 files changed, 327 insertions(+), 85 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 0ceb8eb..bc36456 100644 --- a/configure.ac +++ b/configure.ac @@ -143,6 +143,7 @@ AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], [#include ]) + PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd) CPPFLAGS=$oldCPPFLAGS fi diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 90e6c46..78a770a 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,14 +1,14 @@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(LITECELL15_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +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) AM_CFLAGS += -DENABLE_LC15BTS EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h misc/lc15bts_led.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ - misc/lc15bts_bid.h misc/lc15bts_nl.h misc/lc15bts_bts.h \ + misc/lc15bts_bid.h misc/lc15bts_nl.h misc/lc15bts_bts.h misc/lc15bts_swd.h \ hw_misc.h l1_if.h l1_transp.h lc15bts.h oml_router.h utils.h bin_PROGRAMS = osmo-bts-lc15 lc15bts-mgr lc15bts-util @@ -29,9 +29,10 @@ misc/lc15bts_mgr_temp.c \ misc/lc15bts_mgr_calib.c \ misc/lc15bts_led.c \ - misc/lc15bts_bts.c + misc/lc15bts_bts.c \ + misc/lc15bts_swd.c -lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(COMMON_LDADD) +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBSYSTEMD_LIBS) $(COMMON_LDADD) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index ac39e46..b7049df 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -42,10 +42,9 @@ #include "lc15bts.h" #include "utils.h" -/** - * * Maximum calibration data chunk size - * */ +/* Maximum calibration data chunk size */ #define MAX_CALIB_TBL_SIZE 65536 +/* Calibration header version */ #define CALIB_HDR_V1 0x01 struct calib_file_desc { @@ -93,19 +92,19 @@ { struct { - uint8_t u8Version; // Header version (1) - uint8_t u8Parity; // Parity byte (xor) - uint8_t u8Type; // Table type (0:TX Downlink, 1:RX-A Uplink, 2:RX-B Uplink) - uint8_t u8Band; // GSM Band (0:GSM-850, 1:EGSM-900, 2:DCS-1800, 3:PCS-1900) - uint32_t u32Len; // Table length in bytes including the header + uint8_t u8Version; /* Header version (1) */ + uint8_t u8Parity; /* Parity byte (xor) */ + uint8_t u8Type; /* Table type (0:TX Downlink, 1:RX-A Uplink, 2:RX-B Uplink) */ + uint8_t u8Band; /* GSM Band (0:GSM-850, 1:EGSM-900, 2:DCS-1800, 3:PCS-1900) */ + uint32_t u32Len; /* Table length in bytes including the header */ struct { - uint32_t u32DescOfst; // Description section offset - uint32_t u32DateOfst; // Date section offset - uint32_t u32StationOfst; // Calibration test station section offset - uint32_t u32FpgaFwVerOfst; // Calibration FPGA firmware version section offset - uint32_t u32DspFwVerOfst; // Calibration DSP firmware section offset - uint32_t u32DataOfst; // Calibration data section offset + uint32_t u32DescOfst; /* Description section offset */ + uint32_t u32DateOfst; /* Date section offset */ + uint32_t u32StationOfst; /* Calibration test station section offset */ + uint32_t u32FpgaFwVerOfst; /* Calibration FPGA firmware version section offset */ + uint32_t u32DspFwVerOfst; /* Calibration DSP firmware section offset */ + uint32_t u32DataOfst; /* Calibration data section offset */ } toc; } v1; } hdr; @@ -314,15 +313,14 @@ struct calTbl_t *calTbl; char calChkSum ; - - //calculate file size in bytes + /* calculate file size in bytes */ fseek(st->fp, 0L, SEEK_END); sz = ftell(st->fp); - //rewind read poiner + /* rewind read poiner */ fseek(st->fp, 0L, SEEK_SET); - //read file + /* read file */ rbuf = (char *) malloc( sizeof(char) * sz ); rc = fread(rbuf, 1, sizeof(char) * sz, st->fp); @@ -331,7 +329,7 @@ LOGP(DL1C, LOGL_ERROR, "%s reading error\n", desc->fname); free(rbuf); - //close file + /* close file */ rc = calib_file_close(fl1h); if (rc < 0 ) { LOGP(DL1C, LOGL_ERROR, "%s can not close\n", desc->fname); @@ -341,33 +339,32 @@ return -2; } - calTbl = (struct calTbl_t*) rbuf; - //calcualte file checksum + /* calculate file checksum */ calChkSum = 0; while ( sz-- ) { calChkSum ^= rbuf[sz]; } - //validate Tx calibration parity + /* validate Tx calibration parity */ if ( calChkSum ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid checksum %x.\n", desc->fname, calChkSum); return -4; } - //validate Tx calibration header + /* validate Tx calibration header */ if ( calTbl->hdr.v1.u8Version != CALIB_HDR_V1 ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid header version %u.\n", desc->fname, calTbl->hdr.v1.u8Version); return -5; } - //validate calibration description + /* validate calibration description */ if ( calTbl->hdr.v1.toc.u32DescOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration description offset.\n", desc->fname); return -6; } - //validate calibration date + /* validate calibration date */ if ( calTbl->hdr.v1.toc.u32DateOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration date offset.\n", desc->fname); return -7; @@ -377,24 +374,25 @@ desc->fname, calTbl->u8RawData + calTbl->hdr.v1.toc.u32DateOfst); - //validate calibration station + /* validate calibration station */ if ( calTbl->hdr.v1.toc.u32StationOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration station ID offset.\n", desc->fname); return -8; } - //validate FPGA FW version + /* validate FPGA FW version */ if ( calTbl->hdr.v1.toc.u32FpgaFwVerOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid FPGA FW version offset.\n", desc->fname); return -9; } - //validate DSP FW version + + /* validate DSP FW version */ if ( calTbl->hdr.v1.toc.u32DspFwVerOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid DSP FW version offset.\n", desc->fname); return -10; } - //validate Tx calibration data offset + /* validate Tx calibration data offset */ if ( calTbl->hdr.v1.toc.u32DataOfst == 0xFFFFFFFF ) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration data offset.\n", desc->fname); return -11; @@ -402,11 +400,11 @@ if ( !desc->rx ) { - //parse min/max Tx power + /* parse min/max Tx power */ fl1h->phy_inst->u.lc15.minTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (5 << 2)]; fl1h->phy_inst->u.lc15.maxTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (6 << 2)]; - //override nominal Tx power of given TRX if needed + /* override nominal Tx power of given TRX if needed */ if ( fl1h->phy_inst->trx->nominal_power > fl1h->phy_inst->u.lc15.maxTxPower) { LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", plink->num, @@ -449,7 +447,7 @@ fl1h->phy_inst->u.lc15.maxTxPower ); } - //rewind read poiner for subsequence tasks + /* rewind read pointer for subsequence tasks */ fseek(st->fp, 0L, SEEK_SET); free(rbuf); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index 51a05f9..cec9a82 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -46,6 +46,8 @@ #include "misc/lc15bts_par.h" #include "misc/lc15bts_bid.h" #include "misc/lc15bts_power.h" +#include "misc/lc15bts_swd.h" + #include "lc15bts_led.h" static int no_rom_write = 0; @@ -163,6 +165,7 @@ lc15bts_check_vswr(no_rom_write); osmo_timer_schedule(&sensor_timer, SENSOR_TIMER_SECS, 0); /* TODO checks if lc15bts_check_temp/lc15bts_check_power/lc15bts_check_vswr went ok */ + lc15bts_swd_event(&manager, SWD_CHECK_SENSOR); } static struct osmo_timer_list hours_timer; @@ -172,6 +175,7 @@ osmo_timer_schedule(&hours_timer, HOURS_TIMER_SECS, 0); /* TODO: validates if lc15bts_update_hours went correctly */ + lc15bts_swd_event(&manager, SWD_UPDATE_HOURS); } static void print_help(void) @@ -317,6 +321,10 @@ INIT_LLIST_HEAD(&manager.lc15bts_leds.list); INIT_LLIST_HEAD(&manager.alarms.list); + /* Initialize the service watchdog notification for SWD_LAST event(s) */ + if (lc15bts_swd_init(&manager, (int)(SWD_LAST)) != 0) + exit(3); + /* start temperature check timer */ sensor_timer.cb = check_sensor_timer_cb; check_sensor_timer_cb(NULL); @@ -357,5 +365,6 @@ while (1) { log_reset_context(); osmo_select_main(0); + lc15bts_swd_event(&manager, SWD_MAINLOOP); } } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c index fb49477..badb545 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_calib.c @@ -27,6 +27,9 @@ #include "misc/lc15bts_mgr.h" #include "misc/lc15bts_misc.h" #include "misc/lc15bts_clock.h" +#include "misc/lc15bts_swd.h" +#include "misc/lc15bts_par.h" +#include "misc/lc15bts_led.h" #include "osmo-bts/msg_utils.h" #include @@ -41,9 +44,13 @@ #include #include +#include + static void calib_adjust(struct lc15bts_mgr_instance *mgr); static void calib_state_reset(struct lc15bts_mgr_instance *mgr, int reason); static void calib_loop_run(void *_data); + +static int ocxodac_saved_value = -1; enum calib_state { CALIB_INITIAL, @@ -88,7 +95,9 @@ int interval_sec; int dac_value; int new_dac_value; - double dac_correction; + int dac_correction; + time_t now; + time_t last_gps_fix; rc = lc15bts_clock_err_get(&fault, &error_ppt, &accuracy_ppq, &interval_sec); @@ -99,11 +108,31 @@ return; } + /* get current time */ + now = time(NULL); + + /* first time after start of manager program */ + if (mgr->gps.last_update == 0) + mgr->gps.last_update = now; + + /* read last GPS 3D fix from storage */ + rc = lc15bts_par_get_gps_fix(&last_gps_fix); + if (rc < 0) { + LOGP(DCALIB, LOGL_NOTICE, "Last GPS 3D fix can not read (%d). Last GPS 3D fix sets to zero\n", rc); + last_gps_fix = 0; + } + if (fault) { LOGP(DCALIB, LOGL_NOTICE, "GPS has no fix\n"); calib_state_reset(mgr, CALIB_FAIL_GPSFIX); return; } + + /* We got GPS 3D fix */ + LOGP(DCALIB, LOGL_DEBUG, "Got GPS 3D fix warn_flags=0x%08x, last=%lld, now=%lld\n", + mgr->lc15bts_ctrl.warn_flags, + (long long)last_gps_fix, + (long long)now); rc = lc15bts_clock_dac_get(&dac_value); if (rc < 0) { @@ -113,60 +142,74 @@ return; } + /* Set OCXO initial dac value */ + if (ocxodac_saved_value < 0) + ocxodac_saved_value = dac_value; + LOGP(DCALIB, LOGL_NOTICE, "Calibration ERR(%f PPB) ACC(%f PPB) INT(%d) DAC(%d)\n", error_ppt / 1000., accuracy_ppq / 1000000., interval_sec, dac_value); - /* 1 unit of correction equal about 0.5 - 1 PPB correction */ - dac_correction = (int)(-error_ppt * 0.00056); - new_dac_value = dac_value + dac_correction + 0.5; - - /* We have a fix, make sure the measured error is - meaningful (10 times the accuracy) */ - if ((new_dac_value != dac_value) && ((100l * abs(error_ppt)) > accuracy_ppq)) { - + /* Need integration time to correct */ + if (interval_sec) { + /* 1 unit of correction equal about 0.5 - 1 PPB correction */ + dac_correction = (int)(-error_ppt * 0.0015); + new_dac_value = dac_value + dac_correction; + if (new_dac_value > 4095) - dac_value = 4095; + new_dac_value = 4095; else if (new_dac_value < 0) - dac_value = 0; - else - dac_value = new_dac_value; - - LOGP(DCALIB, LOGL_NOTICE, - "Going to apply %d as new clock setting.\n", - dac_value); - - rc = lc15bts_clock_dac_set(dac_value); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to set OCXO dac value %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_OCXODAC); - return; - } - rc = lc15bts_clock_err_reset(); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to set reset clock error module %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_CLKERR); - return; - } - } + new_dac_value = 0; - /* Save the correction value in the DAC eeprom if the - frequency has been stable for 24 hours */ - else if (interval_sec >= (24 * 60 * 60)) { - rc = lc15bts_clock_dac_save(); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to save OCXO dac value %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_OCXODAC); + /* We have a fix, make sure the measured error is + meaningful (10 times the accuracy) */ + if ((new_dac_value != dac_value) && ((100l * abs(error_ppt)) > accuracy_ppq)) { + + LOGP(DCALIB, LOGL_NOTICE, + "Going to apply %d as new clock setting.\n", + new_dac_value); + + rc = lc15bts_clock_dac_set(new_dac_value); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to set OCXO dac value %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_OCXODAC); + return; + } + rc = lc15bts_clock_err_reset(); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to reset clock error module %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_CLKERR); + return; + } } - rc = lc15bts_clock_err_reset(); - if (rc < 0) { - LOGP(DCALIB, LOGL_ERROR, - "Failed to set reste clock error module %d\n", rc); - calib_state_reset(mgr, CALIB_FAIL_CLKERR); + /* New conditions to store DAC value: + * - Resolution accuracy less or equal than 0.01PPB (or 10000 PPQ) + * - Error less or equal than 2PPB (or 2000PPT) + * - Solution different than the last one */ + else if (accuracy_ppq <= 10000) { + if((dac_value != ocxodac_saved_value) && (abs(error_ppt) < 2000)) { + LOGP(DCALIB, LOGL_NOTICE, "Saving OCXO DAC value to memory... val = %d\n", dac_value); + rc = lc15bts_clock_dac_save(); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to save OCXO dac value %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_OCXODAC); + } else { + ocxodac_saved_value = dac_value; + } + } + + rc = lc15bts_clock_err_reset(); + if (rc < 0) { + LOGP(DCALIB, LOGL_ERROR, + "Failed to reset clock error module %d\n", rc); + calib_state_reset(mgr, CALIB_FAIL_CLKERR); + } } + } else { + LOGP(DCALIB, LOGL_NOTICE, "Skipping this iteration, no integration time\n"); } calib_state_reset(mgr, CALIB_SUCCESS); @@ -197,6 +240,8 @@ mgr->calib.calib_timeout.data = mgr; mgr->calib.calib_timeout.cb = calib_loop_run; osmo_timer_schedule(&mgr->calib.calib_timeout, timeout, 0); + /* TODO: do we want to notify if we got a calibration error, like no gps fix? */ + lc15bts_swd_event(mgr, SWD_CHECK_CALIB); } mgr->calib.state = CALIB_INITIAL; @@ -241,6 +286,7 @@ mgr->calib.calib_timeout.data = mgr; mgr->calib.calib_timeout.cb = calib_loop_run; osmo_timer_schedule(&mgr->calib.calib_timeout, 0, 0); - return 0; + + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 9d2dfec..9665e1d 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -28,6 +28,7 @@ #include "misc/lc15bts_temp.h" #include "misc/lc15bts_power.h" #include "misc/lc15bts_led.h" +#include "misc/lc15bts_swd.h" #include "limits.h" #include @@ -116,7 +117,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl start lc15bts.service"); + system("/bin/systemctl start osmo-bts.service"); } } @@ -151,7 +152,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl stop lc15bts.service"); + system("/bin/systemctl stop osmo-bts.service"); } } @@ -364,6 +365,7 @@ osmo_timer_schedule(&sensor_ctrl_timer, LC15BTS_SENSOR_TIMER_DURATION, 0); LOGP(DTEMP, LOGL_DEBUG,"Check sensors timer expired\n"); /* TODO: do we want to notify if some sensors could not be read? */ + lc15bts_swd_event(mgr, SWD_CHECK_TEMP_SENSOR); } int lc15bts_mgr_sensor_init(struct lc15bts_mgr_instance *mgr) diff --git a/src/osmo-bts-litecell15/misc/lc15bts_swd.c b/src/osmo-bts-litecell15/misc/lc15bts_swd.c new file mode 100644 index 0000000..59c7b61 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_swd.c @@ -0,0 +1,178 @@ +/* Systemd service wd notification for Litecell 1.5 BTS management daemon */ + +/* Copyright (C) 2015 by Yves Godin + * + * 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 "misc/lc15bts_mgr.h" +#include "misc/lc15bts_swd.h" +#include + +/* Needed for service watchdog notification */ +#include + +/* This is the period used to verify if all events have been registered to be allowed + to notify the systemd service watchdog +*/ +#define SWD_PERIOD 30 + +static void swd_start(struct lc15bts_mgr_instance *mgr); +static void swd_process(struct lc15bts_mgr_instance *mgr); +static void swd_close(struct lc15bts_mgr_instance *mgr); +static void swd_state_reset(struct lc15bts_mgr_instance *mgr, int reason); +static int swd_run(struct lc15bts_mgr_instance *mgr, int from_loop); +static void swd_loop_run(void *_data); + +enum swd_state { + SWD_INITIAL, + SWD_IN_PROGRESS, +}; + +enum swd_result { + SWD_FAIL_START, + SWD_FAIL_NOTIFY, + SWD_SUCCESS, +}; + +static void swd_start(struct lc15bts_mgr_instance *mgr) +{ + swd_process(mgr); +} + +static void swd_process(struct lc15bts_mgr_instance *mgr) +{ + int rc = 0, notify = 0; + + /* Did we get all needed conditions ? */ + if (mgr->swd.swd_eventmasks == mgr->swd.swd_events) { + /* Ping systemd service wd if enabled */ + rc = sd_notify(0, "WATCHDOG=1"); + LOGP(DSWD, LOGL_NOTICE, "Watchdog notification attempt\n"); + notify = 1; + } + else { + LOGP(DSWD, LOGL_NOTICE, "Missing watchdog events: e:0x%016llx,m:0x%016llx\n",mgr->swd.swd_events,mgr->swd.swd_eventmasks); + } + + if (rc < 0) { + LOGP(DSWD, LOGL_ERROR, + "Failed to notify system service watchdog: %d\n", rc); + swd_state_reset(mgr, SWD_FAIL_NOTIFY); + return; + } + else { + /* Did we notified the watchdog? */ + if (notify) { + mgr->swd.swd_events = 0; + /* Makes sure we really cleared it in case any event was notified at this same moment (it would be lost) */ + if (mgr->swd.swd_events != 0) + mgr->swd.swd_events = 0; + } + } + + swd_state_reset(mgr, SWD_SUCCESS); + return; +} + +static void swd_close(struct lc15bts_mgr_instance *mgr) +{ +} + +static void swd_state_reset(struct lc15bts_mgr_instance *mgr, int outcome) +{ + if (mgr->swd.swd_from_loop) { + mgr->swd.swd_timeout.data = mgr; + mgr->swd.swd_timeout.cb = swd_loop_run; + osmo_timer_schedule(&mgr->swd.swd_timeout, SWD_PERIOD, 0); + } + + mgr->swd.state = SWD_INITIAL; + swd_close(mgr); +} + +static int swd_run(struct lc15bts_mgr_instance *mgr, int from_loop) +{ + if (mgr->swd.state != SWD_INITIAL) { + LOGP(DSWD, LOGL_ERROR, "Swd is already in progress.\n"); + return -1; + } + + mgr->swd.swd_from_loop = from_loop; + + /* From now on everything will be handled from the failure */ + mgr->swd.state = SWD_IN_PROGRESS; + swd_start(mgr); + return 0; +} + +static void swd_loop_run(void *_data) +{ + int rc; + struct lc15bts_mgr_instance *mgr = _data; + + LOGP(DSWD, LOGL_NOTICE, "Going to check for watchdog notification.\n"); + rc = swd_run(mgr, 1); + if (rc != 0) { + swd_state_reset(mgr, SWD_FAIL_START); + } +} + +/* 'swd_num_events' configures the number of events to be monitored before notifying the + systemd service watchdog. It must be in the range of [1,64]. Events are notified + through the function 'lc15bts_swd_event' +*/ +int lc15bts_swd_init(struct lc15bts_mgr_instance *mgr, int swd_num_events) +{ + /* Checks for a valid number of events to validate */ + if (swd_num_events < 1 || swd_num_events > 64) + return(-1); + + mgr->swd.state = SWD_INITIAL; + mgr->swd.swd_timeout.data = mgr; + mgr->swd.swd_timeout.cb = swd_loop_run; + osmo_timer_schedule(&mgr->swd.swd_timeout, 0, 0); + + if (swd_num_events == 64){ + mgr->swd.swd_eventmasks = 0xffffffffffffffffULL; + } + else { + mgr->swd.swd_eventmasks = ((1ULL << swd_num_events) - 1); + } + mgr->swd.swd_events = 0; + mgr->swd.num_events = swd_num_events; + + return 0; +} + +/* Notifies that the specified event 'swd_event' happened correctly; + the value must be in the range of [0,'swd_num_events'[ (see lc15bts_swd_init). + For example, if 'swd_num_events' was 64, 'swd_event' events are numbered 0 to 63. + WARNING: if this function can be used from multiple threads at the same time, + it must be protected with a kind of mutex to avoid loosing event notification. +*/ +int lc15bts_swd_event(struct lc15bts_mgr_instance *mgr, enum mgr_swd_events swd_event) +{ + /* Checks for a valid specified event (smaller than max possible) */ + if ((int)(swd_event) < 0 || (int)(swd_event) >= mgr->swd.num_events) + return(-1); + + mgr->swd.swd_events = mgr->swd.swd_events | ((unsigned long long int)(1) << (int)(swd_event)); + + /* !!! Uncomment following line to debug events notification */ + LOGP(DSWD, LOGL_DEBUG,"Swd event notified: %d\n", (int)(swd_event)); + + return 0; +} diff --git a/src/osmo-bts-litecell15/misc/lc15bts_swd.h b/src/osmo-bts-litecell15/misc/lc15bts_swd.h new file mode 100644 index 0000000..b78a2c2 --- /dev/null +++ b/src/osmo-bts-litecell15/misc/lc15bts_swd.h @@ -0,0 +1,7 @@ +#ifndef _LC15BTS_SWD_H +#define _LC15BTS_SWD_H + +int lc15bts_swd_init(struct lc15bts_mgr_instance *mgr, int swd_num_events); +int lc15bts_swd_event(struct lc15bts_mgr_instance *mgr, enum mgr_swd_events swd_event); + +#endif -- To view, visit https://gerrit.osmocom.org/3316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I475a330af771891ba3c897294ce0dd57ec2ba8db 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 Sat Jul 22 09:08:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 22 Jul 2017 09:08:14 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: make simple client configurable via VTY In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: make simple client configurable via VTY ...................................................................... sccp: make simple client configurable via VTY The osmo_sccp_simple_client_on_ss7_id and osmo_sccp_simple_client are not entirely configurable via VTY commands. The relation to the VTY is implicit. The user may set up instance objects via VTY (cs7/ss7, AS, ASP), which are then automatically created on startup. Each cs7 instance gets its own ID via the VTY configuration. When osmo_sccp_simple_client_on_ss7_id() is called with the cs7 instance id. (for osmo_sccp_simple_client() the ID will be hardcoded to 1), the function automatically checks if the CS7 instance is present, if not it will create one automatically using the caller supplied parameters as a defult. If a CS7 instance is present, the function checks for the presence of an AS and an ASP. These objects are present, they will be used. If not, new objects will be created. Both functions must not be called if an SCCP instance is already present. Since there can only be one SCCP instance per CS7 instance, this is an error condition. Add additional logic that checks to detect an already existing, valid configuration. If no or an insufficient configuration is detected, use the caller supplied parameters as default configuration. Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c M src/sccp_user.c 3 files changed, 153 insertions(+), 35 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 57a4e06..87ace4a 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -307,6 +307,8 @@ osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx); struct osmo_ss7_as * osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id); +struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, + enum osmo_ss7_asp_protocol proto); struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto); @@ -383,6 +385,9 @@ struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name); +struct osmo_ss7_asp +*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, + enum osmo_ss7_asp_protocol proto); struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index c13c588..eb5a4ef 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -833,6 +833,41 @@ return NULL; } +/*! \brief Find Application Server (AS) by given protocol. + * \param[in] inst SS7 Instance on which we operate + * \param[in] proto Protocol identifier that must match + * \returns pointer to AS on success; NULL otherwise + * If an AS has an ASP also matching the given protocol, that AS is preferred. + * If there are multiple matches, return the first matching AS. */ +struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, + enum osmo_ss7_asp_protocol proto) +{ + struct osmo_ss7_as *as; + struct osmo_ss7_as *as_without_asp = NULL; + + OSMO_ASSERT(ss7_initialized); + + /* Loop through the list with AS and try to find one where the proto + matches up */ + llist_for_each_entry(as, &inst->as_list, list) { + if (as->cfg.proto == proto) { + + /* Put down the first AS that matches the proto, just in + * case we will not find any matching ASP */ + if (!as_without_asp) + as_without_asp = as; + + /* Check if the candicate we have here has any suitable + * ASP */ + if (osmo_ss7_asp_find_by_proto(as, proto)) + return as; + } + } + + /* Return with the second best find, if there is any */ + return as_without_asp; +} + /*! \brief Find or Create Application Server * \param[in] inst SS7 Instance on which we operate * \param[in] name Name of Application Server @@ -1044,6 +1079,23 @@ return NULL; } +/*! \brief Find an ASP that matches the given protocol. + * \param[in] as Application Server in which to look for \ref asp + * \returns SS7 ASP in case a matching one is found; NULL otherwise */ +struct osmo_ss7_asp +*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, + enum osmo_ss7_asp_protocol proto) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { + if (as->cfg.asps[i] && as->cfg.asps[i]->cfg.proto == proto) + return as->cfg.asps[i]; + } + + return NULL; +} + struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, diff --git a/src/sccp_user.c b/src/sccp_user.c index b21a756..c9443a2 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -242,54 +242,113 @@ int remote_port, const char *remote_ip) { struct osmo_ss7_instance *ss7; + bool ss7_created = false; struct osmo_ss7_as *as; + bool as_created = false; struct osmo_ss7_route *rt; + bool rt_created = false; struct osmo_ss7_asp *asp; - char *as_name, *asp_name; + bool asp_created = false; + char *as_name, *asp_name = NULL; + /* Choose default ports when the caller does not supply valid port + * numbers. */ if (!remote_port || remote_port < 0) remote_port = osmo_ss7_asp_protocol_port(prot); if (local_port < 0) local_port = osmo_ss7_asp_protocol_port(prot); - /* allocate + initialize SS7 instance */ - ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); + /* Check if there is already an ss7 instance present under + * the given id. If not, we will create a new one. */ + ss7 = osmo_ss7_instance_find(ss7_id); if (!ss7) { - LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); - return NULL; + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SS7 instance\n", + name); + + /* Create a new ss7 instance */ + ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); + if (!ss7) { + LOGP(DLSCCP, LOGL_ERROR, + "Failed to find or create SS7 instance\n"); + return NULL; + } + + /* Setup primary pointcode + * NOTE: This means that the user must set the pointcode to a + * proper value when a cs7 instance is defined via the VTY. */ + ss7->cfg.primary_pc = pc; + ss7_created = true; } - ss7->cfg.primary_pc = pc; + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, + ss7->cfg.id, osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc)); - as_name = talloc_asprintf(ctx, "as-clnt-%s", name); - asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); + /* There must not be an existing SCCP istance, regarless if the simple + * client has created the SS7 instance or if it was already present. + * An already existing SCCP instance would be an indication that this + * function has been called twice with the same SS7 instance, which + * must not be the case! */ + OSMO_ASSERT(ss7->sccp == NULL); - /* application server */ - as = osmo_ss7_as_find_or_create(ss7, as_name, prot); - if (!as) - goto out_strings; + /* Check if there is already an application server that matches + * the protocol we intend to use. If not, we will create one. */ + as = osmo_ss7_as_find_by_proto(ss7, prot); + if (!as) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating AS instance\n", + name); + as_name = talloc_asprintf(ctx, "as-clnt-%s", name); + as = osmo_ss7_as_find_or_create(ss7, as_name, prot); + talloc_free(as_name); + if (!as) + goto out_ss7; + as_created = true; - as->cfg.routing_key.pc = pc; + as->cfg.routing_key.pc = ss7->cfg.primary_pc; - /* install default route */ - rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, as_name); - if (!rt) - goto out_as; - talloc_free(as_name); + /* install default route */ + rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, + as->cfg.name); + if (!rt) + goto out_as; + rt_created = true; + } + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, + as->cfg.name); - /* application server process */ - asp = osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, local_port, - prot); - if (!asp) - goto out_rt; - asp->cfg.local.host = talloc_strdup(asp, local_ip); - asp->cfg.remote.host = talloc_strdup(asp, remote_ip); - osmo_ss7_as_add_asp(as, asp_name); + /* Check if we do already have an application server process + * that is associated with the application server we have choosen + * the application server process must also match the protocol + * we intend to use. */ + asp = osmo_ss7_asp_find_by_proto(as, prot); + if (!asp) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating ASP instance\n", + name); + asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); + asp = + osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, + local_port, prot); + talloc_free(asp_name); + if (!asp) + goto out_rt; + asp_created = true; + + asp->cfg.local.host = talloc_strdup(asp, local_ip); + asp->cfg.remote.host = talloc_strdup(asp, remote_ip); + + osmo_ss7_as_add_asp(as, asp->cfg.name); + } + + /* Ensure that the ASP we use is set to client mode. */ + asp->cfg.is_server = false; + + /* Restart ASP */ if (prot != OSMO_SS7_ASP_PROT_IPA) osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG); - talloc_free(asp_name); osmo_ss7_asp_restart(asp); + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using ASP instance %s\n", name, + asp->cfg.name); - /* Allocate SCCP stack + SCCP user */ + /* Allocate SCCP instance */ + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SCCP instance\n", name); ss7->sccp = osmo_sccp_instance_create(ss7, NULL); if (!ss7->sccp) goto out_asp; @@ -297,15 +356,17 @@ return ss7->sccp; out_asp: - osmo_ss7_asp_destroy(asp); + if (asp_created) + osmo_ss7_asp_destroy(asp); out_rt: - osmo_ss7_route_destroy(rt); + if (rt_created) + osmo_ss7_route_destroy(rt); out_as: - osmo_ss7_as_destroy(as); -out_strings: - talloc_free(as_name); - talloc_free(asp_name); - osmo_ss7_instance_destroy(ss7); + if (as_created) + osmo_ss7_as_destroy(as); +out_ss7: + if (ss7_created) + osmo_ss7_instance_destroy(ss7); return NULL; } -- To view, visit https://gerrit.osmocom.org/3303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jul 22 09:08:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 22 Jul 2017 09:08:14 +0000 Subject: [MERGED] libosmo-sccp[master]: xua: fix possible memory leak in seems osmo_ss7_asp_use_defa... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: xua: fix possible memory leak in seems osmo_ss7_asp_use_default_lm() ...................................................................... xua: fix possible memory leak in seems osmo_ss7_asp_use_default_lm() The function seems osmo_ss7_asp_use_default_lm() does not guard against an asp->lm_priv FSM instance already existing. If this function is called a second time, it will overwrite asp->lm_priv, causing the original fsm instance to leaked. Check if asp->lm_priv already exists and terminate (free) the FSM if present. Change-Id: I4ad435c042a435c4e641c6e5c53b91265dd23d40 --- M src/xua_default_lm_fsm.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c index 9308de4..2a03cbc 100644 --- a/src/xua_default_lm_fsm.c +++ b/src/xua_default_lm_fsm.c @@ -366,6 +366,11 @@ struct lm_fsm_priv *lmp; struct osmo_fsm_inst *fi; + if (asp->lm_priv) { + osmo_fsm_inst_term(asp->lm_priv, OSMO_FSM_TERM_ERROR, NULL); + asp->lm_priv = NULL; + } + fi = osmo_fsm_inst_alloc(&xua_default_lm_fsm, asp, NULL, log_level, asp->cfg.name); lmp = talloc_zero(fi, struct lm_fsm_priv); -- To view, visit https://gerrit.osmocom.org/3325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4ad435c042a435c4e641c6e5c53b91265dd23d40 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 22 11:31:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 22 Jul 2017 11:31:06 +0000 Subject: [MERGED] libosmocore[master]: GSUP: define default GSUP port as 4222 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: GSUP: define default GSUP port as 4222 ...................................................................... GSUP: define default GSUP port as 4222 See also: https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers https://gerrit.osmocom.org/#/c/3195/2/include/openbsc/osmo_msc.h at 13 (change-id I639544a6cdda77a3aafc4e3446a55393f60e4050) Change-Id: I4222e21686c823985be8ff1f16b1182be8ad6175 --- M include/osmocom/gsm/gsup.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 890bff3..36e5c84 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -27,6 +27,8 @@ #include #include +#define OSMO_GSUP_PORT 4222 + /*! Maximum nubmer of PDP inside \ref osmo_gsup_message */ #define OSMO_GSUP_MAX_NUM_PDP_INFO 10 /* GSM 09.02 limits this to 50 */ /*! Maximum number of auth info inside \ref osmo_gsup_message */ -- To view, visit https://gerrit.osmocom.org/3326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4222e21686c823985be8ff1f16b1182be8ad6175 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 Sat Jul 22 17:41:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 22 Jul 2017 17:41:38 +0000 Subject: osmo-msc[master]: Add msc_vlr test suite for MSC+VLR end-to-end tests In-Reply-To: References: Message-ID: Patch Set 8: Code-Review-1 I still found some discrepancies. For once the tests fail to verify proper Iu Release / BSSAP Clear behavior, and also the msc_vlr_test_gsm_ciph() appears to have some dead tests (there but missing from the tests list and not being tested) -- To view, visit https://gerrit.osmocom.org/3196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From admin at opensuse.org Sat Jul 22 19:54:16 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 22 Jul 2017 19:54:16 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5973ad768d00f_5ccba0cf80466983@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 246s] | [ 246s] | This file was extended by libosmocore config.status 0.9.6.20170722, which was [ 246s] | generated by GNU Autoconf 2.69. Invocation command line was [ 246s] | [ 246s] | CONFIG_FILES = [ 246s] | CONFIG_HEADERS = [ 246s] | CONFIG_LINKS = [ 246s] | CONFIG_COMMANDS = [ 246s] | $ ./config.status Doxyfile.core [ 246s] | [ 246s] | on build32 [ 246s] | [ 246s] | config.status:1171: creating Doxyfile.core [ 246s] [ 246s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 246s] make[1]: *** [override_dh_auto_test] Error 1 [ 246s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 246s] debian/rules:15: recipe for target 'build' failed [ 246s] make: *** [build] Error 2 [ 246s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 246s] [ 246s] build32 failed "build libosmocore_0.9.6.20170722.dsc" at Sat Jul 22 19:53:58 UTC 2017. [ 246s] [ 246s] ### VM INTERACTION START ### [ 249s] [ 233.058086] reboot: Power down [ 250s] ### VM INTERACTION END ### [ 250s] [ 250s] build32 failed "build libosmocore_0.9.6.20170722.dsc" at Sat Jul 22 19:54:03 UTC 2017. [ 250s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 22 19:54:50 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 22 Jul 2017 19:54:50 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5973ad96a1e96_5ccba0cf804670d8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 282s] | [ 282s] | This file was extended by libosmocore config.status 0.9.6.20170722, which was [ 282s] | generated by GNU Autoconf 2.69. Invocation command line was [ 282s] | [ 282s] | CONFIG_FILES = [ 282s] | CONFIG_HEADERS = [ 282s] | CONFIG_LINKS = [ 282s] | CONFIG_COMMANDS = [ 282s] | $ ./config.status Doxyfile.core [ 282s] | [ 282s] | on build35 [ 282s] | [ 282s] | config.status:1171: creating Doxyfile.core [ 282s] [ 282s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 282s] make[1]: *** [override_dh_auto_test] Error 1 [ 282s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 282s] debian/rules:15: recipe for target 'build' failed [ 282s] make: *** [build] Error 2 [ 282s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 282s] [ 282s] build35 failed "build libosmocore_0.9.6.20170722.dsc" at Sat Jul 22 19:54:37 UTC 2017. [ 282s] [ 282s] ### VM INTERACTION START ### [ 285s] [ 267.202124] reboot: Power down [ 285s] ### VM INTERACTION END ### [ 285s] [ 285s] build35 failed "build libosmocore_0.9.6.20170722.dsc" at Sat Jul 22 19:54:41 UTC 2017. [ 285s] -- 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 Jul 23 02:56:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 23 Jul 2017 02:56:05 +0000 Subject: [PATCH] osmo-msc[master]: Use libvlr in libmsc (large refactoring) 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/3195 to look at the new patch set (#10). Use libvlr in libmsc (large refactoring) Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Remove/Disable VTY and CTRL commands to create subscribers, which is now a task of the OsmoHLR. Adjust the python tests accordingly. Remove VTY cmd subscriber-keep-in-ram. Use OSMO_GSUP_PORT = 4222 instead of 2222. See I4222e21686c823985be8ff1f16b1182be8ad6175. So far use the LAC from conn->bts, will be replaced by conn->lac in Id3705236350d5f69e447046b0a764bbabc3d493c. Related: OS#1592 OS#1974 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 --- M configure.ac M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-nitb/rbs2308/openbsc.cfg M include/openbsc/Makefile.am M include/openbsc/abis_rsl.h M include/openbsc/auth.h M include/openbsc/bsc_api.h M include/openbsc/chan_alloc.h M include/openbsc/db.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/gsm_subscriber.h M include/openbsc/osmo_msc.h M include/openbsc/signal.h M include/openbsc/silent_call.h D include/openbsc/token_auth.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M src/gprs/sgsn_main.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/paging.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/meas_feed.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c D src/libmsc/token_auth.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr_access_req_fsm.c M src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/ctrl_test_runner.py M tests/db/db_test.c D tests/mm_auth/Makefile.am D tests/mm_auth/mm_auth_test.c D tests/mm_auth/mm_auth_test.ok A tests/sms_queue/Makefile.am A tests/sms_queue/sms_queue_test.c A tests/sms_queue/sms_queue_test.err A tests/sms_queue/sms_queue_test.ok M tests/subscr/Makefile.am D tests/subscr/subscr_test.c D tests/subscr/subscr_test.ok M tests/testsuite.at M tests/vty_test_runner.py 74 files changed, 2,210 insertions(+), 4,252 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3195/10 -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 10 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jul 23 02:56:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 23 Jul 2017 02:56:05 +0000 Subject: [PATCH] osmo-msc[master]: Add msc_vlr test suite for MSC+VLR end-to-end 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/3196 to look at the new patch set (#9). Add msc_vlr test suite for MSC+VLR end-to-end tests Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd --- M .gitignore M configure.ac M tests/Makefile.am A tests/msc_vlr/Makefile.am A tests/msc_vlr/msc_vlr_test_gsm_authen.c A tests/msc_vlr/msc_vlr_test_gsm_authen.err A tests/msc_vlr/msc_vlr_test_gsm_authen.ok A tests/msc_vlr/msc_vlr_test_gsm_ciph.c A tests/msc_vlr/msc_vlr_test_gsm_ciph.err A tests/msc_vlr/msc_vlr_test_gsm_ciph.ok A tests/msc_vlr/msc_vlr_test_hlr_reject.c A tests/msc_vlr/msc_vlr_test_hlr_reject.err A tests/msc_vlr/msc_vlr_test_hlr_reject.ok A tests/msc_vlr/msc_vlr_test_hlr_timeout.c A tests/msc_vlr/msc_vlr_test_hlr_timeout.err A tests/msc_vlr/msc_vlr_test_hlr_timeout.ok A tests/msc_vlr/msc_vlr_test_ms_timeout.c A tests/msc_vlr/msc_vlr_test_ms_timeout.err A tests/msc_vlr/msc_vlr_test_ms_timeout.ok A tests/msc_vlr/msc_vlr_test_no_authen.c A tests/msc_vlr/msc_vlr_test_no_authen.err A tests/msc_vlr/msc_vlr_test_no_authen.ok A tests/msc_vlr/msc_vlr_test_reject_concurrency.c A tests/msc_vlr/msc_vlr_test_reject_concurrency.err A tests/msc_vlr/msc_vlr_test_reject_concurrency.ok A tests/msc_vlr/msc_vlr_test_rest.c A tests/msc_vlr/msc_vlr_test_rest.err A tests/msc_vlr/msc_vlr_test_rest.ok A tests/msc_vlr/msc_vlr_test_umts_authen.c A tests/msc_vlr/msc_vlr_test_umts_authen.err A tests/msc_vlr/msc_vlr_test_umts_authen.ok A tests/msc_vlr/msc_vlr_tests.c A tests/msc_vlr/msc_vlr_tests.h M tests/testsuite.at 34 files changed, 14,785 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/3196/9 -- To view, visit https://gerrit.osmocom.org/3196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jul 23 03:00:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 23 Jul 2017 03:00:05 +0000 Subject: osmo-msc[master]: Add msc_vlr test suite for MSC+VLR end-to-end tests In-Reply-To: References: Message-ID: Patch Set 9: (the large chunk of testing code removed in this patch set already exists in other files in an improved state -- during a move to other .c files, I forgot to remove them there, making it rotten and dead code.) -- To view, visit https://gerrit.osmocom.org/3196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From admin at opensuse.org Sun Jul 23 19:54:32 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 23 Jul 2017 19:54:32 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5974feff2ef60_5ccba0cf807970b7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 229s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 229s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 229s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 229s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 229s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 229s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 229s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 229s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 229s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 229s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 229s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 229s] -Success [ 229s] ./testsuite.at:63: exit code was 132, expected 0 [ 229s] 10. testsuite.at:60: 10. coding (testsuite.at:60): FAILED (testsuite.at:63) [ 229s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 229s] make[1]: *** [override_dh_auto_test] Error 1 [ 229s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 229s] debian/rules:15: recipe for target 'build' failed [ 229s] make: *** [build] Error 2 [ 229s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 229s] [ 229s] cumulus2 failed "build libosmocore_0.9.6.20170723.dsc" at Sun Jul 23 19:54:17 UTC 2017. [ 229s] [ 229s] ### VM INTERACTION START ### [ 232s] [ 220.544497] reboot: Power down [ 232s] ### VM INTERACTION END ### [ 232s] [ 232s] cumulus2 failed "build libosmocore_0.9.6.20170723.dsc" at Sun Jul 23 19:54:20 UTC 2017. [ 232s] -- 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 Jul 24 07:46:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 24 Jul 2017 07:46:08 +0000 Subject: osmo-bts[master]: cosmetic: scheduler_trx.c: Add function to get rid of ugly g... In-Reply-To: References: Message-ID: Patch Set 1: Can we +2 this one to merge the 3 patches from the patchset? It's only comsetics and has been with only a +1 and no changes required since 20 days ago. -- To view, visit https://gerrit.osmocom.org/3116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c2e166e6f182f703ccf49aa883c223e377c8421 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 24 11:47:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 11:47:31 +0000 Subject: [PATCH] openbsc[master]: cosmetic: vty for timers: remove obsolete range check Message-ID: Review at https://gerrit.osmocom.org/3338 cosmetic: vty for timers: remove obsolete range check The VTY parsing already ensures the parameter range being 1..65535, no need to check the range again. Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/3338/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index bcd78e3..49ff535 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1551,12 +1551,6 @@ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ int value = atoi(argv[0]); \ \ - if (value < 1 || value > 65535) { \ - vty_out(vty, "Timer value %s out of range.%s", \ - argv[0], VTY_NEWLINE); \ - return CMD_WARNING; \ - } \ - \ gsmnet->T##number = value; \ return CMD_SUCCESS; \ } -- To view, visit https://gerrit.osmocom.org/3338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 24 11:47:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 11:47:33 +0000 Subject: [PATCH] openbsc[master]: vty: add 'default' keyword to timer config Message-ID: Review at https://gerrit.osmocom.org/3339 vty: add 'default' keyword to timer config Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/39/3339/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 49ff535..31eb143 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1541,15 +1541,26 @@ return CMD_SUCCESS; } +#define DEFAULT_TIMER(number) GSM_T##number##_DEFAULT +/* Add another expansion so that DEFAULT_TIMER() becomes its value */ +#define EXPAND_AND_STRINGIFY(x) OSMO_STRINGIFY(x) + #define DECLARE_TIMER(number, doc) \ DEFUN(cfg_net_T##number, \ cfg_net_T##number##_cmd, \ - "timer t" #number " <1-65535>", \ + "timer t" #number " (default|<1-65535>)", \ "Configure GSM Timers\n" \ - doc "Timer Value in seconds\n") \ + doc \ + "Set to default timer value" \ + " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ + "Timer Value in seconds\n") \ { \ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ - int value = atoi(argv[0]); \ + int value; \ + if (strcmp(argv[0], "default") == 0) \ + value = DEFAULT_TIMER(number); \ + else \ + value = atoi(argv[0]); \ \ gsmnet->T##number = value; \ return CMD_SUCCESS; \ -- To view, visit https://gerrit.osmocom.org/3339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 24 11:47:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 11:47:34 +0000 Subject: [PATCH] openbsc[master]: timer vty: also print the default value in cmd doc Message-ID: Review at https://gerrit.osmocom.org/3340 timer vty: also print the default value in cmd doc Rationale: allows seeing all timer defaults at once by doing OsmoBSC(config-net)# timer ? Before, defaults are visible only by doing on each timer: OsmoBSC(config-net)# timer t1234 Change-Id: I8259234e5c62e058dde56d531071440bbab11462 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/3340/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 31eb143..c6ff6d5 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1550,7 +1550,7 @@ cfg_net_T##number##_cmd, \ "timer t" #number " (default|<1-65535>)", \ "Configure GSM Timers\n" \ - doc \ + doc " (default: " EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ "Set to default timer value" \ " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ "Timer Value in seconds\n") \ @@ -1566,18 +1566,18 @@ return CMD_SUCCESS; \ } -DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT.\n") -DECLARE_TIMER(3103, "Set the timeout value for HANDOVER.\n") -DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION.\n") -DECLARE_TIMER(3107, "Currently not used.\n") -DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout.\n") -DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel.\n") -DECLARE_TIMER(3113, "Set the time to try paging a subscriber.\n") -DECLARE_TIMER(3115, "Currently not used.\n") -DECLARE_TIMER(3117, "Currently not used.\n") -DECLARE_TIMER(3119, "Currently not used.\n") -DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT\n") -DECLARE_TIMER(3141, "Currently not used.\n") +DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT") +DECLARE_TIMER(3103, "Set the timeout value for HANDOVER") +DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION") +DECLARE_TIMER(3107, "Currently not used") +DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout") +DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel") +DECLARE_TIMER(3113, "Set the time to try paging a subscriber") +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(3141, "Currently not used") DEFUN_DEPRECATED(cfg_net_dtx, cfg_net_dtx_cmd, -- To view, visit https://gerrit.osmocom.org/3340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8259234e5c62e058dde56d531071440bbab11462 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 24 12:14:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 12:14:44 +0000 Subject: [PATCH] libosmo-sccp[master]: safer osmo_sccp_make_addr_pc_ssn(): clear all values Message-ID: Review at https://gerrit.osmocom.org/3341 safer osmo_sccp_make_addr_pc_ssn(): clear all values Make sure that all values of the resulting sccp_addr are cleared to obtain a clean PC+SSN address. Before this, gt and ip remained unset/random, e.g. in osmo_sccp_tx_unitdata_ranap() Change-Id: I37395169d364050e45e99793c495a9848a4f8601 --- M src/sccp_helpers.c 1 file changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/41/3341/1 diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index 76a7c1c..ad0755f 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -38,10 +38,12 @@ void osmo_sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr, uint32_t pc, uint32_t ssn) { - addr->presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC; - addr->ri = OSMO_SCCP_RI_SSN_PC; - addr->ssn = ssn; - addr->pc = pc; + *addr = (struct osmo_sccp_addr){ + .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, + .ri = OSMO_SCCP_RI_SSN_PC, + .ssn = ssn, + .pc = pc, + }; } int osmo_sccp_tx_unitdata(struct osmo_sccp_user *scu, -- To view, visit https://gerrit.osmocom.org/3341 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37395169d364050e45e99793c495a9848a4f8601 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 24 12:16:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 12:16:49 +0000 Subject: libosmo-sccp[master]: sccp: drive local address from given sccp instance In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (4 comments) https://gerrit.osmocom.org/#/c/3330/1//COMMIT_MSG Commit Message: Line 7: sccp: drive local address from given sccp instance derive Line 10: indicator and the pointcode. The latter one is always available (SSN is equally important I guess) https://gerrit.osmocom.org/#/c/3330/1/src/sccp_user.c File src/sccp_user.c: Line 250: dest_addr->ri = OSMO_SCCP_RI_SSN_PC; We set RI to SSN_PC, but the resulting address has no SSN set. It would be safer API to require the caller to pass an SSN. Does that make sense in the intended callers of this function? Line 252: dest_addr->pc = ss7->cfg.primary_pc; Since we have osmo_sccp_make_addr_pc_ssn(), it would make sense to use that function instead of duplicating its content. -- To view, visit https://gerrit.osmocom.org/3330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 24 13:19:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 24 Jul 2017 13:19:44 +0000 Subject: [PATCH] osmo-bts[master]: lc15bts-mgr.cfg: Set default vswr to a value inside valid range Message-ID: Review at https://gerrit.osmocom.org/3342 lc15bts-mgr.cfg: Set default vswr to a value inside valid range Valid range is currently set to 1000-200000. Change-Id: Ibf60ab290acf0423c7617591a86403d63266e5d3 --- M doc/examples/litecell15/lc15bts-mgr.cfg 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/3342/1 diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index c7d0a79..e67742c 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -29,9 +29,9 @@ threshold warning min 17500 threshold critical min 19000 limits tx0_vswr - threshold warning max 3 + threshold warning max 1000 limits tx1_vswr - threshold warning max 3 + threshold warning max 1000 limits supply_pwr threshold warning max 110 threshold critical max 120 -- To view, visit https://gerrit.osmocom.org/3342 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf60ab290acf0423c7617591a86403d63266e5d3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 24 13:19:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 24 Jul 2017 13:19:45 +0000 Subject: [PATCH] osmo-bts[master]: cosmetics: Fix typos and whitespace in lc15bts_mgr_vty.c Message-ID: Review at https://gerrit.osmocom.org/3343 cosmetics: Fix typos and whitespace in lc15bts_mgr_vty.c Change-Id: I6e35fb9c1a6391e5185a62e9efd2f8ffba13cf0d --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/3343/1 diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index b96349e..8120165 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -1,5 +1,5 @@ /* Copyright (C) 2015 by Yves Godin - * + * * Based on sysmoBTS: * sysmobts_mgr_vty.c * (C) 2014 by lc15com - s.f.m.c. GmbH @@ -423,7 +423,7 @@ DEFUN(cfg_limit_vswr_crit_max, cfg_thresh_vswr_crit_max_cmd, "threshold critical max <1000-200000>", - "Threshold to reach\n" "Warning level\n" "Range\n") + "Threshold to reach\n" "Critical level\n" "Range\n") { struct lc15bts_vswr_limit *limit = vty->index; limit->thresh_crit_max = atoi(argv[0]); @@ -441,7 +441,7 @@ DEFUN(cfg_limit_pwr_crit_max, cfg_thresh_pwr_crit_max_cmd, "threshold critical max <0-200>", - "Threshold to reach\n" "Warning level\n" "Range\n") + "Threshold to reach\n" "Critical level\n" "Range\n") { struct lc15bts_pwr_limit *limit = vty->index; limit->thresh_crit_max = atoi(argv[0]); @@ -739,7 +739,7 @@ DEFUN(calibrate_clock, calibrate_clock_cmd, "calibrate clock", - "Calibration commands\n" + "Calibration commands\n" "Calibrate clock against GPS PPS\n") { if (lc15bts_mgr_calib_run(s_mgr) < 0) { -- To view, visit https://gerrit.osmocom.org/3343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e35fb9c1a6391e5185a62e9efd2f8ffba13cf0d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 24 13:19:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 24 Jul 2017 13:19:45 +0000 Subject: [PATCH] osmo-bts[master]: litecell15: Register in vty limits for paX_pwr Message-ID: Review at https://gerrit.osmocom.org/3344 litecell15: Register in vty limits for paX_pwr Otherwise it fails to read the default config file. Change-Id: I316a8ea73091c7e76a175314b890e4d86e9c3010 --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/3344/1 diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index 8120165..a6a925c 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -1040,10 +1040,12 @@ install_node(&limit_pa0_pwr_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_pa0_pwr_cmd); + register_limit(LIMIT_PA0_PWR_NODE, MGR_LIMIT_TYPE_PWR); vty_install_default(LIMIT_PA0_PWR_NODE); install_node(&limit_pa1_pwr_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_pa1_pwr_cmd); + register_limit(LIMIT_PA1_PWR_NODE, MGR_LIMIT_TYPE_PWR); vty_install_default(LIMIT_PA1_PWR_NODE); install_node(&limit_gps_fix_node, config_write_dummy); -- To view, visit https://gerrit.osmocom.org/3344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I316a8ea73091c7e76a175314b890e4d86e9c3010 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 24 18:12:26 2017 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Mon, 24 Jul 2017 18:12:26 +0000 Subject: osmo-bts[master]: litecell15: Register in vty limits for paX_pwr In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Looks okay and it makes sense to have actual commands in these nodes, but I don't really know lc15. -- To view, visit https://gerrit.osmocom.org/3344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I316a8ea73091c7e76a175314b890e4d86e9c3010 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 24 21:59:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 24 Jul 2017 21:59:57 +0000 Subject: osmo-bts[master]: cosmetic: scheduler_trx.c: Add function to get rid of ugly g... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c2e166e6f182f703ccf49aa883c223e377c8421 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 24 22:00:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 24 Jul 2017 22:00:00 +0000 Subject: [MERGED] osmo-bts[master]: cosmetic: scheduler_trx.c: Add function to get rid of ugly g... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: scheduler_trx.c: Add function to get rid of ugly goto path ...................................................................... cosmetic: scheduler_trx.c: Add function to get rid of ugly goto path Change-Id: I9c2e166e6f182f703ccf49aa883c223e377c8421 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 22 insertions(+), 15 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/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index f46ae1a..26b1705 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1585,6 +1585,26 @@ return 0; } +/*! reset clock with current fn and schedule it. Called when trx becomes + * available or when max clock skew is reached */ +static int trx_setup_clock(struct gsm_bts *bts, struct osmo_trx_clock_state *tcs, + struct timespec *tv_now, const struct timespec *interval, uint32_t fn) +{ + tcs->last_fn_timer.fn = fn; + /* call trx cheduler function for new 'last' FN */ + trx_sched_fn(bts, tcs->last_fn_timer.fn); + + /* schedule first FN clock timer */ + timer_ofd_setup(&tcs->fn_timer_ofd, trx_fn_timer_cb, bts); + timer_ofd_schedule(&tcs->fn_timer_ofd, NULL, interval); + + tcs->last_fn_timer.tv = *tv_now; + tcs->last_clk_ind.tv = *tv_now; + tcs->last_clk_ind.fn = fn; + + return 0; +} + /*! called every time we receive a clock indication from TRX */ int trx_sched_clock(struct gsm_bts *bts, uint32_t fn) { @@ -1615,20 +1635,7 @@ /* tell BSC */ check_transceiver_availability(bts, 1); -new_clock: - tcs->last_fn_timer.fn = fn; - /* call trx cheduler function for new 'last' FN */ - trx_sched_fn(bts, tcs->last_fn_timer.fn); - - /* schedule first FN clock timer */ - timer_ofd_setup(&tcs->fn_timer_ofd, trx_fn_timer_cb, bts); - timer_ofd_schedule(&tcs->fn_timer_ofd, NULL, &interval); - - tcs->last_fn_timer.tv = tv_now; - tcs->last_clk_ind.tv = tv_now; - tcs->last_clk_ind.fn = fn; - - return 0; + return trx_setup_clock(bts, tcs, &tv_now, &interval, fn); } /* calculate elapsed time +fn since last timer */ @@ -1663,7 +1670,7 @@ if (elapsed_fn > MAX_FN_SKEW || elapsed_fn < -MAX_FN_SKEW) { LOGP(DL1C, LOGL_NOTICE, "GSM clock skew: old fn=%u, " "new fn=%u\n", tcs->last_fn_timer.fn, fn); - goto new_clock; + return trx_setup_clock(bts, tcs, &tv_now, &interval, fn); } LOGP(DL1C, LOGL_INFO, "GSM clock jitter: %d us (elapsed_fn=%d)\n", -- To view, visit https://gerrit.osmocom.org/3116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9c2e166e6f182f703ccf49aa883c223e377c8421 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jul 24 22:00:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 24 Jul 2017 22:00:01 +0000 Subject: [MERGED] osmo-bts[master]: cosmetic: Move error goto path to the end of the function In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: Move error goto path to the end of the function ...................................................................... cosmetic: Move error goto path to the end of the function Change-Id: I3ad15a9edbfe74de3deb7298441d54fd9d0178ad --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 9 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/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 26b1705..967e3db 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1549,14 +1549,7 @@ /* check if transceiver is still alive */ if (tcs->fn_without_clock_ind++ == TRX_LOSS_FRAMES) { LOGP(DL1C, LOGL_NOTICE, "No more clock from transceiver\n"); - -no_clock: - timer_ofd_disable(&tcs->fn_timer_ofd); - transceiver_available = 0; - - bts_shutdown(bts, "No clock from osmo-trx"); - - return -1; + goto no_clock; } /* compute actual elapsed time and resulting OS scheduling error */ @@ -1583,6 +1576,14 @@ } return 0; + +no_clock: + timer_ofd_disable(&tcs->fn_timer_ofd); + transceiver_available = 0; + + bts_shutdown(bts, "No clock from osmo-trx"); + + return -1; } /*! reset clock with current fn and schedule it. Called when trx becomes -- To view, visit https://gerrit.osmocom.org/3117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ad15a9edbfe74de3deb7298441d54fd9d0178ad 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 Mon Jul 24 22:00:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 24 Jul 2017 22:00:03 +0000 Subject: [MERGED] osmo-bts[master]: cosmetic: scheduler_trx: Remove trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: scheduler_trx: Remove trailing whitespace ...................................................................... cosmetic: scheduler_trx: Remove trailing whitespace Change-Id: Ib057b5e5219ad2acfaee2dcc9ade098daa9ac985 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 4c3330f..f46ae1a 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -120,9 +120,9 @@ sb_info[0] = ((bsic & 0x3f) << 2) | ((t.t1 & 0x600) >> 9); - sb_info[1] = + sb_info[1] = ((t.t1 & 0x1fe) >> 1); - sb_info[2] = + sb_info[2] = ((t.t1 & 0x001) << 7) | ((t.t2 & 0x1f) << 2) | ((t3p & 0x6) >> 1); @@ -174,7 +174,7 @@ goto got_msg; LOGP(DL1C, LOGL_INFO, "%s has not been served !! No prim for " - "trx=%u ts=%u at fn=%u to transmit.\n", + "trx=%u ts=%u at fn=%u to transmit.\n", trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); no_msg: @@ -270,7 +270,7 @@ goto got_msg; LOGP(DL1C, LOGL_INFO, "%s has not been served !! No prim for " - "trx=%u ts=%u at fn=%u to transmit.\n", + "trx=%u ts=%u at fn=%u to transmit.\n", trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); no_msg: @@ -591,7 +591,7 @@ /* no message at all */ if (!msg_tch && !msg_facch) { LOGP(DL1C, LOGL_INFO, "%s has not been served !! No prim for " - "trx=%u ts=%u at fn=%u to transmit.\n", + "trx=%u ts=%u at fn=%u to transmit.\n", trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); goto send_burst; } @@ -688,7 +688,7 @@ /* no message at all */ if (!msg_tch && !msg_facch && !chan_state->dl_ongoing_facch) { LOGP(DL1C, LOGL_INFO, "%s has not been served !! No prim for " - "trx=%u ts=%u at fn=%u to transmit.\n", + "trx=%u ts=%u at fn=%u to transmit.\n", trx_chan_desc[chan].name, l1t->trx->nr, tn, fn); goto send_burst; } @@ -906,7 +906,7 @@ uint16_t ber10k; int rc; - LOGP(DL1C, LOGL_DEBUG, "PDTCH received %s fn=%u ts=%u trx=%u bid=%u\n", + LOGP(DL1C, LOGL_DEBUG, "PDTCH received %s fn=%u ts=%u trx=%u bid=%u\n", trx_chan_desc[chan].name, fn, tn, l1t->trx->nr, bid); /* allocate burst memory, if not already */ @@ -1012,7 +1012,7 @@ if (chan_state->ho_rach_detect == 1) return rx_rach_fn(l1t, tn, fn, chan, bid, bits, GSM_BURST_LEN, rssi, toa); - LOGP(DL1C, LOGL_DEBUG, "TCH/F received %s fn=%u ts=%u trx=%u bid=%u\n", + LOGP(DL1C, LOGL_DEBUG, "TCH/F received %s fn=%u ts=%u trx=%u bid=%u\n", trx_chan_desc[chan].name, fn, tn, l1t->trx->nr, bid); /* allocate burst memory, if not already */ -- To view, visit https://gerrit.osmocom.org/3115 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib057b5e5219ad2acfaee2dcc9ade098daa9ac985 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 Mon Jul 24 22:00:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 24 Jul 2017 22:00:21 +0000 Subject: osmo-msc[master]: Add libvlr implementation In-Reply-To: References: Message-ID: Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 10 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 24 22:01:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 24 Jul 2017 22:01:23 +0000 Subject: osmo-pcu[master]: Introduce GSMTAP categories In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I297183690e98a7234dfc1608c18847d8981306e4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 24 22:01:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 24 Jul 2017 22:01:28 +0000 Subject: [MERGED] osmo-pcu[master]: Introduce GSMTAP categories In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Introduce GSMTAP categories ...................................................................... Introduce GSMTAP categories When looking at GSMTAP output so far, one is easily overwhelmed by way too much information being presented. A lot of is consists of DUMMY frames, which are probably of lowest interest, ever. A concept similar to the "gsmtap-sapi" of OsmoBTS is introduced, by which the user can configure which particular categories (uplink or downlink control or data, gprs or egprs, ...) he actually wants to see in his logs. Change-Id: I297183690e98a7234dfc1608c18847d8981306e4 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_sched.cpp M src/osmo-bts-litecell15/lc15_l1_if.c M src/osmo-bts-sysmo/sysmo_l1_if.c M src/pcu_l1_if.cpp M src/pcu_vty.c 7 files changed, 182 insertions(+), 48 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 2d289d7..5d1a500 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -35,6 +35,7 @@ #include #include #include + #include } #include @@ -360,6 +361,23 @@ LOGP(DRLCMAC, LOGL_INFO, "No paging, because no TBF\n"); return 0; +} + +void BTS::send_gsmtap(enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no, + uint8_t ts_no, uint8_t channel, uint32_t fn, + const uint8_t *data, unsigned int len) +{ + uint16_t arfcn; + + /* check if category is activated at all */ + if (!(m_bts.gsmtap_categ_mask & (1 << categ))) + return; + + arfcn = m_bts.trx[trx_no].arfcn; + if (uplink) + arfcn |= GSMTAP_ARFCN_F_UPLINK; + + gsmtap_send(m_bts.gsmtap, arfcn, ts_no, channel, 0, fn, 0, 0, data, len); } gprs_rlcmac_dl_tbf *BTS::dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) @@ -1488,13 +1506,19 @@ /* Received Uplink RLC control block. */ int gprs_rlcmac_pdch::rcv_control_block( - bitvec *rlc_block, uint32_t fn) + 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: @@ -1544,10 +1568,10 @@ "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); if (cs.isGprs()) - return rcv_block_gprs(data, fn, meas, cs); + return rcv_block_gprs(data, len, fn, meas, cs); if (cs.isEgprs()) - return rcv_data_block(data, fn, meas, cs); + return rcv_data_block(data, len, fn, meas, cs); bts()->decode_error(); LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", @@ -1556,7 +1580,7 @@ } /*! \brief process egprs and gprs data blocks */ -int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint32_t fn, +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; @@ -1574,6 +1598,9 @@ cs.name()); return -EINVAL; } + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + } else { + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); } LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); @@ -1606,7 +1633,7 @@ return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); } -int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint32_t fn, +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; @@ -1616,14 +1643,14 @@ switch (payload) { case GPRS_RLCMAC_DATA_BLOCK: - rc = rcv_data_block(data, fn, meas, cs); + 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(block, fn); + rc = rcv_control_block(data, data_len, block, fn); bitvec_free(block); break; case GPRS_RLCMAC_CONTROL_BLOCK_OPT: diff --git a/src/bts.h b/src/bts.h index 78ed002..66875f1 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,20 @@ #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +/* see bts->gsmtap_categ_mask */ +enum pcu_gsmtap_category { + PCU_GSMTAP_C_DL_UNKNOWN = 0, /* unknown or undecodable downlink blocks */ + PCU_GSMTAP_C_DL_DUMMY = 1, /* downlink dummy blocks */ + PCU_GSMTAP_C_DL_CTRL = 2, /* downlink control blocks */ + PCU_GSMTAP_C_DL_DATA_GPRS = 3, /* downlink GPRS data blocks */ + PCU_GSMTAP_C_DL_DATA_EGPRS = 4, /* downlink EGPRS data blocks */ + + PCU_GSMTAP_C_UL_UNKNOWN = 15, /* unknown or undecodable uplink blocks */ + PCU_GSMTAP_C_UL_DUMMY = 16, /* uplink dummy blocks */ + PCU_GSMTAP_C_UL_CTRL = 17, /* uplink control blocks */ + PCU_GSMTAP_C_UL_DATA_GPRS = 18, /* uplink GPRS data blocks */ + PCU_GSMTAP_C_UL_DATA_EGPRS = 19, /* uplink EGPRS data blocks */ +}; struct BTS; struct GprsMs; @@ -68,9 +82,9 @@ /* 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, uint32_t fn, + 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, uint32_t fn, + 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; @@ -107,7 +121,7 @@ #ifdef __cplusplus private: - int rcv_control_block(bitvec *rlc_block, uint32_t fn); + 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); @@ -186,6 +200,7 @@ uint8_t n3103; uint8_t n3105; 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, @@ -362,6 +377,10 @@ GprsMs *ms_by_imsi(const char *imsi); GprsMs *ms_alloc(uint8_t ms_class, uint8_t egprs_ms_class = 0); + void send_gsmtap(enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no, + uint8_t ts_no, uint8_t channel, uint32_t fn, + const uint8_t *data, unsigned int len); + /* * Statistics */ diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a21c023..e5c8ec8 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -356,22 +356,29 @@ /* Prio 1: select control message */ msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); - if (msg) + if (msg) { bts->bts->rlc_sent_control(); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + } /* Prio 2: select data message for downlink */ if (!msg) { msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); - if (msg) + if (msg) { bts->bts->rlc_sent(); + /* FIXME: distinguish between GPRS and EGPRS */ + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + } } /* Prio 3: send dummy contol message */ if (!msg) { /* increase counter */ msg = sched_dummy(); - if (msg) + if (msg) { bts->bts->rlc_sent_dummy(); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + } } if (!msg) diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c index 12a977b..c82ddba 100644 --- a/src/osmo-bts-litecell15/lc15_l1_if.c +++ b/src/osmo-bts-litecell15/lc15_l1_if.c @@ -199,11 +199,6 @@ if (data_ind->msgUnitParam.u8Size == 0) return -1; - gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, - data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, - data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, - data_ind->msgUnitParam.u8Size-1); - get_meas(&meas, &data_ind->measParam); bts_update_tbf_ta("PH-DATA", data_ind->u32Fn, fl1h->trx_no, data_ind->u8Tn, qta2ta(meas.bto)); @@ -216,7 +211,7 @@ != GsmL1_PdtchPlType_Full) break; /* PDTCH / PACCH frame handling */ - pcu_rx_data_ind_pdtch(fl1h->trx_no, data_ind->u8Tn, + rc = pcu_rx_data_ind_pdtch(fl1h->trx_no, data_ind->u8Tn, data_ind->msgUnitParam.u8Buffer + 1, data_ind->msgUnitParam.u8Size - 1, data_ind->u32Fn, @@ -224,11 +219,19 @@ break; case GsmL1_Sapi_Ptcch: // FIXME + rc = -1; break; default: LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", get_value_string(lc15bts_l1sapi_names, data_ind->sapi)); break; + } + + if (rc < 0) { + gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, + data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, + data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, + data_ind->msgUnitParam.u8Size-1); } return rc; @@ -321,12 +324,6 @@ msu_param = &data_req->msgUnitParam; msu_param->u8Size = len; memcpy(msu_param->u8Buffer, data, len); - - gsmtap_send(fl1h->gsmtap, arfcn, data_req->u8Tn, GSMTAP_CHANNEL_PACCH, - 0, data_req->u32Fn, 0, 0, - data_req->msgUnitParam.u8Buffer, - data_req->msgUnitParam.u8Size); - /* transmit */ if (osmo_wqueue_enqueue(&fl1h->write_q[MQ_PDTCH_WRITE], msg) != 0) { diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index 8994ac3..9170972 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -184,11 +184,6 @@ if (data_ind->msgUnitParam.u8Size == 0) return -1; - gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, - data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, - data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, - data_ind->msgUnitParam.u8Size-1); - get_meas(&meas, &data_ind->measParam); bts_update_tbf_ta("PH-DATA", data_ind->u32Fn, fl1h->trx_no, data_ind->u8Tn, qta2ta(meas.bto)); @@ -209,11 +204,21 @@ break; case GsmL1_Sapi_Ptcch: // FIXME + rc = -1; break; default: LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", get_value_string(femtobts_l1sapi_names, data_ind->sapi)); + rc = -1; break; + } + + if (rc < 0) { + gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, + data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, + data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, + data_ind->msgUnitParam.u8Size-1); + //send_gsmtap(PCU_GSMTAP_C_UL_UNKNOWN, true, 0, date_ind->u8Tn, GSMTAP_CHANNEL_PACCH, data_ind->u32Fn, data_ind->msgUnitParam.u8Buffer+1, data_ind->msgUnitParam.u8Size-1); } return rc; @@ -308,12 +313,6 @@ msu_param = &data_req->msgUnitParam; msu_param->u8Size = len; memcpy(msu_param->u8Buffer, data, len); - - gsmtap_send(fl1h->gsmtap, arfcn, data_req->u8Tn, GSMTAP_CHANNEL_PACCH, - 0, data_req->u32Fn, 0, 0, - data_req->msgUnitParam.u8Buffer, - data_req->msgUnitParam.u8Size); - /* transmit */ if (osmo_wqueue_enqueue(&fl1h->write_q[MQ_PDTCH_WRITE], msg) != 0) { diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index c2c6cc6..420bca0 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -165,7 +165,6 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr, @@ -245,8 +244,9 @@ return pdch->rcv_block(data, len, fn, meas); } -static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind, struct gsmtap_inst *gsmtap) +static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind) { + struct gprs_rlcmac_bts *bts = bts_main_data(); int rc; pcu_l1_meas meas; meas.set_rssi(data_ind->rssi); @@ -264,13 +264,6 @@ data_ind->arfcn, data_ind->block_nr, osmo_hexdump(data_ind->data, data_ind->len)); - rc = gsmtap_send(gsmtap, data_ind->arfcn | GSMTAP_ARFCN_F_UPLINK, data_ind->ts_nr, - GSMTAP_CHANNEL_PACCH, 0, data_ind->fn, 0, 0, data_ind->data, data_ind->len); - if (rc < 0) - LOGP(DL1IF, LOGL_ERROR, "Sending RX data via GSMTAP failed: %d\n", rc); - - rc = 0; - switch (data_ind->sapi) { case PCU_IF_SAPI_PDTCH: rc = pcu_rx_data_ind_pdtch(data_ind->trx_nr, data_ind->ts_nr, @@ -281,6 +274,11 @@ LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with " "unsupported sapi %d\n", data_ind->sapi); rc = -EINVAL; + } + + if (rc < 0 && (bts->gsmtap_categ_mask & PCU_GSMTAP_C_UL_UNKNOWN)) { + gsmtap_send(bts->gsmtap, data_ind->arfcn | GSMTAP_ARFCN_F_UPLINK, data_ind->ts_nr, + GSMTAP_CHANNEL_PACCH, 0, data_ind->fn, 0, 0, data_ind->data, data_ind->len); } return rc; @@ -568,11 +566,10 @@ int pcu_rx(uint8_t msg_type, struct gsm_pcu_if *pcu_prim) { int rc = 0; - struct gprs_rlcmac_bts *bts = bts_main_data(); switch (msg_type) { case PCU_IF_MSG_DATA_IND: - rc = pcu_rx_data_ind(&pcu_prim->u.data_ind, bts->gsmtap); + rc = pcu_rx_data_ind(&pcu_prim->u.data_ind); break; case PCU_IF_MSG_DATA_CNF: rc = pcu_rx_data_cnf(&pcu_prim->u.data_cnf); @@ -597,6 +594,6 @@ msg_type); rc = -EINVAL; } - +; return rc; } diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 3b5996c..fc57a5f 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -16,6 +16,70 @@ #include "pcu_vty_functions.h" +extern void *tall_pcu_ctx; + +static const struct value_string pcu_gsmtap_categ_names[] = { + { PCU_GSMTAP_C_DL_UNKNOWN, "dl-unknown" }, + { PCU_GSMTAP_C_DL_DUMMY, "dl-dummy" }, + { PCU_GSMTAP_C_DL_CTRL, "dl-ctrl" }, + { PCU_GSMTAP_C_DL_DATA_GPRS, "dl-data-gprs" }, + { PCU_GSMTAP_C_DL_DATA_EGPRS, "dl-data-egprs" }, + + { PCU_GSMTAP_C_UL_UNKNOWN, "ul-unknown" }, + { PCU_GSMTAP_C_UL_DUMMY, "ul-dummy" }, + { PCU_GSMTAP_C_UL_CTRL, "ul-ctrl" }, + { PCU_GSMTAP_C_UL_DATA_GPRS, "ul-data-gprs" }, + { PCU_GSMTAP_C_UL_DATA_EGPRS, "ul-data-egprs" }, + + { 0, NULL } +}; + +static const struct value_string pcu_gsmtap_categ_help[] = { + { PCU_GSMTAP_C_DL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" }, + { PCU_GSMTAP_C_DL_DUMMY, "Downlink Dummy Blocks" }, + { PCU_GSMTAP_C_DL_CTRL, "Downlink Control Blocks" }, + { PCU_GSMTAP_C_DL_DATA_GPRS, "Downlink Data Blocks (GPRS)" }, + { PCU_GSMTAP_C_DL_DATA_EGPRS, "Downlink Data Blocks (EGPRS)" }, + + { PCU_GSMTAP_C_UL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" }, + { PCU_GSMTAP_C_UL_DUMMY, "Uplink Dummy Blocks" }, + { PCU_GSMTAP_C_UL_CTRL, "Uplink Control Blocks" }, + { PCU_GSMTAP_C_UL_DATA_GPRS, "Uplink Data Blocks (GPRS)" }, + { PCU_GSMTAP_C_UL_DATA_EGPRS, "Uplink Data Blocks (EGPRS)" }, + + { 0, NULL } +}; + + +DEFUN(cfg_pcu_gsmtap_categ, cfg_pcu_gsmtap_categ_cmd, "HIDDEN", "HIDDEN") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + int categ; + + categ = get_string_value(pcu_gsmtap_categ_names, argv[0]); + if (categ < 0) + return CMD_WARNING; + + bts->gsmtap_categ_mask |= (1 << categ); + + return CMD_SUCCESS; +} + +DEFUN(cfg_pcu_no_gsmtap_categ, cfg_pcu_no_gsmtap_categ_cmd, "HIDDEN", "HIDDEN") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + int categ; + + categ = get_string_value(pcu_gsmtap_categ_names, argv[0]); + if (categ < 0) + return CMD_WARNING; + + bts->gsmtap_categ_mask &= ~(1 << categ); + + return CMD_SUCCESS; +} + + int pcu_vty_go_parent(struct vty *vty) { switch (vty->node) { @@ -53,6 +117,7 @@ static int config_write_pcu(struct vty *vty) { struct gprs_rlcmac_bts *bts = bts_main_data(); + unsigned int i; vty_out(vty, "pcu%s", VTY_NEWLINE); if (bts->egprs_enabled) @@ -166,6 +231,14 @@ if (bts->dl_tbf_idle_msec) vty_out(vty, " dl-tbf-idle-time %d%s", bts->dl_tbf_idle_msec, VTY_NEWLINE); + + for (i = 0; i < 32; i++) { + unsigned int cs = (1 << i); + if (bts->gsmtap_categ_mask & cs) { + vty_out(vty, " gsmtap-category %s%s", + get_value_string(pcu_gsmtap_categ_names, i), VTY_NEWLINE); + } + } return pcu_vty_config_write_pcu_ext(vty); } @@ -953,6 +1026,19 @@ { // install_element_ve(&show_pcu_cmd); + cfg_pcu_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names, + "gsmtap-category (", + "|",")", VTY_DO_LOWER); + cfg_pcu_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help, + "GSMTAP Category\n", + "\n", "", 0); + cfg_pcu_no_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names, + "no gsmtap-category (", + "|",")", VTY_DO_LOWER); + cfg_pcu_no_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help, + NO_STR "GSMTAP Category\n", + "\n", "", 0); + logging_vty_add_cmds(cat); osmo_stats_vty_add_cmds(cat); @@ -1006,6 +1092,8 @@ install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_ms_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd); + install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd); + install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd); install_element_ve(&show_bts_stats_cmd); install_element_ve(&show_tbf_cmd); -- To view, visit https://gerrit.osmocom.org/3337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I297183690e98a7234dfc1608c18847d8981306e4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 24 22:01:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 24 Jul 2017 22:01:42 +0000 Subject: [MERGED] osmo-pcap[master]: client: Move to osmo_sock_init2_ofd() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client: Move to osmo_sock_init2_ofd() ...................................................................... client: Move to osmo_sock_init2_ofd() We can simplify the code even further by using the osmo_fd version of osmo_sock_init2() called osmo_sock_init2_ofd(), which takes care of filling the osmo_fd.fd member and registering the socket in the select loop. Change-Id: Ibf1480e7dee287db77a19bb9f0254edddf7706ab --- M src/osmo_client_network.c 1 file changed, 3 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index 03cb281..402e1cb 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -228,31 +228,22 @@ void osmo_client_connect(struct osmo_pcap_client_conn *conn) { - int fd; + int rc; osmo_client_disconnect(conn); conn->wqueue.read_cb = read_cb; conn->wqueue.write_cb = write_cb; - conn->wqueue.bfd.when = BSC_FD_READ; osmo_wqueue_clear(&conn->wqueue); - fd = osmo_sock_init2(AF_INET, SOCK_STREAM, IPPROTO_TCP, + rc = osmo_sock_init2_ofd(&conn->wqueue.bfd, AF_INET, SOCK_STREAM, IPPROTO_TCP, conn->source_ip, 0, conn->srv_ip, conn->srv_port, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT | OSMO_SOCK_F_NONBLOCK); - if (fd < 0) { + if (rc < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to connect conn=%s to %s:%d\n", conn->name, conn->srv_ip, conn->srv_port); - lost_connection(conn); - return; - } - - conn->wqueue.bfd.fd = fd; - if (osmo_fd_register(&conn->wqueue.bfd) != 0) { - LOGP(DCLIENT, LOGL_ERROR, - "Failed to register to BFD conn=%s\n", conn->name); lost_connection(conn); return; } -- To view, visit https://gerrit.osmocom.org/3336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf1480e7dee287db77a19bb9f0254edddf7706ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 24 22:01:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 24 Jul 2017 22:01:42 +0000 Subject: [MERGED] osmo-pcap[master]: Use libosmocore osmo_sock_init2() instead of local implement... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use libosmocore osmo_sock_init2() instead of local implementation ...................................................................... Use libosmocore osmo_sock_init2() instead of local implementation A related function for "create a socket, bind it locally and connect remotely" has meanwhile been introduced in libosmocore, so the local implementation can go. Change-Id: Ieda77ad8b3f7b89faa09882c0037562ce4d0fc89 --- M src/osmo_client_network.c 1 file changed, 2 insertions(+), 134 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index 27c649a..03cb281 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -43,138 +43,6 @@ #include -/* - * Move to libosmocore... if the api makes source - */ -static int sock_src_init(uint16_t family, uint16_t type, uint8_t proto, - const char *src, uint16_t src_port, - const char *host, uint16_t port, unsigned int flags) -{ - struct addrinfo hints, *result, *rp; - struct addrinfo *src_result, *src_rp = NULL; - int sfd, rc, on = 1; - char portbuf[16]; - char src_portbuf[16]; - - sprintf(portbuf, "%u", port); - sprintf(src_portbuf, "%u", src_port); - memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = family; - if (type == SOCK_RAW) { - /* Workaround for glibc, that returns EAI_SERVICE (-8) if - * SOCK_RAW and IPPROTO_GRE is used. - */ - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - } else { - hints.ai_socktype = type; - hints.ai_protocol = proto; - } - - rc = getaddrinfo(host, portbuf, &hints, &result); - if (rc != 0) { - fprintf(stderr, "getaddrinfo returned NULL: %s:%u: %s\n", - host, port, strerror(errno)); - return -EINVAL; - } - - if (src) { - rc = getaddrinfo(src, src_portbuf, &hints, &src_result); - if (rc != 0) { - fprintf(stderr, "getaddrinfo returned NULL: %s:%u: %s\n", - src, src_port, strerror(errno)); - freeaddrinfo(result); - return -EINVAL; - } - - /* select an address */ - for (src_rp = src_result; src_rp != NULL; src_rp = src_rp->ai_next) { - /* Workaround for glibc again */ - if (type == SOCK_RAW) { - src_rp->ai_socktype = SOCK_RAW; - src_rp->ai_protocol = proto; - } - break; - } - - if (!src_rp) { - fprintf(stderr, "Failed to get src: %s:%u %s\n", - src, src_port, strerror(errno)); - freeaddrinfo(result); - freeaddrinfo(src_result); - return -EINVAL; - } - } - - - for (rp = result; rp != NULL; rp = rp->ai_next) { - /* Workaround for glibc again */ - if (type == SOCK_RAW) { - rp->ai_socktype = SOCK_RAW; - rp->ai_protocol = proto; - } - - sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); - if (sfd == -1) - continue; - if (flags & OSMO_SOCK_F_NONBLOCK) { - if (ioctl(sfd, FIONBIO, (unsigned char *)&on) < 0) { - fprintf(stderr, - "cannot set this socket unblocking:" - " %s:%u: %s\n", - host, port, strerror(errno)); - close(sfd); - freeaddrinfo(result); - return -EINVAL; - } - } - - - if (src_rp) { - rc = bind(sfd, src_rp->ai_addr, src_rp->ai_addrlen); - if (rc != 0) { - fprintf(stderr, - "cannot bind socket:" - " %s:%u: %s\n", - src, src_port, strerror(errno)); - close(sfd); - continue; - } - } - - if (flags & OSMO_SOCK_F_CONNECT) { - rc = connect(sfd, rp->ai_addr, rp->ai_addrlen); - if (rc != -1 || (rc == -1 && errno == EINPROGRESS)) - break; - } else { - rc = setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, - &on, sizeof(on)); - if (rc < 0) { - fprintf(stderr, - "cannot setsockopt socket:" - " %s:%u: %s\n", - host, port, strerror(errno)); - break; - } - if (bind(sfd, rp->ai_addr, rp->ai_addrlen) != -1) - break; - } - close(sfd); - } - freeaddrinfo(result); - if (src) - freeaddrinfo(src_result); - - if (rp == NULL) { - fprintf(stderr, "unable to connect/bind socket: %s:%u: %s\n", - host, port, strerror(errno)); - return -ENODEV; - } - - setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - return sfd; -} - static void _osmo_client_connect(void *_data) { osmo_client_connect((struct osmo_pcap_client_conn *) _data); @@ -369,10 +237,10 @@ conn->wqueue.bfd.when = BSC_FD_READ; osmo_wqueue_clear(&conn->wqueue); - fd = sock_src_init(AF_INET, SOCK_STREAM, IPPROTO_TCP, + fd = osmo_sock_init2(AF_INET, SOCK_STREAM, IPPROTO_TCP, conn->source_ip, 0, conn->srv_ip, conn->srv_port, - OSMO_SOCK_F_CONNECT | OSMO_SOCK_F_NONBLOCK); + OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT | OSMO_SOCK_F_NONBLOCK); if (fd < 0) { LOGP(DCLIENT, LOGL_ERROR, "Failed to connect conn=%s to %s:%d\n", -- To view, visit https://gerrit.osmocom.org/3335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieda77ad8b3f7b89faa09882c0037562ce4d0fc89 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jul 24 23:08:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 23:08:29 +0000 Subject: [PATCH] osmo-msc[master]: mscsplit: various preparations to separate MSC from BSC Message-ID: Review at https://gerrit.osmocom.org/3345 mscsplit: various preparations to separate MSC from BSC Disable large parts of the code that depend on BSC presence. The code sections disabled by #if BEFORE_MSCSPLIT shall be modified or dropped in the course of adding the A-interface. Don't set msg->lchan nor msg->dst. Don't use lchan in libmsc. Decouple lac from bts. Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication: Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to different interfaces depending on the actual subscriber connection. While iu_tx() is going to be functional fairly soon, the a_tx() is going to be just a dummy for some time (see comment). Add Iu specific fields in gsm_subscriber_connection: the UE connection pointer and an indicator for the Integrity Protection status on Iu (to be fully implemented in later commits). Add lac member to gsm_subscriber_connection, to allow decoupling from bts->location_area_code. The conn->lac will actually be set in iu.c in an upcoming commit ("add iucs.[hc]"). move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi(). libmsc: duplicate gsm0808 / gsm48 functions (towards BSC). In osmo-nitb, libmsc would directly call the functions on the BSC level, not always via the bsc_api. When separating libmsc from libbsc, some functions are missing from the linkage. Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also add a _tx to gsm0808_cipher_mode(): * add msc_gsm0808_tx_cipher_mode() (dummy/stub) * add msc_gsm48_tx_mm_serv_ack() * add msc_gsm48_tx_mm_serv_rej() Call these from libmsc instead of * gsm0808_cipher_mode() * gsm48_tx_mm_serv_ack() * gsm48_tx_mm_serv_rej() Also add a comment related to msc_gsm0808_tx_cipher_mode() in two places. Remove internal RTP streaming code; OsmoNITB supported that, but for OsmoMSC, this will be done with an external MGCP gateway. Remove LCHAN_MODIFY from internal MNCC state machine. Temporarily disable all paging to be able to link libmsc without libbsc. Skip the paging part of channel_test because the paging is now disabled. Employ fake paging shims in order for msc_vlr_tests to still work. msc_compl_l3(): publish in .h, tweak return value. Use new libmsc enum values for return val, to avoid dependency on libbsc headers. Make callable from other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c add gsm_encr to subscr_conn move subscr_request to gsm_subscriber.h subscr_request_channel() -> subscr_request_conn() move to libmsc: osmo_stats_vty_add_cmds() gsm_04_08: remove apply_codec_restrictions() gsm0408_test: use NULL for root ctx move to libbsc: gsm_bts_neighbor() move to libbsc: lchan_next_meas_rep() move vty config for t3212 to network level (periodic lu) remove unneccessary linking from some tests remove handle_abisip_signal() abis_rsl.c: don't use libvlr from libbsc gsm_subscriber_connection: put the LAC here, so that it is available without accessing conn->bts. In bsc_api.c, place this lac in conn for the sake of transition: Iu and A will use this new field to pass the LAC around, but in a completely separate OsmoBSC this is not actually needed. It can be removed again from osmo-bsc.git when the time has come. Siemens MRPCI: completely drop sending the MRPCI messages for now, they shall be added in osmo-bsc once the A-Interface code has settled. See OS#2389. Related: OS#1845 OS#2257 OS#2389 Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c --- M include/openbsc/Makefile.am M include/openbsc/gsm_04_08.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/mncc.h A include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_vty.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/handover_decision.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/gsm_data.c M src/libcommon/talloc_ctx.c M src/libmsc/Makefile.am A src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/mncc_builtin.c M src/libmsc/mncc_sock.c A src/libmsc/msc_ifaces.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/vty_interface_layer3.c M tests/bsc/Makefile.am M tests/channel/Makefile.am M tests/db/Makefile.am M tests/gsm0408/gsm0408_test.c M tests/msc_vlr/Makefile.am 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_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 39 files changed, 440 insertions(+), 1,041 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/45/3345/1 diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 456a4a2..1dfe6c3 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -54,6 +54,7 @@ misdn.h \ mncc.h \ mncc_int.h \ + msc_ifaces.h \ nat_rewrite_trie.h \ network_listen.h \ oap_client.h \ diff --git a/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h index c40d96d..6d6ead1 100644 --- a/include/openbsc/gsm_04_08.h +++ b/include/openbsc/gsm_04_08.h @@ -65,8 +65,6 @@ int send_siemens_mrpci(struct gsm_lchan *lchan, uint8_t *classmark2_lv); int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type); int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, uint8_t *mi_type); -int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_subscr *bsub); int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode); int gsm48_rx_rr_modif_ack(struct msgb *msg); diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index fa2fed7..17b3d71 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -26,6 +26,7 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; +struct ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -117,6 +118,12 @@ uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be truncated */ }; +enum integrity_protection_state { + INTEGRITY_PROTECTION_NONE = 0, + INTEGRITY_PROTECTION_IK = 1, + INTEGRITY_PROTECTION_IK_CK = 2, +}; + /* active radio connection of a mobile subscriber */ struct gsm_subscriber_connection { /* global linked list of subscriber_connections */ @@ -176,6 +183,15 @@ enum ran_type via_ran; struct gsm_classmark classmark; + + uint16_t lac; + struct gsm_encr encr; + + /* which Iu-CS connection, if any. */ + struct { + struct ue_conn_ctx *ue_ctx; + int integrity_protection; + } iu; }; @@ -311,6 +327,12 @@ }; struct gsm_network { + /* TODO MSCSPLIT the gsm_network struct is basically a kitchen sink for + * global settings and variables, "madly" mixing BSC and MSC stuff. Split + * this in e.g. struct osmo_bsc and struct osmo_msc, with the things + * these have in common, like country and network code, put in yet + * separate structs and placed as members in osmo_bsc and osmo_msc. */ + /* global parameters */ uint16_t country_code; uint16_t network_code; @@ -416,6 +438,9 @@ uint16_t gsup_server_port; struct vlr_instance *vlr; + + /* Periodic location update default value */ + uint8_t t3212; }; struct osmo_esme; @@ -470,10 +495,6 @@ extern void talloc_ctx_init(void *ctx_root); int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); - -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - uint16_t arfcn, uint8_t bsic); enum gsm_bts_type parse_btstype(const char *arg); const char *btstype2str(enum gsm_bts_type type); @@ -557,7 +578,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_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan); int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); int gsm_bts_model_register(struct gsm_bts_model *model); diff --git a/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h index c65b8a3..60eb0cd 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/include/openbsc/gsm_subscriber.h @@ -19,8 +19,6 @@ #define GSM_SUBSCRIBER_NO_EXPIRATION 0x0 -struct subscr_request; - enum gsm_subscriber_field { GSM_SUBSCRIBER_IMSI, GSM_SUBSCRIBER_TMSI, @@ -34,17 +32,35 @@ GSM_SUBSCRIBER_UPDATE_EQUIPMENT, }; -int subscr_update(struct vlr_subscr *vsub, struct gsm_bts *bts, int reason); +/* + * Struct for pending channel requests. This is managed in the + * llist_head requests of each subscriber. The reference counting + * should work in such a way that a subscriber with a pending request + * remains in memory. + */ +struct subscr_request { + struct llist_head entry; + + /* the callback data */ + gsm_cbfn *cbfn; + void *param; +}; + +int subscr_update(struct vlr_subscr *vsub, int reason); /* * Paging handling with authentication */ -struct subscr_request *subscr_request_channel(struct vlr_subscr *vsub, - int channel_type, - gsm_cbfn *cbfn, void *param); +struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub, + int channel_type, + gsm_cbfn *cbfn, void *param); + void subscr_remove_request(struct subscr_request *req); int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param); +int msc_fake_paging_request(struct vlr_subscr *vsub); +void msc_fake_paging_request_stop(struct vlr_subscr *vsub); + #endif /* _GSM_SUBSCR_H */ diff --git a/include/openbsc/mncc.h b/include/openbsc/mncc.h index 49f0c8b..881e041 100644 --- a/include/openbsc/mncc.h +++ b/include/openbsc/mncc.h @@ -155,9 +155,6 @@ int notify; /* 0..127 */ int emergency; char imsi[16]; - - unsigned char lchan_type; - unsigned char lchan_mode; }; struct gsm_data_frame { @@ -179,7 +176,6 @@ uint32_t called_offset; uint32_t signal_offset; uint32_t emergency_offset; - uint32_t lchan_type_offset; }; struct gsm_mncc_rtp { diff --git a/include/openbsc/msc_ifaces.h b/include/openbsc/msc_ifaces.h new file mode 100644 index 0000000..83aad92 --- /dev/null +++ b/include/openbsc/msc_ifaces.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include + +/* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, + * i.e. in the direction towards the mobile device (MS aka UE). + * + * 2G will use the A-interface, + * 3G aka UMTS will use the Iu-interface (for the MSC, it's IuCS). + * + * To allow linking parts of the MSC code without having to include entire + * infrastructures of external libraries, the core transmitting and receiving + * functions are left unimplemented. For example, a unit test does not need to + * link against external ASN1 libraries if it is never going to encode actual + * outgoing messages. It is up to each building scope to implement real world + * functions or to plug mere dummy implementations. + * + * For example, msc_tx_dtap(conn, msg), depending on conn->via_iface, will call + * either iu_tx() or a_tx() [note: at time of writing, the A-interface is not + * yet implemented]. When you try to link against libmsc, you will find that + * the compiler complains about an undefined reference to iu_tx(). If you, + * however, link against libiu as well as the osmo-iuh libs (etc.), iu_tx() is + * available. A unit test may instead simply implement a dummy iu_tx() function + * and not link against osmo-iuh. + */ + +/* Each main linkage must implement this function (see comment above). */ +extern int iu_tx(struct msgb *msg, uint8_t sapi); + +/* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface + * gets implemented, it should be in a separate lib (like libiu), this function + * should move there, and the following comment should remain here: " + * Each main linkage must implement this function (see comment above). + * " */ +extern int a_tx(struct msgb *msg); + +int msc_tx_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg); + +int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn); +int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, + enum gsm48_reject_value value); + +/* TODO: specific to A interface, move this away */ +int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, + const uint8_t *key, int len, int include_imeisv); diff --git a/include/openbsc/osmo_msc.h b/include/openbsc/osmo_msc.h index 0642c91..5a26b60 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/openbsc/osmo_msc.h @@ -51,6 +51,11 @@ return get_value_string(subscr_conn_from_names, val); } +enum msc_compl_l3_rc { + MSC_CONN_ACCEPT = 0, + MSC_CONN_REJECT = 1, +}; + struct bsc_api *msc_bsc_api(); diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 7ae3eeb..441b386 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1423,6 +1423,19 @@ } } +static struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan) +{ + struct gsm_meas_rep *meas_rep; + + meas_rep = &lchan->meas_rep[lchan->meas_rep_idx]; + memset(meas_rep, 0, sizeof(*meas_rep)); + meas_rep->lchan = lchan; + lchan->meas_rep_idx = (lchan->meas_rep_idx + 1) + % ARRAY_SIZE(lchan->meas_rep); + + return meas_rep; +} + static int rsl_rx_meas_res(struct msgb *msg) { struct abis_rsl_dchan_hdr *dh = msgb_l2(msg); diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 947644e..c2828e3 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -264,6 +264,7 @@ conn->lchan = lchan; conn->bts = lchan->ts->trx->bts; conn->via_ran = RAN_GERAN_A; + conn->lac = conn->bts->location_area_code; lchan->conn = conn; llist_add_tail(&conn->entry, &net->subscr_conns); return conn; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 3bd56ea..771f6e3 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -593,18 +593,12 @@ (sp->penalty_time*20)+20, VTY_NEWLINE); } - /* Is periodic LU enabled or disabled? */ - if (bts->si_common.chan_desc.t3212 == 0) - vty_out(vty, " no periodic location update%s", VTY_NEWLINE); - else - vty_out(vty, " periodic location update %u%s", - bts->si_common.chan_desc.t3212 * 6, VTY_NEWLINE); - if (gsm_bts_get_radio_link_timeout(bts) < 0) vty_out(vty, " radio-link-timeout infinite%s", VTY_NEWLINE); else vty_out(vty, " radio-link-timeout %d%s", gsm_bts_get_radio_link_timeout(bts), VTY_NEWLINE); + vty_out(vty, " channel allocator %s%s", bts->chan_alloc_reverse ? "descending" : "ascending", VTY_NEWLINE); @@ -841,6 +835,11 @@ vty_out(vty, " timezone %d %d%s", gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE); } + if (gsmnet->t3212 == 0) + vty_out(vty, " no periodic location update%s", VTY_NEWLINE); + else + vty_out(vty, " periodic location update %u%s", + gsmnet->t3212 * 6, VTY_NEWLINE); return CMD_SUCCESS; } @@ -4129,7 +4128,6 @@ install_element_ve(&show_paging_group_cmd); logging_vty_add_cmds(NULL); - osmo_stats_vty_add_cmds(); install_element(GSMNET_NODE, &cfg_net_neci_cmd); install_element(GSMNET_NODE, &cfg_net_handover_cmd); diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index 3447d27..7c5e0e9 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -270,61 +270,6 @@ return rsl_siemens_mrpci(lchan, &mrpci); } -int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, uint8_t *mi_type) -{ - /* Check the size for the classmark */ - if (length < 1 + *classmark2_lv) - return -1; - - uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1; - if (length < 2 + *classmark2_lv + mi_lv[0]) - return -2; - - *mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; - return gsm48_mi_to_string(mi_string, GSM48_MI_SIZE, mi_lv+1, *mi_lv); -} - -int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length, - char *mi_string, uint8_t *mi_type) -{ - static const uint32_t classmark_offset = - offsetof(struct gsm48_pag_resp, classmark2); - uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2; - return gsm48_extract_mi(classmark2_lv, length - classmark_offset, - mi_string, mi_type); -} - -int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_subscr *bsub) -{ - struct gsm_bts *bts = msg->lchan->ts->trx->bts; - struct gsm48_hdr *gh = msgb_l3(msg); - uint8_t *classmark2_lv = gh->data + 1; - - if (is_siemens_bts(bts)) - send_siemens_mrpci(msg->lchan, classmark2_lv); - - if (!conn->bsub) { - conn->bsub = bsub; - } else if (conn->bsub != bsub) { - LOGP(DRR, LOGL_ERROR, - "<- Channel already owned by someone else?\n"); - bsc_subscr_put(bsub); - return -EINVAL; - } else { - DEBUGP(DRR, "<- Channel already owned by us\n"); - bsc_subscr_put(bsub); - bsub = conn->bsub; - } - - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED]); - - /* Stop paging on the bts we received the paging response */ - paging_request_stop(&bts->network->bts_list, conn->bts, bsub, conn, - msg); - return 0; -} - /* Chapter 9.1.9: Ciphering Mode Command */ int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv) { diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 0f07bca..8d7e047 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -33,6 +33,27 @@ #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) +{ + 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 */ + + 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; + } + + return NULL; +} + + /* issue handover to a cell identified by ARFCN and BSIC */ static int handover_to_arfcn_bsic(struct gsm_lchan *lchan, uint16_t arfcn, uint8_t bsic) diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index fc9caaf..8e19bb2 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -56,6 +56,9 @@ net->country_code = country_code; net->network_code = network_code; + /* Use 30 min periodic update interval as sane default */ + net->t3212 = 5; + INIT_LLIST_HEAD(&net->trans_list); INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->subscr_conns); @@ -107,6 +110,30 @@ return msg; } +int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, uint8_t *mi_type) +{ + /* Check the size for the classmark */ + if (length < 1 + *classmark2_lv) + return -1; + + uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1; + if (length < 2 + *classmark2_lv + mi_lv[0]) + return -2; + + *mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; + return gsm48_mi_to_string(mi_string, GSM48_MI_SIZE, mi_lv+1, *mi_lv); +} + +int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length, + char *mi_string, uint8_t *mi_type) +{ + static const uint32_t classmark_offset = + offsetof(struct gsm48_pag_resp, classmark2); + uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2; + return gsm48_extract_mi(classmark2_lv, length - classmark_offset, + mi_string, mi_type); +} + uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref) { const uint8_t rp_msg_ref = *next_rp_ref; diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 86b4c53..91d9baf 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -293,6 +293,8 @@ OSMO_ASSERT(vty_global_gsm_network == NULL); vty_global_gsm_network = network; + osmo_stats_vty_add_cmds(); + install_element(CONFIG_NODE, &cfg_net_cmd); install_node(&net_node, config_write_net); vty_install_default(GSMNET_NODE); diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 7c717a4..f6fde37 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -71,25 +71,6 @@ return 0; } -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - 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 */ - - llist_for_each_entry(neigh, &bts->network->bts_list, list) { - if (neigh->c0->arfcn == arfcn && - neigh->bsic == bsic) - return neigh; - } - - return NULL; -} - 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)" }, @@ -210,19 +191,6 @@ return 1; } -struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan) -{ - struct gsm_meas_rep *meas_rep; - - meas_rep = &lchan->meas_rep[lchan->meas_rep_idx]; - memset(meas_rep, 0, sizeof(*meas_rep)); - meas_rep->lchan = lchan; - lchan->meas_rep_idx = (lchan->meas_rep_idx + 1) - % ARRAY_SIZE(lchan->meas_rep); - - return meas_rep; -} - int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) { OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); @@ -322,7 +290,7 @@ bts->si_common.chan_desc.att = 1; /* attachment required */ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = 5; /* Use 30 min periodic update interval as sane default */ + bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ llist_add_tail(&bts->list, &net->bts_list); diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c index 5e3d9ae..c8e9cd3 100644 --- a/src/libcommon/talloc_ctx.c +++ b/src/libcommon/talloc_ctx.c @@ -44,7 +44,6 @@ 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_sub_req_ctx = talloc_named_const(ctx_root, 0, "subscr_request"); 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"); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index bb2a4a1..3c06514 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -23,6 +23,7 @@ $(NULL) libmsc_a_SOURCES = \ + a_iface.c \ auth.c \ db.c \ gsm_04_08.c \ @@ -32,6 +33,7 @@ mncc.c \ mncc_builtin.c \ mncc_sock.c \ + msc_ifaces.c \ rrlp.c \ silent_call.c \ sms_queue.c \ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c new file mode 100644 index 0000000..1f471f9 --- /dev/null +++ b/src/libmsc/a_iface.c @@ -0,0 +1,45 @@ +/* A-interface implementation, from MSC to BSC */ + +/* (C) 2016 by sysmocom s.m.f.c GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include + +#include +#include +#include + +int a_tx(struct msgb *msg) +{ + LOGP(DMSC, LOGL_ERROR, "message to be sent to BSC, but A-interface" + " not implemented.\n%s\n", osmo_hexdump(msg->data, msg->len)); + return -1; +} + +int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, + const uint8_t *key, int len, int include_imeisv) +{ + /* TODO generalize for A- and Iu interfaces, don't name after 08.08 */ + LOGP(DMSC, LOGL_ERROR, "gsm0808_cipher_mode(): message to be sent to" + " BSC, but A interface not yet implemented.\n"); + return -1; +} diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 6cea242..21ffaaa 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -71,10 +72,9 @@ #include + void *tall_locop_ctx; void *tall_authciphop_ctx; - -static int tch_rtp_signal(struct gsm_lchan *lchan, int signal); static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, uint32_t send_tmsi); @@ -86,29 +86,6 @@ uint16_t mnc; uint16_t lac; }; - -static int apply_codec_restrictions(struct gsm_bts *bts, - struct gsm_mncc_bearer_cap *bcap) -{ - int i, j; - - /* remove unsupported speech versions from list */ - for (i = 0, j = 0; bcap->speech_ver[i] >= 0; i++) { - if (bcap->speech_ver[i] == GSM48_BCAP_SV_FR) - bcap->speech_ver[j++] = GSM48_BCAP_SV_FR; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_EFR && bts->codec.efr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_EFR; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_AMR_F && bts->codec.amr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_AMR_F; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_HR && bts->codec.hr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_HR; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_AMR_H && bts->codec.amr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_AMR_H; - } - bcap->speech_ver[j] = -1; - - return 0; -} static uint32_t new_callref = 0x80000001; @@ -126,27 +103,6 @@ * work that the caller no longer has to do */ if (trans) { gh->proto_discr = trans->protocol | (trans->transaction_id << 4); - msg->lchan = trans->conn->lchan; - } - - if (msg->lchan) { - struct e1inp_sign_link *sign_link = - msg->lchan->ts->trx->rsl_link; - - msg->dst = sign_link; - if (gsm48_hdr_pdisc(gh) == GSM48_PDISC_CC) - DEBUGP(DCC, "(bts %d trx %d ts %d ti %02x) " - "Sending '%s' to MS.\n", - sign_link->trx->bts->nr, - sign_link->trx->nr, msg->lchan->ts->nr, - gh->proto_discr & 0xf0, - gsm48_cc_msg_name(gh->msg_type)); - else - DEBUGP(DCC, "(bts %d trx %d ts %d pd %02x) " - "Sending 0x%02x to MS.\n", - sign_link->trx->bts->nr, - sign_link->trx->nr, msg->lchan->ts->nr, - gh->proto_discr, gh->msg_type); } return gsm0808_submit_dtap(conn, msg, 0, 0); @@ -187,7 +143,6 @@ /* Chapter 9.2.14 : Send LOCATION UPDATING REJECT */ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause) { - struct gsm_bts *bts = conn->bts; struct msgb *msg; msg = gsm48_create_loc_upd_rej(cause); @@ -196,11 +151,8 @@ return -1; } - msg->lchan = conn->lchan; - - LOGP(DMM, LOGL_INFO, "Subscriber %s: LOCATION UPDATING REJECT " - "LAC=%u BTS=%u\n", vlr_subscr_name(conn->vsub), - bts->location_area_code, bts->nr); + LOGP(DMM, LOGL_INFO, "Subscriber %s: LOCATION UPDATING REJECT\n", + vlr_subscr_name(conn->vsub)); return gsm48_conn_sendmsg(msg, conn, NULL); } @@ -214,8 +166,6 @@ struct gsm48_loc_area_id *lai; uint8_t *mid; - msg->lchan = conn->lchan; - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); gh->proto_discr = GSM48_PDISC_MM; gh->msg_type = GSM48_MT_MM_LOC_UPD_ACCEPT; @@ -223,7 +173,7 @@ lai = (struct gsm48_loc_area_id *) msgb_put(msg, sizeof(*lai)); gsm48_generate_lai(lai, conn->network->country_code, conn->network->network_code, - conn->bts->location_area_code); + conn->lac); if (send_tmsi == GSM_RESERVED_TMSI) { /* we did not allocate a TMSI to the MS, so we need to @@ -257,8 +207,6 @@ { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 ID REQ"); struct gsm48_hdr *gh; - - msg->lchan = conn->lchan; gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); gh->proto_discr = GSM48_PDISC_MM; @@ -376,7 +324,7 @@ &old_lai.plmn.mnc, &old_lai.lac); new_lai.plmn.mcc = conn->network->country_code; new_lai.plmn.mnc = conn->network->network_code; - new_lai.lac = conn->bts->location_area_code; + new_lai.lac = conn->lac; DEBUGP(DMM, "LU/new-LAC: %u/%u\n", old_lai.lac, new_lai.lac); lu_fsm = vlr_loc_update(conn->conn_fsm, @@ -436,8 +384,6 @@ struct tm* local_time; int tzunits; int dst = 0; - - msg->lchan = conn->lchan; gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); gh->proto_discr = GSM48_PDISC_MM; @@ -588,7 +534,6 @@ if (autn) DEBUGP(DMM, " AUTH REQ (autn = %s)\n", osmo_hexdump_nospc(autn, 16)); - msg->lchan = conn->lchan; gh->proto_discr = GSM48_PDISC_MM; gh->msg_type = GSM48_MT_MM_AUTH_REQ; @@ -663,7 +608,7 @@ * b) Try to parse the TMSI. If we do not have one reject * c) Check that we know the subscriber with the TMSI otherwise reject * with a HLR cause - * d) Set the subscriber on the gsm_lchan and accept + * d) Set the subscriber on the conn and accept * * Keep this function non-static for direct invocation by unit tests. */ @@ -688,19 +633,19 @@ lai.plmn.mcc = conn->network->country_code; lai.plmn.mnc = conn->network->network_code; - lai.lac = conn->bts->location_area_code; + lai.lac = conn->lac; DEBUGP(DMM, "<- CM SERVICE REQUEST "); if (msg->data_len < sizeof(struct gsm48_service_request*)) { DEBUGPC(DMM, "wrong sized message\n"); - return gsm48_tx_mm_serv_rej(conn, - GSM48_REJECT_INCORRECT_MESSAGE); + return msc_gsm48_tx_mm_serv_rej(conn, + GSM48_REJECT_INCORRECT_MESSAGE); } if (msg->data_len < req->mi_len + 6) { DEBUGPC(DMM, "does not fit in packet\n"); - return gsm48_tx_mm_serv_rej(conn, - GSM48_REJECT_INCORRECT_MESSAGE); + return msc_gsm48_tx_mm_serv_rej(conn, + GSM48_REJECT_INCORRECT_MESSAGE); } gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); @@ -716,8 +661,8 @@ mi_string); } else { DEBUGPC(DMM, "mi_type is not expected: %d\n", mi_type); - return gsm48_tx_mm_serv_rej(conn, - GSM48_REJECT_INCORRECT_MESSAGE); + return msc_gsm48_tx_mm_serv_rej(conn, + GSM48_REJECT_INCORRECT_MESSAGE); } osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, (classmark2 + classmark2_len)); @@ -739,9 +684,6 @@ /* logging already happened in msc_create_conn_fsm() */ return rc; } - - if (is_siemens_bts(conn->bts)) - send_siemens_mrpci(msg->lchan, classmark2-1); vlr_proc_acc_req(conn->conn_fsm, SUBSCR_CONN_E_ACCEPTED, @@ -792,7 +734,6 @@ gsm48_mi_type_name(mi_type), mi_string); break; } - /* TODO? We used to remember the subscriber's classmark1 here and * stored it in the old sqlite db, but now we store it in a conn that @@ -1100,7 +1041,7 @@ lai.plmn.mcc = conn->network->country_code; lai.plmn.mnc = conn->network->network_code; - lai.lac = conn->bts->location_area_code; /* (will be replaced by conn->lac soon) */ + lai.lac = conn->lac; resp = (struct gsm48_pag_resp *) &gh->data[0]; gsm48_paging_extract_mi(resp, msgb_l3len(msg) - sizeof(*gh), @@ -1185,8 +1126,6 @@ { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 APP INF"); struct gsm48_hdr *gh; - - msg->lchan = conn->lchan; DEBUGP(DRR, "TX APPLICATION INFO id=0x%02x, len=%u\n", apdu_id, apdu_len); @@ -1279,8 +1218,6 @@ struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 TX SIMPLE"); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - msg->lchan = conn->lchan; - gh->proto_discr = pdisc; gh->msg_type = msg_type; @@ -1302,6 +1239,9 @@ struct msgb *msg; unsigned char *data; +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ if (trans) if (trans->conn && trans->conn->lchan) DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " @@ -1319,6 +1259,9 @@ else DEBUGP(DCC, "(bts - trx - ts - ti -- sub -) " "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); +#else + DEBUGP(DCC, "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); +#endif mncc->msg_type = msg_type; @@ -1362,8 +1305,6 @@ } if (trans->cc.state != GSM_CSTATE_NULL) new_cc_state(trans, GSM_CSTATE_NULL); - if (trans->conn) - trau_mux_unmap(&trans->conn->lchan->ts->e1_link, trans->callref); } static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg); @@ -1377,13 +1318,12 @@ OSMO_ASSERT(!transt->conn); - /* check all tranactions (without lchan) for subscriber */ switch (event) { case GSM_PAGING_SUCCEEDED: DEBUGP(DCC, "Paging subscr %s succeeded!\n", vlr_subscr_msisdn_or_name(transt->vsub)); OSMO_ASSERT(conn); - /* Assign lchan */ + /* Assign conn */ transt->conn = conn; /* send SETUP request to called party */ gsm48_cc_tx_setup(transt, &transt->cc.msg); @@ -1410,235 +1350,6 @@ return 0; } -static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable); - -/* handle audio path for handover */ -static int switch_for_handover(struct gsm_lchan *old_lchan, - struct gsm_lchan *new_lchan) -{ - struct rtp_socket *old_rs, *new_rs, *other_rs; - - /* Ask the new socket to send to the already known port. */ - if (new_lchan->conn->mncc_rtp_bridge) { - LOGP(DHO, LOGL_DEBUG, "Forwarding RTP\n"); - rsl_ipacc_mdcx(new_lchan, - old_lchan->abis_ip.connect_ip, - old_lchan->abis_ip.connect_port, 0); - return 0; - } - - if (ipacc_rtp_direct) { - LOGP(DHO, LOGL_ERROR, "unable to handover in direct RTP mode\n"); - return 0; - } - - /* RTP Proxy mode */ - new_rs = new_lchan->abis_ip.rtp_socket; - old_rs = old_lchan->abis_ip.rtp_socket; - - if (!new_rs) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for new_lchan\n"); - return -EIO; - } - - rsl_ipacc_mdcx_to_rtpsock(new_lchan); - - if (!old_rs) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for old_lchan\n"); - return -EIO; - } - - /* copy rx_action and reference to other sock */ - new_rs->rx_action = old_rs->rx_action; - new_rs->tx_action = old_rs->tx_action; - new_rs->transmit = old_rs->transmit; - - switch (old_lchan->abis_ip.rtp_socket->rx_action) { - case RTP_PROXY: - other_rs = old_rs->proxy.other_sock; - rtp_socket_proxy(new_rs, other_rs); - /* delete reference to other end socket to prevent - * rtp_socket_free() from removing the inverse reference */ - old_rs->proxy.other_sock = NULL; - break; - case RTP_RECV_UPSTREAM: - new_rs->receive = old_rs->receive; - break; - case RTP_NONE: - break; - } - - return 0; -} - -static void maybe_switch_for_handover(struct gsm_lchan *lchan) -{ - struct gsm_lchan *old_lchan; - old_lchan = bsc_handover_pending(lchan); - if (old_lchan) - switch_for_handover(old_lchan, lchan); -} - -/* some other part of the code sends us a signal */ -static int handle_abisip_signal(unsigned int subsys, unsigned int signal, - void *handler_data, void *signal_data) -{ - struct gsm_lchan *lchan = signal_data; - int rc; - struct gsm_network *net; - struct gsm_trans *trans; - - if (subsys != SS_ABISIP) - return 0; - - /* RTP bridge handling */ - if (lchan->conn && lchan->conn->mncc_rtp_bridge) - return tch_rtp_signal(lchan, signal); - - /* in case we use direct BTS-to-BTS RTP */ - if (ipacc_rtp_direct) - return 0; - - switch (signal) { - case S_ABISIP_CRCX_ACK: - /* in case we don't use direct BTS-to-BTS RTP */ - /* the BTS has successfully bound a TCH to a local ip/port, - * which means we can connect our UDP socket to it */ - if (lchan->abis_ip.rtp_socket) { - rtp_socket_free(lchan->abis_ip.rtp_socket); - lchan->abis_ip.rtp_socket = NULL; - } - - lchan->abis_ip.rtp_socket = rtp_socket_create(); - if (!lchan->abis_ip.rtp_socket) - return -EIO; - - rc = rtp_socket_connect(lchan->abis_ip.rtp_socket, - lchan->abis_ip.bound_ip, - lchan->abis_ip.bound_port); - if (rc < 0) - return -EIO; - - /* check if any transactions on this lchan still have - * a tch_recv_mncc request pending */ - net = lchan->ts->trx->bts->network; - llist_for_each_entry(trans, &net->trans_list, entry) { - if (trans->conn && trans->conn->lchan == lchan && trans->tch_recv) { - DEBUGP(DCC, "pending tch_recv_mncc request\n"); - tch_recv_mncc(net, trans->callref, 1); - } - } - - /* - * TODO: this appears to be too early? Why not until after - * the handover detect or the handover complete? - * - * Do we have a handover pending for this new lchan? In that - * case re-route the audio from the old channel to the new one. - */ - maybe_switch_for_handover(lchan); - break; - case S_ABISIP_DLCX_IND: - /* the BTS tells us a RTP stream has been disconnected */ - if (lchan->abis_ip.rtp_socket) { - rtp_socket_free(lchan->abis_ip.rtp_socket); - lchan->abis_ip.rtp_socket = NULL; - } - - break; - } - - return 0; -} - -/* map two ipaccess RTP streams onto each other */ -static int tch_map(struct gsm_lchan *lchan, struct gsm_lchan *remote_lchan) -{ - struct gsm_bts *bts = lchan->ts->trx->bts; - struct gsm_bts *remote_bts = remote_lchan->ts->trx->bts; - enum gsm_chan_t lt = lchan->type, rt = remote_lchan->type; - enum gsm48_chan_mode lm = lchan->tch_mode, rm = remote_lchan->tch_mode; - int rc; - - DEBUGP(DCC, "Setting up TCH map between (bts=%u,trx=%u,ts=%u,%s) and " - "(bts=%u,trx=%u,ts=%u,%s)\n", - bts->nr, lchan->ts->trx->nr, lchan->ts->nr, - get_value_string(gsm_chan_t_names, lt), - remote_bts->nr, remote_lchan->ts->trx->nr, remote_lchan->ts->nr, - get_value_string(gsm_chan_t_names, rt)); - - if (bts->type != remote_bts->type) { - LOGP(DCC, LOGL_ERROR, "Cannot switch calls between different BTS types yet\n"); - return -EINVAL; - } - - if (lt != rt) { - LOGP(DCC, LOGL_ERROR, "Cannot patch through call with different" - " channel types: local = %s, remote = %s\n", - get_value_string(gsm_chan_t_names, lt), - get_value_string(gsm_chan_t_names, rt)); - return -EBADSLT; - } - - if (lm != rm) { - LOGP(DCC, LOGL_ERROR, "Cannot patch through call with different" - " channel modes: local = %s, remote = %s\n", - get_value_string(gsm48_chan_mode_names, lm), - get_value_string(gsm48_chan_mode_names, rm)); - return -EMEDIUMTYPE; - } - - // todo: map between different bts types - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - if (!ipacc_rtp_direct) { - if (!lchan->abis_ip.rtp_socket) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for " - "lchan\n"); - return -EIO; - } - if (!remote_lchan->abis_ip.rtp_socket) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for " - "remote_lchan\n"); - return -EIO; - } - - /* connect the TCH's to our RTP proxy */ - rc = rsl_ipacc_mdcx_to_rtpsock(lchan); - if (rc < 0) - return rc; - rc = rsl_ipacc_mdcx_to_rtpsock(remote_lchan); - if (rc < 0) - return rc; - /* connect them with each other */ - rtp_socket_proxy(lchan->abis_ip.rtp_socket, - remote_lchan->abis_ip.rtp_socket); - } else { - /* directly connect TCH RTP streams to each other */ - rc = rsl_ipacc_mdcx(lchan, remote_lchan->abis_ip.bound_ip, - remote_lchan->abis_ip.bound_port, - remote_lchan->abis_ip.rtp_payload2); - if (rc < 0) - return rc; - rc = rsl_ipacc_mdcx(remote_lchan, lchan->abis_ip.bound_ip, - lchan->abis_ip.bound_port, - lchan->abis_ip.rtp_payload2); - } - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - trau_mux_map_lchan(lchan, remote_lchan); - break; - default: - LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type); - return -EINVAL; - } - - return 0; -} - /* bridge channels of two transactions */ static int tch_bridge(struct gsm_network *net, struct gsm_mncc_bridge *bridge) { @@ -1654,81 +1365,8 @@ /* Which subscriber do we want to track trans1 or trans2? */ log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); - /* through-connect channel */ - return tch_map(trans1->conn->lchan, trans2->conn->lchan); -} - -/* enable receive of channels to MNCC upqueue */ -static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable) -{ - struct gsm_trans *trans; - struct gsm_lchan *lchan; - struct gsm_bts *bts; - int rc; - - /* Find callref */ - trans = trans_find_by_callref(net, callref); - if (!trans) - return -EIO; - if (!trans->conn) - return 0; - - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - lchan = trans->conn->lchan; - bts = lchan->ts->trx->bts; - - /* store receive state */ - trans->tch_recv = enable; - - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - if (ipacc_rtp_direct) { - LOGP(DCC, LOGL_ERROR, "Error: RTP proxy is disabled\n"); - return -EINVAL; - } - /* In case, we don't have a RTP socket to the BTS yet, the BTS - * will not be connected to our RTP proxy and the socket will - * not be assigned to the application interface. This method - * will be called again, once the audio socket is created and - * connected. */ - if (!lchan->abis_ip.rtp_socket) { - DEBUGP(DCC, "queue tch_recv_mncc request (%d)\n", enable); - return 0; - } - if (enable) { - /* connect the TCH's to our RTP proxy */ - rc = rsl_ipacc_mdcx_to_rtpsock(lchan); - if (rc < 0) - return rc; - /* assign socket to application interface */ - rtp_socket_upstream(lchan->abis_ip.rtp_socket, - net, callref); - } else - rtp_socket_upstream(lchan->abis_ip.rtp_socket, - net, 0); - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - /* In case we don't have a TCH with correct mode, the TRAU muxer - * will not be asigned to the application interface. This is - * performed by switch_trau_mux() after successful handover or - * assignment. */ - if (lchan->tch_mode == GSM48_CMODE_SIGN) { - DEBUGP(DCC, "queue tch_recv_mncc request (%d)\n", enable); - return 0; - } - if (enable) - return trau_recv_lchan(lchan, callref); - return trau_mux_unmap(NULL, callref); - break; - default: - LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type); - return -EINVAL; - } - - return 0; + /* future: msc_call_bridge(trans1, trans2); */ + return -1; } static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) @@ -1868,7 +1506,7 @@ memset(&setup, 0, sizeof(struct gsm_mncc)); setup.callref = trans->callref; - setup.lchan_type = trans->conn->lchan->type; + 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) @@ -1884,7 +1522,6 @@ setup.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&setup.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &setup.bearer_cap); } /* facility */ if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { @@ -2024,7 +1661,7 @@ memset(&call_conf, 0, sizeof(struct gsm_mncc)); call_conf.callref = trans->callref; - call_conf.lchan_type = trans->conn->lchan->type; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); #if 0 /* repeat */ @@ -2038,7 +1675,6 @@ call_conf.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&call_conf.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &call_conf.bearer_cap); } /* cause */ if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { @@ -2728,7 +2364,6 @@ modify.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } new_cc_state(trans, GSM_CSTATE_MO_ORIG_MODIFY); @@ -2771,7 +2406,6 @@ modify.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } new_cc_state(trans, GSM_CSTATE_ACTIVE); @@ -2812,7 +2446,6 @@ modify.fields |= GSM48_IE_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } /* cause */ if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { @@ -2915,229 +2548,6 @@ return mncc_recvmsg(trans->net, trans, MNCC_USERINFO_IND, &user); } -static int _gsm48_lchan_modify(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *mode = arg; - struct gsm_lchan *lchan = trans->conn->lchan; - - /* - * We were forced to make an assignment a lot earlier and - * we should avoid sending another assignment that might - * even lead to a different kind of lchan (TCH/F vs. TCH/H). - * In case of rtp-bridge it is too late to change things - * here. - */ - if (trans->conn->mncc_rtp_bridge && lchan->tch_mode != GSM48_CMODE_SIGN) - return 0; - - return gsm0808_assign_req(trans->conn, mode->lchan_mode, - trans->conn->lchan->type != GSM_LCHAN_TCH_H); -} - -static void mncc_recv_rtp(struct gsm_network *net, uint32_t callref, - int cmd, uint32_t addr, uint16_t port, uint32_t payload_type, - uint32_t payload_msg_type) -{ - uint8_t data[sizeof(struct gsm_mncc)]; - struct gsm_mncc_rtp *rtp; - - memset(&data, 0, sizeof(data)); - rtp = (struct gsm_mncc_rtp *) &data[0]; - - rtp->callref = callref; - rtp->msg_type = cmd; - rtp->ip = addr; - rtp->port = port; - rtp->payload_type = payload_type; - rtp->payload_msg_type = payload_msg_type; - mncc_recvmsg(net, NULL, cmd, (struct gsm_mncc *)data); -} - -static void mncc_recv_rtp_sock(struct gsm_network *net, struct gsm_trans *trans, int cmd) -{ - struct gsm_lchan *lchan; - int msg_type; - - lchan = trans->conn->lchan; - switch (lchan->abis_ip.rtp_payload) { - case RTP_PT_GSM_FULL: - msg_type = GSM_TCHF_FRAME; - break; - case RTP_PT_GSM_EFR: - msg_type = GSM_TCHF_FRAME_EFR; - break; - case RTP_PT_GSM_HALF: - msg_type = GSM_TCHH_FRAME; - break; - case RTP_PT_AMR: - msg_type = GSM_TCH_FRAME_AMR; - break; - default: - LOGP(DMNCC, LOGL_ERROR, "%s unknown payload type %d\n", - gsm_lchan_name(lchan), lchan->abis_ip.rtp_payload); - msg_type = 0; - break; - } - - return mncc_recv_rtp(net, trans->callref, cmd, - lchan->abis_ip.bound_ip, - lchan->abis_ip.bound_port, - lchan->abis_ip.rtp_payload, - msg_type); -} - -static void mncc_recv_rtp_err(struct gsm_network *net, uint32_t callref, int cmd) -{ - return mncc_recv_rtp(net, callref, cmd, 0, 0, 0, 0); -} - -static int tch_rtp_create(struct gsm_network *net, uint32_t callref) -{ - struct gsm_bts *bts; - struct gsm_lchan *lchan; - struct gsm_trans *trans; - enum gsm48_chan_mode m; - - /* Find callref */ - trans = trans_find_by_callref(net, callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return 0; - } - - lchan = trans->conn->lchan; - bts = lchan->ts->trx->bts; - if (!is_ipaccess_bts(bts)) { - /* - * I want this to be straight forward and have no audio flow - * through the nitb/osmo-mss system. This currently means that - * this will not work with BS11/Nokia type BTS. We would need - * to have a trau<->rtp bridge for these but still preferable - * in another process. - */ - LOGP(DMNCC, LOGL_ERROR, "RTP create only works with IP systems\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return -EINVAL; - } - - trans->conn->mncc_rtp_bridge = 1; - /* - * *sigh* we need to pick a codec now. Pick the most generic one - * right now and hope we could fix that later on. This is very - * similiar to the routine above. - * Fallback to the internal MNCC mode to select a route. - */ - if (lchan->tch_mode == GSM48_CMODE_SIGN) { - trans->conn->mncc_rtp_create_pending = 1; - m = mncc_codec_for_mode(lchan->type); - LOGP(DMNCC, LOGL_DEBUG, "RTP create: codec=%s, chan_type=%s\n", - get_value_string(gsm48_chan_mode_names, m), - get_value_string(gsm_chan_t_names, lchan->type)); - return gsm0808_assign_req(trans->conn, m, - lchan->type != GSM_LCHAN_TCH_H); - } - - mncc_recv_rtp_sock(trans->net, trans, MNCC_RTP_CREATE); - return 0; -} - -static int tch_rtp_connect(struct gsm_network *net, void *arg) -{ - struct gsm_lchan *lchan; - struct gsm_trans *trans; - struct gsm_mncc_rtp *rtp = arg; - - /* Find callref */ - trans = trans_find_by_callref(net, rtp->callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - return 0; - } - - lchan = trans->conn->lchan; - LOGP(DMNCC, LOGL_DEBUG, "RTP connect: codec=%s, chan_type=%s\n", - get_value_string(gsm48_chan_mode_names, - mncc_codec_for_mode(lchan->type)), - get_value_string(gsm_chan_t_names, lchan->type)); - - /* TODO: Check if payload_msg_type is compatible with what we have */ - if (rtp->payload_type != lchan->abis_ip.rtp_payload) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect with different RTP payload\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - } - - /* - * FIXME: payload2 can't be sent with MDCX as the osmo-bts code - * complains about both rtp and rtp payload2 being present in the - * same package! - */ - trans->conn->mncc_rtp_connect_pending = 1; - return rsl_ipacc_mdcx(lchan, rtp->ip, rtp->port, 0); -} - -static int tch_rtp_signal(struct gsm_lchan *lchan, int signal) -{ - struct gsm_network *net; - struct gsm_trans *tmp, *trans = NULL; - - net = lchan->ts->trx->bts->network; - llist_for_each_entry(tmp, &net->trans_list, entry) { - if (!tmp->conn) - continue; - if (tmp->conn->lchan != lchan && tmp->conn->ho_lchan != lchan) - continue; - trans = tmp; - break; - } - - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "%s IPA abis signal but no transaction.\n", - gsm_lchan_name(lchan)); - return 0; - } - - switch (signal) { - case S_ABISIP_CRCX_ACK: - if (lchan->conn->mncc_rtp_create_pending) { - lchan->conn->mncc_rtp_create_pending = 0; - LOGP(DMNCC, LOGL_NOTICE, "%s sending pending RTP create ind.\n", - gsm_lchan_name(lchan)); - mncc_recv_rtp_sock(net, trans, MNCC_RTP_CREATE); - } - /* - * TODO: this appears to be too early? Why not until after - * the handover detect or the handover complete? - */ - maybe_switch_for_handover(lchan); - break; - case S_ABISIP_MDCX_ACK: - if (lchan->conn->mncc_rtp_connect_pending) { - lchan->conn->mncc_rtp_connect_pending = 0; - LOGP(DMNCC, LOGL_NOTICE, "%s sending pending RTP connect ind.\n", - gsm_lchan_name(lchan)); - mncc_recv_rtp_sock(net, trans, MNCC_RTP_CONNECT); - } - break; - } - - return 0; -} - - static struct downstate { uint32_t states; int type; @@ -3191,9 +2601,6 @@ MNCC_DISC_REQ, gsm48_cc_tx_disconnect}, {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_RELEASE_REQ), /* 5.4.3.2 */ MNCC_REL_REQ, gsm48_cc_tx_release}, - /* special */ - {ALL_STATES, - MNCC_LCHAN_MODIFY, _gsm48_lchan_modify}, }; #define DOWNSLLEN \ @@ -3205,7 +2612,6 @@ int i, rc = 0; struct gsm_trans *trans = NULL, *transt; struct gsm_subscriber_connection *conn = NULL; - struct gsm_bts *bts = NULL; struct gsm_mncc *data = arg, rel; DEBUGP(DMNCC, "receive message %s\n", get_mncc_name(msg_type)); @@ -3218,60 +2624,17 @@ disconnect_bridge(net, arg, -rc); return rc; case MNCC_FRAME_DROP: - return tch_recv_mncc(net, data->callref, 0); case MNCC_FRAME_RECV: - return tch_recv_mncc(net, data->callref, 1); case MNCC_RTP_CREATE: - return tch_rtp_create(net, data->callref); case MNCC_RTP_CONNECT: - return tch_rtp_connect(net, arg); case MNCC_RTP_FREE: - /* unused right now */ - return -EIO; case GSM_TCHF_FRAME: case GSM_TCHF_FRAME_EFR: case GSM_TCHH_FRAME: case GSM_TCH_FRAME_AMR: - /* Find callref */ - trans = trans_find_by_callref(net, data->callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "TCH frame for non-existing trans\n"); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without conn\n"); - return 0; - } - if (!trans->conn->lchan) { - LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without lchan\n"); - return 0; - } - if (trans->conn->lchan->type != GSM_LCHAN_TCH_F - && trans->conn->lchan->type != GSM_LCHAN_TCH_H) { - /* This should be LOGL_ERROR or NOTICE, but - * unfortuantely it happens for a couple of frames at - * the beginning of every RTP connection */ - LOGP(DMNCC, LOGL_DEBUG, "TCH frame for lchan != TCH_F/TCH_H\n"); - return 0; - } - bts = trans->conn->lchan->ts->trx->bts; - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - if (!trans->conn->lchan->abis_ip.rtp_socket) { - DEBUGP(DMNCC, "TCH frame to lchan without RTP connection\n"); - return 0; - } - return rtp_send_frame(trans->conn->lchan->abis_ip.rtp_socket, arg); - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - return trau_send_frame(trans->conn->lchan, arg); - default: - LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type); - } - return -EINVAL; + LOGP(DMNCC, LOGL_ERROR, "RTP streams must be handled externally; %s not supported.\n", + get_mncc_name(msg_type)); + return -ENOTSUP; } memset(&rel, 0, sizeof(struct gsm_mncc)); @@ -3347,14 +2710,15 @@ GSM48_CC_CAUSE_RESOURCE_UNAVAIL); return -ENOMEM; } - /* Find lchan */ + + /* Find conn */ conn = connection_for_subscr(vsub); - /* If subscriber has no lchan */ + /* If subscriber has no conn */ if (!conn) { /* find transaction with this subscriber already paging */ llist_for_each_entry(transt, &net->trans_list, entry) { - /* Transaction of our lchan? */ + /* Transaction of our conn? */ if (transt == trans || transt->vsub != vsub) continue; @@ -3372,7 +2736,7 @@ memcpy(&trans->cc.msg, data, sizeof(struct gsm_mncc)); /* Request a channel */ - trans->paging_request = subscr_request_channel( + trans->paging_request = subscr_request_conn( vsub, RSL_CHANNEED_TCH_F, setup_trig_pag_evt, @@ -3386,7 +2750,8 @@ vlr_subscr_put(vsub); return 0; } - /* Assign lchan */ + + /* Assign conn */ trans->conn = msc_subscr_conn_get(conn); vlr_subscr_put(vsub); } else { @@ -3399,7 +2764,7 @@ /* if paging did not respond yet */ if (!conn) { - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " + DEBUGP(DCC, "(sub %s) " "Received '%s' from MNCC in paging state\n", vlr_subscr_msisdn_or_name(trans->vsub), get_mncc_name(msg_type)); @@ -3414,9 +2779,8 @@ return rc; } - DEBUGP(DCC, "(bts %d trx %d ts %d ti %02x sub %s) " + DEBUGP(DCC, "(ti %02x sub %s) " "Received '%s' from MNCC in state %d (%s)\n", - conn->bts->nr, conn->lchan->ts->trx->nr, conn->lchan->ts->nr, trans->transaction_id, vlr_subscr_msisdn_or_name(trans->conn->vsub), get_mncc_name(msg_type), trans->cc.state, @@ -3513,12 +2877,16 @@ /* Find transaction */ trans = trans_find_by_id(conn, GSM48_PDISC_CC, transaction_id); +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " "Received '%s' from MS in state %d (%s)\n", conn->bts->nr, conn->lchan->ts->trx->nr, conn->lchan->ts->nr, transaction_id, vlr_subscr_msisdn_or_name(conn->vsub), gsm48_cc_msg_name(msg_type), trans?(trans->cc.state):0, gsm48_cc_state_name(trans?(trans->cc.state):0)); +#endif /* Create transaction */ if (!trans) { @@ -3836,11 +3204,18 @@ net->gsup_server_port); } -/* - * This will be run by the linker when loading the DSO. We use it to - * do system initialization, e.g. registration of signal handlers. - */ -static __attribute__((constructor)) void on_dso_load_0408(void) +/* This is a temporary shim merely to ensure that the unit tests still work. It + * shall be removed as soon as Iu and A interface paging is implemented. */ +int msc_fake_paging_request(struct vlr_subscr *vsub) { - osmo_signal_register_handler(SS_ABISIP, handle_abisip_signal, NULL); + LOGP(DMM, LOGL_ERROR, "Paging currently not implemented in the MSC.\n"); + OSMO_ASSERT(false); +} + +/* This is a temporary shim merely to ensure that the unit tests still work. It + * shall be removed as soon as Iu and A interface paging is implemented. */ +void msc_fake_paging_request_stop(struct vlr_subscr *vsub) +{ + LOGP(DMM, LOGL_ERROR, "Paging currently not implemented in the MSC.\n"); + OSMO_ASSERT(false); } diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 6ad944b..3255a3b 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -878,7 +878,7 @@ } /* Take a SMS in gsm_sms structure and send it through an already - * existing lchan. We also assume that the caller ensured this lchan already + * existing conn. We also assume that the caller ensured this conn already * has a SAPI3 RLL connection! */ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms) { @@ -1004,7 +1004,7 @@ struct gsm_subscriber_connection *conn; void *res; - /* check if we already have an open lchan to the subscriber. + /* check if we already have an open conn to the subscriber. * if yes, send the SMS this way */ conn = connection_for_subscr(vsub); if (conn) { @@ -1016,8 +1016,8 @@ /* if not, we have to start paging */ LOGP(DLSMS, LOGL_DEBUG, "Sending SMS: no connection open, start paging %s\n", vlr_subscr_name(vsub)); - res = subscr_request_channel(vsub, RSL_CHANNEED_SDCCH, - paging_cb_send_sms, sms); + res = subscr_request_conn(vsub, RSL_CHANNEED_SDCCH, paging_cb_send_sms, + sms); if (!res) { send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, GSM_PAGING_BUSY); sms_free(sms); diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index e9b2e0e..69d79b0 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -41,43 +41,6 @@ #include #include -void *tall_sub_req_ctx; - -int gsm48_secure_channel(struct gsm_subscriber_connection *conn, int key_seq, - gsm_cbfn *cb, void *cb_data); - - -/* - * Struct for pending channel requests. This is managed in the - * llist_head requests of each subscriber. The reference counting - * should work in such a way that a subscriber with a pending request - * remains in memory. - */ -struct subscr_request { - struct llist_head entry; - - /* the callback data */ - gsm_cbfn *cbfn; - void *param; -}; - -static struct bsc_subscr *vlr_subscr_to_bsc_sub(struct llist_head *bsc_subscribers, - struct vlr_subscr *vsub) -{ - struct bsc_subscr *sub; - /* TODO MSC split -- creating a BSC subscriber directly from MSC data - * structures in RAM. At some point the MSC will send a message to the - * BSC instead. */ - sub = bsc_subscr_find_or_create_by_imsi(bsc_subscribers, vsub->imsi); - sub->tmsi = vsub->tmsi; - sub->lac = vsub->lac; - return sub; -} - -/* - * We got the channel assigned and can now hand this channel - * over to one of our callbacks. - */ int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param) { @@ -85,22 +48,12 @@ struct gsm_subscriber_connection *conn = data; struct vlr_subscr *vsub = param; struct paging_signal_data sig_data; - struct bsc_subscr *bsub; - struct gsm_network *net; OSMO_ASSERT(vsub && vsub->cs.is_paging); - net = vsub->vlr->user_ctx; - /* - * Stop paging on all other BTS. E.g. if this is - * the first timeout on a BTS then the others will - * timeout soon as well. Let's just stop everything - * and forget we wanted to page. - */ - - bsub = vlr_subscr_to_bsc_sub(conn->network->bsc_subscribers, vsub); - paging_request_stop(&net->bts_list, NULL, bsub, NULL, NULL); - bsc_subscr_put(bsub); + /* FIXME: implement stop paging in libmsc; + * faking it for the unit tests to still work */ + msc_fake_paging_request_stop(vsub); /* Inform parts of the system we don't know */ sig_data.vsub = vsub; @@ -126,22 +79,21 @@ return 0; } -struct subscr_request *subscr_request_channel(struct vlr_subscr *vsub, - int channel_type, - gsm_cbfn *cbfn, void *param) +struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub, int channel_type, gsm_cbfn *cbfn, + void *param) { int rc; struct subscr_request *request; - struct bsc_subscr *bsub; - struct gsm_network *net = vsub->vlr->user_ctx; /* Start paging.. we know it is async so we can do it before */ if (!vsub->cs.is_paging) { LOGP(DMM, LOGL_DEBUG, "Subscriber %s not paged yet.\n", vlr_subscr_name(vsub)); - bsub = vlr_subscr_to_bsc_sub(net->bsc_subscribers, vsub); - rc = paging_request(net, bsub, channel_type, NULL, NULL); - bsc_subscr_put(bsub); + + /* FIXME: implement paging in libmsc; + * faking it for the unit tests to still work */ + rc = msc_fake_paging_request(vsub); + if (rc <= 0) { LOGP(DMM, LOGL_ERROR, "Subscriber %s paging failed: %d\n", vlr_subscr_name(vsub), rc); diff --git a/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c index 067cc92..ac6e734 100644 --- a/src/libmsc/mncc_builtin.c +++ b/src/libmsc/mncc_builtin.c @@ -65,21 +65,6 @@ return NULL; } -uint8_t mncc_codec_for_mode(int lchan_type) -{ - /* FIXME: check codec capabilities of the phone */ - - if (lchan_type != GSM_LCHAN_TCH_H) - return mncc_int.def_codec[0]; - else - return mncc_int.def_codec[1]; -} - -static uint8_t determine_lchan_mode(struct gsm_mncc *setup) -{ - return mncc_codec_for_mode(setup->lchan_type); -} - /* on incoming call, look up database and send setup to remote subscr. */ static int mncc_setup_ind(struct gsm_call *call, int msg_type, struct gsm_mncc *setup) @@ -137,9 +122,7 @@ /* modify mode */ memset(&mncc, 0, sizeof(struct gsm_mncc)); mncc.callref = call->callref; - mncc.lchan_mode = determine_lchan_mode(setup); - DEBUGP(DMNCC, "(call %x) Modify channel mode: %s\n", call->callref, - get_value_string(gsm48_chan_mode_names, mncc.lchan_mode)); + DEBUGP(DMNCC, "(call %x) Modify channel mode\n", call->callref); mncc_tx_to_cc(call->net, MNCC_LCHAN_MODIFY, &mncc); /* send setup to remote */ @@ -206,10 +189,6 @@ bridge.callref[0] = call->callref; bridge.callref[1] = call->remote_ref; DEBUGP(DMNCC, "(call %x) Bridging with remote.\n", call->callref); - - /* in direct mode, we always have to bridge the channels */ - if (ipacc_rtp_direct) - return mncc_tx_to_cc(call->net, MNCC_BRIDGE, &bridge); /* proxy mode */ if (!net->handover.active) { @@ -279,28 +258,6 @@ return 0; } -/* receiving a (speech) traffic frame from the BSC code */ -static int mncc_rcv_data(struct gsm_call *call, int msg_type, - struct gsm_data_frame *dfr) -{ - struct gsm_trans *remote_trans; - - remote_trans = trans_find_by_callref(call->net, call->remote_ref); - - /* this shouldn't really happen */ - if (!remote_trans || !remote_trans->conn) { - LOGP(DMNCC, LOGL_ERROR, "No transaction or transaction without lchan?!?\n"); - return -EIO; - } - - /* RTP socket of remote end has meanwhile died */ - if (!remote_trans->conn->lchan->abis_ip.rtp_socket) - return -EIO; - - return rtp_send_frame(remote_trans->conn->lchan->abis_ip.rtp_socket, dfr); -} - - /* Internal MNCC handler input function (from CC -> MNCC -> here) */ int int_mncc_recv(struct gsm_network *net, struct msgb *msg) { @@ -346,7 +303,8 @@ } if (mncc_is_data_frame(msg_type)) { - rc = mncc_rcv_data(call, msg_type, arg); + LOGP(DMNCC, LOGL_ERROR, "(call %x) Received data frame, which is not supported.\n", + call->callref); goto out_free; } @@ -364,7 +322,6 @@ break; case MNCC_CALL_CONF_IND: /* we now need to MODIFY the channel */ - data->lchan_mode = determine_lchan_mode(data); mncc_tx_to_cc(call->net, MNCC_LCHAN_MODIFY, data); break; case MNCC_ALERT_IND: diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index 0efe3a1..0c696f2 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -224,7 +224,6 @@ hello->called_offset = offsetof(struct gsm_mncc, called); hello->signal_offset = offsetof(struct gsm_mncc, signal); hello->emergency_offset = offsetof(struct gsm_mncc, emergency); - hello->lchan_type_offset = offsetof(struct gsm_mncc, lchan_type); msgb_enqueue(&mncc->net->upqueue, msg); mncc->conn_bfd.when |= BSC_FD_WRITE; diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c new file mode 100644 index 0000000..001fcba --- /dev/null +++ b/src/libmsc/msc_ifaces.c @@ -0,0 +1,84 @@ +/* Implementation for MSC decisions which interface to send messages out on. */ + +/* (C) 2016 by sysmocom s.m.f.c GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include + +#include +#include +#include + +static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + switch (conn->via_ran) { + /* FUTURE + case RAN_GERAN_A: + msg->dst = conn; + return a_tx(msg); + + case RAN_UTRAN_IU: + msg->dst = conn->iu.ue_ctx; + return iu_tx(msg, 0); + */ + default: + LOGP(DMSC, LOGL_ERROR, + "msc_tx(): conn->via_ran invalid (%d)\n", + conn->via_ran); + return -1; + } +} + + +int msc_tx_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + return msc_tx(conn, msg); +} + + +/* 9.2.5 CM service accept */ +int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 SERV ACC"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->proto_discr = GSM48_PDISC_MM; + gh->msg_type = GSM48_MT_MM_CM_SERV_ACC; + + DEBUGP(DMM, "-> CM SERVICE ACCEPT\n"); + + return msc_tx_dtap(conn, msg); +} + +/* 9.2.6 CM service reject */ +int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, + enum gsm48_reject_value value) +{ + struct msgb *msg; + + msg = gsm48_create_mm_serv_rej(value); + if (!msg) { + LOGP(DMM, LOGL_ERROR, "Failed to allocate CM Service Reject.\n"); + return -1; + } + + DEBUGP(DMM, "-> CM SERVICE Reject cause: %d\n", value); + + return msc_tx_dtap(conn, msg); +} diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 95e5818..c847b78 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -21,6 +21,7 @@ * */ +#include #include #include #include @@ -69,9 +70,10 @@ osmo_fsm_inst_dispatch(conn->conn_fsm, SUBSCR_CONN_E_BUMP, NULL); } -/* Receive a COMPLETE LAYER3 INFO from BSC */ -static int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, - uint16_t chosen_channel) +/* receive a Level 3 Complete message and return MSC_CONN_ACCEPT or + * MSC_CONN_REJECT */ +static int msc_compl_l3(struct gsm_subscriber_connection *conn, + struct msgb *msg, uint16_t chosen_channel) { /* Ownership of the gsm_subscriber_connection is still a bit mucky * between libbsc and libmsc. In libmsc, we use ref counting, but not @@ -87,7 +89,7 @@ /* keep the use_count reserved, libbsc will discard. If we * released the ref count and discarded here, libbsc would * double-free. And we will not change bsc_api semantics. */ - return BSC_API_CONN_POL_REJECT; + return MSC_CONN_REJECT; } DEBUGP(DMM, "compl_l3: Keeping conn\n"); @@ -96,7 +98,7 @@ /* If this should be kept, the conn->conn_fsm has placed a use_count */ msc_subscr_conn_put(conn); - return BSC_API_CONN_POL_ACCEPT; + return MSC_CONN_ACCEPT; #if 0 /* @@ -105,14 +107,14 @@ * pending transaction or ongoing operation. */ if (conn->silent_call) - return BSC_API_CONN_POL_ACCEPT; - if (conn->sec_operation || conn->anch_operation) - return BSC_API_CONN_POL_ACCEPT; + return MSC_CONN_ACCEPT; + if (conn->loc_operation || conn->sec_operation || conn->anch_operation) + return MSC_CONN_ACCEPT; if (trans_has_conn(conn)) - return BSC_API_CONN_POL_ACCEPT; + return MSC_CONN_ACCEPT; LOGP(DRR, LOGL_INFO, "MSC Complete L3: Rejecting connection.\n"); - return BSC_API_CONN_POL_REJECT; + return MSC_CONN_REJECT; #endif } diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index 6f3fbf2..5fad4f4 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -52,8 +52,12 @@ switch (event) { case GSM_PAGING_SUCCEEDED: +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ DEBUGPC(DLSMS, "success, using Timeslot %u on ARFCN %u\n", conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn); +#endif conn->silent_call = 1; msc_subscr_conn_get(conn); /* increment lchan reference count */ @@ -126,7 +130,10 @@ { struct subscr_request *req; - req = subscr_request_channel(vsub, type, paging_cb_silent, data); + /* FIXME the VTY command allows selecting a silent call channel type. + * This doesn't apply to the situation after MSCSPLIT with an + * A-interface. */ + req = subscr_request_conn(vsub, type, paging_cb_silent, data); return req != NULL; } @@ -143,8 +150,12 @@ if (!conn->silent_call) return -EINVAL; +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ DEBUGPC(DLSMS, "Stopping silent call using Timeslot %u on ARFCN %u\n", conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn); +#endif conn->silent_call = 0; msc_subscr_conn_put(conn); diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index f06eb7d..24a4653 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -423,6 +423,8 @@ build_tlv(req_tlv, &tlv); } +#if BEFORE_MSCSPLIT +/* We currently have no lchan information. Re-add after A-interface, see OS#2390. */ /* Append the Osmocom vendor-specific additional TLVs to a SMPP msg */ static void append_osmo_tlvs(tlv_t **req_tlv, const struct gsm_lchan *lchan) { @@ -461,6 +463,7 @@ (uint8_t *)vsub->imei, imei_len+1); } } +#endif struct { uint32_t smpp_status_code; @@ -680,8 +683,11 @@ memcpy(deliver.short_message, sms->user_data, deliver.sm_length); } +#if BEFORE_MSCSPLIT + /* We currently have no lchan information. Re-add after A-interface, see OS#2390. */ if (esme->acl && esme->acl->osmocom_ext && conn->lchan) append_osmo_tlvs(&deliver.tlv, conn->lchan); +#endif ret = smpp_tx_deliver(esme, &deliver); if (ret < 0) diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index c393a8f..0106f91 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -553,57 +553,6 @@ return CMD_WARNING; } -DEFUN(ena_subscr_handover, - ena_subscr_handover_cmd, - "subscriber " SUBSCR_TYPES " ID handover BTS_NR", - SUBSCR_HELP "Handover the active connection\n" - "Number of the BTS to handover to\n") -{ - int ret; - struct gsm_subscriber_connection *conn; - struct gsm_bts *bts; - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - struct vlr_subscr *vsub = - get_vsub_by_argv(gsmnet, argv[0], argv[1]); - - if (!vsub) { - vty_out(vty, "%% No subscriber found for %s %s.%s", - argv[0], argv[1], VTY_NEWLINE); - return CMD_WARNING; - } - - conn = connection_for_subscr(vsub); - if (!conn) { - vty_out(vty, "%% No active connection for subscriber %s %s.%s", - argv[0], argv[1], VTY_NEWLINE); - vlr_subscr_put(vsub); - return CMD_WARNING; - } - - bts = gsm_bts_num(gsmnet, atoi(argv[2])); - if (!bts) { - vty_out(vty, "%% BTS with number(%d) could not be found.%s", - atoi(argv[2]), VTY_NEWLINE); - vlr_subscr_put(vsub); - return CMD_WARNING; - } - - /* now start the handover */ - ret = bsc_handover_start(conn->lchan, bts); - if (ret != 0) { - vty_out(vty, "%% Handover failed with errno %d.%s", - ret, VTY_NEWLINE); - } else { - vty_out(vty, "%% Handover started from %s", - gsm_lchan_name(conn->lchan)); - vty_out(vty, " to %s.%s", gsm_lchan_name(conn->ho_lchan), - VTY_NEWLINE); - } - - vlr_subscr_put(vsub); - return CMD_SUCCESS; -} - #define A3A8_ALG_TYPES "(none|xor|comp128v1)" #define A3A8_ALG_HELP \ "Use No A3A8 algorithm\n" \ @@ -652,9 +601,7 @@ switch (signal) { case S_SCALL_SUCCESS: - vty_out(vty, "%% silent call on ARFCN %u timeslot %u%s", - sigdata->conn->lchan->ts->trx->arfcn, sigdata->conn->lchan->ts->nr, - VTY_NEWLINE); + vty_out(vty, "%% silent call success%s", VTY_NEWLINE); break; case S_SCALL_EXPIRED: vty_out(vty, "%% silent call expired paging%s", VTY_NEWLINE); @@ -670,7 +617,6 @@ { struct gsm_network *net = gsmnet_from_vty(vty); - openbsc_vty_print_statistics(vty, net); vty_out(vty, "Location Update : %lu attach, %lu normal, %lu periodic%s", net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_ATTACH].current, net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_NORMAL].current, @@ -1055,7 +1001,6 @@ install_element(ENABLE_NODE, &ena_subscr_extension_cmd); install_element(ENABLE_NODE, &ena_subscr_authorized_cmd); install_element(ENABLE_NODE, &ena_subscr_a3a8_cmd); - install_element(ENABLE_NODE, &ena_subscr_handover_cmd); install_element(ENABLE_NODE, &subscriber_purge_cmd); install_element(ENABLE_NODE, &smsqueue_trigger_cmd); install_element(ENABLE_NODE, &smsqueue_max_cmd); diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index 9de4145..904bdfc 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -32,7 +32,6 @@ bsc_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ - $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libtrau/libtrau.a \ diff --git a/tests/channel/Makefile.am b/tests/channel/Makefile.am index c7164b4..dd78bdc 100644 --- a/tests/channel/Makefile.am +++ b/tests/channel/Makefile.am @@ -24,7 +24,6 @@ $(NULL) channel_test_LDADD = \ - $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libvlr/libvlr.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index 0eed5cd..df421d8 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -32,9 +32,7 @@ $(NULL) db_test_LDADD = \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 5a8c6ca..1b326ee 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -182,7 +182,7 @@ static inline void test_si2q_u(void) { struct gsm_bts *bts; - struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(NULL, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater UARFCN generation:\n"); if (!network) @@ -210,7 +210,7 @@ static inline void test_si2q_e(void) { struct gsm_bts *bts; - struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(NULL, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater EARFCN generation:\n"); if (!network) diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index ebbfb5c..71450af 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -60,8 +60,8 @@ -Wl,--wrap=gsup_client_create \ -Wl,--wrap=gsup_client_send \ -Wl,--wrap=gsm0808_submit_dtap \ - -Wl,--wrap=paging_request \ - -Wl,--wrap=paging_request_stop \ + -Wl,--wrap=msc_fake_paging_request \ + -Wl,--wrap=msc_fake_paging_request_stop \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ $(NULL) diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 8f93435..497b7d3 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -270,9 +270,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -351,7 +350,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -734,9 +732,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 + BTS/BSC sends out paging request to MSISDN:46071 paging_expecting_tmsi == 0x03020100 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -815,7 +812,6 @@ DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -1762,9 +1758,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 3 DMM Subscriber MSISDN:42342 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000010650 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:42342 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 @@ -1843,7 +1838,6 @@ DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index 4543ace..e241429 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -287,9 +287,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -387,7 +386,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -786,9 +784,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 + BTS/BSC sends out paging request to MSISDN:46071 paging_expecting_tmsi == 0x03020100 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -886,7 +883,6 @@ DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 12b6c69..bc45367 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -186,9 +186,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -227,7 +226,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -528,9 +526,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 + BTS/BSC sends out paging request to MSISDN:46071 paging_expecting_tmsi == 0x03020100 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -569,7 +566,6 @@ DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 874cf5f..ff248e7 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1188,9 +1188,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -1225,7 +1224,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -1403,9 +1401,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -1440,7 +1437,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -1635,9 +1631,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -1672,7 +1667,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index 67c69c0..84d09ae 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -253,9 +253,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 3 DMM Subscriber MSISDN:42342 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000010650 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:42342 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 @@ -335,7 +334,6 @@ DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -665,9 +663,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 3 DMM Subscriber MSISDN:42342 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000010650 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:42342 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 @@ -747,7 +744,6 @@ DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 8f04593..00196c6 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -252,33 +252,25 @@ paging_expecting_imsi = NULL; } -/* override, requires '-Wl,--wrap=paging_request' */ -int __real_paging_request(struct gsm_network *network, struct bsc_subscr *sub, - int type, gsm_cbfn *cbfn, void *data); -int __wrap_paging_request(struct gsm_network *network, struct bsc_subscr *sub, - int type, gsm_cbfn *cbfn, void *data) +/* override, requires '-Wl,--wrap=msc_fake_paging_request' */ +int __real_msc_fake_paging_request(struct vlr_subscr *vsub); +int __wrap_msc_fake_paging_request(struct vlr_subscr *vsub) { - log("BTS/BSC sends out paging request to %s for channel type %d", - bsc_subscr_name(sub), type); + log("BTS/BSC sends out paging request to %s", + vlr_subscr_name(vsub)); OSMO_ASSERT(paging_expecting_imsi || (paging_expecting_tmsi != GSM_RESERVED_TMSI)); if (paging_expecting_imsi) - VERBOSE_ASSERT(strcmp(paging_expecting_imsi, sub->imsi), == 0, "%d"); + VERBOSE_ASSERT(strcmp(paging_expecting_imsi, vsub->imsi), == 0, "%d"); if (paging_expecting_tmsi != GSM_RESERVED_TMSI) - VERBOSE_ASSERT(paging_expecting_tmsi, == sub->tmsi, "0x%08x"); + VERBOSE_ASSERT(paging_expecting_tmsi, == vsub->tmsi, "0x%08x"); paging_sent = true; paging_stopped = false; return 1; } -/* override, requires '-Wl,--wrap=paging_request_stop' */ -void __real_paging_request_stop(struct gsm_bts *_bts, - struct vlr_subscr *vsub, - struct gsm_subscriber_connection *conn, - struct msgb *msg); -void __wrap_paging_request_stop(struct gsm_bts *_bts, - struct vlr_subscr *vsub, - struct gsm_subscriber_connection *conn, - struct msgb *msg) +/* override, requires '-Wl,--wrap=msc_fake_paging_request_stop' */ +void __real_msc_fake_paging_request_stop(struct vlr_subscr *vsub); +void __wrap_msc_fake_paging_request_stop(struct vlr_subscr *vsub) { paging_stopped = true; } -- To view, visit https://gerrit.osmocom.org/3345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 24 23:10:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 23:10:25 +0000 Subject: [PATCH] osmo-msc[master]: sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not ... Message-ID: Review at https://gerrit.osmocom.org/3346 sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_config In an upcoming commit, sgsn_vty_init() will require access to the global sgsn config struct to initialize a generic VTY command with the proper config destination address, see Change-Id I5b5b6a9678b458affa86800afb1ec726e66eed88. Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0f --- M include/openbsc/sgsn.h M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c 3 files changed, 10 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/46/3346/1 diff --git a/include/openbsc/sgsn.h b/include/openbsc/sgsn.h index 1ede2c9..1ed1583 100644 --- a/include/openbsc/sgsn.h +++ b/include/openbsc/sgsn.h @@ -140,8 +140,8 @@ /* sgsn_vty.c */ -int sgsn_vty_init(void); -int sgsn_parse_config(const char *config_file, struct sgsn_config *cfg); +int sgsn_vty_init(struct sgsn_config *cfg); +int sgsn_parse_config(const char *config_file); /* sgsn.c */ diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 41cebef..d871939 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -350,7 +350,7 @@ vty_init(&vty_info); logging_vty_add_cmds(NULL); osmo_stats_vty_add_cmds(&gprs_log_info); - sgsn_vty_init(); + sgsn_vty_init(&sgsn_inst.cfg); ctrl_vty_init(tall_bsc_ctx); #ifdef BUILD_IU iu_vty_init(&asn_debug); @@ -382,7 +382,7 @@ sgsn_cdr_init(&sgsn_inst); /* FIXME: register signal handler for SS_L_NS */ - rc = sgsn_parse_config(sgsn_inst.config_file, &sgsn_inst.cfg); + rc = sgsn_parse_config(sgsn_inst.config_file); if (rc < 0) { LOGP(DGPRS, LOGL_FATAL, "Error in config file\n"); exit(2); diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index e09a029..1cefe37 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -1222,8 +1222,10 @@ return CMD_SUCCESS; } -int sgsn_vty_init(void) +int sgsn_vty_init(struct sgsn_config *cfg) { + g_cfg = cfg; + install_element_ve(&show_sgsn_cmd); //install_element_ve(&show_mmctx_tlli_cmd); install_element_ve(&show_mmctx_imsi_cmd); @@ -1285,11 +1287,12 @@ return 0; } -int sgsn_parse_config(const char *config_file, struct sgsn_config *cfg) +int sgsn_parse_config(const char *config_file) { int rc; - g_cfg = cfg; + /* make sure sgsn_vty_init() was called before this */ + OSMO_ASSERT(g_cfg); g_cfg->timers.T3312 = GSM0408_T3312_SECS; g_cfg->timers.T3322 = GSM0408_T3322_SECS; -- To view, visit https://gerrit.osmocom.org/3346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 24 23:10:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 23:10:25 +0000 Subject: [PATCH] osmo-msc[master]: Implement IuCS (large refactoring and addition) Message-ID: Review at https://gerrit.osmocom.org/3347 Implement IuCS (large refactoring and addition) osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 --- M .gitignore M configure.ac M doc/examples/osmo-bsc_mgcp/mgcp.cfg A doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc.cfg D doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg D doc/examples/osmo-nitb/nanobts/openbsc.cfg D doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg D doc/examples/osmo-nitb/rbs2308/openbsc.cfg D doc/examples/osmo-nitb/sysmobts/openbsc.cfg M include/openbsc/Makefile.am A include/openbsc/common.h M include/openbsc/debug.h M include/openbsc/gprs_gmm.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/iu.h A include/openbsc/iucs.h A include/openbsc/iucs_ranap.h M include/openbsc/mgcp.h M include/openbsc/mgcp_internal.h A include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M include/openbsc/sgsn.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/paging.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/Makefile.am A src/libmgcp/mgcp_common.c M src/libmgcp/mgcp_network.c M src/libmgcp/mgcp_protocol.c A src/libmgcp/mgcpgw_client.c A src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c A src/libmsc/iucs.c A src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/osmo-bsc/osmo_bsc_api.c R src/osmo-msc/Makefile.am A src/osmo-msc/msc_main.c D src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/ctrl_test_runner.py M tests/db/Makefile.am M tests/db/db_test.c A tests/libiudummy/Makefile.am A tests/libiudummy/README A tests/libiudummy/iudummy.c M tests/mgcp/Makefile.am A tests/mgcp/mgcpgw_client_test.c A tests/mgcp/mgcpgw_client_test.err A tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am 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.c 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.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp_test_runner.py M tests/sms_queue/Makefile.am M tests/testsuite.at M tests/vty_test_runner.py 103 files changed, 5,006 insertions(+), 3,376 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/47/3347/1 -- To view, visit https://gerrit.osmocom.org/3347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 24 23:10:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 23:10:25 +0000 Subject: [PATCH] osmo-msc[master]: msc_vlr_tests: add missing wrap for ranap_iu_tx_release() Message-ID: Review at https://gerrit.osmocom.org/3348 msc_vlr_tests: add missing wrap for ranap_iu_tx_release() It seems merely luck that the tests worked so far without this wrap. Adjust test logs now indicating where we actually send an Iu Release -- and leaving gaping holes where we don't. To be fixed in another commit. Change-Id: I770f5f058c72539ff4a2913b076fee8440248fd9 --- M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 3 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/48/3348/1 diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index dbcd18e..66615f5 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -64,6 +64,7 @@ -Wl,--wrap=a_tx \ -Wl,--wrap=a_page \ -Wl,--wrap=iu_tx \ + -Wl,--wrap=iu_tx_release \ -Wl,--wrap=iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index d24dfc2..c62e78f 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -630,6 +630,7 @@ DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF MSISDN:42342: MSC conn use - 1 == 1 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated @@ -752,6 +753,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF MSISDN:42342: MSC conn use - 1 == 1 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated @@ -909,6 +911,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF MSISDN:42342: MSC conn use - 1 == 1 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated @@ -931,6 +934,7 @@ DREF VLR subscr MSISDN:42342 usage decreases to: 0 DREF freeing VLR subscr MSISDN:42342 DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF unknown: MSC conn use - 1 == 0 DRLL Freeing subscriber connection with NULL subscriber llist_count(&net->subscr_conns) == 0 @@ -1358,6 +1362,7 @@ DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF MSISDN:42342: MSC conn use - 1 == 1 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 8c25fe3..d352c1c 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -455,6 +455,13 @@ return _validate_dtap(msg, RAN_UTRAN_IU); } +/* override, requires '-Wl,--wrap=iu_tx_release' */ +int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); +int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +{ + btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU)); +} + /* override, requires '-Wl,--wrap=a_tx' */ int __real_a_tx(struct msgb *msg, uint8_t sapi); int __wrap_a_tx(struct msgb *msg, uint8_t sapi) -- To view, visit https://gerrit.osmocom.org/3348 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I770f5f058c72539ff4a2913b076fee8440248fd9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 24 23:10:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 23:10:26 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: hack RAB success from nano3G: patch first RTP payload Message-ID: Review at https://gerrit.osmocom.org/3349 mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 --- M include/openbsc/mgcp_internal.h M src/libmgcp/mgcp_network.c 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/49/3349/1 diff --git a/include/openbsc/mgcp_internal.h b/include/openbsc/mgcp_internal.h index b58eb9b..4e215b8 100644 --- a/include/openbsc/mgcp_internal.h +++ b/include/openbsc/mgcp_internal.h @@ -64,6 +64,7 @@ uint32_t stats_jitter; int32_t stats_transit; int stats_cycles; + bool patched_first_rtp_payload; }; struct mgcp_rtp_codec { diff --git a/src/libmgcp/mgcp_network.c b/src/libmgcp/mgcp_network.c index c9fe179..a1c7e85 100644 --- a/src/libmgcp/mgcp_network.c +++ b/src/libmgcp/mgcp_network.c @@ -667,6 +667,13 @@ forward_data(rtp_end->rtp.fd, &endp->taps[tap_idx], buf, len); + if (tap_idx == MGCP_TAP_BTS_OUT + && !rtp_state->patched_first_rtp_payload) { + uint8_t *data = (uint8_t*)&buf[12]; + osmo_hexparse("e400", data, 2); + rtp_state->patched_first_rtp_payload = true; + } + rc = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, rtp_end->rtp_port, buf, len); -- To view, visit https://gerrit.osmocom.org/3349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 24 23:10:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 24 Jul 2017 23:10:26 +0000 Subject: [PATCH] osmo-msc[master]: log protocol discriminators and message types by name Message-ID: Review at https://gerrit.osmocom.org/3350 log protocol discriminators and message types by name Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df --- M src/libmsc/gsm_04_08.c 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 11 files changed, 923 insertions(+), 907 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/50/3350/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index c179bef..21048c1 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3000,10 +3000,10 @@ uint8_t pdisc = gsm48_hdr_pdisc(gh); uint8_t msg_type = gsm48_hdr_msg_type(gh); - DEBUGP(DMM, "%s pdisc=%d msg_type=0x%02x:" + DEBUGP(DMM, "%s: rx msg %s:" " received_cm_service_request changes to false\n", vlr_subscr_name(conn->vsub), - pdisc, msg_type); + gsm48_pdisc_msgtype_name(pdisc, msg_type)); } conn->received_cm_service_request = false; } @@ -3019,14 +3019,16 @@ OSMO_ASSERT(conn); OSMO_ASSERT(msg); - LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message, pdisc=%d\n", pdisc); + LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n", + gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)), + pdisc, gsm48_hdr_msg_type(gh)); if (!msc_subscr_conn_is_accepted(conn) && !msg_is_initially_permitted(gh)) { LOGP(DRLL, LOGL_ERROR, - "subscr %s: Message not permitted for initial conn:" - " pdisc=0x%02x msg_type=0x%02x\n", - vlr_subscr_name(conn->vsub), gh->proto_discr, gh->msg_type); + "subscr %s: Message not permitted for initial conn: %s\n", + vlr_subscr_name(conn->vsub), + gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh))); return -EACCES; } diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index a928df6..0ded81e 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -1,9 +1,9 @@ ===== test_gsm_authen - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -55,19 +55,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -162,10 +162,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -195,18 +195,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -242,16 +242,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -288,10 +288,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -320,18 +320,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -361,7 +361,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -378,9 +378,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -388,12 +388,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -418,10 +418,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -439,10 +439,10 @@ ===== test_gsm_authen_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -494,19 +494,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -577,14 +577,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -593,9 +593,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -637,10 +637,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -670,18 +670,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -717,16 +717,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -763,10 +763,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -795,18 +795,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -836,7 +836,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -853,9 +853,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -863,12 +863,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -894,10 +894,10 @@ --- - subscriber sends LU Request, this time with the TMSI - Location Update request causes an Auth Req to MS - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -926,9 +926,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 5afc8d72) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 5a fc 8d 72 @@ -999,14 +999,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -1015,9 +1015,9 @@ vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 2 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(50462976){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1058,10 +1058,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using new TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1079,10 +1079,10 @@ ===== test_gsm_authen_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1134,19 +1134,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1209,7 +1209,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1220,18 +1220,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1273,10 +1273,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1294,10 +1294,10 @@ ===== test_gsm_authen_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1349,19 +1349,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1424,7 +1424,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1435,18 +1435,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1461,14 +1461,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -1477,9 +1477,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1519,10 +1519,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1540,10 +1540,10 @@ ===== test_gsm_milenage_authen - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1586,9 +1586,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM GSM AUTHENTICATION RESPONSE (sres = 9b36efdf) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 9b 36 ef df @@ -1683,10 +1683,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -1716,18 +1716,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM GSM AUTHENTICATION RESPONSE (sres = 85aa3130) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 85 aa 31 30 @@ -1763,16 +1763,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1809,10 +1809,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -1841,18 +1841,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM GSM AUTHENTICATION RESPONSE (sres = 69d5f9fb) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 69 d5 f9 fb @@ -1882,7 +1882,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1899,9 +1899,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -1909,12 +1909,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1939,10 +1939,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index 930c073..f072675 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -1,9 +1,9 @@ ===== test_ciph - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -46,9 +46,9 @@ lu_result_sent == 0 auth_request_sent == 1 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -69,17 +69,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -162,10 +162,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -195,18 +195,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -229,16 +229,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -259,16 +259,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -305,10 +305,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -337,18 +337,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -370,16 +370,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -398,7 +398,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -412,9 +412,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -422,12 +422,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -452,10 +452,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -473,10 +473,10 @@ ===== test_ciph_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -519,9 +519,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -543,17 +543,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -612,14 +612,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -628,9 +628,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -672,10 +672,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -705,18 +705,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -739,16 +739,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -769,16 +769,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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,10 +815,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -847,18 +847,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -880,16 +880,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -908,7 +908,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -922,9 +922,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -932,12 +932,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -962,10 +962,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -983,10 +983,10 @@ ===== test_ciph_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1029,9 +1029,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1052,17 +1052,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -1113,7 +1113,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1124,18 +1124,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1177,10 +1177,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1198,10 +1198,10 @@ ===== test_ciph_imeisv - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1244,9 +1244,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1269,20 +1269,20 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 vsub->imeisv[0] == 0 DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 - MS sends Ciphering Mode Complete with IMEISV, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: got IMEISV: 4234234234234235F @@ -1303,18 +1303,18 @@ DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_ID_IMEI @@ -1391,10 +1391,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1412,10 +1412,10 @@ ===== test_ciph_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1458,9 +1458,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1481,17 +1481,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -1542,7 +1542,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1553,18 +1553,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1579,14 +1579,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -1595,9 +1595,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1637,10 +1637,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.err b/tests/msc_vlr/msc_vlr_test_hlr_reject.err index b7f67cb..7104ef2 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.err @@ -1,9 +1,9 @@ ===== test_hlr_rej_auth_info_unknown_imsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -74,10 +74,10 @@ ===== test_hlr_rej_auth_info_net_fail - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -150,10 +150,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -196,9 +196,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -299,10 +299,10 @@ --- - Another LU wants to get new tuples; even though HLR sends Network Failure, we are reusing the old tuples. - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -343,9 +343,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 2d 8b 2c 3e @@ -447,10 +447,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -493,9 +493,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -596,10 +596,10 @@ --- - Another LU wants to get new tuples; HLR sends Network Failure, we reject. - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -670,10 +670,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -716,9 +716,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -820,10 +820,10 @@ - Another LU wants to get new tuples; HLR sends IMSI Unknown. Even though we would re-use an old tuple, reject the unknown IMSI. net->vlr->cfg.auth_reuse_old_sets_on_error == 1 - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -892,10 +892,10 @@ ===== test_hlr_acc_but_no_auth_tuples - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -965,10 +965,10 @@ ===== test_hlr_rej_lu - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1041,10 +1041,10 @@ ===== test_hlr_no_insert_data - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err index e2a6aa8..122a9ec 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err @@ -1,10 +1,10 @@ ===== test_hlr_timeout_lu_auth_info - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -83,10 +83,10 @@ ===== test_hlr_timeout_lu_upd_loc_result - Total time passed: 0.000000 s - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err index 728b85c..ba59387 100644 --- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err @@ -1,10 +1,10 @@ ===== test_ms_timeout_lu_auth_resp - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -103,10 +103,10 @@ ===== test_ms_timeout_cm_auth_resp - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -149,9 +149,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -246,10 +246,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 78b2ebb..ef9e3b5 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -1,9 +1,9 @@ ===== test_no_authen - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -46,14 +46,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -115,10 +115,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -156,16 +156,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -203,10 +203,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -236,7 +236,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -254,9 +254,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -264,12 +264,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -294,10 +294,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -315,10 +315,10 @@ ===== test_no_authen_tmsi - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -361,14 +361,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -406,14 +406,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -422,9 +422,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -466,10 +466,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -507,16 +507,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -553,10 +553,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -586,7 +586,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -604,9 +604,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -614,12 +614,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -645,10 +645,10 @@ --- - subscriber sends LU Request, this time with the TMSI - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -689,14 +689,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -734,14 +734,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -750,9 +750,9 @@ vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 2 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(50462976){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -793,10 +793,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using new TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -814,10 +814,10 @@ ===== test_no_authen_imei - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -860,14 +860,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 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 @@ -897,7 +897,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -908,18 +908,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -961,10 +961,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -982,10 +982,10 @@ ===== test_no_authen_tmsi_imei - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1028,14 +1028,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 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 @@ -1065,7 +1065,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1076,18 +1076,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1102,18 +1102,18 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1154,10 +1154,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index fb67206..b84a7bd 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1,9 +1,9 @@ ===== test_reject_2nd_conn - Location Update Request on one connection - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -35,10 +35,10 @@ lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - Another Location Update Request from the same subscriber on another connection is rejected - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -151,10 +151,10 @@ ===== test_reject_lu_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -187,9 +187,9 @@ llist_count(&net->subscr_conns) == 1 --- - Another Location Update Request from the same subscriber on the same conn is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - 1 == 1 @@ -273,10 +273,10 @@ ===== test_reject_cm_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -309,14 +309,14 @@ llist_count(&net->subscr_conns) == 1 --- - A CM Service Request in the middle of a LU is rejected - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM IMSI:901700000004620: connection already in use DMM -> CM SERVICE Reject cause: 17 DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 052211 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_CM_SERV_REJ: 052211 - DTAP matches expected message DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - 1 == 1 @@ -401,10 +401,10 @@ ===== test_reject_paging_resp_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -437,9 +437,9 @@ llist_count(&net->subscr_conns) == 1 --- - An erratic Paging Response is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -526,10 +526,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -630,10 +630,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -669,9 +669,9 @@ cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true - A LU request on an open conn is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +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: still awaiting first request after a CM Service Request @@ -680,9 +680,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -714,10 +714,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -818,10 +818,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -857,9 +857,9 @@ cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true - A second CM Service Request on the same conn is accepted without another auth dance - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM MSISDN:46071: re-using already accepted connection - sending CM Service Accept for MSISDN:46071 @@ -870,9 +870,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -904,10 +904,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1008,10 +1008,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1048,9 +1048,9 @@ msc_subscr_conn_is_accepted() == true --- - An erratic Paging Response on the same conn is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) 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 @@ -1062,16 +1062,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -1100,10 +1100,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1216,10 +1216,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1249,7 +1249,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1264,9 +1264,9 @@ llist_count(&net->subscr_conns) == 1 --- - MS sends erratic LU Request, which is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=5 +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 @@ -1274,9 +1274,9 @@ lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -1284,12 +1284,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1322,10 +1322,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1438,10 +1438,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1471,7 +1471,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1486,9 +1486,9 @@ llist_count(&net->subscr_conns) == 1 --- - CM Service Request during open connection is accepted - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM MSISDN:46071: re-using already accepted connection - sending CM Service Accept for MSISDN:46071 @@ -1499,9 +1499,9 @@ llist_count(&net->subscr_conns) == 1 g_conn->received_cm_service_request == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -1509,12 +1509,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1527,9 +1527,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -1561,10 +1561,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1677,10 +1677,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1710,7 +1710,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1725,18 +1725,18 @@ llist_count(&net->subscr_conns) == 1 --- - MS sends another erratic Paging Response which is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) 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 DREF MSISDN:46071: MSC conn use - 1 == 2 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -1744,12 +1744,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 af28015..2e1c528 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -10,14 +10,14 @@ DMM Subscr_Conn(test){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr unknown: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -43,10 +43,10 @@ ===== test_cm_service_without_lu - CM Service Request without a prior Location Updating - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -84,10 +84,10 @@ ===== test_two_lu - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -130,14 +130,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -200,10 +200,10 @@ --- - verify that the MS can send another LU request - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -244,14 +244,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -312,10 +312,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -333,10 +333,10 @@ ===== test_lu_unknown_tmsi - Location Update request with unknown TMSI sends ID Request for IMSI - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -353,7 +353,7 @@ DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: vlr_loc_upd_want_imsi() DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMSI DMSC msc_tx 3 bytes to TMSI:0x23422342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051801 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051801 - DTAP matches expected message DREF VLR subscr TMSI:0x23422342 usage decreases to: 1 DMM TMSI:0x23422342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -361,18 +361,18 @@ lu_result_sent == 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS tells us the IMSI, causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF TMSI:0x23422342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMSI)=901700000004620 DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: Received Event VLR_ULA_E_ID_IMSI @@ -404,14 +404,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 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 c62e78f..d7fc073 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -1,9 +1,9 @@ ===== test_umts_authen_geran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -47,9 +47,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 @@ -121,14 +121,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -137,9 +137,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -174,10 +174,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -208,18 +208,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 @@ -255,16 +255,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -301,10 +301,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -334,18 +334,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 706f996719ba609c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 70 6f 99 67 19 ba 60 9c @@ -375,7 +375,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -392,9 +392,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -402,12 +402,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -432,10 +432,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 @@ -453,10 +453,10 @@ ===== test_umts_authen_utran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -500,9 +500,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 @@ -587,14 +587,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -603,9 +603,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -641,10 +641,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -675,18 +675,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 @@ -733,16 +733,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -780,10 +780,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -813,18 +813,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 706f996719ba609c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 70 6f 99 67 19 ba 60 9c @@ -869,7 +869,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_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 @@ -882,9 +882,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -892,12 +892,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_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 @@ -923,10 +923,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 @@ -945,10 +945,10 @@ ===== test_umts_authen_resync_geran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -992,9 +992,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Failure with Resync cause, VLR sends GSUP to HLR to resync - rx from MS: pdisc=0x05 msg_type=0x1c + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_FAIL DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_FAIL (0x5:0x1c) DMM IMSI:901700000010650: MM R99 AUTHENTICATION SYNCH (AUTS = 979498b1f72d3e28c59fa2e72f9c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_FAIL DVLR GSUP tx: 08010809710000000156f0260e979498b1f72d3e28c59fa2e72f9c201039fa2f4e3d523d8619a73b4f65c3e14d @@ -1022,9 +1022,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = 1df5f0b4f22b696e) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP_RESYNC}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 1d f5 f0 b4 f2 2b 69 6e @@ -1096,14 +1096,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1112,9 +1112,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1155,10 +1155,10 @@ ===== test_umts_authen_resync_utran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1202,9 +1202,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Failure with Resync cause, VLR sends GSUP to HLR to resync - rx from MS: pdisc=0x05 msg_type=0x1c + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_FAIL DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_FAIL (0x5:0x1c) DMM IMSI:901700000010650: MM R99 AUTHENTICATION SYNCH (AUTS = 979498b1f72d3e28c59fa2e72f9c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_FAIL DVLR GSUP tx: 08010809710000000156f0260e979498b1f72d3e28c59fa2e72f9c201039fa2f4e3d523d8619a73b4f65c3e14d @@ -1232,9 +1232,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = 1df5f0b4f22b696e) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP_RESYNC}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 1d f5 f0 b4 f2 2b 69 6e @@ -1319,14 +1319,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1335,9 +1335,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index d352c1c..ebc204c 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -69,6 +69,17 @@ return msg; } +const char *gh_type_name(struct gsm48_hdr *gh) +{ + return gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh), + gsm48_hdr_msg_type(gh)); +} + +const char *msg_type_name(struct msgb *msg) +{ + return gh_type_name((void*)msg->data); +} + void dtap_expect_tx(const char *hex) { /* Has the previously expected dtap been received? */ @@ -153,8 +164,10 @@ int rc; struct gsm48_hdr *gh = msgb_l3(msg); - log("rx from MS: pdisc=0x%02x msg_type=0x%02x", - gh->proto_discr, gh->msg_type); + + log("MSC <--%s-- MS: %s", + ran_type_name(rx_from_ran), + gh_type_name(gh)); if (g_conn && !conn_exists(g_conn)) g_conn = NULL; @@ -426,8 +439,9 @@ int _validate_dtap(struct msgb *msg, enum ran_type to_ran) { - btw("DTAP --%s--> MS: %s", - ran_type_name(to_ran), + struct gsm48_hdr *gh = (void*)msg->data; + btw("DTAP --%s--> MS: %s: %s", + ran_type_name(to_ran), msg_type_name(msg), osmo_hexdump_nospc(msg->data, msg->len)); OSMO_ASSERT(dtap_tx_expected); -- To view, visit https://gerrit.osmocom.org/3350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 25 01:09:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 25 Jul 2017 01:09:42 +0000 Subject: [PATCH] osmo-hlr[master]: use OSMO_GSUP_PORT == 4222 instead of hardcoded 2222 Message-ID: Review at https://gerrit.osmocom.org/3351 use OSMO_GSUP_PORT == 4222 instead of hardcoded 2222 Depends: I4222e21686c823985be8ff1f16b1182be8ad6175 (libosmocore) Change-Id: I9b372a4ac38677773bf813acba80cebcd88e2e20 --- M src/hlr.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/51/3351/1 diff --git a/src/hlr.c b/src/hlr.c index 7d1bf75..9e8b699 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -466,7 +466,7 @@ exit(1); } - g_hlr->gs = osmo_gsup_server_create(hlr_ctx, g_hlr->gsup_bind_addr, 2222, + g_hlr->gs = osmo_gsup_server_create(hlr_ctx, g_hlr->gsup_bind_addr, OSMO_GSUP_PORT, read_cb, &g_lu_ops); if (!g_hlr->gs) { LOGP(DMAIN, LOGL_FATAL, "Error starting GSUP server\n"); -- To view, visit https://gerrit.osmocom.org/3351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b372a4ac38677773bf813acba80cebcd88e2e20 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 25 11:15:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 25 Jul 2017 11:15:51 +0000 Subject: osmo-msc[master]: Add libvlr implementation In-Reply-To: References: Message-ID: Patch Set 10: I just noticed, I have an IMEISV change as discussed ready and intended to merge it in here, which I forgot. Will see whether to submit a new patch set or implement IMEISV later instead... -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 10 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 25 13:36:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 25 Jul 2017 13:36:44 +0000 Subject: [PATCH] osmo-iuh[master]: ranap_common.h: fix include of asn1c/asn_application.h Message-ID: Review at https://gerrit.osmocom.org/3352 ranap_common.h: fix include of asn1c/asn_application.h Change-Id: I152377813cdcfef73e2c4309b0f8c97807d7d4f8 --- M include/osmocom/ranap/ranap_common.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/52/3352/1 diff --git a/include/osmocom/ranap/ranap_common.h b/include/osmocom/ranap/ranap_common.h index 66b8c3e..8899bd5 100644 --- a/include/osmocom/ranap/ranap_common.h +++ b/include/osmocom/ranap/ranap_common.h @@ -1,6 +1,6 @@ #pragma once -#include +#include /* for f in ranap/RANAP_*.h; printf "#include \"$f\"\n" */ #include -- To view, visit https://gerrit.osmocom.org/3352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I152377813cdcfef73e2c4309b0f8c97807d7d4f8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:07:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:07:18 +0000 Subject: osmo-bts[master]: litecell15: Register in vty limits for paX_pwr In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I316a8ea73091c7e76a175314b890e4d86e9c3010 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: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:08:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:08:31 +0000 Subject: osmo-bts[master]: cosmetics: Fix typos and whitespace in lc15bts_mgr_vty.c In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/3343/1/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c File src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c: PS1, Line 5: lc15 and that too... PS1, Line 9: lc15 lol. that should be sysmocom ;) -- To view, visit https://gerrit.osmocom.org/3343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e35fb9c1a6391e5185a62e9efd2f8ffba13cf0d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:08:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:08:36 +0000 Subject: osmo-bts[master]: cosmetics: Fix typos and whitespace in lc15bts_mgr_vty.c In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e35fb9c1a6391e5185a62e9efd2f8ffba13cf0d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:08:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:08:51 +0000 Subject: osmo-bts[master]: lc15bts-mgr.cfg: Set default vswr to a value inside valid range In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3342 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf60ab290acf0423c7617591a86403d63266e5d3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:15:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:15:04 +0000 Subject: osmo-msc[master]: Use libvlr in libmsc (large refactoring) In-Reply-To: References: Message-ID: Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 10 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:15:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:15:28 +0000 Subject: osmo-msc[master]: jenkins: pass proper configure flags to make distcheck In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic724cf61d44409337414dc58c8795896b4b97a8a Gerrit-PatchSet: 4 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 Tue Jul 25 14:15:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:15:49 +0000 Subject: osmo-msc[master]: fix make distcheck with python tests In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:16:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:16:26 +0000 Subject: osmo-msc[master]: Add msc_vlr test suite for MSC+VLR end-to-end tests In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:17:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:17:20 +0000 Subject: [MERGED] osmo-msc[master]: Add msc_vlr test suite for MSC+VLR end-to-end tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add msc_vlr test suite for MSC+VLR end-to-end tests ...................................................................... Add msc_vlr test suite for MSC+VLR end-to-end tests Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd --- M .gitignore M configure.ac M tests/Makefile.am A tests/msc_vlr/Makefile.am A tests/msc_vlr/msc_vlr_test_gsm_authen.c A tests/msc_vlr/msc_vlr_test_gsm_authen.err A tests/msc_vlr/msc_vlr_test_gsm_authen.ok A tests/msc_vlr/msc_vlr_test_gsm_ciph.c A tests/msc_vlr/msc_vlr_test_gsm_ciph.err A tests/msc_vlr/msc_vlr_test_gsm_ciph.ok A tests/msc_vlr/msc_vlr_test_hlr_reject.c A tests/msc_vlr/msc_vlr_test_hlr_reject.err A tests/msc_vlr/msc_vlr_test_hlr_reject.ok A tests/msc_vlr/msc_vlr_test_hlr_timeout.c A tests/msc_vlr/msc_vlr_test_hlr_timeout.err A tests/msc_vlr/msc_vlr_test_hlr_timeout.ok A tests/msc_vlr/msc_vlr_test_ms_timeout.c A tests/msc_vlr/msc_vlr_test_ms_timeout.err A tests/msc_vlr/msc_vlr_test_ms_timeout.ok A tests/msc_vlr/msc_vlr_test_no_authen.c A tests/msc_vlr/msc_vlr_test_no_authen.err A tests/msc_vlr/msc_vlr_test_no_authen.ok A tests/msc_vlr/msc_vlr_test_reject_concurrency.c A tests/msc_vlr/msc_vlr_test_reject_concurrency.err A tests/msc_vlr/msc_vlr_test_reject_concurrency.ok A tests/msc_vlr/msc_vlr_test_rest.c A tests/msc_vlr/msc_vlr_test_rest.err A tests/msc_vlr/msc_vlr_test_rest.ok A tests/msc_vlr/msc_vlr_test_umts_authen.c A tests/msc_vlr/msc_vlr_test_umts_authen.err A tests/msc_vlr/msc_vlr_test_umts_authen.ok A tests/msc_vlr/msc_vlr_tests.c A tests/msc_vlr/msc_vlr_tests.h M tests/testsuite.at 34 files changed, 14,785 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:17:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:17:21 +0000 Subject: [MERGED] osmo-msc[master]: fix make distcheck with python tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix make distcheck with python tests ...................................................................... fix make distcheck with python tests - bscs.config needed by the vty tests was not picked up as a dist file, because its suffix is not 'cfg'. Rename to *.cfg. Apply this rename in vty_test_runner.py and osmo-bsc_nat.cfg. - Remove restart counters after external tests, otherwise distcheck complains about uncleaned files. - Add contrib/ipa.py to EXTRA_DIST, hence add a Makefile.am to contrib/. Otherwise the python tests cannot find that dependency. Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 --- M Makefile.am M configure.ac A contrib/Makefile.am R doc/examples/osmo-bsc_nat/bscs.cfg M doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg M tests/Makefile.am M tests/vty_test_runner.py 7 files changed, 6 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 31a54ea..4a1f65d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,7 @@ include \ src \ tests \ + contrib \ $(NULL) pkgconfigdir = $(libdir)/pkgconfig diff --git a/configure.ac b/configure.ac index ff51ccf..adae598 100644 --- a/configure.ac +++ b/configure.ac @@ -263,4 +263,5 @@ tests/nanobts_omlattr/Makefile doc/Makefile doc/examples/Makefile + contrib/Makefile Makefile) diff --git a/contrib/Makefile.am b/contrib/Makefile.am new file mode 100644 index 0000000..db6d0f5 --- /dev/null +++ b/contrib/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = ipa.py diff --git a/doc/examples/osmo-bsc_nat/bscs.config b/doc/examples/osmo-bsc_nat/bscs.cfg similarity index 100% rename from doc/examples/osmo-bsc_nat/bscs.config rename to doc/examples/osmo-bsc_nat/bscs.cfg diff --git a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg index 6b48e97..e835e06 100644 --- a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg +++ b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg @@ -62,5 +62,5 @@ timeout ping 20 timeout pong 5 ip-dscp 0 - bscs-config-file bscs.config + bscs-config-file bscs.cfg access-list bla imsi-allow ^11$ diff --git a/tests/Makefile.am b/tests/Makefile.am index 9cbc1c1..72161ee 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -87,7 +87,7 @@ if BUILD_SMPP $(PYTHON) $(srcdir)/smpp_test_runner.py -w $(abs_top_builddir) -v endif - rm -f $(top_builddir)/hlr.sqlite3 + rm -f $(top_builddir)/hlr.sqlite3 $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 92775d5..68a697d 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -1220,7 +1220,7 @@ def nat_bsc_reload(x): x.vty.command("configure terminal") x.vty.command("nat") - x.vty.command("bscs-config-file bscs.config") + x.vty.command("bscs-config-file bscs.cfg") x.vty.command("end") def nat_msc_ip(x, ip, port): -- To view, visit https://gerrit.osmocom.org/3318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:17:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:17:21 +0000 Subject: [MERGED] osmo-msc[master]: jenkins: pass proper configure flags to make distcheck In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: pass proper configure flags to make distcheck ...................................................................... jenkins: pass proper configure flags to make distcheck Enable various components according to the build matrix during make distcheck. Add python tests, osmo-bsc, nat, ... Change-Id: Ic724cf61d44409337414dc58c8795896b4b97a8a --- M contrib/jenkins.sh 1 file changed, 3 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 6650b5d..5903429 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -48,5 +48,7 @@ $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh -LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \ +LD_LIBRARY_PATH="$inst/lib" \ + DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic724cf61d44409337414dc58c8795896b4b97a8a Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:17:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:17:21 +0000 Subject: [MERGED] osmo-msc[master]: Use libvlr in libmsc (large refactoring) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use libvlr in libmsc (large refactoring) ...................................................................... Use libvlr in libmsc (large refactoring) Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Remove/Disable VTY and CTRL commands to create subscribers, which is now a task of the OsmoHLR. Adjust the python tests accordingly. Remove VTY cmd subscriber-keep-in-ram. Use OSMO_GSUP_PORT = 4222 instead of 2222. See I4222e21686c823985be8ff1f16b1182be8ad6175. So far use the LAC from conn->bts, will be replaced by conn->lac in Id3705236350d5f69e447046b0a764bbabc3d493c. Related: OS#1592 OS#1974 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 --- M configure.ac M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-nitb/rbs2308/openbsc.cfg M include/openbsc/Makefile.am M include/openbsc/abis_rsl.h M include/openbsc/auth.h M include/openbsc/bsc_api.h M include/openbsc/chan_alloc.h M include/openbsc/db.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/gsm_subscriber.h M include/openbsc/osmo_msc.h M include/openbsc/signal.h M include/openbsc/silent_call.h D include/openbsc/token_auth.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M src/gprs/sgsn_main.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/paging.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/meas_feed.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c D src/libmsc/token_auth.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr_access_req_fsm.c M src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/ctrl_test_runner.py M tests/db/db_test.c D tests/mm_auth/Makefile.am D tests/mm_auth/mm_auth_test.c D tests/mm_auth/mm_auth_test.ok A tests/sms_queue/Makefile.am A tests/sms_queue/sms_queue_test.c A tests/sms_queue/sms_queue_test.err A tests/sms_queue/sms_queue_test.ok M tests/subscr/Makefile.am D tests/subscr/subscr_test.c D tests/subscr/subscr_test.ok M tests/testsuite.at M tests/vty_test_runner.py 74 files changed, 2,210 insertions(+), 4,252 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050 Gerrit-PatchSet: 10 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:17:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:17:21 +0000 Subject: [MERGED] osmo-msc[master]: Add libvlr implementation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add libvlr implementation ...................................................................... Add libvlr implementation Original libvlr code is by Harald Welte , polished and tweaked by Neels Hofmeyr . This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/debug.h M include/openbsc/iu.h A include/openbsc/vlr.h M src/Makefile.am M src/libcommon/debug.c A src/libmsc/subscr_conn.c M src/libmsc/vty_interface_layer3.c A src/libvlr/Makefile.am A src/libvlr/vlr.c A src/libvlr/vlr_access_req_fsm.c A src/libvlr/vlr_access_req_fsm.h A src/libvlr/vlr_auth_fsm.c A src/libvlr/vlr_auth_fsm.h A src/libvlr/vlr_core.h A src/libvlr/vlr_lu_fsm.c A src/libvlr/vlr_lu_fsm.h M src/osmo-nitb/Makefile.am 19 files changed, 4,734 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index adae598..63a087f 100644 --- a/configure.ac +++ b/configure.ac @@ -225,6 +225,7 @@ src/libtrau/Makefile src/libbsc/Makefile src/libmsc/Makefile + src/libvlr/Makefile src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 2740a5d..532328c 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -84,6 +84,7 @@ trau_mux.h \ trau_upqueue.h \ ussd.h \ + vlr.h \ vty.h \ v42bis.h \ v42bis_private.h \ diff --git a/include/openbsc/debug.h b/include/openbsc/debug.h index 8a4247b..3feb7c3 100644 --- a/include/openbsc/debug.h +++ b/include/openbsc/debug.h @@ -38,12 +38,8 @@ DSUA, DV42BIS, DPCU, + DVLR, Debug_LastEntry, }; - -struct gsm_subscriber; - -void log_set_filter_vlr_subscr(struct log_target *target, - struct gsm_subscriber *vlr_subscr); extern const struct log_info log_info; diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h index f973ac1..8cf830e 100644 --- a/include/openbsc/iu.h +++ b/include/openbsc/iu.h @@ -22,9 +22,6 @@ IU_EVENT_SECURITY_MODE_COMPLETE, IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ - /* FIXME: maybe IU_EVENT_IU_RELEASE and IU_EVENT_LINK_INVALIDATED - * should be combined to one generic event that simply means the - * ue_conn_ctx should no longer be used, for whatever reason. */ }; extern const struct value_string iu_event_type_names[]; @@ -35,7 +32,6 @@ /* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, - /* TODO "gprs_" in generic CS+PS domain ^ */ uint16_t *sai); typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, diff --git a/include/openbsc/vlr.h b/include/openbsc/vlr.h new file mode 100644 index 0000000..90e3d7a --- /dev/null +++ b/include/openbsc/vlr.h @@ -0,0 +1,413 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +// for GSM_NAME_LENGTH +#include + +/* from 3s to 10s */ +#define GSM_29002_TIMER_S 10 +/* from 15s to 30s */ +#define GSM_29002_TIMER_M 30 +/* from 1min to 10min */ +#define GSM_29002_TIMER_ML (10*60) +/* from 28h to 38h */ +#define GSM_29002_TIMER_L (32*60*60) + + +/* VLR subscriber authentication state */ +enum vlr_subscr_auth_state { + /* subscriber needs to be autenticated */ + VLR_SUB_AS_NEEDS_AUTH, + /* waiting for AuthInfo from HLR/AUC */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + /* waiting for response from subscriber */ + VLR_SUB_AS_WAIT_RESP, + /* successfully authenticated */ + VLR_SUB_AS_AUTHENTICATED, + /* subscriber needs re-sync */ + VLR_SUB_AS_NEEDS_RESYNC, + /* waiting for AuthInfo with ReSync */ + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + /* waiting for response from subscr, resync case */ + VLR_SUB_AS_WAIT_RESP_RESYNC, + /* waiting for IMSI from subscriber */ + VLR_SUB_AS_WAIT_ID_IMSI, + /* authentication has failed */ + VLR_SUB_AS_AUTH_FAILED, +}; + +enum vlr_lu_event { + VLR_ULA_E_UPDATE_LA, /* Initial trigger (LU from MS) */ + VLR_ULA_E_SEND_ID_ACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_SEND_ID_NACK, /* Result of Send-ID from PVLR */ + VLR_ULA_E_AUTH_RES, /* Result of auth procedure */ + VLR_ULA_E_CIPH_RES, /* Result of Ciphering Mode Command */ + VLR_ULA_E_ID_IMSI, /* IMSI recieved from MS */ + VLR_ULA_E_ID_IMEI, /* IMEI received from MS */ + VLR_ULA_E_ID_IMEISV, /* IMEISV received from MS */ + VLR_ULA_E_HLR_LU_RES, /* HLR UpdateLocation result */ + VLR_ULA_E_UPD_HLR_COMPL,/* UpdatE_HLR_VLR result */ + VLR_ULA_E_LU_COMPL_SUCCESS,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_LU_COMPL_FAILURE,/* Location_Update_Completion_VLR result */ + VLR_ULA_E_NEW_TMSI_ACK, /* TMSI Reallocation Complete */ +}; + +enum vlr_ciph_result_cause { + VLR_CIPH_REJECT, /* ? */ + VLR_CIPH_COMPL, +}; + +struct vlr_ciph_result { + enum vlr_ciph_result_cause cause; + const char *imeisv; +}; + +enum vlr_subscr_security_context { + VLR_SEC_CTX_NONE, + VLR_SEC_CTX_GSM, + VLR_SEC_CTX_UMTS, +}; + +enum vlr_lu_type { + VLR_LU_TYPE_PERIODIC, + VLR_LU_TYPE_IMSI_ATTACH, + VLR_LU_TYPE_REGULAR, +}; + +#define OSMO_LBUF_DECL(name, xlen) \ + struct { \ + uint8_t buf[xlen]; \ + size_t len; \ + } name + +struct sgsn_mm_ctx; +struct vlr_instance; + +/* The VLR subscriber is the part of the GSM subscriber state in VLR (CS) or + * SGSN (PS), particularly while interacting with the HLR via GSUP */ +struct vlr_subscr { + struct llist_head list; + struct vlr_instance *vlr; + + /* TODO either populate from HLR or drop this completely? */ + long long unsigned int id; + + /* Data from HLR */ /* 3GPP TS 23.008 */ + /* Always use vlr_subscr_set_imsi() to write to imsi[] */ + char imsi[GSM23003_IMSI_MAX_DIGITS+1]; /* 2.1.1.1 */ + char msisdn[GSM_EXTENSION_LENGTH+1]; /* 2.1.2 */ + char name[GSM_NAME_LENGTH+1]; /* proprietary */ + OSMO_LBUF_DECL(hlr, 16); /* 2.4.7 */ + uint32_t periodic_lu_timer; /* 2.4.24 */ + uint32_t age_indicator; /* 2.17.1 */ + + /* Authentication Data */ + struct gsm_auth_tuple auth_tuples[5]; /* 2.3.1-2.3.4 */ + struct gsm_auth_tuple *last_tuple; + enum vlr_subscr_security_context sec_ctx; + + /* Data local to VLR is below */ + uint32_t tmsi; /* 2.1.4 */ + /* Newly allocated TMSI that was not yet acked by MS */ + uint32_t tmsi_new; + + /* some redundancy in information below? */ + struct osmo_cell_global_id cgi; /* 2.4.16 */ + uint16_t lac; /* 2.4.2 */ + + char imeisv[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.2.3 */ + char imei[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.1.9 */ + bool imsi_detached_flag; /* 2.7.1 */ + bool conf_by_radio_contact_ind; /* 2.7.4.1 */ + bool sub_dataconf_by_hlr_ind; /* 2.7.4.2 */ + bool loc_conf_in_hlr_ind; /* 2.7.4.3 */ + bool dormant_ind; /* 2.7.8 */ + bool cancel_loc_rx; /* 2.7.8A */ + bool ms_not_reachable_flag; /* 2.10.2 (MNRF) */ + bool la_allowed; + + int use_count; + time_t expire_lu; /* FIXME: overlap with periodic_lu_timer/age_indicator */ + + struct osmo_fsm_inst *lu_fsm; + struct osmo_fsm_inst *auth_fsm; + struct osmo_fsm_inst *proc_arq_fsm; + + bool lu_complete; + + void *msc_conn_ref; + + /* PS (SGSN) specific parts */ + struct { + struct llist_head pdp_list; + uint8_t rac; + uint8_t sac; + struct gprs_mm_ctx *mmctx; + } ps; + /* CS (NITB/CSCN) specific parts */ + struct { + /* pending requests */ + bool is_paging; + struct llist_head requests; + } cs; +}; + +enum vlr_proc_arq_result; + +enum vlr_ciph { + VLR_CIPH_NONE, /*< A5/0, no encryption */ + VLR_CIPH_A5_1, /*< A5/1, encryption */ + VLR_CIPH_A5_2, /*< A5/2, deprecated export-grade encryption */ + VLR_CIPH_A5_3, /*< A5/3, 'new secure' encryption */ +}; + +struct vlr_ops { + /* encode + transmit an AUTH REQ towards the MS. + * \param[in] at auth tuple providing rand, key_seq and autn. + * \param[in] send_autn True to send AUTN, for r99 UMTS auth. + */ + int (*tx_auth_req)(void *msc_conn_ref, struct gsm_auth_tuple *at, + bool send_autn); + /* encode + transmit an AUTH REJECT towards the MS */ + int (*tx_auth_rej)(void *msc_conn_ref); + + /* encode + transmit an IDENTITY REQUEST towards the MS */ + int (*tx_id_req)(void *msc_conn_ref, uint8_t mi_type); + + int (*tx_lu_acc)(void *msc_conn_ref, uint32_t send_tmsi); + int (*tx_lu_rej)(void *msc_conn_ref, uint8_t cause); + 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 retrieve_imeisv); + + /* notify MSC/SGSN that the subscriber data in VLR has been updated */ + void (*subscr_update)(struct vlr_subscr *vsub); + /* notify MSC/SGSN that the given subscriber has been associated + * with this msc_conn_ref */ + void (*subscr_assoc)(void *msc_conn_ref, struct vlr_subscr *vsub); +}; + +enum vlr_timer { + VLR_T_3250, + VLR_T_3260, + VLR_T_3270, + _NUM_VLR_TIMERS +}; + +/* An instance of the VLR codebase */ +struct vlr_instance { + struct llist_head subscribers; + struct llist_head operations; + struct gsup_client *gsup_client; + struct vlr_ops ops; + struct { + bool retrieve_imeisv; + bool assign_tmsi; + bool check_imei_rqd; + int auth_tuple_max_use_count; + bool auth_reuse_old_sets_on_error; + bool parq_retrieve_imsi; + bool is_ps; + uint32_t timer[_NUM_VLR_TIMERS]; + } cfg; + /* A free-form pointer for use by the caller */ + void *user_ctx; +}; + +extern const struct value_string vlr_ciph_names[]; +static inline const char *vlr_ciph_name(enum vlr_ciph val) +{ + return get_value_string(vlr_ciph_names, val); +} + +/* Location Updating request */ +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi); + +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi); + +/* tell the VLR that the subscriber connection is gone */ +int vlr_subscr_disconnected(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); +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); +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); +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub); + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops); +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port); + +/* internal use only */ + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event); +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event); + +struct osmo_fsm_inst * +lu_compl_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure); + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +const char *vlr_subscr_msisdn_or_name(struct vlr_subscr *vsub); + +#define vlr_subscr_find_by_imsi(vlr, imsi) \ + _vlr_subscr_find_by_imsi(vlr, imsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_imsi(vlr, imsi, created) \ + _vlr_subscr_find_or_create_by_imsi(vlr, imsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_tmsi(vlr, tmsi) \ + _vlr_subscr_find_by_tmsi(vlr, tmsi, __BASE_FILE__, __LINE__) +#define vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created) \ + _vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created, \ + __BASE_FILE__, __LINE__) + +#define vlr_subscr_find_by_msisdn(vlr, msisdn) \ + _vlr_subscr_find_by_msisdn(vlr, msisdn, __BASE_FILE__, __LINE__) + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line); +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line); + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line); + +#define vlr_subscr_get(sub) _vlr_subscr_get(sub, __BASE_FILE__, __LINE__) +#define vlr_subscr_put(sub) _vlr_subscr_put(sub, __BASE_FILE__, __LINE__) +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line); +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line); + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_free(struct vlr_subscr *vsub); +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub); + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi); +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei); +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv); +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn); + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi); +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi); +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn); +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei); + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer); + +int vlr_subscr_changed(struct vlr_subscr *vsub); +int vlr_subscr_purge(struct vlr_subscr *vsub); +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause); + + +/* Process Acccess Request FSM */ + +enum vlr_proc_arq_result { + VLR_PR_ARQ_RES_NONE, + VLR_PR_ARQ_RES_SYSTEM_FAILURE, + VLR_PR_ARQ_RES_ILLEGAL_SUBSCR, + VLR_PR_ARQ_RES_UNIDENT_SUBSCR, + VLR_PR_ARQ_RES_ROAMING_NOTALLOWED, + VLR_PR_ARQ_RES_ILLEGAL_EQUIP, + VLR_PR_ARQ_RES_UNKNOWN_ERROR, + VLR_PR_ARQ_RES_TIMEOUT, + VLR_PR_ARQ_RES_PASSED, +}; + +extern const struct value_string vlr_proc_arq_result_names[]; +static inline const char *vlr_proc_arq_result_name(enum vlr_proc_arq_result res) +{ + return get_value_string(vlr_proc_arq_result_names, res); +} + +enum proc_arq_vlr_event { + PR_ARQ_E_START, + PR_ARQ_E_ID_IMSI, + PR_ARQ_E_AUTH_RES, + PR_ARQ_E_CIPH_RES, + PR_ARQ_E_UPD_LOC_RES, + PR_ARQ_E_TRACE_RES, + PR_ARQ_E_IMEI_RES, + PR_ARQ_E_PRES_RES, + PR_ARQ_E_TMSI_ACK, +}; + +enum vlr_parq_type { + VLR_PR_ARQ_T_INVALID = 0, /* to guard against unset vars */ + VLR_PR_ARQ_T_CM_SERV_REQ, + VLR_PR_ARQ_T_PAGING_RESP, + /* FIXME: differentiate between services of 24.008 10.5.3.3 */ +}; + +/* Process Access Request (CM SERV REQ / PAGING RESP) */ +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran); + +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi); + +void vlr_parq_fsm_init(void); + +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv); + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr); diff --git a/src/Makefile.am b/src/Makefile.am index cfad7df..c66f9e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,7 @@ # Libraries SUBDIRS = \ libcommon \ + libvlr \ libmgcp \ libbsc \ libmsc \ diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index f29f168..088902a 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -180,6 +180,11 @@ .description = "PCU Interface", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DVLR] = { + .name = "DVLR", + .description = "Visitor Location Register", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static int filter_fn(const struct log_context *ctx, struct log_target *tar) diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c new file mode 100644 index 0000000..91ffe40 --- /dev/null +++ b/src/libmsc/subscr_conn.c @@ -0,0 +1,269 @@ +/* MSC subscriber connection implementation */ + +/* + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +static const struct value_string subscr_conn_fsm_event_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_E_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_E_ACCEPTED), + OSMO_VALUE_STRING(SUBSCR_CONN_E_BUMP), + OSMO_VALUE_STRING(SUBSCR_CONN_E_MO_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CN_CLOSE), + OSMO_VALUE_STRING(SUBSCR_CONN_E_CLOSE_CONF), + { 0, NULL } +}; + +const struct value_string subscr_conn_from_names[] = { + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_INVALID), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_LU), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_CM_SERVICE_REQ), + OSMO_VALUE_STRING(SUBSCR_CONN_FROM_PAGING_RESP), + { 0, NULL } +}; + +static void paging_resp(struct gsm_subscriber_connection *conn, + enum gsm_paging_event pe) +{ + subscr_paging_dispatch(GSM_HOOK_RR_PAGING, pe, NULL, conn, conn->subscr); +} + +void subscr_conn_fsm_new(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + enum subscr_conn_from from = SUBSCR_CONN_FROM_INVALID; + enum gsm_paging_event pe; + + if (data) { + from = *(enum subscr_conn_from*)data; + LOGPFSM(fi, "%s\n", subscr_conn_from_name(from)); + } + + /* If accepted, transition the state, all other cases mean failure. */ + switch (event) { + case SUBSCR_CONN_E_ACCEPTED: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + break; + + case SUBSCR_CONN_E_MO_CLOSE: + case SUBSCR_CONN_E_CN_CLOSE: + case SUBSCR_CONN_E_CLOSE_CONF: + break; + + default: + LOGPFSM(fi, "Unexpected event: %d %s\n", + event, osmo_fsm_event_name(fi->fsm, event)); + break; + } + + /* if appropriate, signal paging success or failure */ + if (from == SUBSCR_CONN_FROM_PAGING_RESP) { + pe = (fi->state == SUBSCR_CONN_S_ACCEPTED)? + GSM_PAGING_SUCCEEDED : GSM_PAGING_EXPIRED; + paging_resp(conn, pe); + } + + /* On failure, discard the conn */ + if (fi->state != SUBSCR_CONN_S_ACCEPTED) { + /* TODO: on MO_CLOSE or CN_CLOSE, first go to RELEASING and + * await BSC confirmation? */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); + return; + } + + /* On success, handle pending requests and/or close conn */ + + if (from == SUBSCR_CONN_FROM_CM_SERVICE_REQ) { + conn->received_cm_service_request = true; + LOGPFSM(fi, "received_cm_service_request = true\n"); + } + + osmo_fsm_inst_dispatch(fi, SUBSCR_CONN_E_BUMP, data); +} + +#if 0 + case SUBSCR_CONN_E_PARQ_SUCCESS: + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, 0, 0); + accept_conn = true; + /* fall through */ + case SUBSCR_CONN_E_PARQ_FAILURE: + parq_type = data ? *(enum vlr_parq_type*)data : VLR_PR_ARQ_T_INVALID; + switch (parq_type) { + + case VLR_PR_ARQ_T_CM_SERV_REQ: + accept_conn = handle_cm_serv_result(fi, accept_conn); + break; + + case VLR_PR_ARQ_T_PAGING_RESP: + accept_conn = handle_paging_result(fi, accept_conn); + break; + + default: + LOGPFSML(fi, LOGL_ERROR, + "Invalid VLR Process Access Request type" + " %d\n", parq_type); + accept_conn = false; + break; + } + break; +#endif + +static void subscr_conn_fsm_bump(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = fi->priv; + + if (conn->silent_call) + return; + + if (conn->received_cm_service_request) + return; + + /* is this needed? */ + if (conn->subscr && !llist_empty(&conn->subscr->requests)) + return; + + if (trans_has_conn(conn)) + return; + + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_accepted(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case SUBSCR_CONN_E_BUMP: + subscr_conn_fsm_bump(fi, event, data); + return; + + default: + break; + } + /* Whatever unexpected happens in the accepted state, it means release. + * Even if an unexpected event is passed, the safest thing to do is + * discard the conn. We don't expect another SUBSCR_CONN_E_ACCEPTED. */ + osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_RELEASED, 0, 0); +} + +static void subscr_conn_fsm_release(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = fi->priv; + if (!conn) + return; + + /* temporary hack, see owned_by_msc */ + if (!conn->owned_by_msc) { + DEBUGP(DMM, "%s leaving bsc_subscr_con_free() to bsc_api.c, owned_by_msc = false\n", + subscr_name(conn->subscr)); + return; + } + + DEBUGP(DMM, "%s calling bsc_subscr_con_free(), owned_by_msc = true\n", + subscr_name(conn->subscr)); + gsm0808_clear(conn); + bsc_subscr_con_free(conn); +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state subscr_conn_fsm_states[] = { + [SUBSCR_CONN_S_NEW] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_NEW), + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_ACCEPTED) | + S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_new, + }, + [SUBSCR_CONN_S_ACCEPTED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_ACCEPTED), + /* allow everything to release for any odd behavior */ + .in_event_mask = S(SUBSCR_CONN_E_ACCEPTED) | + S(SUBSCR_CONN_E_BUMP) | + S(SUBSCR_CONN_E_MO_CLOSE) | + S(SUBSCR_CONN_E_CN_CLOSE) | + S(SUBSCR_CONN_E_CLOSE_CONF), + .out_state_mask = S(SUBSCR_CONN_S_RELEASED), + .action = subscr_conn_fsm_accepted, + }, + [SUBSCR_CONN_S_RELEASED] = { + .name = OSMO_STRINGIFY(SUBSCR_CONN_S_RELEASED), + .onenter = subscr_conn_fsm_release, + }, +}; + +static struct osmo_fsm subscr_conn_fsm = { + .name = "Subscr_Conn", + .states = subscr_conn_fsm_states, + .num_states = ARRAY_SIZE(subscr_conn_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = subscr_conn_fsm_event_names, +}; + +int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id) +{ + struct osmo_fsm_inst *fi; + OSMO_ASSERT(conn); + + if (conn->conn_fsm) { + LOGP(DMM, LOGL_ERROR, + "%s: Error: connection already in use\n", id); + return -EINVAL; + } + + fi = osmo_fsm_inst_alloc(&subscr_conn_fsm, conn, conn, LOGL_DEBUG, id); + + if (!fi) { + LOGP(DMM, LOGL_ERROR, + "%s: Failed to allocate subscr conn master FSM\n", id); + return -ENOMEM; + } + conn->conn_fsm = fi; + return 0; +} + +bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn) +{ + if (!conn) + return false; + if (!conn->subscr) + return false; + if (!conn->conn_fsm) + return false; + if (conn->conn_fsm->state != SUBSCR_CONN_S_ACCEPTED) + return false; + return true; +} + +void msc_subscr_conn_init(void) +{ + osmo_fsm_register(&subscr_conn_fsm); +} diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index e503291..99d7fb9 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -1053,7 +1053,6 @@ return CMD_WARNING; } - log_set_filter_vlr_subscr(tgt, vlr_subscr); log_set_filter_bsc_subscr(tgt, bsc_subscr); return CMD_SUCCESS; } diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am new file mode 100644 index 0000000..17ad411 --- /dev/null +++ b/src/libvlr/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) + +noinst_HEADERS = \ + vlr_access_req_fsm.h \ + vlr_auth_fsm.h \ + vlr_core.h \ + vlr_lu_fsm.h \ + $(NULL) + +noinst_LIBRARIES = libvlr.a + +libvlr_a_SOURCES = \ + vlr.c \ + vlr_access_req_fsm.c \ + vlr_auth_fsm.c \ + vlr_lu_fsm.c \ + $(NULL) diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c new file mode 100644 index 0000000..0e0d31c --- /dev/null +++ b/src/libvlr/vlr.c @@ -0,0 +1,1108 @@ +/* Osmocom Visitor Location Register (VLR) code base */ + +/* (C) 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define SGSN_SUBSCR_MAX_RETRIES 3 +#define SGSN_SUBSCR_RETRY_INTERVAL 10 + +/*********************************************************************** + * Convenience functions + ***********************************************************************/ + +const struct value_string vlr_ciph_names[] = { + OSMO_VALUE_STRING(VLR_CIPH_NONE), + OSMO_VALUE_STRING(VLR_CIPH_A5_1), + OSMO_VALUE_STRING(VLR_CIPH_A5_2), + OSMO_VALUE_STRING(VLR_CIPH_A5_3), + { 0, NULL } +}; + +uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer) +{ + uint32_t tidx = 0xffffffff; + + switch (timer) { + case 3270: + tidx = VLR_T_3270; + break; + case 3260: + tidx = VLR_T_3260; + break; + case 3250: + tidx = VLR_T_3250; + break; + } + + OSMO_ASSERT(tidx < sizeof(vlr->cfg.timer)); + return vlr->cfg.timer[tidx]; +} + +struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr, + const char *imsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!imsi || !*imsi) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_imsi(vsub, imsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (tmsi == GSM_RESERVED_TMSI) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_tmsi(vsub, tmsi)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr, + const char *msisdn, + const char *file, int line) +{ + struct vlr_subscr *vsub; + + if (!msisdn || !*msisdn) + return NULL; + + llist_for_each_entry(vsub, &vlr->subscribers, list) { + if (vlr_subscr_matches_msisdn(vsub, msisdn)) + return _vlr_subscr_get(vsub, file, line); + } + return NULL; +} + +/* Transmit GSUP message to HLR */ +static int vlr_tx_gsup_message(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + struct msgb *msg = gsup_client_msgb_alloc(); + + osmo_gsup_encode(msg, gsup_msg); + + if (!vlr->gsup_client) { + LOGP(DVLR, LOGL_NOTICE, "GSUP link is down, cannot " + "send GSUP: %s\n", msgb_hexdump(msg)); + msgb_free(msg); + return -ENOTSUP; + } + + LOGP(DVLR, LOGL_DEBUG, "GSUP tx: %s\n", + osmo_hexdump_nospc(msg->data, msg->len)); + + return gsup_client_send(vlr->gsup_client, msg); +} + +/* Transmit GSUP message for subscriber to HLR, using IMSI from subscriber */ +static int vlr_subscr_tx_gsup_message(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct vlr_instance *vlr = vsub->vlr; + + if (strlen(gsup_msg->imsi) == 0) + osmo_strlcpy(gsup_msg->imsi, vsub->imsi, sizeof(gsup_msg->imsi)); + + return vlr_tx_gsup_message(vlr, gsup_msg); +} + +/* Transmit GSUP error in response to original message */ +static int vlr_tx_gsup_error_reply(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_orig, + enum gsm48_gmm_cause cause) +{ + struct osmo_gsup_message gsup_reply = {0}; + + osmo_strlcpy(gsup_reply.imsi, gsup_orig->imsi, sizeof(gsup_reply.imsi)); + gsup_reply.cause = cause; + gsup_reply.message_type = + OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type); + + return vlr_tx_gsup_message(vlr, &gsup_reply); +} + +struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + OSMO_ASSERT(sub->use_count < INT_MAX); + sub->use_count++; + LOGPSRC(DREF, LOGL_DEBUG, file, line, + "VLR subscr %s usage increases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + return sub; +} + +struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line) +{ + if (!sub) + return NULL; + sub->use_count--; + LOGPSRC(DREF, sub->use_count >= 0? LOGL_DEBUG : LOGL_ERROR, + file, line, + "VLR subscr %s usage decreases to: %d\n", + vlr_subscr_name(sub), sub->use_count); + if (sub->use_count <= 0) + vlr_subscr_free(sub); + return NULL; +} + +/* Allocate a new subscriber and insert it into list */ +static struct vlr_subscr *_vlr_subscr_alloc(struct vlr_instance *vlr) +{ + struct vlr_subscr *vsub; + int i; + + vsub = talloc_zero(vlr, struct vlr_subscr); + vsub->vlr = vlr; + vsub->tmsi = GSM_RESERVED_TMSI; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + + INIT_LLIST_HEAD(&vsub->cs.requests); + INIT_LLIST_HEAD(&vsub->ps.pdp_list); + + llist_add_tail(&vsub->list, &vlr->subscribers); + return vsub; +} + +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr) +{ + return vlr_subscr_get(_vlr_subscr_alloc(vlr)); +} + +/* Send a GSUP Purge MS request. + * TODO: this should be sent to the *previous* VLR when this VLR is "taking" + * this subscriber, not to the HLR? */ +int vlr_subscr_purge(struct vlr_subscr *vsub) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_PURGE_MS_REQUEST; + + /* provide HLR number in case we know it */ + gsup_msg.hlr_enc_len = vsub->hlr.len; + gsup_msg.hlr_enc = vsub->hlr.buf; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +void vlr_subscr_cancel(struct vlr_subscr *vsub, enum gsm48_gmm_cause cause) +{ + if (!vsub) + return; + + if (vsub->lu_fsm) { + if (vsub->lu_fsm->state == VLR_ULA_S_WAIT_HLR_UPD) + osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_HLR_LU_RES, + (void*)&cause); + else + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_ERROR, + 0); + } + + if (vsub->proc_arq_fsm) + osmo_fsm_inst_term(vsub->proc_arq_fsm, OSMO_FSM_TERM_ERROR, 0); +} + +/* Call vlr_subscr_cancel(), then completely drop the entry from the VLR */ +void vlr_subscr_free(struct vlr_subscr *vsub) +{ + llist_del(&vsub->list); + DEBUGP(DREF, "freeing VLR subscr %s\n", vlr_subscr_name(vsub)); + talloc_free(vsub); +} + +/* Generate a new TMSI and store in vsub->tmsi_new. + * Search all known subscribers to ensure that the TMSI is unique. */ +int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub) +{ + struct vlr_instance *vlr = vsub->vlr; + uint32_t tmsi; + int tried; + + for (tried = 0; tried < 100; tried++) { + if (RAND_bytes((uint8_t *) &tmsi, sizeof(tmsi)) != 1) { + LOGP(DVLR, LOGL_ERROR, "RAND_bytes failed\n"); + return -1; + } + /* throw the dice again, if the TSMI doesn't fit */ + if (tmsi == GSM_RESERVED_TMSI) + continue; + + /* Section 2.4 of 23.003: MSC has two MSB 00/01/10, SGSN 11 */ + if (vlr->cfg.is_ps) { + /* SGSN */ + tmsi |= 0xC000000; + } else { + /* MSC */ + if ((tmsi & 0xC0000000) == 0xC0000000) + tmsi &= ~0xC0000000; + } + + /* If this TMSI is already in use, try another one. */ + if (vlr_subscr_find_by_tmsi(vlr, tmsi)) + continue; + + vsub->tmsi_new = tmsi; + return 0; + } + + LOGP(DVLR, LOGL_ERROR, "subscr %s: unable to generate valid TMSI" + " after %d tries\n", vlr_subscr_name(vsub), tried); + return -1; +} + +/* Find subscriber by IMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] imsi IMSI string. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_imsi(struct vlr_instance *vlr, + const char *imsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_imsi(vlr, imsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vlr_subscr_set_imsi(vsub, imsi); + LOGP(DVLR, LOGL_INFO, "New subscr, IMSI: %s\n", vsub->imsi); + if (created) + *created = true; + return vsub; +} + +/* Find subscriber by TMSI, or create new subscriber if not found. + * \param[in] vlr VLR instace. + * \param[in] tmsi TMSI. + * \param[out] created if non-NULL, returns whether a new entry was created. */ +struct vlr_subscr *_vlr_subscr_find_or_create_by_tmsi(struct vlr_instance *vlr, + uint32_t tmsi, + bool *created, + const char *file, + int line) +{ + struct vlr_subscr *vsub; + vsub = _vlr_subscr_find_by_tmsi(vlr, tmsi, file, line); + if (vsub) { + if (created) + *created = false; + return vsub; + } + + vsub = _vlr_subscr_get(_vlr_subscr_alloc(vlr), file, line); + if (!vsub) + return NULL; + vsub->tmsi = tmsi; + LOGP(DVLR, LOGL_INFO, "New subscr, TMSI: 0x%08x\n", vsub->tmsi); + if (created) + *created = true; + return vsub; +} + +void vlr_subscr_set_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imsi, imsi, sizeof(vsub->imsi)); + vsub->id = atoll(vsub->imsi); + DEBUGP(DVLR, "set IMSI on subscriber; IMSI=%s id=%llu\n", + vsub->imsi, vsub->id); +} + +void vlr_subscr_set_imei(struct vlr_subscr *vsub, const char *imei) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imei, imei, sizeof(vsub->imei)); + DEBUGP(DVLR, "set IMEI on subscriber; IMSI=%s IMEI=%s\n", + vsub->imsi, vsub->imei); +} + +void vlr_subscr_set_imeisv(struct vlr_subscr *vsub, const char *imeisv) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->imeisv, imeisv, sizeof(vsub->imeisv)); + DEBUGP(DVLR, "set IMEISV on subscriber; IMSI=%s IMEISV=%s\n", + vsub->imsi, vsub->imeisv); +} + +/* Safely copy the given MSISDN string to vsub->msisdn */ +void vlr_subscr_set_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + if (!vsub) + return; + osmo_strlcpy(vsub->msisdn, msisdn, sizeof(vsub->msisdn)); + DEBUGP(DVLR, "set MSISDN on subscriber; IMSI=%s MSISDN=%s\n", + vsub->imsi, vsub->msisdn); +} + +bool vlr_subscr_matches_imsi(struct vlr_subscr *vsub, const char *imsi) +{ + return vsub && imsi && vsub->imsi[0] && !strcmp(vsub->imsi, imsi); +} + +bool vlr_subscr_matches_tmsi(struct vlr_subscr *vsub, uint32_t tmsi) +{ + return vsub && tmsi != GSM_RESERVED_TMSI + && (vsub->tmsi == tmsi || vsub->tmsi_new == tmsi); +} + +bool vlr_subscr_matches_msisdn(struct vlr_subscr *vsub, const char *msisdn) +{ + return vsub && msisdn && vsub->msisdn[0] + && !strcmp(vsub->msisdn, msisdn); +} + +bool vlr_subscr_matches_imei(struct vlr_subscr *vsub, const char *imei) +{ + return vsub && imei && vsub->imei[0] + && !strcmp(vsub->imei, imei); +} + +/* Send updated subscriber information to HLR */ +int vlr_subscr_changed(struct vlr_subscr *vsub) +{ + /* FIXME */ + LOGP(DVLR, LOGL_ERROR, "Not implemented: %s\n", __func__); + return 0; +} + +/*********************************************************************** + * PDP context data + ***********************************************************************/ + +struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_alloc(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data* pdata; + + pdata = talloc_zero(vsub, struct sgsn_subscriber_pdp_data); + + llist_add_tail(&pdata->list, &vsub->ps.pdp_list); + + return pdata; +} + +static int vlr_subscr_pdp_data_clear(struct vlr_subscr *vsub) +{ + struct sgsn_subscriber_pdp_data *pdp, *pdp2; + int count = 0; + + llist_for_each_entry_safe(pdp, pdp2, &vsub->ps.pdp_list, list) { + llist_del(&pdp->list); + talloc_free(pdp); + count += 1; + } + + return count; +} + +static struct sgsn_subscriber_pdp_data * +vlr_subscr_pdp_data_get_by_id(struct vlr_subscr *vsub, unsigned context_id) +{ + struct sgsn_subscriber_pdp_data *pdp; + + llist_for_each_entry(pdp, &vsub->ps.pdp_list, list) { + if (pdp->context_id == context_id) + return pdp; + } + + return NULL; +} + +/*********************************************************************** + * Actual Implementation + ***********************************************************************/ + +static int vlr_rx_gsup_unknown_imsi(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup_msg->message_type)) { + vlr_tx_gsup_error_reply(vlr, gsup_msg, + GMM_CAUSE_IMSI_UNKNOWN); + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP request " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } else if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP error " + "of type 0x%02x, cause '%s' (%d)\n", + gsup_msg->imsi, gsup_msg->message_type, + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + } else { + LOGP(DVLR, LOGL_NOTICE, + "Unknown IMSI %s, discarding GSUP response " + "of type 0x%02x\n", + gsup_msg->imsi, gsup_msg->message_type); + } + + return -GMM_CAUSE_IMSI_UNKNOWN; +} + +static int vlr_rx_gsup_purge_no_subscr(struct vlr_instance *vlr, + struct osmo_gsup_message *gsup_msg) +{ + if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + LOGGSUPP(LOGL_NOTICE, gsup_msg, + "Purge MS has failed with cause '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, gsup_msg->cause), + gsup_msg->cause); + return -gsup_msg->cause; + } + LOGGSUPP(LOGL_INFO, gsup_msg, "Completing purge MS\n"); + return 0; +} + +/* VLR internal call to request UpdateLocation from HLR */ +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps) +{ + struct osmo_gsup_message gsup_msg = {0}; + int rc; + + gsup_msg.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; + rc = vlr_subscr_tx_gsup_message(vsub, &gsup_msg); + + return rc; +} + +/* VLR internal call to request tuples from HLR */ +int vlr_subscr_req_sai(struct vlr_subscr *vsub, + const uint8_t *auts, const uint8_t *auts_rand) +{ + struct osmo_gsup_message gsup_msg = {0}; + + gsup_msg.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; + gsup_msg.auts = auts; + gsup_msg.rand = auts_rand; + + return vlr_subscr_tx_gsup_message(vsub, &gsup_msg); +} + +/* Tell HLR that authentication failure occurred */ +int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub) +{ + 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)); + return vlr_tx_gsup_message(vsub->vlr, &gsup_msg); +} + +/* Update the subscriber with GSUP-received auth tuples */ +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + unsigned int i; + unsigned int got_tuples; + + if (gsup->num_auth_vectors) { + memset(&vsub->auth_tuples, 0, sizeof(vsub->auth_tuples)); + for (i = 0; i < ARRAY_SIZE(vsub->auth_tuples); i++) + vsub->auth_tuples[i].key_seq = GSM_KEY_SEQ_INVAL; + } + + got_tuples = 0; + for (i = 0; i < gsup->num_auth_vectors; i++) { + size_t key_seq = i; + + if (key_seq >= ARRAY_SIZE(vsub->auth_tuples)) { + LOGVSUBP(LOGL_NOTICE, vsub, + "Skipping auth tuple wih invalid cksn %zu\n", + key_seq); + continue; + } + vsub->auth_tuples[i].vec = gsup->auth_vectors[i]; + vsub->auth_tuples[i].key_seq = key_seq; + got_tuples ++; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "Received %u auth tuples\n", got_tuples); + + if (!got_tuples) { + /* FIXME what now? */ + // vlr_subscr_cancel(vsub, GMM_CAUSE_GSM_AUTH_UNACCEPT); ? + } + + /* New tuples means last_tuple becomes invalid */ + vsub->last_tuple = NULL; +} + +/* Handle SendAuthInfo Result/Error from HLR */ +static int vlr_subscr_handle_sai_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + void *data = (void *) gsup; + + switch (gsup->message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_ACK, data); + break; + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_HLR_SAI_NACK, data); + break; + default: + return -1; + } + + return 0; +} + +static int decode_bcd_number_safe(char *output, int output_len, + const uint8_t *bcd_lv, int input_len, + int h_len) +{ + uint8_t len; + OSMO_ASSERT(output_len >= 1); + *output = '\0'; + if (input_len < 1) + return -EIO; + len = bcd_lv[0]; + if (input_len < len) + return -EIO; + return gsm48_decode_bcd_number(output, output_len, bcd_lv, h_len); +} + +static void vlr_subscr_gsup_insert_data(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup_msg) +{ + unsigned idx; + int rc; + + if (gsup_msg->msisdn_enc) { + decode_bcd_number_safe(vsub->msisdn, sizeof(vsub->msisdn), + gsup_msg->msisdn_enc, + gsup_msg->msisdn_enc_len, 0); + LOGP(DVLR, LOGL_DEBUG, "IMSI:%s has MSISDN:%s\n", + vsub->imsi, vsub->msisdn); + } + + if (gsup_msg->hlr_enc) { + if (gsup_msg->hlr_enc_len > sizeof(vsub->hlr.buf)) { + LOGP(DVLR, LOGL_ERROR, "HLR-Number too long (%zu)\n", + gsup_msg->hlr_enc_len); + vsub->hlr.len = 0; + } else { + memcpy(vsub->hlr.buf, gsup_msg->hlr_enc, + gsup_msg->hlr_enc_len); + vsub->hlr.len = gsup_msg->hlr_enc_len; + } + } + + if (gsup_msg->pdp_info_compl) { + rc = vlr_subscr_pdp_data_clear(vsub); + if (rc > 0) + LOGP(DVLR, LOGL_INFO, "Cleared existing PDP info\n"); + } + + for (idx = 0; idx < gsup_msg->num_pdp_infos; idx++) { + const struct osmo_gsup_pdp_info *pdp_info = &gsup_msg->pdp_infos[idx]; + size_t ctx_id = pdp_info->context_id; + struct sgsn_subscriber_pdp_data *pdp_data; + + if (pdp_info->apn_enc_len >= sizeof(pdp_data->apn_str)-1) { + LOGVSUBP(LOGL_ERROR, vsub, + "APN too long, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, + pdp_info->apn_enc_len)); + continue; + } + + if (pdp_info->qos_enc_len > sizeof(pdp_data->qos_subscribed)) { + LOGVSUBP(LOGL_ERROR, vsub, + "QoS info too long (%zu)\n", + pdp_info->qos_enc_len); + continue; + } + + LOGVSUBP(LOGL_INFO, vsub, + "Will set PDP info, context id = %zu, APN = %s\n", + ctx_id, osmo_hexdump(pdp_info->apn_enc, pdp_info->apn_enc_len)); + + /* Set PDP info [ctx_id] */ + pdp_data = vlr_subscr_pdp_data_get_by_id(vsub, ctx_id); + if (!pdp_data) { + pdp_data = vlr_subscr_pdp_data_alloc(vsub); + pdp_data->context_id = ctx_id; + } + + OSMO_ASSERT(pdp_data != NULL); + pdp_data->pdp_type = pdp_info->pdp_type; + osmo_apn_to_str(pdp_data->apn_str, + pdp_info->apn_enc, pdp_info->apn_enc_len); + memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); + pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + } +} + + +/* Handle InsertSubscrData Result from HLR */ +static int vlr_subscr_handle_isd_req(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + struct osmo_gsup_message gsup_reply = {0}; + + vlr_subscr_gsup_insert_data(vsub, gsup); + vsub->vlr->ops.subscr_update(vsub); + + gsup_reply.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; + return vlr_subscr_tx_gsup_message(vsub, &gsup_reply); +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_res(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Result " + "without LU in progress\n"); + return -ENODEV; + } + + /* contrary to MAP, we allow piggy-backing subscriber data onto the + * UPDATE LOCATION RESULT, and don't mandate the use of a separate + * nested INSERT SUBSCRIBER DATA transaction */ + vlr_subscr_gsup_insert_data(vsub, gsup); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, NULL); + + return 0; +} + +/* Handle UpdateLocation Result from HLR */ +static int vlr_subscr_handle_lu_err(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup) +{ + if (!vsub->lu_fsm) { + LOGVSUBP(LOGL_ERROR, vsub, "Rx GSUP LU Error " + "without LU in progress\n"); + return -ENODEV; + } + + LOGVSUBP(LOGL_DEBUG, vsub, "UpdateLocation failed; gmm_cause: %s\n", + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_HLR_LU_RES, + (void *)&gsup->cause); + + return 0; +} + +/* Handle LOCATION CANCEL request from HLR */ +static int vlr_subscr_handle_cancel_req(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct osmo_gsup_message gsup_reply = {0}; + int is_update_procedure = !gsup_msg->cancel_type || + gsup_msg->cancel_type == OSMO_GSUP_CANCEL_TYPE_UPDATE; + + LOGVSUBP(LOGL_INFO, vsub, "Cancelling MS subscriber (%s)\n", + is_update_procedure ? + "update procedure" : "subscription withdraw"); + + gsup_reply.message_type = OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT; + vlr_subscr_tx_gsup_message(vsub, &gsup_reply); + + vlr_subscr_cancel(vsub, gsup_msg->cause); + + return 0; +} + +/* Incoming handler for GSUP from HLR. + * Keep this function non-static for direct invocation by unit tests. */ +int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +{ + struct vlr_instance *vlr = (struct vlr_instance *) gsupc->data; + struct vlr_subscr *vsub; + struct osmo_gsup_message gsup; + int rc; + + DEBUGP(DVLR, "GSUP rx %u: %s\n", msgb_l2len(msg), + osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup); + if (rc < 0) { + LOGP(DVLR, LOGL_ERROR, + "decoding GSUP message fails with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return rc; + } + + if (!gsup.imsi[0]) { + LOGP(DVLR, LOGL_ERROR, "Missing IMSI in GSUP message\n"); + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup.message_type)) + vlr_tx_gsup_error_reply(vlr, &gsup, + GMM_CAUSE_INV_MAND_INFO); + return -GMM_CAUSE_INV_MAND_INFO; + } + + vsub = vlr_subscr_find_by_imsi(vlr, gsup.imsi); + if (!vsub) { + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + return vlr_rx_gsup_purge_no_subscr(vlr, &gsup); + default: + return vlr_rx_gsup_unknown_imsi(vlr, &gsup); + } + } + + switch (gsup.message_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + rc = vlr_subscr_handle_sai_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: + rc = vlr_subscr_handle_isd_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST: + rc = vlr_subscr_handle_cancel_req(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: + rc = vlr_subscr_handle_lu_res(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: + rc = vlr_subscr_handle_lu_err(vsub, &gsup); + break; + case OSMO_GSUP_MSGT_PURGE_MS_ERROR: + case OSMO_GSUP_MSGT_PURGE_MS_RESULT: + case OSMO_GSUP_MSGT_DELETE_DATA_REQUEST: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not yet implemented\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + default: + LOGVSUBP(LOGL_ERROR, vsub, + "Rx GSUP msg_type=%d not valid at VLR/SGSN side\n", + gsup.message_type); + rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + break; + } + + vlr_subscr_put(vsub); + return rc; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_id_resp(struct vlr_subscr *vsub, + const uint8_t *mi, size_t mi_len) +{ + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type = mi[0] & GSM_MI_TYPE_MASK; + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); + + /* update the vlr_subscr with the given identity */ + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else + vlr_subscr_set_imsi(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEI: + vlr_subscr_set_imei(vsub, mi_string); + break; + case GSM_MI_TYPE_IMEISV: + vlr_subscr_set_imeisv(vsub, mi_string); + break; + } + + if (vsub->auth_fsm) { + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + osmo_fsm_inst_dispatch(vsub->auth_fsm, + VLR_AUTH_E_MS_ID_IMSI, mi_string); + break; + } + } + + if (vsub->lu_fsm) { + uint32_t event = 0; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + event = VLR_ULA_E_ID_IMSI; + break; + case GSM_MI_TYPE_IMEI: + event = VLR_ULA_E_ID_IMEI; + break; + case GSM_MI_TYPE_IMEISV: + event = VLR_ULA_E_ID_IMEISV; + break; + default: + OSMO_ASSERT(0); + break; + } + osmo_fsm_inst_dispatch(vsub->lu_fsm, event, mi_string); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, "gratuitous ID RESPONSE?!?\n"); + } + + return 0; +} + +/* MSC->VLR: Subscriber has provided IDENTITY RESPONSE */ +int vlr_subscr_rx_tmsi_reall_compl(struct vlr_subscr *vsub) +{ + if (vsub->lu_fsm) { + return osmo_fsm_inst_dispatch(vsub->lu_fsm, + VLR_ULA_E_NEW_TMSI_ACK, NULL); + } else if (vsub->proc_arq_fsm) { + return osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, + PR_ARQ_E_TMSI_ACK, NULL); + } else { + LOGVSUBP(LOGL_NOTICE, vsub, + "gratuitous TMSI REALLOC COMPL"); + return -EINVAL; + } +} + +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); + } + return 0; +} + +/* Tear down any running FSMs due to MSC connection timeout. + * Visit all vsub->*_fsm pointers and give them a queue to send a final reject + * message before the entire connection is torn down. + * \param[in] vsub subscriber to tear down + */ +void vlr_subscr_conn_timeout(struct vlr_subscr *vsub) +{ + if (!vsub) + return; + + vlr_loc_update_conn_timeout(vsub->lu_fsm); + vlr_parq_conn_timeout(vsub->proc_arq_fsm); +} + +struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops) +{ + struct vlr_instance *vlr = talloc_zero(ctx, struct vlr_instance); + OSMO_ASSERT(vlr); + OSMO_ASSERT(ops->tx_auth_req); + OSMO_ASSERT(ops->tx_auth_rej); + OSMO_ASSERT(ops->tx_id_req); + OSMO_ASSERT(ops->tx_lu_acc); + OSMO_ASSERT(ops->tx_lu_rej); + OSMO_ASSERT(ops->tx_cm_serv_acc); + OSMO_ASSERT(ops->tx_cm_serv_rej); + OSMO_ASSERT(ops->set_ciph_mode); + OSMO_ASSERT(ops->subscr_update); + OSMO_ASSERT(ops->subscr_assoc); + + INIT_LLIST_HEAD(&vlr->subscribers); + INIT_LLIST_HEAD(&vlr->operations); + memcpy(&vlr->ops, ops, sizeof(vlr->ops)); + + /* osmo_auth_fsm.c */ + osmo_fsm_register(&vlr_auth_fsm); + /* osmo_lu_fsm.c */ + vlr_lu_fsm_init(); + /* vlr_access_request_fsm.c */ + vlr_parq_fsm_init(); + + return vlr; +} + +int vlr_start(const char *gsup_unit_name, struct vlr_instance *vlr, + const char *gsup_server_addr_str, uint16_t gsup_server_port) +{ + OSMO_ASSERT(vlr); + + vlr->gsup_client = gsup_client_create(gsup_unit_name, + gsup_server_addr_str, + gsup_server_port, + &vlr_gsupc_read_cb, NULL); + if (!vlr->gsup_client) + return -ENOMEM; + vlr->gsup_client->data = vlr; + + return 0; +} + +/* MSC->VLR: Subscribre has disconnected */ +int vlr_subscr_disconnected(struct vlr_subscr *vsub) +{ + /* This corresponds to a MAP-ABORT from MSC->VLR on a classic B + * interface */ + osmo_fsm_inst_term(vsub->lu_fsm, OSMO_FSM_TERM_REQUEST, NULL); + osmo_fsm_inst_term(vsub->auth_fsm, OSMO_FSM_TERM_REQUEST, NULL); + vsub->msc_conn_ref = NULL; + + return 0; +} + +/* MSC->VLR: Receive Authentication Failure from Subscriber */ +int vlr_subscr_rx_auth_fail(struct vlr_subscr *vsub, const uint8_t *auts) +{ + struct vlr_auth_resp_par par = {0}; + par.auts = auts; + + osmo_fsm_inst_dispatch(vsub->auth_fsm, VLR_AUTH_E_MS_AUTH_FAIL, &par); + return 0; +} + +/* MSC->VLR: Receive Authentication Response from MS + * \returns 1 in case of success, 0 in case of delay, -1 on auth error */ +int vlr_subscr_rx_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, uint8_t res_len) +{ + struct osmo_fsm_inst *auth_fi = vsub->auth_fsm; + struct vlr_auth_resp_par par; + + par.is_r99 = is_r99; + par.is_utran = is_utran; + par.res = res; + par.res_len = res_len; + osmo_fsm_inst_dispatch(auth_fi, VLR_AUTH_E_MS_AUTH_RESP, (void *) &par); + + return 0; +} + +/* MSC->VLR: Receive result of Ciphering Mode Command from MS */ +void vlr_subscr_rx_ciph_res(struct vlr_subscr *vsub, struct vlr_ciph_result *res) +{ + if (vsub->lu_fsm && vsub->lu_fsm->state == VLR_ULA_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->lu_fsm, VLR_ULA_E_CIPH_RES, res); + if (vsub->proc_arq_fsm + && vsub->proc_arq_fsm->state == PR_ARQ_S_WAIT_CIPH) + osmo_fsm_inst_dispatch(vsub->proc_arq_fsm, PR_ARQ_E_CIPH_RES, + res); +} + +/* Internal evaluation of requested ciphering mode. + * Send set_ciph_mode() to MSC depending on the ciph_mode argument. + * \param[in] vlr VLR instance. + * \param[in] fi Calling FSM instance, for logging. + * \param[in] msc_conn_ref MSC conn to send to. + * \param[in] ciph_mode Ciphering config, to decide whether to do ciphering. + * \returns 0 if no ciphering is needed or message was sent successfully, + * or a negative value if ciph_mode is invalid or sending failed. + */ +int vlr_set_ciph_mode(struct vlr_instance *vlr, + struct osmo_fsm_inst *fi, + void *msc_conn_ref, + enum vlr_ciph ciph_mode, + bool retrieve_imeisv) +{ + switch (ciph_mode) { + case VLR_CIPH_NONE: + return 0; + + case VLR_CIPH_A5_1: + case VLR_CIPH_A5_3: + return vlr->ops.set_ciph_mode(msc_conn_ref, + ciph_mode, + 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; + } +} + +void log_set_filter_vlr_subscr(struct log_target *target, + struct vlr_subscr *vlr_subscr) +{ + struct vlr_subscr **fsub = (void*)&target->filter_data[LOG_FLT_VLR_SUBSCR]; + + /* free the old data */ + if (*fsub) { + vlr_subscr_put(*fsub); + *fsub = NULL; + } + + if (vlr_subscr) { + target->filter_map |= (1 << LOG_FLT_VLR_SUBSCR); + *fsub = vlr_subscr_get(vlr_subscr); + } else + target->filter_map &= ~(1 << LOG_FLT_VLR_SUBSCR); +} diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c new file mode 100644 index 0000000..4e63e29 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.c @@ -0,0 +1,778 @@ +/* Osmocom Visitor Location Register (VLR): Access Request FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" +#include "vlr_access_req_fsm.h" + +#define S(x) (1 << (x)) + +/*********************************************************************** + * Process_Access_Request_VLR, TS 29.002 Chapter 25.4.2 + ***********************************************************************/ + +const struct value_string vlr_proc_arq_result_names[] = { + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_NONE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_SYSTEM_FAILURE), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNIDENT_SUBSCR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ROAMING_NOTALLOWED), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_ILLEGAL_EQUIP), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_UNKNOWN_ERROR), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_TIMEOUT), + OSMO_VALUE_STRING(VLR_PR_ARQ_RES_PASSED), + { 0, NULL } +}; + +static const struct value_string proc_arq_vlr_event_names[] = { + OSMO_VALUE_STRING(PR_ARQ_E_START), + OSMO_VALUE_STRING(PR_ARQ_E_ID_IMSI), + OSMO_VALUE_STRING(PR_ARQ_E_AUTH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_CIPH_RES), + OSMO_VALUE_STRING(PR_ARQ_E_UPD_LOC_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TRACE_RES), + OSMO_VALUE_STRING(PR_ARQ_E_IMEI_RES), + OSMO_VALUE_STRING(PR_ARQ_E_PRES_RES), + OSMO_VALUE_STRING(PR_ARQ_E_TMSI_ACK), + { 0, NULL } +}; + +struct proc_arq_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *ul_child_fsm; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + + enum vlr_parq_type type; + enum vlr_proc_arq_result result; + bool by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool implicitly_accepted_parq_by_ciphering_cmd; +}; + +static void assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + + vsub->msc_conn_ref = par->msc_conn_ref; + par->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(par->msc_conn_ref, par->vsub); +} + +#define proc_arq_fsm_done(fi, res) _proc_arq_fsm_done(fi, res, __FILE__, __LINE__) +static void _proc_arq_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_proc_arq_result res, + const char *file, int line) +{ + struct proc_arq_priv *par = fi->priv; + LOGPFSMSRC(fi, file, line, "proc_arq_fsm_done(%s)\n", + vlr_proc_arq_result_name(res)); + par->result = res; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_DONE, 0, 0); +} + +static void proc_arq_vlr_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct proc_arq_priv *par = fi->priv; + bool success; + int rc; + LOGPFSM(fi, "Process Access Request result: %s\n", + vlr_proc_arq_result_name(par->result)); + + success = (par->result == VLR_PR_ARQ_RES_PASSED); + + /* It would be logical to first dispatch the success event to the + * parent FSM, but that could start actions that send messages to the + * MS. Rather send the CM Service Accept message first and then signal + * success. Since messages are handled synchronously, the success event + * will be processed before we handle new incoming data from the MS. */ + + if (par->type == VLR_PR_ARQ_T_CM_SERV_REQ) { + if (success + && !par->implicitly_accepted_parq_by_ciphering_cmd) { + rc = par->vlr->ops.tx_cm_serv_acc(par->msc_conn_ref); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Accept\n"); + success = false; + } + } + if (!success) { + rc = par->vlr->ops.tx_cm_serv_rej(par->msc_conn_ref, + par->result); + if (rc) + LOGPFSML(fi, LOGL_ERROR, + "Failed to send CM Service Reject\n"); + } + } + + /* For VLR_PR_ARQ_T_PAGING_RESP, there is nothing to send. The conn_fsm + * will start handling pending paging transactions. */ + + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + success ? par->parent_event_success + : par->parent_event_failure, + par->parent_event_data); +} + +void proc_arq_vlr_cleanup(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause) +{ + struct proc_arq_priv *par = fi->priv; + if (par->vsub && par->vsub->proc_arq_fsm == fi) + par->vsub->proc_arq_fsm = NULL; +} + +static void _proc_arq_vlr_post_imei(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + /* TODO: Identity := IMSI */ + if (0 /* TODO: TMSI reallocation at access: vlr->cfg.alloc_tmsi_arq */) { + vlr_subscr_alloc_tmsi(vsub); + /* TODO: forward TMSI to MS, wait for TMSI + * REALLOC COMPLETE */ + /* TODO: Freeze old TMSI */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TMSI_ACK, 0, 0); + return; + } + + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static void _proc_arq_vlr_post_trace(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + /* Node 3 */ + if (0 /* IMEI check required */) { + /* Chck_IMEI_VLR */ + vlr->ops.tx_id_req(par->msc_conn_ref, GSM_MI_TYPE_IMEI); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CHECK_IMEI, + vlr_timer(vlr, 3270), 3270); + } else + _proc_arq_vlr_post_imei(fi); +} + +/* After Subscriber_Present_VLR */ +static void _proc_arq_vlr_post_pres(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + if (0 /* TODO: tracing required */) { + /* TODO: Trace_Subscriber_Activity_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TRACE_SUB, 0, 0); + } + _proc_arq_vlr_post_trace(fi); +} + +/* After Update_Location_Child_VLR */ +static void _proc_arq_vlr_node2_post_vlr(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!vsub->sub_dataconf_by_hlr_ind) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + if (0 /* roaming not allowed in LA */) { + /* Set User Error: Roaming not allowed in this LA */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ROAMING_NOTALLOWED); + return; + } + vsub->imsi_detached_flag = false; + if (vsub->ms_not_reachable_flag) { + /* Start Subscriber_Present_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_SUB_PRES, 0, 0); + par->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + PR_ARQ_E_PRES_RES); + return; + } + _proc_arq_vlr_post_pres(fi); +} + +static void _proc_arq_vlr_node2_post_ciph(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + vsub->conf_by_radio_contact_ind = true; + if (vsub->loc_conf_in_hlr_ind == false) { + /* start Update_Location_Child_VLR. WE use + * Update_HLR_VLR instead, the differences appear + * insignificant for now. */ + par->ul_child_fsm = upd_hlr_vlr_proc_start(fi, vsub, + PR_ARQ_E_UPD_LOC_RES); + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_UPD_LOC_CHILD, 0, 0); + return; + } + _proc_arq_vlr_node2_post_vlr(fi); +} + +static bool is_ciph_required(struct proc_arq_priv *par) +{ + return par->ciphering_required != VLR_CIPH_NONE; +} + +static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + if (!is_ciph_required(par)) { + _proc_arq_vlr_node2_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, par->msc_conn_ref, + par->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_SYSTEM_FAILURE); + return; + } + + par->implicitly_accepted_parq_by_ciphering_cmd = true; + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CIPH, 0, 0); +} + +static bool is_auth_required(struct proc_arq_priv *par) +{ + /* 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); +} + +/* after the IMSI is known */ +static void proc_arq_vlr_fn_post_imsi(struct osmo_fsm_inst *fi) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + /* TODO: Identity IMEI -> System Failure */ + if (is_auth_required(par)) { + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_AUTH, + 0, 0); + vsub->auth_fsm = auth_fsm_start(vsub, fi->log_level, fi, + PR_ARQ_E_AUTH_RES, + par->is_r99, + par->is_utran); + } else { + _proc_arq_vlr_node2(fi); + } +} + +static void proc_arq_vlr_fn_init(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub = NULL; + + OSMO_ASSERT(event == PR_ARQ_E_START); + + /* Obtain_Identity_VLR */ + if (!par->by_tmsi) { + /* IMSI was included */ + vsub = vlr_subscr_find_by_imsi(par->vlr, par->imsi); + } else { + /* TMSI was included */ + vsub = vlr_subscr_find_by_tmsi(par->vlr, par->tmsi); + } + if (vsub) { + if (vsub->proc_arq_fsm && fi != vsub->proc_arq_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "Another proc_arq_fsm is already" + " associated with subscr %s," + " terminating the other FSM.\n", + vlr_subscr_name(vsub)); + proc_arq_fsm_done(vsub->proc_arq_fsm, + VLR_PR_ARQ_RES_SYSTEM_FAILURE); + } + vsub->proc_arq_fsm = fi; + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); + return; + } + /* No VSUB could be resolved. What now? */ + + if (!par->by_tmsi) { + /* We couldn't find a subscriber even by IMSI, + * Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } else { + /* TMSI was included, are we permitted to use it? */ + if (vlr->cfg.parq_retrieve_imsi) { + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_OBTAIN_IMSI, + vlr_timer(vlr, 3270), 3270); + return; + } else { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + } +} + +/* ID REQ(IMSI) has returned */ +static void proc_arq_vlr_fn_w_obt_imsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_instance *vlr = par->vlr; + struct vlr_subscr *vsub; + + OSMO_ASSERT(event == PR_ARQ_E_ID_IMSI); + + vsub = vlr_subscr_find_by_imsi(vlr, par->imsi); + if (!vsub) { + /* Set User Error: Unidentified Subscriber */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + assoc_par_with_subscr(fi, vsub); + proc_arq_vlr_fn_post_imsi(fi); + vlr_subscr_put(vsub); +} + +/* Authenticate_VLR has completed */ +static void proc_arq_vlr_fn_w_auth(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + enum vlr_auth_fsm_result res; + enum vlr_proc_arq_result ret; + + OSMO_ASSERT(event == PR_ARQ_E_AUTH_RES); + + res = data ? *(enum vlr_auth_fsm_result*)data : -1; + LOGPFSM(fi, "got %s\n", vlr_auth_fsm_result_name(res)); + + switch (res) { + case VLR_AUTH_RES_PASSED: + /* Node 2 */ + _proc_arq_vlr_node2(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* Error */ + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* Set User Error: Unidentified Subscriber */ + ret = VLR_PR_ARQ_RES_UNIDENT_SUBSCR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* Set User Error: Illegal Subscriber */ + ret = VLR_PR_ARQ_RES_ILLEGAL_SUBSCR; + break; + case VLR_AUTH_RES_PROC_ERR: + /* Set User Error: System failure */ + ret = VLR_PR_ARQ_RES_SYSTEM_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "Unexpected vlr_auth_fsm_result value: %d (data=%p)\n", res, data); + ret = VLR_PR_ARQ_RES_UNKNOWN_ERROR; + break; + } + + /* send process_access_req response to caller, enter error state */ + proc_arq_fsm_done(fi, ret); +} + +static void proc_arq_vlr_fn_w_ciph(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct proc_arq_priv *par = fi->priv; + struct vlr_subscr *vsub = par->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == PR_ARQ_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR); + return; + } + + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + _proc_arq_vlr_node2_post_ciph(fi); +} + +/* Update_Location_Child_VLR has completed */ +static void proc_arq_vlr_fn_w_upd_loc(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_UPD_LOC_RES); + + _proc_arq_vlr_node2_post_vlr(fi); +} + +/* Subscriber_Present_VLR has completed */ +static void proc_arq_vlr_fn_w_pres(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_PRES_RES); + + _proc_arq_vlr_post_pres(fi); +} + +static void proc_arq_vlr_fn_w_trace(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TRACE_RES); + + _proc_arq_vlr_post_trace(fi); +} + +/* we have received the ID RESPONSE (IMEI) */ +static void proc_arq_vlr_fn_w_imei(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_IMEI_RES); + + _proc_arq_vlr_post_imei(fi); +} + +/* MSC tells us that MS has acknowleded TMSI re-allocation */ +static void proc_arq_vlr_fn_w_tmsi(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + OSMO_ASSERT(event == PR_ARQ_E_TMSI_ACK); + + /* FIXME: check confirmation? unfreeze? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_PASSED); +} + +static const struct osmo_fsm_state proc_arq_vlr_states[] = { + [PR_ARQ_S_INIT] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_INIT), + .in_event_mask = S(PR_ARQ_E_START), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_OBTAIN_IMSI) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_init, + }, + [PR_ARQ_S_WAIT_OBTAIN_IMSI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_OBTAIN_IMSI), + .in_event_mask = S(PR_ARQ_E_ID_IMSI), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_AUTH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_obt_imsi, + }, + [PR_ARQ_S_WAIT_AUTH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_AUTH), + .in_event_mask = S(PR_ARQ_E_AUTH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CIPH) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_auth, + }, + [PR_ARQ_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CIPH), + .in_event_mask = S(PR_ARQ_E_CIPH_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_UPD_LOC_CHILD) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_ciph, + }, + [PR_ARQ_S_WAIT_UPD_LOC_CHILD] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_UPD_LOC_CHILD), + .in_event_mask = S(PR_ARQ_E_UPD_LOC_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_SUB_PRES) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_upd_loc, + }, + [PR_ARQ_S_WAIT_SUB_PRES] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_SUB_PRES), + .in_event_mask = S(PR_ARQ_E_PRES_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TRACE_SUB) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_pres, + }, + [PR_ARQ_S_WAIT_TRACE_SUB] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TRACE_SUB), + .in_event_mask = S(PR_ARQ_E_TRACE_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_CHECK_IMEI) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_trace, + }, + [PR_ARQ_S_WAIT_CHECK_IMEI] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_CHECK_IMEI), + .in_event_mask = S(PR_ARQ_E_IMEI_RES), + .out_state_mask = S(PR_ARQ_S_DONE) | + S(PR_ARQ_S_WAIT_TMSI_ACK), + .action = proc_arq_vlr_fn_w_imei, + }, + [PR_ARQ_S_WAIT_TMSI_ACK] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_WAIT_TMSI_ACK), + .in_event_mask = S(PR_ARQ_E_TMSI_ACK), + .out_state_mask = S(PR_ARQ_S_DONE), + .action = proc_arq_vlr_fn_w_tmsi, + }, + [PR_ARQ_S_DONE] = { + .name = OSMO_STRINGIFY(PR_ARQ_S_DONE), + .onenter = proc_arq_vlr_dispatch_result, + }, +}; + +static struct osmo_fsm proc_arq_vlr_fsm = { + .name = "Process_Access_Request_VLR", + .states = proc_arq_vlr_states, + .num_states = ARRAY_SIZE(proc_arq_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = proc_arq_vlr_event_names, + .cleanup = proc_arq_vlr_cleanup, +}; + +void +vlr_proc_acc_req(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + 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 is_r99, bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct proc_arq_priv *par; + char mi_string[GSM48_MI_SIZE]; + uint8_t mi_type; + + fi = osmo_fsm_inst_alloc_child(&proc_arq_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return; + + par = talloc_zero(fi, struct proc_arq_priv); + fi->priv = par; + par->vlr = vlr; + par->msc_conn_ref = msc_conn_ref; + par->type = type; + par->lai = *lai; + par->parent_event_success = parent_event_success; + par->parent_event_failure = parent_event_failure; + par->parent_event_data = parent_event_data; + par->authentication_required = authentication_required; + par->ciphering_required = ciphering_required; + par->is_r99 = is_r99; + par->is_utran = is_utran; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi_lv+1, mi_lv[0]); + mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); + par->imsi[sizeof(par->imsi)-1] = '\0'; + par->by_tmsi = false; + break; + case GSM_MI_TYPE_TMSI: + par->by_tmsi = true; + par->tmsi = osmo_load32be(mi_lv+2); + break; + case GSM_MI_TYPE_IMEI: + /* TODO: IMEI (emergency call) */ + default: + /* FIXME: directly send reject? */ + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); + return; + } + + osmo_fsm_inst_dispatch(fi, PR_ARQ_E_START, NULL); +} + +/* Gracefully terminate an FSM created by vlr_proc_acc_req() in case of + * external timeout (i.e. from MSC). */ +void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == PR_ARQ_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_TIMEOUT); +} + + +#if 0 +/*********************************************************************** + * Update_Location_Child_VLR, TS 29.002 Chapter 25.4.4 + ***********************************************************************/ + +enum upd_loc_child_vlr_state { + ULC_S_IDLE, + ULC_S_WAIT_HLR_RESP, + ULC_S_DONE, +}; + +enum upd_loc_child_vlr_event { + ULC_E_START, +}; + +static const struct value_string upd_loc_child_vlr_event_names[] = { + { ULC_E_START, "START" }, + { 0, NULL } +}; + +static void upd_loc_child_f_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + OSMO_ASSERT(event == ULC_E_START); + + /* send update location */ +} + +static void upd_loc_child_f_w_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ +} + +static const struct osmo_fsm_state upd_loc_child_vlr_states[] = { + [ULC_S_IDLE] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_WAIT_HLR_RESP) | + S(ULC_S_DONE), + .name = "IDLE", + .action = upd_loc_child_f_idle, + }, + [ULC_S_WAIT_HLR_RESP] = { + .in_event_mask = , + .out_state_mask = S(ULC_S_DONE), + .name = "WAIT-HLR-RESP", + .action = upd_loc_child_f_w_hlr, + }, + [ULC_S_DONE] = { + .name = "DONE", + }, +}; + +static struct osmo_fsm upd_loc_child_vlr_fsm = { + .name = "Update_Location_Child_VLR", + .states = upd_loc_child_vlr_states, + .num_states = ARRAY_SIZE(upd_loc_child_vlr_states), + .log_subsys = DVLR, + .event_names = upd_loc_child_vlr_event_names, +}; +#endif + +void vlr_parq_fsm_init(void) +{ + //osmo_fsm_register(&upd_loc_child_vlr_fsm); + osmo_fsm_register(&proc_arq_vlr_fsm); +} diff --git a/src/libvlr/vlr_access_req_fsm.h b/src/libvlr/vlr_access_req_fsm.h new file mode 100644 index 0000000..8386da6 --- /dev/null +++ b/src/libvlr/vlr_access_req_fsm.h @@ -0,0 +1,17 @@ +#pragma once + +enum proc_arq_vlr_state { + PR_ARQ_S_INIT, + /* Waiting for Obtain_Identity_VLR (IMSI) result */ + PR_ARQ_S_WAIT_OBTAIN_IMSI, + /* Waiting for Authenticate_VLR result */ + PR_ARQ_S_WAIT_AUTH, + PR_ARQ_S_WAIT_CIPH, + PR_ARQ_S_WAIT_UPD_LOC_CHILD, + PR_ARQ_S_WAIT_SUB_PRES, + PR_ARQ_S_WAIT_TRACE_SUB, + PR_ARQ_S_WAIT_CHECK_IMEI, + PR_ARQ_S_WAIT_TMSI_ACK, + PR_ARQ_S_WAIT_CECK_CONF, + PR_ARQ_S_DONE, +}; diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c new file mode 100644 index 0000000..0eb86e7 --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.c @@ -0,0 +1,605 @@ +/* Osmocom Visitor Location Register (VLR) Autentication FSM */ + +/* (C) 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 +#include +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" + +#define S(x) (1 << (x)) + +static const struct value_string fsm_auth_event_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_E_START), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_NACK), + OSMO_VALUE_STRING(VLR_AUTH_E_HLR_SAI_ABORT), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_RESP), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_AUTH_FAIL), + OSMO_VALUE_STRING(VLR_AUTH_E_MS_ID_IMSI), + { 0, NULL } +}; + +const struct value_string vlr_auth_fsm_result_names[] = { + OSMO_VALUE_STRING(VLR_AUTH_RES_ABORTED), + OSMO_VALUE_STRING(VLR_AUTH_RES_UNKNOWN_SUBSCR), + OSMO_VALUE_STRING(VLR_AUTH_RES_PROC_ERR), + OSMO_VALUE_STRING(VLR_AUTH_RES_AUTH_FAILED), + OSMO_VALUE_STRING(VLR_AUTH_RES_PASSED), + {0, NULL} +}; + +/* private state of the auth_fsm_instance */ +struct auth_fsm_priv { + struct vlr_subscr *vsub; + bool by_imsi; + bool is_r99; + bool is_utran; + bool auth_requested; + + int auth_tuple_max_use_count; /* see vlr->cfg instead */ +}; + +/*********************************************************************** + * Utility functions + ***********************************************************************/ + +/* Always use either vlr_subscr_get_auth_tuple() or vlr_subscr_has_auth_tuple() + * instead, to ensure proper use count. + * Return an auth tuple with the lowest use_count among the auth tuples. If + * max_use_count >= 0, return NULL if all available auth tuples have a use + * count > max_use_count. If max_use_count is negative, return a currently + * least used auth tuple without enforcing a maximum use count. If there are + * no auth tuples, return NULL. + */ +static struct gsm_auth_tuple * +_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + unsigned int count; + unsigned int idx; + struct gsm_auth_tuple *at = NULL; + unsigned int key_seq = GSM_KEY_SEQ_INVAL; + + if (!vsub) + return NULL; + + if (vsub->last_tuple) + key_seq = vsub->last_tuple->key_seq; + + if (key_seq == GSM_KEY_SEQ_INVAL) + /* Start with 0 after increment modulo array size */ + idx = ARRAY_SIZE(vsub->auth_tuples) - 1; + else + idx = key_seq; + + for (count = ARRAY_SIZE(vsub->auth_tuples); count > 0; count--) { + idx = (idx + 1) % ARRAY_SIZE(vsub->auth_tuples); + + if (vsub->auth_tuples[idx].key_seq == GSM_KEY_SEQ_INVAL) + continue; + + if (!at || vsub->auth_tuples[idx].use_count < at->use_count) + at = &vsub->auth_tuples[idx]; + } + + if (!at || (max_use_count >= 0 && at->use_count > max_use_count)) + return NULL; + + return at; +} + +/* Return an auth tuple and increment its use count. */ +static struct gsm_auth_tuple * +vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +{ + struct gsm_auth_tuple *at = _vlr_subscr_next_auth_tuple(vsub, + max_use_count); + if (!at) + return NULL; + at->use_count++; + return at; +} + +/* Return whether an auth tuple with the given max_use_count is available. */ +static bool vlr_subscr_has_auth_tuple(struct vlr_subscr *vsub, + int max_use_count) +{ + return _vlr_subscr_next_auth_tuple(vsub, max_use_count) != NULL; +} + +static bool check_auth_resp(struct vlr_subscr *vsub, bool is_r99, + bool is_utran, const uint8_t *res, + uint8_t res_len) +{ + struct gsm_auth_tuple *at = vsub->last_tuple; + struct osmo_auth_vector *vec = &at->vec; + bool check_umts; + OSMO_ASSERT(at); + + LOGVSUBP(LOGL_DEBUG, vsub, "received res: %s\n", + osmo_hexdump(res, res_len)); + + /* RES must be present and at least 32bit */ + if (!res || res_len < sizeof(vec->sres)) { + LOGVSUBP(LOGL_NOTICE, vsub, "AUTH RES missing or too short " + "(%u)\n", res_len); + goto out_false; + } + + check_umts = false; + if (is_r99 && (vec->auth_types & OSMO_AUTH_TYPE_UMTS)) { + check_umts = true; + /* We have a R99 capable UE and have a UMTS AKA capable USIM. + * However, the ME may still choose to only perform GSM AKA, as + * long as the bearer is GERAN */ + if (res_len != vec->res_len) { + if (is_utran) { + LOGVSUBP(LOGL_NOTICE, vsub, + "AUTH via UTRAN but " + "res_len(%u) != vec->res_len(%u)\n", + res_len, vec->res_len); + goto out_false; + } + check_umts = false; + } + } + + if (check_umts) { + if (res_len != vec->res_len + || memcmp(res, vec->res, res_len)) { + LOGVSUBP(LOGL_INFO, vsub, "UMTS AUTH failure:" + " mismatching res (expected res=%s)\n", + osmo_hexdump(vec->res, vec->res_len)); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established UMTS security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_UMTS; + return true; + } else { + if (res_len != sizeof(vec->sres) + || memcmp(res, vec->sres, sizeof(vec->sres))) { + LOGVSUBP(LOGL_INFO, vsub, "GSM AUTH failure:" + " mismatching sres (expected sres=%s)\n", + osmo_hexdump(vec->sres, sizeof(vec->sres))); + goto out_false; + } + + LOGVSUBP(LOGL_INFO, vsub, "AUTH established GSM security" + " context\n"); + vsub->sec_ctx = VLR_SEC_CTX_GSM; + return true; + } + +out_false: + vsub->sec_ctx = VLR_SEC_CTX_NONE; + return false; +} + +static void auth_fsm_onenter_failed(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + /* If authentication hasn't even started, e.g. the HLR sent no auth + * info, then we also don't need to tell the HLR about an auth failure. + */ + if (afp->auth_requested) + vlr_subscr_tx_auth_fail_rep(vsub); +} + +static bool is_umts_auth(struct auth_fsm_priv *afp, + uint32_t auth_types) +{ + if (!afp->is_r99) + return false; + if (!(auth_types & OSMO_AUTH_TYPE_UMTS)) + return false; + return true; +} + +/* Terminate the Auth FSM Instance and notify parent */ +static void auth_fsm_term(struct osmo_fsm_inst *fi, enum vlr_auth_fsm_result res) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + LOGPFSM(fi, "Authentication terminating with result %s\n", + vlr_auth_fsm_result_name(res)); + + /* Do one final state transition (mostly for logging purpose) */ + if (res == VLR_AUTH_RES_PASSED) + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTHENTICATED, 0, 0); + else + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_AUTH_FAILED, 0, 0); + + /* return the result to the parent FSM */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, &res); + vsub->auth_fsm = NULL; +} + +/* back-end function transmitting authentication. Caller ensures we have valid + * tuple */ +static int _vlr_subscr_authenticate(struct osmo_fsm_inst *fi) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct gsm_auth_tuple *at; + + /* Caller ensures we have vectors available */ + at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_use_count); + if (!at) { + LOGPFSML(fi, LOGL_ERROR, "A previous check ensured that an" + " auth tuple was available, but now there is in fact" + " none.\n"); + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return -1; + } + + LOGPFSM(fi, "got auth tuple: use_count=%d key_seq=%d\n", + at->use_count, at->key_seq); + + OSMO_ASSERT(at); + + /* Transmit auth req to subscriber */ + afp->auth_requested = true; + vsub->last_tuple = at; + vsub->vlr->ops.tx_auth_req(vsub->msc_conn_ref, at, + is_umts_auth(afp, at->vec.auth_types)); + return 0; +} + +/*********************************************************************** + * FSM State Action functions + ***********************************************************************/ + +/* Initial State of TS 23.018 AUT_VLR */ +static void auth_fsm_needs_auth(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + + OSMO_ASSERT(event == VLR_AUTH_E_START); + + /* Start off with the default max_use_count, possibly change that if we + * need to re-use an old tuple. */ + afp->auth_tuple_max_use_count = vsub->vlr->cfg.auth_tuple_max_use_count; + + /* Check if we have vectors available */ + if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_use_count)) { + /* Obtain_Authentication_Sets_VLR */ + vlr_subscr_req_sai(vsub, NULL, NULL); + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, + GSM_29002_TIMER_M, 0); + } else { + /* go straight ahead with sending auth request */ + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); + } +} + +/* Waiting for Authentication Info from HLR */ +static void auth_fsm_wait_ai(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + if (event == VLR_AUTH_E_HLR_SAI_NACK) + LOGPFSM(fi, "GSUP: rx Auth Info Error cause: %d: %s\n", + gsup->cause, + get_value_string(gsm48_gmm_cause_names, gsup->cause)); + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) + || (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) + || (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + if (vsub->vlr->cfg.auth_reuse_old_sets_on_error + && vlr_subscr_has_auth_tuple(vsub, -1)) { + /* To re-use an old tuple, disable the max_use_count + * constraint. */ + afp->auth_tuple_max_use_count = -1; + goto pass; + } + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + return; + } + + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for Authentication Response from MS */ +static void auth_fsm_wait_auth_resp(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_instance *vlr = vsub->vlr; + struct vlr_auth_resp_par *par = data; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + } + } else { + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + if (par->auts) { + /* First failure, start re-sync attempt */ + vlr_subscr_req_sai(vsub, par->auts, + vsub->last_tuple->vec.rand); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC, + GSM_29002_TIMER_M, 0); + } else + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* Waiting for Authentication Info from HLR (resync case) */ +static void auth_fsm_wait_ai_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct osmo_gsup_message *gsup = data; + + /* We are in what corresponds to the + * Wait_For_Authentication_Sets state of TS 23.018 OAS_VLR */ + if ((event == VLR_AUTH_E_HLR_SAI_ACK && !gsup->num_auth_vectors) || + (event == VLR_AUTH_E_HLR_SAI_NACK && + gsup->cause != GMM_CAUSE_IMSI_UNKNOWN) || + (event == VLR_AUTH_E_HLR_SAI_ABORT)) { + /* result = procedure error */ + auth_fsm_term(fi, VLR_AUTH_RES_PROC_ERR); + } + switch (event) { + case VLR_AUTH_E_HLR_SAI_ACK: + vlr_subscr_update_tuples(vsub, gsup); + goto pass; + break; + case VLR_AUTH_E_HLR_SAI_NACK: + auth_fsm_term(fi, + gsup->cause == GMM_CAUSE_IMSI_UNKNOWN? + VLR_AUTH_RES_UNKNOWN_SUBSCR + : VLR_AUTH_RES_PROC_ERR); + break; + } + + return; +pass: + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_WAIT_RESP_RESYNC, + vlr_timer(vsub->vlr, 3260), 3260); + _vlr_subscr_authenticate(fi); +} + +/* Waiting for AUTH RESP from MS (re-sync case) */ +static void auth_fsm_wait_auth_resp_resync(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + struct vlr_auth_resp_par *par = data; + struct vlr_instance *vlr = vsub->vlr; + int rc; + + switch (event) { + case VLR_AUTH_E_MS_AUTH_RESP: + rc = check_auth_resp(vsub, par->is_r99, par->is_utran, + par->res, par->res_len); + if (rc == false) { + if (!afp->by_imsi) { + vlr->ops.tx_id_req(vsub->msc_conn_ref, + GSM_MI_TYPE_IMSI); + osmo_fsm_inst_state_chg(fi, + VLR_SUB_AS_WAIT_ID_IMSI, + vlr_timer(vlr, 3270), 3270); + } else { + /* Result = Aborted */ + auth_fsm_term(fi, VLR_AUTH_RES_ABORTED); + } + } else { + /* Result = Pass */ + auth_fsm_term(fi, VLR_AUTH_RES_PASSED); + } + break; + case VLR_AUTH_E_MS_AUTH_FAIL: + /* Second failure: Result = Fail */ + auth_fsm_term(fi, VLR_AUTH_RES_AUTH_FAILED); + break; + } +} + +/* AUT_VLR waiting for Obtain_IMSI_VLR result */ +static void auth_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct auth_fsm_priv *afp = fi->priv; + struct vlr_subscr *vsub = afp->vsub; + const char *mi_string = data; + + switch (event) { + case VLR_AUTH_E_MS_ID_IMSI: + if (vsub->imsi[0] + && !vlr_subscr_matches_imsi(vsub, mi_string)) { + LOGVSUBP(LOGL_ERROR, vsub, "IMSI in ID RESP differs:" + " %s\n", mi_string); + } else { + strncpy(vsub->imsi, mi_string, sizeof(vsub->imsi)); + vsub->imsi[sizeof(vsub->imsi)-1] = '\0'; + } + /* retry with identity=IMSI */ + afp->by_imsi = true; + osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH, 0, 0); + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + break; + } +} + +static const struct osmo_fsm_state auth_fsm_states[] = { + [VLR_SUB_AS_NEEDS_AUTH] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH), + .in_event_mask = S(VLR_AUTH_E_START), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_needs_auth, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_AI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_AI), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP), + .action = auth_fsm_wait_ai, + }, + [VLR_SUB_AS_WAIT_RESP] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_WAIT_ID_IMSI) | + S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED) | + S(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .action = auth_fsm_wait_auth_resp, + }, + [VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_NEEDS_AUTH_WAIT_SAI_RESYNC), + .in_event_mask = S(VLR_AUTH_E_HLR_SAI_ACK) | + S(VLR_AUTH_E_HLR_SAI_NACK), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_WAIT_RESP_RESYNC), + .action = auth_fsm_wait_ai_resync, + }, + [VLR_SUB_AS_WAIT_RESP_RESYNC] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_RESP_RESYNC), + .in_event_mask = S(VLR_AUTH_E_MS_AUTH_RESP) | + S(VLR_AUTH_E_MS_AUTH_FAIL), + .out_state_mask = S(VLR_SUB_AS_AUTH_FAILED) | + S(VLR_SUB_AS_AUTHENTICATED), + .action = auth_fsm_wait_auth_resp_resync, + }, + [VLR_SUB_AS_WAIT_ID_IMSI] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_WAIT_ID_IMSI), + .in_event_mask = S(VLR_AUTH_E_MS_ID_IMSI), + .out_state_mask = S(VLR_SUB_AS_NEEDS_AUTH), + .action = auth_fsm_wait_imsi, + }, + [VLR_SUB_AS_AUTHENTICATED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTHENTICATED), + .in_event_mask = 0, + .out_state_mask = 0, + }, + [VLR_SUB_AS_AUTH_FAILED] = { + .name = OSMO_STRINGIFY(VLR_SUB_AS_AUTH_FAILED), + .in_event_mask = 0, + .out_state_mask = 0, + .onenter = auth_fsm_onenter_failed, + }, +}; + +struct osmo_fsm vlr_auth_fsm = { + .name = "VLR_Authenticate", + .states = auth_fsm_states, + .num_states = ARRAY_SIZE(auth_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_auth_event_names, +}; + +/*********************************************************************** + * User API (for SGSN/MSC code) + ***********************************************************************/ + +/* MSC->VLR: Start Procedure Authenticate_VLR (TS 23.012 Ch. 4.1.2.2) */ +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran) +{ + struct osmo_fsm_inst *fi; + struct auth_fsm_priv *afp; + + fi = osmo_fsm_inst_alloc_child(&vlr_auth_fsm, parent, + parent_term_event); + + + afp = talloc_zero(fi, struct auth_fsm_priv); + if (!afp) { + osmo_fsm_inst_dispatch(parent, parent_term_event, 0); + return NULL; + } + + afp->vsub = vsub; + if (vsub->imsi[0]) + afp->by_imsi = true; + afp->is_r99 = is_r99; + afp->is_utran = is_utran; + fi->priv = afp; + vsub->auth_fsm = fi; + + osmo_fsm_inst_dispatch(fi, VLR_AUTH_E_START, NULL); + + return fi; +} diff --git a/src/libvlr/vlr_auth_fsm.h b/src/libvlr/vlr_auth_fsm.h new file mode 100644 index 0000000..226435f --- /dev/null +++ b/src/libvlr/vlr_auth_fsm.h @@ -0,0 +1,52 @@ +#pragma once + +#include + +/* Parameters to VLR_AUTH_E_MS_AUTH_RESP */ +struct vlr_auth_resp_par { + bool is_r99; + bool is_utran; + const uint8_t *res; + unsigned int res_len; + const uint8_t *auts; +}; + +/* Result communicated back to parent FMS */ +enum vlr_auth_fsm_result { + VLR_AUTH_RES_ABORTED, + VLR_AUTH_RES_UNKNOWN_SUBSCR, + VLR_AUTH_RES_PROC_ERR, + VLR_AUTH_RES_AUTH_FAILED, + VLR_AUTH_RES_PASSED, +}; + +extern const struct value_string vlr_auth_fsm_result_names[]; +static inline const char *vlr_auth_fsm_result_name(enum vlr_auth_fsm_result val) +{ + return get_value_string(vlr_auth_fsm_result_names, val); +} + +enum vlr_fsm_auth_event { + VLR_AUTH_E_START, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo ACK from HLR */ + VLR_AUTH_E_HLR_SAI_ACK, + /* TS 23.018 OAS_VLR1(2): SendAuthInfo NACK from HLR */ + VLR_AUTH_E_HLR_SAI_NACK, + /* FIXME: merge with NACK? */ + VLR_AUTH_E_HLR_SAI_ABORT, + /* Authentication Response from MS */ + VLR_AUTH_E_MS_AUTH_RESP, + /* Authentication Failure from MS */ + VLR_AUTH_E_MS_AUTH_FAIL, + /* Identity Response (IMSI) from MS */ + VLR_AUTH_E_MS_ID_IMSI, +}; + +struct osmo_fsm vlr_auth_fsm; + +struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, + uint32_t log_level, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + bool is_r99, + bool is_utran); diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h new file mode 100644 index 0000000..0e63c7e --- /dev/null +++ b/src/libvlr/vlr_core.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#define LOGGSUPP(level, gsup, fmt, args...) \ + LOGP(DVLR, level, "GSUP(%s) " fmt, \ + (gsup)->imsi, \ + ## args) + +#define LOGVSUBP(level, vsub, fmt, args...) \ + LOGP(DVLR, level, "SUBSCR(%s) " fmt, \ + vlr_subscr_name(vsub), ## args) + + +const char *vlr_subscr_name(struct vlr_subscr *vsub); +int vlr_subscr_req_lu(struct vlr_subscr *vsub, bool is_ps); +int vlr_subscr_req_sai(struct vlr_subscr *vsub, const uint8_t *auts, + const uint8_t *auts_rand); +struct vlr_subscr *vlr_subscr_alloc(struct vlr_instance *vlr); +void vlr_subscr_update_tuples(struct vlr_subscr *vsub, + const struct osmo_gsup_message *gsup); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c new file mode 100644 index 0000000..d32659f --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.c @@ -0,0 +1,1424 @@ +/* Osmocom Visitor Location Register (VLR): Location Update FSMs */ + +/* (C) 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 +#include +#include +#include + +#include "vlr_core.h" +#include "vlr_auth_fsm.h" +#include "vlr_lu_fsm.h" + +#define S(x) (1 << (x)) + +#define LU_TIMEOUT_LONG 30 + +enum vlr_fsm_result { + VLR_FSM_RESULT_NONE, + VLR_FSM_RESULT_SUCCESS, + VLR_FSM_RESULT_FAILURE, +}; + + +/*********************************************************************** + * Update_HLR_VLR, TS 23.012 Chapter 4.1.2.4 + ***********************************************************************/ + +enum upd_hlr_vlr_state { + UPD_HLR_VLR_S_INIT, + UPD_HLR_VLR_S_WAIT_FOR_DATA, + UPD_HLR_VLR_S_DONE, +}; + +enum upd_hlr_vlr_evt { + UPD_HLR_VLR_E_START, + UPD_HLR_VLR_E_INS_SUB_DATA, + UPD_HLR_VLR_E_ACT_TRACE_MODE, + UPD_HLR_VLR_E_FW_CHECK_SS_IND, + UPD_HLR_VLR_E_UPD_LOC_ACK, + UPD_HLR_VLR_E_UPD_LOC_NACK, +}; + +static const struct value_string upd_hlr_vlr_event_names[] = { + OSMO_VALUE_STRING(UPD_HLR_VLR_E_START), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_INS_SUB_DATA), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_ACT_TRACE_MODE), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_FW_CHECK_SS_IND), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_ACK), + OSMO_VALUE_STRING(UPD_HLR_VLR_E_UPD_LOC_NACK), + { 0, NULL } +}; + +static void upd_hlr_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + OSMO_ASSERT(event == UPD_HLR_VLR_E_START); + + /* Send UpdateLocation to HLR */ + vlr_subscr_req_lu(vsub, vsub->vlr->cfg.is_ps); + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_WAIT_FOR_DATA, + LU_TIMEOUT_LONG, 0); +} + +static void upd_hlr_vlr_fsm_wait_data(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case UPD_HLR_VLR_E_INS_SUB_DATA: + /* FIXME: Insert_Subscr_Data_VLR */ + break; + case UPD_HLR_VLR_E_ACT_TRACE_MODE: + /* TODO: Activate_Tracing_VLR */ + break; + case UPD_HLR_VLR_E_FW_CHECK_SS_IND: + /* TODO: Forward Check SS Ind to MSC */ + break; + case UPD_HLR_VLR_E_UPD_LOC_ACK: + /* Inside Update_HLR_VLR after UpdateLocationAck */ + vsub->sub_dataconf_by_hlr_ind = true; + vsub->loc_conf_in_hlr_ind = true; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + case UPD_HLR_VLR_E_UPD_LOC_NACK: + /* Inside Update_HLR_VLR after UpdateLocationNack */ + /* TODO: Check_User_Error_In_Serving_Network_Entity */ + vsub->sub_dataconf_by_hlr_ind = false; + vsub->loc_conf_in_hlr_ind = false; + osmo_fsm_inst_state_chg(fi, UPD_HLR_VLR_S_DONE, 0, 0); + /* Data is a pointer to a gsm48_gmm_cause which we + * simply pass through */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, data); + break; + } +} + +static const struct osmo_fsm_state upd_hlr_vlr_states[] = { + [UPD_HLR_VLR_S_INIT] = { + .in_event_mask = S(UPD_HLR_VLR_E_START), + .out_state_mask = S(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_INIT), + .action = upd_hlr_vlr_fsm_init, + }, + [UPD_HLR_VLR_S_WAIT_FOR_DATA] = { + .in_event_mask = S(UPD_HLR_VLR_E_INS_SUB_DATA) | + S(UPD_HLR_VLR_E_ACT_TRACE_MODE) | + S(UPD_HLR_VLR_E_FW_CHECK_SS_IND) | + S(UPD_HLR_VLR_E_UPD_LOC_ACK) | + S(UPD_HLR_VLR_E_UPD_LOC_NACK), + .out_state_mask = S(UPD_HLR_VLR_S_DONE), + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_WAIT_FOR_DATA), + .action = upd_hlr_vlr_fsm_wait_data, + }, + [UPD_HLR_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(UPD_HLR_VLR_S_DONE), + }, +}; + +static struct osmo_fsm upd_hlr_vlr_fsm = { + .name = "upd_hlr_vlr_fsm", + .states = upd_hlr_vlr_states, + .num_states = ARRAY_SIZE(upd_hlr_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = upd_hlr_vlr_event_names, +}; + +struct osmo_fsm_inst * +upd_hlr_vlr_proc_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t parent_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&upd_hlr_vlr_fsm, parent, + parent_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, UPD_HLR_VLR_E_START, NULL); + + return fi; +} + + +/*********************************************************************** + * Subscriber_Present_VLR, TS 29.002 Chapter 25.10.1 + ***********************************************************************/ + +enum sub_pres_vlr_state { + SUB_PRES_VLR_S_INIT, + SUB_PRES_VLR_S_WAIT_FOR_HLR, + SUB_PRES_VLR_S_DONE, +}; + +enum sub_pres_vlr_event { + SUB_PRES_VLR_E_START, + SUB_PRES_VLR_E_READY_SM_CNF, + SUB_PRES_VLR_E_READY_SM_ERR, +}; + +static const struct value_string sub_pres_vlr_event_names[] = { + OSMO_VALUE_STRING(SUB_PRES_VLR_E_START), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_CNF), + OSMO_VALUE_STRING(SUB_PRES_VLR_E_READY_SM_ERR), + { 0, NULL } +}; + +static void sub_pres_vlr_fsm_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + OSMO_ASSERT(event == SUB_PRES_VLR_E_START); + + if (!vsub->ms_not_reachable_flag) { + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + return; + } + /* FIXME: Send READY_FOR_SM via GSUP */ + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_WAIT_FOR_HLR, + LU_TIMEOUT_LONG, 0); +} + +static void sub_pres_vlr_fsm_wait_hlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct vlr_subscr *vsub = fi->priv; + + switch (event) { + case SUB_PRES_VLR_E_READY_SM_CNF: + vsub->ms_not_reachable_flag = false; + break; + case SUB_PRES_VLR_E_READY_SM_ERR: + break; + } + osmo_fsm_inst_state_chg(fi, SUB_PRES_VLR_S_DONE, 0, 0); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +static const struct osmo_fsm_state sub_pres_vlr_states[] = { + [SUB_PRES_VLR_S_INIT] = { + .in_event_mask = S(SUB_PRES_VLR_E_START), + .out_state_mask = S(SUB_PRES_VLR_S_WAIT_FOR_HLR) | + S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_INIT), + .action = sub_pres_vlr_fsm_init, + }, + [SUB_PRES_VLR_S_WAIT_FOR_HLR] = { + .in_event_mask = S(SUB_PRES_VLR_E_READY_SM_CNF) | + S(SUB_PRES_VLR_E_READY_SM_ERR), + .out_state_mask = S(SUB_PRES_VLR_S_DONE), + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_WAIT_FOR_HLR), + .action = sub_pres_vlr_fsm_wait_hlr, + }, + [SUB_PRES_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(SUB_PRES_VLR_S_DONE), + }, +}; + +static struct osmo_fsm sub_pres_vlr_fsm = { + .name = "sub_pres_vlr_fsm", + .states = sub_pres_vlr_states, + .num_states = ARRAY_SIZE(sub_pres_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = sub_pres_vlr_event_names, +}; + +struct osmo_fsm_inst *sub_pres_vlr_fsm_start(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + uint32_t term_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc_child(&sub_pres_vlr_fsm, parent, + term_event); + if (!fi) + return NULL; + + fi->priv = vsub; + osmo_fsm_inst_dispatch(fi, SUB_PRES_VLR_E_START, NULL); + + return fi; +} + +/*********************************************************************** + * Location_Update_Completion_VLR, TS 23.012 Chapter 4.1.2.3 + ***********************************************************************/ + +enum lu_compl_vlr_state { + LU_COMPL_VLR_S_INIT, + LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_COMPL_VLR_S_WAIT_IMEI, + LU_COMPL_VLR_S_WAIT_IMEI_TMSI, + LU_COMPL_VLR_S_WAIT_TMSI_CNF, + LU_COMPL_VLR_S_DONE, +}; + +enum lu_compl_vlr_event { + LU_COMPL_VLR_E_START, + LU_COMPL_VLR_E_SUB_PRES_COMPL, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, + LU_COMPL_VLR_E_IMEI_CHECK_NACK, + LU_COMPL_VLR_E_NEW_TMSI_ACK, +}; + +static const struct value_string lu_compl_vlr_event_names[] = { + OSMO_VALUE_STRING(LU_COMPL_VLR_E_START), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_SUB_PRES_COMPL), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_ACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + OSMO_VALUE_STRING(LU_COMPL_VLR_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_compl_vlr_priv { + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *sub_pres_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t cause; + bool assign_tmsi; +}; + +static void _vlr_lu_compl_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result, + uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->result = result; + lcvp->cause = cause; + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_DONE, 0, 0); +} + +static void vlr_lu_compl_fsm_success(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + if (!vsub->lu_complete) { + vsub->lu_complete = true; + /* Balanced by vlr_subscr_rx_imsi_detach() */ + vlr_subscr_get(vsub); + } + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_SUCCESS, 0); +} + +static void vlr_lu_compl_fsm_failure(struct osmo_fsm_inst *fi, uint8_t cause) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + lcvp->vsub->vlr->ops.tx_lu_rej(lcvp->msc_conn_ref, cause); + _vlr_lu_compl_fsm_done(fi, VLR_FSM_RESULT_FAILURE, cause); +} + +static void vlr_lu_compl_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lcvp->result == VLR_FSM_RESULT_SUCCESS) + ? lcvp->parent_event_success + : lcvp->parent_event_failure, + &lcvp->cause); +} + +static void lu_compl_vlr_init(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr; + OSMO_ASSERT(vsub); + vlr = vsub->vlr; + OSMO_ASSERT(vlr); + + OSMO_ASSERT(event == LU_COMPL_VLR_E_START); + + /* TODO: National Roaming restrictions? */ + /* TODO: Roaming restriction due to unsupported feature in subscriber + * data? */ + /* TODO: Regional subscription restriction? */ + /* TODO: Administrative restriction of subscribres' access feature? */ + /* TODO: AccessRestrictuionData parameter available? */ + /* TODO: AccessRestrictionData permits RAT? */ + /* Node 1 */ + /* TODO: Autonomous CSG supported in VPLMN and allowed by HPLMN? */ + /* TODO: Hybrid Cel / CSG Cell */ + /* Node 2 */ + vsub->la_allowed = true; + vsub->imsi_detached_flag = false; + /* Start Subscriber_Present_VLR Procedure */ + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_SUB_PRES, + LU_TIMEOUT_LONG, 0); + + lcvp->sub_pres_vlr_fsm = sub_pres_vlr_fsm_start(fi, vsub, + LU_COMPL_VLR_E_SUB_PRES_COMPL); + +} + +static void lu_compl_vlr_new_tmsi(struct osmo_fsm_inst *fi) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + if (vlr_subscr_alloc_tmsi(vsub)) { + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_TMSI_CNF, + vlr_timer(vlr, 3250), 3250); + + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, vsub->tmsi_new); +} + +/* After completion of Subscriber_Present_VLR */ +static void lu_compl_vlr_wait_subscr_pres(struct osmo_fsm_inst *fi, + uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_SUB_PRES_COMPL); + + lcvp->sub_pres_vlr_fsm = NULL; + + /* TODO: Trace_Subscriber_Activity_VLR */ + + if (vlr->cfg.check_imei_rqd) { + /* Check IMEI VLR */ + osmo_fsm_inst_state_chg(fi, + lcvp->assign_tmsi ? + LU_COMPL_VLR_S_WAIT_IMEI_TMSI + : LU_COMPL_VLR_S_WAIT_IMEI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lcvp->msc_conn_ref, GSM_MI_TYPE_IMEI); + return; + } + + /* Do we need to allocate a TMSI? */ + if (lcvp->assign_tmsi) { + lu_compl_vlr_new_tmsi(fi); + return; + } + + /* Location Updating Accept */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for completion of CHECK_IMEI_VLR */ +static void lu_compl_vlr_wait_imei(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + struct vlr_instance *vlr = vsub->vlr; + + switch (event) { + case LU_COMPL_VLR_E_IMEI_CHECK_ACK: + if (!vsub->imei[0]) { + /* Abort: Do nothing */ + vlr_lu_compl_fsm_failure(fi, + GSM48_REJECT_PROTOCOL_ERROR); + return; + } + /* Pass */ + break; + + case LU_COMPL_VLR_E_IMEI_CHECK_NACK: + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_ILLEGAL_ME); + /* FIXME: IMEI Check Fail to VLR Application (Detach IMSI VLR) */ + return; + } + + /* IMEI is available. Allocate TMSI if needed. */ + if (lcvp->assign_tmsi) { + if (fi->state != LU_COMPL_VLR_S_WAIT_IMEI_TMSI) + LOGPFSML(fi, LOGL_ERROR, + "TMSI required, expected to be in state" + " LU_COMPL_VLR_S_WAIT_IMEI_TMSI," + " am in %s instead\n", + osmo_fsm_state_name(fi->fsm, fi->state)); + /* Logged an error, continue anyway. */ + + lu_compl_vlr_new_tmsi(fi); + + /* Wait for TMSI ack */ + return; + } + + /* No TMSI needed, accept now. */ + vlr->ops.tx_lu_acc(lcvp->msc_conn_ref, GSM_RESERVED_TMSI); + vlr_lu_compl_fsm_success(fi); +} + +/* Waiting for TMSI confirmation */ +static void lu_compl_vlr_wait_tmsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_compl_vlr_priv *lcvp = fi->priv; + struct vlr_subscr *vsub = lcvp->vsub; + + OSMO_ASSERT(event == LU_COMPL_VLR_E_NEW_TMSI_ACK); + + if (!vsub || vsub->tmsi_new == GSM_RESERVED_TMSI) { + LOGPFSML(fi, LOGL_ERROR, "TMSI Realloc Compl implies that" + " the subscriber has a new TMSI allocated, but" + " the new TMSI is unset.\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + vsub->tmsi = vsub->tmsi_new; + vsub->tmsi_new = GSM_RESERVED_TMSI; + + vlr_lu_compl_fsm_success(fi); +} + +static const struct osmo_fsm_state lu_compl_vlr_states[] = { + [LU_COMPL_VLR_S_INIT] = { + .in_event_mask = S(LU_COMPL_VLR_E_START), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_SUB_PRES) | + S(LU_COMPL_VLR_S_WAIT_IMEI), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_INIT), + .action = lu_compl_vlr_init, + }, + [LU_COMPL_VLR_S_WAIT_SUB_PRES] = { + .in_event_mask = S(LU_COMPL_VLR_E_SUB_PRES_COMPL), + .out_state_mask = S(LU_COMPL_VLR_S_WAIT_IMEI) | + S(LU_COMPL_VLR_S_WAIT_IMEI_TMSI) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF) | + S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_SUB_PRES), + .action = lu_compl_vlr_wait_subscr_pres, + }, + [LU_COMPL_VLR_S_WAIT_IMEI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_IMEI_TMSI] = { + .in_event_mask = S(LU_COMPL_VLR_E_IMEI_CHECK_ACK) | + S(LU_COMPL_VLR_E_IMEI_CHECK_NACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE) | + S(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_IMEI_TMSI), + .action = lu_compl_vlr_wait_imei, + }, + [LU_COMPL_VLR_S_WAIT_TMSI_CNF] = { + .in_event_mask = S(LU_COMPL_VLR_E_NEW_TMSI_ACK), + .out_state_mask = S(LU_COMPL_VLR_S_DONE), + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_WAIT_TMSI_CNF), + .action = lu_compl_vlr_wait_tmsi, + }, + [LU_COMPL_VLR_S_DONE] = { + .name = OSMO_STRINGIFY(LU_COMPL_VLR_S_DONE), + .onenter = vlr_lu_compl_fsm_dispatch_result, + }, +}; + +static struct osmo_fsm lu_compl_vlr_fsm = { + .name = "lu_compl_vlr_fsm", + .states = lu_compl_vlr_states, + .num_states = ARRAY_SIZE(lu_compl_vlr_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = lu_compl_vlr_event_names, +}; + +struct osmo_fsm_inst * +lu_compl_vlr_proc_alloc(struct osmo_fsm_inst *parent, + struct vlr_subscr *vsub, + void *msc_conn_ref, + uint32_t parent_event_success, + uint32_t parent_event_failure, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_compl_vlr_priv *lcvp; + + fi = osmo_fsm_inst_alloc_child(&lu_compl_vlr_fsm, parent, + parent_event_failure); + if (!fi) + return NULL; + + lcvp = talloc_zero(fi, struct lu_compl_vlr_priv); + lcvp->vsub = vsub; + lcvp->msc_conn_ref = msc_conn_ref; + lcvp->parent_event_success = parent_event_success; + lcvp->parent_event_failure = parent_event_failure; + lcvp->assign_tmsi = assign_tmsi; + fi->priv = lcvp; + + return fi; +} + + +/*********************************************************************** + * Update_Location_Area_VLR, TS 23.012 Chapter 4.1.2.1 + ***********************************************************************/ + +static const struct value_string fsm_lu_event_names[] = { + OSMO_VALUE_STRING(VLR_ULA_E_UPDATE_LA), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_ACK), + OSMO_VALUE_STRING(VLR_ULA_E_SEND_ID_NACK), + OSMO_VALUE_STRING(VLR_ULA_E_AUTH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_CIPH_RES), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMSI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEI), + OSMO_VALUE_STRING(VLR_ULA_E_ID_IMEISV), + OSMO_VALUE_STRING(VLR_ULA_E_HLR_LU_RES), + OSMO_VALUE_STRING(VLR_ULA_E_UPD_HLR_COMPL), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_SUCCESS), + OSMO_VALUE_STRING(VLR_ULA_E_LU_COMPL_FAILURE), + OSMO_VALUE_STRING(VLR_ULA_E_NEW_TMSI_ACK), + { 0, NULL } +}; + +struct lu_fsm_priv { + struct vlr_instance *vlr; + struct vlr_subscr *vsub; + void *msc_conn_ref; + struct osmo_fsm_inst *upd_hlr_vlr_fsm; + struct osmo_fsm_inst *lu_compl_vlr_fsm; + uint32_t parent_event_success; + uint32_t parent_event_failure; + void *parent_event_data; + enum vlr_fsm_result result; + uint8_t rej_cause; + + enum vlr_lu_type type; + bool lu_by_tmsi; + char imsi[16]; + uint32_t tmsi; + struct osmo_location_area_id old_lai; + struct osmo_location_area_id new_lai; + bool authentication_required; + enum vlr_ciph ciphering_required; + bool is_r99; + bool is_utran; + bool assign_tmsi; +}; + + +/* Determine if given location area is served by this VLR */ +static bool lai_in_this_vlr(struct vlr_instance *vlr, + const struct osmo_location_area_id *lai) +{ + /* TODO: VLR needs to keep a locally configued list of LAIs */ + return true; +} + +/* Determine if authentication is required */ +static bool is_auth_required(struct lu_fsm_priv *lfp) +{ + /* 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); +} + +/* Determine if ciphering is required */ +static bool is_ciph_required(struct lu_fsm_priv *lfp) +{ + return lfp->ciphering_required != VLR_CIPH_NONE; +} + +/* Determine if a HLR Update is required */ +static bool hlr_update_needed(struct vlr_subscr *vsub) +{ + /* TODO: properly decide this, rather than always assuming we + * need to update the HLR. */ + return true; +} + +static void lu_fsm_dispatch_result(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!fi->proc.parent) { + LOGPFSML(fi, LOGL_ERROR, "No parent FSM\n"); + return; + } + osmo_fsm_inst_dispatch(fi->proc.parent, + (lfp->result == VLR_FSM_RESULT_SUCCESS) + ? lfp->parent_event_success + : lfp->parent_event_failure, + lfp->parent_event_data); +} + +static void _lu_fsm_done(struct osmo_fsm_inst *fi, + enum vlr_fsm_result result) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->result = result; + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_DONE, 0, 0); +} + +static void lu_fsm_success(struct osmo_fsm_inst *fi) +{ + _lu_fsm_done(fi, VLR_FSM_RESULT_SUCCESS); +} + +static void lu_fsm_failure(struct osmo_fsm_inst *fi, uint8_t rej_cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (rej_cause) + lfp->vlr->ops.tx_lu_rej(lfp->msc_conn_ref, rej_cause); + _lu_fsm_done(fi, VLR_FSM_RESULT_FAILURE); +} + +static void vlr_loc_upd_start_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + lfp->lu_compl_vlr_fsm = + lu_compl_vlr_proc_alloc(fi, lfp->vsub, lfp->msc_conn_ref, + VLR_ULA_E_LU_COMPL_SUCCESS, + VLR_ULA_E_LU_COMPL_FAILURE, + lfp->assign_tmsi); + + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, LU_COMPL_VLR_E_START, NULL); +} + +static void lu_fsm_discard_lu_compl_fsm(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + if (!lfp->lu_compl_vlr_fsm) + return; + osmo_fsm_inst_term(lfp->lu_compl_vlr_fsm, OSMO_FSM_TERM_PARENT, NULL); +} + +/* 4.1.2.1 Node 4 */ +static void vlr_loc_upd_node_4(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + bool hlr_unknown = false; + + LOGPFSM(fi, "%s()\n", __func__); + + if (hlr_unknown) { + /* FIXME: Delete subscriber record */ + /* LU REJ: Roaming not allowed */ + lu_fsm_failure(fi, GSM48_REJECT_ROAMING_NOT_ALLOWED); + } else { + /* Update_HLR_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_HLR_UPD, + LU_TIMEOUT_LONG, 0); + lfp->upd_hlr_vlr_fsm = + upd_hlr_vlr_proc_start(fi, vsub, VLR_ULA_E_UPD_HLR_COMPL); + } +} + +/* 4.1.2.1 Node B */ +static void vlr_loc_upd_node_b(struct osmo_fsm_inst *fi) +{ + LOGPFSM(fi, "%s()\n", __func__); + + /* FIXME */ + if (0) { /* IMEISV or PgA to send */ + vlr_loc_upd_node_4(fi); + } else { + /* Location_Update_Completion */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } +} + +/* Non-standard: after Ciphering Mode Complete (or no ciph required) */ +static void vlr_loc_upd_post_ciph(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + vsub->conf_by_radio_contact_ind = true; + /* Update LAI */ + vsub->cgi.lai = lfp->new_lai; + vsub->dormant_ind = false; + vsub->cancel_loc_rx = false; + if (hlr_update_needed(vsub)) { + vlr_loc_upd_node_4(fi); + } else { + /* TODO: ADD Support */ + /* TODO: Node A: PgA Support */ + vlr_loc_upd_node_b(fi); + } +} + +/* 4.1.2.1 after Authentication successful (or no auth rqd) */ +static void vlr_loc_upd_post_auth(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (!is_ciph_required(lfp)) { + vlr_loc_upd_post_ciph(fi); + return; + } + + if (vlr_set_ciph_mode(vsub->vlr, fi, lfp->msc_conn_ref, + lfp->ciphering_required, + vsub->vlr->cfg.retrieve_imeisv)) { + LOGPFSML(fi, LOGL_ERROR, + "Failed to send Ciphering Mode Command\n"); + vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); + return; + } + + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_CIPH, LU_TIMEOUT_LONG, 0); +} + +static void vlr_loc_upd_node1(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(vsub); + + if (is_auth_required(lfp)) { + /* Authenticate_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_AUTH, + LU_TIMEOUT_LONG, 0); + vsub->auth_fsm = auth_fsm_start(lfp->vsub, fi->log_level, + fi, VLR_ULA_E_AUTH_RES, + lfp->is_r99, + lfp->is_utran); + } else { + /* no need for authentication */ + vlr_loc_upd_post_auth(fi); + } +} + +static void vlr_loc_upd_want_imsi(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + LOGPFSM(fi, "%s()\n", __func__); + + OSMO_ASSERT(lfp->vsub); + + /* Obtain_IMSI_VLR */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMSI, + vlr_timer(vlr, 3270), 3270); + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMSI); + /* will continue at vlr_loc_upd_node1() once IMSI arrives */ +} + +static int assoc_lfp_with_sub(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + if (vsub->lu_fsm) { + LOGPFSML(fi, LOGL_ERROR, + "A Location Updating process is already pending for" + " this subscriber. Aborting.\n"); + /* Also get rid of the other pending LU attempt? */ + /*lu_fsm_failure(vsub->lu_fsm, GSM48_REJECT_CONGESTION);*/ + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); + return -EINVAL; + } + vsub->lu_fsm = fi; + vsub->msc_conn_ref = lfp->msc_conn_ref; + /* FIXME: send new LAC to HLR? */ + vsub->lac = lfp->new_lai.lac; + lfp->vsub = vsub; + /* Tell MSC to associate this subscriber with the given + * connection */ + vlr->ops.subscr_assoc(lfp->msc_conn_ref, lfp->vsub); + return 0; +} + +static const char *lai_name(struct osmo_location_area_id *lai) +{ + static char buf[64]; + snprintf(buf, sizeof(buf),"MCC:%u, MNC:%u, LAC:%u", + lai->plmn.mcc, lai->plmn.mnc, lai->lac); + return buf; +} + +/* 4.1.2.1: Subscriber (via MSC/SGSN) requests location update */ +static void _start_lu_main(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + struct vlr_subscr *vsub = NULL; + bool created; + + /* TODO: PUESBINE related handling */ + + /* Is previous LAI in this VLR? */ + if (!lai_in_this_vlr(vlr, &lfp->old_lai)) { +#if 0 + /* FIXME: check previous VLR, (3) */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_PVLR, + LU_TIMEOUT_LONG, 0); + return; +#endif + LOGPFSML(fi, LOGL_NOTICE, "LAI change from %s," + " but checking previous VLR not implemented\n", + lai_name(&lfp->old_lai)); + } + + if (!lfp->imsi[0]) { + /* TMSI was used */ + lfp->lu_by_tmsi = true; + /* TMSI clash: if a different subscriber already has this TMSI, + * we will find that other subscriber in the VLR. So the IMSIs + * would mismatch, but we don't know about it. Theoretically, + * an authentication process would thwart any attempt to use + * someone else's TMSI. + * TODO: Otherwise we can ask for the IMSI and verify that it + * matches the IMSI on record. */ + vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, + &created); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + + if (created) + vlr_loc_upd_want_imsi(fi); + else + vlr_loc_upd_node1(fi); + /* We cannot have MSC area change, as the VLR + * serves only one MSC */ + vlr_subscr_put(vsub); + } else { + /* IMSI was used */ + vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, + "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + vlr_subscr_put(vsub); + return; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return; /* error */ + } + vlr_loc_upd_node1(fi); + vlr_subscr_put(vsub); + } +} + + +static void lu_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + + OSMO_ASSERT(event == VLR_ULA_E_UPDATE_LA); + + if (1) { // FIXME + //if (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0]) + /* R_IMEISV_IR1 passed */ + _start_lu_main(fi); + } else { + vlr->ops.tx_id_req(lfp->msc_conn_ref, GSM_MI_TYPE_IMEISV); + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_IMEISV, + vlr_timer(vlr, 3270), 3270); + } +} + +static void lu_fsm_wait_imeisv(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_ID_IMEISV: + /* FIXME: copy IMEISV */ + _start_lu_main(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for response from Send_Identification to PVLR */ +static void lu_fsm_wait_pvlr(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + switch (event) { + case VLR_ULA_E_SEND_ID_ACK: + vlr_loc_upd_node1(fi); + break; + case VLR_ULA_E_SEND_ID_NACK: + vlr_loc_upd_want_imsi(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for result of Authenticate_VLR procedure */ +static void lu_fsm_wait_auth(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + enum vlr_auth_fsm_result *res = data; + uint8_t rej_cause = 0; + + OSMO_ASSERT(event == VLR_ULA_E_AUTH_RES); + + lfp->upd_hlr_vlr_fsm = NULL; + + if (res) { + switch (*res) { + case VLR_AUTH_RES_PASSED: + /* Result == Pass */ + vlr_loc_upd_post_auth(fi); + return; + case VLR_AUTH_RES_ABORTED: + /* go to Idle with no response */ + rej_cause = 0; + break; + case VLR_AUTH_RES_UNKNOWN_SUBSCR: + /* FIXME: delete subscribe record */ + rej_cause = GSM48_REJECT_IMSI_UNKNOWN_IN_HLR; + break; + case VLR_AUTH_RES_AUTH_FAILED: + /* cause = illegal subscriber */ + rej_cause = GSM48_REJECT_ILLEGAL_MS; + break; + case VLR_AUTH_RES_PROC_ERR: + /* cause = system failure */ + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } + } else + rej_cause = GSM48_REJECT_NETWORK_FAILURE; + + lu_fsm_failure(fi, rej_cause); +} + +static void lu_fsm_wait_ciph(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + struct vlr_ciph_result res = { .cause = VLR_CIPH_REJECT }; + + OSMO_ASSERT(event == VLR_ULA_E_CIPH_RES); + + if (!data) + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: NULL\n"); + else + res = *(struct vlr_ciph_result*)data; + + switch (res.cause) { + case VLR_CIPH_COMPL: + break; + case VLR_CIPH_REJECT: + LOGPFSM(fi, "ciphering rejected\n"); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + default: + LOGPFSML(fi, LOGL_ERROR, "invalid ciphering result: %d\n", + res.cause); + lu_fsm_failure(fi, GSM48_REJECT_INVALID_MANDANTORY_INF); + return; + } + + if (res.imeisv) { + LOGPFSM(fi, "got IMEISV: %s\n", res.imeisv); + vlr_subscr_set_imeisv(vsub, res.imeisv); + } + vlr_loc_upd_post_ciph(fi); +} + +static void lu_fsm_wait_imsi(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + char *mi_string = data; + + switch (event) { + case VLR_ULA_E_ID_IMSI: + vlr_subscr_set_imsi(vsub, mi_string); + vlr_loc_upd_node1(fi); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* At the end of Update_HLR_VLR */ +static void lu_fsm_wait_hlr_ul_res(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + + switch (event) { + case VLR_ULA_E_HLR_LU_RES: + /* pass-through this event to Update_HLR_VLR */ + if (data == NULL) + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_ACK, NULL); + else + osmo_fsm_inst_dispatch(lfp->upd_hlr_vlr_fsm, UPD_HLR_VLR_E_UPD_LOC_NACK, data); + break; + case VLR_ULA_E_UPD_HLR_COMPL: + if (data == NULL) { + /* successful case */ + osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + /* continue in MSC ?!? */ + } else { + /* unsuccessful case */ + enum gsm48_gmm_cause cause = + *(enum gsm48_gmm_cause *)data; + if (0 /* procedure_error && vlr->cfg.standalone_mode */) { + osmo_fsm_inst_state_chg(fi, + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, + LU_TIMEOUT_LONG, 0); + vlr_loc_upd_start_lu_compl_fsm(fi); + } else { + lu_fsm_failure(fi, cause); + } + } + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR */ +static void lu_fsm_wait_lu_compl(struct osmo_fsm_inst *fi, uint32_t event, + void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_ID_IMEI: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_IMEI_CHECK_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + + /* Update Register */ + /* TODO: Set_Notification_Type 23.078 */ + /* TODO: Notify_gsmSCF 23.078 */ + /* TODO: Authenticated Radio Contact Established -> ARC */ + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +/* Wait for end of Location_Update_Completion_VLR (standalone case) */ +static void lu_fsm_wait_lu_compl_standalone(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + uint8_t cause; + + switch (event) { + case VLR_ULA_E_NEW_TMSI_ACK: + osmo_fsm_inst_dispatch(lfp->lu_compl_vlr_fsm, + LU_COMPL_VLR_E_NEW_TMSI_ACK, NULL); + break; + case VLR_ULA_E_LU_COMPL_SUCCESS: + lu_fsm_discard_lu_compl_fsm(fi); + vsub->sub_dataconf_by_hlr_ind = false; + lu_fsm_success(fi); + break; + case VLR_ULA_E_LU_COMPL_FAILURE: + vsub->sub_dataconf_by_hlr_ind = false; + cause = GSM48_REJECT_NETWORK_FAILURE; + if (data) + cause = *(uint8_t*)data; + lu_fsm_discard_lu_compl_fsm(fi); + lu_fsm_failure(fi, cause); + break; + default: + LOGPFSML(fi, LOGL_ERROR, "event without effect: %s\n", + osmo_fsm_event_name(fi->fsm, event)); + break; + } +} + +static const struct osmo_fsm_state vlr_lu_fsm_states[] = { + [VLR_ULA_S_IDLE] = { + .in_event_mask = S(VLR_ULA_E_UPDATE_LA), + .out_state_mask = S(VLR_ULA_S_WAIT_IMEISV) | + S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_IDLE), + .action = lu_fsm_idle, + }, + [VLR_ULA_S_WAIT_IMEISV] = { + .in_event_mask = S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_WAIT_PVLR) | + S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMEISV), + .action = lu_fsm_wait_imeisv, + }, + [VLR_ULA_S_WAIT_PVLR] = { + .in_event_mask = S(VLR_ULA_E_SEND_ID_ACK) | + S(VLR_ULA_E_SEND_ID_NACK), + .out_state_mask = S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_PVLR), + .action = lu_fsm_wait_pvlr, + }, + [VLR_ULA_S_WAIT_AUTH] = { + .in_event_mask = S(VLR_ULA_E_AUTH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_CIPH) | + S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_AUTH), + .action = lu_fsm_wait_auth, + }, + [VLR_ULA_S_WAIT_CIPH] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_CIPH), + .in_event_mask = S(VLR_ULA_E_CIPH_RES), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .action = lu_fsm_wait_ciph, + }, + [VLR_ULA_S_WAIT_IMSI] = { + .in_event_mask = S(VLR_ULA_E_ID_IMSI), + .out_state_mask = S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMSI), + .action = lu_fsm_wait_imsi, + }, + [VLR_ULA_S_WAIT_HLR_UPD] = { + .in_event_mask = S(VLR_ULA_E_HLR_LU_RES) | + S(VLR_ULA_E_UPD_HLR_COMPL), + .out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) | + S(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE) | + S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_HLR_UPD), + .action = lu_fsm_wait_hlr_ul_res, + }, + [VLR_ULA_S_WAIT_LU_COMPL] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK) | + S(VLR_ULA_E_ID_IMEI) | + S(VLR_ULA_E_ID_IMEISV), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL), + .action = lu_fsm_wait_lu_compl, + }, + [VLR_ULA_S_WAIT_LU_COMPL_STANDALONE] = { + .in_event_mask = S(VLR_ULA_E_LU_COMPL_SUCCESS) | + S(VLR_ULA_E_LU_COMPL_FAILURE) | + S(VLR_ULA_E_NEW_TMSI_ACK), + .out_state_mask = S(VLR_ULA_S_DONE), + .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE), + .action = lu_fsm_wait_lu_compl_standalone, + }, + [VLR_ULA_S_DONE] = { + .name = OSMO_STRINGIFY(VLR_ULA_S_DONE), + .onenter = lu_fsm_dispatch_result, + }, +}; + +static void fsm_lu_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_subscr *vsub = lfp->vsub; + + LOGPFSM(fi, "fsm_lu_cleanup called with cause %s\n", + osmo_fsm_term_cause_name(cause)); + if (vsub && vsub->lu_fsm == fi) + vsub->lu_fsm = NULL; +} + +static struct osmo_fsm vlr_lu_fsm = { + .name = "vlr_lu_fsm", + .states = vlr_lu_fsm_states, + .num_states = ARRAY_SIZE(vlr_lu_fsm_states), + .allstate_event_mask = 0, + .allstate_action = NULL, + .log_subsys = DVLR, + .event_names = fsm_lu_event_names, + .cleanup = fsm_lu_cleanup, +}; + +struct osmo_fsm_inst * +vlr_loc_update(struct osmo_fsm_inst *parent, + uint32_t parent_event_success, + uint32_t parent_event_failure, + void *parent_event_data, + struct vlr_instance *vlr, void *msc_conn_ref, + enum vlr_lu_type type, uint32_t tmsi, const char *imsi, + 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 is_r99, bool is_utran, + bool assign_tmsi) +{ + struct osmo_fsm_inst *fi; + struct lu_fsm_priv *lfp; + + fi = osmo_fsm_inst_alloc_child(&vlr_lu_fsm, parent, parent_event_failure); + if (!fi) + return NULL; + + lfp = talloc_zero(fi, struct lu_fsm_priv); + lfp->vlr = vlr; + lfp->msc_conn_ref = msc_conn_ref; + lfp->tmsi = tmsi; + lfp->type = type; + lfp->old_lai = *old_lai; + lfp->new_lai = *new_lai; + lfp->lu_by_tmsi = true; + lfp->parent_event_success = parent_event_success; + lfp->parent_event_failure = parent_event_failure; + lfp->parent_event_data = parent_event_data; + lfp->authentication_required = authentication_required; + lfp->ciphering_required = ciphering_required; + lfp->is_r99 = is_r99; + lfp->is_utran = is_utran; + lfp->assign_tmsi = assign_tmsi; + if (imsi) { + strncpy(lfp->imsi, imsi, sizeof(lfp->imsi)-1); + lfp->imsi[sizeof(lfp->imsi)-1] = '\0'; + lfp->lu_by_tmsi = false; + } + fi->priv = lfp; + + LOGPFSM(fi, "rev=%s net=%s%s%s\n", + is_r99 ? "R99" : "GSM", + is_utran ? "UTRAN" : "GERAN", + (authentication_required || ciphering_required)? + " Auth" : " (no Auth)", + (authentication_required || ciphering_required)? + (ciphering_required? "+Ciph" : " (no Ciph)") + : ""); + + osmo_fsm_inst_dispatch(fi, VLR_ULA_E_UPDATE_LA, NULL); + + return fi; +} + +/* Gracefully terminate an FSM created by vlr_loc_update() in case of external + * timeout (i.e. from MSC). */ +void vlr_loc_update_conn_timeout(struct osmo_fsm_inst *fi) +{ + if (!fi || fi->state == VLR_ULA_S_DONE) + return; + LOGPFSM(fi, "Connection timed out\n"); + lu_fsm_failure(fi, GSM48_REJECT_CONGESTION); +} + +void vlr_lu_fsm_init(void) +{ + osmo_fsm_register(&vlr_lu_fsm); + osmo_fsm_register(&upd_hlr_vlr_fsm); + osmo_fsm_register(&sub_pres_vlr_fsm); + osmo_fsm_register(&lu_compl_vlr_fsm); +} diff --git a/src/libvlr/vlr_lu_fsm.h b/src/libvlr/vlr_lu_fsm.h new file mode 100644 index 0000000..5cf13c7 --- /dev/null +++ b/src/libvlr/vlr_lu_fsm.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +enum vlr_lu_state { + VLR_ULA_S_IDLE, + VLR_ULA_S_WAIT_IMEISV, + VLR_ULA_S_WAIT_PVLR, /* Waiting for ID from PVLR */ + VLR_ULA_S_WAIT_AUTH, /* Waiting for Authentication */ + VLR_ULA_S_WAIT_CIPH, /* Waiting for Ciphering Complete */ + VLR_ULA_S_WAIT_IMSI, /* Waiting for IMSI from MS */ + VLR_ULA_S_WAIT_HLR_UPD, /* Waiting for end of HLR update */ + VLR_ULA_S_WAIT_LU_COMPL,/* Waiting for LU complete */ + VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, /* Standalone VLR */ + VLR_ULA_S_DONE +}; + +void vlr_lu_fsm_init(void); diff --git a/src/osmo-nitb/Makefile.am b/src/osmo-nitb/Makefile.am index f4ef487..a99334d 100644 --- a/src/osmo-nitb/Makefile.am +++ b/src/osmo-nitb/Makefile.am @@ -32,6 +32,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libvlr/libvlr.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622 Gerrit-PatchSet: 10 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:17:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:17:22 +0000 Subject: [MERGED] osmo-msc[master]: osmo-nitb: change default db name to sms.db In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-nitb: change default db name to sms.db ...................................................................... osmo-nitb: change default db name to sms.db libvlr now delegates subscriber management to osmo-hlr, so the database no longer represents a HLR. It basically only stores SMS, so reflect that fact in the default database name. Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197 --- M src/osmo-nitb/bsc_hack.c M tests/Makefile.am 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-nitb/bsc_hack.c b/src/osmo-nitb/bsc_hack.c index 89bbb5e..21585e5 100644 --- a/src/osmo-nitb/bsc_hack.c +++ b/src/osmo-nitb/bsc_hack.c @@ -57,7 +57,7 @@ /* MCC and MNC for the Location Area Identifier */ struct gsm_network *bsc_gsmnet = 0; -static const char *database_name = "hlr.sqlite3"; +static const char *database_name = "sms.db"; static const char *config_file = "openbsc.cfg"; static const char *rf_ctrl_path = NULL; extern const char *openbsc_copyright; diff --git a/tests/Makefile.am b/tests/Makefile.am index b36844a..38890a8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -87,7 +87,7 @@ if BUILD_SMPP $(PYTHON) $(srcdir)/smpp_test_runner.py -w $(abs_top_builddir) -v endif - rm -f $(top_builddir)/hlr.sqlite3 $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count + rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" -- To view, visit https://gerrit.osmocom.org/3314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:17:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:17:41 +0000 Subject: osmo-msc[master]: cosmetic: make osmo-python-tests dependency more accurate In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f84a13b7fa6ec4173bdc155e6114d4d7328b619 Gerrit-PatchSet: 3 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 Tue Jul 25 14:18:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:18:13 +0000 Subject: [MERGED] osmo-msc[master]: cosmetic: make osmo-python-tests dependency more accurate In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: make osmo-python-tests dependency more accurate ...................................................................... cosmetic: make osmo-python-tests dependency more accurate Change-Id: I4f84a13b7fa6ec4173bdc155e6114d4d7328b619 --- 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 e2bbf79..e1c3303 100644 --- a/configure.ac +++ b/configure.ac @@ -207,7 +207,7 @@ AM_PATH_PYTHON AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then - AC_MSG_ERROR([Please install osmocom-python to run the VTY/CTRL tests.]) + AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) fi fi AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) -- To view, visit https://gerrit.osmocom.org/3321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f84a13b7fa6ec4173bdc155e6114d4d7328b619 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:18:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:18:13 +0000 Subject: [MERGED] osmo-msc[master]: SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA ...................................................................... SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA Change-Id: I796e1f4281628061f4522c43c549de9e751bc045 --- M src/libbsc/bsc_init.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index b7135f1..e12b880 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -462,6 +462,9 @@ for (n=0, i=0; i<8; i++) n += bts->c0->ts[i].pchan == GSM_PCHAN_CCCH ? 1 : 0; + /* Indicate R99 MSC in SI3 */ + bts->si_common.chan_desc.mscr = 1; + switch (n) { case 0: bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_1_C; -- To view, visit https://gerrit.osmocom.org/3310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I796e1f4281628061f4522c43c549de9e751bc045 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:18:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:18:14 +0000 Subject: [MERGED] osmo-msc[master]: IuPS: don't require an MM context for Iu Release In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: IuPS: don't require an MM context for Iu Release ...................................................................... IuPS: don't require an MM context for Iu Release Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3 --- M src/gprs/gprs_gmm.c 1 file changed, 13 insertions(+), 5 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 dfec604..83b1a70 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -180,25 +180,33 @@ int rc = -1; mm = sgsn_mm_ctx_by_ue_ctx(ctx); - if (!mm) { - LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event %i!\n", type); - return rc; + +#define REQUIRE_MM \ + if (!mm) { \ + LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event %d\n", type); \ + return rc; \ } switch (type) { case IU_EVENT_RAB_ASSIGN: + REQUIRE_MM rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; case IU_EVENT_IU_RELEASE: /* fall thru */ case IU_EVENT_LINK_INVALIDATED: /* Clean up ue_conn_ctx here */ - LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); - if (mm->pmm_state == PMM_CONNECTED) + if (mm) + LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); + else + LOGMMCTXP(LOGL_INFO, mm, "IU release for UE conn 0x%x\n", + ctx->conn_id); + if (mm && mm->pmm_state == PMM_CONNECTED) mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; case IU_EVENT_SECURITY_MODE_COMPLETE: + REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; rc = gsm48_gmm_authorize(mm); -- To view, visit https://gerrit.osmocom.org/3311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3 Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:18:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:18:14 +0000 Subject: [MERGED] osmo-msc[master]: IuPS: explicitly check RAN type; move comment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: IuPS: explicitly check RAN type; move comment ...................................................................... IuPS: explicitly check RAN type; move comment Change-Id: I054d72590dfb2012f6f8506d3a5f8fd2953194e1 --- M src/gprs/gprs_gmm.c 1 file changed, 3 insertions(+), 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 83b1a70..577af1b 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -971,10 +971,12 @@ static int gsm48_tx_gmm_ra_upd_ack(struct sgsn_mm_ctx *mm); #ifdef BUILD_IU +/* Send RAB activation requests for all PDP contexts */ void activate_pdp_rabs(struct sgsn_mm_ctx *ctx) { - /* Send RAB activation requests for all PDP contexts */ struct sgsn_pdp_ctx *pdp; + if (ctx->ran_type != MM_CTX_T_UTRAN_Iu) + return; llist_for_each_entry(pdp, &ctx->pdp_list, list) { iu_rab_act_ps(pdp->nsapi, pdp, 1); } -- To view, visit https://gerrit.osmocom.org/3312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I054d72590dfb2012f6f8506d3a5f8fd2953194e1 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:18:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 25 Jul 2017 14:18:17 +0000 Subject: [MERGED] osmo-msc[master]: SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN ...................................................................... SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN Change-Id: Ifd9ff4342de342475609bad0257a23c50290e23b --- M src/gprs/sgsn_libgtp.c 1 file changed, 20 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 001e611..cd10931 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -247,12 +247,8 @@ memcpy(pdp->gsnlu.v, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); - /* Assume we are a GERAN system */ - pdp->rattype.l = 1; - pdp->rattype.v[0] = 2; - pdp->rattype_given = 1; - - /* Include RAI and ULI all the time */ + /* Routing Area Identifier with LAC and RAC fixed values, as + * requested in 29.006 7.3.1 */ pdp->rai_given = 1; pdp->rai.l = 6; raid = mmctx->ra; @@ -260,10 +256,24 @@ raid.rac = 0xFF; gsm48_construct_ra(pdp->rai.v, &raid); - pdp->userloc_given = 1; - pdp->userloc.l = 8; - pdp->userloc.v[0] = 0; /* CGI for GERAN */ - bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); + pdp->rattype.l = 1; + pdp->rattype_given = 1; + + switch (mmctx->ran_type) { + case MM_CTX_T_GERAN_Gb: + case MM_CTX_T_GERAN_Iu: + pdp->rattype.v[0] = 2; + /* User Location Information */ + pdp->userloc_given = 1; + pdp->userloc.l = 8; + pdp->userloc.v[0] = 0; /* CGI for GERAN */ + bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); + break; + case MM_CTX_T_UTRAN_Iu: + pdp->rattype.v[0] = 1; + /* FIXME: Optional User Location Information with SAI */ + break; + } /* include the IMEI(SV) */ pdp->imeisv_given = 1; -- To view, visit https://gerrit.osmocom.org/3313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifd9ff4342de342475609bad0257a23c50290e23b Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jul 25 14:37:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 25 Jul 2017 14:37:35 +0000 Subject: osmo-hlr[master]: use OSMO_GSUP_PORT == 4222 instead of hardcoded 2222 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b372a4ac38677773bf813acba80cebcd88e2e20 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 Jul 25 14:37:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 25 Jul 2017 14:37:37 +0000 Subject: [MERGED] osmo-hlr[master]: use OSMO_GSUP_PORT == 4222 instead of hardcoded 2222 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: use OSMO_GSUP_PORT == 4222 instead of hardcoded 2222 ...................................................................... use OSMO_GSUP_PORT == 4222 instead of hardcoded 2222 Depends: I4222e21686c823985be8ff1f16b1182be8ad6175 (libosmocore) Change-Id: I9b372a4ac38677773bf813acba80cebcd88e2e20 --- M src/hlr.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hlr.c b/src/hlr.c index 7d1bf75..9e8b699 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -466,7 +466,7 @@ exit(1); } - g_hlr->gs = osmo_gsup_server_create(hlr_ctx, g_hlr->gsup_bind_addr, 2222, + g_hlr->gs = osmo_gsup_server_create(hlr_ctx, g_hlr->gsup_bind_addr, OSMO_GSUP_PORT, read_cb, &g_lu_ops); if (!g_hlr->gs) { LOGP(DMAIN, LOGL_FATAL, "Error starting GSUP server\n"); -- To view, visit https://gerrit.osmocom.org/3351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b372a4ac38677773bf813acba80cebcd88e2e20 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 Jul 25 17:17:25 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 25 Jul 2017 17:17:25 +0000 Subject: [MERGED] osmo-bts[master]: lc15bts-mgr.cfg: Set default vswr to a value inside valid range In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: lc15bts-mgr.cfg: Set default vswr to a value inside valid range ...................................................................... lc15bts-mgr.cfg: Set default vswr to a value inside valid range Valid range is currently set to 1000-200000. Change-Id: Ibf60ab290acf0423c7617591a86403d63266e5d3 --- M doc/examples/litecell15/lc15bts-mgr.cfg 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index c7d0a79..e67742c 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -29,9 +29,9 @@ threshold warning min 17500 threshold critical min 19000 limits tx0_vswr - threshold warning max 3 + threshold warning max 1000 limits tx1_vswr - threshold warning max 3 + threshold warning max 1000 limits supply_pwr threshold warning max 110 threshold critical max 120 -- To view, visit https://gerrit.osmocom.org/3342 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf60ab290acf0423c7617591a86403d63266e5d3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 25 17:17:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 25 Jul 2017 17:17:26 +0000 Subject: [MERGED] osmo-bts[master]: cosmetics: Fix typos and whitespace in lc15bts_mgr_vty.c In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: cosmetics: Fix typos and whitespace in lc15bts_mgr_vty.c ...................................................................... cosmetics: Fix typos and whitespace in lc15bts_mgr_vty.c Change-Id: I6e35fb9c1a6391e5185a62e9efd2f8ffba13cf0d --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index b96349e..8120165 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -1,5 +1,5 @@ /* Copyright (C) 2015 by Yves Godin - * + * * Based on sysmoBTS: * sysmobts_mgr_vty.c * (C) 2014 by lc15com - s.f.m.c. GmbH @@ -423,7 +423,7 @@ DEFUN(cfg_limit_vswr_crit_max, cfg_thresh_vswr_crit_max_cmd, "threshold critical max <1000-200000>", - "Threshold to reach\n" "Warning level\n" "Range\n") + "Threshold to reach\n" "Critical level\n" "Range\n") { struct lc15bts_vswr_limit *limit = vty->index; limit->thresh_crit_max = atoi(argv[0]); @@ -441,7 +441,7 @@ DEFUN(cfg_limit_pwr_crit_max, cfg_thresh_pwr_crit_max_cmd, "threshold critical max <0-200>", - "Threshold to reach\n" "Warning level\n" "Range\n") + "Threshold to reach\n" "Critical level\n" "Range\n") { struct lc15bts_pwr_limit *limit = vty->index; limit->thresh_crit_max = atoi(argv[0]); @@ -739,7 +739,7 @@ DEFUN(calibrate_clock, calibrate_clock_cmd, "calibrate clock", - "Calibration commands\n" + "Calibration commands\n" "Calibrate clock against GPS PPS\n") { if (lc15bts_mgr_calib_run(s_mgr) < 0) { -- To view, visit https://gerrit.osmocom.org/3343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e35fb9c1a6391e5185a62e9efd2f8ffba13cf0d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jul 25 17:17:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 25 Jul 2017 17:17:26 +0000 Subject: [MERGED] osmo-bts[master]: litecell15: Register in vty limits for paX_pwr In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: litecell15: Register in vty limits for paX_pwr ...................................................................... litecell15: Register in vty limits for paX_pwr Otherwise it fails to read the default config file. Change-Id: I316a8ea73091c7e76a175314b890e4d86e9c3010 --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c 1 file changed, 2 insertions(+), 0 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/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index 8120165..a6a925c 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -1040,10 +1040,12 @@ install_node(&limit_pa0_pwr_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_pa0_pwr_cmd); + register_limit(LIMIT_PA0_PWR_NODE, MGR_LIMIT_TYPE_PWR); vty_install_default(LIMIT_PA0_PWR_NODE); install_node(&limit_pa1_pwr_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_pa1_pwr_cmd); + register_limit(LIMIT_PA1_PWR_NODE, MGR_LIMIT_TYPE_PWR); vty_install_default(LIMIT_PA1_PWR_NODE); install_node(&limit_gps_fix_node, config_write_dummy); -- To view, visit https://gerrit.osmocom.org/3344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I316a8ea73091c7e76a175314b890e4d86e9c3010 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Tue Jul 25 17:21:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 25 Jul 2017 17:21:51 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: lc15bts_mgr_vty.c: Fix typos in comments Message-ID: Review at https://gerrit.osmocom.org/3353 cosmetic: lc15bts_mgr_vty.c: Fix typos in comments Change-Id: I46b1cc6e5502829e0c1dc84a184cd2002fbd2b18 --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/3353/1 diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index a6a925c..e7e33e5 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -2,11 +2,11 @@ * * Based on sysmoBTS: * sysmobts_mgr_vty.c - * (C) 2014 by lc15com - s.f.m.c. GmbH + * (C) 2014 by sysmocom - s.f.m.c. GmbH * * All Rights Reserved * - * Author: Alvaro Neira Ayuso + * Author: Alvaro Neira Ayuso * * 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 -- To view, visit https://gerrit.osmocom.org/3353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I46b1cc6e5502829e0c1dc84a184cd2002fbd2b18 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 26 07:53:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 26 Jul 2017 07:53:34 +0000 Subject: osmo-bts[master]: cosmetic: lc15bts_mgr_vty.c: Fix typos in comments In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I46b1cc6e5502829e0c1dc84a184cd2002fbd2b18 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jul 26 07:53:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 26 Jul 2017 07:53:37 +0000 Subject: [MERGED] osmo-bts[master]: cosmetic: lc15bts_mgr_vty.c: Fix typos in comments In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: lc15bts_mgr_vty.c: Fix typos in comments ...................................................................... cosmetic: lc15bts_mgr_vty.c: Fix typos in comments Change-Id: I46b1cc6e5502829e0c1dc84a184cd2002fbd2b18 --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index a6a925c..e7e33e5 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -2,11 +2,11 @@ * * Based on sysmoBTS: * sysmobts_mgr_vty.c - * (C) 2014 by lc15com - s.f.m.c. GmbH + * (C) 2014 by sysmocom - s.f.m.c. GmbH * * All Rights Reserved * - * Author: Alvaro Neira Ayuso + * Author: Alvaro Neira Ayuso * * 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 -- To view, visit https://gerrit.osmocom.org/3353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I46b1cc6e5502829e0c1dc84a184cd2002fbd2b18 Gerrit-PatchSet: 1 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 Wed Jul 26 07:58:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 26 Jul 2017 07:58:03 +0000 Subject: osmo-iuh[master]: cn unitdata: verify correct remote addr In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 It's questionable if this is really the right thing to do in SS7 networks. Routing can be asymmetric, and particularly with GTT and GT based routing the source adresss of responses cold be different than the destination address of requests. But then, in *typical* configurations I would assume just MTP-level routing (PC/SSN) between HNB-GW and MSC/SGSN, so we can probably merge the patch to help catching invalid configurations at the expense of possibly breaking some more complex configurations. -- To view, visit https://gerrit.osmocom.org/3113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7190b4c3a05e8bac0eeffa1eab18c9e47429cb17 Gerrit-PatchSet: 2 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 Wed Jul 26 14:50:25 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 26 Jul 2017 14:50:25 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: fix possible nullpointer deref Message-ID: Review at https://gerrit.osmocom.org/3354 sccp: fix possible nullpointer deref check input parameters local_ip and remote_ip of the function osmo_sccp_simple_client_on_ss7_id() before using them with talloc_strdup() Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 --- M src/sccp_user.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/54/3354/1 diff --git a/src/sccp_user.c b/src/sccp_user.c index c9443a2..1805cff 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -331,8 +331,10 @@ goto out_rt; asp_created = true; - asp->cfg.local.host = talloc_strdup(asp, local_ip); - asp->cfg.remote.host = talloc_strdup(asp, remote_ip); + if (local_ip) + asp->cfg.local.host = talloc_strdup(asp, local_ip); + if (remote_ip) + asp->cfg.remote.host = talloc_strdup(asp, remote_ip); osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jul 26 14:58:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 26 Jul 2017 14:58:28 +0000 Subject: libosmo-sccp[master]: sccp: fix possible nullpointer deref In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3354/1/src/sccp_user.c File src/sccp_user.c: Line 335: asp->cfg.local.host = talloc_strdup(asp, local_ip); make sure it is set to NULL otherwise, because the code path above seems to not guarantee that *asp is zeroed out. e.g. ...host = local_ip? talloc_strdup(..) : NULL; same below. (BTW, is one aspect why I didn't like the re-entrant nature of this code, reusing found things instead of making sure this is the first one creating things) -- To view, visit https://gerrit.osmocom.org/3354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jul 26 15:04:58 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 26 Jul 2017 15:04:58 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: fix possible nullpointer deref 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/3354 to look at the new patch set (#2). sccp: fix possible nullpointer deref check input parameters local_ip and remote_ip of the function osmo_sccp_simple_client_on_ss7_id() before using them with talloc_strdup() Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 --- M src/sccp_user.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/54/3354/2 diff --git a/src/sccp_user.c b/src/sccp_user.c index c9443a2..1c818f0 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -331,8 +331,15 @@ goto out_rt; asp_created = true; - asp->cfg.local.host = talloc_strdup(asp, local_ip); - asp->cfg.remote.host = talloc_strdup(asp, remote_ip); + if (local_ip) + asp->cfg.local.host = talloc_strdup(asp, local_ip); + else + asp->cfg.local.host = NULL; + + if (remote_ip) + asp->cfg.remote.host = talloc_strdup(asp, remote_ip); + else + asp->cfg.remote.host = NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 26 15:14:49 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 26 Jul 2017 15:14:49 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: ensure addressbook entry names are unique In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: sccp: ensure addressbook entry names are unique ...................................................................... sccp: ensure addressbook entry names are unique It is possible to add two (or more) different sccp-addresses under the same name, when the addresses are defined in different cs7 instances. Add a check to make sure an address name is not used multiple times Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 --- M src/osmo_ss7_vty.c 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 8a03303..c859eb9 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1205,6 +1205,16 @@ return CMD_WARNING; } + /* Ensure that we do not use address names that + * are already used in other ss7 instances. */ + entry = addr_entry_by_name_global(name); + if (entry != NULL) { + vty_out(vty, + "address name (%s) already used in ss7 instance %u%s", + entry->name, entry->inst->cfg.id, VTY_NEWLINE); + return CMD_WARNING; + } + entry = addr_entry_by_name_local(name, inst); /* Create a new addressbook entry if we can not find an -- To view, visit https://gerrit.osmocom.org/3292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335 Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Jul 26 15:44:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 26 Jul 2017 15:44:11 +0000 Subject: [PATCH] libosmo-sccp[master]: ensure valid primary_pc in osmo_ss7_instance Message-ID: Review at https://gerrit.osmocom.org/3355 ensure valid primary_pc in osmo_ss7_instance Add osmo_ss7_instance.cfg.primary_pc_valid flag. Adjust all code paths setting primary_pc to also set primary_pc_valid. Adjust all code paths using primary_pc to ensure it is indeed valid. Rationale: It looks like we are going to use the primary point-code of an SS7 instance to derive a local SCCP address, e.g. for osmo-bsc and osmo-hnbgw. cs7-instance 1 point-code 1.2.3 ! sets osmo_ss7_instance.primary_pc = 1.2.3 sccp-address msc point-code 0.0.1 routing-indicator PC hnb iucs remote-addr msc ! derives cs7 instance 1 and local pc 1.2.3 If 'point-code 1.2.3' is omitted, this becomes '0.0.0' without the user noticing, and this happens for each client that omits it. I would like to barf when no local PC is set, but since 0 is apparently a valid point-code and osmo_ss7_instance.primary_pc is a uint32_t, we have no way to tell whether the user supplied a point-code or not. Currently, in osmo_ss7_vty.c we had "if (inst->cfg.primary_pc)" suggesting 0 is invalid, but in struct osmo_sccp_user we have flag pc_valid suggesting 0 is indeed valid. I chose to adopt a primary_pc_valid flag like osmo_sccp_user. Change-Id: I7f0f0c89b7335d9da24161bfac8234be214ca00c --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c M src/osmo_ss7_vty.c M src/sccp_scoc.c M src/sccp_scrc.c M src/sccp_user.c M tests/ss7/ss7_test.c 7 files changed, 28 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/55/3355/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 87ace4a..06fb29c 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -85,6 +85,7 @@ char *name; char *description; uint32_t primary_pc; + bool primary_pc_valid; /* secondary PCs */ /* capability PCs */ uint8_t network_indicator; diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index eb5a4ef..ee2b212 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -1819,7 +1819,7 @@ bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc) { OSMO_ASSERT(ss7_initialized); - if (pc == inst->cfg.primary_pc) + if (inst->cfg.primary_pc_valid && pc == inst->cfg.primary_pc) return true; /* FIXME: Secondary and Capability Point Codes */ return false; diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index c859eb9..775baf2 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -172,6 +172,7 @@ } inst->cfg.primary_pc = pc; + inst->cfg.primary_pc_valid = true; return CMD_SUCCESS; } @@ -1536,7 +1537,7 @@ if (inst->cfg.pc_fmt.delimiter != '.') vty_out(vty, " point-code delimiter dash%s", VTY_NEWLINE); - if (inst->cfg.primary_pc) + if (inst->cfg.primary_pc_valid) vty_out(vty, " point-code %s%s", osmo_ss7_pointcode_print(inst, inst->cfg.primary_pc), VTY_NEWLINE); diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 3d43448..729bc4d 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1671,11 +1671,15 @@ struct osmo_ss7_instance *s7i = conn->inst->ss7; struct osmo_sccp_addr *remote_addr; uint32_t local_pc; + bool local_pc_valid = false; - if (conn->user->pc_valid) + if (conn->user->pc_valid) { local_pc = conn->user->pc; - else + local_pc_valid = true; + } else if (s7i->cfg.primary_pc_valid) { local_pc = s7i->cfg.primary_pc; + local_pc_valid = true; + } if (conn->incoming) remote_addr = &conn->calling_addr; @@ -1684,7 +1688,7 @@ vty_out(vty, "%c %06x %3u %7s ", conn->incoming ? 'I' : 'O', conn->conn_id, conn->user->ssn, - osmo_ss7_pointcode_print(s7i, local_pc)); + local_pc_valid ? osmo_ss7_pointcode_print(s7i, local_pc) : "(no PC)"); vty_out(vty, "%16s %06x %3u %7s%s", osmo_fsm_inst_state_name(conn->fi), conn->remote_ref, remote_addr->ssn, osmo_ss7_pointcode_print(s7i, conn->remote_pc), diff --git a/src/sccp_scrc.c b/src/sccp_scrc.c index e44201a..a9c1c73 100644 --- a/src/sccp_scrc.c +++ b/src/sccp_scrc.c @@ -91,8 +91,14 @@ param = &omp->u.transfer; if (sua->mtp.opc) param->opc = sua->mtp.opc; - else + else { + if (!s7i->cfg.primary_pc_valid) { + LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n", + s7i->cfg.id); + return -1; + } param->opc = s7i->cfg.primary_pc; + } param->dpc = remote_pc; param->sls = sua->mtp.sls; param->sio = MTP_SIO(MTP_SI_SCCP, s7i->cfg.network_indicator); diff --git a/src/sccp_user.c b/src/sccp_user.c index c9443a2..ddb777d 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -277,10 +277,12 @@ * NOTE: This means that the user must set the pointcode to a * proper value when a cs7 instance is defined via the VTY. */ ss7->cfg.primary_pc = pc; + ss7->cfg.primary_pc_valid = true; ss7_created = true; } LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, - ss7->cfg.id, osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc)); + ss7->cfg.id, + ss7->cfg.primary_pc_valid ? osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc) : "(no PC)"); /* There must not be an existing SCCP istance, regarless if the simple * client has created the SS7 instance or if it was already present. @@ -302,6 +304,11 @@ goto out_ss7; as_created = true; + if (!ss7->cfg.primary_pc_valid) { + LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n", + ss7->cfg.id); + goto out_ss7; + } as->cfg.routing_key.pc = ss7->cfg.primary_pc; /* install default route */ @@ -401,6 +408,7 @@ if (!ss7) return NULL; ss7->cfg.primary_pc = pc; + ss7->cfg.primary_pc_valid = true; xs = osmo_ss7_xua_server_create(ss7, prot, local_port, local_ip); if (!xs) diff --git a/tests/ss7/ss7_test.c b/tests/ss7/ss7_test.c index 7c51767..6dc2caa 100644 --- a/tests/ss7/ss7_test.c +++ b/tests/ss7/ss7_test.c @@ -302,6 +302,7 @@ /* test osmo_ss7_pc_is_local() */ s7i->cfg.primary_pc = 55; + s7i->cfg.primary_pc_valid = true; OSMO_ASSERT(osmo_ss7_pc_is_local(s7i, 55) == true); OSMO_ASSERT(osmo_ss7_pc_is_local(s7i, 23) == false); -- To view, visit https://gerrit.osmocom.org/3355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f0f0c89b7335d9da24161bfac8234be214ca00c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jul 26 15:44:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 26 Jul 2017 15:44:38 +0000 Subject: [PATCH] osmo-bts[master]: lc15: Tweak led colors used in service file Message-ID: Review at https://gerrit.osmocom.org/3356 lc15: Tweak led colors used in service file service sets led to orange before/while osmo-bts is being started. osmo-bts-lc15 sets led to green while operating. (unchanged in here) service sets led to red when osmo-bts stops running. Change-Id: If351f49d1ead359192d0d80bbc381afd3459c940 --- M contrib/osmo-bts-lc15.service 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/3356/1 diff --git a/contrib/osmo-bts-lc15.service b/contrib/osmo-bts-lc15.service index ab7def8..6aa9751 100644 --- a/contrib/osmo-bts-lc15.service +++ b/contrib/osmo-bts-lc15.service @@ -3,10 +3,10 @@ [Service] Type=simple -ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/usr0/brightness' -ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness' +ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness' +ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr1/brightness' ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts.cfg -M -ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr0/brightness' +ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness' ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness' Restart=always RestartSec=2 -- To view, visit https://gerrit.osmocom.org/3356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If351f49d1ead359192d0d80bbc381afd3459c940 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jul 26 15:52:59 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 26 Jul 2017 15:52:59 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: derive local address from given sccp instance 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/3330 to look at the new patch set (#2). sccp: derive local address from given sccp instance The most important parts of an SCCP address are the routing indicator and the pointcode. The latter one is always available via the SS7 instance, so a basic local address can be derived from there. Add function osmo_sccp_local_addr_by_instance() to derive a basic local SCCP address from a given SCCP instance Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/30/3330/2 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 24d64d9..732df2a 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -253,3 +253,7 @@ const char *name); const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr); + +void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, + const struct osmo_sccp_instance *inst, + uint32_t ssn); diff --git a/src/sccp_user.c b/src/sccp_user.c index c9443a2..c3ab8f8 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -22,6 +22,7 @@ */ #include +#include #include #include @@ -231,6 +232,25 @@ talloc_free(inst); } +/*! \brief derive a basic local SCCP-Address from a given SCCP instance. + * \param[out] dest_addr pointer to output address memory + * \param[in] inst SCCP instance + * \param[in] ssn Subsystem Number */ +void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, + const struct osmo_sccp_instance *inst, + uint32_t ssn) +{ + struct osmo_ss7_instance *ss7; + + OSMO_ASSERT(dest_addr); + OSMO_ASSERT(inst); + ss7 = inst->ss7; + OSMO_ASSERT(ss7); + + memset(dest_addr, 0, sizeof(*dest_addr)); + osmo_sccp_make_addr_pc_ssn(dest_addr, ss7->cfg.primary_pc, ssn); +} + /*********************************************************************** * Convenience function for CLIENT ***********************************************************************/ -- To view, visit https://gerrit.osmocom.org/3330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 06:37:42 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 27 Jul 2017 06:37:42 +0000 Subject: [PATCH] osmocom-bb[master]: vty_interface.c: use RPLMN from settings if preset Message-ID: Review at https://gerrit.osmocom.org/3357 vty_interface.c: use RPLMN from settings if preset Previously, when testcard was attached via VTY interface, the initial values were used for MCC / MNC, LAC and TMSI, even if correct RPLMN settings were set. Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b --- M src/host/layer23/src/mobile/vty_interface.c 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/57/3357/1 diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index d909153..b26d471 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -472,6 +472,9 @@ int attached) { struct osmocom_ms *ms; + struct gsm_settings *set; + + /* Initial testcard settings */ uint16_t mcc = 0x001, mnc = 0x01f, lac = 0x0000; uint32_t tmsi = 0xffffffff; @@ -485,6 +488,18 @@ return CMD_WARNING; } + set = &ms->settings; + if (set->test_rplmn_valid) { + mcc = set->test_rplmn_mcc; + mnc = set->test_rplmn_mnc; + + if (set->test_lac > 0x0000 && set->test_lac < 0xfffe) + lac = set->test_lac; + + if (set->test_tmsi != 0xffffffff) + tmsi = set->test_tmsi; + } + if (argc == 2) { vty_out(vty, "Give MNC together with MCC%s", VTY_NEWLINE); return CMD_WARNING; -- To view, visit https://gerrit.osmocom.org/3357 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jul 27 12:12:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 27 Jul 2017 12:12:54 +0000 Subject: [PATCH] libosmocore[master]: chantype_rsl2gsmtap/gsmtap2rsl: Fix PDCH channel type conver... Message-ID: Review at https://gerrit.osmocom.org/3358 chantype_rsl2gsmtap/gsmtap2rsl: Fix PDCH channel type conversion Change-Id: I88a06e8ba894f16006a8efa259fc536cf300de32 --- M src/gsmtap_util.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/3358/1 diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index ad6f914..28149c0 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -81,6 +81,9 @@ /* it could also be AGCH... */ ret = GSMTAP_CHANNEL_PCH; break; + case RSL_CHAN_OSMO_PDCH: + ret = GSMTAP_CHANNEL_PDCH; + break; } if (link_id & 0x40) @@ -121,7 +124,7 @@ *rsl_chantype = RSL_CHAN_PCH_AGCH; break; case GSMTAP_CHANNEL_PDCH: - *rsl_chantype = GSMTAP_CHANNEL_PDCH; + *rsl_chantype = RSL_CHAN_OSMO_PDCH; break; } -- To view, visit https://gerrit.osmocom.org/3358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88a06e8ba894f16006a8efa259fc536cf300de32 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jul 27 13:41:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 13:41:13 +0000 Subject: [PATCH] libosmo-sccp[master]: add osmo_sccp_addr_set_ssn() Message-ID: Review at https://gerrit.osmocom.org/3359 add osmo_sccp_addr_set_ssn() Will be used by e.g. osmo-hnbgw to add an SSN to addresses obtained from the sccp address book. Change-Id: I85b46269dbe7909e52873ace3f720f6292a4516c --- M include/osmocom/sigtran/sccp_helpers.h M src/sccp_helpers.c 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/59/3359/1 diff --git a/include/osmocom/sigtran/sccp_helpers.h b/include/osmocom/sigtran/sccp_helpers.h index ecf583e..2f318f4 100644 --- a/include/osmocom/sigtran/sccp_helpers.h +++ b/include/osmocom/sigtran/sccp_helpers.h @@ -17,6 +17,8 @@ void osmo_sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr, uint32_t pc, uint32_t ssn); +void osmo_sccp_addr_set_ssn(struct osmo_sccp_addr *addr, uint32_t ssn); + int osmo_sccp_tx_unitdata_ranap(struct osmo_sccp_user *scu, uint32_t src_point_code, uint32_t dst_point_code, diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index 76a7c1c..2320fe5 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -44,6 +44,12 @@ addr->pc = pc; } +void osmo_sccp_addr_set_ssn(struct osmo_sccp_addr *addr, uint32_t ssn) +{ + addr->presence |= OSMO_SCCP_ADDR_T_SSN; + addr->ssn = ssn; +} + int osmo_sccp_tx_unitdata(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr, const struct osmo_sccp_addr *called_addr, -- To view, visit https://gerrit.osmocom.org/3359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I85b46269dbe7909e52873ace3f720f6292a4516c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 13:41:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 13:41:13 +0000 Subject: [PATCH] libosmo-sccp[master]: osmo_ss7_vty_init: ensure a talloc ctx is set by user Message-ID: Review at https://gerrit.osmocom.org/3360 osmo_ss7_vty_init: ensure a talloc ctx is set by user Drop the separate osmo_ss7_set_vty_alloc_ctx() because we are likely to forget calling it. Instead, incorporate into osmo_ss7_vty_init_*() with a new ctx arg, and set the static context var in vty_init_shared(). Change-Id: Id4e7f47979001f7856b0b3665c9e94982e75e490 --- M examples/m3ua_example.c M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7_vty.c M stp/stp_main.c 4 files changed, 11 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/60/3360/1 diff --git a/examples/m3ua_example.c b/examples/m3ua_example.c index d3c6a7c..6c2b146 100644 --- a/examples/m3ua_example.c +++ b/examples/m3ua_example.c @@ -92,7 +92,7 @@ osmo_ss7_init(); osmo_fsm_log_addr(false); vty_init(&vty_info); - osmo_ss7_vty_init_asp(); + osmo_ss7_vty_init_asp(NULL); osmo_sccp_vty_init(); if (argc <= 1) diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 87ace4a..bbe425c 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -471,8 +471,7 @@ /* VTY related */ struct vty; -void osmo_ss7_set_vty_alloc_ctx(void *ctx); -void osmo_ss7_vty_init_asp(void); -void osmo_ss7_vty_init_sg(void); +void osmo_ss7_vty_init_asp(void *ctx); +void osmo_ss7_vty_init_sg(void *ctx); int osmo_ss7_vty_go_parent(struct vty *vty); int osmo_ss7_is_config_node(struct vty *vty, int node); diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index c859eb9..476aedf 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1661,8 +1661,10 @@ install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } -static void vty_init_shared(void) +static void vty_init_shared(void *ctx) { + g_ctx = ctx; + install_element_ve(&show_cs7_user_cmd); /* the mother of all VTY config nodes */ @@ -1706,14 +1708,14 @@ vty_init_addr(); } -void osmo_ss7_vty_init_asp(void) +void osmo_ss7_vty_init_asp(void *ctx) { - vty_init_shared(); + vty_init_shared(ctx); } -void osmo_ss7_vty_init_sg(void) +void osmo_ss7_vty_init_sg(void *ctx) { - vty_init_shared(); + vty_init_shared(ctx); install_node(&rtable_node, NULL); vty_install_default(L_CS7_RTABLE_NODE); @@ -1730,8 +1732,3 @@ install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); } - -void osmo_ss7_set_vty_alloc_ctx(void *ctx) -{ - g_ctx = ctx; -}; diff --git a/stp/stp_main.c b/stp/stp_main.c index 074272b..ac8e6dd 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -137,7 +137,7 @@ osmo_ss7_init(); osmo_fsm_log_addr(false); logging_vty_add_cmds(&log_info); - osmo_ss7_vty_init_sg(); + osmo_ss7_vty_init_sg(NULL); osmo_fsm_vty_add_cmds(); rc = vty_read_config_file(cmdline_config.config_file, NULL); -- To view, visit https://gerrit.osmocom.org/3360 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id4e7f47979001f7856b0b3665c9e94982e75e490 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 13:41:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 13:41:14 +0000 Subject: [PATCH] libosmo-sccp[master]: constify ss7_instance arg of osmo_ss7_pointcode_print() Message-ID: Review at https://gerrit.osmocom.org/3361 constify ss7_instance arg of osmo_ss7_pointcode_print() Change-Id: I8c6b7188d004033e75e9c41f4a65c418d13a79c5 --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c 2 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/61/3361/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 27e42eb..cb30f79 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -23,8 +23,8 @@ bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc); int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str); int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in); -const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc); -const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc); +const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc); +const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc); /*********************************************************************** * SS7 Routing Tables diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index ee2b212..de99009 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -245,7 +245,7 @@ return -EINVAL; } -const char *_osmo_ss7_pointcode_print(char *buf, size_t len, struct osmo_ss7_instance *inst, uint32_t pc) +const char *_osmo_ss7_pointcode_print(char *buf, size_t len, const struct osmo_ss7_instance *inst, uint32_t pc) { const struct osmo_ss7_pc_fmt *pc_fmt = inst ? &inst->cfg.pc_fmt : &default_pc_fmt; unsigned int num_comp_exp = num_pc_comp_exp(pc_fmt); @@ -263,7 +263,7 @@ /* print a pointcode according to the structure configured for this * ss7_instance */ -const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc) +const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc) { static char buf[MAX_PC_STR_LEN]; return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc); @@ -271,7 +271,7 @@ /* same as osmo_ss7_pointcode_print() but using a separate buffer, useful for multiple point codes in the * same LOGP/printf. */ -const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc) +const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc) { static char buf[MAX_PC_STR_LEN]; return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc); -- To view, visit https://gerrit.osmocom.org/3361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c6b7188d004033e75e9c41f4a65c418d13a79c5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 13:50:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 13:50:04 +0000 Subject: [PATCH] libosmo-sccp[master]: introduce OSMO_SCCP_RI_NONE to indicate unset RI Message-ID: Review at https://gerrit.osmocom.org/3362 introduce OSMO_SCCP_RI_NONE to indicate unset RI Change-Id: I6e2f31b023b08cba2f2ee8234e6108efcaca41c0 --- M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7_vty.c 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/62/3362/1 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 24d64d9..6ae8579 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -54,6 +54,7 @@ /* Q.713 3.4.1 + RFC 3868 3.10.2.3 */ enum osmo_sccp_routing_ind { + OSMO_SCCP_RI_NONE, OSMO_SCCP_RI_GT, OSMO_SCCP_RI_SSN_PC, OSMO_SCCP_RI_SSN_IP, diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index fab27b4..f60eef4 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1049,6 +1049,11 @@ case OSMO_SCCP_RI_SSN_IP: vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); break; + case OSMO_SCCP_RI_NONE: + break; + default: + vty_out(vty, " ! invalid routing-indicator value: %u%s", entry->addr.ri, VTY_NEWLINE); + break; } if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) vty_out(vty, " point-code %s%s", -- To view, visit https://gerrit.osmocom.org/3362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e2f31b023b08cba2f2ee8234e6108efcaca41c0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 13:50:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 13:50:04 +0000 Subject: [PATCH] libosmo-sccp[master]: add osmo_sccp_addr_name() and two value_string[]s Message-ID: Review at https://gerrit.osmocom.org/3363 add osmo_sccp_addr_name() and two value_string[]s osmo_sccp_addr_dump() just prints the raw values. In osmo_sccp_addr_name(), use osmo_ss7_pointcode_print() and newly added SSN and GT value_string[] to print more meaningful log output. Change-Id: Ie1aedd7894acd69ddc887cd65a8a0df4b888838c --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_helpers.c M src/sccp_sap.c 3 files changed, 81 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/63/3363/1 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 6ae8579..d44e347 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -60,6 +60,11 @@ OSMO_SCCP_RI_SSN_IP, }; +extern const struct value_string osmo_sccp_routing_ind_names[]; +static inline const char *osmo_sccp_routing_ind_name(enum osmo_sccp_routing_ind val) +{ return get_value_string(osmo_sccp_routing_ind_names, val); } + + /* Q.713 3.4.1 + RFC 3868 3.10.2.3 */ enum osmo_sccp_gti { OSMO_SCCP_GTI_NO_GT, @@ -68,6 +73,10 @@ OSMO_SCCP_GTI_TT_NPL_ENC, OSMO_SCCP_GTI_TT_NPL_ENC_NAI, }; + +extern const struct value_string osmo_sccp_gti_names[]; +static inline const char *osmo_sccp_gti_name(enum osmo_sccp_gti val) +{ return get_value_string(osmo_sccp_gti_names, val); } /* RFC 3868 3.10.2.3 */ enum osmo_sccp_npi { @@ -126,6 +135,10 @@ OSMO_SCCP_SSN_BSS_OAM = 253, }; +extern const struct value_string osmo_sccp_ssn_names[]; +static inline const char *osmo_sccp_ssn_name(enum osmo_sccp_ssn val) +{ return get_value_string(osmo_sccp_ssn_names, val); } + struct osmo_sccp_gt { uint8_t gti; uint8_t tt; diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index 2320fe5..471c9cb 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -274,6 +274,7 @@ return buf; } +/* Return string representation of SCCP address raw bytes in a static string. */ char *osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr) { static char buf[256]; @@ -295,3 +296,26 @@ return buf; } + +/* Like osmo_sccp_addr_dump() but print human readable representations instead of raw values. */ +char *osmo_sccp_addr_name(const struct osmo_ss7_instance *ss7, const struct osmo_sccp_addr *addr) +{ + static char buf[256]; + bool comma = false; + + buf[0] = '\0'; + + append_to_buf(buf, &comma, "RI=%s", osmo_sccp_routing_ind_name(addr->ri)); + + if (addr->presence & OSMO_SCCP_ADDR_T_PC) + append_to_buf(buf, &comma, "PC=%s", osmo_ss7_pointcode_print(ss7, addr->pc)); + if (addr->presence & OSMO_SCCP_ADDR_T_SSN) + append_to_buf(buf, &comma, "SSN=%s", osmo_sccp_ssn_name(addr->ssn)); + if (addr->presence & OSMO_SCCP_ADDR_T_IPv4) + append_to_buf(buf, &comma, "IP=%s", inet_ntoa(addr->ip.v4)); + append_to_buf(buf, &comma, "GTI=%s", osmo_sccp_gti_name(addr->gt.gti)); + if (addr->presence & OSMO_SCCP_ADDR_T_GT) + append_to_buf(buf, &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); + + return buf; +} diff --git a/src/sccp_sap.c b/src/sccp_sap.c index d4580ae..a4b4087 100644 --- a/src/sccp_sap.c +++ b/src/sccp_sap.c @@ -85,3 +85,47 @@ return prim_name_buf; } + +const struct value_string osmo_sccp_routing_ind_names[] = { + { OSMO_SCCP_RI_NONE, "NONE" }, + { OSMO_SCCP_RI_GT, "GT" }, + { OSMO_SCCP_RI_SSN_PC, "SSN_PC" }, + { OSMO_SCCP_RI_SSN_IP, "SSN_IP" }, +}; + +const struct value_string osmo_sccp_gti_names[] = { + { OSMO_SCCP_GTI_NO_GT, "NO_GT" }, + { OSMO_SCCP_GTI_NAI_ONLY, "NAI_ONLY" }, + { OSMO_SCCP_GTI_TT_ONLY, "TT_ONLY" }, + { OSMO_SCCP_GTI_TT_NPL_ENC, "TT_NPL_ENC" }, + { OSMO_SCCP_GTI_TT_NPL_ENC_NAI, "TT_NPL_ENC_NAI" }, +}; + +const struct value_string osmo_sccp_ssn_names[] = { + { OSMO_SCCP_SSN_MGMT, "MGMT" }, + { OSMO_SCCP_SSN_ISUP, "ISUP" }, + { OSMO_SCCP_SSN_OMAP, "OMAP" }, + { OSMO_SCCP_SSN_MAP, "MAP" }, + { OSMO_SCCP_SSN_HLR, "HLR" }, + { OSMO_SCCP_SSN_VLR, "VLR" }, + { OSMO_SCCP_SSN_MSC, "MSC" }, + { OSMO_SCCP_SSN_EIR, "EIR" }, + { OSMO_SCCP_SSN_AUC, "AUC" }, + { OSMO_SCCP_SSN_ISDN_SS, "ISDN_SS" }, + { OSMO_SCCP_SSN_RES_INTL, "RES_INTL" }, + { OSMO_SCCP_SSN_BISDN, "BISDN" }, + { OSMO_SCCP_SSN_TC_TEST, "TC_TEST" }, + { OSMO_SCCP_SSN_RANAP, "RANAP" }, + { OSMO_SCCP_SSN_RNSAP, "RNSAP" }, + { OSMO_SCCP_SSN_GMLC_MAP, "GMLC_MAP" }, + { OSMO_SCCP_SSN_CAP, "CAP" }, + { OSMO_SCCP_SSN_gsmSCF_MAP, "gsmSCF_MAP" }, + { OSMO_SCCP_SSN_SIWF_MAP, "SIWF_MAP" }, + { OSMO_SCCP_SSN_SGSN_MAP, "SGSN_MAP" }, + { OSMO_SCCP_SSN_GGSN_MAP, "GGSN_MAP" }, + { OSMO_SCCP_SSN_PCAP, "PCAP" }, + { OSMO_SCCP_SSN_BSC_BSSAP, "BSC_BSSAP" }, + { OSMO_SCCP_SSN_MSC_BSSAP, "MSC_BSSAP" }, + { OSMO_SCCP_SSN_SMLC_BSSAP, "SMLC_BSSAP" }, + { OSMO_SCCP_SSN_BSS_OAM, "BSS_OAM" }, +}; -- To view, visit https://gerrit.osmocom.org/3363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1aedd7894acd69ddc887cd65a8a0df4b888838c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 13:50:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 13:50:05 +0000 Subject: [PATCH] libosmo-sccp[master]: fix osmo_sccp_addr_dump(): actually print RI Message-ID: Review at https://gerrit.osmocom.org/3364 fix osmo_sccp_addr_dump(): actually print RI Adjust xua_test accordingly. Change-Id: I93e0aa706867e7b1de7f7a6071e3c8af89772af0 --- M src/sccp_helpers.c M tests/xua/xua_test.ok 2 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/64/3364/1 diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index 471c9cb..db562db 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -282,7 +282,7 @@ buf[0] = '\0'; - append_to_buf(buf, &comma, "RI=7"); + append_to_buf(buf, &comma, "RI=%d", addr->ri); if (addr->presence & OSMO_SCCP_ADDR_T_PC) append_to_buf(buf, &comma, "PC=%u", addr->pc); diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index ca8572a..12d817d 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -1,14 +1,14 @@ digits='01234567' (8) digits='0123456' (7) sccp_addr_parse test case 0 -expected: RI=7,SSN=6,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919969679389) -parsed: RI=7,SSN=6,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919969679389) +expected: RI=1,SSN=6,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919969679389) +parsed: RI=1,SSN=6,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919969679389) sccp_addr_parse test case 1 -expected: RI=7,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992) -parsed: RI=7,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992) +expected: RI=1,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992) +parsed: RI=1,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992) sccp_addr_parse test case 2 -expected: RI=7,SSN=254,GTI=0 -parsed: RI=7,SSN=254,GTI=0 +expected: RI=2,SSN=254,GTI=0 +parsed: RI=2,SSN=254,GTI=0 Testing Decoded GT -> SUA encoding IN: TT=0,NPL=1,NAI=4,DIG=919969679389 0400000001000000040000003931393936393637393338390000000000000000000000000000000000000000 -- To view, visit https://gerrit.osmocom.org/3364 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93e0aa706867e7b1de7f7a6071e3c8af89772af0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 13:50:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 13:50:05 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp-addr vty: set RI to SSN_PC when setting a point-code Message-ID: Review at https://gerrit.osmocom.org/3365 sccp-addr vty: set RI to SSN_PC when setting a point-code Change-Id: I75c67d289693f1c2a049ac61cf2b2097d6e5687d --- M src/osmo_ss7_vty.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/65/3365/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index f60eef4..72d7946 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1301,6 +1301,8 @@ entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; entry->addr.pc = pc; + if (entry->addr.ri == OSMO_SCCP_RI_NONE) + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/3365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75c67d289693f1c2a049ac61cf2b2097d6e5687d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 13:50:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 13:50:06 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_helpers: check buf len in append_to_buf() Message-ID: Review at https://gerrit.osmocom.org/3366 sccp_helpers: check buf len in append_to_buf() Change-Id: I2e6d656871f952be8e719573fedf2154832841d7 --- M src/sccp_helpers.c 1 file changed, 21 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/66/3366/1 diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index db562db..1e83c8c 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -230,16 +230,19 @@ return osmo_sccp_tx_conn_resp_msg(scu, conn_id, resp_addr, msg); } -static void append_to_buf(char *buf, bool *comma, const char *fmt, ...) +static void append_to_buf(char *buf, size_t size, bool *comma, const char *fmt, ...) { va_list ap; + size_t printed; va_start(ap, fmt); if (*comma == true) { strcat(buf, ","); } else *comma = true; - vsprintf(buf+strlen(buf), fmt, ap); + printed = strlen(buf); + OSMO_ASSERT(printed <= size); + vsnprintf(buf + printed, size - printed, fmt, ap); va_end(ap); } @@ -260,16 +263,16 @@ if (gt->gti == OSMO_SCCP_GTI_TT_ONLY || gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC || gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC_NAI) - append_to_buf(buf, &comma, "TT=%u", gt->tt); + append_to_buf(buf, sizeof(buf), &comma, "TT=%u", gt->tt); if (gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC || gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC_NAI) - append_to_buf(buf, &comma, "NPL=%u", gt->npi); + append_to_buf(buf, sizeof(buf), &comma, "NPL=%u", gt->npi); if (gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC_NAI) - append_to_buf(buf, &comma, "NAI=%u", gt->nai); + append_to_buf(buf, sizeof(buf), &comma, "NAI=%u", gt->nai); - append_to_buf(buf, &comma, "DIG=%s", gt->digits); + append_to_buf(buf, sizeof(buf), &comma, "DIG=%s", gt->digits); return buf; } @@ -282,17 +285,17 @@ buf[0] = '\0'; - append_to_buf(buf, &comma, "RI=%d", addr->ri); + append_to_buf(buf, sizeof(buf), &comma, "RI=%d", addr->ri); if (addr->presence & OSMO_SCCP_ADDR_T_PC) - append_to_buf(buf, &comma, "PC=%u", addr->pc); + append_to_buf(buf, sizeof(buf), &comma, "PC=%u", addr->pc); if (addr->presence & OSMO_SCCP_ADDR_T_SSN) - append_to_buf(buf, &comma, "SSN=%u", addr->ssn); + append_to_buf(buf, sizeof(buf), &comma, "SSN=%u", addr->ssn); if (addr->presence & OSMO_SCCP_ADDR_T_IPv4) - append_to_buf(buf, &comma, "IP=%s", inet_ntoa(addr->ip.v4)); - append_to_buf(buf, &comma, "GTI=%u", addr->gt.gti); + append_to_buf(buf, sizeof(buf), &comma, "IP=%s", inet_ntoa(addr->ip.v4)); + append_to_buf(buf, sizeof(buf), &comma, "GTI=%u", addr->gt.gti); if (addr->presence & OSMO_SCCP_ADDR_T_GT) - append_to_buf(buf, &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); + append_to_buf(buf, sizeof(buf), &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); return buf; } @@ -305,17 +308,17 @@ buf[0] = '\0'; - append_to_buf(buf, &comma, "RI=%s", osmo_sccp_routing_ind_name(addr->ri)); + append_to_buf(buf, sizeof(buf), &comma, "RI=%s", osmo_sccp_routing_ind_name(addr->ri)); if (addr->presence & OSMO_SCCP_ADDR_T_PC) - append_to_buf(buf, &comma, "PC=%s", osmo_ss7_pointcode_print(ss7, addr->pc)); + append_to_buf(buf, sizeof(buf), &comma, "PC=%s", osmo_ss7_pointcode_print(ss7, addr->pc)); if (addr->presence & OSMO_SCCP_ADDR_T_SSN) - append_to_buf(buf, &comma, "SSN=%s", osmo_sccp_ssn_name(addr->ssn)); + append_to_buf(buf, sizeof(buf), &comma, "SSN=%s", osmo_sccp_ssn_name(addr->ssn)); if (addr->presence & OSMO_SCCP_ADDR_T_IPv4) - append_to_buf(buf, &comma, "IP=%s", inet_ntoa(addr->ip.v4)); - append_to_buf(buf, &comma, "GTI=%s", osmo_sccp_gti_name(addr->gt.gti)); + append_to_buf(buf, sizeof(buf), &comma, "IP=%s", inet_ntoa(addr->ip.v4)); + append_to_buf(buf, sizeof(buf), &comma, "GTI=%s", osmo_sccp_gti_name(addr->gt.gti)); if (addr->presence & OSMO_SCCP_ADDR_T_GT) - append_to_buf(buf, &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); + append_to_buf(buf, sizeof(buf), &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); return buf; } -- To view, visit https://gerrit.osmocom.org/3366 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e6d656871f952be8e719573fedf2154832841d7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 15:33:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 15:33:31 +0000 Subject: [PATCH] libosmo-sccp[master]: add osmo_sccp_addr_name() and three value_string[]s In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3363 to look at the new patch set (#2). add osmo_sccp_addr_name() and three value_string[]s osmo_sccp_addr_dump() just prints the raw values. In osmo_sccp_addr_name(), use osmo_ss7_pointcode_print() and newly added RI, SSN and GT value_string[] to print more human readable log output. Change-Id: Ie1aedd7894acd69ddc887cd65a8a0df4b888838c --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_helpers.c M src/sccp_sap.c 3 files changed, 84 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/63/3363/2 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 6ae8579..d44e347 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -60,6 +60,11 @@ OSMO_SCCP_RI_SSN_IP, }; +extern const struct value_string osmo_sccp_routing_ind_names[]; +static inline const char *osmo_sccp_routing_ind_name(enum osmo_sccp_routing_ind val) +{ return get_value_string(osmo_sccp_routing_ind_names, val); } + + /* Q.713 3.4.1 + RFC 3868 3.10.2.3 */ enum osmo_sccp_gti { OSMO_SCCP_GTI_NO_GT, @@ -68,6 +73,10 @@ OSMO_SCCP_GTI_TT_NPL_ENC, OSMO_SCCP_GTI_TT_NPL_ENC_NAI, }; + +extern const struct value_string osmo_sccp_gti_names[]; +static inline const char *osmo_sccp_gti_name(enum osmo_sccp_gti val) +{ return get_value_string(osmo_sccp_gti_names, val); } /* RFC 3868 3.10.2.3 */ enum osmo_sccp_npi { @@ -126,6 +135,10 @@ OSMO_SCCP_SSN_BSS_OAM = 253, }; +extern const struct value_string osmo_sccp_ssn_names[]; +static inline const char *osmo_sccp_ssn_name(enum osmo_sccp_ssn val) +{ return get_value_string(osmo_sccp_ssn_names, val); } + struct osmo_sccp_gt { uint8_t gti; uint8_t tt; diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index 2320fe5..471c9cb 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -274,6 +274,7 @@ return buf; } +/* Return string representation of SCCP address raw bytes in a static string. */ char *osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr) { static char buf[256]; @@ -295,3 +296,26 @@ return buf; } + +/* Like osmo_sccp_addr_dump() but print human readable representations instead of raw values. */ +char *osmo_sccp_addr_name(const struct osmo_ss7_instance *ss7, const struct osmo_sccp_addr *addr) +{ + static char buf[256]; + bool comma = false; + + buf[0] = '\0'; + + append_to_buf(buf, &comma, "RI=%s", osmo_sccp_routing_ind_name(addr->ri)); + + if (addr->presence & OSMO_SCCP_ADDR_T_PC) + append_to_buf(buf, &comma, "PC=%s", osmo_ss7_pointcode_print(ss7, addr->pc)); + if (addr->presence & OSMO_SCCP_ADDR_T_SSN) + append_to_buf(buf, &comma, "SSN=%s", osmo_sccp_ssn_name(addr->ssn)); + if (addr->presence & OSMO_SCCP_ADDR_T_IPv4) + append_to_buf(buf, &comma, "IP=%s", inet_ntoa(addr->ip.v4)); + append_to_buf(buf, &comma, "GTI=%s", osmo_sccp_gti_name(addr->gt.gti)); + if (addr->presence & OSMO_SCCP_ADDR_T_GT) + append_to_buf(buf, &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); + + return buf; +} diff --git a/src/sccp_sap.c b/src/sccp_sap.c index d4580ae..e5addb1 100644 --- a/src/sccp_sap.c +++ b/src/sccp_sap.c @@ -85,3 +85,50 @@ return prim_name_buf; } + +const struct value_string osmo_sccp_routing_ind_names[] = { + { OSMO_SCCP_RI_NONE, "NONE" }, + { OSMO_SCCP_RI_GT, "GT" }, + { OSMO_SCCP_RI_SSN_PC, "SSN_PC" }, + { OSMO_SCCP_RI_SSN_IP, "SSN_IP" }, + { 0, NULL } +}; + +const struct value_string osmo_sccp_gti_names[] = { + { OSMO_SCCP_GTI_NO_GT, "NO_GT" }, + { OSMO_SCCP_GTI_NAI_ONLY, "NAI_ONLY" }, + { OSMO_SCCP_GTI_TT_ONLY, "TT_ONLY" }, + { OSMO_SCCP_GTI_TT_NPL_ENC, "TT_NPL_ENC" }, + { OSMO_SCCP_GTI_TT_NPL_ENC_NAI, "TT_NPL_ENC_NAI" }, + { 0, NULL } +}; + +const struct value_string osmo_sccp_ssn_names[] = { + { OSMO_SCCP_SSN_MGMT, "MGMT" }, + { OSMO_SCCP_SSN_ISUP, "ISUP" }, + { OSMO_SCCP_SSN_OMAP, "OMAP" }, + { OSMO_SCCP_SSN_MAP, "MAP" }, + { OSMO_SCCP_SSN_HLR, "HLR" }, + { OSMO_SCCP_SSN_VLR, "VLR" }, + { OSMO_SCCP_SSN_MSC, "MSC" }, + { OSMO_SCCP_SSN_EIR, "EIR" }, + { OSMO_SCCP_SSN_AUC, "AUC" }, + { OSMO_SCCP_SSN_ISDN_SS, "ISDN_SS" }, + { OSMO_SCCP_SSN_RES_INTL, "RES_INTL" }, + { OSMO_SCCP_SSN_BISDN, "BISDN" }, + { OSMO_SCCP_SSN_TC_TEST, "TC_TEST" }, + { OSMO_SCCP_SSN_RANAP, "RANAP" }, + { OSMO_SCCP_SSN_RNSAP, "RNSAP" }, + { OSMO_SCCP_SSN_GMLC_MAP, "GMLC_MAP" }, + { OSMO_SCCP_SSN_CAP, "CAP" }, + { OSMO_SCCP_SSN_gsmSCF_MAP, "gsmSCF_MAP" }, + { OSMO_SCCP_SSN_SIWF_MAP, "SIWF_MAP" }, + { OSMO_SCCP_SSN_SGSN_MAP, "SGSN_MAP" }, + { OSMO_SCCP_SSN_GGSN_MAP, "GGSN_MAP" }, + { OSMO_SCCP_SSN_PCAP, "PCAP" }, + { OSMO_SCCP_SSN_BSC_BSSAP, "BSC_BSSAP" }, + { OSMO_SCCP_SSN_MSC_BSSAP, "MSC_BSSAP" }, + { OSMO_SCCP_SSN_SMLC_BSSAP, "SMLC_BSSAP" }, + { OSMO_SCCP_SSN_BSS_OAM, "BSS_OAM" }, + { 0, NULL } +}; -- To view, visit https://gerrit.osmocom.org/3363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie1aedd7894acd69ddc887cd65a8a0df4b888838c Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 27 15:33:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 15:33:32 +0000 Subject: [PATCH] libosmo-sccp[master]: cosmetic: ws in log Message-ID: Review at https://gerrit.osmocom.org/3367 cosmetic: ws in log Change-Id: If5a56ec170d4e91ce070f6fa9c9cfe5bbc121186 --- M src/sccp2sua.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/67/3367/1 diff --git a/src/sccp2sua.c b/src/sccp2sua.c index 499b55b..ad948c9 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -231,7 +231,7 @@ break; default: LOGP(DLSUA, LOGL_ERROR, "Unknown CCP Routing Indicator %u" - "requested\n", in->ri); + " requested\n", in->ri); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/3367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If5a56ec170d4e91ce070f6fa9c9cfe5bbc121186 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 15:49:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 15:49:22 +0000 Subject: osmo-iuh[master]: cn unitdata: verify correct remote addr In-Reply-To: References: Message-ID: Patch Set 2: it's not really important, but merging this. We can always lift that limitation later. -- To view, visit https://gerrit.osmocom.org/3113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7190b4c3a05e8bac0eeffa1eab18c9e47429cb17 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh 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 Jul 27 15:49:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 15:49:26 +0000 Subject: [MERGED] osmo-iuh[master]: cn unitdata: verify correct remote addr In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cn unitdata: verify correct remote addr ...................................................................... cn unitdata: verify correct remote addr When receiving unitdata from the CN, verify that it is indeed coming from the remote address that matches our CS/PS domain settings. This patch came from an earlier stage where the is_ps out-parameter was actually used. While it currently isn't, it doesn't hurt to leave it there. Change-Id: I7190b4c3a05e8bac0eeffa1eab18c9e47429cb17 --- M src/hnbgw_cn.c 1 file changed, 28 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 8124ce5..e967260 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -240,6 +240,31 @@ return rc; } +static bool pc_and_ssn_match(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b) +{ + return (a == b) + || ((a->pc == b->pc) + && (a->ssn == b->ssn)); +} + +static int classify_cn_remote_addr(const struct hnb_gw *gw, + const struct osmo_sccp_addr *cn_remote_addr, + bool *is_ps) +{ + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_cs)) { + if (is_ps) + *is_ps = false; + return 0; + } + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_ps)) { + if (is_ps) + *is_ps = true; + return 0; + } + LOGP(DMAIN, LOGL_ERROR, "Unexpected remote address, matches neither CS nor PS address: %s\n", + osmo_sccp_addr_dump(cn_remote_addr)); + return -1; +} static int handle_cn_unitdata(struct hnbgw_cnlink *cnlink, const struct osmo_scu_unitdata_param *param, @@ -251,6 +276,9 @@ return -1; } + if (classify_cn_remote_addr(cnlink->gw, ¶m->calling_addr, NULL) < 0) + return -1; + return handle_cn_ranap(cnlink, msgb_l2(oph->msg), msgb_l2len(oph->msg)); } -- To view, visit https://gerrit.osmocom.org/3113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7190b4c3a05e8bac0eeffa1eab18c9e47429cb17 Gerrit-PatchSet: 3 Gerrit-Project: osmo-iuh 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 Jul 27 15:56:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 15:56:41 +0000 Subject: libosmo-sccp[master]: sccp: derive local address from given sccp instance In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/3330/2/src/sccp_user.c File src/sccp_user.c: Line 250: memset(dest_addr, 0, sizeof(*dest_addr)); (btw when https://gerrit.osmocom.org/3341 is merged this isn't strictly needed. Btw btw, hfreyther, and now me too, tend to prefer clearing by assignment: *dest_addr = (struct osmo_sccp_addr){}; but neither of these are important, just noting.) Line 251: osmo_sccp_make_addr_pc_ssn(dest_addr, ss7->cfg.primary_pc, ssn); build failure: it appears you need to #include -- To view, visit https://gerrit.osmocom.org/3330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 27 15:59:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 15:59:04 +0000 Subject: libosmo-sccp[master]: sccp: fix possible nullpointer deref In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3354/2/src/sccp_user.c File src/sccp_user.c: Line 342: asp->cfg.remote.host = NULL; I still prefer 'a ? b : c' making 7 lines less bloat, but whatever. -- To view, visit https://gerrit.osmocom.org/3354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jul 27 16:00:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 16:00:02 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 3: hmm, can we get someone else to approve as well? -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 27 16:03:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 16:03:32 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 13: Code-Review+2 I guess it's time to give this a try. -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 13 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 27 16:04:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 16:04:48 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 13: Verified+1 I haven't verified that this works, but since it is only adding a script to osmo-ci, it can't break anything. -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 13 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jul 27 16:51:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 16:51:20 +0000 Subject: [PATCH] osmo-msc[master]: mscsplit: various preparations to separate MSC from BSC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3345 to look at the new patch set (#2). mscsplit: various preparations to separate MSC from BSC Disable large parts of the code that depend on BSC presence. The code sections disabled by #if BEFORE_MSCSPLIT shall be modified or dropped in the course of adding the A-interface. Don't set msg->lchan nor msg->dst. Don't use lchan in libmsc. Decouple lac from bts. Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication: Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to different interfaces depending on the actual subscriber connection. While iu_tx() is going to be functional fairly soon, the a_tx() is going to be just a dummy for some time (see comment). Add Iu specific fields in gsm_subscriber_connection: the UE connection pointer and an indicator for the Integrity Protection status on Iu (to be fully implemented in later commits). Add lac member to gsm_subscriber_connection, to allow decoupling from bts->location_area_code. The conn->lac will actually be set in iu.c in an upcoming commit ("add iucs.[hc]"). move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi(). libmsc: duplicate gsm0808 / gsm48 functions (towards BSC). In osmo-nitb, libmsc would directly call the functions on the BSC level, not always via the bsc_api. When separating libmsc from libbsc, some functions are missing from the linkage. Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also add a _tx to gsm0808_cipher_mode(): * add msc_gsm0808_tx_cipher_mode() (dummy/stub) * add msc_gsm48_tx_mm_serv_ack() * add msc_gsm48_tx_mm_serv_rej() Call these from libmsc instead of * gsm0808_cipher_mode() * gsm48_tx_mm_serv_ack() * gsm48_tx_mm_serv_rej() Also add a comment related to msc_gsm0808_tx_cipher_mode() in two places. Remove internal RTP streaming code; OsmoNITB supported that, but for OsmoMSC, this will be done with an external MGCP gateway. Remove LCHAN_MODIFY from internal MNCC state machine. Temporarily disable all paging to be able to link libmsc without libbsc. Skip the paging part of channel_test because the paging is now disabled. Employ fake paging shims in order for msc_vlr_tests to still work. msc_compl_l3(): publish in .h, tweak return value. Use new libmsc enum values for return val, to avoid dependency on libbsc headers. Make callable from other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c add gsm_encr to subscr_conn move subscr_request to gsm_subscriber.h subscr_request_channel() -> subscr_request_conn() move to libmsc: osmo_stats_vty_add_cmds() gsm_04_08: remove apply_codec_restrictions() gsm0408_test: use NULL for root ctx move to libbsc: gsm_bts_neighbor() move to libbsc: lchan_next_meas_rep() move vty config for t3212 to network level (periodic lu) remove unneccessary linking from some tests remove handle_abisip_signal() abis_rsl.c: don't use libvlr from libbsc gsm_subscriber_connection: put the LAC here, so that it is available without accessing conn->bts. In bsc_api.c, place this lac in conn for the sake of transition: Iu and A will use this new field to pass the LAC around, but in a completely separate OsmoBSC this is not actually needed. It can be removed again from osmo-bsc.git when the time has come. Siemens MRPCI: completely drop sending the MRPCI messages for now, they shall be added in osmo-bsc once the A-Interface code has settled. See OS#2389. Related: OS#1845 OS#2257 OS#2389 Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c --- M include/openbsc/Makefile.am M include/openbsc/gsm_04_08.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/mncc.h A include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_vty.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/handover_decision.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/gsm_data.c M src/libcommon/talloc_ctx.c M src/libmsc/Makefile.am A src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/mncc_builtin.c M src/libmsc/mncc_sock.c A src/libmsc/msc_ifaces.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/vty_interface_layer3.c M tests/bsc/Makefile.am M tests/channel/Makefile.am M tests/db/Makefile.am M tests/gsm0408/gsm0408_test.c M tests/msc_vlr/Makefile.am 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_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 39 files changed, 470 insertions(+), 1,071 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/45/3345/2 diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 456a4a2..1dfe6c3 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -54,6 +54,7 @@ misdn.h \ mncc.h \ mncc_int.h \ + msc_ifaces.h \ nat_rewrite_trie.h \ network_listen.h \ oap_client.h \ diff --git a/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h index c40d96d..6d6ead1 100644 --- a/include/openbsc/gsm_04_08.h +++ b/include/openbsc/gsm_04_08.h @@ -65,8 +65,6 @@ int send_siemens_mrpci(struct gsm_lchan *lchan, uint8_t *classmark2_lv); int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type); int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, uint8_t *mi_type); -int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_subscr *bsub); int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode); int gsm48_rx_rr_modif_ack(struct msgb *msg); diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index fa2fed7..17b3d71 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -26,6 +26,7 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; +struct ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -117,6 +118,12 @@ uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be truncated */ }; +enum integrity_protection_state { + INTEGRITY_PROTECTION_NONE = 0, + INTEGRITY_PROTECTION_IK = 1, + INTEGRITY_PROTECTION_IK_CK = 2, +}; + /* active radio connection of a mobile subscriber */ struct gsm_subscriber_connection { /* global linked list of subscriber_connections */ @@ -176,6 +183,15 @@ enum ran_type via_ran; struct gsm_classmark classmark; + + uint16_t lac; + struct gsm_encr encr; + + /* which Iu-CS connection, if any. */ + struct { + struct ue_conn_ctx *ue_ctx; + int integrity_protection; + } iu; }; @@ -311,6 +327,12 @@ }; struct gsm_network { + /* TODO MSCSPLIT the gsm_network struct is basically a kitchen sink for + * global settings and variables, "madly" mixing BSC and MSC stuff. Split + * this in e.g. struct osmo_bsc and struct osmo_msc, with the things + * these have in common, like country and network code, put in yet + * separate structs and placed as members in osmo_bsc and osmo_msc. */ + /* global parameters */ uint16_t country_code; uint16_t network_code; @@ -416,6 +438,9 @@ uint16_t gsup_server_port; struct vlr_instance *vlr; + + /* Periodic location update default value */ + uint8_t t3212; }; struct osmo_esme; @@ -470,10 +495,6 @@ extern void talloc_ctx_init(void *ctx_root); int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); - -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - uint16_t arfcn, uint8_t bsic); enum gsm_bts_type parse_btstype(const char *arg); const char *btstype2str(enum gsm_bts_type type); @@ -557,7 +578,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_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan); int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); int gsm_bts_model_register(struct gsm_bts_model *model); diff --git a/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h index c65b8a3..60eb0cd 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/include/openbsc/gsm_subscriber.h @@ -19,8 +19,6 @@ #define GSM_SUBSCRIBER_NO_EXPIRATION 0x0 -struct subscr_request; - enum gsm_subscriber_field { GSM_SUBSCRIBER_IMSI, GSM_SUBSCRIBER_TMSI, @@ -34,17 +32,35 @@ GSM_SUBSCRIBER_UPDATE_EQUIPMENT, }; -int subscr_update(struct vlr_subscr *vsub, struct gsm_bts *bts, int reason); +/* + * Struct for pending channel requests. This is managed in the + * llist_head requests of each subscriber. The reference counting + * should work in such a way that a subscriber with a pending request + * remains in memory. + */ +struct subscr_request { + struct llist_head entry; + + /* the callback data */ + gsm_cbfn *cbfn; + void *param; +}; + +int subscr_update(struct vlr_subscr *vsub, int reason); /* * Paging handling with authentication */ -struct subscr_request *subscr_request_channel(struct vlr_subscr *vsub, - int channel_type, - gsm_cbfn *cbfn, void *param); +struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub, + int channel_type, + gsm_cbfn *cbfn, void *param); + void subscr_remove_request(struct subscr_request *req); int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param); +int msc_fake_paging_request(struct vlr_subscr *vsub); +void msc_fake_paging_request_stop(struct vlr_subscr *vsub); + #endif /* _GSM_SUBSCR_H */ diff --git a/include/openbsc/mncc.h b/include/openbsc/mncc.h index 49f0c8b..881e041 100644 --- a/include/openbsc/mncc.h +++ b/include/openbsc/mncc.h @@ -155,9 +155,6 @@ int notify; /* 0..127 */ int emergency; char imsi[16]; - - unsigned char lchan_type; - unsigned char lchan_mode; }; struct gsm_data_frame { @@ -179,7 +176,6 @@ uint32_t called_offset; uint32_t signal_offset; uint32_t emergency_offset; - uint32_t lchan_type_offset; }; struct gsm_mncc_rtp { diff --git a/include/openbsc/msc_ifaces.h b/include/openbsc/msc_ifaces.h new file mode 100644 index 0000000..83aad92 --- /dev/null +++ b/include/openbsc/msc_ifaces.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include + +/* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, + * i.e. in the direction towards the mobile device (MS aka UE). + * + * 2G will use the A-interface, + * 3G aka UMTS will use the Iu-interface (for the MSC, it's IuCS). + * + * To allow linking parts of the MSC code without having to include entire + * infrastructures of external libraries, the core transmitting and receiving + * functions are left unimplemented. For example, a unit test does not need to + * link against external ASN1 libraries if it is never going to encode actual + * outgoing messages. It is up to each building scope to implement real world + * functions or to plug mere dummy implementations. + * + * For example, msc_tx_dtap(conn, msg), depending on conn->via_iface, will call + * either iu_tx() or a_tx() [note: at time of writing, the A-interface is not + * yet implemented]. When you try to link against libmsc, you will find that + * the compiler complains about an undefined reference to iu_tx(). If you, + * however, link against libiu as well as the osmo-iuh libs (etc.), iu_tx() is + * available. A unit test may instead simply implement a dummy iu_tx() function + * and not link against osmo-iuh. + */ + +/* Each main linkage must implement this function (see comment above). */ +extern int iu_tx(struct msgb *msg, uint8_t sapi); + +/* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface + * gets implemented, it should be in a separate lib (like libiu), this function + * should move there, and the following comment should remain here: " + * Each main linkage must implement this function (see comment above). + * " */ +extern int a_tx(struct msgb *msg); + +int msc_tx_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg); + +int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn); +int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, + enum gsm48_reject_value value); + +/* TODO: specific to A interface, move this away */ +int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, + const uint8_t *key, int len, int include_imeisv); diff --git a/include/openbsc/osmo_msc.h b/include/openbsc/osmo_msc.h index 0642c91..5a26b60 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/openbsc/osmo_msc.h @@ -51,6 +51,11 @@ return get_value_string(subscr_conn_from_names, val); } +enum msc_compl_l3_rc { + MSC_CONN_ACCEPT = 0, + MSC_CONN_REJECT = 1, +}; + struct bsc_api *msc_bsc_api(); diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 7ae3eeb..441b386 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1423,6 +1423,19 @@ } } +static struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan) +{ + struct gsm_meas_rep *meas_rep; + + meas_rep = &lchan->meas_rep[lchan->meas_rep_idx]; + memset(meas_rep, 0, sizeof(*meas_rep)); + meas_rep->lchan = lchan; + lchan->meas_rep_idx = (lchan->meas_rep_idx + 1) + % ARRAY_SIZE(lchan->meas_rep); + + return meas_rep; +} + static int rsl_rx_meas_res(struct msgb *msg) { struct abis_rsl_dchan_hdr *dh = msgb_l2(msg); diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 947644e..c2828e3 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -264,6 +264,7 @@ conn->lchan = lchan; conn->bts = lchan->ts->trx->bts; conn->via_ran = RAN_GERAN_A; + conn->lac = conn->bts->location_area_code; lchan->conn = conn; llist_add_tail(&conn->entry, &net->subscr_conns); return conn; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 3bd56ea..722753a 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -593,18 +593,12 @@ (sp->penalty_time*20)+20, VTY_NEWLINE); } - /* Is periodic LU enabled or disabled? */ - if (bts->si_common.chan_desc.t3212 == 0) - vty_out(vty, " no periodic location update%s", VTY_NEWLINE); - else - vty_out(vty, " periodic location update %u%s", - bts->si_common.chan_desc.t3212 * 6, VTY_NEWLINE); - if (gsm_bts_get_radio_link_timeout(bts) < 0) vty_out(vty, " radio-link-timeout infinite%s", VTY_NEWLINE); else vty_out(vty, " radio-link-timeout %d%s", gsm_bts_get_radio_link_timeout(bts), VTY_NEWLINE); + vty_out(vty, " channel allocator %s%s", bts->chan_alloc_reverse ? "descending" : "ascending", VTY_NEWLINE); @@ -841,6 +835,11 @@ vty_out(vty, " timezone %d %d%s", gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE); } + if (gsmnet->t3212 == 0) + vty_out(vty, " no periodic location update%s", VTY_NEWLINE); + else + vty_out(vty, " periodic location update %u%s", + gsmnet->t3212 * 6, VTY_NEWLINE); return CMD_SUCCESS; } @@ -2262,34 +2261,6 @@ bts->si_common.cell_ro_sel_par.present = 1; bts->si_common.cell_ro_sel_par.penalty_time = 31; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_per_loc_upd, cfg_bts_per_loc_upd_cmd, - "periodic location update <6-1530>", - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval in Minutes\n") -{ - struct gsm_bts *bts = vty->index; - - bts->si_common.chan_desc.t3212 = atoi(argv[0]) / 6; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_per_loc_upd, cfg_bts_no_per_loc_upd_cmd, - "no periodic location update", - NO_STR - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n") -{ - struct gsm_bts *bts = vty->index; - - bts->si_common.chan_desc.t3212 = 0; return CMD_SUCCESS; } @@ -4129,7 +4100,6 @@ install_element_ve(&show_paging_group_cmd); logging_vty_add_cmds(NULL); - osmo_stats_vty_add_cmds(); install_element(GSMNET_NODE, &cfg_net_neci_cmd); install_element(GSMNET_NODE, &cfg_net_handover_cmd); @@ -4189,8 +4159,6 @@ install_element(BTS_NODE, &cfg_bts_rach_ec_allowed_cmd); install_element(BTS_NODE, &cfg_bts_rach_ac_class_cmd); install_element(BTS_NODE, &cfg_bts_ms_max_power_cmd); - install_element(BTS_NODE, &cfg_bts_per_loc_upd_cmd); - install_element(BTS_NODE, &cfg_bts_no_per_loc_upd_cmd); install_element(BTS_NODE, &cfg_bts_cell_resel_hyst_cmd); install_element(BTS_NODE, &cfg_bts_rxlev_acc_min_cmd); install_element(BTS_NODE, &cfg_bts_cell_bar_qualify_cmd); diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index 3447d27..7c5e0e9 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -270,61 +270,6 @@ return rsl_siemens_mrpci(lchan, &mrpci); } -int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, uint8_t *mi_type) -{ - /* Check the size for the classmark */ - if (length < 1 + *classmark2_lv) - return -1; - - uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1; - if (length < 2 + *classmark2_lv + mi_lv[0]) - return -2; - - *mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; - return gsm48_mi_to_string(mi_string, GSM48_MI_SIZE, mi_lv+1, *mi_lv); -} - -int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length, - char *mi_string, uint8_t *mi_type) -{ - static const uint32_t classmark_offset = - offsetof(struct gsm48_pag_resp, classmark2); - uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2; - return gsm48_extract_mi(classmark2_lv, length - classmark_offset, - mi_string, mi_type); -} - -int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_subscr *bsub) -{ - struct gsm_bts *bts = msg->lchan->ts->trx->bts; - struct gsm48_hdr *gh = msgb_l3(msg); - uint8_t *classmark2_lv = gh->data + 1; - - if (is_siemens_bts(bts)) - send_siemens_mrpci(msg->lchan, classmark2_lv); - - if (!conn->bsub) { - conn->bsub = bsub; - } else if (conn->bsub != bsub) { - LOGP(DRR, LOGL_ERROR, - "<- Channel already owned by someone else?\n"); - bsc_subscr_put(bsub); - return -EINVAL; - } else { - DEBUGP(DRR, "<- Channel already owned by us\n"); - bsc_subscr_put(bsub); - bsub = conn->bsub; - } - - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED]); - - /* Stop paging on the bts we received the paging response */ - paging_request_stop(&bts->network->bts_list, conn->bts, bsub, conn, - msg); - return 0; -} - /* Chapter 9.1.9: Ciphering Mode Command */ int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv) { diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 0f07bca..8d7e047 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -33,6 +33,27 @@ #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) +{ + 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 */ + + 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; + } + + return NULL; +} + + /* issue handover to a cell identified by ARFCN and BSIC */ static int handover_to_arfcn_bsic(struct gsm_lchan *lchan, uint16_t arfcn, uint8_t bsic) diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index fc9caaf..8e19bb2 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -56,6 +56,9 @@ net->country_code = country_code; net->network_code = network_code; + /* Use 30 min periodic update interval as sane default */ + net->t3212 = 5; + INIT_LLIST_HEAD(&net->trans_list); INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->subscr_conns); @@ -107,6 +110,30 @@ return msg; } +int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, uint8_t *mi_type) +{ + /* Check the size for the classmark */ + if (length < 1 + *classmark2_lv) + return -1; + + uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1; + if (length < 2 + *classmark2_lv + mi_lv[0]) + return -2; + + *mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; + return gsm48_mi_to_string(mi_string, GSM48_MI_SIZE, mi_lv+1, *mi_lv); +} + +int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length, + char *mi_string, uint8_t *mi_type) +{ + static const uint32_t classmark_offset = + offsetof(struct gsm48_pag_resp, classmark2); + uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2; + return gsm48_extract_mi(classmark2_lv, length - classmark_offset, + mi_string, mi_type); +} + uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref) { const uint8_t rp_msg_ref = *next_rp_ref; diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 86b4c53..1791687 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -284,6 +284,34 @@ return CMD_SUCCESS; } +DEFUN(cfg_net_per_loc_upd, cfg_net_per_loc_upd_cmd, + "periodic location update <6-1530>", + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval in Minutes\n") +{ + struct gsm_network *net = vty->index; + + net->t3212 = atoi(argv[0]) / 6; + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_no_per_loc_upd, cfg_net_no_per_loc_upd_cmd, + "no periodic location update", + NO_STR + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n") +{ + struct gsm_network *net = vty->index; + + net->t3212 = 0; + + return CMD_SUCCESS; +} + static struct gsm_network *vty_global_gsm_network = NULL; /* initialize VTY elements used in both BSC and MSC */ @@ -292,6 +320,8 @@ { OSMO_ASSERT(vty_global_gsm_network == NULL); vty_global_gsm_network = network; + + osmo_stats_vty_add_cmds(); install_element(CONFIG_NODE, &cfg_net_cmd); install_node(&net_node, config_write_net); @@ -310,6 +340,8 @@ install_element(GSMNET_NODE, &cfg_net_timezone_cmd); install_element(GSMNET_NODE, &cfg_net_timezone_dst_cmd); install_element(GSMNET_NODE, &cfg_net_no_timezone_cmd); + install_element(GSMNET_NODE, &cfg_net_per_loc_upd_cmd); + install_element(GSMNET_NODE, &cfg_net_no_per_loc_upd_cmd); install_element(GSMNET_NODE, &cfg_net_dyn_ts_allow_tch_f_cmd); return CMD_SUCCESS; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 7c717a4..f6fde37 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -71,25 +71,6 @@ return 0; } -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - 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 */ - - llist_for_each_entry(neigh, &bts->network->bts_list, list) { - if (neigh->c0->arfcn == arfcn && - neigh->bsic == bsic) - return neigh; - } - - return NULL; -} - 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)" }, @@ -210,19 +191,6 @@ return 1; } -struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan) -{ - struct gsm_meas_rep *meas_rep; - - meas_rep = &lchan->meas_rep[lchan->meas_rep_idx]; - memset(meas_rep, 0, sizeof(*meas_rep)); - meas_rep->lchan = lchan; - lchan->meas_rep_idx = (lchan->meas_rep_idx + 1) - % ARRAY_SIZE(lchan->meas_rep); - - return meas_rep; -} - int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) { OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); @@ -322,7 +290,7 @@ bts->si_common.chan_desc.att = 1; /* attachment required */ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = 5; /* Use 30 min periodic update interval as sane default */ + bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ llist_add_tail(&bts->list, &net->bts_list); diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c index 5e3d9ae..c8e9cd3 100644 --- a/src/libcommon/talloc_ctx.c +++ b/src/libcommon/talloc_ctx.c @@ -44,7 +44,6 @@ 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_sub_req_ctx = talloc_named_const(ctx_root, 0, "subscr_request"); 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"); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index bb2a4a1..3c06514 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -23,6 +23,7 @@ $(NULL) libmsc_a_SOURCES = \ + a_iface.c \ auth.c \ db.c \ gsm_04_08.c \ @@ -32,6 +33,7 @@ mncc.c \ mncc_builtin.c \ mncc_sock.c \ + msc_ifaces.c \ rrlp.c \ silent_call.c \ sms_queue.c \ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c new file mode 100644 index 0000000..1f471f9 --- /dev/null +++ b/src/libmsc/a_iface.c @@ -0,0 +1,45 @@ +/* A-interface implementation, from MSC to BSC */ + +/* (C) 2016 by sysmocom s.m.f.c GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include + +#include +#include +#include + +int a_tx(struct msgb *msg) +{ + LOGP(DMSC, LOGL_ERROR, "message to be sent to BSC, but A-interface" + " not implemented.\n%s\n", osmo_hexdump(msg->data, msg->len)); + return -1; +} + +int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, + const uint8_t *key, int len, int include_imeisv) +{ + /* TODO generalize for A- and Iu interfaces, don't name after 08.08 */ + LOGP(DMSC, LOGL_ERROR, "gsm0808_cipher_mode(): message to be sent to" + " BSC, but A interface not yet implemented.\n"); + return -1; +} diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 6cea242..21ffaaa 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -71,10 +72,9 @@ #include + void *tall_locop_ctx; void *tall_authciphop_ctx; - -static int tch_rtp_signal(struct gsm_lchan *lchan, int signal); static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, uint32_t send_tmsi); @@ -86,29 +86,6 @@ uint16_t mnc; uint16_t lac; }; - -static int apply_codec_restrictions(struct gsm_bts *bts, - struct gsm_mncc_bearer_cap *bcap) -{ - int i, j; - - /* remove unsupported speech versions from list */ - for (i = 0, j = 0; bcap->speech_ver[i] >= 0; i++) { - if (bcap->speech_ver[i] == GSM48_BCAP_SV_FR) - bcap->speech_ver[j++] = GSM48_BCAP_SV_FR; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_EFR && bts->codec.efr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_EFR; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_AMR_F && bts->codec.amr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_AMR_F; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_HR && bts->codec.hr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_HR; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_AMR_H && bts->codec.amr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_AMR_H; - } - bcap->speech_ver[j] = -1; - - return 0; -} static uint32_t new_callref = 0x80000001; @@ -126,27 +103,6 @@ * work that the caller no longer has to do */ if (trans) { gh->proto_discr = trans->protocol | (trans->transaction_id << 4); - msg->lchan = trans->conn->lchan; - } - - if (msg->lchan) { - struct e1inp_sign_link *sign_link = - msg->lchan->ts->trx->rsl_link; - - msg->dst = sign_link; - if (gsm48_hdr_pdisc(gh) == GSM48_PDISC_CC) - DEBUGP(DCC, "(bts %d trx %d ts %d ti %02x) " - "Sending '%s' to MS.\n", - sign_link->trx->bts->nr, - sign_link->trx->nr, msg->lchan->ts->nr, - gh->proto_discr & 0xf0, - gsm48_cc_msg_name(gh->msg_type)); - else - DEBUGP(DCC, "(bts %d trx %d ts %d pd %02x) " - "Sending 0x%02x to MS.\n", - sign_link->trx->bts->nr, - sign_link->trx->nr, msg->lchan->ts->nr, - gh->proto_discr, gh->msg_type); } return gsm0808_submit_dtap(conn, msg, 0, 0); @@ -187,7 +143,6 @@ /* Chapter 9.2.14 : Send LOCATION UPDATING REJECT */ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause) { - struct gsm_bts *bts = conn->bts; struct msgb *msg; msg = gsm48_create_loc_upd_rej(cause); @@ -196,11 +151,8 @@ return -1; } - msg->lchan = conn->lchan; - - LOGP(DMM, LOGL_INFO, "Subscriber %s: LOCATION UPDATING REJECT " - "LAC=%u BTS=%u\n", vlr_subscr_name(conn->vsub), - bts->location_area_code, bts->nr); + LOGP(DMM, LOGL_INFO, "Subscriber %s: LOCATION UPDATING REJECT\n", + vlr_subscr_name(conn->vsub)); return gsm48_conn_sendmsg(msg, conn, NULL); } @@ -214,8 +166,6 @@ struct gsm48_loc_area_id *lai; uint8_t *mid; - msg->lchan = conn->lchan; - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); gh->proto_discr = GSM48_PDISC_MM; gh->msg_type = GSM48_MT_MM_LOC_UPD_ACCEPT; @@ -223,7 +173,7 @@ lai = (struct gsm48_loc_area_id *) msgb_put(msg, sizeof(*lai)); gsm48_generate_lai(lai, conn->network->country_code, conn->network->network_code, - conn->bts->location_area_code); + conn->lac); if (send_tmsi == GSM_RESERVED_TMSI) { /* we did not allocate a TMSI to the MS, so we need to @@ -257,8 +207,6 @@ { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 ID REQ"); struct gsm48_hdr *gh; - - msg->lchan = conn->lchan; gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); gh->proto_discr = GSM48_PDISC_MM; @@ -376,7 +324,7 @@ &old_lai.plmn.mnc, &old_lai.lac); new_lai.plmn.mcc = conn->network->country_code; new_lai.plmn.mnc = conn->network->network_code; - new_lai.lac = conn->bts->location_area_code; + new_lai.lac = conn->lac; DEBUGP(DMM, "LU/new-LAC: %u/%u\n", old_lai.lac, new_lai.lac); lu_fsm = vlr_loc_update(conn->conn_fsm, @@ -436,8 +384,6 @@ struct tm* local_time; int tzunits; int dst = 0; - - msg->lchan = conn->lchan; gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); gh->proto_discr = GSM48_PDISC_MM; @@ -588,7 +534,6 @@ if (autn) DEBUGP(DMM, " AUTH REQ (autn = %s)\n", osmo_hexdump_nospc(autn, 16)); - msg->lchan = conn->lchan; gh->proto_discr = GSM48_PDISC_MM; gh->msg_type = GSM48_MT_MM_AUTH_REQ; @@ -663,7 +608,7 @@ * b) Try to parse the TMSI. If we do not have one reject * c) Check that we know the subscriber with the TMSI otherwise reject * with a HLR cause - * d) Set the subscriber on the gsm_lchan and accept + * d) Set the subscriber on the conn and accept * * Keep this function non-static for direct invocation by unit tests. */ @@ -688,19 +633,19 @@ lai.plmn.mcc = conn->network->country_code; lai.plmn.mnc = conn->network->network_code; - lai.lac = conn->bts->location_area_code; + lai.lac = conn->lac; DEBUGP(DMM, "<- CM SERVICE REQUEST "); if (msg->data_len < sizeof(struct gsm48_service_request*)) { DEBUGPC(DMM, "wrong sized message\n"); - return gsm48_tx_mm_serv_rej(conn, - GSM48_REJECT_INCORRECT_MESSAGE); + return msc_gsm48_tx_mm_serv_rej(conn, + GSM48_REJECT_INCORRECT_MESSAGE); } if (msg->data_len < req->mi_len + 6) { DEBUGPC(DMM, "does not fit in packet\n"); - return gsm48_tx_mm_serv_rej(conn, - GSM48_REJECT_INCORRECT_MESSAGE); + return msc_gsm48_tx_mm_serv_rej(conn, + GSM48_REJECT_INCORRECT_MESSAGE); } gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); @@ -716,8 +661,8 @@ mi_string); } else { DEBUGPC(DMM, "mi_type is not expected: %d\n", mi_type); - return gsm48_tx_mm_serv_rej(conn, - GSM48_REJECT_INCORRECT_MESSAGE); + return msc_gsm48_tx_mm_serv_rej(conn, + GSM48_REJECT_INCORRECT_MESSAGE); } osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, (classmark2 + classmark2_len)); @@ -739,9 +684,6 @@ /* logging already happened in msc_create_conn_fsm() */ return rc; } - - if (is_siemens_bts(conn->bts)) - send_siemens_mrpci(msg->lchan, classmark2-1); vlr_proc_acc_req(conn->conn_fsm, SUBSCR_CONN_E_ACCEPTED, @@ -792,7 +734,6 @@ gsm48_mi_type_name(mi_type), mi_string); break; } - /* TODO? We used to remember the subscriber's classmark1 here and * stored it in the old sqlite db, but now we store it in a conn that @@ -1100,7 +1041,7 @@ lai.plmn.mcc = conn->network->country_code; lai.plmn.mnc = conn->network->network_code; - lai.lac = conn->bts->location_area_code; /* (will be replaced by conn->lac soon) */ + lai.lac = conn->lac; resp = (struct gsm48_pag_resp *) &gh->data[0]; gsm48_paging_extract_mi(resp, msgb_l3len(msg) - sizeof(*gh), @@ -1185,8 +1126,6 @@ { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 APP INF"); struct gsm48_hdr *gh; - - msg->lchan = conn->lchan; DEBUGP(DRR, "TX APPLICATION INFO id=0x%02x, len=%u\n", apdu_id, apdu_len); @@ -1279,8 +1218,6 @@ struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 TX SIMPLE"); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - msg->lchan = conn->lchan; - gh->proto_discr = pdisc; gh->msg_type = msg_type; @@ -1302,6 +1239,9 @@ struct msgb *msg; unsigned char *data; +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ if (trans) if (trans->conn && trans->conn->lchan) DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " @@ -1319,6 +1259,9 @@ else DEBUGP(DCC, "(bts - trx - ts - ti -- sub -) " "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); +#else + DEBUGP(DCC, "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); +#endif mncc->msg_type = msg_type; @@ -1362,8 +1305,6 @@ } if (trans->cc.state != GSM_CSTATE_NULL) new_cc_state(trans, GSM_CSTATE_NULL); - if (trans->conn) - trau_mux_unmap(&trans->conn->lchan->ts->e1_link, trans->callref); } static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg); @@ -1377,13 +1318,12 @@ OSMO_ASSERT(!transt->conn); - /* check all tranactions (without lchan) for subscriber */ switch (event) { case GSM_PAGING_SUCCEEDED: DEBUGP(DCC, "Paging subscr %s succeeded!\n", vlr_subscr_msisdn_or_name(transt->vsub)); OSMO_ASSERT(conn); - /* Assign lchan */ + /* Assign conn */ transt->conn = conn; /* send SETUP request to called party */ gsm48_cc_tx_setup(transt, &transt->cc.msg); @@ -1410,235 +1350,6 @@ return 0; } -static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable); - -/* handle audio path for handover */ -static int switch_for_handover(struct gsm_lchan *old_lchan, - struct gsm_lchan *new_lchan) -{ - struct rtp_socket *old_rs, *new_rs, *other_rs; - - /* Ask the new socket to send to the already known port. */ - if (new_lchan->conn->mncc_rtp_bridge) { - LOGP(DHO, LOGL_DEBUG, "Forwarding RTP\n"); - rsl_ipacc_mdcx(new_lchan, - old_lchan->abis_ip.connect_ip, - old_lchan->abis_ip.connect_port, 0); - return 0; - } - - if (ipacc_rtp_direct) { - LOGP(DHO, LOGL_ERROR, "unable to handover in direct RTP mode\n"); - return 0; - } - - /* RTP Proxy mode */ - new_rs = new_lchan->abis_ip.rtp_socket; - old_rs = old_lchan->abis_ip.rtp_socket; - - if (!new_rs) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for new_lchan\n"); - return -EIO; - } - - rsl_ipacc_mdcx_to_rtpsock(new_lchan); - - if (!old_rs) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for old_lchan\n"); - return -EIO; - } - - /* copy rx_action and reference to other sock */ - new_rs->rx_action = old_rs->rx_action; - new_rs->tx_action = old_rs->tx_action; - new_rs->transmit = old_rs->transmit; - - switch (old_lchan->abis_ip.rtp_socket->rx_action) { - case RTP_PROXY: - other_rs = old_rs->proxy.other_sock; - rtp_socket_proxy(new_rs, other_rs); - /* delete reference to other end socket to prevent - * rtp_socket_free() from removing the inverse reference */ - old_rs->proxy.other_sock = NULL; - break; - case RTP_RECV_UPSTREAM: - new_rs->receive = old_rs->receive; - break; - case RTP_NONE: - break; - } - - return 0; -} - -static void maybe_switch_for_handover(struct gsm_lchan *lchan) -{ - struct gsm_lchan *old_lchan; - old_lchan = bsc_handover_pending(lchan); - if (old_lchan) - switch_for_handover(old_lchan, lchan); -} - -/* some other part of the code sends us a signal */ -static int handle_abisip_signal(unsigned int subsys, unsigned int signal, - void *handler_data, void *signal_data) -{ - struct gsm_lchan *lchan = signal_data; - int rc; - struct gsm_network *net; - struct gsm_trans *trans; - - if (subsys != SS_ABISIP) - return 0; - - /* RTP bridge handling */ - if (lchan->conn && lchan->conn->mncc_rtp_bridge) - return tch_rtp_signal(lchan, signal); - - /* in case we use direct BTS-to-BTS RTP */ - if (ipacc_rtp_direct) - return 0; - - switch (signal) { - case S_ABISIP_CRCX_ACK: - /* in case we don't use direct BTS-to-BTS RTP */ - /* the BTS has successfully bound a TCH to a local ip/port, - * which means we can connect our UDP socket to it */ - if (lchan->abis_ip.rtp_socket) { - rtp_socket_free(lchan->abis_ip.rtp_socket); - lchan->abis_ip.rtp_socket = NULL; - } - - lchan->abis_ip.rtp_socket = rtp_socket_create(); - if (!lchan->abis_ip.rtp_socket) - return -EIO; - - rc = rtp_socket_connect(lchan->abis_ip.rtp_socket, - lchan->abis_ip.bound_ip, - lchan->abis_ip.bound_port); - if (rc < 0) - return -EIO; - - /* check if any transactions on this lchan still have - * a tch_recv_mncc request pending */ - net = lchan->ts->trx->bts->network; - llist_for_each_entry(trans, &net->trans_list, entry) { - if (trans->conn && trans->conn->lchan == lchan && trans->tch_recv) { - DEBUGP(DCC, "pending tch_recv_mncc request\n"); - tch_recv_mncc(net, trans->callref, 1); - } - } - - /* - * TODO: this appears to be too early? Why not until after - * the handover detect or the handover complete? - * - * Do we have a handover pending for this new lchan? In that - * case re-route the audio from the old channel to the new one. - */ - maybe_switch_for_handover(lchan); - break; - case S_ABISIP_DLCX_IND: - /* the BTS tells us a RTP stream has been disconnected */ - if (lchan->abis_ip.rtp_socket) { - rtp_socket_free(lchan->abis_ip.rtp_socket); - lchan->abis_ip.rtp_socket = NULL; - } - - break; - } - - return 0; -} - -/* map two ipaccess RTP streams onto each other */ -static int tch_map(struct gsm_lchan *lchan, struct gsm_lchan *remote_lchan) -{ - struct gsm_bts *bts = lchan->ts->trx->bts; - struct gsm_bts *remote_bts = remote_lchan->ts->trx->bts; - enum gsm_chan_t lt = lchan->type, rt = remote_lchan->type; - enum gsm48_chan_mode lm = lchan->tch_mode, rm = remote_lchan->tch_mode; - int rc; - - DEBUGP(DCC, "Setting up TCH map between (bts=%u,trx=%u,ts=%u,%s) and " - "(bts=%u,trx=%u,ts=%u,%s)\n", - bts->nr, lchan->ts->trx->nr, lchan->ts->nr, - get_value_string(gsm_chan_t_names, lt), - remote_bts->nr, remote_lchan->ts->trx->nr, remote_lchan->ts->nr, - get_value_string(gsm_chan_t_names, rt)); - - if (bts->type != remote_bts->type) { - LOGP(DCC, LOGL_ERROR, "Cannot switch calls between different BTS types yet\n"); - return -EINVAL; - } - - if (lt != rt) { - LOGP(DCC, LOGL_ERROR, "Cannot patch through call with different" - " channel types: local = %s, remote = %s\n", - get_value_string(gsm_chan_t_names, lt), - get_value_string(gsm_chan_t_names, rt)); - return -EBADSLT; - } - - if (lm != rm) { - LOGP(DCC, LOGL_ERROR, "Cannot patch through call with different" - " channel modes: local = %s, remote = %s\n", - get_value_string(gsm48_chan_mode_names, lm), - get_value_string(gsm48_chan_mode_names, rm)); - return -EMEDIUMTYPE; - } - - // todo: map between different bts types - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - if (!ipacc_rtp_direct) { - if (!lchan->abis_ip.rtp_socket) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for " - "lchan\n"); - return -EIO; - } - if (!remote_lchan->abis_ip.rtp_socket) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for " - "remote_lchan\n"); - return -EIO; - } - - /* connect the TCH's to our RTP proxy */ - rc = rsl_ipacc_mdcx_to_rtpsock(lchan); - if (rc < 0) - return rc; - rc = rsl_ipacc_mdcx_to_rtpsock(remote_lchan); - if (rc < 0) - return rc; - /* connect them with each other */ - rtp_socket_proxy(lchan->abis_ip.rtp_socket, - remote_lchan->abis_ip.rtp_socket); - } else { - /* directly connect TCH RTP streams to each other */ - rc = rsl_ipacc_mdcx(lchan, remote_lchan->abis_ip.bound_ip, - remote_lchan->abis_ip.bound_port, - remote_lchan->abis_ip.rtp_payload2); - if (rc < 0) - return rc; - rc = rsl_ipacc_mdcx(remote_lchan, lchan->abis_ip.bound_ip, - lchan->abis_ip.bound_port, - lchan->abis_ip.rtp_payload2); - } - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - trau_mux_map_lchan(lchan, remote_lchan); - break; - default: - LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type); - return -EINVAL; - } - - return 0; -} - /* bridge channels of two transactions */ static int tch_bridge(struct gsm_network *net, struct gsm_mncc_bridge *bridge) { @@ -1654,81 +1365,8 @@ /* Which subscriber do we want to track trans1 or trans2? */ log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); - /* through-connect channel */ - return tch_map(trans1->conn->lchan, trans2->conn->lchan); -} - -/* enable receive of channels to MNCC upqueue */ -static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable) -{ - struct gsm_trans *trans; - struct gsm_lchan *lchan; - struct gsm_bts *bts; - int rc; - - /* Find callref */ - trans = trans_find_by_callref(net, callref); - if (!trans) - return -EIO; - if (!trans->conn) - return 0; - - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - lchan = trans->conn->lchan; - bts = lchan->ts->trx->bts; - - /* store receive state */ - trans->tch_recv = enable; - - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - if (ipacc_rtp_direct) { - LOGP(DCC, LOGL_ERROR, "Error: RTP proxy is disabled\n"); - return -EINVAL; - } - /* In case, we don't have a RTP socket to the BTS yet, the BTS - * will not be connected to our RTP proxy and the socket will - * not be assigned to the application interface. This method - * will be called again, once the audio socket is created and - * connected. */ - if (!lchan->abis_ip.rtp_socket) { - DEBUGP(DCC, "queue tch_recv_mncc request (%d)\n", enable); - return 0; - } - if (enable) { - /* connect the TCH's to our RTP proxy */ - rc = rsl_ipacc_mdcx_to_rtpsock(lchan); - if (rc < 0) - return rc; - /* assign socket to application interface */ - rtp_socket_upstream(lchan->abis_ip.rtp_socket, - net, callref); - } else - rtp_socket_upstream(lchan->abis_ip.rtp_socket, - net, 0); - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - /* In case we don't have a TCH with correct mode, the TRAU muxer - * will not be asigned to the application interface. This is - * performed by switch_trau_mux() after successful handover or - * assignment. */ - if (lchan->tch_mode == GSM48_CMODE_SIGN) { - DEBUGP(DCC, "queue tch_recv_mncc request (%d)\n", enable); - return 0; - } - if (enable) - return trau_recv_lchan(lchan, callref); - return trau_mux_unmap(NULL, callref); - break; - default: - LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type); - return -EINVAL; - } - - return 0; + /* future: msc_call_bridge(trans1, trans2); */ + return -1; } static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) @@ -1868,7 +1506,7 @@ memset(&setup, 0, sizeof(struct gsm_mncc)); setup.callref = trans->callref; - setup.lchan_type = trans->conn->lchan->type; + 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) @@ -1884,7 +1522,6 @@ setup.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&setup.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &setup.bearer_cap); } /* facility */ if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { @@ -2024,7 +1661,7 @@ memset(&call_conf, 0, sizeof(struct gsm_mncc)); call_conf.callref = trans->callref; - call_conf.lchan_type = trans->conn->lchan->type; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); #if 0 /* repeat */ @@ -2038,7 +1675,6 @@ call_conf.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&call_conf.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &call_conf.bearer_cap); } /* cause */ if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { @@ -2728,7 +2364,6 @@ modify.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } new_cc_state(trans, GSM_CSTATE_MO_ORIG_MODIFY); @@ -2771,7 +2406,6 @@ modify.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } new_cc_state(trans, GSM_CSTATE_ACTIVE); @@ -2812,7 +2446,6 @@ modify.fields |= GSM48_IE_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } /* cause */ if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { @@ -2915,229 +2548,6 @@ return mncc_recvmsg(trans->net, trans, MNCC_USERINFO_IND, &user); } -static int _gsm48_lchan_modify(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *mode = arg; - struct gsm_lchan *lchan = trans->conn->lchan; - - /* - * We were forced to make an assignment a lot earlier and - * we should avoid sending another assignment that might - * even lead to a different kind of lchan (TCH/F vs. TCH/H). - * In case of rtp-bridge it is too late to change things - * here. - */ - if (trans->conn->mncc_rtp_bridge && lchan->tch_mode != GSM48_CMODE_SIGN) - return 0; - - return gsm0808_assign_req(trans->conn, mode->lchan_mode, - trans->conn->lchan->type != GSM_LCHAN_TCH_H); -} - -static void mncc_recv_rtp(struct gsm_network *net, uint32_t callref, - int cmd, uint32_t addr, uint16_t port, uint32_t payload_type, - uint32_t payload_msg_type) -{ - uint8_t data[sizeof(struct gsm_mncc)]; - struct gsm_mncc_rtp *rtp; - - memset(&data, 0, sizeof(data)); - rtp = (struct gsm_mncc_rtp *) &data[0]; - - rtp->callref = callref; - rtp->msg_type = cmd; - rtp->ip = addr; - rtp->port = port; - rtp->payload_type = payload_type; - rtp->payload_msg_type = payload_msg_type; - mncc_recvmsg(net, NULL, cmd, (struct gsm_mncc *)data); -} - -static void mncc_recv_rtp_sock(struct gsm_network *net, struct gsm_trans *trans, int cmd) -{ - struct gsm_lchan *lchan; - int msg_type; - - lchan = trans->conn->lchan; - switch (lchan->abis_ip.rtp_payload) { - case RTP_PT_GSM_FULL: - msg_type = GSM_TCHF_FRAME; - break; - case RTP_PT_GSM_EFR: - msg_type = GSM_TCHF_FRAME_EFR; - break; - case RTP_PT_GSM_HALF: - msg_type = GSM_TCHH_FRAME; - break; - case RTP_PT_AMR: - msg_type = GSM_TCH_FRAME_AMR; - break; - default: - LOGP(DMNCC, LOGL_ERROR, "%s unknown payload type %d\n", - gsm_lchan_name(lchan), lchan->abis_ip.rtp_payload); - msg_type = 0; - break; - } - - return mncc_recv_rtp(net, trans->callref, cmd, - lchan->abis_ip.bound_ip, - lchan->abis_ip.bound_port, - lchan->abis_ip.rtp_payload, - msg_type); -} - -static void mncc_recv_rtp_err(struct gsm_network *net, uint32_t callref, int cmd) -{ - return mncc_recv_rtp(net, callref, cmd, 0, 0, 0, 0); -} - -static int tch_rtp_create(struct gsm_network *net, uint32_t callref) -{ - struct gsm_bts *bts; - struct gsm_lchan *lchan; - struct gsm_trans *trans; - enum gsm48_chan_mode m; - - /* Find callref */ - trans = trans_find_by_callref(net, callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return 0; - } - - lchan = trans->conn->lchan; - bts = lchan->ts->trx->bts; - if (!is_ipaccess_bts(bts)) { - /* - * I want this to be straight forward and have no audio flow - * through the nitb/osmo-mss system. This currently means that - * this will not work with BS11/Nokia type BTS. We would need - * to have a trau<->rtp bridge for these but still preferable - * in another process. - */ - LOGP(DMNCC, LOGL_ERROR, "RTP create only works with IP systems\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return -EINVAL; - } - - trans->conn->mncc_rtp_bridge = 1; - /* - * *sigh* we need to pick a codec now. Pick the most generic one - * right now and hope we could fix that later on. This is very - * similiar to the routine above. - * Fallback to the internal MNCC mode to select a route. - */ - if (lchan->tch_mode == GSM48_CMODE_SIGN) { - trans->conn->mncc_rtp_create_pending = 1; - m = mncc_codec_for_mode(lchan->type); - LOGP(DMNCC, LOGL_DEBUG, "RTP create: codec=%s, chan_type=%s\n", - get_value_string(gsm48_chan_mode_names, m), - get_value_string(gsm_chan_t_names, lchan->type)); - return gsm0808_assign_req(trans->conn, m, - lchan->type != GSM_LCHAN_TCH_H); - } - - mncc_recv_rtp_sock(trans->net, trans, MNCC_RTP_CREATE); - return 0; -} - -static int tch_rtp_connect(struct gsm_network *net, void *arg) -{ - struct gsm_lchan *lchan; - struct gsm_trans *trans; - struct gsm_mncc_rtp *rtp = arg; - - /* Find callref */ - trans = trans_find_by_callref(net, rtp->callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - return 0; - } - - lchan = trans->conn->lchan; - LOGP(DMNCC, LOGL_DEBUG, "RTP connect: codec=%s, chan_type=%s\n", - get_value_string(gsm48_chan_mode_names, - mncc_codec_for_mode(lchan->type)), - get_value_string(gsm_chan_t_names, lchan->type)); - - /* TODO: Check if payload_msg_type is compatible with what we have */ - if (rtp->payload_type != lchan->abis_ip.rtp_payload) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect with different RTP payload\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - } - - /* - * FIXME: payload2 can't be sent with MDCX as the osmo-bts code - * complains about both rtp and rtp payload2 being present in the - * same package! - */ - trans->conn->mncc_rtp_connect_pending = 1; - return rsl_ipacc_mdcx(lchan, rtp->ip, rtp->port, 0); -} - -static int tch_rtp_signal(struct gsm_lchan *lchan, int signal) -{ - struct gsm_network *net; - struct gsm_trans *tmp, *trans = NULL; - - net = lchan->ts->trx->bts->network; - llist_for_each_entry(tmp, &net->trans_list, entry) { - if (!tmp->conn) - continue; - if (tmp->conn->lchan != lchan && tmp->conn->ho_lchan != lchan) - continue; - trans = tmp; - break; - } - - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "%s IPA abis signal but no transaction.\n", - gsm_lchan_name(lchan)); - return 0; - } - - switch (signal) { - case S_ABISIP_CRCX_ACK: - if (lchan->conn->mncc_rtp_create_pending) { - lchan->conn->mncc_rtp_create_pending = 0; - LOGP(DMNCC, LOGL_NOTICE, "%s sending pending RTP create ind.\n", - gsm_lchan_name(lchan)); - mncc_recv_rtp_sock(net, trans, MNCC_RTP_CREATE); - } - /* - * TODO: this appears to be too early? Why not until after - * the handover detect or the handover complete? - */ - maybe_switch_for_handover(lchan); - break; - case S_ABISIP_MDCX_ACK: - if (lchan->conn->mncc_rtp_connect_pending) { - lchan->conn->mncc_rtp_connect_pending = 0; - LOGP(DMNCC, LOGL_NOTICE, "%s sending pending RTP connect ind.\n", - gsm_lchan_name(lchan)); - mncc_recv_rtp_sock(net, trans, MNCC_RTP_CONNECT); - } - break; - } - - return 0; -} - - static struct downstate { uint32_t states; int type; @@ -3191,9 +2601,6 @@ MNCC_DISC_REQ, gsm48_cc_tx_disconnect}, {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_RELEASE_REQ), /* 5.4.3.2 */ MNCC_REL_REQ, gsm48_cc_tx_release}, - /* special */ - {ALL_STATES, - MNCC_LCHAN_MODIFY, _gsm48_lchan_modify}, }; #define DOWNSLLEN \ @@ -3205,7 +2612,6 @@ int i, rc = 0; struct gsm_trans *trans = NULL, *transt; struct gsm_subscriber_connection *conn = NULL; - struct gsm_bts *bts = NULL; struct gsm_mncc *data = arg, rel; DEBUGP(DMNCC, "receive message %s\n", get_mncc_name(msg_type)); @@ -3218,60 +2624,17 @@ disconnect_bridge(net, arg, -rc); return rc; case MNCC_FRAME_DROP: - return tch_recv_mncc(net, data->callref, 0); case MNCC_FRAME_RECV: - return tch_recv_mncc(net, data->callref, 1); case MNCC_RTP_CREATE: - return tch_rtp_create(net, data->callref); case MNCC_RTP_CONNECT: - return tch_rtp_connect(net, arg); case MNCC_RTP_FREE: - /* unused right now */ - return -EIO; case GSM_TCHF_FRAME: case GSM_TCHF_FRAME_EFR: case GSM_TCHH_FRAME: case GSM_TCH_FRAME_AMR: - /* Find callref */ - trans = trans_find_by_callref(net, data->callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "TCH frame for non-existing trans\n"); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without conn\n"); - return 0; - } - if (!trans->conn->lchan) { - LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without lchan\n"); - return 0; - } - if (trans->conn->lchan->type != GSM_LCHAN_TCH_F - && trans->conn->lchan->type != GSM_LCHAN_TCH_H) { - /* This should be LOGL_ERROR or NOTICE, but - * unfortuantely it happens for a couple of frames at - * the beginning of every RTP connection */ - LOGP(DMNCC, LOGL_DEBUG, "TCH frame for lchan != TCH_F/TCH_H\n"); - return 0; - } - bts = trans->conn->lchan->ts->trx->bts; - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - if (!trans->conn->lchan->abis_ip.rtp_socket) { - DEBUGP(DMNCC, "TCH frame to lchan without RTP connection\n"); - return 0; - } - return rtp_send_frame(trans->conn->lchan->abis_ip.rtp_socket, arg); - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - return trau_send_frame(trans->conn->lchan, arg); - default: - LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type); - } - return -EINVAL; + LOGP(DMNCC, LOGL_ERROR, "RTP streams must be handled externally; %s not supported.\n", + get_mncc_name(msg_type)); + return -ENOTSUP; } memset(&rel, 0, sizeof(struct gsm_mncc)); @@ -3347,14 +2710,15 @@ GSM48_CC_CAUSE_RESOURCE_UNAVAIL); return -ENOMEM; } - /* Find lchan */ + + /* Find conn */ conn = connection_for_subscr(vsub); - /* If subscriber has no lchan */ + /* If subscriber has no conn */ if (!conn) { /* find transaction with this subscriber already paging */ llist_for_each_entry(transt, &net->trans_list, entry) { - /* Transaction of our lchan? */ + /* Transaction of our conn? */ if (transt == trans || transt->vsub != vsub) continue; @@ -3372,7 +2736,7 @@ memcpy(&trans->cc.msg, data, sizeof(struct gsm_mncc)); /* Request a channel */ - trans->paging_request = subscr_request_channel( + trans->paging_request = subscr_request_conn( vsub, RSL_CHANNEED_TCH_F, setup_trig_pag_evt, @@ -3386,7 +2750,8 @@ vlr_subscr_put(vsub); return 0; } - /* Assign lchan */ + + /* Assign conn */ trans->conn = msc_subscr_conn_get(conn); vlr_subscr_put(vsub); } else { @@ -3399,7 +2764,7 @@ /* if paging did not respond yet */ if (!conn) { - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " + DEBUGP(DCC, "(sub %s) " "Received '%s' from MNCC in paging state\n", vlr_subscr_msisdn_or_name(trans->vsub), get_mncc_name(msg_type)); @@ -3414,9 +2779,8 @@ return rc; } - DEBUGP(DCC, "(bts %d trx %d ts %d ti %02x sub %s) " + DEBUGP(DCC, "(ti %02x sub %s) " "Received '%s' from MNCC in state %d (%s)\n", - conn->bts->nr, conn->lchan->ts->trx->nr, conn->lchan->ts->nr, trans->transaction_id, vlr_subscr_msisdn_or_name(trans->conn->vsub), get_mncc_name(msg_type), trans->cc.state, @@ -3513,12 +2877,16 @@ /* Find transaction */ trans = trans_find_by_id(conn, GSM48_PDISC_CC, transaction_id); +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " "Received '%s' from MS in state %d (%s)\n", conn->bts->nr, conn->lchan->ts->trx->nr, conn->lchan->ts->nr, transaction_id, vlr_subscr_msisdn_or_name(conn->vsub), gsm48_cc_msg_name(msg_type), trans?(trans->cc.state):0, gsm48_cc_state_name(trans?(trans->cc.state):0)); +#endif /* Create transaction */ if (!trans) { @@ -3836,11 +3204,18 @@ net->gsup_server_port); } -/* - * This will be run by the linker when loading the DSO. We use it to - * do system initialization, e.g. registration of signal handlers. - */ -static __attribute__((constructor)) void on_dso_load_0408(void) +/* This is a temporary shim merely to ensure that the unit tests still work. It + * shall be removed as soon as Iu and A interface paging is implemented. */ +int msc_fake_paging_request(struct vlr_subscr *vsub) { - osmo_signal_register_handler(SS_ABISIP, handle_abisip_signal, NULL); + LOGP(DMM, LOGL_ERROR, "Paging currently not implemented in the MSC.\n"); + OSMO_ASSERT(false); +} + +/* This is a temporary shim merely to ensure that the unit tests still work. It + * shall be removed as soon as Iu and A interface paging is implemented. */ +void msc_fake_paging_request_stop(struct vlr_subscr *vsub) +{ + LOGP(DMM, LOGL_ERROR, "Paging currently not implemented in the MSC.\n"); + OSMO_ASSERT(false); } diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 6ad944b..3255a3b 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -878,7 +878,7 @@ } /* Take a SMS in gsm_sms structure and send it through an already - * existing lchan. We also assume that the caller ensured this lchan already + * existing conn. We also assume that the caller ensured this conn already * has a SAPI3 RLL connection! */ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms) { @@ -1004,7 +1004,7 @@ struct gsm_subscriber_connection *conn; void *res; - /* check if we already have an open lchan to the subscriber. + /* check if we already have an open conn to the subscriber. * if yes, send the SMS this way */ conn = connection_for_subscr(vsub); if (conn) { @@ -1016,8 +1016,8 @@ /* if not, we have to start paging */ LOGP(DLSMS, LOGL_DEBUG, "Sending SMS: no connection open, start paging %s\n", vlr_subscr_name(vsub)); - res = subscr_request_channel(vsub, RSL_CHANNEED_SDCCH, - paging_cb_send_sms, sms); + res = subscr_request_conn(vsub, RSL_CHANNEED_SDCCH, paging_cb_send_sms, + sms); if (!res) { send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, GSM_PAGING_BUSY); sms_free(sms); diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index e9b2e0e..69d79b0 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -41,43 +41,6 @@ #include #include -void *tall_sub_req_ctx; - -int gsm48_secure_channel(struct gsm_subscriber_connection *conn, int key_seq, - gsm_cbfn *cb, void *cb_data); - - -/* - * Struct for pending channel requests. This is managed in the - * llist_head requests of each subscriber. The reference counting - * should work in such a way that a subscriber with a pending request - * remains in memory. - */ -struct subscr_request { - struct llist_head entry; - - /* the callback data */ - gsm_cbfn *cbfn; - void *param; -}; - -static struct bsc_subscr *vlr_subscr_to_bsc_sub(struct llist_head *bsc_subscribers, - struct vlr_subscr *vsub) -{ - struct bsc_subscr *sub; - /* TODO MSC split -- creating a BSC subscriber directly from MSC data - * structures in RAM. At some point the MSC will send a message to the - * BSC instead. */ - sub = bsc_subscr_find_or_create_by_imsi(bsc_subscribers, vsub->imsi); - sub->tmsi = vsub->tmsi; - sub->lac = vsub->lac; - return sub; -} - -/* - * We got the channel assigned and can now hand this channel - * over to one of our callbacks. - */ int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param) { @@ -85,22 +48,12 @@ struct gsm_subscriber_connection *conn = data; struct vlr_subscr *vsub = param; struct paging_signal_data sig_data; - struct bsc_subscr *bsub; - struct gsm_network *net; OSMO_ASSERT(vsub && vsub->cs.is_paging); - net = vsub->vlr->user_ctx; - /* - * Stop paging on all other BTS. E.g. if this is - * the first timeout on a BTS then the others will - * timeout soon as well. Let's just stop everything - * and forget we wanted to page. - */ - - bsub = vlr_subscr_to_bsc_sub(conn->network->bsc_subscribers, vsub); - paging_request_stop(&net->bts_list, NULL, bsub, NULL, NULL); - bsc_subscr_put(bsub); + /* FIXME: implement stop paging in libmsc; + * faking it for the unit tests to still work */ + msc_fake_paging_request_stop(vsub); /* Inform parts of the system we don't know */ sig_data.vsub = vsub; @@ -126,22 +79,21 @@ return 0; } -struct subscr_request *subscr_request_channel(struct vlr_subscr *vsub, - int channel_type, - gsm_cbfn *cbfn, void *param) +struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub, int channel_type, gsm_cbfn *cbfn, + void *param) { int rc; struct subscr_request *request; - struct bsc_subscr *bsub; - struct gsm_network *net = vsub->vlr->user_ctx; /* Start paging.. we know it is async so we can do it before */ if (!vsub->cs.is_paging) { LOGP(DMM, LOGL_DEBUG, "Subscriber %s not paged yet.\n", vlr_subscr_name(vsub)); - bsub = vlr_subscr_to_bsc_sub(net->bsc_subscribers, vsub); - rc = paging_request(net, bsub, channel_type, NULL, NULL); - bsc_subscr_put(bsub); + + /* FIXME: implement paging in libmsc; + * faking it for the unit tests to still work */ + rc = msc_fake_paging_request(vsub); + if (rc <= 0) { LOGP(DMM, LOGL_ERROR, "Subscriber %s paging failed: %d\n", vlr_subscr_name(vsub), rc); diff --git a/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c index 067cc92..ac6e734 100644 --- a/src/libmsc/mncc_builtin.c +++ b/src/libmsc/mncc_builtin.c @@ -65,21 +65,6 @@ return NULL; } -uint8_t mncc_codec_for_mode(int lchan_type) -{ - /* FIXME: check codec capabilities of the phone */ - - if (lchan_type != GSM_LCHAN_TCH_H) - return mncc_int.def_codec[0]; - else - return mncc_int.def_codec[1]; -} - -static uint8_t determine_lchan_mode(struct gsm_mncc *setup) -{ - return mncc_codec_for_mode(setup->lchan_type); -} - /* on incoming call, look up database and send setup to remote subscr. */ static int mncc_setup_ind(struct gsm_call *call, int msg_type, struct gsm_mncc *setup) @@ -137,9 +122,7 @@ /* modify mode */ memset(&mncc, 0, sizeof(struct gsm_mncc)); mncc.callref = call->callref; - mncc.lchan_mode = determine_lchan_mode(setup); - DEBUGP(DMNCC, "(call %x) Modify channel mode: %s\n", call->callref, - get_value_string(gsm48_chan_mode_names, mncc.lchan_mode)); + DEBUGP(DMNCC, "(call %x) Modify channel mode\n", call->callref); mncc_tx_to_cc(call->net, MNCC_LCHAN_MODIFY, &mncc); /* send setup to remote */ @@ -206,10 +189,6 @@ bridge.callref[0] = call->callref; bridge.callref[1] = call->remote_ref; DEBUGP(DMNCC, "(call %x) Bridging with remote.\n", call->callref); - - /* in direct mode, we always have to bridge the channels */ - if (ipacc_rtp_direct) - return mncc_tx_to_cc(call->net, MNCC_BRIDGE, &bridge); /* proxy mode */ if (!net->handover.active) { @@ -279,28 +258,6 @@ return 0; } -/* receiving a (speech) traffic frame from the BSC code */ -static int mncc_rcv_data(struct gsm_call *call, int msg_type, - struct gsm_data_frame *dfr) -{ - struct gsm_trans *remote_trans; - - remote_trans = trans_find_by_callref(call->net, call->remote_ref); - - /* this shouldn't really happen */ - if (!remote_trans || !remote_trans->conn) { - LOGP(DMNCC, LOGL_ERROR, "No transaction or transaction without lchan?!?\n"); - return -EIO; - } - - /* RTP socket of remote end has meanwhile died */ - if (!remote_trans->conn->lchan->abis_ip.rtp_socket) - return -EIO; - - return rtp_send_frame(remote_trans->conn->lchan->abis_ip.rtp_socket, dfr); -} - - /* Internal MNCC handler input function (from CC -> MNCC -> here) */ int int_mncc_recv(struct gsm_network *net, struct msgb *msg) { @@ -346,7 +303,8 @@ } if (mncc_is_data_frame(msg_type)) { - rc = mncc_rcv_data(call, msg_type, arg); + LOGP(DMNCC, LOGL_ERROR, "(call %x) Received data frame, which is not supported.\n", + call->callref); goto out_free; } @@ -364,7 +322,6 @@ break; case MNCC_CALL_CONF_IND: /* we now need to MODIFY the channel */ - data->lchan_mode = determine_lchan_mode(data); mncc_tx_to_cc(call->net, MNCC_LCHAN_MODIFY, data); break; case MNCC_ALERT_IND: diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index 0efe3a1..0c696f2 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -224,7 +224,6 @@ hello->called_offset = offsetof(struct gsm_mncc, called); hello->signal_offset = offsetof(struct gsm_mncc, signal); hello->emergency_offset = offsetof(struct gsm_mncc, emergency); - hello->lchan_type_offset = offsetof(struct gsm_mncc, lchan_type); msgb_enqueue(&mncc->net->upqueue, msg); mncc->conn_bfd.when |= BSC_FD_WRITE; diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c new file mode 100644 index 0000000..001fcba --- /dev/null +++ b/src/libmsc/msc_ifaces.c @@ -0,0 +1,84 @@ +/* Implementation for MSC decisions which interface to send messages out on. */ + +/* (C) 2016 by sysmocom s.m.f.c GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include + +#include +#include +#include + +static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + switch (conn->via_ran) { + /* FUTURE + case RAN_GERAN_A: + msg->dst = conn; + return a_tx(msg); + + case RAN_UTRAN_IU: + msg->dst = conn->iu.ue_ctx; + return iu_tx(msg, 0); + */ + default: + LOGP(DMSC, LOGL_ERROR, + "msc_tx(): conn->via_ran invalid (%d)\n", + conn->via_ran); + return -1; + } +} + + +int msc_tx_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + return msc_tx(conn, msg); +} + + +/* 9.2.5 CM service accept */ +int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 SERV ACC"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->proto_discr = GSM48_PDISC_MM; + gh->msg_type = GSM48_MT_MM_CM_SERV_ACC; + + DEBUGP(DMM, "-> CM SERVICE ACCEPT\n"); + + return msc_tx_dtap(conn, msg); +} + +/* 9.2.6 CM service reject */ +int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, + enum gsm48_reject_value value) +{ + struct msgb *msg; + + msg = gsm48_create_mm_serv_rej(value); + if (!msg) { + LOGP(DMM, LOGL_ERROR, "Failed to allocate CM Service Reject.\n"); + return -1; + } + + DEBUGP(DMM, "-> CM SERVICE Reject cause: %d\n", value); + + return msc_tx_dtap(conn, msg); +} diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 95e5818..c847b78 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -21,6 +21,7 @@ * */ +#include #include #include #include @@ -69,9 +70,10 @@ osmo_fsm_inst_dispatch(conn->conn_fsm, SUBSCR_CONN_E_BUMP, NULL); } -/* Receive a COMPLETE LAYER3 INFO from BSC */ -static int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, - uint16_t chosen_channel) +/* receive a Level 3 Complete message and return MSC_CONN_ACCEPT or + * MSC_CONN_REJECT */ +static int msc_compl_l3(struct gsm_subscriber_connection *conn, + struct msgb *msg, uint16_t chosen_channel) { /* Ownership of the gsm_subscriber_connection is still a bit mucky * between libbsc and libmsc. In libmsc, we use ref counting, but not @@ -87,7 +89,7 @@ /* keep the use_count reserved, libbsc will discard. If we * released the ref count and discarded here, libbsc would * double-free. And we will not change bsc_api semantics. */ - return BSC_API_CONN_POL_REJECT; + return MSC_CONN_REJECT; } DEBUGP(DMM, "compl_l3: Keeping conn\n"); @@ -96,7 +98,7 @@ /* If this should be kept, the conn->conn_fsm has placed a use_count */ msc_subscr_conn_put(conn); - return BSC_API_CONN_POL_ACCEPT; + return MSC_CONN_ACCEPT; #if 0 /* @@ -105,14 +107,14 @@ * pending transaction or ongoing operation. */ if (conn->silent_call) - return BSC_API_CONN_POL_ACCEPT; - if (conn->sec_operation || conn->anch_operation) - return BSC_API_CONN_POL_ACCEPT; + return MSC_CONN_ACCEPT; + if (conn->loc_operation || conn->sec_operation || conn->anch_operation) + return MSC_CONN_ACCEPT; if (trans_has_conn(conn)) - return BSC_API_CONN_POL_ACCEPT; + return MSC_CONN_ACCEPT; LOGP(DRR, LOGL_INFO, "MSC Complete L3: Rejecting connection.\n"); - return BSC_API_CONN_POL_REJECT; + return MSC_CONN_REJECT; #endif } diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index 6f3fbf2..5fad4f4 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -52,8 +52,12 @@ switch (event) { case GSM_PAGING_SUCCEEDED: +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ DEBUGPC(DLSMS, "success, using Timeslot %u on ARFCN %u\n", conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn); +#endif conn->silent_call = 1; msc_subscr_conn_get(conn); /* increment lchan reference count */ @@ -126,7 +130,10 @@ { struct subscr_request *req; - req = subscr_request_channel(vsub, type, paging_cb_silent, data); + /* FIXME the VTY command allows selecting a silent call channel type. + * This doesn't apply to the situation after MSCSPLIT with an + * A-interface. */ + req = subscr_request_conn(vsub, type, paging_cb_silent, data); return req != NULL; } @@ -143,8 +150,12 @@ if (!conn->silent_call) return -EINVAL; +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ DEBUGPC(DLSMS, "Stopping silent call using Timeslot %u on ARFCN %u\n", conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn); +#endif conn->silent_call = 0; msc_subscr_conn_put(conn); diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index f06eb7d..24a4653 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -423,6 +423,8 @@ build_tlv(req_tlv, &tlv); } +#if BEFORE_MSCSPLIT +/* We currently have no lchan information. Re-add after A-interface, see OS#2390. */ /* Append the Osmocom vendor-specific additional TLVs to a SMPP msg */ static void append_osmo_tlvs(tlv_t **req_tlv, const struct gsm_lchan *lchan) { @@ -461,6 +463,7 @@ (uint8_t *)vsub->imei, imei_len+1); } } +#endif struct { uint32_t smpp_status_code; @@ -680,8 +683,11 @@ memcpy(deliver.short_message, sms->user_data, deliver.sm_length); } +#if BEFORE_MSCSPLIT + /* We currently have no lchan information. Re-add after A-interface, see OS#2390. */ if (esme->acl && esme->acl->osmocom_ext && conn->lchan) append_osmo_tlvs(&deliver.tlv, conn->lchan); +#endif ret = smpp_tx_deliver(esme, &deliver); if (ret < 0) diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index c393a8f..0106f91 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -553,57 +553,6 @@ return CMD_WARNING; } -DEFUN(ena_subscr_handover, - ena_subscr_handover_cmd, - "subscriber " SUBSCR_TYPES " ID handover BTS_NR", - SUBSCR_HELP "Handover the active connection\n" - "Number of the BTS to handover to\n") -{ - int ret; - struct gsm_subscriber_connection *conn; - struct gsm_bts *bts; - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - struct vlr_subscr *vsub = - get_vsub_by_argv(gsmnet, argv[0], argv[1]); - - if (!vsub) { - vty_out(vty, "%% No subscriber found for %s %s.%s", - argv[0], argv[1], VTY_NEWLINE); - return CMD_WARNING; - } - - conn = connection_for_subscr(vsub); - if (!conn) { - vty_out(vty, "%% No active connection for subscriber %s %s.%s", - argv[0], argv[1], VTY_NEWLINE); - vlr_subscr_put(vsub); - return CMD_WARNING; - } - - bts = gsm_bts_num(gsmnet, atoi(argv[2])); - if (!bts) { - vty_out(vty, "%% BTS with number(%d) could not be found.%s", - atoi(argv[2]), VTY_NEWLINE); - vlr_subscr_put(vsub); - return CMD_WARNING; - } - - /* now start the handover */ - ret = bsc_handover_start(conn->lchan, bts); - if (ret != 0) { - vty_out(vty, "%% Handover failed with errno %d.%s", - ret, VTY_NEWLINE); - } else { - vty_out(vty, "%% Handover started from %s", - gsm_lchan_name(conn->lchan)); - vty_out(vty, " to %s.%s", gsm_lchan_name(conn->ho_lchan), - VTY_NEWLINE); - } - - vlr_subscr_put(vsub); - return CMD_SUCCESS; -} - #define A3A8_ALG_TYPES "(none|xor|comp128v1)" #define A3A8_ALG_HELP \ "Use No A3A8 algorithm\n" \ @@ -652,9 +601,7 @@ switch (signal) { case S_SCALL_SUCCESS: - vty_out(vty, "%% silent call on ARFCN %u timeslot %u%s", - sigdata->conn->lchan->ts->trx->arfcn, sigdata->conn->lchan->ts->nr, - VTY_NEWLINE); + vty_out(vty, "%% silent call success%s", VTY_NEWLINE); break; case S_SCALL_EXPIRED: vty_out(vty, "%% silent call expired paging%s", VTY_NEWLINE); @@ -670,7 +617,6 @@ { struct gsm_network *net = gsmnet_from_vty(vty); - openbsc_vty_print_statistics(vty, net); vty_out(vty, "Location Update : %lu attach, %lu normal, %lu periodic%s", net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_ATTACH].current, net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_NORMAL].current, @@ -1055,7 +1001,6 @@ install_element(ENABLE_NODE, &ena_subscr_extension_cmd); install_element(ENABLE_NODE, &ena_subscr_authorized_cmd); install_element(ENABLE_NODE, &ena_subscr_a3a8_cmd); - install_element(ENABLE_NODE, &ena_subscr_handover_cmd); install_element(ENABLE_NODE, &subscriber_purge_cmd); install_element(ENABLE_NODE, &smsqueue_trigger_cmd); install_element(ENABLE_NODE, &smsqueue_max_cmd); diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index 9de4145..904bdfc 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -32,7 +32,6 @@ bsc_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ - $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libtrau/libtrau.a \ diff --git a/tests/channel/Makefile.am b/tests/channel/Makefile.am index c7164b4..dd78bdc 100644 --- a/tests/channel/Makefile.am +++ b/tests/channel/Makefile.am @@ -24,7 +24,6 @@ $(NULL) channel_test_LDADD = \ - $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libvlr/libvlr.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index 0eed5cd..df421d8 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -32,9 +32,7 @@ $(NULL) db_test_LDADD = \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 5a8c6ca..1b326ee 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -182,7 +182,7 @@ static inline void test_si2q_u(void) { struct gsm_bts *bts; - struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(NULL, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater UARFCN generation:\n"); if (!network) @@ -210,7 +210,7 @@ static inline void test_si2q_e(void) { struct gsm_bts *bts; - struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(NULL, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater EARFCN generation:\n"); if (!network) diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index ebbfb5c..71450af 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -60,8 +60,8 @@ -Wl,--wrap=gsup_client_create \ -Wl,--wrap=gsup_client_send \ -Wl,--wrap=gsm0808_submit_dtap \ - -Wl,--wrap=paging_request \ - -Wl,--wrap=paging_request_stop \ + -Wl,--wrap=msc_fake_paging_request \ + -Wl,--wrap=msc_fake_paging_request_stop \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ $(NULL) diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 8f93435..497b7d3 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -270,9 +270,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -351,7 +350,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -734,9 +732,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 + BTS/BSC sends out paging request to MSISDN:46071 paging_expecting_tmsi == 0x03020100 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -815,7 +812,6 @@ DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -1762,9 +1758,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 3 DMM Subscriber MSISDN:42342 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000010650 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:42342 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 @@ -1843,7 +1838,6 @@ DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index 4543ace..e241429 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -287,9 +287,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -387,7 +386,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -786,9 +784,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 + BTS/BSC sends out paging request to MSISDN:46071 paging_expecting_tmsi == 0x03020100 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -886,7 +883,6 @@ DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 12b6c69..bc45367 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -186,9 +186,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -227,7 +226,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -528,9 +526,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 + BTS/BSC sends out paging request to MSISDN:46071 paging_expecting_tmsi == 0x03020100 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -569,7 +566,6 @@ DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 874cf5f..ff248e7 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1188,9 +1188,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -1225,7 +1224,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -1403,9 +1401,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -1440,7 +1437,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -1635,9 +1631,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -1672,7 +1667,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index 67c69c0..84d09ae 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -253,9 +253,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 3 DMM Subscriber MSISDN:42342 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000010650 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:42342 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 @@ -335,7 +334,6 @@ DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -665,9 +663,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 3 DMM Subscriber MSISDN:42342 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000010650 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:42342 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 @@ -747,7 +744,6 @@ DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 8f04593..00196c6 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -252,33 +252,25 @@ paging_expecting_imsi = NULL; } -/* override, requires '-Wl,--wrap=paging_request' */ -int __real_paging_request(struct gsm_network *network, struct bsc_subscr *sub, - int type, gsm_cbfn *cbfn, void *data); -int __wrap_paging_request(struct gsm_network *network, struct bsc_subscr *sub, - int type, gsm_cbfn *cbfn, void *data) +/* override, requires '-Wl,--wrap=msc_fake_paging_request' */ +int __real_msc_fake_paging_request(struct vlr_subscr *vsub); +int __wrap_msc_fake_paging_request(struct vlr_subscr *vsub) { - log("BTS/BSC sends out paging request to %s for channel type %d", - bsc_subscr_name(sub), type); + log("BTS/BSC sends out paging request to %s", + vlr_subscr_name(vsub)); OSMO_ASSERT(paging_expecting_imsi || (paging_expecting_tmsi != GSM_RESERVED_TMSI)); if (paging_expecting_imsi) - VERBOSE_ASSERT(strcmp(paging_expecting_imsi, sub->imsi), == 0, "%d"); + VERBOSE_ASSERT(strcmp(paging_expecting_imsi, vsub->imsi), == 0, "%d"); if (paging_expecting_tmsi != GSM_RESERVED_TMSI) - VERBOSE_ASSERT(paging_expecting_tmsi, == sub->tmsi, "0x%08x"); + VERBOSE_ASSERT(paging_expecting_tmsi, == vsub->tmsi, "0x%08x"); paging_sent = true; paging_stopped = false; return 1; } -/* override, requires '-Wl,--wrap=paging_request_stop' */ -void __real_paging_request_stop(struct gsm_bts *_bts, - struct vlr_subscr *vsub, - struct gsm_subscriber_connection *conn, - struct msgb *msg); -void __wrap_paging_request_stop(struct gsm_bts *_bts, - struct vlr_subscr *vsub, - struct gsm_subscriber_connection *conn, - struct msgb *msg) +/* override, requires '-Wl,--wrap=msc_fake_paging_request_stop' */ +void __real_msc_fake_paging_request_stop(struct vlr_subscr *vsub); +void __wrap_msc_fake_paging_request_stop(struct vlr_subscr *vsub) { paging_stopped = true; } -- To view, visit https://gerrit.osmocom.org/3345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 27 16:51:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 16:51:57 +0000 Subject: [PATCH] osmo-msc[master]: Implement IuCS (large refactoring and addition) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3347 to look at the new patch set (#2). Implement IuCS (large refactoring and addition) osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 --- M .gitignore M configure.ac M doc/examples/osmo-bsc_mgcp/mgcp.cfg A doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc.cfg D doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg D doc/examples/osmo-nitb/nanobts/openbsc.cfg D doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg D doc/examples/osmo-nitb/rbs2308/openbsc.cfg D doc/examples/osmo-nitb/sysmobts/openbsc.cfg M include/openbsc/Makefile.am A include/openbsc/common.h M include/openbsc/debug.h M include/openbsc/gprs_gmm.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/iu.h A include/openbsc/iucs.h A include/openbsc/iucs_ranap.h M include/openbsc/mgcp.h M include/openbsc/mgcp_internal.h A include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M include/openbsc/sgsn.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/libbsc/bsc_init.c M src/libbsc/paging.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/Makefile.am A src/libmgcp/mgcp_common.c M src/libmgcp/mgcp_network.c M src/libmgcp/mgcp_protocol.c A src/libmgcp/mgcpgw_client.c A src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c A src/libmsc/iucs.c A src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/osmo-bsc/osmo_bsc_api.c R src/osmo-msc/Makefile.am A src/osmo-msc/msc_main.c D src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/ctrl_test_runner.py M tests/db/Makefile.am M tests/db/db_test.c A tests/libiudummy/Makefile.am A tests/libiudummy/README A tests/libiudummy/iudummy.c M tests/mgcp/Makefile.am A tests/mgcp/mgcpgw_client_test.c A tests/mgcp/mgcpgw_client_test.err A tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am 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.c 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.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp_test_runner.py M tests/sms_queue/Makefile.am M tests/testsuite.at M tests/vty_test_runner.py 101 files changed, 4,976 insertions(+), 3,346 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/47/3347/2 -- To view, visit https://gerrit.osmocom.org/3347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 27 16:51:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 16:51:57 +0000 Subject: [PATCH] osmo-msc[master]: msc_vlr_tests: add missing wrap for ranap_iu_tx_release() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3348 to look at the new patch set (#2). msc_vlr_tests: add missing wrap for ranap_iu_tx_release() It seems merely luck that the tests worked so far without this wrap. Adjust test logs now indicating where we actually send an Iu Release -- and leaving gaping holes where we don't. To be fixed in another commit. Change-Id: I770f5f058c72539ff4a2913b076fee8440248fd9 --- M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 3 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/48/3348/2 diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index dbcd18e..66615f5 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -64,6 +64,7 @@ -Wl,--wrap=a_tx \ -Wl,--wrap=a_page \ -Wl,--wrap=iu_tx \ + -Wl,--wrap=iu_tx_release \ -Wl,--wrap=iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index d24dfc2..c62e78f 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -630,6 +630,7 @@ DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF MSISDN:42342: MSC conn use - 1 == 1 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated @@ -752,6 +753,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF MSISDN:42342: MSC conn use - 1 == 1 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated @@ -909,6 +911,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF MSISDN:42342: MSC conn use - 1 == 1 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated @@ -931,6 +934,7 @@ DREF VLR subscr MSISDN:42342 usage decreases to: 0 DREF freeing VLR subscr MSISDN:42342 DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF unknown: MSC conn use - 1 == 0 DRLL Freeing subscriber connection with NULL subscriber llist_count(&net->subscr_conns) == 0 @@ -1358,6 +1362,7 @@ DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS DREF MSISDN:42342: MSC conn use - 1 == 1 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 8c25fe3..d352c1c 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -455,6 +455,13 @@ return _validate_dtap(msg, RAN_UTRAN_IU); } +/* override, requires '-Wl,--wrap=iu_tx_release' */ +int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); +int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +{ + btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU)); +} + /* override, requires '-Wl,--wrap=a_tx' */ int __real_a_tx(struct msgb *msg, uint8_t sapi); int __wrap_a_tx(struct msgb *msg, uint8_t sapi) -- To view, visit https://gerrit.osmocom.org/3348 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I770f5f058c72539ff4a2913b076fee8440248fd9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 27 16:51:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 16:51:57 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: hack RAB success from nano3G: patch first RTP payload In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3349 to look at the new patch set (#2). mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 --- M include/openbsc/mgcp_internal.h M src/libmgcp/mgcp_network.c 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/49/3349/2 diff --git a/include/openbsc/mgcp_internal.h b/include/openbsc/mgcp_internal.h index b58eb9b..4e215b8 100644 --- a/include/openbsc/mgcp_internal.h +++ b/include/openbsc/mgcp_internal.h @@ -64,6 +64,7 @@ uint32_t stats_jitter; int32_t stats_transit; int stats_cycles; + bool patched_first_rtp_payload; }; struct mgcp_rtp_codec { diff --git a/src/libmgcp/mgcp_network.c b/src/libmgcp/mgcp_network.c index c9fe179..a1c7e85 100644 --- a/src/libmgcp/mgcp_network.c +++ b/src/libmgcp/mgcp_network.c @@ -667,6 +667,13 @@ forward_data(rtp_end->rtp.fd, &endp->taps[tap_idx], buf, len); + if (tap_idx == MGCP_TAP_BTS_OUT + && !rtp_state->patched_first_rtp_payload) { + uint8_t *data = (uint8_t*)&buf[12]; + osmo_hexparse("e400", data, 2); + rtp_state->patched_first_rtp_payload = true; + } + rc = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, rtp_end->rtp_port, buf, len); -- To view, visit https://gerrit.osmocom.org/3349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 27 16:51:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 16:51:57 +0000 Subject: [PATCH] osmo-msc[master]: log protocol discriminators and message types by name In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3350 to look at the new patch set (#2). log protocol discriminators and message types by name Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df --- M src/libmsc/gsm_04_08.c 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 11 files changed, 923 insertions(+), 907 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/50/3350/2 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index c179bef..21048c1 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3000,10 +3000,10 @@ uint8_t pdisc = gsm48_hdr_pdisc(gh); uint8_t msg_type = gsm48_hdr_msg_type(gh); - DEBUGP(DMM, "%s pdisc=%d msg_type=0x%02x:" + DEBUGP(DMM, "%s: rx msg %s:" " received_cm_service_request changes to false\n", vlr_subscr_name(conn->vsub), - pdisc, msg_type); + gsm48_pdisc_msgtype_name(pdisc, msg_type)); } conn->received_cm_service_request = false; } @@ -3019,14 +3019,16 @@ OSMO_ASSERT(conn); OSMO_ASSERT(msg); - LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message, pdisc=%d\n", pdisc); + LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n", + gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)), + pdisc, gsm48_hdr_msg_type(gh)); if (!msc_subscr_conn_is_accepted(conn) && !msg_is_initially_permitted(gh)) { LOGP(DRLL, LOGL_ERROR, - "subscr %s: Message not permitted for initial conn:" - " pdisc=0x%02x msg_type=0x%02x\n", - vlr_subscr_name(conn->vsub), gh->proto_discr, gh->msg_type); + "subscr %s: Message not permitted for initial conn: %s\n", + vlr_subscr_name(conn->vsub), + gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh))); return -EACCES; } diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index a928df6..0ded81e 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -1,9 +1,9 @@ ===== test_gsm_authen - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -55,19 +55,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -162,10 +162,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -195,18 +195,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -242,16 +242,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -288,10 +288,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -320,18 +320,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -361,7 +361,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -378,9 +378,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -388,12 +388,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -418,10 +418,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -439,10 +439,10 @@ ===== test_gsm_authen_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -494,19 +494,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -577,14 +577,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -593,9 +593,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -637,10 +637,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -670,18 +670,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -717,16 +717,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -763,10 +763,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -795,18 +795,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -836,7 +836,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -853,9 +853,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -863,12 +863,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -894,10 +894,10 @@ --- - subscriber sends LU Request, this time with the TMSI - Location Update request causes an Auth Req to MS - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -926,9 +926,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 5afc8d72) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 5a fc 8d 72 @@ -999,14 +999,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -1015,9 +1015,9 @@ vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 2 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(50462976){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1058,10 +1058,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using new TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1079,10 +1079,10 @@ ===== test_gsm_authen_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1134,19 +1134,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1209,7 +1209,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1220,18 +1220,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1273,10 +1273,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1294,10 +1294,10 @@ ===== test_gsm_authen_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1349,19 +1349,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1424,7 +1424,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1435,18 +1435,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1461,14 +1461,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -1477,9 +1477,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1519,10 +1519,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1540,10 +1540,10 @@ ===== test_gsm_milenage_authen - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1586,9 +1586,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM GSM AUTHENTICATION RESPONSE (sres = 9b36efdf) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 9b 36 ef df @@ -1683,10 +1683,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -1716,18 +1716,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM GSM AUTHENTICATION RESPONSE (sres = 85aa3130) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 85 aa 31 30 @@ -1763,16 +1763,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1809,10 +1809,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -1841,18 +1841,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM GSM AUTHENTICATION RESPONSE (sres = 69d5f9fb) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 69 d5 f9 fb @@ -1882,7 +1882,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1899,9 +1899,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -1909,12 +1909,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1939,10 +1939,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index 930c073..f072675 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -1,9 +1,9 @@ ===== test_ciph - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -46,9 +46,9 @@ lu_result_sent == 0 auth_request_sent == 1 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -69,17 +69,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -162,10 +162,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -195,18 +195,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -229,16 +229,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -259,16 +259,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -305,10 +305,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -337,18 +337,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -370,16 +370,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -398,7 +398,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -412,9 +412,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -422,12 +422,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -452,10 +452,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -473,10 +473,10 @@ ===== test_ciph_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -519,9 +519,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -543,17 +543,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -612,14 +612,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -628,9 +628,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -672,10 +672,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -705,18 +705,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -739,16 +739,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -769,16 +769,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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,10 +815,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -847,18 +847,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -880,16 +880,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -908,7 +908,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -922,9 +922,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -932,12 +932,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -962,10 +962,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -983,10 +983,10 @@ ===== test_ciph_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1029,9 +1029,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1052,17 +1052,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -1113,7 +1113,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1124,18 +1124,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1177,10 +1177,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1198,10 +1198,10 @@ ===== test_ciph_imeisv - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1244,9 +1244,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1269,20 +1269,20 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 vsub->imeisv[0] == 0 DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 - MS sends Ciphering Mode Complete with IMEISV, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: got IMEISV: 4234234234234235F @@ -1303,18 +1303,18 @@ DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_ID_IMEI @@ -1391,10 +1391,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1412,10 +1412,10 @@ ===== test_ciph_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1458,9 +1458,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1481,17 +1481,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -1542,7 +1542,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1553,18 +1553,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1579,14 +1579,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -1595,9 +1595,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1637,10 +1637,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.err b/tests/msc_vlr/msc_vlr_test_hlr_reject.err index b7f67cb..7104ef2 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.err @@ -1,9 +1,9 @@ ===== test_hlr_rej_auth_info_unknown_imsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -74,10 +74,10 @@ ===== test_hlr_rej_auth_info_net_fail - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -150,10 +150,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -196,9 +196,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -299,10 +299,10 @@ --- - Another LU wants to get new tuples; even though HLR sends Network Failure, we are reusing the old tuples. - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -343,9 +343,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 2d 8b 2c 3e @@ -447,10 +447,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -493,9 +493,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -596,10 +596,10 @@ --- - Another LU wants to get new tuples; HLR sends Network Failure, we reject. - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -670,10 +670,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -716,9 +716,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -820,10 +820,10 @@ - Another LU wants to get new tuples; HLR sends IMSI Unknown. Even though we would re-use an old tuple, reject the unknown IMSI. net->vlr->cfg.auth_reuse_old_sets_on_error == 1 - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -892,10 +892,10 @@ ===== test_hlr_acc_but_no_auth_tuples - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -965,10 +965,10 @@ ===== test_hlr_rej_lu - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1041,10 +1041,10 @@ ===== test_hlr_no_insert_data - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err index e2a6aa8..122a9ec 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err @@ -1,10 +1,10 @@ ===== test_hlr_timeout_lu_auth_info - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -83,10 +83,10 @@ ===== test_hlr_timeout_lu_upd_loc_result - Total time passed: 0.000000 s - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err index 728b85c..ba59387 100644 --- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err @@ -1,10 +1,10 @@ ===== test_ms_timeout_lu_auth_resp - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -103,10 +103,10 @@ ===== test_ms_timeout_cm_auth_resp - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -149,9 +149,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -246,10 +246,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 78b2ebb..ef9e3b5 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -1,9 +1,9 @@ ===== test_no_authen - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -46,14 +46,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -115,10 +115,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -156,16 +156,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -203,10 +203,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -236,7 +236,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -254,9 +254,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -264,12 +264,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -294,10 +294,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -315,10 +315,10 @@ ===== test_no_authen_tmsi - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -361,14 +361,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -406,14 +406,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -422,9 +422,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -466,10 +466,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -507,16 +507,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -553,10 +553,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -586,7 +586,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -604,9 +604,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -614,12 +614,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -645,10 +645,10 @@ --- - subscriber sends LU Request, this time with the TMSI - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -689,14 +689,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -734,14 +734,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -750,9 +750,9 @@ vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 2 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(50462976){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -793,10 +793,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using new TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -814,10 +814,10 @@ ===== test_no_authen_imei - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -860,14 +860,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 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 @@ -897,7 +897,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -908,18 +908,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -961,10 +961,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -982,10 +982,10 @@ ===== test_no_authen_tmsi_imei - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1028,14 +1028,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 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 @@ -1065,7 +1065,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1076,18 +1076,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1102,18 +1102,18 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1154,10 +1154,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index fb67206..b84a7bd 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1,9 +1,9 @@ ===== test_reject_2nd_conn - Location Update Request on one connection - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -35,10 +35,10 @@ lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - Another Location Update Request from the same subscriber on another connection is rejected - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -151,10 +151,10 @@ ===== test_reject_lu_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -187,9 +187,9 @@ llist_count(&net->subscr_conns) == 1 --- - Another Location Update Request from the same subscriber on the same conn is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - 1 == 1 @@ -273,10 +273,10 @@ ===== test_reject_cm_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -309,14 +309,14 @@ llist_count(&net->subscr_conns) == 1 --- - A CM Service Request in the middle of a LU is rejected - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM IMSI:901700000004620: connection already in use DMM -> CM SERVICE Reject cause: 17 DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 052211 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_CM_SERV_REJ: 052211 - DTAP matches expected message DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - 1 == 1 @@ -401,10 +401,10 @@ ===== test_reject_paging_resp_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -437,9 +437,9 @@ llist_count(&net->subscr_conns) == 1 --- - An erratic Paging Response is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -526,10 +526,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -630,10 +630,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -669,9 +669,9 @@ cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true - A LU request on an open conn is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +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: still awaiting first request after a CM Service Request @@ -680,9 +680,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -714,10 +714,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -818,10 +818,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -857,9 +857,9 @@ cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true - A second CM Service Request on the same conn is accepted without another auth dance - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM MSISDN:46071: re-using already accepted connection - sending CM Service Accept for MSISDN:46071 @@ -870,9 +870,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -904,10 +904,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1008,10 +1008,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1048,9 +1048,9 @@ msc_subscr_conn_is_accepted() == true --- - An erratic Paging Response on the same conn is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) 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 @@ -1062,16 +1062,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +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 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: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS: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 @@ -1100,10 +1100,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1216,10 +1216,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1249,7 +1249,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1264,9 +1264,9 @@ llist_count(&net->subscr_conns) == 1 --- - MS sends erratic LU Request, which is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=5 +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 @@ -1274,9 +1274,9 @@ lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -1284,12 +1284,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1322,10 +1322,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1438,10 +1438,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1471,7 +1471,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1486,9 +1486,9 @@ llist_count(&net->subscr_conns) == 1 --- - CM Service Request during open connection is accepted - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM MSISDN:46071: re-using already accepted connection - sending CM Service Accept for MSISDN:46071 @@ -1499,9 +1499,9 @@ llist_count(&net->subscr_conns) == 1 g_conn->received_cm_service_request == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -1509,12 +1509,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1527,9 +1527,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -1561,10 +1561,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1677,10 +1677,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1710,7 +1710,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -1725,18 +1725,18 @@ llist_count(&net->subscr_conns) == 1 --- - MS sends another erratic Paging Response which is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) 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 DREF MSISDN:46071: MSC conn use - 1 == 2 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -1744,12 +1744,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 af28015..2e1c528 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -10,14 +10,14 @@ DMM Subscr_Conn(test){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr unknown: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - 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 @@ -43,10 +43,10 @@ ===== test_cm_service_without_lu - CM Service Request without a prior Location Updating - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -84,10 +84,10 @@ ===== test_two_lu - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -130,14 +130,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -200,10 +200,10 @@ --- - verify that the MS can send another LU request - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -244,14 +244,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -312,10 +312,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -333,10 +333,10 @@ ===== test_lu_unknown_tmsi - Location Update request with unknown TMSI sends ID Request for IMSI - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -353,7 +353,7 @@ DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: vlr_loc_upd_want_imsi() DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMSI DMSC msc_tx 3 bytes to TMSI:0x23422342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051801 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051801 - DTAP matches expected message DREF VLR subscr TMSI:0x23422342 usage decreases to: 1 DMM TMSI:0x23422342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -361,18 +361,18 @@ lu_result_sent == 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 - MS tells us the IMSI, causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF TMSI:0x23422342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMSI)=901700000004620 DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: Received Event VLR_ULA_E_ID_IMSI @@ -404,14 +404,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +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 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 c62e78f..d7fc073 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -1,9 +1,9 @@ ===== test_umts_authen_geran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -47,9 +47,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 @@ -121,14 +121,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -137,9 +137,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -174,10 +174,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -208,18 +208,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 @@ -255,16 +255,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -301,10 +301,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -334,18 +334,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 706f996719ba609c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 70 6f 99 67 19 ba 60 9c @@ -375,7 +375,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -392,9 +392,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -402,12 +402,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_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 @@ -432,10 +432,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 @@ -453,10 +453,10 @@ ===== test_umts_authen_utran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -500,9 +500,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 @@ -587,14 +587,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -603,9 +603,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -641,10 +641,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -675,18 +675,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 @@ -733,16 +733,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -780,10 +780,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -813,18 +813,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 706f996719ba609c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 70 6f 99 67 19 ba 60 9c @@ -869,7 +869,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_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 @@ -882,9 +882,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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 @@ -892,12 +892,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_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: 0904 +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_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 @@ -923,10 +923,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 @@ -945,10 +945,10 @@ ===== test_umts_authen_resync_geran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -992,9 +992,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Failure with Resync cause, VLR sends GSUP to HLR to resync - rx from MS: pdisc=0x05 msg_type=0x1c + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_FAIL DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_FAIL (0x5:0x1c) DMM IMSI:901700000010650: MM R99 AUTHENTICATION SYNCH (AUTS = 979498b1f72d3e28c59fa2e72f9c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_FAIL DVLR GSUP tx: 08010809710000000156f0260e979498b1f72d3e28c59fa2e72f9c201039fa2f4e3d523d8619a73b4f65c3e14d @@ -1022,9 +1022,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = 1df5f0b4f22b696e) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP_RESYNC}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 1d f5 f0 b4 f2 2b 69 6e @@ -1096,14 +1096,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1112,9 +1112,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1155,10 +1155,10 @@ ===== test_umts_authen_resync_utran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1202,9 +1202,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Failure with Resync cause, VLR sends GSUP to HLR to resync - rx from MS: pdisc=0x05 msg_type=0x1c + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_FAIL DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_FAIL (0x5:0x1c) DMM IMSI:901700000010650: MM R99 AUTHENTICATION SYNCH (AUTS = 979498b1f72d3e28c59fa2e72f9c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_FAIL DVLR GSUP tx: 08010809710000000156f0260e979498b1f72d3e28c59fa2e72f9c201039fa2f4e3d523d8619a73b4f65c3e14d @@ -1232,9 +1232,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = 1df5f0b4f22b696e) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP_RESYNC}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 1d f5 f0 b4 f2 2b 69 6e @@ -1319,14 +1319,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1335,9 +1335,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index d352c1c..ebc204c 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -69,6 +69,17 @@ return msg; } +const char *gh_type_name(struct gsm48_hdr *gh) +{ + return gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh), + gsm48_hdr_msg_type(gh)); +} + +const char *msg_type_name(struct msgb *msg) +{ + return gh_type_name((void*)msg->data); +} + void dtap_expect_tx(const char *hex) { /* Has the previously expected dtap been received? */ @@ -153,8 +164,10 @@ int rc; struct gsm48_hdr *gh = msgb_l3(msg); - log("rx from MS: pdisc=0x%02x msg_type=0x%02x", - gh->proto_discr, gh->msg_type); + + log("MSC <--%s-- MS: %s", + ran_type_name(rx_from_ran), + gh_type_name(gh)); if (g_conn && !conn_exists(g_conn)) g_conn = NULL; @@ -426,8 +439,9 @@ int _validate_dtap(struct msgb *msg, enum ran_type to_ran) { - btw("DTAP --%s--> MS: %s", - ran_type_name(to_ran), + struct gsm48_hdr *gh = (void*)msg->data; + btw("DTAP --%s--> MS: %s: %s", + ran_type_name(to_ran), msg_type_name(msg), osmo_hexdump_nospc(msg->data, msg->len)); OSMO_ASSERT(dtap_tx_expected); -- To view, visit https://gerrit.osmocom.org/3350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 27 22:48:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 22:48:38 +0000 Subject: [ABANDON] osmo-msc[master]: msc_vlr_tests: add missing wrap for ranap_iu_tx_release() In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: msc_vlr_tests: add missing wrap for ranap_iu_tx_release() ...................................................................... Abandoned should actually be part of the preceding IuCS patch -- To view, visit https://gerrit.osmocom.org/3348 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I770f5f058c72539ff4a2913b076fee8440248fd9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 27 22:55:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 22:55:46 +0000 Subject: [PATCH] osmo-msc[master]: Implement IuCS (large refactoring and addition) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3347 to look at the new patch set (#3). Implement IuCS (large refactoring and addition) osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 --- M .gitignore M configure.ac M doc/examples/osmo-bsc_mgcp/mgcp.cfg A doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc.cfg D doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg D doc/examples/osmo-nitb/nanobts/openbsc.cfg D doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg D doc/examples/osmo-nitb/rbs2308/openbsc.cfg D doc/examples/osmo-nitb/sysmobts/openbsc.cfg M include/openbsc/Makefile.am A include/openbsc/common.h M include/openbsc/debug.h M include/openbsc/gprs_gmm.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/iu.h A include/openbsc/iucs.h A include/openbsc/iucs_ranap.h M include/openbsc/mgcp.h M include/openbsc/mgcp_internal.h A include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M include/openbsc/sgsn.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/libbsc/bsc_init.c M src/libbsc/paging.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/Makefile.am A src/libmgcp/mgcp_common.c M src/libmgcp/mgcp_network.c M src/libmgcp/mgcp_protocol.c A src/libmgcp/mgcpgw_client.c A src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c A src/libmsc/iucs.c A src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/osmo-bsc/osmo_bsc_api.c R src/osmo-msc/Makefile.am A src/osmo-msc/msc_main.c D src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/ctrl_test_runner.py M tests/db/Makefile.am M tests/db/db_test.c A tests/libiudummy/Makefile.am A tests/libiudummy/README A tests/libiudummy/iudummy.c M tests/mgcp/Makefile.am A tests/mgcp/mgcpgw_client_test.c A tests/mgcp/mgcpgw_client_test.err A tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am 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.c 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.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp_test_runner.py M tests/sms_queue/Makefile.am M tests/testsuite.at M tests/vty_test_runner.py 101 files changed, 4,989 insertions(+), 3,346 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/47/3347/3 -- To view, visit https://gerrit.osmocom.org/3347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 27 23:17:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 23:17:48 +0000 Subject: [PATCH] osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3187 to look at the new patch set (#3). move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client To help split openbsc.git to separate MSC and SGSN repositories, place the common Iu interface related code here in libosmo-ranap. Also apply various improvements while moving (from intermittent code review). The code depends on libosmo-ranap tightly. One reason to want this separate from libosmo-ranap could be that it uses libosmo-sigtran, accepting an sccp instance. However, including in libosmo-ranap is the simplest way to go. The osmo-iuh build depends on libosmo-sigtran anyway because of OsmoHNBGW, and all current users of libosmo-ranap also naturally link libosmo-sigtran already. Apply prefix ranap_iu_ and RANAP_IU_ to allow smooth transition from the openbsc.git iu_ to the libranap ranap_iu_ implementations. Prune unneeded #include statements. Instead of sccp_addr, store an rnc pointer in the ue_conn_ctx. To facilitate, also: - Move iu_rnc struct to iu_client.h (as ranap_iu_rnc). - Instead of sccp_addr, pass rnc to ue_conn_ctx_alloc(). - Pass a local struct new_ue_conn_ctx containing the sccp_addr and conn_id up the RANAP handling stack in case of an InitialUE message. - Separate the InitialUE message handling from cn_ranap_handle_co(), by moving to new and separate cn_ranap_handle_co_initial(), so we can still pass a looked-up ue_conn_ctx to all other cn_ranap_handle_co() code paths. - Allocate the ue_conn_ctx only in ranap_handle_co_initial_ue(), not as early as before. Note that we are not actually ever using the rnc pointer now present in ue_conn_ctx. It could be used for more concise paging, to first page only the RNC where we last saw the subscriber. So far we page all matching LAC/RACs. Tweak error logging: use __func__ instead of writing the function names as string constants. In iu_client_vty.c: - Move the asn.1 debug commands from logging over to the iu node. They are not specific to the logging target. They could qualify for an entirely separate 'asn1' root node, but for simplicity place under 'iu'. - Add the 'asn1' commands to ranap_iu_vty_config_write(), so far missing. - remove the legacy "net." from a VTY error message, it is not known which name the parent node of 'iu' has. Depends: libosmo-sccp I85b46269dbe7909e52873ace3f720f6292a4516c, libosmo-sccp Ie1aedd7894acd69ddc887cd65a8a0df4b888838c Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 --- M include/osmocom/iuh/hnbgw.h M include/osmocom/iuh/hnbgw_cn.h M include/osmocom/ranap/Makefile.am A include/osmocom/ranap/iu_client.h M src/Makefile.am M src/hnbgw.c M src/hnbgw_cn.c M src/hnbgw_rua.c M src/hnbgw_vty.c A src/iu_client.c A src/iu_client_vty.c 11 files changed, 1,117 insertions(+), 99 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/87/3187/3 diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index db22d97..58bdab4 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -116,10 +116,8 @@ /*! The UDP port where we receive multiplexed CS user * plane traffic from HNBs */ uint16_t iuh_cs_mux_port; - const char *iucs_remote_ip; - uint16_t iucs_remote_port; - const char *iups_remote_ip; - uint16_t iups_remote_port; + const char *iucs_remote_addr_name; + const char *iups_remote_addr_name; uint16_t rnc_id; bool hnbap_allow_tmsi; } config; @@ -134,11 +132,11 @@ /* currently active CN links for CS and PS */ struct { - struct osmo_sccp_instance *instance; + struct osmo_sccp_instance *client; struct hnbgw_cnlink *cnlink; struct osmo_sccp_addr local_addr; - struct osmo_sccp_addr remote_addr_cs; - struct osmo_sccp_addr remote_addr_ps; + struct osmo_sccp_addr iucs_remote_addr; + struct osmo_sccp_addr iups_remote_addr; } sccp; }; diff --git a/include/osmocom/iuh/hnbgw_cn.h b/include/osmocom/iuh/hnbgw_cn.h index 93123f2..2e61d82 100644 --- a/include/osmocom/iuh/hnbgw_cn.h +++ b/include/osmocom/iuh/hnbgw_cn.h @@ -2,5 +2,4 @@ #include -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc); +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip); diff --git a/include/osmocom/ranap/Makefile.am b/include/osmocom/ranap/Makefile.am index 0f83e03..1606928 100644 --- a/include/osmocom/ranap/Makefile.am +++ b/include/osmocom/ranap/Makefile.am @@ -12,6 +12,7 @@ ranap_common_cn.h \ ranap_msg_factory.h \ iu_helpers.h \ + iu_client.h \ RANAP_AccuracyFulfilmentIndicator.h \ RANAP_AllocationOrRetentionPriority.h \ RANAP_AlternativeRABConfigurationRequest.h \ diff --git a/include/osmocom/ranap/iu_client.h b/include/osmocom/ranap/iu_client.h new file mode 100644 index 0000000..873b2d2 --- /dev/null +++ b/include/osmocom/ranap/iu_client.h @@ -0,0 +1,74 @@ +#pragma once + +#include + +#include +#include +#include + +struct msgb; +struct osmo_auth_vector; + +struct RANAP_RAB_SetupOrModifiedItemIEs_s; +struct RANAP_Cause; + +struct ranap_iu_rnc; + +/* Debugging switches from asn1c and osmo-iuh */ +extern int asn_debug; +extern int asn1_xer_print; + +enum ranap_nsap_addr_enc { + RANAP_NSAP_ADDR_ENC_X213, + RANAP_NSAP_ADDR_ENC_V4RAW, +}; + +struct ranap_ue_conn_ctx { + struct llist_head list; + struct ranap_iu_rnc *rnc; + uint32_t conn_id; + int integrity_active; + struct gprs_ra_id ra_id; + enum ranap_nsap_addr_enc rab_assign_addr_enc; +}; + +enum ranap_iu_event_type { + RANAP_IU_EVENT_RAB_ASSIGN, + RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, + RANAP_IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ + RANAP_IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ +}; + +extern const struct value_string ranap_iu_event_type_names[]; +static inline const char *ranap_iu_event_type_str(enum ranap_iu_event_type e) +{ + return get_value_string(ranap_iu_event_type_names, e); +} + +/* Implementations of iu_recv_cb_t shall find the ranap_ue_conn_ctx in msg->dst. */ +typedef int (* ranap_iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, + uint16_t *sai); + +typedef int (* ranap_iu_event_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, + enum ranap_iu_event_type type, void *data); + +typedef int (* ranap_iu_rab_ass_resp_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id, + struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb); + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc); +int ranap_iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/src/Makefile.am b/src/Makefile.am index bb1ebbd..48918b0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,7 +54,7 @@ libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \ - ranap_common_cn.c + ranap_common_cn.c iu_client.c iu_client_vty.c # build the actual HomeNodeB gateway # diff --git a/src/hnbgw.c b/src/hnbgw.c index 5d9f87b..409110f 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -79,14 +79,6 @@ gw->config.iuh_local_ip = talloc_strdup(gw, HNBGW_LOCAL_IP_DEFAULT); gw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT; - gw->config.iucs_remote_ip = talloc_strdup(gw, - HNBGW_IUCS_REMOTE_IP_DEFAULT); - gw->config.iucs_remote_port = M3UA_PORT; - - gw->config.iups_remote_ip = talloc_strdup(gw, - HNBGW_IUPS_REMOTE_IP_DEFAULT); - gw->config.iups_remote_port = M3UA_PORT; - gw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&gw->hnb_list); INIT_LLIST_HEAD(&gw->ue_list); @@ -465,6 +457,7 @@ vty_info.copyright = osmo_hnbgw_copyright; vty_init(&vty_info); + osmo_ss7_vty_init_asp(); hnbgw_vty_init(g_hnb_gw, tall_hnb_ctx); logging_vty_add_cmds(&hnbgw_log_info); @@ -501,23 +494,12 @@ ranap_set_log_area(DRANAP); - OSMO_ASSERT(g_hnb_gw->config.iucs_remote_ip); rc = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iucs_remote_ip, - g_hnb_gw->config.iucs_remote_port, - "127.0.0.5" /* FIXME: configurable */, - 23 /* FIXME: configurable */); + "127.0.0.1", M3UA_PORT, "127.0.0.5" /* FIXME: configurable */); if (rc < 0) { LOGP(DMAIN, LOGL_ERROR, "Failed to initialize SCCP link to CN\n"); exit(1); } - - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_cs, - 1 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_ps, - 2 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); OSMO_ASSERT(g_hnb_gw->config.iuh_local_ip); LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n", diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 8124ce5..c87066c 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -63,8 +63,8 @@ { struct hnb_gw *gw = data; - transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.remote_addr_cs); - transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.remote_addr_ps); + transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.iucs_remote_addr); + transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.iups_remote_addr); hnbgw_cnlink_change_state(gw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); /* The spec states that we should abandon after a configurable * number of times. We decide to simply continue trying */ @@ -373,27 +373,90 @@ return 0; } -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc) +static bool addr_has_pc_and_ssn(const struct osmo_sccp_addr *addr) { - struct hnbgw_cnlink *cnlink; - int rc; + if (!(addr->presence & OSMO_SCCP_ADDR_T_SSN)) + return false; + if (!(addr->presence & OSMO_SCCP_ADDR_T_PC)) + return false; + return true; +} - OSMO_ASSERT(!gw->sccp.instance); - OSMO_ASSERT(!gw->sccp.cnlink); +static int resolve_addr_name(struct osmo_sccp_addr *dest, struct osmo_ss7_instance **ss7, + const char *addr_name, const char *label) +{ + struct osmo_ss7_instance *ss7_tmp; - gw->sccp.instance = osmo_sccp_simple_client(gw, "OsmoHNBGW", local_pc, - OSMO_SS7_ASP_PROT_M3UA, 0, local_ip, - stp_port, stp_host); - if (!gw->sccp.instance) { - LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Instance\n"); + if (!addr_name) { + LOGP(DMAIN, LOGL_ERROR, "Missing config: %s remote-addr\n", label); return -1; } - LOGP(DRUA, LOGL_DEBUG, "SCCP uplink to STP: %s %u\n", stp_host, stp_port); + ss7_tmp = osmo_sccp_addr_by_name(dest, addr_name); + if (!ss7_tmp) { + LOGP(DMAIN, LOGL_ERROR, "%s remote addr: no such SCCP address book entry: '%s'\n", + label, addr_name); + return -1; + } - osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, - OSMO_SCCP_SSN_RANAP); + if (*ss7 && (*ss7 != ss7_tmp)) { + LOGP(DMAIN, LOGL_ERROR, "IuCS and IuPS cannot be served from separate CS7 instances," + " cs7 instance %d != %d\n", (*ss7)->cfg.id, ss7_tmp->cfg.id); + return -1; + } + + *ss7 = ss7_tmp; + + osmo_sccp_addr_set_ssn(dest, OSMO_SCCP_SSN_RANAP); + + if (!addr_has_pc_and_ssn(dest)) { + LOGP(DMAIN, LOGL_ERROR, "Invalid/incomplete %s remote-addr: %s\n", + label, osmo_sccp_addr_name(dest)); + return -1; + } + + LOGP(DRANAP, LOGL_NOTICE, "Remote %s SCCP addr: %s\n", + label, osmo_sccp_addr_name(*ss7, dest)); + return 0; +} + +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip) +{ + struct hnbgw_cnlink *cnlink; + struct osmo_ss7_instance *ss7; + uint32_t local_pc; + int rc; + + OSMO_ASSERT(!gw->sccp.client); + OSMO_ASSERT(!gw->sccp.cnlink); + + ss7 = NULL; + if (resolve_addr_name(&gw->sccp.iucs_remote_addr, &ss7, + gw->config.iucs_remote_addr_name, "IuCS")) + return -1; + if (resolve_addr_name(&gw->sccp.iups_remote_addr, &ss7, + gw->config.iups_remote_addr_name, "IuPS")) + return -1; + + if (!ss7->cfg.primary_pc_valid) { + LOGP(DMAIN, LOGL_ERROR, "IuCS/IuPS uplink cannot be setup: CS7 instance %d has no point-code set\n", + ss7->cfg.id); + return -1; + } + local_pc = ss7->cfg.primary_pc; + + osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, OSMO_SCCP_SSN_RANAP); + + LOGP(DRANAP, LOGL_NOTICE, "M3UA uplink to STP: %s %u\n", stp_host, stp_port); + LOGP(DRANAP, LOGL_NOTICE, "Local SCCP addr: %s\n", osmo_sccp_addr_name(ss7, &gw->sccp.local_addr)); + + gw->sccp.client = osmo_sccp_simple_client_on_ss7_id(gw, ss7->cfg.id, "OsmoHNBGW", + local_pc, OSMO_SS7_ASP_PROT_M3UA, + 0, local_ip, stp_port, stp_host); + if (!gw->sccp.client) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Client\n"); + return -1; + } cnlink = talloc_zero(gw, struct hnbgw_cnlink); cnlink->gw = gw; @@ -402,10 +465,8 @@ cnlink->T_RafC.data = gw; cnlink->next_conn_id = 1000; - cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.instance, - "OsmoHNBGW", - sccp_sap_up, OSMO_SCCP_SSN_RANAP, - gw->sccp.local_addr.pc); + cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.client, "OsmoHNBGW", sccp_sap_up, + OSMO_SCCP_SSN_RANAP, gw->sccp.local_addr.pc); if (!cnlink->sccp_user) { LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP User\n"); return -1; diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index b610437..95979f5 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -188,11 +188,11 @@ switch (cN_DomainIndicator) { case RUA_CN_DomainIndicator_cs_domain: - remote_addr = &hnb->gw->sccp.remote_addr_cs; + remote_addr = &hnb->gw->sccp.iucs_remote_addr; is_ps = false; break; case RUA_CN_DomainIndicator_ps_domain: - remote_addr = &hnb->gw->sccp.remote_addr_ps; + remote_addr = &hnb->gw->sccp.iups_remote_addr; is_ps = true; break; default: diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c index 59871da..ddea578 100644 --- a/src/hnbgw_vty.c +++ b/src/hnbgw_vty.c @@ -90,7 +90,6 @@ vty->node = HNBGW_NODE; vty->index = NULL; break; - default: case HNBGW_NODE: vty->node = CONFIG_NODE; vty->index = NULL; @@ -98,6 +97,9 @@ case CONFIG_NODE: vty->node = ENABLE_NODE; vty->index = NULL; + break; + default: + osmo_ss7_vty_go_parent(vty); break; } @@ -182,37 +184,23 @@ return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_ip, cfg_hnbgw_iucs_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuCS core network link to\n" - "Remote IuCS IP address (default: " HNBGW_IUCS_REMOTE_IP_DEFAULT ")") +DEFUN(cfg_hnbgw_iucs_remote_addr, + cfg_hnbgw_iucs_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuCS to (MSC)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - talloc_free((void*)g_hnb_gw->config.iucs_remote_ip); - g_hnb_gw->config.iucs_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); + g_hnb_gw->config.iucs_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_port, cfg_hnbgw_iucs_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuCS core network link to\n" - "Remote IuCS port (default: 14001)") +DEFUN(cfg_hnbgw_iups_remote_addr, + cfg_hnbgw_iups_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuPS to (SGSN)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - g_hnb_gw->config.iucs_remote_port = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_ip, cfg_hnbgw_iups_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuPS core network link to\n" - "Remote IuPS IP address (default: " HNBGW_IUPS_REMOTE_IP_DEFAULT ")") -{ - talloc_free((void*)g_hnb_gw->config.iups_remote_ip); - g_hnb_gw->config.iups_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_port, cfg_hnbgw_iups_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuPS core network link to\n" - "Remote IuPS port (default: 14001)") -{ - g_hnb_gw->config.iups_remote_port = atoi(argv[0]); + g_hnb_gw->config.iups_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } @@ -248,15 +236,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iucs_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iucs%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iucs_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUCS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iucs_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iucs_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -266,15 +251,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iups_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iups%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iups_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUPS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iups_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iups_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -300,15 +282,13 @@ install_node(&iucs_node, config_write_hnbgw_iucs); vty_install_default(IUCS_NODE); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_ip_cmd); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_port_cmd); + install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_addr_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_iups_cmd); install_node(&iups_node, config_write_hnbgw_iups); vty_install_default(IUPS_NODE); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_ip_cmd); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_port_cmd); + install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_addr_cmd); install_element_ve(&show_hnb_cmd); install_element_ve(&show_ue_cmd); diff --git a/src/iu_client.c b/src/iu_client.c new file mode 100644 index 0000000..83ed276 --- /dev/null +++ b/src/iu_client.c @@ -0,0 +1,783 @@ +/* Common parts of IuCS and IuPS interfaces implementation */ + +/* (C) 2016-2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the + * PLMN identity is a BCD representation of the MCC and MNC. + * See iu_grnc_id_parse(). */ +struct iu_grnc_id { + uint16_t mcc; + uint16_t mnc; + uint16_t rnc_id; +}; + +/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has + * called us and is currently reachable at the given osmo_sccp_addr. So, when we + * know a LAC for a subscriber, we can page it at the RNC matching that LAC or + * RAC. An HNB-GW typically presents itself as if it were a single RNC, even + * though it may have several RNCs in hNodeBs connected to it. Those will then + * share the same RNC id, which they actually receive and adopt from the HNB-GW + * in the HNBAP HNB REGISTER ACCEPT message. */ +struct ranap_iu_rnc { + struct llist_head entry; + + uint16_t rnc_id; + uint16_t lac; /* Location Area Code (used for CS and PS) */ + uint8_t rac; /* Routing Area Code (used for PS only) */ + struct osmo_sccp_addr sccp_addr; +}; + +void *talloc_iu_ctx; +void *talloc_asn1_ctx; + +/* Implement the extern asn_debug from libasn1c to indicate whether to print + * asn.1 debug messages (see libasn1c). */ +int asn_debug = 0; + +/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary + * code decoded and encoded during Iu communication should be logged to stderr + * (see asn.1 generated code in osmo-iuh). */ +int asn1_xer_print = 0; + +ranap_iu_recv_cb_t global_iu_recv_cb = NULL; +ranap_iu_event_cb_t global_iu_event_cb = NULL; +int iu_log_subsystem = 0; + +#define LOGPIU(level, fmt, args...) \ + LOGP(iu_log_subsystem, level, fmt, ## args) + +static LLIST_HEAD(ue_conn_ctx_list); +static LLIST_HEAD(rnc_list); + +static struct osmo_sccp_instance *g_sccp; +static struct osmo_sccp_user *g_scu; + +const struct value_string ranap_iu_event_type_names[] = { + OSMO_VALUE_STRING(RANAP_IU_EVENT_RAB_ASSIGN), + OSMO_VALUE_STRING(RANAP_IU_EVENT_SECURITY_MODE_COMPLETE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_IU_RELEASE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_LINK_INVALIDATED), + { 0, NULL } +}; + +static struct ranap_ue_conn_ctx *ue_conn_ctx_alloc(struct ranap_iu_rnc *rnc, uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ranap_ue_conn_ctx); + + ctx->rnc = rnc; + ctx->conn_id = conn_id; + llist_add(&ctx->list, &ue_conn_ctx_list); + + return ctx; +} + +static struct ranap_ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx; + + llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { + if (ctx->conn_id == conn_id) + return ctx; + } + return NULL; +} + +static struct ranap_iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, + struct osmo_sccp_addr *addr) +{ + struct ranap_iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct ranap_iu_rnc); + + rnc->rnc_id = rnc_id; + rnc->lac = lac; + rnc->rac = rac; + rnc->sccp_addr = *addr; + llist_add(&rnc->entry, &rnc_list); + + LOGPIU(LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + + return rnc; +} + +static struct ranap_iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, + uint8_t rac, struct osmo_sccp_addr *addr) +{ + struct ranap_iu_rnc *rnc; + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->rnc_id != rnc_id) + continue; + + /* We have this RNC Id registered already. Make sure that the + * details match. */ + + /* TODO should a mismatch be an error? */ + if (rnc->lac != lac || rnc->rac != rac) + LOGPIU(LOGL_NOTICE, "RNC %d changes its details:" + " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", + rnc->rnc_id, rnc->lac, rnc->rac, + lac, rac); + rnc->lac = lac; + rnc->rac = rac; + + if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) + LOGPIU(LOGL_NOTICE, "RNC %d on New SCCP Addr %s" + " (LAC=%d RAC=%d)\n", + rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); + rnc->sccp_addr = *addr; + return rnc; + } + + /* Not found, make a new one. */ + return iu_rnc_alloc(rnc_id, lac, rac, addr); +} + +/*********************************************************************** + * RANAP handling + ***********************************************************************/ + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) +{ + struct osmo_scu_prim *prim; + + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ue_ctx->conn_id; + osmo_prim_init(&prim->oph, + SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, + msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id) +{ + /* FIXME */ + return -1; +} + +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key) +{ + struct osmo_scu_prim *prim; + struct msgb *msg; + + /* create RANAP message */ + msg = ranap_new_msg_sec_mod_cmd(vec->ik, send_ck? vec->ck : NULL, + new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg->l2h = msg->data; + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + + return 0; +} + +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_common_id(imsi); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +static int iu_grnc_id_parse(struct iu_grnc_id *dst, struct RANAP_GlobalRNC_ID *src) +{ + /* The size is coming from arbitrary sender, check it gracefully */ + if (src->pLMNidentity.size != 3) { + LOGPIU(LOGL_ERROR, "Invalid PLMN Identity size:" + " should be 3, is %d\n", src->pLMNidentity.size); + return -1; + } + gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], + &dst->mcc, &dst->mnc); + dst->rnc_id = (uint16_t)src->rNC_ID; + return 0; +} + +#if 0 + -- not used at present -- +static int iu_grnc_id_compose(struct iu_grnc_id *src, struct RANAP_GlobalRNC_ID *dst) +{ + /* The caller must ensure proper size */ + OSMO_ASSERT(dst->pLMNidentity.size == 3); + gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], + src->mcc, src->mnc); + dst->rNC_ID = src->rnc_id; + return 0; +} +#endif + +struct new_ue_conn_ctx { + struct osmo_sccp_addr sccp_addr; + uint32_t conn_id; +}; + +static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) +{ + struct new_ue_conn_ctx *new_ctx = ctx; + struct gprs_ra_id ra_id; + struct iu_grnc_id grnc_id; + uint16_t sai; + struct ranap_ue_conn_ctx *ue; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + struct ranap_iu_rnc *rnc; + + if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + + if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { + ra_id.rac = asn1str_to_u8(&ies->rac); + } + + if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { + LOGPIU(LOGL_ERROR, + "Failed to parse RANAP Global-RNC-ID IE\n"); + return -1; + } + + sai = asn1str_to_u16(&ies->sai.sAC); + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ + rnc = iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &new_ctx->sccp_addr); + + ue = ue_conn_ctx_alloc(rnc, new_ctx->conn_id); + OSMO_ASSERT(ue); + ue->ra_id = ra_id; + + /* Feed into the MM layer */ + msg->dst = ue; + global_iu_recv_cb(msg, &ra_id, &sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) +{ + struct gprs_ra_id _ra_id, *ra_id = NULL; + uint16_t _sai, *sai = NULL; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { + if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + ra_id = &_ra_id; + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { + _ra_id.rac = asn1str_to_u8(&ies->rac); + } + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { + _sai = asn1str_to_u16(&ies->sai.sAC); + sai = &_sai; + } + } + + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Feed into the MM/CC/SMS-CP layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, ra_id, sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +int ranap_iu_tx(struct msgb *msg_nas, uint8_t sapi) +{ + struct ranap_ue_conn_ctx *uectx = msg_nas->dst; + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); + msgb_free(msg_nas); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +/* Send Iu Release for the given UE connection. + * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise + * the provided cause. */ +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + static const struct RANAP_Cause default_cause = { + .present = RANAP_Cause_PR_radioNetwork, + .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, + }; + + if (!cause) + cause = &default_cause; + + msg = ranap_new_msg_iu_rel_cmd(cause); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ctx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +static int ranap_handle_co_iu_rel_req(struct ranap_ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) +{ + LOGPIU(LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); + ranap_iu_tx_release(ctx, &ies->cause); + return 0; +} + +static int ranap_handle_co_rab_ass_resp(struct ranap_ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) +{ + int rc = -1; + + LOGPIU(LOGL_INFO, + "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); + if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { + /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ + RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; + RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; + + rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); + if (rc) { + LOGPIU(LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); + return rc; + } + + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_RAB_ASSIGN, &setup_ies); + + ranap_free_rab_setupormodifieditemies(&setup_ies); + } + /* FIXME: handle RAB Ass failure? */ + + return rc; +} + +static void cn_ranap_handle_co_initial(void *ctx, ranap_message *message) +{ + int rc; + + LOGPIU(LOGL_NOTICE, "handle_co_initial(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + if (message->direction != RANAP_RANAP_PDU_PR_initiatingMessage + || message->procedureCode != RANAP_ProcedureCode_id_InitialUE_Message) { + LOGPIU(LOGL_ERROR, "Expected direction 'InitiatingMessage'," + " procedureCode 'InitialUE_Message', instead got %u and %u\n", + message->direction, message->procedureCode); + rc = -1; + } + else + rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +/* Entry point for connection-oriented RANAP message */ +static void cn_ranap_handle_co(void *ctx, ranap_message *message) +{ + int rc; + + LOGPIU(LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_InitialUE_Message: + LOGPIU(LOGL_ERROR, "Got InitialUE_Message but this is not a new conn\n"); + rc = -1; + break; + case RANAP_ProcedureCode_id_DirectTransfer: + rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + case RANAP_ProcedureCode_id_Iu_ReleaseRequest: + /* Iu Release Request */ + rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_SecurityModeControl: + /* Security Mode Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, NULL); + break; + case RANAP_ProcedureCode_id_Iu_Release: + /* Iu Release Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_IU_RELEASE, NULL); + if (rc) { + LOGPIU(LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", + rc); + } + break; + default: + LOGPIU(LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_outcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_RAB_Assignment: + /* RAB Assignment Response */ + rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + default: + LOGPIU(LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) +{ + /* FIXME: send reset response */ + return -1; +} + +static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +/* Entry point for connection-less RANAP message */ +static void cn_ranap_handle_cl(void *ctx, ranap_message *message) +{ + int rc; + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_Reset: + /* received reset.req, send reset.resp */ + rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + default: + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + case RANAP_RANAP_PDU_PR_outcome: + default: + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +/*********************************************************************** + * Paging + ***********************************************************************/ + +struct osmo_sccp_addr local_sccp_addr = { + .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, + .ri = OSMO_SCCP_RI_SSN_PC, + .ssn = OSMO_SCCP_SSN_RANAP, + .pc = 1, +}; + +/* Send a paging command down a given SCCP User. tmsi and paging_cause are + * optional and may be passed NULL and 0, respectively, to disable their use. + * See enum RANAP_PagingCause. + * + * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, + * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ +static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, + const char *imsi, const uint32_t *tmsi, + bool is_ps, uint32_t paging_cause) +{ + struct msgb *msg; + msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); + msg->l2h = msg->data; + osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); + return 0; +} + +static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, + uint16_t lac, uint8_t rac, bool is_ps) +{ + struct ranap_iu_rnc *rnc; + int pagings_sent = 0; + + if (tmsi_or_ptimsi) { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use %s %x)\n", + is_ps? "IuPS" : "IuCS", + imsi, + is_ps? "PTMSI" : "TMSI", + *tmsi_or_ptimsi); + } else { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use IMSI)\n", + is_ps? "IuPS" : "IuCS", + imsi + ); + } + + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->lac != lac) + continue; + if (is_ps && rnc->rac != rac) + continue; + + /* Found a match! */ + if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) + == 0) { + LOGPIU(LOGL_DEBUG, + "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", + is_ps? "IuPS" : "IuCS", + imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); + pagings_sent ++; + } + } + + /* Some logging... */ + if (pagings_sent > 0) { + LOGPIU(LOGL_DEBUG, + "%s: %d RNCs were paged for IMSI %s.\n", + is_ps? "IuPS" : "IuCS", + pagings_sent, imsi); + } + else { + if (is_ps) { + LOGPIU(LOGL_ERROR, "IuPS: Found no RNC to page for" + " LAC %d RAC %d (would have paged IMSI %s)\n", + lac, rac, imsi); + } + else { + LOGPIU(LOGL_ERROR, "IuCS: Found no RNC to page for" + " LAC %d (would have paged IMSI %s)\n", + lac, imsi); + } + } + + return pagings_sent; +} + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +{ + return iu_page(imsi, tmsi, lac, 0, false); +} + +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +{ + return iu_page(imsi, ptmsi, lac, rac, true); +} + + +/*********************************************************************** + * + ***********************************************************************/ + +int tx_unitdata(struct osmo_sccp_user *scu); +int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); + +struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); +struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); + +static struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) +{ + struct msgb *msg = msgb_alloc(1024, "conn_resp"); + struct osmo_scu_prim *prim; + + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_CONNECT, + PRIM_OP_RESPONSE, msg); + memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); + return &prim->oph; +} + +static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) +{ + struct osmo_sccp_user *scu = _scu; + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct osmo_prim_hdr *resp = NULL; + int rc; + struct ranap_ue_conn_ctx *ue; + struct new_ue_conn_ctx new_ctx = {}; + + LOGPIU(LOGL_DEBUG, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + + switch (OSMO_PRIM_HDR(oph)) { + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): + /* confirmation of outbound connection */ + rc = -1; + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): + /* indication of new inbound connection request*/ + LOGPIU(LOGL_DEBUG, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); + if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ + !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { + LOGPIU(LOGL_NOTICE, + "Received invalid N-CONNECT.ind\n"); + return 0; + } + new_ctx.sccp_addr = prim->u.connect.calling_addr; + new_ctx.conn_id = prim->u.connect.conn_id; + /* first ensure the local SCCP socket is ACTIVE */ + resp = make_conn_resp(&prim->u.connect); + osmo_sccp_user_sap_down(scu, resp); + /* then handle the RANAP payload */ + rc = ranap_cn_rx_co(cn_ranap_handle_co_initial, &new_ctx, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): + /* indication of disconnect */ + LOGPIU(LOGL_DEBUG, "N-DISCONNECT.ind(%u)\n", + prim->u.disconnect.conn_id); + ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): + /* connection-oriented data received */ + LOGPIU(LOGL_DEBUG, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + /* resolve UE context */ + ue = ue_conn_ctx_find(prim->u.data.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): + /* connection-less data received */ + LOGPIU(LOGL_DEBUG, "N-UNITDATA.ind(%s)\n", + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + rc = ranap_cn_rx_cl(cn_ranap_handle_cl, scu, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + default: + rc = -1; + break; + } + + msgb_free(oph->msg); + return rc; +} + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb) +{ + iu_log_subsystem = log_subsystem; + talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); + talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); + + global_iu_recv_cb = iu_recv_cb; + global_iu_event_cb = iu_event_cb; + g_sccp = sccp; + g_scu = osmo_sccp_user_bind(g_sccp, sccp_user_name, sccp_sap_up, OSMO_SCCP_SSN_RANAP); + + return 0; +} + diff --git a/src/iu_client_vty.c b/src/iu_client_vty.c new file mode 100644 index 0000000..b809b2a --- /dev/null +++ b/src/iu_client_vty.c @@ -0,0 +1,140 @@ +/* OpenBSC Iu related interface to quagga VTY */ +/* (C) 2016 by sysmocom s.m.f.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include +#include + +#include + +static enum ranap_nsap_addr_enc *g_rab_assign_addr_enc = NULL; + +DEFUN(cfg_iu_asn1_debug, + cfg_iu_asn1_debug_cmd, + "asn1 debug (1|0)", + "ASN.1 settings\n" + "Enable ASN.1 debug messages\n" + "Log ASN.1 debug messages to stderr\n" + "Do not log ASN.1 debug messages to stderr\n") +{ + asn_debug = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_iu_asn1_xer_print, + cfg_iu_asn1_xer_print_cmd, + "asn1 xer-print (1|0)", + "ASN.1 settings\n" + "Log human readable representations of all ASN.1 messages to stderr\n" + "Log XML representation of all ASN.1 messages to stderr\n" + "Do not log decoded ASN.1 messages to stderr\n") +{ + asn1_xer_print = atoi(argv[0]); + return CMD_SUCCESS; +} + +#define IU_STR "Iu interface protocol options\n" +DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, + "iu rab-assign-addr-enc (x213|v4raw)", + IU_STR + "Choose RAB Assignment's Transport Layer Address encoding\n" + "ITU-T X.213 compliant address encoding (default)\n" + "32bit length raw IPv4 address (for ip.access nano3G)\n") +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if (strcmp(argv[0], "v4raw") == 0) + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_V4RAW; + else + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_X213; + return CMD_SUCCESS; +} + +extern struct osmo_sccp_addr local_sccp_addr; + +DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, + "iu local-address point-code PC", + IU_STR "Local SCCP Address\n") +{ + local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; + local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; + local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); + + return CMD_SUCCESS; +} + +/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ + +int ranap_iu_vty_config_write(struct vty *vty, const char *indent) +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + switch (*g_rab_assign_addr_enc) { + case RANAP_NSAP_ADDR_ENC_V4RAW: + vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, + VTY_NEWLINE); + break; + case RANAP_NSAP_ADDR_ENC_X213: + /* default value, no need to write anything */ + break; + default: + LOGP(0, LOGL_ERROR, "Invalid value for" + " iu.rab_assign_addr_enc: %d\n", + *g_rab_assign_addr_enc); + return CMD_WARNING; + } + + vty_out(vty, "%siu local-address point-code %s%s", indent, + osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); + + if (asn_debug) + vty_out(vty, "%sasn1 debug 1%s", indent, VTY_NEWLINE); + + if (asn1_xer_print) + vty_out(vty, "%sasn1 xer-print 1%s", indent, VTY_NEWLINE); + + return CMD_SUCCESS; +} + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc) +{ + g_rab_assign_addr_enc = rab_assign_addr_enc; + + install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); + install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); + + /* Technically, these are global ASN.1 settings and not necessarily limited to the Iu interface. + * Practically, only Iu users will use ASN.1 in Osmocom programs -- at least so far. So it is + * easiest to have these commands under 'iu'. */ + install_element(iu_parent_node, &cfg_iu_asn1_debug_cmd); + install_element(iu_parent_node, &cfg_iu_asn1_xer_print_cmd); +} -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-iuh 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 Jul 27 23:17:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 23:17:48 +0000 Subject: [PATCH] osmo-iuh[master]: apply ctx arg to osmo_ss7_vty_init_asp() Message-ID: Review at https://gerrit.osmocom.org/3369 apply ctx arg to osmo_ss7_vty_init_asp() Depends: libosmo-sccp Id4e7f47979001f7856b0b3665c9e94982e75e490 Change-Id: Idccbdc669d740179153d0a73096745785bd2f5af --- M src/hnbgw.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/69/3369/1 diff --git a/src/hnbgw.c b/src/hnbgw.c index 409110f..c9fdd53 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -457,7 +457,7 @@ vty_info.copyright = osmo_hnbgw_copyright; vty_init(&vty_info); - osmo_ss7_vty_init_asp(); + osmo_ss7_vty_init_asp(tall_hnb_ctx); hnbgw_vty_init(g_hnb_gw, tall_hnb_ctx); logging_vty_add_cmds(&hnbgw_log_info); -- To view, visit https://gerrit.osmocom.org/3369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idccbdc669d740179153d0a73096745785bd2f5af Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jul 27 23:23:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 23:23:34 +0000 Subject: [PATCH] osmo-msc[master]: Implement IuCS (large refactoring and addition) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3347 to look at the new patch set (#4). Implement IuCS (large refactoring and addition) osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 --- M .gitignore M configure.ac M doc/examples/osmo-bsc_mgcp/mgcp.cfg A doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc.cfg D doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg D doc/examples/osmo-nitb/nanobts/openbsc.cfg D doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg D doc/examples/osmo-nitb/rbs2308/openbsc.cfg D doc/examples/osmo-nitb/sysmobts/openbsc.cfg M include/openbsc/Makefile.am A include/openbsc/common.h M include/openbsc/debug.h M include/openbsc/gprs_gmm.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/iu.h A include/openbsc/iucs.h A include/openbsc/iucs_ranap.h M include/openbsc/mgcp.h M include/openbsc/mgcp_internal.h A include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M include/openbsc/sgsn.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/libbsc/bsc_init.c M src/libbsc/paging.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/Makefile.am A src/libmgcp/mgcp_common.c M src/libmgcp/mgcp_network.c M src/libmgcp/mgcp_protocol.c A src/libmgcp/mgcpgw_client.c A src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c A src/libmsc/iucs.c A src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/osmo-bsc/osmo_bsc_api.c R src/osmo-msc/Makefile.am A src/osmo-msc/msc_main.c D src/osmo-nitb/bsc_hack.c M tests/Makefile.am M tests/ctrl_test_runner.py M tests/db/Makefile.am M tests/db/db_test.c A tests/libiudummy/Makefile.am A tests/libiudummy/README A tests/libiudummy/iudummy.c M tests/mgcp/Makefile.am A tests/mgcp/mgcpgw_client_test.c A tests/mgcp/mgcpgw_client_test.err A tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am 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.c 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.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp_test_runner.py M tests/sms_queue/Makefile.am M tests/testsuite.at M tests/vty_test_runner.py 101 files changed, 4,990 insertions(+), 3,346 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/47/3347/4 -- To view, visit https://gerrit.osmocom.org/3347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jul 27 23:24:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 27 Jul 2017 23:24:36 +0000 Subject: osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client In-Reply-To: References: Message-ID: Patch Set 3: > Build Failed depends on some libosmo-sccp patches, see 'Depends:' in commit log -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-iuh 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 Jul 28 13:06:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 13:06:32 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Print NOTICE log message from unimplemented stubs Message-ID: Review at https://gerrit.osmocom.org/3370 VIRT-PHY: Print NOTICE log message from unimplemented stubs There are plenty of functions stubbed out in osmo-bts-virtual, let's print a NOTICE level log message to be able to correlate any kind of erroneous behavior with the fact that a given function has no actual implementation. Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa --- M src/osmo-bts-virtual/bts_model.c M src/osmo-bts-virtual/main.c 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/70/3370/1 diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c index 5293cc3..424e27c 100644 --- a/src/osmo-bts-virtual/bts_model.c +++ b/src/osmo-bts-virtual/bts_model.c @@ -38,6 +38,7 @@ /* TODO: check if dummy method is sufficient, else implement */ int bts_model_lchan_deactivate(struct gsm_lchan *lchan) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return -1; } @@ -45,16 +46,19 @@ int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr, int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return -1; } int bts_model_trx_close(struct gsm_bts_trx *trx) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } @@ -86,6 +90,7 @@ static uint8_t vbts_set_trx(struct gsm_bts_trx *trx) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } @@ -154,16 +159,19 @@ int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } int bts_model_ctrl_cmds_install(struct gsm_bts *bts) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index f1dc293..bebbe2e 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -51,6 +51,7 @@ /* dummy, since no direct dsp support */ uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } @@ -68,6 +69,7 @@ void bts_model_print_help() { + LOGP(DSUM, LOGL_NOTICE, "Unimplemneted %s\n", __func__); } int bts_model_handle_options(int argc, char **argv) @@ -112,15 +114,18 @@ void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemneted %s\n", __func__); } int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return -ENOTSUP; } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return -ENOTSUP; } -- To view, visit https://gerrit.osmocom.org/3370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 28 13:06:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 13:06:32 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-BTS: Enable uplink support for GPRS Message-ID: Review at https://gerrit.osmocom.org/3371 VIRT-BTS: Enable uplink support for GPRS Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc --- M src/osmo-bts-virtual/l1_if.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/71/3371/1 diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 4fe1ec8..679f019 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -133,6 +133,9 @@ #endif case GSMTAP_CHANNEL_SDCCH4: case GSMTAP_CHANNEL_SDCCH8: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_DATA, PRIM_OP_INDICATION, msg); l1sap.u.data.chan_nr = chan_nr; @@ -151,9 +154,6 @@ goto nomessage; case GSMTAP_CHANNEL_SDCCH: case GSMTAP_CHANNEL_CCCH: - case GSMTAP_CHANNEL_PACCH: - case GSMTAP_CHANNEL_PDCH: - case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type not supported!\n"); -- To view, visit https://gerrit.osmocom.org/3371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 28 13:06:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 13:06:32 +0000 Subject: [PATCH] osmo-bts[master]: GSMTAP: Don't log fill frames via GSMTAP Message-ID: Review at https://gerrit.osmocom.org/3372 GSMTAP: Don't log fill frames via GSMTAP There's very little point in sending fill frames (such as empty PAGING) or dummy UI frames via GSMTAP all the time. They serve no purpose other than to bloat the log files and make it more difficult for users to find the interesting bits among all this noise. Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac --- M src/common/l1sap.c 1 file changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/72/3372/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index b6fcad3..20a8c40 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -315,6 +315,28 @@ return 0; } +/* Paging Request 1 with "no identity" content, i.e. empty/dummy paging */ +static const uint8_t paging_fill[GSM_MACBLOCK_LEN] = { + 0x15, 0x06, 0x21, 0x00, 0x01, 0xf0, 0x2b, 0x2b, 0x2b, 0x2b, + 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, + 0x2b, 0x2b, 0x2b }; + +static bool is_fill_frame(uint8_t chan_type, const uint8_t *data, unsigned int len) +{ + switch (chan_type) { + case GSMTAP_CHANNEL_AGCH: + if (!memcmp(data, fill_frame, GSM_MACBLOCK_LEN)) + return true; + break; + case GSMTAP_CHANNEL_PCH: + if (!memcmp(data, paging_fill, GSM_MACBLOCK_LEN)) + return true; + break; + default: + return false; + } +} + static int to_gsmtap(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) { uint8_t *data; @@ -362,6 +384,11 @@ return 0; } + /* don't log fill frames via GSMTAP; they serve no purpose other than + * to clog up your logs */ + if (is_fill_frame(chan_type, data, len)) + return 0; + gsmtap_send(gsmtap, trx->arfcn | uplink, tn, chan_type, ss, fn, 0, 0, data, len); -- To view, visit https://gerrit.osmocom.org/3372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jul 28 14:40:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 14:40:55 +0000 Subject: osmo-bts[master]: GSMTAP: Don't log fill frames via GSMTAP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 one coudl argue this should be yet another vty command. Any opinions here? -- To view, visit https://gerrit.osmocom.org/3372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 28 14:41:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 14:41:23 +0000 Subject: osmo-bts[master]: VIRT-PHY: Print NOTICE log message from unimplemented stubs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 full of typos -- To view, visit https://gerrit.osmocom.org/3370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 28 14:41:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 14:41:31 +0000 Subject: osmo-bts[master]: VIRT-BTS: Enable uplink support for GPRS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 28 14:41:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 14:41:51 +0000 Subject: [MERGED] osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Introduce artifacts holding dependencies to speed up builds. ...................................................................... Introduce artifacts holding dependencies to speed up builds. Basically, osmo-build.sh holds logic to check whether the necessary artifact is available. If so it fetches artifact, unpacks it and triggers the actual build. In case the necessary artifact is not available osmo-build.sh simply builds all dependencies from source by using osmo-build-dep.sh and archives deps to the ARTIFACT_STORE afterwards. The necessary functions to determine the artifact name from remote and local repositories as well as the handling of artifact files live in osmo-artifacts.sh, which is sourced by osmo-build.sh. osmo-build.sh will be sourced by the contrib/jenkins.sh build script inside each git repository. This automatically triggers the build, so one need to source at the end of each jenkins.sh script. See jenkins-openBsc.sh [1] for more details. Artifacts will be stored as follows: $ARTIFACT_STORE/$JOB_NAME/.._... ..._..tar.gz Furthermore, ARTIFACT_STORE environment variable has to be set on all jenkins slaves. The JOB_NAME variables is injected to each jenkins job by jenkins. [1] https://github.com/blobbsen/diy-artifacts/blob/master/jenkins-openBSC.sh Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 --- A scripts/osmo-build.sh 1 file changed, 230 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/scripts/osmo-build.sh b/scripts/osmo-build.sh new file mode 100644 index 0000000..8ca8e47 --- /dev/null +++ b/scripts/osmo-build.sh @@ -0,0 +1,230 @@ +#!/bin/sh +# +# This script enables artifacts holding dependencies on a jenkins job level to +# speed up builds. Basically, it holds logic to check whether the necessary artifact +# is available. If so it fetches artifact, unpacks it and if cp/tar succeeded +# it triggers the actual build. +# +# Otherwise it simply builds all dependencies from source by using osmo-build-dep.sh +# and archives deps to the ARTIFACT_STORE afterwards. Revisions of locally built +# dependencies are detrmined after dependencies are built to ensure catching new +# changes in dep_n+1 meanwhile building dep_n. +# +# Furthermore, ARTIFACT_STORE environment variable has to be set on all jenkins slaves. +# The JOB_NAME variable will be injected to each jenkins' job by jenkins itself. +# When using script within a docker container one must inject jenkins' JOB_NAME variable +# to the container and ensure that ARTIFACT_STORE is mounted to the container's +# internal ARTIFACT_STORE. +# +# Artifacts will be stored as follows: +# +# $ARTIFACT_STORE/$JOB_NAME/.._... +# ..._..tar.gz +# +# Note: each matrix-build has its own directory inside ARTIFACT_STORE. +# +# In order to make use of osmo-build.sh one needs to source it, e.g. from +# ./contrib/jenkins.sh. Furthermore, jenkins should check out the git tree of +# the project to be built in the workspace root. Following functions needs to be +# declared within a build script that sources osmo-build.sh: +# +# - artifact_name() +# - build_deps() +# - build_project() +# +# This is an example for building "libosmo-netif" which depends on "libosmocore" +# and "libosmo-abis". +# +# #!/bin/sh +# +# artifact_deps() { +# # $1 will be one of folllowing functions: +# # - artifact_name_by_local_repo() +# # - artifact_name_by_remote_repo() +# # osmo-build.sh takes care about which function to use +# +# x="$($1 libosmocore)" +# x="${x}_$($1 libosmo-abis)" +# +# echo "${x}.tar.gz" +# } +# +# build_deps() { +# # all commands to build necessary dependencies +# osmo-build-dep.sh libosmocore master ac_cv_path_DOXYGEN=false +# "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +# osmo-build-dep.sh libosmo-abis +# } +# +# build_project() { +# # Necessary commands to build the project, expecting all dependencies have +# # been built or fetched. Commands within build_project() will be executed +# # in jenkins' $WORKSPACE. +# +# autoreconf --install --force +# ./configure --enable-sanitize +# $MAKE $PARALLEL_MAKE +# $MAKE distcheck || cat-testlogs.sh +# } +# +## +# # source osmo-build.sh to fire the build +# . osmo-build.sh + +log() { + set +x + echo + echo "[INFO] $1" + echo + set -x +} + +# SOURCING SANITY +log "source sanity check to ensure that sourcing script holds necessary functions" +type artifact_deps +type build_deps +type build_project +log "check whether necessary dependency build scripts are in PATH" +type osmo-build-dep.sh +type osmo-deps.sh + +# BUILD FUNCTIONS +init_build() { + + if [ -z "$JOB_NAME" ]; then + log "[ERROR] JOB_NAME variable is not set, running in Jenkins?" + exit 1 + fi + + if [ -z "$ARTIFACT_STORE" ]; then + log "[ERROR] ARTIFACT_STORE variable is not set on this build slave" + exit 1 + fi + + base="$(pwd)" + deps="$base/deps" + inst="$deps/install" + rm -rf "$deps" || true + + # obtain the project name from the git clone found in the workspace root + project=$(git config --get --local remote.origin.url \ + | cut -d '/' -f4 | cut -d '.' -f1) + + # replace invalid char for dirs in $JOB_NAME (jenkins variable) + # ( '/' separates job name and matrix-axis) + job_name="$( echo "$JOB_NAME" | tr '/' '_')" + + export base deps inst project job_name + export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" + export LD_LIBRARY_PATH="$inst/lib" + + log "$project build initialized" +} + +build() { + + init_build + + artifact_name="$(artifact_name)" + + if [ -f "$ARTIFACT_STORE/$job_name/$artifact_name" ]; then + fetch_artifact "$ARTIFACT_STORE/$job_name" "$artifact_name" + else + log "Compile $project dependencies from source." + mkdir -p "$deps" + rm -rf "$inst" + + build_deps + archive_artifact + fi + + log "building $project" + build_project +} + +# ARTIFACT FUNCTIONS +artifact_name() { + # in case deps is empty or does not exist we + if [ -d "$deps" ]; then + artifact_deps "branch_and_rev_of_local_repo" + cd "$base" + else + artifact_deps "branch_and_rev_of_remote_repo" + fi +} + +branch_and_rev_of_local_repo() { + cd "$deps/$1" + rev="$(git rev-parse --short HEAD)" + branch="$(git rev-parse --abbrev-ref HEAD)" + + # check whether it is a tag + if [ "$branch" = "HEAD" ]; then + tag="$(git describe --tags HEAD)" + tag="$(echo "$tag" | tr '/' '_')" + echo "$1.$tag" + else + branch="$( echo "$branch" | tr '/' '_')" + echo "$1.$branch.$rev" + fi +} + +branch_and_rev_of_remote_repo() { + if [ -z "${2+x}" ]; then branch="master"; else branch="$2"; fi + branch="$( echo "$branch" | tr '/' '_')" + rev="$(git ls-remote "https://git.osmocom.org/$1" "refs/heads/$branch")" + + # check whether branch is a tag + if [ "$rev" = "" ]; then + echo "$1.$branch" + else + rev="$(echo "$rev" | cut -c 1-7)" + echo "$1.$branch.$rev" + fi +} + +archive_artifact() { + log "Archiving artifact to artifactStore." + + cd "$base" + artifact="$(artifact_name)" + # temp_job_store is necessary to atomically move it to production. + temp_job_store="$ARTIFACT_STORE/tmp/$job_name/" + job_store="$ARTIFACT_STORE/$job_name/" + + if [ ! -f "$temp_job_store/$artifact" ]; then + mkdir -p "$job_store" "$temp_job_store" + # remove outdated artifact first to avoid temporarily + # doubling of artifact storage consumption + rm -f "$job_store/*" + tar czf "$temp_job_store/$artifact" "deps" + mv -n "$temp_job_store/$artifact" "$job_store/$artifact" + rm -rf "$temp_job_store" + + log_artifact_hash "$job_store/$artifact" + fi +} + +fetch_artifact() { + log "Fetching artifact from artifactStore." + + log_artifact_hash "$1/$2" + cp "$1/$2" . + log_artifact_hash "$2" + tar xzf "$2" + + if [ $? -gt 0 ]; then + log "Artifact could not be fetched, triggering build_deps()" + build_deps + else + log "Artifact successfully fetched, triggering $project compilation" + fi +} + +# checksum is not used by script itself, +# but might be handy in logs when debugging. +log_artifact_hash() { + log "name: $1 \n sha256: $(sha256sum "$1" | cut -d ' ' -f1)" +} + +build -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 14 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jul 28 14:54:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 14:54:01 +0000 Subject: libosmocore[master]: BSSGP: add function to reset all PTP BVC In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913 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 Jul 28 14:56:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 14:56:08 +0000 Subject: osmo-pcu[master]: BSSGP: Use libosmocore for BVC-RESET In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I718c949759688cb34ce6bcbb3da2092fcdfa6989 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 Fri Jul 28 15:01:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 15:01:44 +0000 Subject: [MERGED] libosmocore[master]: BSSGP: add function to reset all PTP BVC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSGP: add function to reset all PTP BVC ...................................................................... BSSGP: add function to reset all PTP BVC Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913 Related: OS#1638 --- M include/osmocom/gprs/gprs_bssgp_bss.h M src/gb/gprs_bssgp.c M src/gb/libosmogb.map 3 files changed, 28 insertions(+), 1 deletion(-) 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 9374e73..74211fd 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -26,7 +26,7 @@ #include uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); - +int bssgp_tx_bvc_ptp_reset(uint16_t nsei, enum gprs_bssgp_cause cause); int bssgp_tx_suspend(uint16_t nsei, uint32_t tlli, const struct gprs_ra_id *ra_id); diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 8daf39f..2552849 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -35,6 +35,7 @@ #include #include +#include #include #include "common_vty.h" @@ -77,6 +78,31 @@ return NULL; } +/*! Initiate reset procedure for all PTP BVC on a given NSEI. + * + * This function initiates reset procedure for all PTP BVC with a given cause. + * \param[in] nsei NSEI to which PTP BVC should belong to + * \param[in] cause Cause of BVC RESET + * \returns 0 on success, negative error code otherwise + */ +int bssgp_tx_bvc_ptp_reset(uint16_t nsei, enum gprs_bssgp_cause cause) +{ + int rc; + struct bssgp_bvc_ctx *bctx; + + llist_for_each_entry(bctx, &bssgp_bvc_ctxts, list) { + if (bctx->nsei == nsei && bctx->bvci != BVCI_SIGNALLING) { + LOGP(DBSSGP, LOGL_DEBUG, "NSEI=%u/BVCI=%u RESET due to %s\n", + nsei, bctx->bvci, bssgp_cause_str(cause)); + rc = bssgp_tx_bvc_reset(bctx, bctx->bvci, cause); + if (rc < 0) + return rc; + } + } + + return 0; +} + /* Find a BTS context based on BVCI+NSEI tuple */ struct bssgp_bvc_ctx *btsctx_by_bvci_nsei(uint16_t bvci, uint16_t nsei) { diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index 6aad8fd..9a0dba5 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -34,6 +34,7 @@ bssgp_rx_paging; bssgp_set_log_ss; bssgp_tx_dl_ud; +bssgp_tx_bvc_ptp_reset; bssgp_tx_paging; bssgp_vty_init; bssgp_nsi; -- To view, visit https://gerrit.osmocom.org/3088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913 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 Jul 28 21:24:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 21:24:56 +0000 Subject: [MERGED] osmo-pcu[master]: BSSGP: Use libosmocore for BVC-RESET In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSGP: Use libosmocore for BVC-RESET ...................................................................... BSSGP: Use libosmocore for BVC-RESET Implement proper BVC RESET procedure by using libosmocore code to handle BVCI reset and initiate PTP BVC reset if necessary. Requires I9bf8f4dd784ccddbb9926492a85fff3293a0e913 in libosmocore. Related: OS#1638 Change-Id: I718c949759688cb34ce6bcbb3da2092fcdfa6989 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 22 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index d3c8491..437479b 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -325,14 +325,15 @@ struct bssgp_ud_hdr *budh = (struct bssgp_ud_hdr *) msgb_bssgph(msg); struct tlv_parsed tp; enum bssgp_pdu_type pdu_type = (enum bssgp_pdu_type) bgph->pdu_type; - uint16_t ns_bvci = msgb_bvci(msg); + enum gprs_bssgp_cause cause = BSSGP_CAUSE_OML_INTERV; + uint16_t ns_bvci = msgb_bvci(msg), nsei = msgb_nsei(msg); int data_len; int rc = 0; struct bssgp_bvc_ctx *bctx; if (pdu_type == BSSGP_PDUT_STATUS) /* Pass the message to the generic BSSGP parser, which handles - * STATUS message in either direction. */ + * STATUS and RESET messages in either direction. */ return bssgp_rcvmsg(msg); /* Identifiers from DOWN: NSEI, BVCI (both in msg->cb) */ @@ -349,6 +350,23 @@ rc = bssgp_tlv_parse(&tp, budh->data, data_len); } + if (pdu_type == BSSGP_PDUT_BVC_RESET) { + rc = bssgp_rcvmsg(msg); + if (ns_bvci != BVCI_SIGNALLING) + return rc; + + if (TLVP_PRES_LEN(&tp, BSSGP_IE_CAUSE, 1)) + cause = (enum gprs_bssgp_cause)*TLVP_VAL(&tp, BSSGP_IE_CAUSE); + else + LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u BVC RESET without cause?!\n", nsei); + + rc = bssgp_tx_bvc_ptp_reset(nsei, cause); + if (rc < 0) + LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u BVC PTP reset procedure failed: %d\n", nsei, rc); + + return rc; + } + /* look-up or create the BTS context for this BVC */ bctx = btsctx_by_bvci_nsei(ns_bvci, msgb_nsei(msg)); @@ -357,9 +375,8 @@ && pdu_type != BSSGP_PDUT_BVC_UNBLOCK_ACK && pdu_type != BSSGP_PDUT_PAGING_PS) { - LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u Rejecting PDU " - "type %s for unknown BVCI\n", msgb_nsei(msg), ns_bvci, - bssgp_pdu_str(pdu_type)); + LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u Rejecting PDU type %s for unknown BVCI\n", + nsei, ns_bvci, bssgp_pdu_str(pdu_type)); return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI, NULL, msg); } -- To view, visit https://gerrit.osmocom.org/3089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I718c949759688cb34ce6bcbb3da2092fcdfa6989 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 Fri Jul 28 21:26:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 21:26:09 +0000 Subject: libosmocore[master]: chantype_rsl2gsmtap/gsmtap2rsl: Fix PDCH channel type conver... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I88a06e8ba894f16006a8efa259fc536cf300de32 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jul 28 21:26:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 28 Jul 2017 21:26:11 +0000 Subject: [MERGED] libosmocore[master]: chantype_rsl2gsmtap/gsmtap2rsl: Fix PDCH channel type conver... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: chantype_rsl2gsmtap/gsmtap2rsl: Fix PDCH channel type conversion ...................................................................... chantype_rsl2gsmtap/gsmtap2rsl: Fix PDCH channel type conversion Change-Id: I88a06e8ba894f16006a8efa259fc536cf300de32 --- M src/gsmtap_util.c 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index ad6f914..28149c0 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -81,6 +81,9 @@ /* it could also be AGCH... */ ret = GSMTAP_CHANNEL_PCH; break; + case RSL_CHAN_OSMO_PDCH: + ret = GSMTAP_CHANNEL_PDCH; + break; } if (link_id & 0x40) @@ -121,7 +124,7 @@ *rsl_chantype = RSL_CHAN_PCH_AGCH; break; case GSMTAP_CHANNEL_PDCH: - *rsl_chantype = GSMTAP_CHANNEL_PDCH; + *rsl_chantype = RSL_CHAN_OSMO_PDCH; break; } -- To view, visit https://gerrit.osmocom.org/3358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I88a06e8ba894f16006a8efa259fc536cf300de32 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:04:24 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:04:24 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: drop length check in gsm0480_decode_ss_request() Message-ID: Review at https://gerrit.osmocom.org/3373 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/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 557aa14..38693d4 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -248,12 +248,6 @@ struct 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: newchange Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:04:25 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:04:25 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: modify USSD structures to support external handling Message-ID: Review at https://gerrit.osmocom.org/3374 gsm0480: modify USSD structures to support external handling This change adds the following new fields to ss_request struct: - 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 Also, the MAX_LEN_USSD_STRING was increased to 182. Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c 2 files changed, 33 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/3374/1 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 672ffe5..e3b15d2 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 { @@ -21,11 +21,31 @@ 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]; + /*! 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, diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 38693d4..1c01e64 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -264,6 +264,7 @@ 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"); @@ -333,6 +334,8 @@ LOGP(0, LOGL_ERROR, "Component does not fit.\n"); return 0; } + + req->component_type = component_type; switch (component_type) { case GSM0480_CTYPE_INVOKE: @@ -443,9 +446,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; } } -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:04:25 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:04:25 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: refactor the parse_process_uss_req() Message-ID: Review at https://gerrit.osmocom.org/3375 gsm0480: refactor the parse_process_uss_req() This change reduces the degree of code nesting using the 'follow by contradiction' pattern. 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/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 1c01e64..de99223 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -427,36 +427,37 @@ 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 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: newchange Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:04:25 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:04:25 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle UnstructuredSS request with DSC != 0x0F Message-ID: Review at https://gerrit.osmocom.org/3376 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/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index de99223..87095d2 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -455,6 +455,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: newchange Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:04:26 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:04:26 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately Message-ID: Review at https://gerrit.osmocom.org/3377 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/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 87095d2..e8a3bc3 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -194,6 +194,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, @@ -272,8 +274,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", @@ -285,6 +289,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: newchange Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:04:26 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:04:26 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT Message-ID: Review at https://gerrit.osmocom.org/3378 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/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index e8a3bc3..7e036ba 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -202,6 +202,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, @@ -360,6 +364,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; @@ -439,6 +446,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 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 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 ss_request *req) -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:04:26 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:04:26 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ Message-ID: Review at https://gerrit.osmocom.org/3379 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/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 7e036ba..c74077a 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -418,6 +418,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: newchange Gerrit-Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:04:26 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:04:26 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA Message-ID: Review at https://gerrit.osmocom.org/3380 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/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index c74077a..6731cec 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -425,6 +425,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: newchange Gerrit-Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:04:27 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:04:27 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() Message-ID: Review at https://gerrit.osmocom.org/3381 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/1 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index e3b15d2..e3d40a9 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 6731cec..9705359 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -198,8 +198,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, @@ -302,7 +300,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, @@ -324,7 +323,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; @@ -338,8 +337,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 714cb25..b9d30bb 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -83,6 +83,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: newchange Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:11:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:11:23 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle UnstructuredSS request with DSC != 0x0F In-Reply-To: References: Message-ID: 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/2 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index de99223..87095d2 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -455,6 +455,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: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:11:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:11:23 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: 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/2 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 87095d2..e8a3bc3 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -194,6 +194,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, @@ -272,8 +274,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", @@ -285,6 +289,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: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:11:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:11:23 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: 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/2 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index e8a3bc3..7e036ba 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -202,6 +202,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, @@ -360,6 +364,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; @@ -439,6 +446,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 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 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 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: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:11:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:11:23 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ In-Reply-To: References: Message-ID: 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/2 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 7e036ba..c74077a 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -418,6 +418,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: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:11:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:11:23 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA In-Reply-To: References: Message-ID: 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/2 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index c74077a..6731cec 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -425,6 +425,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: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:11:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:11:23 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: 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/2 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index e3b15d2..e3d40a9 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 6731cec..9705359 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -198,8 +198,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, @@ -302,7 +300,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, @@ -324,7 +323,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; @@ -338,8 +337,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 714cb25..b9d30bb 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -83,6 +83,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: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:11:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 29 Jul 2017 08:11:23 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: refactor the parse_process_uss_req() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3375 to look at the new patch set (#2). gsm0480: refactor the parse_process_uss_req() This change reduces the degree of code nesting using the 'follow by contradiction' pattern. 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/2 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 1c01e64..de99223 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -427,36 +427,37 @@ 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 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: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:21:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 08:21:50 +0000 Subject: [PATCH] osmo-pcu[master]: Remove #warnings that have been adressed since 2015 Message-ID: Review at https://gerrit.osmocom.org/3382 Remove #warnings that have been adressed since 2015 In commit 939904672961fa7e28397e27f942a7d1fff4bbdf the lookup by TLLI, TLLI-OLD and IMSI has been implemented, but the corresponding compile-time warning was never removed. Change-Id: I7a1767bc7cab01048e851fd4e63112bc676d6c78 --- M src/tbf_dl.cpp 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/82/3382/1 diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index a894789..505d488 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -126,8 +126,6 @@ GprsMs *ms; /* check for uplink data, so we copy our informations */ -#warning "Do the same look up for IMSI, TLLI and OLD_TLLI" -#warning "Refactor the below lines... into a new method" ms = bts->bts->ms_store().get_ms(tlli, tlli_old, imsi); if (ms) { ul_tbf = ms->ul_tbf(); -- To view, visit https://gerrit.osmocom.org/3382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a1767bc7cab01048e851fd4e63112bc676d6c78 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:21:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 08:21:51 +0000 Subject: [PATCH] osmo-pcu[master]: BSSGP: Improve logging of received messages Message-ID: Review at https://gerrit.osmocom.org/3383 BSSGP: Improve logging of received messages We now differentiate clearly between messages that a) we don't expect based on our reading of the spec b) we have not implemented yet (but should) c) we do not even know of Also, unify the log string formats and provide BVCI whenever possible. Change-Id: Ie32f5771d49960547ec5d7611f96a74facc1b035 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 75 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/83/3383/1 diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index 437479b..9c78ecf 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -208,6 +208,7 @@ { struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_bssgph(msg); enum bssgp_pdu_type pdu_type = (enum bssgp_pdu_type) bgph->pdu_type; + int bvci = bctx ? bctx->bvci : -1; unsigned rc = 0; if (!bctx) @@ -224,29 +225,51 @@ } switch (pdu_type) { + case BSSGP_PDUT_STATUS: + /* already handled in libosmogb */ + OSMO_ASSERT(0); + break; case BSSGP_PDUT_DL_UNITDATA: - LOGP(DBSSGP, LOGL_DEBUG, "RX: [SGSN->PCU] BSSGP_PDUT_DL_UNITDATA\n"); + LOGP(DBSSGP, LOGL_DEBUG, "Rx BSSGP BVCI=%d (PTP) DL_UNITDATA\n", bvci); if (the_pcu.on_dl_unit_data) the_pcu.on_dl_unit_data(&the_pcu, msg, tp); gprs_bssgp_pcu_rx_dl_ud(msg, tp); break; - case BSSGP_PDUT_PAGING_PS: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_PAGING_PS\n"); - break; - case BSSGP_PDUT_PAGING_CS: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_PAGING_CS\n"); - break; - case BSSGP_PDUT_RA_CAPA_UPDATE_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_RA_CAPA_UPDATE_ACK\n"); - break; case BSSGP_PDUT_FLOW_CONTROL_BVC_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_FLOW_CONTROL_BVC_ACK\n"); - break; case BSSGP_PDUT_FLOW_CONTROL_MS_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_FLOW_CONTROL_MS_ACK\n"); + LOGP(DBSSGP, LOGL_DEBUG, "Rx BSSGP BVCI=%d (PTP) %s\n", + bvci, bssgp_pdu_str(pdu_type)); + break; + case BSSGP_PDUT_PAGING_PS: + case BSSGP_PDUT_PAGING_CS: + case BSSGP_PDUT_RA_CAPABILITY: + case BSSGP_PDUT_RA_CAPA_UPDATE_ACK: + LOGP(DBSSGP, LOGL_INFO, "Rx BSSGP BVCI=%d (PTP) PDU type %s not implemented\n", + bvci, bssgp_pdu_str(pdu_type)); + break; + /* See TS 08.18 5.4.1 */ + case BSSGP_PDUT_SUSPEND: + case BSSGP_PDUT_SUSPEND_ACK: + case BSSGP_PDUT_SUSPEND_NACK: + case BSSGP_PDUT_RESUME: + case BSSGP_PDUT_RESUME_ACK: + case BSSGP_PDUT_RESUME_NACK: + case BSSGP_PDUT_FLUSH_LL: + case BSSGP_PDUT_FLUSH_LL_ACK: + case BSSGP_PDUT_LLC_DISCARD: + case BSSGP_PDUT_BVC_BLOCK: + case BSSGP_PDUT_BVC_BLOCK_ACK: + case BSSGP_PDUT_BVC_UNBLOCK: + case BSSGP_PDUT_BVC_UNBLOCK_ACK: + case BSSGP_PDUT_BVC_RESET: + case BSSGP_PDUT_BVC_RESET_ACK: + case BSSGP_PDUT_SGSN_INVOKE_TRACE: + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%u (PTP) PDU type %s unexpected at PTP\n", + bctx->bvci, bssgp_pdu_str(pdu_type)); + rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, msg); break; default: - LOGP(DBSSGP, LOGL_NOTICE, "BSSGP BVCI=%u PDU type %s unknown\n", + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%u (PTP) PDU type %s unknown\n", bctx->bvci, bssgp_pdu_str(pdu_type)); rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, msg); break; @@ -263,18 +286,17 @@ int bvci = bctx ? bctx->bvci : -1; switch (pdu_type) { case BSSGP_PDUT_STATUS: - /* Some exception has occurred */ - DEBUGP(DBSSGP, "BSSGP BVCI=%d Rx BVC STATUS\n", bvci); - /* FIXME: send NM_STATUS.ind to NM */ + /* already handled in libosmogb */ + OSMO_ASSERT(0); break; case BSSGP_PDUT_SUSPEND_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_SUSPEND_ACK\n"); - break; - case BSSGP_PDUT_SUSPEND_NACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_SUSPEND_NACK\n"); + case BSSGP_PDUT_RESUME_ACK: + case BSSGP_PDUT_BVC_BLOCK_ACK: + LOGP(DBSSGP, LOGL_DEBUG, "Rx BSSGP BVCI=%d (SIGN) %s\n", + bvci, bssgp_pdu_str(pdu_type)); break; case BSSGP_PDUT_BVC_RESET_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_BVC_RESET_ACK\n"); + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%d (SIGN) BVC_RESET_ACK\n", bvci); if (!the_pcu.bvc_sig_reset) the_pcu.bvc_sig_reset = 1; else @@ -282,36 +304,48 @@ bvc_timeout(NULL); break; case BSSGP_PDUT_PAGING_PS: - LOGP(DBSSGP, LOGL_NOTICE, "RX: [SGSN->PCU] BSSGP_PDUT_PAGING_PS\n"); gprs_bssgp_pcu_rx_paging_ps(msg, tp); break; - case BSSGP_PDUT_PAGING_CS: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_PAGING_CS\n"); - break; - case BSSGP_PDUT_RESUME_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_RESUME_ACK\n"); - break; - case BSSGP_PDUT_RESUME_NACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_RESUME_NACK\n"); - break; - case BSSGP_PDUT_FLUSH_LL: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_FLUSH_LL\n"); - break; - case BSSGP_PDUT_BVC_BLOCK_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_SUSPEND_ACK\n"); - break; case BSSGP_PDUT_BVC_UNBLOCK_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_BVC_UNBLOCK_ACK\n"); + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%d (SIGN) BVC_UNBLOCK_ACK\n", bvci); the_pcu.bvc_unblocked = 1; if (the_pcu.on_unblock_ack) the_pcu.on_unblock_ack(&the_pcu); bvc_timeout(NULL); break; + case BSSGP_PDUT_SUSPEND_NACK: + case BSSGP_PDUT_RESUME_NACK: + case BSSGP_PDUT_PAGING_CS: + case BSSGP_PDUT_FLUSH_LL: case BSSGP_PDUT_SGSN_INVOKE_TRACE: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_SGSN_INVOKE_TRACE\n"); + LOGP(DBSSGP, LOGL_INFO, "Rx BSSGP BVCI=%d (SIGN) PDU type %s not implemented\n", + bvci, bssgp_pdu_str(pdu_type)); + break; + /* See TS 08.18 5.4.1 */ + case BSSGP_PDUT_UL_UNITDATA: + case BSSGP_PDUT_DL_UNITDATA: + case BSSGP_PDUT_RA_CAPABILITY: + case BSSGP_PDUT_PTM_UNITDATA: + case BSSGP_PDUT_RA_CAPA_UDPATE: + case BSSGP_PDUT_RA_CAPA_UPDATE_ACK: + case BSSGP_PDUT_RADIO_STATUS: + case BSSGP_PDUT_FLOW_CONTROL_BVC: + case BSSGP_PDUT_FLOW_CONTROL_BVC_ACK: + case BSSGP_PDUT_FLOW_CONTROL_MS: + case BSSGP_PDUT_FLOW_CONTROL_MS_ACK: + case BSSGP_PDUT_DOWNLOAD_BSS_PFC: + case BSSGP_PDUT_CREATE_BSS_PFC: + case BSSGP_PDUT_CREATE_BSS_PFC_ACK: + case BSSGP_PDUT_CREATE_BSS_PFC_NACK: + case BSSGP_PDUT_MODIFY_BSS_PFC: + case BSSGP_PDUT_MODIFY_BSS_PFC_ACK: + case BSSGP_PDUT_DELETE_BSS_PFC: + case BSSGP_PDUT_DELETE_BSS_PFC_ACK: + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%d (SIGN) PDU type %s unexpected at SIGN\n", + bvci, bssgp_pdu_str(pdu_type)); break; default: - LOGP(DBSSGP, LOGL_NOTICE, "BSSGP BVCI=%d Rx PDU type %s unknown\n", + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%d (SIGN) PDU type %s unknown\n", bvci, bssgp_pdu_str(pdu_type)); rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, msg); break; -- To view, visit https://gerrit.osmocom.org/3383 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie32f5771d49960547ec5d7611f96a74facc1b035 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 29 08:21:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 08:21:51 +0000 Subject: [PATCH] osmo-pcu[master]: Forward GPRS SUSPEND REQ from BTS to SGSN using BSSGP Message-ID: Review at https://gerrit.osmocom.org/3384 Forward GPRS SUSPEND REQ from BTS to SGSN using BSSGP As specified in 3GPP TS 03.60 Section 16.2.1 and 44.018 Section 3.4.15, a Class B MS is sending a "RR GPRS SUSPEND REQ" via a DCCH to the BTS if it wants to suspend GPRS services. As of Change-Id I3c1af662c8f0d3d22da200638480f6ef05c3ed1f, OsmoBTS forwards this via the PCU socket, so we need to pick it up and send it via BSSGP to the SGSN. Change-Id: I7b4beb413a6f974373a404b5a11c44d86ba695d3 Closes: OS#2249 --- M include/osmocom/pcu/pcuif_proto.h M src/pcu_l1_if.cpp 2 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/84/3384/1 diff --git a/include/osmocom/pcu/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h index 88dc09e..d6c7556 100644 --- a/include/osmocom/pcu/pcuif_proto.h +++ b/include/osmocom/pcu/pcuif_proto.h @@ -10,6 +10,7 @@ #define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ #define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */ #define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ +#define PCU_IF_MSG_SUSP_REQ 0x03 /* BTS forwards GPRS SUSP REQ to PCU */ #define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ #define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ #define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */ @@ -150,6 +151,13 @@ uint8_t identity_lv[9]; } __attribute__ ((packed)); +/* BTS tells PCU about a GPRS SUSPENSION REQUEST received on DCCH */ +struct gsm_pcu_if_susp_req { + uint32_t tlli; + uint8_t ra_id[6]; + uint8_t cause; +} __attribute__ ((packed)); + struct gsm_pcu_if { /* context based information */ uint8_t msg_type; /* message type */ @@ -160,6 +168,7 @@ struct gsm_pcu_if_data data_req; struct gsm_pcu_if_data data_cnf; struct gsm_pcu_if_data data_ind; + struct gsm_pcu_if_susp_req susp_req; struct gsm_pcu_if_rts_req rts_req; struct gsm_pcu_if_rach_ind rach_ind; struct gsm_pcu_if_txt_ind txt_ind; diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 420bca0..9d05539 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -563,6 +563,21 @@ pag_req->identity_lv); } +static int pcu_rx_susp_req(struct gsm_pcu_if_susp_req *susp_req) +{ + struct bssgp_bvc_ctx *bctx = gprs_bssgp_pcu_current_bctx(); + struct gprs_ra_id ra_id; + + gsm48_parse_ra(&ra_id, susp_req->ra_id); + + LOGP(DL1IF, LOGL_DEBUG, "GPRS Suspent request received: tlli=0x%08x\n", susp_req->tlli); + + if (!bctx) + return -1; + + return bssgp_tx_suspend(bctx->nsei, susp_req->tlli, &ra_id); +} + int pcu_rx(uint8_t msg_type, struct gsm_pcu_if *pcu_prim) { int rc = 0; @@ -589,6 +604,9 @@ case PCU_IF_MSG_PAG_REQ: rc = pcu_rx_pag_req(&pcu_prim->u.pag_req); break; + case PCU_IF_MSG_SUSP_REQ: + rc = pcu_rx_susp_req(&pcu_prim->u.susp_req); + break; default: LOGP(DL1IF, LOGL_ERROR, "Received unknwon PCU msg type %d\n", msg_type); -- To view, visit https://gerrit.osmocom.org/3384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b4beb413a6f974373a404b5a11c44d86ba695d3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 29 09:11:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 09:11:58 +0000 Subject: osmo-pcu[master]: Remove #warnings that have been adressed since 2015 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a1767bc7cab01048e851fd4e63112bc676d6c78 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 29 09:11:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 09:11:59 +0000 Subject: [MERGED] osmo-pcu[master]: Remove #warnings that have been adressed since 2015 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove #warnings that have been adressed since 2015 ...................................................................... Remove #warnings that have been adressed since 2015 In commit 939904672961fa7e28397e27f942a7d1fff4bbdf the lookup by TLLI, TLLI-OLD and IMSI has been implemented, but the corresponding compile-time warning was never removed. Change-Id: I7a1767bc7cab01048e851fd4e63112bc676d6c78 --- M src/tbf_dl.cpp 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index a894789..505d488 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -126,8 +126,6 @@ GprsMs *ms; /* check for uplink data, so we copy our informations */ -#warning "Do the same look up for IMSI, TLLI and OLD_TLLI" -#warning "Refactor the below lines... into a new method" ms = bts->bts->ms_store().get_ms(tlli, tlli_old, imsi); if (ms) { ul_tbf = ms->ul_tbf(); -- To view, visit https://gerrit.osmocom.org/3382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a1767bc7cab01048e851fd4e63112bc676d6c78 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 29 09:12:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 09:12:12 +0000 Subject: osmo-pcu[master]: BSSGP: Improve logging of received messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3383 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie32f5771d49960547ec5d7611f96a74facc1b035 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 29 09:12:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 09:12:14 +0000 Subject: [MERGED] osmo-pcu[master]: BSSGP: Improve logging of received messages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSGP: Improve logging of received messages ...................................................................... BSSGP: Improve logging of received messages We now differentiate clearly between messages that a) we don't expect based on our reading of the spec b) we have not implemented yet (but should) c) we do not even know of Also, unify the log string formats and provide BVCI whenever possible. Change-Id: Ie32f5771d49960547ec5d7611f96a74facc1b035 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 75 insertions(+), 41 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index 437479b..9c78ecf 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -208,6 +208,7 @@ { struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_bssgph(msg); enum bssgp_pdu_type pdu_type = (enum bssgp_pdu_type) bgph->pdu_type; + int bvci = bctx ? bctx->bvci : -1; unsigned rc = 0; if (!bctx) @@ -224,29 +225,51 @@ } switch (pdu_type) { + case BSSGP_PDUT_STATUS: + /* already handled in libosmogb */ + OSMO_ASSERT(0); + break; case BSSGP_PDUT_DL_UNITDATA: - LOGP(DBSSGP, LOGL_DEBUG, "RX: [SGSN->PCU] BSSGP_PDUT_DL_UNITDATA\n"); + LOGP(DBSSGP, LOGL_DEBUG, "Rx BSSGP BVCI=%d (PTP) DL_UNITDATA\n", bvci); if (the_pcu.on_dl_unit_data) the_pcu.on_dl_unit_data(&the_pcu, msg, tp); gprs_bssgp_pcu_rx_dl_ud(msg, tp); break; - case BSSGP_PDUT_PAGING_PS: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_PAGING_PS\n"); - break; - case BSSGP_PDUT_PAGING_CS: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_PAGING_CS\n"); - break; - case BSSGP_PDUT_RA_CAPA_UPDATE_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_RA_CAPA_UPDATE_ACK\n"); - break; case BSSGP_PDUT_FLOW_CONTROL_BVC_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_FLOW_CONTROL_BVC_ACK\n"); - break; case BSSGP_PDUT_FLOW_CONTROL_MS_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_FLOW_CONTROL_MS_ACK\n"); + LOGP(DBSSGP, LOGL_DEBUG, "Rx BSSGP BVCI=%d (PTP) %s\n", + bvci, bssgp_pdu_str(pdu_type)); + break; + case BSSGP_PDUT_PAGING_PS: + case BSSGP_PDUT_PAGING_CS: + case BSSGP_PDUT_RA_CAPABILITY: + case BSSGP_PDUT_RA_CAPA_UPDATE_ACK: + LOGP(DBSSGP, LOGL_INFO, "Rx BSSGP BVCI=%d (PTP) PDU type %s not implemented\n", + bvci, bssgp_pdu_str(pdu_type)); + break; + /* See TS 08.18 5.4.1 */ + case BSSGP_PDUT_SUSPEND: + case BSSGP_PDUT_SUSPEND_ACK: + case BSSGP_PDUT_SUSPEND_NACK: + case BSSGP_PDUT_RESUME: + case BSSGP_PDUT_RESUME_ACK: + case BSSGP_PDUT_RESUME_NACK: + case BSSGP_PDUT_FLUSH_LL: + case BSSGP_PDUT_FLUSH_LL_ACK: + case BSSGP_PDUT_LLC_DISCARD: + case BSSGP_PDUT_BVC_BLOCK: + case BSSGP_PDUT_BVC_BLOCK_ACK: + case BSSGP_PDUT_BVC_UNBLOCK: + case BSSGP_PDUT_BVC_UNBLOCK_ACK: + case BSSGP_PDUT_BVC_RESET: + case BSSGP_PDUT_BVC_RESET_ACK: + case BSSGP_PDUT_SGSN_INVOKE_TRACE: + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%u (PTP) PDU type %s unexpected at PTP\n", + bctx->bvci, bssgp_pdu_str(pdu_type)); + rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, msg); break; default: - LOGP(DBSSGP, LOGL_NOTICE, "BSSGP BVCI=%u PDU type %s unknown\n", + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%u (PTP) PDU type %s unknown\n", bctx->bvci, bssgp_pdu_str(pdu_type)); rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, msg); break; @@ -263,18 +286,17 @@ int bvci = bctx ? bctx->bvci : -1; switch (pdu_type) { case BSSGP_PDUT_STATUS: - /* Some exception has occurred */ - DEBUGP(DBSSGP, "BSSGP BVCI=%d Rx BVC STATUS\n", bvci); - /* FIXME: send NM_STATUS.ind to NM */ + /* already handled in libosmogb */ + OSMO_ASSERT(0); break; case BSSGP_PDUT_SUSPEND_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_SUSPEND_ACK\n"); - break; - case BSSGP_PDUT_SUSPEND_NACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_SUSPEND_NACK\n"); + case BSSGP_PDUT_RESUME_ACK: + case BSSGP_PDUT_BVC_BLOCK_ACK: + LOGP(DBSSGP, LOGL_DEBUG, "Rx BSSGP BVCI=%d (SIGN) %s\n", + bvci, bssgp_pdu_str(pdu_type)); break; case BSSGP_PDUT_BVC_RESET_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_BVC_RESET_ACK\n"); + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%d (SIGN) BVC_RESET_ACK\n", bvci); if (!the_pcu.bvc_sig_reset) the_pcu.bvc_sig_reset = 1; else @@ -282,36 +304,48 @@ bvc_timeout(NULL); break; case BSSGP_PDUT_PAGING_PS: - LOGP(DBSSGP, LOGL_NOTICE, "RX: [SGSN->PCU] BSSGP_PDUT_PAGING_PS\n"); gprs_bssgp_pcu_rx_paging_ps(msg, tp); break; - case BSSGP_PDUT_PAGING_CS: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_PAGING_CS\n"); - break; - case BSSGP_PDUT_RESUME_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_RESUME_ACK\n"); - break; - case BSSGP_PDUT_RESUME_NACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_RESUME_NACK\n"); - break; - case BSSGP_PDUT_FLUSH_LL: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_FLUSH_LL\n"); - break; - case BSSGP_PDUT_BVC_BLOCK_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_SUSPEND_ACK\n"); - break; case BSSGP_PDUT_BVC_UNBLOCK_ACK: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_BVC_UNBLOCK_ACK\n"); + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%d (SIGN) BVC_UNBLOCK_ACK\n", bvci); the_pcu.bvc_unblocked = 1; if (the_pcu.on_unblock_ack) the_pcu.on_unblock_ack(&the_pcu); bvc_timeout(NULL); break; + case BSSGP_PDUT_SUSPEND_NACK: + case BSSGP_PDUT_RESUME_NACK: + case BSSGP_PDUT_PAGING_CS: + case BSSGP_PDUT_FLUSH_LL: case BSSGP_PDUT_SGSN_INVOKE_TRACE: - LOGP(DBSSGP, LOGL_DEBUG, "rx BSSGP_PDUT_SGSN_INVOKE_TRACE\n"); + LOGP(DBSSGP, LOGL_INFO, "Rx BSSGP BVCI=%d (SIGN) PDU type %s not implemented\n", + bvci, bssgp_pdu_str(pdu_type)); + break; + /* See TS 08.18 5.4.1 */ + case BSSGP_PDUT_UL_UNITDATA: + case BSSGP_PDUT_DL_UNITDATA: + case BSSGP_PDUT_RA_CAPABILITY: + case BSSGP_PDUT_PTM_UNITDATA: + case BSSGP_PDUT_RA_CAPA_UDPATE: + case BSSGP_PDUT_RA_CAPA_UPDATE_ACK: + case BSSGP_PDUT_RADIO_STATUS: + case BSSGP_PDUT_FLOW_CONTROL_BVC: + case BSSGP_PDUT_FLOW_CONTROL_BVC_ACK: + case BSSGP_PDUT_FLOW_CONTROL_MS: + case BSSGP_PDUT_FLOW_CONTROL_MS_ACK: + case BSSGP_PDUT_DOWNLOAD_BSS_PFC: + case BSSGP_PDUT_CREATE_BSS_PFC: + case BSSGP_PDUT_CREATE_BSS_PFC_ACK: + case BSSGP_PDUT_CREATE_BSS_PFC_NACK: + case BSSGP_PDUT_MODIFY_BSS_PFC: + case BSSGP_PDUT_MODIFY_BSS_PFC_ACK: + case BSSGP_PDUT_DELETE_BSS_PFC: + case BSSGP_PDUT_DELETE_BSS_PFC_ACK: + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%d (SIGN) PDU type %s unexpected at SIGN\n", + bvci, bssgp_pdu_str(pdu_type)); break; default: - LOGP(DBSSGP, LOGL_NOTICE, "BSSGP BVCI=%d Rx PDU type %s unknown\n", + LOGP(DBSSGP, LOGL_NOTICE, "Rx BSSGP BVCI=%d (SIGN) PDU type %s unknown\n", bvci, bssgp_pdu_str(pdu_type)); rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, msg); break; -- To view, visit https://gerrit.osmocom.org/3383 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie32f5771d49960547ec5d7611f96a74facc1b035 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 29 11:36:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 11:36:34 +0000 Subject: [PATCH] libosmocore[master]: Rename GSMTAP_CHANNEL_PDCH to GSMTAP_CHANNEL_PDTCH Message-ID: Review at https://gerrit.osmocom.org/3385 Rename GSMTAP_CHANNEL_PDCH to GSMTAP_CHANNEL_PDTCH PDCH is the physical channel, while actually we want to talk about PDTCH the logical channel. Introduce backwards compatibility define. Change-Id: Id6782d2247846e2db29fc58d98684970a66db948 --- M include/osmocom/core/gsmtap.h 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/3385/1 diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h index 1e19315..c226185 100644 --- a/include/osmocom/core/gsmtap.h +++ b/include/osmocom/core/gsmtap.h @@ -85,7 +85,9 @@ #define GSMTAP_CHANNEL_TCH_H 0x0a #define GSMTAP_CHANNEL_PACCH 0x0b #define GSMTAP_CHANNEL_CBCH52 0x0c -#define GSMTAP_CHANNEL_PDCH 0x0d +#define GSMTAP_CHANNEL_PDTCH 0x0d +/* for legacy reasons we use a mis-spelled name. PDCH is really the physical channel, but we use it as PDTCH */ +#define GSMTAP_CHANNEL_PDCH GSMTAP_CHANNEL_PDTCH #define GSMTAP_CHANNEL_PTCCH 0x0e #define GSMTAP_CHANNEL_CBCH51 0x0f -- To view, visit https://gerrit.osmocom.org/3385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6782d2247846e2db29fc58d98684970a66db948 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 29 11:44:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 11:44:13 +0000 Subject: libosmocore[master]: Rename GSMTAP_CHANNEL_PDCH to GSMTAP_CHANNEL_PDTCH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6782d2247846e2db29fc58d98684970a66db948 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 Jul 29 11:44:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 11:44:16 +0000 Subject: [MERGED] libosmocore[master]: Rename GSMTAP_CHANNEL_PDCH to GSMTAP_CHANNEL_PDTCH In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Rename GSMTAP_CHANNEL_PDCH to GSMTAP_CHANNEL_PDTCH ...................................................................... Rename GSMTAP_CHANNEL_PDCH to GSMTAP_CHANNEL_PDTCH PDCH is the physical channel, while actually we want to talk about PDTCH the logical channel. Introduce backwards compatibility define. Change-Id: Id6782d2247846e2db29fc58d98684970a66db948 --- M include/osmocom/core/gsmtap.h 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h index 1e19315..c226185 100644 --- a/include/osmocom/core/gsmtap.h +++ b/include/osmocom/core/gsmtap.h @@ -85,7 +85,9 @@ #define GSMTAP_CHANNEL_TCH_H 0x0a #define GSMTAP_CHANNEL_PACCH 0x0b #define GSMTAP_CHANNEL_CBCH52 0x0c -#define GSMTAP_CHANNEL_PDCH 0x0d +#define GSMTAP_CHANNEL_PDTCH 0x0d +/* for legacy reasons we use a mis-spelled name. PDCH is really the physical channel, but we use it as PDTCH */ +#define GSMTAP_CHANNEL_PDCH GSMTAP_CHANNEL_PDTCH #define GSMTAP_CHANNEL_PTCCH 0x0e #define GSMTAP_CHANNEL_CBCH51 0x0f -- To view, visit https://gerrit.osmocom.org/3385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id6782d2247846e2db29fc58d98684970a66db948 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 Jul 29 11:44:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 11:44:42 +0000 Subject: [PATCH] osmo-pcu[master]: GSMTAP: Fix channel type for data blocks: PDTCH instead of P... Message-ID: Review at https://gerrit.osmocom.org/3386 GSMTAP: Fix channel type for data blocks: PDTCH instead of PACCH PACCH is used only for RLC/MAC control messages, while PDTCH is used for data. Change-Id: I6c912e17d8c8d4178096679a541e61eeeb4b6643 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/86/3386/1 diff --git a/src/bts.cpp b/src/bts.cpp index 5d1a500..2bafd63 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1598,9 +1598,9 @@ cs.name()); return -EINVAL; } - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + 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_PACCH, fn, data, data_len); + 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)); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index e5c8ec8..42f0308 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -367,7 +367,7 @@ if (msg) { bts->bts->rlc_sent(); /* FIXME: distinguish between GPRS and EGPRS */ - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); } } -- To view, visit https://gerrit.osmocom.org/3386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c912e17d8c8d4178096679a541e61eeeb4b6643 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 29 11:44:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 11:44:42 +0000 Subject: [PATCH] osmo-pcu[master]: GSMTAP: Fix logical channel of downlink PTCCH Message-ID: Review at https://gerrit.osmocom.org/3387 GSMTAP: Fix logical channel of downlink PTCCH Change-Id: I29ecc968d56d4d0165cffa206297c42d6fb02cf4 --- M src/pcu_l1_if.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/87/3387/1 diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 420bca0..42164e4 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -183,7 +183,7 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); + gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PTCCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 1, fn, arfcn, block_nr, -- To view, visit https://gerrit.osmocom.org/3387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I29ecc968d56d4d0165cffa206297c42d6fb02cf4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 29 11:44:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 11:44:43 +0000 Subject: [PATCH] osmo-pcu[master]: GSMTAP: Ad PTCCH as separate gsmtap category Message-ID: Review at https://gerrit.osmocom.org/3388 GSMTAP: Ad PTCCH as separate gsmtap category This allows us to send GSMTAP for PTCCH only if requested by user/vty Change-Id: Id720f4bebdce7f6152fbddddbe05036638c5866e --- M src/bts.h M src/pcu_l1_if.cpp M src/pcu_vty.c 3 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/88/3388/1 diff --git a/src/bts.h b/src/bts.h index 66875f1..25193f9 100644 --- a/src/bts.h +++ b/src/bts.h @@ -51,6 +51,7 @@ PCU_GSMTAP_C_DL_CTRL = 2, /* downlink control blocks */ PCU_GSMTAP_C_DL_DATA_GPRS = 3, /* downlink GPRS data blocks */ PCU_GSMTAP_C_DL_DATA_EGPRS = 4, /* downlink EGPRS data blocks */ + PCU_GSMTAP_C_DL_PTCCH = 5, /* downlink PTCCH blocks */ PCU_GSMTAP_C_UL_UNKNOWN = 15, /* unknown or undecodable uplink blocks */ PCU_GSMTAP_C_UL_DUMMY = 16, /* uplink dummy blocks */ diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 42164e4..8ea2ad5 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -183,7 +183,8 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PTCCH, 0, fn, 0, 0, msg->data, msg->len); + if (bts->gsmtap_categ_mask & PCU_GSMTAP_C_DL_PTCCH) + gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PTCCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 1, fn, arfcn, block_nr, diff --git a/src/pcu_vty.c b/src/pcu_vty.c index fc57a5f..cd22e38 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -24,6 +24,7 @@ { PCU_GSMTAP_C_DL_CTRL, "dl-ctrl" }, { PCU_GSMTAP_C_DL_DATA_GPRS, "dl-data-gprs" }, { PCU_GSMTAP_C_DL_DATA_EGPRS, "dl-data-egprs" }, + { PCU_GSMTAP_C_DL_PTCCH, "dl-ptcch" }, { PCU_GSMTAP_C_UL_UNKNOWN, "ul-unknown" }, { PCU_GSMTAP_C_UL_DUMMY, "ul-dummy" }, @@ -40,6 +41,7 @@ { PCU_GSMTAP_C_DL_CTRL, "Downlink Control Blocks" }, { PCU_GSMTAP_C_DL_DATA_GPRS, "Downlink Data Blocks (GPRS)" }, { PCU_GSMTAP_C_DL_DATA_EGPRS, "Downlink Data Blocks (EGPRS)" }, + { PCU_GSMTAP_C_DL_PTCCH, "Downlink PTCCH Blocks" }, { PCU_GSMTAP_C_UL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" }, { PCU_GSMTAP_C_UL_DUMMY, "Uplink Dummy Blocks" }, -- To view, visit https://gerrit.osmocom.org/3388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id720f4bebdce7f6152fbddddbe05036638c5866e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jul 29 11:46:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 11:46:19 +0000 Subject: osmo-pcu[master]: GSMTAP: Fix channel type for data blocks: PDTCH instead of P... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6c912e17d8c8d4178096679a541e61eeeb4b6643 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 29 11:46:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 11:46:30 +0000 Subject: osmo-pcu[master]: GSMTAP: Fix logical channel of downlink PTCCH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29ecc968d56d4d0165cffa206297c42d6fb02cf4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 29 11:47:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 11:47:09 +0000 Subject: osmo-pcu[master]: GSMTAP: Ad PTCCH as separate gsmtap category In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id720f4bebdce7f6152fbddddbe05036638c5866e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jul 29 18:30:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 18:30:55 +0000 Subject: [MERGED] osmo-pcu[master]: GSMTAP: Fix channel type for data blocks: PDTCH instead of P... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSMTAP: Fix channel type for data blocks: PDTCH instead of PACCH ...................................................................... GSMTAP: Fix channel type for data blocks: PDTCH instead of PACCH PACCH is used only for RLC/MAC control messages, while PDTCH is used for data. Change-Id: I6c912e17d8c8d4178096679a541e61eeeb4b6643 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 5d1a500..2bafd63 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1598,9 +1598,9 @@ cs.name()); return -EINVAL; } - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + 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_PACCH, fn, data, data_len); + 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)); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index e5c8ec8..42f0308 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -367,7 +367,7 @@ if (msg) { bts->bts->rlc_sent(); /* FIXME: distinguish between GPRS and EGPRS */ - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); } } -- To view, visit https://gerrit.osmocom.org/3386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6c912e17d8c8d4178096679a541e61eeeb4b6643 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 29 18:30:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 18:30:58 +0000 Subject: [MERGED] osmo-pcu[master]: GSMTAP: Fix logical channel of downlink PTCCH In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSMTAP: Fix logical channel of downlink PTCCH ...................................................................... GSMTAP: Fix logical channel of downlink PTCCH Change-Id: I29ecc968d56d4d0165cffa206297c42d6fb02cf4 --- M src/pcu_l1_if.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 420bca0..42164e4 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -183,7 +183,7 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); + gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PTCCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 1, fn, arfcn, block_nr, -- To view, visit https://gerrit.osmocom.org/3387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I29ecc968d56d4d0165cffa206297c42d6fb02cf4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 29 18:31:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 18:31:00 +0000 Subject: [MERGED] osmo-pcu[master]: GSMTAP: Ad PTCCH as separate gsmtap category In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSMTAP: Ad PTCCH as separate gsmtap category ...................................................................... GSMTAP: Ad PTCCH as separate gsmtap category This allows us to send GSMTAP for PTCCH only if requested by user/vty Change-Id: Id720f4bebdce7f6152fbddddbe05036638c5866e --- M src/bts.h M src/pcu_l1_if.cpp M src/pcu_vty.c 3 files changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.h b/src/bts.h index 66875f1..25193f9 100644 --- a/src/bts.h +++ b/src/bts.h @@ -51,6 +51,7 @@ PCU_GSMTAP_C_DL_CTRL = 2, /* downlink control blocks */ PCU_GSMTAP_C_DL_DATA_GPRS = 3, /* downlink GPRS data blocks */ PCU_GSMTAP_C_DL_DATA_EGPRS = 4, /* downlink EGPRS data blocks */ + PCU_GSMTAP_C_DL_PTCCH = 5, /* downlink PTCCH blocks */ PCU_GSMTAP_C_UL_UNKNOWN = 15, /* unknown or undecodable uplink blocks */ PCU_GSMTAP_C_UL_DUMMY = 16, /* uplink dummy blocks */ diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 42164e4..8ea2ad5 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -183,7 +183,8 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PTCCH, 0, fn, 0, 0, msg->data, msg->len); + if (bts->gsmtap_categ_mask & PCU_GSMTAP_C_DL_PTCCH) + gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PTCCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 1, fn, arfcn, block_nr, diff --git a/src/pcu_vty.c b/src/pcu_vty.c index fc57a5f..cd22e38 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -24,6 +24,7 @@ { PCU_GSMTAP_C_DL_CTRL, "dl-ctrl" }, { PCU_GSMTAP_C_DL_DATA_GPRS, "dl-data-gprs" }, { PCU_GSMTAP_C_DL_DATA_EGPRS, "dl-data-egprs" }, + { PCU_GSMTAP_C_DL_PTCCH, "dl-ptcch" }, { PCU_GSMTAP_C_UL_UNKNOWN, "ul-unknown" }, { PCU_GSMTAP_C_UL_DUMMY, "ul-dummy" }, @@ -40,6 +41,7 @@ { PCU_GSMTAP_C_DL_CTRL, "Downlink Control Blocks" }, { PCU_GSMTAP_C_DL_DATA_GPRS, "Downlink Data Blocks (GPRS)" }, { PCU_GSMTAP_C_DL_DATA_EGPRS, "Downlink Data Blocks (EGPRS)" }, + { PCU_GSMTAP_C_DL_PTCCH, "Downlink PTCCH Blocks" }, { PCU_GSMTAP_C_UL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" }, { PCU_GSMTAP_C_UL_DUMMY, "Uplink Dummy Blocks" }, -- To view, visit https://gerrit.osmocom.org/3388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id720f4bebdce7f6152fbddddbe05036638c5866e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jul 29 20:15:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 29 Jul 2017 20:15:10 +0000 Subject: [PATCH] osmo-pcu[master]: README: Clarify that fixed allocations have been revmoved fr... Message-ID: Review at https://gerrit.osmocom.org/3389 README: Clarify that fixed allocations have been revmoved from 3GPP specs In Release 5, Fixed Allocations were removed as part of a "GPRS simplification project" inside 3PGPP. This means that any MS compatible with Rel-5 or higher may not support it, which makes implementation in the PCU af historical interest only. See Tdoc GP-021277 for the actual removal, it happened at 5.0.0 time. Change-Id: I8138bc0a47d3468b67cec866447fd4b0fc69d4c5 --- M README.md 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/89/3389/1 diff --git a/README.md b/README.md index ed5ab17..65cf475 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ ------------------- * No PFC support - * No fixed allocation support + * No fixed allocation support (was removed from 3GPP Rel >= 5 anyway) * No extended dynamic allocation support * No unacknowledged mode operation * Only single slot assignment on uplink direction -- To view, visit https://gerrit.osmocom.org/3389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8138bc0a47d3468b67cec866447fd4b0fc69d4c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jul 30 12:31:48 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 30 Jul 2017 12:31:48 +0000 Subject: libosmocore[master]: gsm0480: refactor the parse_process_uss_req() In-Reply-To: References: Message-ID: Patch Set 3: 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: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 12:33:13 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 30 Jul 2017 12:33:13 +0000 Subject: libosmocore[master]: gsm0480: handle UnstructuredSS request with DSC != 0x0F In-Reply-To: References: Message-ID: Patch Set 3: 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: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 12:34:51 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 30 Jul 2017 12:34:51 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3374/2/include/osmocom/gsm/gsm0480.h File include/osmocom/gsm/gsm0480.h: Line 10: #define MAX_LEN_USSD_STRING 182 Could we add a reference to the standard here to point at where this value is coming from? -- 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: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jul 30 12:36:40 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 30 Jul 2017 12:36:40 +0000 Subject: libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: Patch Set 3: 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: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 12:38:16 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 30 Jul 2017 12:38:16 +0000 Subject: libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Patch Set 3: 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: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 12:39:33 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 30 Jul 2017 12:39:33 +0000 Subject: libosmocore[master]: gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 12:40:15 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 30 Jul 2017 12:40:15 +0000 Subject: libosmocore[master]: gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 13:17:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 13:17:22 +0000 Subject: [PATCH] libosmocore[master]: RSL: Add support for RSL_CHAN_OSMO_PDCH to rsl_dec_chan_nr() Message-ID: Review at https://gerrit.osmocom.org/3390 RSL: Add support for RSL_CHAN_OSMO_PDCH to rsl_dec_chan_nr() Change-Id: Icc772285636c06e1075a89809f0ac379d7a0002c --- M src/gsm/rsl.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/3390/1 diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index 83097fd..2a2af1f 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -202,6 +202,9 @@ } else if ((chan_nr & 0xf8) == RSL_CHAN_PCH_AGCH) { *type = RSL_CHAN_PCH_AGCH; *subch = 0; + } else if ((chan_nr & 0xf8) == RSL_CHAN_OSMO_PDCH) { + *type = RSL_CHAN_OSMO_PDCH; + *subch = 0; } else return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc772285636c06e1075a89809f0ac379d7a0002c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jul 30 14:41:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 14:41:47 +0000 Subject: osmo-pcu[master]: README: Clarify that fixed allocations have been revmoved fr... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8138bc0a47d3468b67cec866447fd4b0fc69d4c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 14:41:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 14:41:56 +0000 Subject: [MERGED] osmo-pcu[master]: README: Clarify that fixed allocations have been revmoved fr... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: README: Clarify that fixed allocations have been revmoved from 3GPP specs ...................................................................... README: Clarify that fixed allocations have been revmoved from 3GPP specs In Release 5, Fixed Allocations were removed as part of a "GPRS simplification project" inside 3PGPP. This means that any MS compatible with Rel-5 or higher may not support it, which makes implementation in the PCU af historical interest only. See Tdoc GP-021277 for the actual removal, it happened at 5.0.0 time. Change-Id: I8138bc0a47d3468b67cec866447fd4b0fc69d4c5 --- M README.md 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/README.md b/README.md index ed5ab17..65cf475 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ ------------------- * No PFC support - * No fixed allocation support + * No fixed allocation support (was removed from 3GPP Rel >= 5 anyway) * No extended dynamic allocation support * No unacknowledged mode operation * Only single slot assignment on uplink direction -- To view, visit https://gerrit.osmocom.org/3389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8138bc0a47d3468b67cec866447fd4b0fc69d4c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 30 14:42:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 14:42:13 +0000 Subject: libosmocore[master]: RSL: Add support for RSL_CHAN_OSMO_PDCH to rsl_dec_chan_nr() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icc772285636c06e1075a89809f0ac379d7a0002c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 14:42:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 14:42:23 +0000 Subject: [MERGED] libosmocore[master]: RSL: Add support for RSL_CHAN_OSMO_PDCH to rsl_dec_chan_nr() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RSL: Add support for RSL_CHAN_OSMO_PDCH to rsl_dec_chan_nr() ...................................................................... RSL: Add support for RSL_CHAN_OSMO_PDCH to rsl_dec_chan_nr() Change-Id: Icc772285636c06e1075a89809f0ac379d7a0002c --- M src/gsm/rsl.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index 83097fd..2a2af1f 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -202,6 +202,9 @@ } else if ((chan_nr & 0xf8) == RSL_CHAN_PCH_AGCH) { *type = RSL_CHAN_PCH_AGCH; *subch = 0; + } else if ((chan_nr & 0xf8) == RSL_CHAN_OSMO_PDCH) { + *type = RSL_CHAN_OSMO_PDCH; + *subch = 0; } else return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icc772285636c06e1075a89809f0ac379d7a0002c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 30 14:43:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 14:43:22 +0000 Subject: osmo-bts[master]: VIRT-BTS: Enable uplink support for GPRS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 let's merge this in the overall patch for full (UL and DL) GPRS support -- To view, visit https://gerrit.osmocom.org/3371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 14:56:00 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 30 Jul 2017 14:56:00 +0000 Subject: libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Patch Set 3: 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: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:21:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:21:29 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-BTS: Support for GPRS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3371 to look at the new patch set (#2). VIRT-BTS: Support for GPRS Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc --- M src/osmo-bts-virtual/bts_model.c M src/osmo-bts-virtual/l1_if.c M src/osmo-bts-virtual/main.c 3 files changed, 7 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/71/3371/2 diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c index 424e27c..264bf4f 100644 --- a/src/osmo-bts-virtual/bts_model.c +++ b/src/osmo-bts-virtual/bts_model.c @@ -137,13 +137,12 @@ case NM_OC_SITE_MANAGER: case NM_OC_BASEB_TRANSC: case NM_OC_BTS: - oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); - rc = oml_mo_opstart_ack(mo); - break; - /* TODO: gprs support */ case NM_OC_GPRS_NSE: case NM_OC_GPRS_CELL: case NM_OC_GPRS_NSVC: + oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); + rc = oml_mo_opstart_ack(mo); + break; default: rc = oml_mo_opstart_nack(mo, NM_NACK_OBJCLASS_NOTSUPP); } diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index bdbf2a7..cb6d483 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -133,6 +133,9 @@ #endif case GSMTAP_CHANNEL_SDCCH4: case GSMTAP_CHANNEL_SDCCH8: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_DATA, PRIM_OP_INDICATION, msg); l1sap.u.data.chan_nr = chan_nr; @@ -142,7 +145,7 @@ l1sap.u.data.ber10k = 0; /* Bit Error Rate in 0.01%. Best -> 0 */ l1sap.u.data.ta_offs_qbits = 0; /* Burst time of arrival in quarter bits. Probably used for Timing Advance calc. Best -> 0 */ l1sap.u.data.lqual_cb = 10 * signal_dbm; /* Link quality in centiBel = 10 * dB. */ - l1sap.u.data.pdch_presence_info = PRES_INFO_UNKNOWN; + l1sap.u.data.pdch_presence_info = PRES_INFO_BOTH; break; case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: @@ -151,9 +154,6 @@ goto nomessage; case GSMTAP_CHANNEL_SDCCH: case GSMTAP_CHANNEL_CCCH: - case GSMTAP_CHANNEL_PACCH: - case GSMTAP_CHANNEL_PDCH: - case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type not supported!\n"); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index bebbe2e..243adea 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -51,7 +51,6 @@ /* dummy, since no direct dsp support */ uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) { - LOGP(DSUM, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } -- To view, visit https://gerrit.osmocom.org/3371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:21:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:21:30 +0000 Subject: [PATCH] osmo-bts[master]: TRX / VIRT-PHY: Make check for BCCH/CCCH more specific Message-ID: Review at https://gerrit.osmocom.org/3391 TRX / VIRT-PHY: Make check for BCCH/CCCH more specific In bts_model_l1sap_down() we want to identify BCCH/CCCH channel numbers, but our check is a bit non-specific. Let's make the check more specific to only cover the BCCH, Uplink CCCH and Downlink CCCH C-bits as defined n 3GPP TS 08.58 Section 9.3.1 Change-Id: Ia20ab09b96c87c0dfbfaf98e5b2a8d36423fac67 --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-virtual/l1_if.c 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/3391/1 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 37a399f..f69e587 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -555,7 +555,7 @@ chan_nr = l1sap->u.info.u.act_req.chan_nr; lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { - if ((chan_nr & 0x80)) { + if ((chan_nr & 0xE0) == 0x80) { LOGP(DL1C, LOGL_ERROR, "Cannot activate" " chan_nr 0x%02x\n", chan_nr); break; @@ -605,7 +605,7 @@ break; } /* here, type == PRIM_INFO_DEACTIVATE */ - if ((chan_nr & 0x80)) { + if ((chan_nr & 0xE0) == 0x80) { LOGP(DL1C, LOGL_ERROR, "Cannot deactivate " "chan_nr 0x%02x\n", chan_nr); break; diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 4fe1ec8..bdbf2a7 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -370,7 +370,7 @@ /* we receive a channel activation request from the BSC, * e.g. as a response to a channel req on RACH */ if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { - if ((chan_nr & 0x80)) { + if ((chan_nr & 0xE0) == 0x80) { LOGP(DL1C, LOGL_ERROR, "Cannot activate" " chan_nr 0x%02x\n", chan_nr); break; @@ -419,7 +419,7 @@ 0); break; } - if ((chan_nr & 0x80)) { + if ((chan_nr & 0xE0) == 0x80) { LOGP(DL1C, LOGL_ERROR, "Cannot deactivate " "chan_nr 0x%02x\n", chan_nr); break; -- To view, visit https://gerrit.osmocom.org/3391 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia20ab09b96c87c0dfbfaf98e5b2a8d36423fac67 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:21:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:21:30 +0000 Subject: [PATCH] osmo-bts[master]: L1SAP: Print chan_nr and link_id always as hex Message-ID: Review at https://gerrit.osmocom.org/3392 L1SAP: Print chan_nr and link_id always as hex The RSL Channel ID is best read / interpreted as hex value, not as decimal, primarily due to the fact that it is a bit-mask of various fields. Change-Id: I9b72a67407870b485e7f7e8a72fa1ad30fc8ed4d --- M src/common/l1sap.c 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/3392/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index b6fcad3..7c69561 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -656,7 +656,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=%d link_id=%d\n", + DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=0x%02x link_id=0x%02xd\n", osmo_dump_gsmtime(&g_time), chan_nr, link_id); /* reuse PH-RTS.ind for PH-DATA.req */ @@ -750,7 +750,7 @@ memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } - DEBUGP(DL1P, "Tx PH-DATA.req %02u/%02u/%02u chan_nr=%d link_id=%d\n", + DEBUGP(DL1P, "Tx PH-DATA.req %02u/%02u/%02u chan_nr=%02x link_id=0x%02x\n", g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); l1sap_down(trx, l1sap); @@ -798,7 +798,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); + DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) @@ -851,7 +851,7 @@ resp_l1sap->u.tch.fn = fn; resp_l1sap->u.tch.marker = marker; - DEBUGP(DL1P, "Tx TCH.req %02u/%02u/%02u chan_nr=%d\n", + DEBUGP(DL1P, "Tx TCH.req %02u/%02u/%02u chan_nr=0x%02x\n", g_time.t1, g_time.t2, g_time.t3, chan_nr); l1sap_down(trx, resp_l1sap); @@ -954,13 +954,13 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-DATA.ind %s chan_nr=%d link_id=%d\n", - osmo_dump_gsmtime(&g_time), chan_nr, link_id); + DEBUGP(DL1P, "Rx PH-DATA.ind %s chan_nr=0x%02x link_id=0x%02x len=%d\n", + osmo_dump_gsmtime(&g_time), chan_nr, link_id, len); if (ts_is_pdch(&trx->ts[tn])) { lchan = get_lchan_by_chan_nr(trx, chan_nr); if (!lchan) - LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); + LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=0x%02x\n", chan_nr); if (lchan && lchan->loopback && !L1SAP_IS_PTCCH(fn)) { /* we are in loopback mode (for BER testing) * mode and need to enqeue the frame to be @@ -1059,7 +1059,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); + DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) -- To view, visit https://gerrit.osmocom.org/3392 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b72a67407870b485e7f7e8a72fa1ad30fc8ed4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:21:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:21:30 +0000 Subject: [PATCH] osmo-bts[master]: L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP Message-ID: Review at https://gerrit.osmocom.org/3393 L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP So far, L1SAP code is hiding RSL_CHAN_OSMO_PDCH from the bts specific code below L1SAP. This is some kind of a hack/workaround, making code and debug output / logs more difficult to understand. So let's teach the lower layer how to treat RSL_CHAN_OSMO_PDCH and remove the "hiding" code from the common l1sap.c code. Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19 --- M include/osmo-bts/l1sap.h M src/common/l1sap.c M src/common/scheduler.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-sysmo/l1_if.c 6 files changed, 12 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/93/3393/1 diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 4e9c9e2..ad13145 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -22,6 +22,7 @@ #define L1SAP_IS_CHAN_BCCH(chan_nr) ((chan_nr & 0xf8) == 0x80) #define L1SAP_IS_CHAN_RACH(chan_nr) ((chan_nr & 0xf8) == 0x88) #define L1SAP_IS_CHAN_AGCH_PCH(chan_nr) ((chan_nr & 0xf8) == 0x90) +#define L1SAP_IS_CHAN_PDCH(chan_nr) ((chan_nr & 0xf8) == 0xc0) /* rach type from ra */ #define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f) diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 7c69561..4bf24a5 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -263,6 +263,8 @@ *chan_type = GSMTAP_CHANNEL_PCH; else *chan_type = GSMTAP_CHANNEL_AGCH; + } else if (L1SAP_IS_CHAN_PDCH(chan_nr)) { + *chan_type = GSMTAP_CHANNEL_PDTCH; } if (L1SAP_IS_LINK_SACCH(link_id)) *chan_type |= GSMTAP_CHANNEL_ACCH; @@ -1218,7 +1220,7 @@ l1sap = msgb_l1sap_prim(msg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_PH_DATA, PRIM_OP_REQUEST, msg); - l1sap->u.data.chan_nr = 0x08 | ts->nr; + l1sap->u.data.chan_nr = RSL_CHAN_OSMO_PDCH | ts->nr; l1sap->u.data.link_id = 0x00; l1sap->u.data.fn = fn; msg->l2h = msgb_put(msg, len); @@ -1264,11 +1266,6 @@ enum osmo_mph_info_type type, uint8_t sacch_only) { struct osmo_phsap_prim l1sap; - - /* The caller may pass a non-standard RSL_CHAN_OSMO_PDCH, which the L1 - * doesn't understand. Use the normal TCH/F cbits instead. */ - if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) - chan_nr = RSL_CHAN_Bm_ACCHs | (chan_nr & ~RSL_CHAN_NR_MASK); memset(&l1sap, 0, sizeof(l1sap)); osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_REQUEST, diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 08603d2..f6cb07e 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -152,8 +152,8 @@ { 0, TRXC_SACCH8_5, 0x68, LID_SACCH, "SACCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, { 0, TRXC_SACCH8_6, 0x70, LID_SACCH, "SACCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, { 0, TRXC_SACCH8_7, 0x78, LID_SACCH, "SACCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 1, TRXC_PDTCH, 0x08, LID_DEDIC, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 }, - { 1, TRXC_PTCCH, 0x08, LID_DEDIC, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 1, TRXC_PDTCH, 0xc0, LID_DEDIC, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 }, + { 1, TRXC_PTCCH, 0xc0, LID_DEDIC, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, }; const struct value_string trx_chan_type_names[] = { diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index cb3efab..c568353 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -358,9 +358,9 @@ lchan = get_lchan_by_chan_nr(trx, chan_nr); if (L1SAP_IS_LINK_SACCH(link_id)) { sapi = GsmL1_Sapi_Sacch; - if (!L1SAP_IS_CHAN_TCHF(chan_nr)) + if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr)) subCh = l1sap_chan2ss(chan_nr); - } else if (L1SAP_IS_CHAN_TCHF(chan_nr)) { + } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) { if (ts_is_pdch(&trx->ts[u8Tn])) { if (L1SAP_IS_PTCCH(u32Fn)) { sapi = GsmL1_Sapi_Ptcch; diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 20a84f8..cb792d7 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -473,9 +473,9 @@ subCh = 0xf1; if (L1SAP_IS_LINK_SACCH(link_id)) { sapi = cOCTVC1_GSM_SAPI_ENUM_SACCH; - if (!L1SAP_IS_CHAN_TCHF(chan_nr)) + if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr)) subCh = l1sap_chan2ss(chan_nr); - } else if (L1SAP_IS_CHAN_TCHF(chan_nr)) { + } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) { if (trx->ts[u8Tn].pchan == GSM_PCHAN_PDCH) { if (L1SAP_IS_PTCCH(u32Fn)) { sapi = cOCTVC1_GSM_SAPI_ENUM_PTCCH; diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index a4bfffb..b4a63d6 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -354,9 +354,9 @@ lchan = get_lchan_by_chan_nr(trx, chan_nr); if (L1SAP_IS_LINK_SACCH(link_id)) { sapi = GsmL1_Sapi_Sacch; - if (!L1SAP_IS_CHAN_TCHF(chan_nr)) + if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr)) subCh = l1sap_chan2ss(chan_nr); - } else if (L1SAP_IS_CHAN_TCHF(chan_nr)) { + } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) { if (ts_is_pdch(&trx->ts[u8Tn])) { if (L1SAP_IS_PTCCH(u32Fn)) { sapi = GsmL1_Sapi_Ptcch; -- To view, visit https://gerrit.osmocom.org/3393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:37:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:37:13 +0000 Subject: osmo-bts[master]: TRX / VIRT-PHY: Make check for BCCH/CCCH more specific In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3391 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia20ab09b96c87c0dfbfaf98e5b2a8d36423fac67 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:37:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:37:17 +0000 Subject: osmo-bts[master]: L1SAP: Print chan_nr and link_id always as hex In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3392 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b72a67407870b485e7f7e8a72fa1ad30fc8ed4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:37:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:37:23 +0000 Subject: osmo-bts[master]: L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:37:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:37:27 +0000 Subject: osmo-bts[master]: VIRT-BTS: Support for GPRS In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:38:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:38:43 +0000 Subject: [PATCH] osmo-bts[master]: VIRT-PHY: Print NOTICE log message from unimplemented stubs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3370 to look at the new patch set (#3). VIRT-PHY: Print NOTICE log message from unimplemented stubs There are plenty of functions stubbed out in osmo-bts-virtual, let's print a NOTICE level log message to be able to correlate any kind of erroneous behavior with the fact that a given function has no actual implementation. Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa --- M src/osmo-bts-virtual/bts_model.c M src/osmo-bts-virtual/main.c 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/70/3370/3 diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c index 5293cc3..c82f1aa 100644 --- a/src/osmo-bts-virtual/bts_model.c +++ b/src/osmo-bts-virtual/bts_model.c @@ -38,6 +38,7 @@ /* TODO: check if dummy method is sufficient, else implement */ int bts_model_lchan_deactivate(struct gsm_lchan *lchan) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return -1; } @@ -45,16 +46,19 @@ int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr, int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return -1; } int bts_model_trx_close(struct gsm_bts_trx *trx) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } @@ -86,6 +90,7 @@ static uint8_t vbts_set_trx(struct gsm_bts_trx *trx) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } @@ -154,16 +159,19 @@ int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } int bts_model_ctrl_cmds_install(struct gsm_bts *bts) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index f1dc293..937046b 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -51,6 +51,7 @@ /* dummy, since no direct dsp support */ uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } @@ -68,6 +69,7 @@ void bts_model_print_help() { + LOGP(DSUM, LOGL_NOTICE, "Unimplemented %s\n", __func__); } int bts_model_handle_options(int argc, char **argv) @@ -112,15 +114,18 @@ void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemented %s\n", __func__); } int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemented %s\n", __func__); return -ENOTSUP; } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemented %s\n", __func__); return -ENOTSUP; } -- To view, visit https://gerrit.osmocom.org/3370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 30 15:38:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 15:38:59 +0000 Subject: osmo-bts[master]: VIRT-PHY: Print NOTICE log message from unimplemented stubs In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jul 30 16:16:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 16:16:41 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-PHY: Print NOTICE log message from unimplemented stubs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Print NOTICE log message from unimplemented stubs ...................................................................... VIRT-PHY: Print NOTICE log message from unimplemented stubs There are plenty of functions stubbed out in osmo-bts-virtual, let's print a NOTICE level log message to be able to correlate any kind of erroneous behavior with the fact that a given function has no actual implementation. Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa --- M src/osmo-bts-virtual/bts_model.c M src/osmo-bts-virtual/main.c 2 files changed, 13 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c index 5293cc3..c82f1aa 100644 --- a/src/osmo-bts-virtual/bts_model.c +++ b/src/osmo-bts-virtual/bts_model.c @@ -38,6 +38,7 @@ /* TODO: check if dummy method is sufficient, else implement */ int bts_model_lchan_deactivate(struct gsm_lchan *lchan) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return -1; } @@ -45,16 +46,19 @@ int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr, int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return -1; } int bts_model_trx_close(struct gsm_bts_trx *trx) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } @@ -86,6 +90,7 @@ static uint8_t vbts_set_trx(struct gsm_bts_trx *trx) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } @@ -154,16 +159,19 @@ int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } int bts_model_ctrl_cmds_install(struct gsm_bts *bts) { + LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__); return 0; } diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index f1dc293..937046b 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -51,6 +51,7 @@ /* dummy, since no direct dsp support */ uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } @@ -68,6 +69,7 @@ void bts_model_print_help() { + LOGP(DSUM, LOGL_NOTICE, "Unimplemented %s\n", __func__); } int bts_model_handle_options(int argc, char **argv) @@ -112,15 +114,18 @@ void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemented %s\n", __func__); } int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemented %s\n", __func__); return -ENOTSUP; } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { + LOGP(DSUM, LOGL_NOTICE, "Unimplemented %s\n", __func__); return -ENOTSUP; } -- To view, visit https://gerrit.osmocom.org/3370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 30 16:46:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 16:46:38 +0000 Subject: [MERGED] osmo-bts[master]: TRX / VIRT-PHY: Make check for BCCH/CCCH more specific In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX / VIRT-PHY: Make check for BCCH/CCCH more specific ...................................................................... TRX / VIRT-PHY: Make check for BCCH/CCCH more specific In bts_model_l1sap_down() we want to identify BCCH/CCCH channel numbers, but our check is a bit non-specific. Let's make the check more specific to only cover the BCCH, Uplink CCCH and Downlink CCCH C-bits as defined n 3GPP TS 08.58 Section 9.3.1 Change-Id: Ia20ab09b96c87c0dfbfaf98e5b2a8d36423fac67 --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-virtual/l1_if.c 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 37a399f..f69e587 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -555,7 +555,7 @@ chan_nr = l1sap->u.info.u.act_req.chan_nr; lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { - if ((chan_nr & 0x80)) { + if ((chan_nr & 0xE0) == 0x80) { LOGP(DL1C, LOGL_ERROR, "Cannot activate" " chan_nr 0x%02x\n", chan_nr); break; @@ -605,7 +605,7 @@ break; } /* here, type == PRIM_INFO_DEACTIVATE */ - if ((chan_nr & 0x80)) { + if ((chan_nr & 0xE0) == 0x80) { LOGP(DL1C, LOGL_ERROR, "Cannot deactivate " "chan_nr 0x%02x\n", chan_nr); break; diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 4fe1ec8..bdbf2a7 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -370,7 +370,7 @@ /* we receive a channel activation request from the BSC, * e.g. as a response to a channel req on RACH */ if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { - if ((chan_nr & 0x80)) { + if ((chan_nr & 0xE0) == 0x80) { LOGP(DL1C, LOGL_ERROR, "Cannot activate" " chan_nr 0x%02x\n", chan_nr); break; @@ -419,7 +419,7 @@ 0); break; } - if ((chan_nr & 0x80)) { + if ((chan_nr & 0xE0) == 0x80) { LOGP(DL1C, LOGL_ERROR, "Cannot deactivate " "chan_nr 0x%02x\n", chan_nr); break; -- To view, visit https://gerrit.osmocom.org/3391 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia20ab09b96c87c0dfbfaf98e5b2a8d36423fac67 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 30 16:46:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 16:46:39 +0000 Subject: [MERGED] osmo-bts[master]: L1SAP: Print chan_nr and link_id always as hex In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: L1SAP: Print chan_nr and link_id always as hex ...................................................................... L1SAP: Print chan_nr and link_id always as hex The RSL Channel ID is best read / interpreted as hex value, not as decimal, primarily due to the fact that it is a bit-mask of various fields. Change-Id: I9b72a67407870b485e7f7e8a72fa1ad30fc8ed4d --- M src/common/l1sap.c 1 file changed, 8 insertions(+), 8 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 b6fcad3..7c69561 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -656,7 +656,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=%d link_id=%d\n", + DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=0x%02x link_id=0x%02xd\n", osmo_dump_gsmtime(&g_time), chan_nr, link_id); /* reuse PH-RTS.ind for PH-DATA.req */ @@ -750,7 +750,7 @@ memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } - DEBUGP(DL1P, "Tx PH-DATA.req %02u/%02u/%02u chan_nr=%d link_id=%d\n", + DEBUGP(DL1P, "Tx PH-DATA.req %02u/%02u/%02u chan_nr=%02x link_id=0x%02x\n", g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); l1sap_down(trx, l1sap); @@ -798,7 +798,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); + DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) @@ -851,7 +851,7 @@ resp_l1sap->u.tch.fn = fn; resp_l1sap->u.tch.marker = marker; - DEBUGP(DL1P, "Tx TCH.req %02u/%02u/%02u chan_nr=%d\n", + DEBUGP(DL1P, "Tx TCH.req %02u/%02u/%02u chan_nr=0x%02x\n", g_time.t1, g_time.t2, g_time.t3, chan_nr); l1sap_down(trx, resp_l1sap); @@ -954,13 +954,13 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-DATA.ind %s chan_nr=%d link_id=%d\n", - osmo_dump_gsmtime(&g_time), chan_nr, link_id); + DEBUGP(DL1P, "Rx PH-DATA.ind %s chan_nr=0x%02x link_id=0x%02x len=%d\n", + osmo_dump_gsmtime(&g_time), chan_nr, link_id, len); if (ts_is_pdch(&trx->ts[tn])) { lchan = get_lchan_by_chan_nr(trx, chan_nr); if (!lchan) - LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); + LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=0x%02x\n", chan_nr); if (lchan && lchan->loopback && !L1SAP_IS_PTCCH(fn)) { /* we are in loopback mode (for BER testing) * mode and need to enqeue the frame to be @@ -1059,7 +1059,7 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=%d\n", osmo_dump_gsmtime(&g_time), chan_nr); + DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) -- To view, visit https://gerrit.osmocom.org/3392 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b72a67407870b485e7f7e8a72fa1ad30fc8ed4d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jul 30 16:47:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 30 Jul 2017 16:47:13 +0000 Subject: osmo-bts[master]: L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP In-Reply-To: References: Message-ID: Patch Set 2: this needs testing with osmo-bts-{sysmo,octphy,lc15}. -- To view, visit https://gerrit.osmocom.org/3393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From admin at opensuse.org Sun Jul 30 19:54:19 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 30 Jul 2017 19:54:19 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <597e3973e67e9_49e1850f84615812@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 249s] | [ 249s] | This file was extended by libosmocore config.status 0.9.6.20170730, which was [ 249s] | generated by GNU Autoconf 2.69. Invocation command line was [ 249s] | [ 249s] | CONFIG_FILES = [ 249s] | CONFIG_HEADERS = [ 249s] | CONFIG_LINKS = [ 249s] | CONFIG_COMMANDS = [ 249s] | $ ./config.status Doxyfile.core [ 249s] | [ 249s] | on build34 [ 249s] | [ 249s] | config.status:1171: creating Doxyfile.core [ 249s] [ 249s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 249s] make[1]: *** [override_dh_auto_test] Error 1 [ 249s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 249s] debian/rules:15: recipe for target 'build' failed [ 249s] make: *** [build] Error 2 [ 249s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 249s] [ 249s] build34 failed "build libosmocore_0.9.6.20170730.dsc" at Sun Jul 30 19:54:05 UTC 2017. [ 249s] [ 249s] ### VM INTERACTION START ### [ 253s] [ 238.906811] reboot: Power down [ 254s] ### VM INTERACTION END ### [ 254s] [ 254s] build34 failed "build libosmocore_0.9.6.20170730.dsc" at Sun Jul 30 19:54:10 UTC 2017. [ 254s] -- 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 Jul 31 09:36:19 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 31 Jul 2017 09:36:19 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: derive local address from given sccp instance 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/3330 to look at the new patch set (#3). sccp: derive local address from given sccp instance The most important parts of an SCCP address are the routing indicator and the pointcode. The latter one is always available via the SS7 instance, so a basic local address can be derived from there. Add function osmo_sccp_local_addr_by_instance() to derive a basic local SCCP address from a given SCCP instance Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 26 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/30/3330/3 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 24d64d9..732df2a 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -253,3 +253,7 @@ const char *name); const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr); + +void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, + const struct osmo_sccp_instance *inst, + uint32_t ssn); diff --git a/src/sccp_user.c b/src/sccp_user.c index c9443a2..acd5ee1 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -22,6 +22,7 @@ */ #include +#include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include "sccp_internal.h" #include "xua_internal.h" @@ -231,6 +233,26 @@ talloc_free(inst); } +/*! \brief derive a basic local SCCP-Address from a given SCCP instance. + * \param[out] dest_addr pointer to output address memory + * \param[in] inst SCCP instance + * \param[in] ssn Subsystem Number */ +void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, + const struct osmo_sccp_instance *inst, + uint32_t ssn) +{ + struct osmo_ss7_instance *ss7; + + OSMO_ASSERT(dest_addr); + OSMO_ASSERT(inst); + ss7 = inst->ss7; + OSMO_ASSERT(ss7); + + *dest_addr = (struct osmo_sccp_addr){}; + + osmo_sccp_make_addr_pc_ssn(dest_addr, ss7->cfg.primary_pc, ssn); +} + /*********************************************************************** * Convenience function for CLIENT ***********************************************************************/ -- To view, visit https://gerrit.osmocom.org/3330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 31 09:58:09 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 31 Jul 2017 09:58:09 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: fix possible nullpointer deref 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/3354 to look at the new patch set (#3). sccp: fix possible nullpointer deref check input parameters local_ip and remote_ip of the function osmo_sccp_simple_client_on_ss7_id() before using them with talloc_strdup() Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 --- M src/sccp_user.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/54/3354/3 diff --git a/src/sccp_user.c b/src/sccp_user.c index c9443a2..89a0320 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -331,8 +331,10 @@ goto out_rt; asp_created = true; - asp->cfg.local.host = talloc_strdup(asp, local_ip); - asp->cfg.remote.host = talloc_strdup(asp, remote_ip); + local_ip ? asp->cfg.local.host = + talloc_strdup(asp, local_ip) : NULL; + remote_ip ? asp->cfg.remote.host = + talloc_strdup(asp, remote_ip) : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 31 11:20:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 31 Jul 2017 11:20:59 +0000 Subject: [PATCH] osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3187 to look at the new patch set (#4). move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client To help split openbsc.git to separate MSC and SGSN repositories, place the common Iu interface related code here in libosmo-ranap. Also apply various improvements while moving (from intermittent code review). The code depends on libosmo-ranap tightly. One reason to want this separate from libosmo-ranap could be that it uses libosmo-sigtran, accepting an sccp instance. However, including in libosmo-ranap is the simplest way to go. The osmo-iuh build depends on libosmo-sigtran anyway because of OsmoHNBGW, and all current users of libosmo-ranap also naturally link libosmo-sigtran already. Apply prefix ranap_iu_ and RANAP_IU_ to allow smooth transition from the openbsc.git iu_ to the libranap ranap_iu_ implementations. Prune unneeded #include statements. Instead of sccp_addr, store an rnc pointer in the ue_conn_ctx. To facilitate, also: - Move iu_rnc struct to iu_client.h (as ranap_iu_rnc). - Instead of sccp_addr, pass rnc to ue_conn_ctx_alloc(). - Pass a local struct new_ue_conn_ctx containing the sccp_addr and conn_id up the RANAP handling stack in case of an InitialUE message. - Separate the InitialUE message handling from cn_ranap_handle_co(), by moving to new and separate cn_ranap_handle_co_initial(), so we can still pass a looked-up ue_conn_ctx to all other cn_ranap_handle_co() code paths. - Allocate the ue_conn_ctx only in ranap_handle_co_initial_ue(), not as early as before. Note that we are not actually ever using the rnc pointer now present in ue_conn_ctx. It could be used for more concise paging, to first page only the RNC where we last saw the subscriber. So far we page all matching LAC/RACs. Tweak error logging: use __func__ instead of writing the function names as string constants. In iu_client_vty.c: - Move the asn.1 debug commands from logging over to the iu node. They are not specific to the logging target. They could qualify for an entirely separate 'asn1' root node, but for simplicity place under 'iu'. - Add the 'asn1' commands to ranap_iu_vty_config_write(), so far missing. - remove the legacy "net." from a VTY error message, it is not known which name the parent node of 'iu' has. Depends: libosmo-sccp I85b46269dbe7909e52873ace3f720f6292a4516c, libosmo-sccp Ie1aedd7894acd69ddc887cd65a8a0df4b888838c Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 --- M include/osmocom/ranap/Makefile.am A include/osmocom/ranap/iu_client.h M src/Makefile.am A src/iu_client.c A src/iu_client_vty.c 5 files changed, 999 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/87/3187/4 diff --git a/include/osmocom/ranap/Makefile.am b/include/osmocom/ranap/Makefile.am index 0f83e03..1606928 100644 --- a/include/osmocom/ranap/Makefile.am +++ b/include/osmocom/ranap/Makefile.am @@ -12,6 +12,7 @@ ranap_common_cn.h \ ranap_msg_factory.h \ iu_helpers.h \ + iu_client.h \ RANAP_AccuracyFulfilmentIndicator.h \ RANAP_AllocationOrRetentionPriority.h \ RANAP_AlternativeRABConfigurationRequest.h \ diff --git a/include/osmocom/ranap/iu_client.h b/include/osmocom/ranap/iu_client.h new file mode 100644 index 0000000..873b2d2 --- /dev/null +++ b/include/osmocom/ranap/iu_client.h @@ -0,0 +1,74 @@ +#pragma once + +#include + +#include +#include +#include + +struct msgb; +struct osmo_auth_vector; + +struct RANAP_RAB_SetupOrModifiedItemIEs_s; +struct RANAP_Cause; + +struct ranap_iu_rnc; + +/* Debugging switches from asn1c and osmo-iuh */ +extern int asn_debug; +extern int asn1_xer_print; + +enum ranap_nsap_addr_enc { + RANAP_NSAP_ADDR_ENC_X213, + RANAP_NSAP_ADDR_ENC_V4RAW, +}; + +struct ranap_ue_conn_ctx { + struct llist_head list; + struct ranap_iu_rnc *rnc; + uint32_t conn_id; + int integrity_active; + struct gprs_ra_id ra_id; + enum ranap_nsap_addr_enc rab_assign_addr_enc; +}; + +enum ranap_iu_event_type { + RANAP_IU_EVENT_RAB_ASSIGN, + RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, + RANAP_IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ + RANAP_IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ +}; + +extern const struct value_string ranap_iu_event_type_names[]; +static inline const char *ranap_iu_event_type_str(enum ranap_iu_event_type e) +{ + return get_value_string(ranap_iu_event_type_names, e); +} + +/* Implementations of iu_recv_cb_t shall find the ranap_ue_conn_ctx in msg->dst. */ +typedef int (* ranap_iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, + uint16_t *sai); + +typedef int (* ranap_iu_event_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, + enum ranap_iu_event_type type, void *data); + +typedef int (* ranap_iu_rab_ass_resp_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id, + struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb); + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc); +int ranap_iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/src/Makefile.am b/src/Makefile.am index bb1ebbd..48918b0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,7 +54,7 @@ libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \ - ranap_common_cn.c + ranap_common_cn.c iu_client.c iu_client_vty.c # build the actual HomeNodeB gateway # diff --git a/src/iu_client.c b/src/iu_client.c new file mode 100644 index 0000000..83ed276 --- /dev/null +++ b/src/iu_client.c @@ -0,0 +1,783 @@ +/* Common parts of IuCS and IuPS interfaces implementation */ + +/* (C) 2016-2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the + * PLMN identity is a BCD representation of the MCC and MNC. + * See iu_grnc_id_parse(). */ +struct iu_grnc_id { + uint16_t mcc; + uint16_t mnc; + uint16_t rnc_id; +}; + +/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has + * called us and is currently reachable at the given osmo_sccp_addr. So, when we + * know a LAC for a subscriber, we can page it at the RNC matching that LAC or + * RAC. An HNB-GW typically presents itself as if it were a single RNC, even + * though it may have several RNCs in hNodeBs connected to it. Those will then + * share the same RNC id, which they actually receive and adopt from the HNB-GW + * in the HNBAP HNB REGISTER ACCEPT message. */ +struct ranap_iu_rnc { + struct llist_head entry; + + uint16_t rnc_id; + uint16_t lac; /* Location Area Code (used for CS and PS) */ + uint8_t rac; /* Routing Area Code (used for PS only) */ + struct osmo_sccp_addr sccp_addr; +}; + +void *talloc_iu_ctx; +void *talloc_asn1_ctx; + +/* Implement the extern asn_debug from libasn1c to indicate whether to print + * asn.1 debug messages (see libasn1c). */ +int asn_debug = 0; + +/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary + * code decoded and encoded during Iu communication should be logged to stderr + * (see asn.1 generated code in osmo-iuh). */ +int asn1_xer_print = 0; + +ranap_iu_recv_cb_t global_iu_recv_cb = NULL; +ranap_iu_event_cb_t global_iu_event_cb = NULL; +int iu_log_subsystem = 0; + +#define LOGPIU(level, fmt, args...) \ + LOGP(iu_log_subsystem, level, fmt, ## args) + +static LLIST_HEAD(ue_conn_ctx_list); +static LLIST_HEAD(rnc_list); + +static struct osmo_sccp_instance *g_sccp; +static struct osmo_sccp_user *g_scu; + +const struct value_string ranap_iu_event_type_names[] = { + OSMO_VALUE_STRING(RANAP_IU_EVENT_RAB_ASSIGN), + OSMO_VALUE_STRING(RANAP_IU_EVENT_SECURITY_MODE_COMPLETE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_IU_RELEASE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_LINK_INVALIDATED), + { 0, NULL } +}; + +static struct ranap_ue_conn_ctx *ue_conn_ctx_alloc(struct ranap_iu_rnc *rnc, uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ranap_ue_conn_ctx); + + ctx->rnc = rnc; + ctx->conn_id = conn_id; + llist_add(&ctx->list, &ue_conn_ctx_list); + + return ctx; +} + +static struct ranap_ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx; + + llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { + if (ctx->conn_id == conn_id) + return ctx; + } + return NULL; +} + +static struct ranap_iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, + struct osmo_sccp_addr *addr) +{ + struct ranap_iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct ranap_iu_rnc); + + rnc->rnc_id = rnc_id; + rnc->lac = lac; + rnc->rac = rac; + rnc->sccp_addr = *addr; + llist_add(&rnc->entry, &rnc_list); + + LOGPIU(LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + + return rnc; +} + +static struct ranap_iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, + uint8_t rac, struct osmo_sccp_addr *addr) +{ + struct ranap_iu_rnc *rnc; + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->rnc_id != rnc_id) + continue; + + /* We have this RNC Id registered already. Make sure that the + * details match. */ + + /* TODO should a mismatch be an error? */ + if (rnc->lac != lac || rnc->rac != rac) + LOGPIU(LOGL_NOTICE, "RNC %d changes its details:" + " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", + rnc->rnc_id, rnc->lac, rnc->rac, + lac, rac); + rnc->lac = lac; + rnc->rac = rac; + + if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) + LOGPIU(LOGL_NOTICE, "RNC %d on New SCCP Addr %s" + " (LAC=%d RAC=%d)\n", + rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); + rnc->sccp_addr = *addr; + return rnc; + } + + /* Not found, make a new one. */ + return iu_rnc_alloc(rnc_id, lac, rac, addr); +} + +/*********************************************************************** + * RANAP handling + ***********************************************************************/ + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) +{ + struct osmo_scu_prim *prim; + + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ue_ctx->conn_id; + osmo_prim_init(&prim->oph, + SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, + msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id) +{ + /* FIXME */ + return -1; +} + +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key) +{ + struct osmo_scu_prim *prim; + struct msgb *msg; + + /* create RANAP message */ + msg = ranap_new_msg_sec_mod_cmd(vec->ik, send_ck? vec->ck : NULL, + new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg->l2h = msg->data; + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + + return 0; +} + +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_common_id(imsi); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +static int iu_grnc_id_parse(struct iu_grnc_id *dst, struct RANAP_GlobalRNC_ID *src) +{ + /* The size is coming from arbitrary sender, check it gracefully */ + if (src->pLMNidentity.size != 3) { + LOGPIU(LOGL_ERROR, "Invalid PLMN Identity size:" + " should be 3, is %d\n", src->pLMNidentity.size); + return -1; + } + gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], + &dst->mcc, &dst->mnc); + dst->rnc_id = (uint16_t)src->rNC_ID; + return 0; +} + +#if 0 + -- not used at present -- +static int iu_grnc_id_compose(struct iu_grnc_id *src, struct RANAP_GlobalRNC_ID *dst) +{ + /* The caller must ensure proper size */ + OSMO_ASSERT(dst->pLMNidentity.size == 3); + gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], + src->mcc, src->mnc); + dst->rNC_ID = src->rnc_id; + return 0; +} +#endif + +struct new_ue_conn_ctx { + struct osmo_sccp_addr sccp_addr; + uint32_t conn_id; +}; + +static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) +{ + struct new_ue_conn_ctx *new_ctx = ctx; + struct gprs_ra_id ra_id; + struct iu_grnc_id grnc_id; + uint16_t sai; + struct ranap_ue_conn_ctx *ue; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + struct ranap_iu_rnc *rnc; + + if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + + if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { + ra_id.rac = asn1str_to_u8(&ies->rac); + } + + if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { + LOGPIU(LOGL_ERROR, + "Failed to parse RANAP Global-RNC-ID IE\n"); + return -1; + } + + sai = asn1str_to_u16(&ies->sai.sAC); + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ + rnc = iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &new_ctx->sccp_addr); + + ue = ue_conn_ctx_alloc(rnc, new_ctx->conn_id); + OSMO_ASSERT(ue); + ue->ra_id = ra_id; + + /* Feed into the MM layer */ + msg->dst = ue; + global_iu_recv_cb(msg, &ra_id, &sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) +{ + struct gprs_ra_id _ra_id, *ra_id = NULL; + uint16_t _sai, *sai = NULL; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { + if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + ra_id = &_ra_id; + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { + _ra_id.rac = asn1str_to_u8(&ies->rac); + } + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { + _sai = asn1str_to_u16(&ies->sai.sAC); + sai = &_sai; + } + } + + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Feed into the MM/CC/SMS-CP layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, ra_id, sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +int ranap_iu_tx(struct msgb *msg_nas, uint8_t sapi) +{ + struct ranap_ue_conn_ctx *uectx = msg_nas->dst; + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); + msgb_free(msg_nas); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +/* Send Iu Release for the given UE connection. + * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise + * the provided cause. */ +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + static const struct RANAP_Cause default_cause = { + .present = RANAP_Cause_PR_radioNetwork, + .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, + }; + + if (!cause) + cause = &default_cause; + + msg = ranap_new_msg_iu_rel_cmd(cause); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ctx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +static int ranap_handle_co_iu_rel_req(struct ranap_ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) +{ + LOGPIU(LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); + ranap_iu_tx_release(ctx, &ies->cause); + return 0; +} + +static int ranap_handle_co_rab_ass_resp(struct ranap_ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) +{ + int rc = -1; + + LOGPIU(LOGL_INFO, + "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); + if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { + /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ + RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; + RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; + + rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); + if (rc) { + LOGPIU(LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); + return rc; + } + + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_RAB_ASSIGN, &setup_ies); + + ranap_free_rab_setupormodifieditemies(&setup_ies); + } + /* FIXME: handle RAB Ass failure? */ + + return rc; +} + +static void cn_ranap_handle_co_initial(void *ctx, ranap_message *message) +{ + int rc; + + LOGPIU(LOGL_NOTICE, "handle_co_initial(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + if (message->direction != RANAP_RANAP_PDU_PR_initiatingMessage + || message->procedureCode != RANAP_ProcedureCode_id_InitialUE_Message) { + LOGPIU(LOGL_ERROR, "Expected direction 'InitiatingMessage'," + " procedureCode 'InitialUE_Message', instead got %u and %u\n", + message->direction, message->procedureCode); + rc = -1; + } + else + rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +/* Entry point for connection-oriented RANAP message */ +static void cn_ranap_handle_co(void *ctx, ranap_message *message) +{ + int rc; + + LOGPIU(LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_InitialUE_Message: + LOGPIU(LOGL_ERROR, "Got InitialUE_Message but this is not a new conn\n"); + rc = -1; + break; + case RANAP_ProcedureCode_id_DirectTransfer: + rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + case RANAP_ProcedureCode_id_Iu_ReleaseRequest: + /* Iu Release Request */ + rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_SecurityModeControl: + /* Security Mode Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, NULL); + break; + case RANAP_ProcedureCode_id_Iu_Release: + /* Iu Release Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_IU_RELEASE, NULL); + if (rc) { + LOGPIU(LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", + rc); + } + break; + default: + LOGPIU(LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_outcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_RAB_Assignment: + /* RAB Assignment Response */ + rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + default: + LOGPIU(LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) +{ + /* FIXME: send reset response */ + return -1; +} + +static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +/* Entry point for connection-less RANAP message */ +static void cn_ranap_handle_cl(void *ctx, ranap_message *message) +{ + int rc; + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_Reset: + /* received reset.req, send reset.resp */ + rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + default: + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + case RANAP_RANAP_PDU_PR_outcome: + default: + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +/*********************************************************************** + * Paging + ***********************************************************************/ + +struct osmo_sccp_addr local_sccp_addr = { + .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, + .ri = OSMO_SCCP_RI_SSN_PC, + .ssn = OSMO_SCCP_SSN_RANAP, + .pc = 1, +}; + +/* Send a paging command down a given SCCP User. tmsi and paging_cause are + * optional and may be passed NULL and 0, respectively, to disable their use. + * See enum RANAP_PagingCause. + * + * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, + * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ +static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, + const char *imsi, const uint32_t *tmsi, + bool is_ps, uint32_t paging_cause) +{ + struct msgb *msg; + msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); + msg->l2h = msg->data; + osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); + return 0; +} + +static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, + uint16_t lac, uint8_t rac, bool is_ps) +{ + struct ranap_iu_rnc *rnc; + int pagings_sent = 0; + + if (tmsi_or_ptimsi) { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use %s %x)\n", + is_ps? "IuPS" : "IuCS", + imsi, + is_ps? "PTMSI" : "TMSI", + *tmsi_or_ptimsi); + } else { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use IMSI)\n", + is_ps? "IuPS" : "IuCS", + imsi + ); + } + + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->lac != lac) + continue; + if (is_ps && rnc->rac != rac) + continue; + + /* Found a match! */ + if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) + == 0) { + LOGPIU(LOGL_DEBUG, + "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", + is_ps? "IuPS" : "IuCS", + imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); + pagings_sent ++; + } + } + + /* Some logging... */ + if (pagings_sent > 0) { + LOGPIU(LOGL_DEBUG, + "%s: %d RNCs were paged for IMSI %s.\n", + is_ps? "IuPS" : "IuCS", + pagings_sent, imsi); + } + else { + if (is_ps) { + LOGPIU(LOGL_ERROR, "IuPS: Found no RNC to page for" + " LAC %d RAC %d (would have paged IMSI %s)\n", + lac, rac, imsi); + } + else { + LOGPIU(LOGL_ERROR, "IuCS: Found no RNC to page for" + " LAC %d (would have paged IMSI %s)\n", + lac, imsi); + } + } + + return pagings_sent; +} + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +{ + return iu_page(imsi, tmsi, lac, 0, false); +} + +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +{ + return iu_page(imsi, ptmsi, lac, rac, true); +} + + +/*********************************************************************** + * + ***********************************************************************/ + +int tx_unitdata(struct osmo_sccp_user *scu); +int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); + +struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); +struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); + +static struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) +{ + struct msgb *msg = msgb_alloc(1024, "conn_resp"); + struct osmo_scu_prim *prim; + + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_CONNECT, + PRIM_OP_RESPONSE, msg); + memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); + return &prim->oph; +} + +static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) +{ + struct osmo_sccp_user *scu = _scu; + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct osmo_prim_hdr *resp = NULL; + int rc; + struct ranap_ue_conn_ctx *ue; + struct new_ue_conn_ctx new_ctx = {}; + + LOGPIU(LOGL_DEBUG, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + + switch (OSMO_PRIM_HDR(oph)) { + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): + /* confirmation of outbound connection */ + rc = -1; + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): + /* indication of new inbound connection request*/ + LOGPIU(LOGL_DEBUG, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); + if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ + !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { + LOGPIU(LOGL_NOTICE, + "Received invalid N-CONNECT.ind\n"); + return 0; + } + new_ctx.sccp_addr = prim->u.connect.calling_addr; + new_ctx.conn_id = prim->u.connect.conn_id; + /* first ensure the local SCCP socket is ACTIVE */ + resp = make_conn_resp(&prim->u.connect); + osmo_sccp_user_sap_down(scu, resp); + /* then handle the RANAP payload */ + rc = ranap_cn_rx_co(cn_ranap_handle_co_initial, &new_ctx, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): + /* indication of disconnect */ + LOGPIU(LOGL_DEBUG, "N-DISCONNECT.ind(%u)\n", + prim->u.disconnect.conn_id); + ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): + /* connection-oriented data received */ + LOGPIU(LOGL_DEBUG, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + /* resolve UE context */ + ue = ue_conn_ctx_find(prim->u.data.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): + /* connection-less data received */ + LOGPIU(LOGL_DEBUG, "N-UNITDATA.ind(%s)\n", + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + rc = ranap_cn_rx_cl(cn_ranap_handle_cl, scu, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + default: + rc = -1; + break; + } + + msgb_free(oph->msg); + return rc; +} + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb) +{ + iu_log_subsystem = log_subsystem; + talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); + talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); + + global_iu_recv_cb = iu_recv_cb; + global_iu_event_cb = iu_event_cb; + g_sccp = sccp; + g_scu = osmo_sccp_user_bind(g_sccp, sccp_user_name, sccp_sap_up, OSMO_SCCP_SSN_RANAP); + + return 0; +} + diff --git a/src/iu_client_vty.c b/src/iu_client_vty.c new file mode 100644 index 0000000..b809b2a --- /dev/null +++ b/src/iu_client_vty.c @@ -0,0 +1,140 @@ +/* OpenBSC Iu related interface to quagga VTY */ +/* (C) 2016 by sysmocom s.m.f.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include +#include + +#include + +static enum ranap_nsap_addr_enc *g_rab_assign_addr_enc = NULL; + +DEFUN(cfg_iu_asn1_debug, + cfg_iu_asn1_debug_cmd, + "asn1 debug (1|0)", + "ASN.1 settings\n" + "Enable ASN.1 debug messages\n" + "Log ASN.1 debug messages to stderr\n" + "Do not log ASN.1 debug messages to stderr\n") +{ + asn_debug = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_iu_asn1_xer_print, + cfg_iu_asn1_xer_print_cmd, + "asn1 xer-print (1|0)", + "ASN.1 settings\n" + "Log human readable representations of all ASN.1 messages to stderr\n" + "Log XML representation of all ASN.1 messages to stderr\n" + "Do not log decoded ASN.1 messages to stderr\n") +{ + asn1_xer_print = atoi(argv[0]); + return CMD_SUCCESS; +} + +#define IU_STR "Iu interface protocol options\n" +DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, + "iu rab-assign-addr-enc (x213|v4raw)", + IU_STR + "Choose RAB Assignment's Transport Layer Address encoding\n" + "ITU-T X.213 compliant address encoding (default)\n" + "32bit length raw IPv4 address (for ip.access nano3G)\n") +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if (strcmp(argv[0], "v4raw") == 0) + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_V4RAW; + else + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_X213; + return CMD_SUCCESS; +} + +extern struct osmo_sccp_addr local_sccp_addr; + +DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, + "iu local-address point-code PC", + IU_STR "Local SCCP Address\n") +{ + local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; + local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; + local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); + + return CMD_SUCCESS; +} + +/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ + +int ranap_iu_vty_config_write(struct vty *vty, const char *indent) +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + switch (*g_rab_assign_addr_enc) { + case RANAP_NSAP_ADDR_ENC_V4RAW: + vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, + VTY_NEWLINE); + break; + case RANAP_NSAP_ADDR_ENC_X213: + /* default value, no need to write anything */ + break; + default: + LOGP(0, LOGL_ERROR, "Invalid value for" + " iu.rab_assign_addr_enc: %d\n", + *g_rab_assign_addr_enc); + return CMD_WARNING; + } + + vty_out(vty, "%siu local-address point-code %s%s", indent, + osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); + + if (asn_debug) + vty_out(vty, "%sasn1 debug 1%s", indent, VTY_NEWLINE); + + if (asn1_xer_print) + vty_out(vty, "%sasn1 xer-print 1%s", indent, VTY_NEWLINE); + + return CMD_SUCCESS; +} + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc) +{ + g_rab_assign_addr_enc = rab_assign_addr_enc; + + install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); + install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); + + /* Technically, these are global ASN.1 settings and not necessarily limited to the Iu interface. + * Practically, only Iu users will use ASN.1 in Osmocom programs -- at least so far. So it is + * easiest to have these commands under 'iu'. */ + install_element(iu_parent_node, &cfg_iu_asn1_debug_cmd); + install_element(iu_parent_node, &cfg_iu_asn1_xer_print_cmd); +} -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 4 Gerrit-Project: osmo-iuh 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 Jul 31 11:20:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 31 Jul 2017 11:20:59 +0000 Subject: [PATCH] osmo-iuh[master]: make point codes configurable by SCCP address book Message-ID: Review at https://gerrit.osmocom.org/3394 make point codes configurable by SCCP address book In the vty config, use the SCCP address book to configure the local and remote SCCP addresses. Add VTY commands to set the remote SCCP addresses by name, derive the ss7 instance from these addresses: cs7 instance 1 point-code 0.23.0 sccp-address msc point-code 0.0.1 sccp-address sgsn point-code 0.0.2 hnbgw iucs remote-addr msc iups remote-addr sgsn Enforce that both IuCS and IuPS use the same ss7 instance. In the future, we may add the feature to use two separate instances. Depends: libosmo-sccp I75c67d289693f1c2a049ac61cf2b2097d6e5687d, Ie1aedd7894acd69ddc887cd65a8a0df4b888838c, I85b46269dbe7909e52873ace3f720f6292a4516c Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b --- M include/osmocom/iuh/hnbgw.h M include/osmocom/iuh/hnbgw_cn.h M src/hnbgw.c M src/hnbgw_cn.c M src/hnbgw_rua.c M src/hnbgw_vty.c 6 files changed, 118 insertions(+), 98 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/94/3394/1 diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index db22d97..58bdab4 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -116,10 +116,8 @@ /*! The UDP port where we receive multiplexed CS user * plane traffic from HNBs */ uint16_t iuh_cs_mux_port; - const char *iucs_remote_ip; - uint16_t iucs_remote_port; - const char *iups_remote_ip; - uint16_t iups_remote_port; + const char *iucs_remote_addr_name; + const char *iups_remote_addr_name; uint16_t rnc_id; bool hnbap_allow_tmsi; } config; @@ -134,11 +132,11 @@ /* currently active CN links for CS and PS */ struct { - struct osmo_sccp_instance *instance; + struct osmo_sccp_instance *client; struct hnbgw_cnlink *cnlink; struct osmo_sccp_addr local_addr; - struct osmo_sccp_addr remote_addr_cs; - struct osmo_sccp_addr remote_addr_ps; + struct osmo_sccp_addr iucs_remote_addr; + struct osmo_sccp_addr iups_remote_addr; } sccp; }; diff --git a/include/osmocom/iuh/hnbgw_cn.h b/include/osmocom/iuh/hnbgw_cn.h index 93123f2..2e61d82 100644 --- a/include/osmocom/iuh/hnbgw_cn.h +++ b/include/osmocom/iuh/hnbgw_cn.h @@ -2,5 +2,4 @@ #include -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc); +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip); diff --git a/src/hnbgw.c b/src/hnbgw.c index 5d9f87b..409110f 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -79,14 +79,6 @@ gw->config.iuh_local_ip = talloc_strdup(gw, HNBGW_LOCAL_IP_DEFAULT); gw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT; - gw->config.iucs_remote_ip = talloc_strdup(gw, - HNBGW_IUCS_REMOTE_IP_DEFAULT); - gw->config.iucs_remote_port = M3UA_PORT; - - gw->config.iups_remote_ip = talloc_strdup(gw, - HNBGW_IUPS_REMOTE_IP_DEFAULT); - gw->config.iups_remote_port = M3UA_PORT; - gw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&gw->hnb_list); INIT_LLIST_HEAD(&gw->ue_list); @@ -465,6 +457,7 @@ vty_info.copyright = osmo_hnbgw_copyright; vty_init(&vty_info); + osmo_ss7_vty_init_asp(); hnbgw_vty_init(g_hnb_gw, tall_hnb_ctx); logging_vty_add_cmds(&hnbgw_log_info); @@ -501,23 +494,12 @@ ranap_set_log_area(DRANAP); - OSMO_ASSERT(g_hnb_gw->config.iucs_remote_ip); rc = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iucs_remote_ip, - g_hnb_gw->config.iucs_remote_port, - "127.0.0.5" /* FIXME: configurable */, - 23 /* FIXME: configurable */); + "127.0.0.1", M3UA_PORT, "127.0.0.5" /* FIXME: configurable */); if (rc < 0) { LOGP(DMAIN, LOGL_ERROR, "Failed to initialize SCCP link to CN\n"); exit(1); } - - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_cs, - 1 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_ps, - 2 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); OSMO_ASSERT(g_hnb_gw->config.iuh_local_ip); LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n", diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index e967260..4bd6506 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -63,8 +63,8 @@ { struct hnb_gw *gw = data; - transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.remote_addr_cs); - transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.remote_addr_ps); + transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.iucs_remote_addr); + transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.iups_remote_addr); hnbgw_cnlink_change_state(gw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); /* The spec states that we should abandon after a configurable * number of times. We decide to simply continue trying */ @@ -401,27 +401,90 @@ return 0; } -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc) +static bool addr_has_pc_and_ssn(const struct osmo_sccp_addr *addr) { - struct hnbgw_cnlink *cnlink; - int rc; + if (!(addr->presence & OSMO_SCCP_ADDR_T_SSN)) + return false; + if (!(addr->presence & OSMO_SCCP_ADDR_T_PC)) + return false; + return true; +} - OSMO_ASSERT(!gw->sccp.instance); - OSMO_ASSERT(!gw->sccp.cnlink); +static int resolve_addr_name(struct osmo_sccp_addr *dest, struct osmo_ss7_instance **ss7, + const char *addr_name, const char *label) +{ + struct osmo_ss7_instance *ss7_tmp; - gw->sccp.instance = osmo_sccp_simple_client(gw, "OsmoHNBGW", local_pc, - OSMO_SS7_ASP_PROT_M3UA, 0, local_ip, - stp_port, stp_host); - if (!gw->sccp.instance) { - LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Instance\n"); + if (!addr_name) { + LOGP(DMAIN, LOGL_ERROR, "Missing config: %s remote-addr\n", label); return -1; } - LOGP(DRUA, LOGL_DEBUG, "SCCP uplink to STP: %s %u\n", stp_host, stp_port); + ss7_tmp = osmo_sccp_addr_by_name(dest, addr_name); + if (!ss7_tmp) { + LOGP(DMAIN, LOGL_ERROR, "%s remote addr: no such SCCP address book entry: '%s'\n", + label, addr_name); + return -1; + } - osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, - OSMO_SCCP_SSN_RANAP); + if (*ss7 && (*ss7 != ss7_tmp)) { + LOGP(DMAIN, LOGL_ERROR, "IuCS and IuPS cannot be served from separate CS7 instances," + " cs7 instance %d != %d\n", (*ss7)->cfg.id, ss7_tmp->cfg.id); + return -1; + } + + *ss7 = ss7_tmp; + + osmo_sccp_addr_set_ssn(dest, OSMO_SCCP_SSN_RANAP); + + if (!addr_has_pc_and_ssn(dest)) { + LOGP(DMAIN, LOGL_ERROR, "Invalid/incomplete %s remote-addr: %s\n", + label, osmo_sccp_addr_name(dest)); + return -1; + } + + LOGP(DRANAP, LOGL_NOTICE, "Remote %s SCCP addr: %s\n", + label, osmo_sccp_addr_name(*ss7, dest)); + return 0; +} + +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip) +{ + struct hnbgw_cnlink *cnlink; + struct osmo_ss7_instance *ss7; + uint32_t local_pc; + int rc; + + OSMO_ASSERT(!gw->sccp.client); + OSMO_ASSERT(!gw->sccp.cnlink); + + ss7 = NULL; + if (resolve_addr_name(&gw->sccp.iucs_remote_addr, &ss7, + gw->config.iucs_remote_addr_name, "IuCS")) + return -1; + if (resolve_addr_name(&gw->sccp.iups_remote_addr, &ss7, + gw->config.iups_remote_addr_name, "IuPS")) + return -1; + + if (!ss7->cfg.primary_pc_valid) { + LOGP(DMAIN, LOGL_ERROR, "IuCS/IuPS uplink cannot be setup: CS7 instance %d has no point-code set\n", + ss7->cfg.id); + return -1; + } + local_pc = ss7->cfg.primary_pc; + + osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, OSMO_SCCP_SSN_RANAP); + + LOGP(DRANAP, LOGL_NOTICE, "M3UA uplink to STP: %s %u\n", stp_host, stp_port); + LOGP(DRANAP, LOGL_NOTICE, "Local SCCP addr: %s\n", osmo_sccp_addr_name(ss7, &gw->sccp.local_addr)); + + gw->sccp.client = osmo_sccp_simple_client_on_ss7_id(gw, ss7->cfg.id, "OsmoHNBGW", + local_pc, OSMO_SS7_ASP_PROT_M3UA, + 0, local_ip, stp_port, stp_host); + if (!gw->sccp.client) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Client\n"); + return -1; + } cnlink = talloc_zero(gw, struct hnbgw_cnlink); cnlink->gw = gw; @@ -430,10 +493,8 @@ cnlink->T_RafC.data = gw; cnlink->next_conn_id = 1000; - cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.instance, - "OsmoHNBGW", - sccp_sap_up, OSMO_SCCP_SSN_RANAP, - gw->sccp.local_addr.pc); + cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.client, "OsmoHNBGW", sccp_sap_up, + OSMO_SCCP_SSN_RANAP, gw->sccp.local_addr.pc); if (!cnlink->sccp_user) { LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP User\n"); return -1; diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index b610437..95979f5 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -188,11 +188,11 @@ switch (cN_DomainIndicator) { case RUA_CN_DomainIndicator_cs_domain: - remote_addr = &hnb->gw->sccp.remote_addr_cs; + remote_addr = &hnb->gw->sccp.iucs_remote_addr; is_ps = false; break; case RUA_CN_DomainIndicator_ps_domain: - remote_addr = &hnb->gw->sccp.remote_addr_ps; + remote_addr = &hnb->gw->sccp.iups_remote_addr; is_ps = true; break; default: diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c index 59871da..ddea578 100644 --- a/src/hnbgw_vty.c +++ b/src/hnbgw_vty.c @@ -90,7 +90,6 @@ vty->node = HNBGW_NODE; vty->index = NULL; break; - default: case HNBGW_NODE: vty->node = CONFIG_NODE; vty->index = NULL; @@ -98,6 +97,9 @@ case CONFIG_NODE: vty->node = ENABLE_NODE; vty->index = NULL; + break; + default: + osmo_ss7_vty_go_parent(vty); break; } @@ -182,37 +184,23 @@ return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_ip, cfg_hnbgw_iucs_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuCS core network link to\n" - "Remote IuCS IP address (default: " HNBGW_IUCS_REMOTE_IP_DEFAULT ")") +DEFUN(cfg_hnbgw_iucs_remote_addr, + cfg_hnbgw_iucs_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuCS to (MSC)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - talloc_free((void*)g_hnb_gw->config.iucs_remote_ip); - g_hnb_gw->config.iucs_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); + g_hnb_gw->config.iucs_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_port, cfg_hnbgw_iucs_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuCS core network link to\n" - "Remote IuCS port (default: 14001)") +DEFUN(cfg_hnbgw_iups_remote_addr, + cfg_hnbgw_iups_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuPS to (SGSN)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - g_hnb_gw->config.iucs_remote_port = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_ip, cfg_hnbgw_iups_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuPS core network link to\n" - "Remote IuPS IP address (default: " HNBGW_IUPS_REMOTE_IP_DEFAULT ")") -{ - talloc_free((void*)g_hnb_gw->config.iups_remote_ip); - g_hnb_gw->config.iups_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_port, cfg_hnbgw_iups_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuPS core network link to\n" - "Remote IuPS port (default: 14001)") -{ - g_hnb_gw->config.iups_remote_port = atoi(argv[0]); + g_hnb_gw->config.iups_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } @@ -248,15 +236,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iucs_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iucs%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iucs_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUCS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iucs_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iucs_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -266,15 +251,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iups_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iups%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iups_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUPS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iups_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iups_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -300,15 +282,13 @@ install_node(&iucs_node, config_write_hnbgw_iucs); vty_install_default(IUCS_NODE); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_ip_cmd); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_port_cmd); + install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_addr_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_iups_cmd); install_node(&iups_node, config_write_hnbgw_iups); vty_install_default(IUPS_NODE); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_ip_cmd); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_port_cmd); + install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_addr_cmd); install_element_ve(&show_hnb_cmd); install_element_ve(&show_ue_cmd); -- To view, visit https://gerrit.osmocom.org/3394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jul 31 11:55:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 31 Jul 2017 11:55:11 +0000 Subject: osmo-bts[master]: lc15: Tweak led colors used in service file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If351f49d1ead359192d0d80bbc381afd3459c940 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 31 11:55:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 31 Jul 2017 11:55:12 +0000 Subject: [MERGED] osmo-bts[master]: lc15: Tweak led colors used in service file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: Tweak led colors used in service file ...................................................................... lc15: Tweak led colors used in service file service sets led to orange before/while osmo-bts is being started. osmo-bts-lc15 sets led to green while operating. (unchanged in here) service sets led to red when osmo-bts stops running. Change-Id: If351f49d1ead359192d0d80bbc381afd3459c940 --- M contrib/osmo-bts-lc15.service 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/osmo-bts-lc15.service b/contrib/osmo-bts-lc15.service index ab7def8..6aa9751 100644 --- a/contrib/osmo-bts-lc15.service +++ b/contrib/osmo-bts-lc15.service @@ -3,10 +3,10 @@ [Service] Type=simple -ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/usr0/brightness' -ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness' +ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness' +ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr1/brightness' ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts.cfg -M -ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr0/brightness' +ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness' ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness' Restart=always RestartSec=2 -- To view, visit https://gerrit.osmocom.org/3356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If351f49d1ead359192d0d80bbc381afd3459c940 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 Mon Jul 31 11:55:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 31 Jul 2017 11:55:36 +0000 Subject: osmo-iuh[master]: ranap_common.h: fix include of asn1c/asn_application.h In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I152377813cdcfef73e2c4309b0f8c97807d7d4f8 Gerrit-PatchSet: 2 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 Mon Jul 31 11:56:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 31 Jul 2017 11:56:37 +0000 Subject: osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 4 Gerrit-Project: osmo-iuh 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 Jul 31 11:57:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 31 Jul 2017 11:57:13 +0000 Subject: osmo-iuh[master]: make point codes configurable by SCCP address book In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b 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 Mon Jul 31 11:57:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 31 Jul 2017 11:57:26 +0000 Subject: osmo-iuh[master]: apply ctx arg to osmo_ss7_vty_init_asp() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idccbdc669d740179153d0a73096745785bd2f5af Gerrit-PatchSet: 2 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 Mon Jul 31 11:58:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 31 Jul 2017 11:58:17 +0000 Subject: libosmo-sccp[master]: sccp: fix possible nullpointer deref In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 31 16:15:12 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Mon, 31 Jul 2017 16:15:12 +0000 Subject: libosmocore[master]: l1sap.h: Add ber10k and lqual_cb to ph_tch_param In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3092/1/include/osmocom/gsm/l1sap.h File include/osmocom/gsm/l1sap.h: PS1, Line 88: a typo -- To view, visit https://gerrit.osmocom.org/3092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If4ae20c22b881e94585dad710f17b9e37f77bf82 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jul 31 17:00:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 31 Jul 2017 17:00:14 +0000 Subject: [PATCH] osmo-gsm-tester[master]: esme: Log connection parameters of the SMSC Message-ID: Review at https://gerrit.osmocom.org/3395 esme: Log connection parameters of the SMSC Change-Id: Ie4d3019503a68b02ace849defe618bdc74eacbd9 --- M src/osmo_gsm_tester/esme.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/95/3395/1 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index 89eaa39..7063c33 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -101,7 +101,7 @@ self.connected = True self.client.bind_transceiver(system_id=self.system_id, password=self.password) self.bound = True - self.log('Connected and bound successfully. Starting to listen') + self.log('Connected and bound successfully to %s (%s:%d). Starting to listen.' % (self.system_id, host, port)) self.start_listening() def disconnect(self): -- To view, visit https://gerrit.osmocom.org/3395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie4d3019503a68b02ace849defe618bdc74eacbd9 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 Jul 31 17:00:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 31 Jul 2017 17:00:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: suite: Don't stop cleanup of objects on cleanup exception Message-ID: Review at https://gerrit.osmocom.org/3396 suite: Don't stop cleanup of objects on cleanup exception Let's accept that during cleanup time some stuff may not be in a good state, specially in case of a failure, but let's keep harder to clean up everything as much as possible. This should fix an issue in which after a test failure using an esme object, an smpp connection is kept in a buggy state and never removed/cleaned up, and makes all tests after it fail too because the conn is triggered at poll() time: File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/suite.py", line 260, in run_tests self.objects_cleanup() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/suite.py", line 199, in objects_cleanup obj.cleanup() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 345, in cleanup self.dbus.cleanup() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 170, in cleanup self.set_powered(False) File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 304, in set_powered self.set_bool('Powered', powered) File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 295, in set_bool event_loop.poll() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/event_loop.py", line 39, in poll func() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/esme.py", line 78, in poll self.client.poll() File "/usr/local/lib/python3.4/dist-packages/smpplib/client.py", line 321, in poll self.read_once(ignore_error_codes) File "/usr/local/lib/python3.4/dist-packages/smpplib/client.py", line 279, in read_once p = self.read_pdu() File "/usr/local/lib/python3.4/dist-packages/smpplib/client.py", line 206, in read_pdu raise exceptions.ConnectionError() smpplib.exceptions.ConnectionError Change-Id: Ie7ef9284490f12f5cfd76c35b33b57eefab20eb6 --- M src/osmo_gsm_tester/suite.py 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/96/3396/1 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index c4a9abc..d510b93 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -196,7 +196,10 @@ def objects_cleanup(self): while self.objects_to_clean_up: obj = self.objects_to_clean_up.pop() - obj.cleanup() + try: + obj.cleanup() + except Exception: + log.log_exn() def mark_start(self): self.start_timestamp = time.time() -- To view, visit https://gerrit.osmocom.org/3396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7ef9284490f12f5cfd76c35b33b57eefab20eb6 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 Jul 31 17:02:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 31 Jul 2017 17:02:41 +0000 Subject: osmo-gsm-tester[master]: suite: Don't stop cleanup of objects on cleanup exception In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7ef9284490f12f5cfd76c35b33b57eefab20eb6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 31 17:02:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 31 Jul 2017 17:02:49 +0000 Subject: osmo-gsm-tester[master]: esme: Log connection parameters of the SMSC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4d3019503a68b02ace849defe618bdc74eacbd9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jul 31 17:03:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 31 Jul 2017 17:03:00 +0000 Subject: [MERGED] osmo-gsm-tester[master]: esme: Log connection parameters of the SMSC In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: esme: Log connection parameters of the SMSC ...................................................................... esme: Log connection parameters of the SMSC Change-Id: Ie4d3019503a68b02ace849defe618bdc74eacbd9 --- M src/osmo_gsm_tester/esme.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index 89eaa39..7063c33 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -101,7 +101,7 @@ self.connected = True self.client.bind_transceiver(system_id=self.system_id, password=self.password) self.bound = True - self.log('Connected and bound successfully. Starting to listen') + self.log('Connected and bound successfully to %s (%s:%d). Starting to listen.' % (self.system_id, host, port)) self.start_listening() def disconnect(self): -- To view, visit https://gerrit.osmocom.org/3395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie4d3019503a68b02ace849defe618bdc74eacbd9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 31 17:03:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 31 Jul 2017 17:03:00 +0000 Subject: [MERGED] osmo-gsm-tester[master]: suite: Don't stop cleanup of objects on cleanup exception In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: suite: Don't stop cleanup of objects on cleanup exception ...................................................................... suite: Don't stop cleanup of objects on cleanup exception Let's accept that during cleanup time some stuff may not be in a good state, specially in case of a failure, but let's keep harder to clean up everything as much as possible. This should fix an issue in which after a test failure using an esme object, an smpp connection is kept in a buggy state and never removed/cleaned up, and makes all tests after it fail too because the conn is triggered at poll() time: File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/suite.py", line 260, in run_tests self.objects_cleanup() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/suite.py", line 199, in objects_cleanup obj.cleanup() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 345, in cleanup self.dbus.cleanup() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 170, in cleanup self.set_powered(False) File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 304, in set_powered self.set_bool('Powered', powered) File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 295, in set_bool event_loop.poll() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/event_loop.py", line 39, in poll func() File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/esme.py", line 78, in poll self.client.poll() File "/usr/local/lib/python3.4/dist-packages/smpplib/client.py", line 321, in poll self.read_once(ignore_error_codes) File "/usr/local/lib/python3.4/dist-packages/smpplib/client.py", line 279, in read_once p = self.read_pdu() File "/usr/local/lib/python3.4/dist-packages/smpplib/client.py", line 206, in read_pdu raise exceptions.ConnectionError() smpplib.exceptions.ConnectionError Change-Id: Ie7ef9284490f12f5cfd76c35b33b57eefab20eb6 --- M src/osmo_gsm_tester/suite.py 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index c4a9abc..d510b93 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -196,7 +196,10 @@ def objects_cleanup(self): while self.objects_to_clean_up: obj = self.objects_to_clean_up.pop() - obj.cleanup() + try: + obj.cleanup() + except Exception: + log.log_exn() def mark_start(self): self.start_timestamp = time.time() -- To view, visit https://gerrit.osmocom.org/3396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7ef9284490f12f5cfd76c35b33b57eefab20eb6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jul 31 17:22:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 31 Jul 2017 17:22:05 +0000 Subject: [PATCH] osmo-bts[master]: lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi Message-ID: Review at https://gerrit.osmocom.org/3397 lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi Change-Id: I007e5f0ce9709026331817e55148749e21d8b015 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/3397/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index cb3efab..a3b9556 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -934,8 +934,8 @@ chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); if (!chan_nr) { - LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi " - "%d\n", data_ind->sapi); + LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi %s (%d)\n", + get_value_string(lc15bts_l1sapi_names, data_ind->sapi), data_ind->sapi); msgb_free(l1p_msg); return ENOTSUP; } diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index a4bfffb..781900e 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -929,8 +929,8 @@ chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); if (!chan_nr) { - LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi " - "%d\n", data_ind->sapi); + LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi %s (%d)\n", + get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->sapi); msgb_free(l1p_msg); return ENOTSUP; } -- To view, visit https://gerrit.osmocom.org/3397 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I007e5f0ce9709026331817e55148749e21d8b015 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol