osmo-ttcn3-hacks[master]: MNCC: Represent 'keypad' as one-character charstring, not int

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6268
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id17ac502ca33f4962214a3d5938d0dc29ca6ec1b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: MNCC: Represent 'keypad' as one-character charstring, not int

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: MNCC: Represent 'keypad' as one-character charstring, not int
..


MNCC: Represent 'keypad' as one-character charstring, not int

The MNCC Unix Domain Socket encoding uses an int here, which is
a bit odd, given that it's an ASCII / IA5 char value on the actual
GSM L3.  Let's convert from/to something useful.

Change-Id: Id17ac502ca33f4962214a3d5938d0dc29ca6ec1b
---
M library/MNCC_EncDec.cc
M library/MNCC_Types.ttcn
2 files changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc
index 2c68cb1..fef2a40 100644
--- a/library/MNCC_EncDec.cc
+++ b/library/MNCC_EncDec.cc
@@ -155,8 +155,8 @@
mncc.fields |= MNCC_F_SIGNAL;
}
if (in_sig.keypad().is_value()) {
-   const INTEGER  = in_sig.keypad();
-   mncc.signal = kpd;
+   const CHARSTRING  = in_sig.keypad();
+   mncc.signal = (int) kpd[0].get_char();
mncc.fields |= MNCC_F_KEYPAD;
}
mncc.more = in_sig.more();
@@ -292,8 +292,10 @@
sign.ssversion() = CHARSTRING(in_mncc->ssversion.info);
if (in_mncc->fields & MNCC_F_CCCAP)
sign.cccap() = MNCC__cccap(in_mncc->cccap.dtmf, 
in_mncc->cccap.pcp);
-   if (in_mncc->fields & MNCC_F_KEYPAD)
-   sign.keypad() = in_mncc->keypad;
+   if (in_mncc->fields & MNCC_F_KEYPAD) {
+   char kpd[2] = { (char) in_mncc->keypad, 0 };
+   sign.keypad() = CHARSTRING(kpd);
+   }
if (in_mncc->fields & MNCC_F_SIGNAL)
sign.signal() = in_mncc->signal;
 
diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn
index 258db3f..bc7c4e6 100644
--- a/library/MNCC_Types.ttcn
+++ b/library/MNCC_Types.ttcn
@@ -303,7 +303,7 @@
 };
 
 type int MNCC_notify (0..127);
-type int MNCC_keypad (0..127);
+type charstring MNCC_keypad length (1);
 
 type enumerated MNCC_bcap {
GSM_MNCC_BCAP_SPEECH(0),

-- 
To view, visit https://gerrit.osmocom.org/6268
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id17ac502ca33f4962214a3d5938d0dc29ca6ec1b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-ttcn3-hacks[master]: MNCC: Represent 'keypad' as one-character charstring, not int

2018-02-03 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6268

MNCC: Represent 'keypad' as one-character charstring, not int

The MNCC Unix Domain Socket encoding uses an int here, which is
a bit odd, given that it's an ASCII / IA5 char value on the actual
GSM L3.  Let's convert from/to something useful.

Change-Id: Id17ac502ca33f4962214a3d5938d0dc29ca6ec1b
---
M library/MNCC_EncDec.cc
M library/MNCC_Types.ttcn
2 files changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/68/6268/1

diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc
index 2c68cb1..fef2a40 100644
--- a/library/MNCC_EncDec.cc
+++ b/library/MNCC_EncDec.cc
@@ -155,8 +155,8 @@
mncc.fields |= MNCC_F_SIGNAL;
}
if (in_sig.keypad().is_value()) {
-   const INTEGER  = in_sig.keypad();
-   mncc.signal = kpd;
+   const CHARSTRING  = in_sig.keypad();
+   mncc.signal = (int) kpd[0].get_char();
mncc.fields |= MNCC_F_KEYPAD;
}
mncc.more = in_sig.more();
@@ -292,8 +292,10 @@
sign.ssversion() = CHARSTRING(in_mncc->ssversion.info);
if (in_mncc->fields & MNCC_F_CCCAP)
sign.cccap() = MNCC__cccap(in_mncc->cccap.dtmf, 
in_mncc->cccap.pcp);
-   if (in_mncc->fields & MNCC_F_KEYPAD)
-   sign.keypad() = in_mncc->keypad;
+   if (in_mncc->fields & MNCC_F_KEYPAD) {
+   char kpd[2] = { (char) in_mncc->keypad, 0 };
+   sign.keypad() = CHARSTRING(kpd);
+   }
if (in_mncc->fields & MNCC_F_SIGNAL)
sign.signal() = in_mncc->signal;
 
diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn
index 258db3f..bc7c4e6 100644
--- a/library/MNCC_Types.ttcn
+++ b/library/MNCC_Types.ttcn
@@ -303,7 +303,7 @@
 };
 
 type int MNCC_notify (0..127);
-type int MNCC_keypad (0..127);
+type charstring MNCC_keypad length (1);
 
 type enumerated MNCC_bcap {
GSM_MNCC_BCAP_SPEECH(0),

-- 
To view, visit https://gerrit.osmocom.org/6268
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id17ac502ca33f4962214a3d5938d0dc29ca6ec1b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[MERGED] libosmocore[master]: gsm48_hdr_msg_type(): SS is in the same group as MM/CC

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: gsm48_hdr_msg_type(): SS is in the same group as MM/CC
..


gsm48_hdr_msg_type(): SS is in the same group as MM/CC

Change-Id: I1ddadeacced9650885f454b81f3f0df531ea1e5d
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h 
b/include/osmocom/gsm/protocol/gsm_04_08.h
index 4fb8a7f..c785d9f 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -1017,8 +1017,8 @@
switch (gsm48_hdr_pdisc(hdr)) {
case GSM48_PDISC_MM:
case GSM48_PDISC_CC:
-   return hdr->msg_type & 0x3f;
case GSM48_PDISC_NC_SS:
+   return hdr->msg_type & 0x3f;
case GSM48_PDISC_GROUP_CC:
case GSM48_PDISC_BCAST_CC:
case GSM48_PDISC_LOC:

-- 
To view, visit https://gerrit.osmocom.org/6266
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ddadeacced9650885f454b81f3f0df531ea1e5d
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] libosmocore[master]: gsm48_hdr_msg_type[_r99]: Fix bit-masks

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: gsm48_hdr_msg_type[_r99]: Fix bit-masks
..


gsm48_hdr_msg_type[_r99]: Fix bit-masks

TS 24.007 is quite clear: The upper two bits of the message type
octet are *not* part of the message type in any of the L3 protocols
which implement sequence numbers.  it doesn't matter if it's R98 or
R99, or whether the sequence number is 1bit or 2bits wide.

Related: OS#2908
Change-Id: Iec875a77f5458322dfbef174f5abfc0e8c09d464
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 2 insertions(+), 2 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 e54084f..4fb8a7f 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -1001,7 +1001,7 @@
case GSM48_PDISC_GROUP_CC:
case GSM48_PDISC_BCAST_CC:
case GSM48_PDISC_LOC:
-   return hdr->msg_type & 0xbf;
+   return hdr->msg_type & 0x3f;
default:
return hdr->msg_type;
}
@@ -1022,7 +1022,7 @@
case GSM48_PDISC_GROUP_CC:
case GSM48_PDISC_BCAST_CC:
case GSM48_PDISC_LOC:
-   return hdr->msg_type & 0xbf;
+   return hdr->msg_type & 0x3f;
default:
return hdr->msg_type;
}

-- 
To view, visit https://gerrit.osmocom.org/6265
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec875a77f5458322dfbef174f5abfc0e8c09d464
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


libosmocore[master]: gsm48_hdr_msg_type(): SS is in the same group as MM/CC

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6266
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1ddadeacced9650885f454b81f3f0df531ea1e5d
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: gsm48_hdr_msg_type[_r99]: Fix bit-masks

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6265
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iec875a77f5458322dfbef174f5abfc0e8c09d464
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-msc[master]: Implement checks for duplicate uplink UL L3 message

2018-02-03 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6267

Implement checks for duplicate uplink UL L3 message

According to TS 24.007 Section 11.2.3.2.3, it is possible that uplink L3
messages are duplicated in some scenarios, particularly during
assignment/handover procedure.

To avoid L3 entities from seeing duplicated messages, there's a modulo-2
or modulo-4 message sequence counter, based on which the MSC can detect
and suppress such duplicate messages.

It appears that even our unit tests were wrong in that regard so far.
Rather than manually adjusting each and every message, let's make sure
that the sequence number generation always increments as expected, and
that during matching of incoming messages, sequence numbers are masked
out.

Note: the tests will only pass from libosmocore Change-Id
Iec875a77f5458322dfbef174f5abfc0e8c09d464 onwards, due to
gsm48_hdr_msg_type() being broken in earlier versions.

Change-Id: Id15e399ab7e1b05dcd426b292886fa19d36082b1
Closes: #2908
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/gsm_04_08.c
M tests/msc_vlr/msc_vlr_tests.c
3 files changed, 137 insertions(+), 0 deletions(-)


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

diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 27324d7..16e83f3 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -184,6 +184,9 @@
uint16_t lac;
struct gsm_encr encr;
 
+   /* N(SD) expected in the received frame, per flow (TS 24.007 
11.2.3.2.3.2.2) */
+   uint8_t n_sd_next[4];
+
struct {
unsigned int mgcp_rtp_endpoint;
uint16_t port_subscr;
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index c9ea2c8..5acc4e4 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -3302,6 +3302,94 @@
conn->received_cm_service_request = false;
 }
 
+/* TS 24.007 11.2.3.2.3 Message Type Octet / Duplicate Detection */
+int gsm0407_pdisc_ctr_bin(uint8_t pdisc)
+{
+   switch (pdisc) {
+   case GSM48_PDISC_MM:
+   case GSM48_PDISC_CC:
+   case GSM48_PDISC_NC_SS:
+   return 0;
+   case GSM48_PDISC_GROUP_CC:
+   return 1;
+   case GSM48_PDISC_BCAST_CC:
+   return 2;
+   case GSM48_PDISC_LOC:
+   return 3;
+   default:
+   return -1;
+   }
+}
+
+/* extract the N(SD) and return the modulo value for a R98 message */
+static uint8_t gsm0407_determine_nsd_ret_modulo_r99(uint8_t pdisc, uint8_t 
msg_type, uint8_t *n_sd)
+{
+   switch (pdisc) {
+   case GSM48_PDISC_MM:
+   case GSM48_PDISC_CC:
+   case GSM48_PDISC_NC_SS:
+   *n_sd = (msg_type >> 6) & 0x3;
+   return 4;
+   case GSM48_PDISC_GROUP_CC:
+   case GSM48_PDISC_BCAST_CC:
+   case GSM48_PDISC_LOC:
+   *n_sd = (msg_type >> 6) & 0x1;
+   return 2;
+   default:
+   /* no sequence number, we cannot detect dups */
+   return 0;
+   }
+}
+
+/* extract the N(SD) and return the modulo value for a R99 message */
+static uint8_t gsm0407_determine_nsd_ret_modulo_r98(uint8_t pdisc, uint8_t 
msg_type, uint8_t *n_sd)
+{
+   switch (pdisc) {
+   case GSM48_PDISC_MM:
+   case GSM48_PDISC_CC:
+   case GSM48_PDISC_NC_SS:
+   case GSM48_PDISC_GROUP_CC:
+   case GSM48_PDISC_BCAST_CC:
+   case GSM48_PDISC_LOC:
+   *n_sd = (msg_type >> 6) & 0x1;
+   return 2;
+   default:
+   /* no sequence number, we cannot detect dups */
+   return 0;
+   }
+}
+
+/* TS 24.007 11.2.3.2 Message Type Octet / Duplicate Detection */
+static bool gsm0407_is_duplicate(struct gsm_subscriber_connection *conn, 
struct msgb *msg)
+{
+   struct gsm48_hdr *gh;
+   uint8_t pdisc;
+   uint8_t n_sd, modulo, bin;
+
+   gh = msgb_l3(msg);
+   pdisc = gsm48_hdr_pdisc(gh);
+
+   if (conn->classmark.classmark1_set && 
conn->classmark.classmark1.rev_lev < 2) {
+   modulo = gsm0407_determine_nsd_ret_modulo_r98(pdisc, 
gh->msg_type, _sd);
+   } else { /* R99 */
+   modulo = gsm0407_determine_nsd_ret_modulo_r99(pdisc, 
gh->msg_type, _sd);
+   }
+   if (modulo == 0)
+   return false;
+   bin = gsm0407_pdisc_ctr_bin(pdisc);
+   if (bin < 0)
+   return false;
+
+   OSMO_ASSERT(bin < ARRAY_SIZE(conn->n_sd_next));
+   if (n_sd != conn->n_sd_next[bin]) {
+   /* not what we expected: duplicate */
+   return true;
+   } else {
+   /* as expected: no dup; update expected counter for next 
message */
+   conn->n_sd_next[bin] = (n_sd + 1) % modulo;
+   return false;
+   }
+}
 
 /* Main entry point for GSM 04.08/44.008 Layer 3 data (e.g. from the BSC). */
 int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg)
@@ -3317,6 +3405,12 @@
  

[PATCH] libosmocore[master]: gsm48_hdr_msg_type[_r99]: Fix bit-masks

2018-02-03 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6265

gsm48_hdr_msg_type[_r99]: Fix bit-masks

TS 24.007 is quite clear: The upper two bits of the message type
octet are *not* part of the message type in any of the L3 protocols
which implement sequence numbers.  it doesn't matter if it's R98 or
R99, or whether the sequence number is 1bit or 2bits wide.

Related: OS#2908
Change-Id: Iec875a77f5458322dfbef174f5abfc0e8c09d464
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/65/6265/1

diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h 
b/include/osmocom/gsm/protocol/gsm_04_08.h
index e54084f..4fb8a7f 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -1001,7 +1001,7 @@
case GSM48_PDISC_GROUP_CC:
case GSM48_PDISC_BCAST_CC:
case GSM48_PDISC_LOC:
-   return hdr->msg_type & 0xbf;
+   return hdr->msg_type & 0x3f;
default:
return hdr->msg_type;
}
@@ -1022,7 +1022,7 @@
case GSM48_PDISC_GROUP_CC:
case GSM48_PDISC_BCAST_CC:
case GSM48_PDISC_LOC:
-   return hdr->msg_type & 0xbf;
+   return hdr->msg_type & 0x3f;
default:
return hdr->msg_type;
}

-- 
To view, visit https://gerrit.osmocom.org/6265
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec875a77f5458322dfbef174f5abfc0e8c09d464
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] libosmocore[master]: gsm48_hdr_msg_type(): SS is in the same group as MM/CC

2018-02-03 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6266

gsm48_hdr_msg_type(): SS is in the same group as MM/CC

Change-Id: I1ddadeacced9650885f454b81f3f0df531ea1e5d
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/6266/1

diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h 
b/include/osmocom/gsm/protocol/gsm_04_08.h
index 4fb8a7f..c785d9f 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -1017,8 +1017,8 @@
switch (gsm48_hdr_pdisc(hdr)) {
case GSM48_PDISC_MM:
case GSM48_PDISC_CC:
-   return hdr->msg_type & 0x3f;
case GSM48_PDISC_NC_SS:
+   return hdr->msg_type & 0x3f;
case GSM48_PDISC_GROUP_CC:
case GSM48_PDISC_BCAST_CC:
case GSM48_PDISC_LOC:

-- 
To view, visit https://gerrit.osmocom.org/6266
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ddadeacced9650885f454b81f3f0df531ea1e5d
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


osmo-bts[master]: Name systemd service after the software

2018-02-03 Thread Harald Welte

Patch Set 2:

What about these service file renames?

-- 
To view, visit https://gerrit.osmocom.org/2225
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie336292c275e7415a1deedab7c3b44966aacc3bf
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


openbsc[master]: gprs/gprs_gmm: implement T3314. Timeout to reset MM state to...

2018-02-03 Thread Harald Welte

Patch Set 2:

Would  be great to revivr this. Test could be in ttcn3

-- 
To view, visit https://gerrit.osmocom.org/1762
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4ce23ebe50d141076c20c9c56990b7103cd25e55
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: No


[ABANDON] libosmo-sccp[master]: Add selector for ANSI or ITU variant

2018-02-03 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: Add selector for ANSI or ITU variant
..


Abandoned

No feedback from submitter

-- 
To view, visit https://gerrit.osmocom.org/73
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ia17eef8c9b7d8e1092c587f469b4a68aa9702651
Gerrit-PatchSet: 6
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Arran Cudbard-bell 
Gerrit-Reviewer: Arran Cudbard-bell 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder


osmo-pcu[master]: Move EGPRS WS computation to C code

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/6241
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie411ea2bbfca442b33405584f15687a7ffcbb53c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: GSUP: add helper wrapper for setting IMSI

2018-02-03 Thread Harald Welte

Patch Set 1:

Ping?

-- 
To view, visit https://gerrit.osmocom.org/6197
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I03d0d3d32a8d572ad573d03c603e14cdc27a3f7b
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-pcu[master]: TBF: move common test code into functions

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/6240
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c4ad1dc94542835f15bd666f0821e0ccfcc78c1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-pcu[master]: TBF: add helpers for assignment type handling

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: TBF: add helpers for assignment type handling
..


TBF: add helpers for assignment type handling

* add function to set/unset given assignment type
* log assignment type flag changes
* update tests output with additional logs

This enables us to carefully track the TBF assignment type transitions.

Change-Id: I3fe9d52472be8b7f257e8326b2f84e8e7d7bd1f4
Related: OS#1759
---
M src/bts.cpp
M src/tbf.h
M src/tbf_dl.cpp
M tests/tbf/TbfTest.err
4 files changed, 86 insertions(+), 10 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/bts.cpp b/src/bts.cpp
index 72e1621..3d29ad6 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -759,7 +759,7 @@
} else {
tbf->set_ta(ta);
TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW);
-   tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH);
+   TBF_ASS_TYPE_SET(tbf, GPRS_RLCMAC_FLAG_CCCH);
T_START(tbf, T3169, m_bts.t3169, 0, "RACH (new 
UL-TBF)", true);
LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] START\n");
LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] RACH "
@@ -1042,7 +1042,7 @@
LOGPTBF(new_tbf, LOGL_INFO,
"The TBF has been confirmed on the PACCH, "
"changed type from CCCH to PACCH\n");
-   new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH);
+   TBF_ASS_TYPE_SET(new_tbf, GPRS_RLCMAC_FLAG_PACCH);
}
TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW);
/* stop pending assignment timer */
diff --git a/src/tbf.h b/src/tbf.h
index 803ea33..2ed63f9 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -191,6 +191,8 @@
 #define TBF_POLL_SCHED_SET(t) do { t->poll_sched_set(__FILE__, __LINE__); } 
while(0)
 #define TBF_POLL_SCHED_UNSET(t) do { t->poll_sched_unset(__FILE__, __LINE__); 
} while(0)
 #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, 
__LINE__); } while(0)
+#define TBF_ASS_TYPE_SET(t, kind) do { t->ass_type_mod(kind, false, __FILE__, 
__LINE__); } while(0)
+#define TBF_ASS_TYPE_UNSET(t, kind) do { t->ass_type_mod(kind, true, __FILE__, 
__LINE__); } while(0)
 
 struct gprs_rlcmac_tbf {
gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir);
@@ -213,6 +215,7 @@
void check_pending_ass();
bool check_n_clear(uint8_t state_flag);
void set_assigned_on(uint8_t state_flag, bool check_ccch, const char 
*file, int line);
+   void ass_type_mod(uint8_t t, bool unset, const char *file, int line);
const char *state_name() const;
 
const char *name() const;
@@ -422,11 +425,57 @@
set_state(GPRS_RLCMAC_ASSIGN, file, line);
if (check_ccch) {
if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)))
-   state_flags |= (1 << state_flag);
+   ass_type_mod(state_flag, false, file, line);
} else
state_flags |= (1 << state_flag);
 }
 
+inline void gprs_rlcmac_tbf::ass_type_mod(uint8_t t, bool unset, const char 
*file, int line)
+{
+   const char *ch = "UNKNOWN";
+   switch (t) {
+   case GPRS_RLCMAC_FLAG_CCCH:
+   if (unset) {
+   if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)))
+   return;
+   } else {
+   if (state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))
+   LOGPSRC(DTBF, LOGL_ERROR, file, line,
+   "%s attempted to set ass. type CCCH 
which is already set.\n",
+   tbf_name(this));
+   }
+   ch = "CCCH";
+   break;
+   case GPRS_RLCMAC_FLAG_PACCH:
+   if (unset) {
+   if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH)))
+   return;
+   } else {
+   if (state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH))
+   LOGPSRC(DTBF, LOGL_ERROR, file, line,
+   "%s attempted to set ass. type PACCH 
which is already set.\n",
+   tbf_name(this));
+   }
+   ch = "PACCH";
+   break;
+   default:
+   LOGPSRC(DTBF, LOGL_ERROR, file, line, "%s attempted to %sset 
unexpected ass. type %d - FIXME!\n",
+   tbf_name(this), unset ? "un" : "", t);
+   return;
+   }
+
+   LOGPSRC(DTBF, LOGL_INFO, file, line, "%s %sset ass. type %s [prev 
CCCH:%u, PACCH:%u]\n",
+   tbf_name(this), unset ? "un" : "", ch,
+   state_flags & (1 << 

[MERGED] osmo-pcu[master]: vty: drop unused function

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: vty: drop unused function
..


vty: drop unused function

Change-Id: I01f3773ca6a9b6d4e28ca2f59c944c6d48918dd1
---
M src/pcu_vty.c
M src/pcu_vty_functions.cpp
M src/pcu_vty_functions.h
3 files changed, 1 insertion(+), 7 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index dff331f..5c3f625 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -265,7 +265,7 @@
}
}
 
-   return pcu_vty_config_write_pcu_ext(vty);
+   return CMD_SUCCESS;
 }
 
 /* per-BTS configuration */
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index bb341f8..41165f3 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -34,11 +34,6 @@
 #include 
 }
 
-int pcu_vty_config_write_pcu_ext(struct vty *vty)
-{
-   return CMD_SUCCESS;
-}
-
 static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf)
 {
gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf);
diff --git a/src/pcu_vty_functions.h b/src/pcu_vty_functions.h
index 35acf64..470df0e 100644
--- a/src/pcu_vty_functions.h
+++ b/src/pcu_vty_functions.h
@@ -27,7 +27,6 @@
 struct vty;
 struct gprs_rlcmac_bts;
 
-int pcu_vty_config_write_pcu_ext(struct vty *vty);
 int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data);
 int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data);
 int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts_data,

-- 
To view, visit https://gerrit.osmocom.org/6208
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I01f3773ca6a9b6d4e28ca2f59c944c6d48918dd1
Gerrit-PatchSet: 3
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-pcu[master]: TBF: show assignment kind in vty

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: TBF: show assignment kind in vty
..


TBF: show assignment kind in vty

Change-Id: Ic4e40d9c141ab7ee3f7c4dceec007dbe16359f93
Related: OS#1759
---
M src/pcu_vty_functions.cpp
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index eb15aa6..bb341f8 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -49,9 +49,11 @@
tbf->ta(),
tbf->direction == GPRS_RLCMAC_UL_TBF ? "UL" : "DL",
tbf->imsi(), VTY_NEWLINE);
-   vty_out(vty, " created=%lu state=%08x 1st_TS=%d 1st_cTS=%d ctrl_TS=%d "
-   "MS_CLASS=%d/%d%s",
-   tbf->created_ts(), tbf->state_flags, tbf->first_ts,
+   vty_out(vty, " created=%lu state=%08x [CCCH:%u, PACCH:%u] 1st_TS=%d 
1st_cTS=%d ctrl_TS=%d MS_CLASS=%d/%d%s",
+   tbf->created_ts(), tbf->state_flags,
+   tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH),
+   tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH),
+   tbf->first_ts,
tbf->first_common_ts, tbf->control_ts,
tbf->ms_class(),
tbf->ms() ? tbf->ms()->egprs_ms_class() : -1,

-- 
To view, visit https://gerrit.osmocom.org/6207
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic4e40d9c141ab7ee3f7c4dceec007dbe16359f93
Gerrit-PatchSet: 3
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-pcu[master]: TBF: decrease logging verbosity for traffic

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: TBF: decrease logging verbosity for traffic
..


TBF: decrease logging verbosity for traffic

Change-Id: If43aa9895abf58602556c986a633ff93a6f00b06
---
M src/tbf_dl.cpp
M src/tbf_ul.cpp
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index e8aec23..0587a4a 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -517,7 +517,7 @@
if (!msg)
return;
 
-   LOGPTBFDL(this, LOGL_INFO, "Dequeue next LLC (len=%d)\n", msg->len);
+   LOGPTBFDL(this, LOGL_DEBUG, "Dequeue next LLC (len=%d)\n", msg->len);
 
m_llc.put_frame(msg->data, msg->len);
bts->llc_frame_sched();
@@ -599,7 +599,7 @@
if (ar == Encoding::AR_NEED_MORE_BLOCKS)
break;
 
-   LOGPTBFDL(this, LOGL_INFO, "Complete DL frame, len=%d\n", 
m_llc.frame_length());
+   LOGPTBFDL(this, LOGL_DEBUG, "Complete DL frame, len=%d\n", 
m_llc.frame_length());
gprs_rlcmac_dl_bw(this, m_llc.frame_length());
bts->llc_dl_bytes(m_llc.frame_length());
m_llc.reset();
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 1560eb0..46d4d12 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -84,7 +84,7 @@
 
if (frame->is_complete) {
/* send frame to SGSN */
-   LOGPTBFUL(this, LOGL_INFO, "complete UL frame 
len=%d\n", m_llc.frame_length());
+   LOGPTBFUL(this, LOGL_DEBUG, "complete UL frame 
len=%d\n", m_llc.frame_length());
snd_ul_ud();
bts->llc_ul_bytes(m_llc.frame_length());
m_llc.reset();

-- 
To view, visit https://gerrit.osmocom.org/6199
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If43aa9895abf58602556c986a633ff93a6f00b06
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-pcu[master]: vty: add commands to show TBF of a certain kind

2018-02-03 Thread Harald Welte

Patch Set 1:

Could be one command with (all|pacch|...)

-- 
To view, visit https://gerrit.osmocom.org/6239
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-pcu[master]: vty: drop unused function

2018-02-03 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6208
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I01f3773ca6a9b6d4e28ca2f59c944c6d48918dd1
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-pcu[master]: TBF: add helpers for assignment type handling

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6206
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3fe9d52472be8b7f257e8326b2f84e8e7d7bd1f4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-pcu[master]: TBF: show assignment kind in vty

2018-02-03 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6207
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic4e40d9c141ab7ee3f7c4dceec007dbe16359f93
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-pcu[master]: TBF: decrease logging verbosity for traffic

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6199
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If43aa9895abf58602556c986a633ff93a6f00b06
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmocom-bb[master]: Import gprsdecode utility

2018-02-03 Thread Harald Welte

Patch Set 1:

I'll leave it up to vadim. Once vadim is happy, let me know for some final 
review and hopefully +2

-- 
To view, visit https://gerrit.osmocom.org/5992
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I12234d37c66b83b8abd60f7511fa1d7837db1856
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: fixeria 
Gerrit-HasComments: No


osmo-mgw[master]: ep: move endpoint struct and define to mgcp_ep.h

2018-02-03 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6244
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibae55e1859bd41e2d1918eda433418b4bf8365fe
Gerrit-PatchSet: 3
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-mgw[master]: protocol: prohibit wildcarded requests for MDCX and DLCX

2018-02-03 Thread Harald Welte

Patch Set 2: Code-Review-1

Copy,+paste error, DLCX used in MDCX api call

-- 
To view, visit https://gerrit.osmocom.org/6260
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia77d44a6a86083e62338e5845b553e5cf13ebd10
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-mgw[master]: protocol: fix tagging of wildcarded requests

2018-02-03 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6259
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia5063ec65f5bc3a8a0943d1fd823aaeee20b8637
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-mgw[master]: protocol: check requested connection mode

2018-02-03 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6258
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6ab01855d3b1faa36aebac357e7b97c563990678
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-mgw[master]: protocol: exit cleanly when local cx options check fails

2018-02-03 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6256
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaef4ea6c6a2f24ac8b276966bda72d0b30f25cd5
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-mgw[master]: protocol: reject DLCX/CRCX/MDCX on unsupported parameters

2018-02-03 Thread Harald Welte

Patch Set 2: Code-Review-1

Copy+paste error, uses CRCX in the response function call even for mdcx or dlcx

-- 
To view, visit https://gerrit.osmocom.org/6255
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8cd5987fc6befcd53a7c4916f77b1a24c904ba48
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-mgw[master]: cosmetic: rename mgcp_ep.c/h to mgcp_endp.c/h

2018-02-03 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6246
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id52047bb2d0407655ac272c858ed3412b8ae9e6d
Gerrit-PatchSet: 3
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-mgw[master]: cosmetic: rename mgcp_release_endp to mgcp_endp_release

2018-02-03 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6245
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I22e938e702f57ad76d38c9f4a1370b110ac1ba11
Gerrit-PatchSet: 3
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-mgw[master]: protocol: on wildcarded CRCX return endpoint number as hex

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: protocol: on wildcarded CRCX return endpoint number as hex
..


protocol: on wildcarded CRCX return endpoint number as hex

When a wildcarded CRCX is done, then the endpoint number is
returned as unsigned integer (%u). This results into problems
with endpoint numbers higher than 9.

- Return endpoint identifier with the endpoint number in
  hexadecimal representation

Change-Id: I504f4658c193009347753b15256dbb46b32ad5a4
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 709c04a..3f1594f 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -201,7 +201,7 @@
/* NOTE: Only in the virtual trunk we allow dynamic endpoint names */
if (endp->wildcarded_crcx
&& endp->tcfg->trunk_type == MGCP_TRUNK_VIRTUAL) {
-   rc = msgb_printf(msg, "Z: %s%u@%s\r\n",
+   rc = msgb_printf(msg, "Z: %s%x@%s\r\n",
 MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK,
 ENDPOINT_NUMBER(endp), endp->cfg->domain);
if (rc < 0)

-- 
To view, visit https://gerrit.osmocom.org/6242
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I504f4658c193009347753b15256dbb46b32ad5a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-mgw[master]: cosmetic: move mgcp_release_endp() to mgcp_ep.c

2018-02-03 Thread Harald Welte

Patch Set 4: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6008
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0a65b6e906c52a9e7cd75c88c4cbe1bf473b866b
Gerrit-PatchSet: 4
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-mgw[master]: msg: fix response code on exhausted endp resources

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: msg: fix response code on exhausted endp resources
..


msg: fix response code on exhausted endp resources

When all endpoints are seized and a call agent tries to allocate
another one, then 500 is returned as response code, which means
that the endpoint was not found. This does not match.

- Return 403 which is defined as "Insufficient resources available
  at this time"

Change-Id: Idf241b47e711e35e9f9b5a43f3cea5c0298ea30b
---
M src/libosmo-mgcp/mgcp_msg.c
1 file changed, 19 insertions(+), 7 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index 3aa93b7..4055a0c 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -224,11 +224,15 @@
 /* Search the endpoint pool for the endpoint that had been selected via the
  * MGCP message (helper function for mgcp_analyze_header()) */
 static struct mgcp_endpoint *find_endpoint(struct mgcp_config *cfg,
-  const char *mgcp)
+  const char *mgcp,
+  int *cause)
 {
char *endptr = NULL;
unsigned int gw = INT_MAX;
const char *endpoint_number_str;
+   struct mgcp_endpoint *endp;
+
+   *cause = 0;
 
/* Check if the domainname in the request is correct */
if (check_domain_name(cfg, mgcp)) {
@@ -237,8 +241,12 @@
}
 
/* Check if the E1 trunk is requested */
-   if (strncmp(mgcp, "ds/e1", 5) == 0)
-   return find_e1_endpoint(cfg, mgcp);
+   if (strncmp(mgcp, "ds/e1", 5) == 0) {
+   endp = find_e1_endpoint(cfg, mgcp);
+   if (!endp)
+   *cause = -500;
+   return endp;
+   }
 
/* Check if the virtual trunk is addressed (new, correct way with 
prefix) */
if (strncmp
@@ -247,10 +255,12 @@
endpoint_number_str =
mgcp + strlen(MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK);
if (endpoint_number_str[0] == '*') {
-   return find_free_endpoint(cfg->trunk.endpoints,
+   endp = find_free_endpoint(cfg->trunk.endpoints,
  cfg->trunk.number_endpoints);
+   if (!endp)
+   *cause = -403;
+   return endp;
}
-
gw = strtoul(endpoint_number_str, , 16);
if (gw < cfg->trunk.number_endpoints && endptr[0] == '@')
return >trunk.endpoints[gw];
@@ -265,6 +275,7 @@
return >trunk.endpoints[gw];
 
LOGP(DLMGCP, LOGL_ERROR, "Not able to find the endpoint: '%s'\n", mgcp);
+   *cause = -500;
return NULL;
 }
 
@@ -277,6 +288,7 @@
 {
int i = 0;
char *elem, *save = NULL;
+   int cause;
 
/*! This function will parse the header part of the received
 *  MGCP message. The parsing results are stored in pdata.
@@ -294,11 +306,11 @@
pdata->trans = elem;
break;
case 1:
-   pdata->endp = find_endpoint(pdata->cfg, elem);
+   pdata->endp = find_endpoint(pdata->cfg, elem, );
if (!pdata->endp) {
LOGP(DLMGCP, LOGL_ERROR,
 "Unable to find Endpoint `%s'\n", elem);
-   return -500;
+   return cause;
}
break;
case 2:

-- 
To view, visit https://gerrit.osmocom.org/6243
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idf241b47e711e35e9f9b5a43f3cea5c0298ea30b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-mgw[master]: msg: fix response code on exhausted endp resources

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6243
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idf241b47e711e35e9f9b5a43f3cea5c0298ea30b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-mgw[master]: protocol: on wildcarded CRCX return endpoint number as hex

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6242
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I504f4658c193009347753b15256dbb46b32ad5a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-bts[master]: rsl: do not allow MODE MODIFY request with unsupp. codec/rate

2018-02-03 Thread Harald Welte

Patch Set 1:

I think the pointer to the const static array is not sufficient anyway. Think 
of having to set it depending on the DSP firmware version?

-- 
To view, visit https://gerrit.osmocom.org/6097
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: MGCP_Test: test illegal wildcarded DLCX and MDCX

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6264
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I140c6d9e337cd16d6147bb582a9474cf76b5170b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: MCGP_Test: Add tests for wildcarded CRCX

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: MCGP_Test: Add tests for wildcarded CRCX
..


MCGP_Test: Add tests for wildcarded CRCX

The wildcarded CRCX is not tested yet.

- Add a test function that executes a single wildcarded CRCX
  request

- Add a test function that exchausts all MGW resources using
  wildcarded CRCX requests

Change-Id: I70cf486dc21aef19e4199289f5a5509f6927713e
---
M mgw/MGCP_Test.cfg
M mgw/MGCP_Test.ttcn
2 files changed, 72 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/mgw/MGCP_Test.cfg b/mgw/MGCP_Test.cfg
index af59a7c..6eeb9c2 100644
--- a/mgw/MGCP_Test.cfg
+++ b/mgw/MGCP_Test.cfg
@@ -26,6 +26,8 @@
 MGCP_Test.TC_crcx_missing_mode
 MGCP_Test.TC_crcx_unsupp_packet_intv
 MGCP_Test.TC_crcx_sdp
+MGCP_Test.TC_crcx_wildcarded
+MGCP_Test.TC_crcx_wildcarded_exhaust
 MGCP_Test.TC_mdcx_without_crcx
 MGCP_Test.TC_dlcx_without_crcx
 MGCP_Test.TC_crcx_and_dlcx_ep_callid_connid
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index bc3f72e..9cd 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -391,6 +391,74 @@
setverdict(pass);
}
 
+   /* test valid wildcarded CRCX */
+   testcase TC_crcx_wildcarded() runs on dummy_CT {
+   var template MgcpCommand cmd;
+   var MgcpResponse resp;
+   var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "*@" & c_mgw_domain;
+   var MgcpCallId call_id := '1234'H;
+   var MgcpEndpoint ep_assigned;
+   f_init();
+
+   /* create the connection on the MGW */
+   cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id);
+   resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+   extract_conn_id(resp);
+
+   /* extract endpoint name we got assigned by the MGW */
+   var MgcpMessage resp_msg := {
+   response := resp
+   }
+   if (f_mgcp_find_param(resp_msg, "Z", ep_assigned) == false) {
+   setverdict(fail, "No SpecificEndpointName in MGCP 
response", resp);
+   }
+
+   /* clean-up */
+   f_dlcx_ok(ep_assigned, call_id);
+
+   setverdict(pass);
+   }
+
+   /* test valid wildcarded CRCX */
+   testcase TC_crcx_wildcarded_exhaust() runs on dummy_CT {
+   const integer n_endpoints := 32;
+   var integer i;
+   var template MgcpCommand cmd;
+   var MgcpResponse resp;
+   var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "*@" & c_mgw_domain;
+   var MgcpCallId call_id := '1234'H;
+   var MgcpEndpoint ep_assigned[n_endpoints];
+   f_init();
+
+   /* Exhaust all endpoint resources on the virtual trunk */
+   for (i := 0; i < n_endpoints; i := i+1) {
+   cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", 
call_id);
+   resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+
+   /* Make sure we got a connection id */
+   extract_conn_id(resp);
+
+   var MgcpMessage resp_msg := {
+   response := resp
+   }
+   if (f_mgcp_find_param(resp_msg, "Z", ep_assigned[i]) == 
false) {
+   setverdict(fail, "No SpecificEndpointName in 
MGCP response", resp);
+   }
+   }
+
+   /* Try to allocate one more endpoint, which should fail */
+   cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id);
+   var template MgcpResponse rtmpl := tr_MgcpResp_Err("403");
+   resp := mgcp_transceive_mgw(cmd, rtmpl);
+   setverdict(pass);
+
+   /* clean-up */
+   for (i := 0; i < n_endpoints; i := i+1) {
+   f_dlcx_ok(ep_assigned[i], call_id);
+   }
+   setverdict(pass);
+   }
+
/* TODO: various SDP related bits */
 
 
@@ -612,6 +680,8 @@
execute(TC_crcx_unsupp_packet_intv());
execute(TC_crcx_illegal_double_lco());
execute(TC_crcx_sdp());
+   execute(TC_crcx_wildcarded());
+   execute(TC_crcx_wildcarded_exhaust());
execute(TC_mdcx_without_crcx());
execute(TC_dlcx_without_crcx());
execute(TC_crcx_and_dlcx_ep_callid_connid());

-- 
To view, visit https://gerrit.osmocom.org/6262
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I70cf486dc21aef19e4199289f5a5509f6927713e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 

[MERGED] osmo-ttcn3-hacks[master]: mgw: add constants for mgw endpoint and domain name

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: mgw: add constants for mgw endpoint and domain name
..


mgw: add constants for mgw endpoint and domain name

The testcase for osmo-mgw hardcodes the mgw domain and also lacks
an endpoint identifier, which was deprecated recently.

- replace the hardcoded occurrences of the mgw domain name with
  a constant

- add a constant for the rtpbridge endpoint identifier

- add a testcase that still uses the old method without prefix
  on the endpoint identifier.

Change-Id: If4455c4cb521270b2fe24881ade9b578a5132205
---
M mgw/MGCP_Test.cfg
M mgw/MGCP_Test.ttcn
2 files changed, 38 insertions(+), 24 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/mgw/MGCP_Test.cfg b/mgw/MGCP_Test.cfg
index 00e3d7c..af59a7c 100644
--- a/mgw/MGCP_Test.cfg
+++ b/mgw/MGCP_Test.cfg
@@ -18,6 +18,7 @@
 [EXECUTE]
 #MGCP_Test.TC_selftest
 MGCP_Test.TC_crcx
+MGCP_Test.TC_crcx_noprefix
 MGCP_Test.TC_crcx_unsupp_mode
 MGCP_Test.TC_crcx_early_bidir_mode
 MGCP_Test.TC_crcx_unsupp_param
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 516944a..bc3f72e 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -10,6 +10,9 @@
import from RTP_Endpoint all;
import from IPL4asp_Types all;
 
+   const charstring c_mgw_domain := "mgw";
+   const charstring c_mgw_ep_rtpbridge := "rtpbridge/";
+
/* any variables declared in the component will be available to
 * all functions that 'run on' the named component, similar to
 * class members in C++ */
@@ -75,7 +78,7 @@
 
testcase TC_selftest() runs on dummy_CT {
const charstring c_auep := "AUEP 158663169 
ds/e1-1/2@172.16.6.66 MGCP 1.0\r\n";
-   const charstring c_mdcx3 := "MDCX 18983215 1@mgw MGCP 1.0\r\n";
+   const charstring c_mdcx3 := "MDCX 18983215 " & 
c_mgw_ep_rtpbridge & "1@" & c_mgw_domain & " MGCP 1.0\r\n";
const charstring c_mdcx3_ret := "200 18983215 OK\r\n" &
"I: 1\n" &
"\n" &
@@ -87,7 +90,7 @@
"m=audio 0 RTP/AVP 126\r\n" &
"a=rtpmap:126 AMR/8000\r\n" &
"a=ptime:20\r\n";
-   const charstring c_mdcx4 := "MDCX 18983216 1@mgw MGCP 
1.0\r\n" &
+   const charstring c_mdcx4 := "MDCX 18983216 " & 
c_mgw_ep_rtpbridge & "1@" & c_mgw_domain & " MGCP 1.0\r\n" &
"M: sendrecv\r" &
"C: 2\r\n" &
"I: 1\r\n" &
@@ -115,8 +118,8 @@
log(c_mdcx4);
log(dec_MgcpCommand(c_mdcx4));
 
-   log(ts_CRCX("23", "42@mgw", "sendrecv", '1234'H));
-   log(enc_MgcpCommand(valueof(ts_CRCX("23", "42@mgw", "sendrecv", 
'1234'H;
+   log(ts_CRCX("23", c_mgw_ep_rtpbridge & "42@" & c_mgw_domain, 
"sendrecv", '1234'H));
+   log(enc_MgcpCommand(valueof(ts_CRCX("23", c_mgw_ep_rtpbridge & 
"42@" & c_mgw_domain, "sendrecv", '1234'H;
 
log(c_crcx510_ret);
log(dec_MgcpResponse(c_crcx510_ret));
@@ -221,11 +224,10 @@
f_dlcx(ep, ?, *, call_id, conn_id);
}
 
-   /* test valid CRCX without SDP */
-   testcase TC_crcx() runs on dummy_CT {
+   function f_crcx(charstring ep_prefix) runs on dummy_CT {
+   var MgcpEndpoint ep := ep_prefix & "2@" & c_mgw_domain;
var template MgcpCommand cmd;
var MgcpResponse resp;
-   var MgcpEndpoint ep := "2@mgw";
var MgcpCallId call_id := '1234'H;
 
f_init(ep);
@@ -237,7 +239,17 @@
 
/* clean-up */
f_dlcx_ok(ep, call_id);
+   }
 
+   /* test valid CRCX without SDP */
+   testcase TC_crcx() runs on dummy_CT {
+   f_crcx(c_mgw_ep_rtpbridge);
+   setverdict(pass);
+   }
+
+   /* test valid CRCX without SDP (older method without endpoint prefix) */
+   testcase TC_crcx_noprefix() runs on dummy_CT {
+   f_crcx("");
setverdict(pass);
}
 
@@ -245,7 +257,7 @@
testcase TC_crcx_unsupp_mode() runs on dummy_CT {
var template MgcpCommand cmd;
var MgcpResponse resp;
-   var MgcpEndpoint ep := "2@mgw";
+   var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "2@" & c_mgw_domain;
var MgcpCallId call_id := '1233'H;
var template MgcpResponse rtmpl := tr_MgcpResp_Err("517");
 
@@ -262,7 +274,7 @@
testcase TC_crcx_early_bidir_mode() runs on dummy_CT {

[MERGED] osmo-ttcn3-hacks[master]: MGCP_Test: test illegal wildcarded DLCX and MDCX

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: MGCP_Test: test illegal wildcarded DLCX and MDCX
..


MGCP_Test: test illegal wildcarded DLCX and MDCX

- Add tests to check the behaviour on wildcarded DLCX and MDCX,
  both commands not supported by the MGW and should fail.

Change-Id: I140c6d9e337cd16d6147bb582a9474cf76b5170b
---
M mgw/MGCP_Test.cfg
M mgw/MGCP_Test.ttcn
2 files changed, 56 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/mgw/MGCP_Test.cfg b/mgw/MGCP_Test.cfg
index 6eeb9c2..da45761 100644
--- a/mgw/MGCP_Test.cfg
+++ b/mgw/MGCP_Test.cfg
@@ -30,6 +30,8 @@
 MGCP_Test.TC_crcx_wildcarded_exhaust
 MGCP_Test.TC_mdcx_without_crcx
 MGCP_Test.TC_dlcx_without_crcx
+MGCP_Test.TC_mdcx_wildcarded
+MGCP_Test.TC_dlcx_wildcarded
 MGCP_Test.TC_crcx_and_dlcx_ep_callid_connid
 MGCP_Test.TC_crcx_and_dlcx_ep_callid
 MGCP_Test.TC_crcx_and_dlcx_ep
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 6c47e27..9632e79 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -518,6 +518,58 @@
setverdict(pass);
}
 
+   /* test valid wildcarded MDCX */
+   testcase TC_mdcx_wildcarded() runs on dummy_CT {
+/* Note: A wildcarded MDCX is not allowed, so we expect the
+ * MGW to reject this request */
+   var template MgcpCommand cmd;
+   var MgcpResponse resp;
+   var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "*@" & c_mgw_domain;
+   var MgcpCallId call_id := '1225'H;
+   var template MgcpResponse rtmpl := {
+   line := {
+   /* TODO: accept/enforce better error? */
+   code := "507",
+   string := ?
+   },
+   params:= { },
+   sdp := omit
+   };
+
+   f_init(ep);
+
+   cmd := ts_MDCX(get_next_trans_id(), ep, "sendrecv", call_id, 
call_id);
+   cmd.sdp := ts_SDP("127.0.0.1", "127.0.0.2", "23", "42", 2344, { 
"98" },
+ { valueof(ts_SDP_rtpmap(98, "AMR/8000")),
+   valueof(ts_SDP_ptime(20)) });
+   resp := mgcp_transceive_mgw(cmd, rtmpl);
+   setverdict(pass);
+   }
+
+   /* test valid wildcarded DLCX */
+   testcase TC_dlcx_wildcarded() runs on dummy_CT {
+/* Note: A wildcarded DLCX is specified, but our MGW does not
+ * support this feature so we expect the MGW to reject the
+ * request */
+   var template MgcpCommand cmd;
+   var MgcpResponse resp;
+   var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "*@" & c_mgw_domain;
+   var template MgcpResponse rtmpl := {
+   line := {
+   code := "507",
+   string := ?
+   },
+   params:= { },
+   sdp := omit
+   };
+
+   f_init(ep);
+
+   cmd := ts_DLCX(get_next_trans_id(), ep, '41234'H);
+   resp := mgcp_transceive_mgw(cmd, rtmpl);
+   setverdict(pass);
+   }
+
/* Test (valid) CRCX followed by (valid) DLCX containig 
EP+CallId+ConnId */
testcase TC_crcx_and_dlcx_ep_callid_connid() runs on dummy_CT {
var template MgcpCommand cmd;
@@ -688,6 +740,8 @@
execute(TC_crcx_wildcarded_exhaust());
execute(TC_mdcx_without_crcx());
execute(TC_dlcx_without_crcx());
+   execute(TC_mdcx_wildcarded());
+   execute(TC_dlcx_wildcarded());
execute(TC_crcx_and_dlcx_ep_callid_connid());
execute(TC_crcx_and_dlcx_ep_callid());
execute(TC_crcx_and_dlcx_ep());

-- 
To view, visit https://gerrit.osmocom.org/6264
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I140c6d9e337cd16d6147bb582a9474cf76b5170b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-ttcn3-hacks[master]: MGCP_Test: Clean up after TC_crcx_sdp

2018-02-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: MGCP_Test: Clean up after TC_crcx_sdp
..


MGCP_Test: Clean up after TC_crcx_sdp

The testcase TC_crcx_sdp does not clean up the connection it
created. This can cause subsequent tests to fail.

- Use f_dlcx_ok() to clean up the connection once the test
  is done.

Change-Id: I4e0f5ce218fadc5debe0bbf548b69919584ab66c
---
M mgw/MGCP_Test.ttcn
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 9cd..6c47e27 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -388,6 +388,10 @@
  { valueof(ts_SDP_rtpmap(98, "AMR/8000")),
valueof(ts_SDP_ptime(20)) });
resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+
+   /* clean-up */
+   f_dlcx_ok(ep, call_id);
+
setverdict(pass);
}
 

-- 
To view, visit https://gerrit.osmocom.org/6263
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4e0f5ce218fadc5debe0bbf548b69919584ab66c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-ttcn3-hacks[master]: MGCP_Test: Clean up after TC_crcx_sdp

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6263
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4e0f5ce218fadc5debe0bbf548b69919584ab66c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: mgw: add constants for mgw endpoint and domain name

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6261
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If4455c4cb521270b2fe24881ade9b578a5132205
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: MCGP_Test: Add tests for wildcarded CRCX

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6262
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I70cf486dc21aef19e4199289f5a5509f6927713e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-bts[master]: Remove unused variables

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review-1

-- 
To view, visit https://gerrit.osmocom.org/6248
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3fec7e4b337f3ea4d8cd79f4e7261babc34911cb
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-Reviewer: dexter 
Gerrit-HasComments: No


osmo-bts[master]: bts-trx: scheduler_trx.c: Fix missing header

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6249
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I274662cd657ce8c36ed1d262d138590808bfafea
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


osmo-bts[master]: gsm_pchan2chan_nr: move warning to pragma message and track ...

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6247
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I21298fcd0d1c1aafdd3dc1e8c8dae37b271b1d3d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bts[master]: l1sap.c: l1sap_tch_rts_ind: Remove unused variables

2018-02-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6250
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie7cd648a4b8a5ae59efc8953d6424a91a0f025ef
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No