Change in osmo-msc[master]: Autofill LCLS parameters for A-interface transactions

2021-06-01 Thread laforge
laforge has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/13422 )

Change subject: Autofill LCLS parameters for A-interface transactions
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/13422
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I35ae6b6ca04925c8d300bc1a0269af00eac727f3
Gerrit-Change-Number: 13422
Gerrit-PatchSet: 18
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-CC: neels 
Gerrit-MessageType: abandon


Change in osmo-msc[master]: Autofill LCLS parameters for A-interface transactions

2020-12-23 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/13422 )

Change subject: Autofill LCLS parameters for A-interface transactions
..


Patch Set 12:

(9 comments)

https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/include/osmocom/msc/mncc.h
File include/osmocom/msc/mncc.h:

https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/include/osmocom/msc/mncc.h@166
PS12, Line 166:
> Need to bump the MNCC version.
@laforge, this is the reason why this patch must remain WIP, it changes the 
MNCC socket protocol without bumping the revision (which should also be 
coordinated with osmo-sip-connector)


https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/include/osmocom/msc/transaction.h
File include/osmocom/msc/transaction.h:

https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/include/osmocom/msc/transaction.h@135
PS12, Line 135: struct osmo_lcls *lcls;
this should go in the "cc" struct above, because it only concerns voice 
transactions


https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/include/osmocom/msc/vlr.h
File include/osmocom/msc/vlr.h:

https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/include/osmocom/msc/vlr.h@274
PS12, Line 274: bool lcls_enable;
i don't see this flag being used anywhere. It gets initialized to 1 at some 
point but never has any effect, right? (also, the VLR is not the right place to 
put an LCLS flag)
I think we can drop the flag until a need arises...


https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/src/libmsc/gsm_04_08_cc.c
File src/libmsc/gsm_04_08_cc.c:

https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/src/libmsc/gsm_04_08_cc.c@503
PS12, Line 503: trans->lcls = trans_lcls_compose(trans, true);
(if (!trans->lcls), log a comment that composing LCLS info failed?)


https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/src/libmsc/gsm_04_08_cc.c@1984
PS12, Line 1984:trans->lcls->gcr = trans->cc.msg.gcr;
> Might be worth placing in a comment here that this is happing as a result of 
> Paging success, so we n […]
imho above comment is sufficient


https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/src/libmsc/mncc_builtin.c
File src/libmsc/mncc_builtin.c:

https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/src/libmsc/mncc_builtin.c@72
PS12, Line 72:struct osmo_gcr_parsed gcr)
setup->gcr == gcr, there should be no need to add another argument.

(BTW, passing a struct as argument must always be done as a pointer)


https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/src/libmsc/mncc_builtin.c@116
PS12, Line 116: setup->gcr = gcr;
afaict the same gcr is already in there, just leave it up to the caller and not 
bother here


https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/src/libmsc/mncc_builtin.c@310
PS12, Line 310: rc = mncc_setup_ind(call, arg, data->gcr);
arg and data are pointers to the same MNCC struct, it shouldn't be necessary to 
add another arg


https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/src/libmsc/transaction.c
File src/libmsc/transaction.c:

https://gerrit.osmocom.org/c/osmo-msc/+/13422/12/src/libmsc/transaction.c@117
PS12, Line 117:Can we get primary_pc elsewhere? */
> Not sure this commment is still valid. […]
i think this comment can be dropped, doesn't seem to convey any useful 
information



--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/13422
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I35ae6b6ca04925c8d300bc1a0269af00eac727f3
Gerrit-Change-Number: 13422
Gerrit-PatchSet: 12
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-CC: neels 
Gerrit-Comment-Date: Wed, 23 Dec 2020 20:31:19 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: keith 
Gerrit-MessageType: comment


Change in osmo-msc[master]: Autofill LCLS parameters for A-interface transactions

2020-12-23 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/13422 )

Change subject: Autofill LCLS parameters for A-interface transactions
..


Patch Set 12:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/13422
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I35ae6b6ca04925c8d300bc1a0269af00eac727f3
Gerrit-Change-Number: 13422
Gerrit-PatchSet: 12
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Wed, 23 Dec 2020 08:53:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-msc[master]: Autofill LCLS parameters for A-interface transactions

2019-03-26 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13422


Change subject: Autofill LCLS parameters for A-interface transactions
..

Autofill LCLS parameters for A-interface transactions

That's experimental patch to facilitate testing of BSC implementation of
LCLS.

Change-Id: I35ae6b6ca04925c8d300bc1a0269af00eac727f3
---
M include/osmocom/msc/debug.h
M include/osmocom/msc/transaction.h
M src/libmsc/a_iface.c
M src/libmsc/transaction.c
4 files changed, 62 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/22/13422/1

diff --git a/include/osmocom/msc/debug.h b/include/osmocom/msc/debug.h
index 28ba482..3d3f5e6 100644
--- a/include/osmocom/msc/debug.h
+++ b/include/osmocom/msc/debug.h
@@ -8,6 +8,7 @@
DCC,
DMM,
DRR,
+   DLCLS,
DMNCC,
DPAG,
DMSC,
diff --git a/include/osmocom/msc/transaction.h 
b/include/osmocom/msc/transaction.h
index 830328b..eb5a0d0 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -108,6 +108,8 @@
 const struct vlr_subscr *vsub,
 uint8_t sm_rp_mr);

+struct osmo_lcls *trans_fill_lcls(const struct gsm_trans *trans, bool use_lac);
+
 struct gsm_trans *trans_alloc(struct gsm_network *net,
  struct vlr_subscr *vsub,
  uint8_t protocol, uint8_t trans_id,
diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c
index 91a2b6a..b707b59 100644
--- a/src/libmsc/a_iface.c
+++ b/src/libmsc/a_iface.c
@@ -425,7 +425,11 @@
memset(&rtp_addr, 0, sizeof(rtp_addr));
memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in));

-   msg = gsm0808_create_ass(&ct, NULL, &rtp_addr, &scl, NULL);
+   LOGPCONN(conn, LOGL_NOTICE, "Preparing LCLS...\n");
+   bool use_lac = true;
+   msg = gsm0808_create_ass2(&ct, NULL, &rtp_addr, &scl, NULL, NULL, 
trans_fill_lcls(trans, use_lac));
+   LOGPCONN(conn, LOGL_DEBUG, "N-DATA.req(%s)\n", msgb_hexdump_l2(msg));
+
return a_iface_tx_bssap(conn, msg);
 }

diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index 66126e6..8aa81c6 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -93,6 +93,60 @@
return NULL;
 }

+struct osmo_lcls *trans_fill_lcls(const struct gsm_trans *trans, bool use_lac)
+{
+   struct osmo_ss7_instance *ss7 = 
osmo_sccp_get_ss7(trans->net->a.sccp);//FIXME: ensure that a interface is in 
use for this transaction
+   struct osmo_lcls *lcls;
+   uint8_t w = osmo_ss7_pc_width(&ss7->cfg.pc_fmt);
+
+   if(!trans->vsub->vlr->cfg.lcls_enabled) {
+   LOGP(DCC, LOGL_NOTICE, "LCLS disabled globally\n");
+   return NULL;
+   }
+
+   if(!trans) {
+   LOGP(DCC, LOGL_ERROR, "LCLS: unable to fill parameters for 
unallocated transaction\n");
+   return NULL;
+   }
+
+   if(!trans->conn) {
+   LOGP(DCC, LOGL_ERROR, "LCLS: unable to fill parameters for 
transaction without connection\n");
+   return NULL;
+   }
+
+   if (trans->conn->via_ran != OSMO_RAT_GERAN_A) {
+   LOGP(DCC, LOGL_ERROR, "LCLS: only A interface is supported at 
the moment\n");
+   return NULL;
+   }
+
+   lcls = talloc_zero(trans, struct osmo_lcls);
+   if (!lcls) {
+   LOGP(DCC, LOGL_ERROR, "LCLS: failed to allocate osmo_lcls\n");
+   return NULL;
+   }
+
+   LOGP(DCC, LOGL_INFO, "LCLS: using %u bits (%u bytes) for node ID\n", w, 
w / 8);
+
+   lcls->gcr.net_len = 3;
+   lcls->gcr.node = ss7->cfg.primary_pc;
+
+   osmo_plmn_to_bcd(lcls->gcr.net, &trans->net->plmn); /* net id from 
Q.1902.3 3-5 bytes, this function gives 3 bytes exactly */
+
+   osmo_store32be(trans->callref, lcls->gcr.cr);
+   osmo_store16be(use_lac ? trans->conn->lac : trans->conn->ci, 
lcls->gcr.cr + 3);
+
+   LOGP(DCC, LOGL_INFO, "LCLS: allocated %s-based CR-ID %s\n", use_lac ? 
"LAC" : "CI", osmo_hexdump(lcls->gcr.cr, 5));
+
+   lcls->config = GSM0808_LCLS_CFG_BOTH_WAY;
+   lcls->control = GSM0808_LCLS_CSC_CONNECT;
+   lcls->corr_needed = true;
+   lcls->gcr_available = true;
+
+   LOGP(DCC, LOGL_INFO, "Filled %s, %s\n", osmo_lcls_dump(lcls), 
osmo_gcr_dump(lcls));
+
+   return lcls;
+}
+
 /*! Allocate a new transaction and add it to network list
  *  \param[in] net Netwokr in which we allocate transaction
  *  \param[in] subscr Subscriber for which we allocate transaction

--
To view, visit https://gerrit.osmocom.org/13422
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I35ae6b6ca04925c8d300bc1a0269af00eac727f3
Gerrit-Change-Number: 13422
Gerri