From ciaby at autistici.org Tue Mar 10 22:37:36 2015 From: ciaby at autistici.org (Ciaby) Date: Tue, 10 Mar 2015 16:37:36 -0600 Subject: AMR support in osmo-nitb Message-ID: <54FF7230.4000503@autistici.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi, I'm trying to get AMR to work (in TCH/F mode) on osmo-nitb. LCR is compiled with the correct codecs, but looking at the MNCC traffic I only get GSM FR coming from the osmo-nitb side. I already set this in osmo-nitb.cfg: mncc-int default-codec tch-f amr default-codec tch-h amr Any clue about this? Cheers Ciaby -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJU/3IvAAoJEPU83OtbD4fQmOMP/i46E//ide5JlScpZsN5oVCA u1cYIihZLpHPfKiGYhIp+A7/zX0FQpgiVKYh0n8A58H4UvF9wxG9ZZmX5B9D02aW 8eexmH5jeOAHj7YlHGPl0dK2RAOYie43kFevftPco21o7QmsylZ9+Z1lWn6OREDn R1Mix39wqq0feXxfhaMq/Y5j9XCjGOUS7FXDtuaCjlUANBcmp45WfXwhbwVfeLzX vTwHZ0mfQQ4Uyln8Y1gZL6MdF2WqHYEWND+qB6Aj+QKMLAeFr8yq5hapfev+PKwC kK4MoSJwW2aUi2TGuZqOZM9daJn7BhVfjf56TycyAMTHP3sJSNJKJ8vEzCUZy1ir CmSVe3m+C3QOBVRzbUYR0/sTBJ11+WcNdOMnM4sJCdz1guTzzMMjj4U3RKcMalaj KaqEsdBrpvQ+MRcE07aaRU/wm4ZG89r/enEmyqtIIzKVzJBgjyeZFQw0I5ca9TKA DNgwjcQ3FmHt4iAkDLbQK9OX3fkCcAkmC56bOKl1V16Es9fknrtadRGsLf9a2SzI B1sfVbfjZQ9r7Tag1cv6CUv0NcDK1BNs7VOxSvABFkkAjllbcy1j3HF0H2pMfPqo 3bOJXZ0N4a887lYae7ltPB4IGN9eHBVQwoQCA1yW1xL9AQtRuIiMQuFmodfSH7ij EHzL0rIjViIlxKzJGyDK =Fin+ -----END PGP SIGNATURE----- From holger at freyther.de Wed Mar 11 14:18:58 2015 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Wed, 11 Mar 2015 15:18:58 +0100 Subject: AMR support in osmo-nitb In-Reply-To: <54FF7230.4000503@autistici.org> References: <54FF7230.4000503@autistici.org> Message-ID: <20150311141858.GA320@xiaoyu.lan> On Tue, Mar 10, 2015 at 04:37:36PM -0600, Ciaby wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Hi, > I'm trying to get AMR to work (in TCH/F mode) on osmo-nitb. > LCR is compiled with the correct codecs, but looking at the MNCC > traffic I only get GSM FR coming from the osmo-nitb side. > I already set this in osmo-nitb.cfg: > > mncc-int > default-codec tch-f amr > default-codec tch-h amr We couldn't do that at 31C3 either. For the bearer negotiation you will need to configure amr as codec inside the bts(?) section as well. From ciaby at autistici.org Wed Mar 11 15:17:07 2015 From: ciaby at autistici.org (Ciaby) Date: Wed, 11 Mar 2015 09:17:07 -0600 Subject: AMR support in osmo-nitb In-Reply-To: <20150311141858.GA320@xiaoyu.lan> References: <54FF7230.4000503@autistici.org> <20150311141858.GA320@xiaoyu.lan> Message-ID: <55005C73.1030905@autistici.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 03/11/2015 08:18 AM, Holger Hans Peter Freyther wrote: [...] > We couldn't do that at 31C3 either. For the bearer negotiation you > will need to configure amr as codec inside the bts(?) section as > well. Ok, I'll try to do that as soon as I get to the office. Cheers Ciaby -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJVAFxyAAoJEPU83OtbD4fQ9WAP/0xZR7vjFLei53yFAD89BA3j cCQ4KPEM3t3KbCQukUJEp5QHKNHUHfWBG7KFQcxV3XiSP3fD2/OCgmKyk9YYCjbi so7Rb6yZ5040nYhqhQd1ju4f51Szk+YhEbV1LZIVkSiQnfgl0yxs1Lq1Qu17aExi OlMS0iIVIP8kJx038ctH45AcVOBwTWOGH335eP+JA+VKMnsprZ1uzqFhruvOBAV3 3lEXx9MQRe6p8z09H7t+RAjHnU9egd7KNsirZw7flGJDGWqZ3GnqklO+45Nqn9YO SGbXoXibxH7mrjjBp7wSmREJPYTB3v0PipPGz39xrRyPQJp5zaWlFx0a9+e6yfAA Va/QmKD3h73XkiG2a5iX7QXzEA6FWQkqHvoc9r6jUpSyj57WZQ86V+opdPw/yy0t yze0Ebl1/I5goKmR3V8B918YUdci3+kG1c9BWfymbgEzwrf1TDnMZ0uKm1SmwOWB yUjY8d6tPaUbCXfFwStWewoE22jvrXlBiGxk0v4SgERW0F2nfTsWcQcFK0Dp9Sz0 dytSXViLGGCxfpW8Fm5qWJ4gE8T002otbAPFrm5h8ngN/twNuNFlS61X7otKBKde Oo4UqBhSVqKvspQF9xPXPCrqXNMqUxJjIJvb9n056JCsWwXWo3MxtMqvCGALFk6O WkoQ41NxuSHoPlrX4KOY =D39+ -----END PGP SIGNATURE----- From stephen at egroat.com Mon Mar 16 19:14:25 2015 From: stephen at egroat.com (Stephen Groat) Date: Mon, 16 Mar 2015 19:14:25 +0000 Subject: Cannot build libosmocore git master for debian 7.8 Message-ID: I'm trying to make a Docker image to install network in a box and am having some trouble getting libosmocore to build. >From a base debian image, I'm running apt-get update && apt-get -y upgrade && apt-get -y install wget libopencore-amrwb0 libopencore-amrnb0 libortp8 libortp-dev libopencore-amrnb-dev libopencore-amrwb-dev sqlite3 libdbi-dev libdbi1 libdbd-sqlite3 git build-essential automake libtool libpcsclite1 libpcsclite-dev then: git clone git://git.osmocom.org/libosmocore.git cd libosmocore autoreconf -i ./configure The error I'm currently getting is: checking whether struct tm has tm_gmtoff member... yes ./configure: line 12023: syntax error near unexpected token `PCSC,' ./configure: line 12023: ` PKG_CHECK_MODULES(PCSC, libpcsclite)' Any advice? Thanks, Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at freyther.de Mon Mar 16 19:58:37 2015 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Mon, 16 Mar 2015 20:58:37 +0100 Subject: Cannot build libosmocore git master for debian 7.8 In-Reply-To: References: Message-ID: <20150316195837.GR6330@xiaoyu.lan> On Mon, Mar 16, 2015 at 07:14:25PM +0000, Stephen Groat wrote: Hi! > ./configure: line 12023: syntax error near unexpected token `PCSC,' > ./configure: line 12023: ` PKG_CHECK_MODULES(PCSC, libpcsclite)' > > Any advice? Thanks, build the debian package with cowbuilder or such and then install it. You are missing the pkg-config m4 files which means the macro PKG_CHECK_MODULES is not expanded.. which means when you run the configure shell script you do see the above. The best way forward is to build debian packages and install them. From jerlbeck at sysmocom.de Tue Mar 17 09:21:16 2015 From: jerlbeck at sysmocom.de (Jacob Erlbeck) Date: Tue, 17 Mar 2015 10:21:16 +0100 Subject: [PATCH 2/3] bssgp: Don't reply with STATUS when receiving a PtP STATUS message In-Reply-To: <1426584077-31056-1-git-send-email-jerlbeck@sysmocom.de> References: <1426584077-31056-1-git-send-email-jerlbeck@sysmocom.de> Message-ID: <1426584077-31056-2-git-send-email-jerlbeck@sysmocom.de> Currently each incoming PtP BSSGP STATUS message is handled as 'not yet implemented' and a BSSGP STATUS message (cause BSSGP_CAUSE_PROTO_ERR_UNSPEC) is sent back to the peer. This will cause endless messages loops if both peers use this BSSGP stack implementation. This does not apply to signalling messages. This commit changes the implementation of bssgp_rx_ptp() to just do logging in this case. Sponsored-by: On-Waves ehf --- src/gb/gprs_bssgp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 851d01c..8708340 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -845,7 +845,9 @@ static int bssgp_rx_ptp(struct msgb *msg, struct tlv_parsed *tp, break; case BSSGP_PDUT_STATUS: /* Some exception has occurred */ + DEBUGP(DBSSGP, "BSSGP BVCI=%u Rx PTP BVC STATUS\n", bctx->bvci); /* FIXME: send NM_STATUS.ind to NM */ + break; case BSSGP_PDUT_DOWNLOAD_BSS_PFC: case BSSGP_PDUT_CREATE_BSS_PFC_ACK: case BSSGP_PDUT_CREATE_BSS_PFC_NACK: -- 1.9.1 From jerlbeck at sysmocom.de Tue Mar 17 09:21:17 2015 From: jerlbeck at sysmocom.de (Jacob Erlbeck) Date: Tue, 17 Mar 2015 10:21:17 +0100 Subject: [PATCH 3/3] bssgp: Handle BSSGP STATUS messages In-Reply-To: <1426584077-31056-1-git-send-email-jerlbeck@sysmocom.de> References: <1426584077-31056-1-git-send-email-jerlbeck@sysmocom.de> Message-ID: <1426584077-31056-3-git-send-email-jerlbeck@sysmocom.de> Currently incoming BSSGP STATUS messages are just logged and no other action is taken. This makes it impossible for higher layers to react to failures which are indicated by corresponding STATUS messages unless a timeout is triggered as a result of that failure later on. This commit adds a bssgp_rx_status() function and calls it on incoming STATUS messages. That function logs a message, increments the new BSSGP_CTR_STATUS counter if the bctx context exists and invokes an NM_STATUS status indication. The latter will allow the application to handle failures immediately. Since all STATUS messages should be handled, the function is already called in bssgp_rcvmsg and the message is no longer handled in (and will not reach) bssgp_rx_sign and bssgp_rx_ptp. Ticket: OW#1414 Sponsored-by: On-Waves ehf --- include/osmocom/gprs/gprs_bssgp.h | 2 + src/gb/gprs_bssgp.c | 78 +++++++++++++++++++++++++++++++-------- tests/gb/gprs_bssgp_test.c | 35 ++++++++++++++++++ tests/gb/gprs_bssgp_test.ok | 4 ++ 4 files changed, 103 insertions(+), 16 deletions(-) diff --git a/include/osmocom/gprs/gprs_bssgp.h b/include/osmocom/gprs/gprs_bssgp.h index f229253..e24b563 100644 --- a/include/osmocom/gprs/gprs_bssgp.h +++ b/include/osmocom/gprs/gprs_bssgp.h @@ -33,6 +33,7 @@ enum bssgp_prim { PRIM_NM_BVC_RESET, PRIM_NM_BVC_BLOCK, PRIM_NM_BVC_UNBLOCK, + PRIM_NM_STATUS, }; struct osmo_bssgp_prim { @@ -117,6 +118,7 @@ enum bssgp_ctr { BSSGP_CTR_BYTES_OUT, BSSGP_CTR_BLOCKED, BSSGP_CTR_DISCARDED, + BSSGP_CTR_STATUS, }; diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 8708340..2f23290 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -46,6 +46,7 @@ static const struct rate_ctr_desc bssgp_ctr_description[] = { { "bytes.out", "Bytes at BSSGP Level (Out)" }, { "blocked", "BVC Blocking count" }, { "discarded", "BVC LLC Discarded count" }, + { "status", "BVC Status count" }, }; static const struct rate_ctr_group_desc bssgp_ctrg_desc = { @@ -516,6 +517,46 @@ static int bssgp_rx_llc_disc(struct msgb *msg, struct tlv_parsed *tp, return bssgp_prim_cb(&nmp.oph, NULL); } +int bssgp_rx_status(struct msgb *msg, struct tlv_parsed *tp, + uint16_t bvci, struct bssgp_bvc_ctx *bctx) +{ + struct osmo_bssgp_prim nmp; + enum gprs_bssgp_cause cause; + + if (!TLVP_PRESENT(tp, BSSGP_IE_CAUSE)) { + LOGP(DBSSGP, LOGL_ERROR, "BSSGP BVCI=%u Rx STATUS " + "missing mandatory IE\n", bvci); + cause = BSSGP_CAUSE_PROTO_ERR_UNSPEC; + } else { + cause = *TLVP_VAL(tp, BSSGP_IE_CAUSE); + } + + LOGP(DBSSGP, LOGL_NOTICE, "BSSGP BVCI=%u Rx BVC STATUS, cause=%s\n", + bvci, bssgp_cause_str(cause)); + + if (cause == BSSGP_CAUSE_BVCI_BLOCKED || cause == BSSGP_CAUSE_UNKNOWN_BVCI) { + if (!TLVP_PRESENT(tp, BSSGP_IE_BVCI)) + LOGP(DBSSGP, LOGL_ERROR, + "BSSGP BVCI=%u Rx STATUS cause=%s " + "missing conditional BVCI IE\n", + bvci, bssgp_cause_str(cause)); + } + + if (bctx) + rate_ctr_inc(&bctx->ctrg->ctr[BSSGP_CTR_STATUS]); + + /* send NM_STATUS to NM */ + memset(&nmp, 0, sizeof(nmp)); + nmp.nsei = msgb_nsei(msg); + nmp.bvci = bvci; + nmp.tp = tp; + osmo_prim_init(&nmp.oph, SAP_BSSGP_NM, PRIM_NM_STATUS, + PRIM_OP_INDICATION, msg); + + return bssgp_prim_cb(&nmp.oph, NULL); +} + + /* One element (msgb) in a BSSGP Flow Control queue */ struct bssgp_fc_queue_element { /* linked list of queue elements */ @@ -807,10 +848,12 @@ static int bssgp_rx_ptp(struct msgb *msg, struct tlv_parsed *tp, uint8_t pdu_type = bgph->pdu_type; int rc = 0; + OSMO_ASSERT(pdu_type != BSSGP_PDUT_STATUS); + /* If traffic is received on a BVC that is marked as blocked, the * received PDU shall not be accepted and a STATUS PDU (Cause value: * BVC Blocked) shall be sent to the peer entity on the signalling BVC */ - if (bctx->state & BVC_S_BLOCKED && pdu_type != BSSGP_PDUT_STATUS) { + if (bctx->state & BVC_S_BLOCKED) { uint16_t bvci = msgb_bvci(msg); return bssgp_tx_status(BSSGP_CAUSE_BVCI_BLOCKED, &bvci, msg); } @@ -844,9 +887,7 @@ static int bssgp_rx_ptp(struct msgb *msg, struct tlv_parsed *tp, /* FIXME: Send FLOW_CONTROL_MS_ACK */ break; case BSSGP_PDUT_STATUS: - /* Some exception has occurred */ - DEBUGP(DBSSGP, "BSSGP BVCI=%u Rx PTP BVC STATUS\n", bctx->bvci); - /* FIXME: send NM_STATUS.ind to NM */ + /* This is already handled in bssgp_rcvmsg() */ break; case BSSGP_PDUT_DOWNLOAD_BSS_PFC: case BSSGP_PDUT_CREATE_BSS_PFC_ACK: @@ -943,9 +984,7 @@ static int bssgp_rx_sign(struct msgb *msg, struct tlv_parsed *tp, rc = bssgp_rx_bvc_reset(msg, tp, ns_bvci); break; case BSSGP_PDUT_STATUS: - /* Some exception has occurred */ - DEBUGP(DBSSGP, "BSSGP BVCI=%u Rx BVC STATUS\n", bvci); - /* FIXME: send NM_STATUS.ind to NM */ + /* This is already handled in bssgp_rcvmsg() */ break; /* those only exist in the SGSN -> BSS direction */ case BSSGP_PDUT_PAGING_PS: @@ -1006,15 +1045,6 @@ int bssgp_rcvmsg(struct msgb *msg) /* look-up or create the BTS context for this BVC */ bctx = btsctx_by_bvci_nsei(bvci, msgb_nsei(msg)); - /* Only a RESET PDU can create a new BVC context, - * otherwise it must be registered if a BVCI is given */ - if (!bctx && bvci != BVCI_SIGNALLING && - pdu_type != BSSGP_PDUT_BVC_RESET) { - LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u Rejecting PDU " - "type %u for unknown BVCI\n", msgb_nsei(msg), bvci, - pdu_type); - return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI, &bvci, msg); - } if (bctx) { log_set_context(GPRS_CTX_BVC, bctx); @@ -1023,6 +1053,22 @@ int bssgp_rcvmsg(struct msgb *msg) msgb_bssgp_len(msg)); } + /* Always handle STATUS PDUs, even if they contain an invalid BVCI or + * are otherwise unexpected */ + if (pdu_type == BSSGP_PDUT_STATUS) + /* Some exception has occurred */ + return bssgp_rx_status(msg, &tp, bvci, bctx); + + /* Only a RESET PDU can create a new BVC context, otherwise it must be + * registered if a BVCI is given. */ + if (!bctx && bvci != BVCI_SIGNALLING && + pdu_type != BSSGP_PDUT_BVC_RESET) { + LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u Rejecting PDU " + "type %u for unknown BVCI\n", msgb_nsei(msg), bvci, + pdu_type); + return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI, &bvci, msg); + } + if (ns_bvci == BVCI_SIGNALLING) rc = bssgp_rx_sign(msg, &tp, bctx); else if (ns_bvci == BVCI_PTM) diff --git a/tests/gb/gprs_bssgp_test.c b/tests/gb/gprs_bssgp_test.c index a247326..3d1384b 100644 --- a/tests/gb/gprs_bssgp_test.c +++ b/tests/gb/gprs_bssgp_test.c @@ -125,6 +125,40 @@ static void test_bssgp_suspend_resume(void) printf("----- %s END\n", __func__); } +static void send_bssgp_status(enum gprs_bssgp_cause cause, uint16_t *bvci) +{ + struct msgb *msg = bssgp_msgb_alloc(); + uint8_t cause_ = cause; + + msgb_v_put(msg, BSSGP_PDUT_STATUS); + msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, &cause_); + if (bvci) { + uint16_t bvci_ = htons(*bvci); + msgb_tvlv_put(msg, BSSGP_IE_BVCI, 2, (uint8_t *) &bvci_); + } + + msgb_bssgp_send_and_free(msg); +} + +static void test_bssgp_status(void) +{ + uint16_t bvci; + + printf("----- %s START\n", __func__); + + send_bssgp_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL); + OSMO_ASSERT(last_oph.primitive == PRIM_NM_STATUS); + + /* Enforce prim != PRIM_NM_STATUS */ + last_oph.primitive = PRIM_NM_LLC_DISCARDED; + + bvci = 1234; + send_bssgp_status(BSSGP_CAUSE_UNKNOWN_BVCI, &bvci); + OSMO_ASSERT(last_oph.primitive == PRIM_NM_STATUS); + + printf("----- %s END\n", __func__); +} + static struct log_info info = {}; int main(int argc, char **argv) @@ -146,6 +180,7 @@ int main(int argc, char **argv) printf("===== BSSGP test START\n"); test_bssgp_suspend_resume(); + test_bssgp_status(); printf("===== BSSGP test END\n\n"); exit(EXIT_SUCCESS); diff --git a/tests/gb/gprs_bssgp_test.ok b/tests/gb/gprs_bssgp_test.ok index c9ec83d..0392e6a 100644 --- a/tests/gb/gprs_bssgp_test.ok +++ b/tests/gb/gprs_bssgp_test.ok @@ -3,5 +3,9 @@ BSSGP primitive, SAP 16777219, prim = 3, op = 0, msg = 0b 1f 84 f0 12 34 56 1b 86 0f f1 80 20 37 00 BSSGP primitive, SAP 16777219, prim = 4, op = 0, msg = 0e 1f 84 f0 12 34 56 1b 86 0f f1 80 20 37 00 1d 81 01 ----- test_bssgp_suspend_resume END +----- test_bssgp_status START +BSSGP primitive, SAP 16777221, prim = 11, op = 2, msg = 41 07 81 27 +BSSGP primitive, SAP 16777221, prim = 11, op = 2, msg = 41 07 81 05 04 82 04 d2 +----- test_bssgp_status END ===== BSSGP test END -- 1.9.1 From jerlbeck at sysmocom.de Tue Mar 17 09:21:15 2015 From: jerlbeck at sysmocom.de (Jacob Erlbeck) Date: Tue, 17 Mar 2015 10:21:15 +0100 Subject: [PATCH 1/3] logging: Implement subsecond resolution of extended timestamps Message-ID: <1426584077-31056-1-git-send-email-jerlbeck@sysmocom.de> Currently when using 'logging print extended-timestamp 1', the subsecond part (milliseconds) of the printed timestamp is always 0. This makes it difficult to correlate log entries with PCAP file entries if there are many of them per second. This patch changes _output in logging.c to use gettimeofday() instead of time() when extended timestamps are enabled and replaces the '000' by the milliseconds computed from tv_usec. Sponsored-by: On-Waves ehf --- src/logging.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/logging.c b/src/logging.c index c007a45..20b0596 100644 --- a/src/logging.c +++ b/src/logging.c @@ -38,6 +38,7 @@ #include #endif #include +#include #include #include @@ -254,11 +255,13 @@ static void _output(struct log_target *target, unsigned int subsys, if (!cont) { if (target->print_ext_timestamp) { struct tm tm; - time_t timep = time(NULL); - localtime_r(&timep, &tm); - ret = snprintf(buf + offset, rem, "%04d%02d%02d%02d%02d%02d000 ", + struct timeval tv; + gettimeofday(&tv, NULL); + localtime_r(&tv.tv_sec, &tm); + ret = snprintf(buf + offset, rem, "%04d%02d%02d%02d%02d%02d%03d ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec); + tm.tm_hour, tm.tm_min, tm.tm_sec, + (int)(tv.tv_usec / 1000)); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -- 1.9.1 From amber_sarosh at hotmail.com Fri Mar 20 06:53:40 2015 From: amber_sarosh at hotmail.com (Amber and Sarosh) Date: Fri, 20 Mar 2015 11:53:40 +0500 Subject: Error - Installating libosmo-abis Message-ID: Hi, I am trying to configure and run OsmoTRX,OsmoBTS, OsmoNITB and LCR as per instructions at ; http://openbsc.osmocom.org/trac/wiki/network_from_scratch After installation of libosmocore when i run ./configure in libosmo-abis-master , I get the error below every time. Please note that I have installed libosmocore-0.6.0 but some how even while running pkg-config --modversion libosmocore command the version is reported as having value of UNKNOWN. I have also set the path of PKG_CONFIG_PATH correctly where the file libosmocore.pc is actually located but still this error is seen. checking if gcc supports -fvisibility=hidden... yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... no configure: error: Package requirements (libosmocore >= 0.3.0) were not met: Requested 'libosmocore >= 0.3.0' but version of Osmocom Core Library is UNKNOWN Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBOSMOCORE_CFLAGS and LIBOSMOCORE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. Please help me in this regard. Regards, Sarosh -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.chemeris at gmail.com Sun Mar 22 19:29:26 2015 From: alexander.chemeris at gmail.com (Alexander Chemeris) Date: Sun, 22 Mar 2015 22:29:26 +0300 Subject: Error - Installating libosmo-abis In-Reply-To: References: Message-ID: Sarosh, For OsmoTRX support in OpenBSC I recommend you to use 'fairwaves/master' branches where they exist - they are synchronized to each other, as we're using them here. On Fri, Mar 20, 2015 at 9:53 AM, Amber and Sarosh wrote: > Hi, I am trying to configure and run OsmoTRX,OsmoBTS, OsmoNITB and LCR as > per instructions at ; > http://openbsc.osmocom.org/trac/wiki/network_from_scratch > After installation of libosmocore when i run ./configure in > libosmo-abis-master , I get the error below every time. Please note that I > have installed libosmocore-0.6.0 but some how even while running pkg-config > --modversion libosmocore command the version is reported as having value of > UNKNOWN. I have also set the path of PKG_CONFIG_PATH correctly where the > file libosmocore.pc is actually located but still this error is seen. > > checking if gcc supports -fvisibility=hidden... yes > checking for pkg-config... /usr/bin/pkg-config > checking pkg-config is at least version 0.9.0... yes > checking for LIBOSMOCORE... no > configure: error: Package requirements (libosmocore >= 0.3.0) were not met: > > Requested 'libosmocore >= 0.3.0' but version of Osmocom Core Library is > UNKNOWN > > Consider adjusting the PKG_CONFIG_PATH environment variable if you > installed software in a non-standard prefix. > > Alternatively, you may set the environment variables LIBOSMOCORE_CFLAGS > and LIBOSMOCORE_LIBS to avoid the need to call pkg-config. > See the pkg-config man page for more details. > > Please help me in this regard. > > Regards, > Sarosh -- Regards, Alexander Chemeris. CEO, Fairwaves, Inc. https://fairwaves.co From variomap at gmail.com Wed Mar 25 11:46:23 2015 From: variomap at gmail.com (Alexander Nikolaev) Date: Wed, 25 Mar 2015 14:46:23 +0300 Subject: Patch to add index to SMS table Message-ID: Hi, I would like to introduce new index for the SMS table. I've run benchmarks using test database with about 8500 records in both SMS and Subscriber tables. Introducing SMS(dest_addr) index reduces execution time 4 times for this benchmark. As far as I can see, db_sms_get_unsent() gets called frequently, so real-life benefits might also be considerable, especially for the large datasets. Patch: https://gist.github.com/ati/5ef481954f5bd38d00fc SQL queries benchmark script (python): https://gist.github.com/ati/bd03be698a89e24d8a89 Regards, Alexander From holger at freyther.de Wed Mar 25 22:39:32 2015 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Wed, 25 Mar 2015 23:39:32 +0100 Subject: [PATCH 03/33] Add BCCH message to PH-/MPH-/TCH-SAP interface In-Reply-To: <1409176492-13269-4-git-send-email-laforge@gnumonks.org> References: <1409176492-13269-1-git-send-email-laforge@gnumonks.org> <1409176492-13269-4-git-send-email-laforge@gnumonks.org> Message-ID: <20150325223932.GA9479@xiaoyu.lan> On Wed, Aug 27, 2014 at 11:54:22PM +0200, Harald Welte wrote: > + /* don't free, because we forwarded data */ > + return 1; Maybe we can make that a define for the ownership handling instead of a magic number. > +static int ph_data_req(struct gsm_bts_trx *trx, struct msgb *msg, > + struct osmo_phsap_prim *l1sap) > +{ ... > + } else { > + LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d " > + "chan_nr %d link_id %d\n", l1sap->oph.primitive, > + l1sap->oph.operation, chan_nr, link_id); sure this should not happen in normal operation msgb_free(l1sap); > + return -EINVAL; > + } > + /* wrap zeroed l1p structure arrount payload around... > + * this must be done in three steps, since the actual > + * payload is not at the end but inside the l1p structure. */ maybe we can use the pull_to_l3 method hre? > + > + /* send message to DSP's queue */ > + osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], msg); The existing code doesn't do this either but wqueue_enqueue is written in a way that if the queue has reached the max depth the message will not be added. This was done to let the caller decide if it should clear the queue or wants to print the msgb. The result is that the result of enqueue should be checked and if the queuing was rejected msgb_free must be called. > +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) > +{ > + struct msgb *msg = l1sap->oph.msg; > + int rc = 0; > + > + switch (OSMO_PRIM_HDR(&l1sap->oph)) { > + case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST): > + rc = ph_data_req(trx, msg, l1sap); > + break; > + default: > + LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d\n", > + l1sap->oph.primitive, l1sap->oph.operation); > + rc = -EINVAL; > + } > + > + if (rc) > + msgb_free(msg); did the rc == 1 turn into a rc != 0 here? > @@ -598,6 +740,7 @@ tx: > /* transmit */ > osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], resp_msg); the existing osmo_queue_enquire issue. > @@ -952,8 +1095,8 @@ static int l1if_handle_ind(struct femtol1_hdl *fl1, struct msgb *msg) > case GsmL1_PrimId_PhConnectInd: > break; > case GsmL1_PrimId_PhReadyToSendInd: > - rc = handle_ph_readytosend_ind(fl1, &l1p->u.phReadyToSendInd); > - break; > + return handle_ph_readytosend_ind(fl1, &l1p->u.phReadyToSendInd, > + msg); maybe it is better to split the switch into two cases to show the new and old memory semantics? From holger at freyther.de Wed Mar 25 23:41:24 2015 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Thu, 26 Mar 2015 00:41:24 +0100 Subject: Patch to add index to SMS table In-Reply-To: References: Message-ID: <20150325234124.GN540@xiaoyu.lan> On Wed, Mar 25, 2015 at 02:46:23PM +0300, Alexander Nikolaev wrote: > Hi, Hey, > Patch: https://gist.github.com/ati/5ef481954f5bd38d00fc great! What is the benefit of using ";" to execute both statements with a single sqlite3 command in db_prepare? Any disadvantage to introduce a new key for the index? > SQL queries benchmark script (python): > https://gist.github.com/ati/bd03be698a89e24d8a89 What we would like to do is to avoid using libdbi. It has known and unfixed memory access issues, for sqlite3 it needs to execute pragma statements for each column we query. Would you be interested to do more work on the database interface? holger From variomap at gmail.com Fri Mar 27 17:16:47 2015 From: variomap at gmail.com (Alexander Nikolaev) Date: Fri, 27 Mar 2015 18:16:47 +0100 Subject: Patch to add index to SMS table In-Reply-To: <20150325234124.GN540@xiaoyu.lan> References: <20150325234124.GN540@xiaoyu.lan> Message-ID: Holger, > What is the benefit of using ";" to execute both > statements with a single sqlite3 command in db_prepare? I don't think there's a big difference, not in case of sqlite anyway, since its -prepare and -exec calls support both single statements and sql statemens list. If separate SQL statements better match the approved code style, I've created a patch that uses separate query for index creation -- https://gist.github.com/ati/3089e35080598495ca27 > What we would like to do is to avoid using libdbi. Do you have in mind some other abstraction layer or think that it is better to just use native sqlite interface? It would be great if it is possible to use asynchronous db calls, but this requires major rewrite of the database interface. Regards, Alexander Nikolaev fairwaves.co On Thu, Mar 26, 2015 at 12:41 AM, Holger Hans Peter Freyther wrote: > On Wed, Mar 25, 2015 at 02:46:23PM +0300, Alexander Nikolaev wrote: >> Hi, > > Hey, > >> Patch: https://gist.github.com/ati/5ef481954f5bd38d00fc > > great! What is the benefit of using ";" to execute both > statements with a single sqlite3 command in db_prepare? > Any disadvantage to introduce a new key for the index? > > >> SQL queries benchmark script (python): >> https://gist.github.com/ati/bd03be698a89e24d8a89 > > What we would like to do is to avoid using libdbi. It has > known and unfixed memory access issues, for sqlite3 it > needs to execute pragma statements for each column we > query. Would you be interested to do more work on the > database interface? > > holger > From max.suraev at fairwaves.co Sat Mar 28 15:13:14 2015 From: max.suraev at fairwaves.co (Max) Date: Sat, 28 Mar 2015 16:13:14 +0100 Subject: [PATCH] ignore debian build byproducts Message-ID: <1427555594-6525-1-git-send-email-max.suraev@fairwaves.co> Signed-off-by: Max --- .gitignore | 1 + openbsc/.gitignore | 1 + 2 files changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89bf7df --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +debian/*.log diff --git a/openbsc/.gitignore b/openbsc/.gitignore index 58885b9..2210c47 100644 --- a/openbsc/.gitignore +++ b/openbsc/.gitignore @@ -56,6 +56,7 @@ src/gprs/osmo-gbproxy src/osmo-bsc_nat/osmo-bsc_nat #tests +tests/testsuite.dir tests/bsc-nat/bsc_nat_test tests/bsc-nat-trie/bsc_nat_trie_test tests/channel/channel_test -- 2.1.0 From holger at freyther.de Sun Mar 29 09:25:22 2015 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Sun, 29 Mar 2015 11:25:22 +0200 Subject: Patch to add index to SMS table In-Reply-To: References: <20150325234124.GN540@xiaoyu.lan> Message-ID: <20150329092522.GD16743@xiaoyu.lan> On Fri, Mar 27, 2015 at 06:16:47PM +0100, Alexander Nikolaev wrote: > Holger, > If separate SQL statements better match the approved code style, I've > created a patch that uses separate query for index creation -- > https://gist.github.com/ati/3089e35080598495ca27 Have a look at int db_prepare(void) { dbi_result result; int i; for (i = 0; i < ARRAY_SIZE(create_stmts); i++) { result = dbi_conn_query(conn, create_stmts[i]); if (!result) { LOGP(DDB, LOGL_ERROR, "Failed to create some table.\n"); return 1; } dbi_result_free(result); } so after you added the SCHEMA_SMS_IDX should be automatically created. There should be no requirement to execute statement from update_db_revision_3. > > What we would like to do is to avoid using libdbi. > Do you have in mind some other abstraction layer or think that it is > better to just use native sqlite interface? > It would be great if it is possible to use asynchronous db calls, but > this requires major rewrite of the database interface. https://openbsc.osmocom.org/trac/wiki/Tasks/NITBAsyncDatabase for a proposal. holger From Max.Suraev at fairwaves.co Sun Mar 29 10:16:25 2015 From: Max.Suraev at fairwaves.co (=?UTF-8?B?4piO?=) Date: Sun, 29 Mar 2015 12:16:25 +0200 Subject: patches4review Message-ID: <5517D0F9.6000507@fairwaves.co> Hi. As a follow-up on today's discussion here are the links to patches I'd like to get reviewed and merged: http://patchwork.ozlabs.org/patch/400499/ http://patchwork.ozlabs.org/patch/402147/ Also, would be nice to get patchwork subscribed back to ML. -- best regards, Max, http://fairwaves.co From mike.mcternan at wavemobile.com Mon Mar 30 12:30:58 2015 From: mike.mcternan at wavemobile.com (Mike McTernan (wavemobile)) Date: Mon, 30 Mar 2015 12:30:58 +0000 Subject: [PATCH 1/1] Loggingrb: Build and fix the testcase Message-ID: The loggingrb (ringbuffer) testcase was not actually being built and ran; instead the makefile called the normal logging test for a second time. This patch fixes Makefile.am to build the correct files, then the loggingrb testcase is fixed to use the current loggingrb API so that it builds and passes. Signed-off-by: Michael McTernan --- tests/Makefile.am | 2 +- tests/loggingrb/loggingrb_test.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 2c80063..0bf0c43 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -78,7 +78,7 @@ logging_logging_test_LDADD = $(top_builddir)/src/libosmocore.la fr_fr_test_SOURCES = fr/fr_test.c fr_fr_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL) -loggingrb_loggingrb_test_SOURCES = logging/logging_test.c +loggingrb_loggingrb_test_SOURCES = loggingrb/loggingrb_test.c loggingrb_loggingrb_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/vty/libosmovty.la strrb_strrb_test_SOURCES = strrb/strrb_test.c diff --git a/tests/loggingrb/loggingrb_test.c b/tests/loggingrb/loggingrb_test.c index 9957b53..ebc0181 100644 --- a/tests/loggingrb/loggingrb_test.c +++ b/tests/loggingrb/loggingrb_test.c @@ -21,8 +21,7 @@ #include #include -#include -#include +#include enum { DRLL, @@ -61,7 +60,7 @@ int main(int argc, char **argv) struct log_target *ringbuf_target; log_init(&log_info, NULL); - ringbuf_target = log_target_create_rbvty(NULL, 0x1000); + ringbuf_target = log_target_create_rb(0x1000); log_add_target(ringbuf_target); log_set_all_filter(ringbuf_target, 1); log_set_print_filename(ringbuf_target, 0); @@ -74,9 +73,9 @@ int main(int argc, char **argv) DEBUGP(DRLL, "You should see this\n"); DEBUGP(DCC, "You should see this\n"); DEBUGP(DMM, "You should not see this\n"); - fprintf(stderr, ringbuffer_get_nth(ringbuf_target->tgt_rbvty.rb, 0)); - fprintf(stderr, ringbuffer_get_nth(ringbuf_target->tgt_rbvty.rb, 1)); - OSMO_ASSERT(!ringbuffer_get_nth(ringbuf_target->tgt_rbvty.rb, 2)); + fprintf(stderr, log_target_rb_get(ringbuf_target, 0)); + fprintf(stderr, log_target_rb_get(ringbuf_target, 1)); + OSMO_ASSERT(!log_target_rb_get(ringbuf_target, 2)); return 0; } -- 1.8.3.1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at freyther.de Mon Mar 30 13:39:11 2015 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Mon, 30 Mar 2015 15:39:11 +0200 Subject: [PATCH 1/1] Loggingrb: Build and fix the testcase In-Reply-To: References: Message-ID: <20150330133911.GH14131@xiaoyu.lan> On Mon, Mar 30, 2015 at 12:30:58PM +0000, Mike McTernan (wavemobile) wrote: Hey! > The loggingrb (ringbuffer) testcase was not actually being built and ran; instead the makefile called the normal logging test for a second time. > > This patch fixes Makefile.am to build the correct files, then the loggingrb testcase is fixed to use the current loggingrb API so that it builds and passes. oh nice find! How did you find it? Could you somehow send it as attachment? Your mailer has sadly broken it. :( holger From mike.mcternan at wavemobile.com Mon Mar 30 13:51:43 2015 From: mike.mcternan at wavemobile.com (Mike McTernan (wavemobile)) Date: Mon, 30 Mar 2015 13:51:43 +0000 Subject: [PATCH 1/1] Loggingrb: Build and fix the testcase In-Reply-To: <20150330133911.GH14131@xiaoyu.lan> References: <20150330133911.GH14131@xiaoyu.lan> Message-ID: > oh nice find! How did you find it? I was adding to the existing logger testcase for some other changes, and noticed loggerrb started failing... manually trying to build the loggerrb case made it obvious when it wouldn't compile due to wrong headers and functions. > Could you somehow send it as attachment? Sure, attached. > Your mailer has sadly broken it. :( Hmm, I thought it might - Outlook I'm afraid :( Kind Regards, Mike -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Tests-Fix-broken-loggingrb-testcase.patch Type: application/octet-stream Size: 2654 bytes Desc: 0001-Tests-Fix-broken-loggingrb-testcase.patch URL: