Change in osmo-ttcn3-hacks[master]: L3_Templates; add tr_ML3_MT_MM_AUTH_REQ_3G()

2018-10-28 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11492 )

Change subject: L3_Templates; add tr_ML3_MT_MM_AUTH_REQ_3G()
..

L3_Templates; add tr_ML3_MT_MM_AUTH_REQ_3G()

this allows us to match on specifically 3G MM AUTH REQ, whereas
so far we only had a generic template that matched the 2G and 3G
auth req.

Change-Id: I392d61d1348bee9c88abe4bb938e99b2c3702a94
---
M library/L3_Templates.ttcn
1 file changed, 23 insertions(+), 0 deletions(-)

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



diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index a05aba2..52d4a2a 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -1268,6 +1268,29 @@
}
 }

+template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ_3G(template OCT16 rand := ?, 
template OCT16 autn) := {
+   discriminator := '0101'B,
+   tiOrSkip := {
+   skipIndicator := ''B
+   },
+   msgs := {
+   mm := {
+   authenticationRequest := {
+   messageType := '010010'B,
+   nsd := '00'B,
+   cipheringKeySequenceNumber := ?,
+   spare2_4 := ?,
+   authenticationParRAND := rand,
+   authenticationParAUTN := {
+   elementIdentifier := '20'O,
+   lengthIndicator := ?,
+   autnValue := autn
+   }
+   }
+   }
+   }
+}
+
 template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := {
discriminator := '0101'B,
tiOrSkip := {

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I392d61d1348bee9c88abe4bb938e99b2c3702a94
Gerrit-Change-Number: 11492
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ttcn3-hacks[master]: L3_Templates; add tr_ML3_MT_MM_AUTH_REQ_3G()

2018-10-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11492 )

Change subject: L3_Templates; add tr_ML3_MT_MM_AUTH_REQ_3G()
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I392d61d1348bee9c88abe4bb938e99b2c3702a94
Gerrit-Change-Number: 11492
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 28 Oct 2018 23:21:21 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: L3_Templates; add tr_ML3_MT_MM_AUTH_REQ_3G()

2018-10-28 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11492


Change subject: L3_Templates; add tr_ML3_MT_MM_AUTH_REQ_3G()
..

L3_Templates; add tr_ML3_MT_MM_AUTH_REQ_3G()

this allows us to match on specifically 3G MM AUTH REQ, whereas
so far we only had a generic template that matched the 2G and 3G
auth req.

Change-Id: I392d61d1348bee9c88abe4bb938e99b2c3702a94
---
M library/L3_Templates.ttcn
1 file changed, 23 insertions(+), 0 deletions(-)



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

diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index a05aba2..52d4a2a 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -1268,6 +1268,29 @@
}
 }

+template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ_3G(template OCT16 rand := ?, 
template OCT16 autn) := {
+   discriminator := '0101'B,
+   tiOrSkip := {
+   skipIndicator := ''B
+   },
+   msgs := {
+   mm := {
+   authenticationRequest := {
+   messageType := '010010'B,
+   nsd := '00'B,
+   cipheringKeySequenceNumber := ?,
+   spare2_4 := ?,
+   authenticationParRAND := rand,
+   authenticationParAUTN := {
+   elementIdentifier := '20'O,
+   lengthIndicator := ?,
+   autnValue := autn
+   }
+   }
+   }
+   }
+}
+
 template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := {
discriminator := '0101'B,
tiOrSkip := {

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

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


Change in osmo-ttcn3-hacks[master]: L1CTL_Types.ttcn: drop length limitation for traffic messages

2018-10-28 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11490 )

Change subject: L1CTL_Types.ttcn: drop length limitation for traffic messages
..

L1CTL_Types.ttcn: drop length limitation for traffic messages

There is no any reason to limit payload length.

Change-Id: I1782856affe427b087fa3f7ef1c02a865d136372
---
M library/L1CTL_Types.ttcn
1 file changed, 1 insertion(+), 3 deletions(-)

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



diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn
index 39732be..4273ba3 100644
--- a/library/L1CTL_Types.ttcn
+++ b/library/L1CTL_Types.ttcn
@@ -83,8 +83,6 @@
L1CTL_RES_T_SCHED
} with { variant "FIELDLENGTH(8)" };

-   const integer TRAFFIC_DATA_LEN := 40;
-
type record L1ctlHdrFlags {
BIT7padding,
boolean f_done
@@ -299,7 +297,7 @@


type record L1ctlTrafficReq {
-   octetstring data length(TRAFFIC_DATA_LEN)
+   octetstring data
} with {
variant (data) "BYTEORDER(first)"
}

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1782856affe427b087fa3f7ef1c02a865d136372
Gerrit-Change-Number: 11490
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-ttcn3-hacks[master]: L1CTL_Types.ttcn: drop length limitation for traffic messages

2018-10-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11490 )

Change subject: L1CTL_Types.ttcn: drop length limitation for traffic messages
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1782856affe427b087fa3f7ef1c02a865d136372
Gerrit-Change-Number: 11490
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 28 Oct 2018 20:49:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: gerrot-osmo-bts: Don't use unsupported '/' in labels of axis/matrix jobs

2018-10-28 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11484 )

Change subject: gerrot-osmo-bts: Don't use unsupported '/' in labels of 
axis/matrix jobs
..

gerrot-osmo-bts: Don't use unsupported '/' in labels of axis/matrix jobs

It seems jenkins cannot deal with this, so we cannot specify something
like 'origin/nrw/oc2g-next' in a label.  Let's work around by using only
oc2g-next here and expanding that to 'origin/nrw/oc2g-next' only in the
osmo-l1yer1-headers.sh script of osmo-ci.git

Change-Id: I9130a2f349f06a0b46b50665cef7188ddb08f666
---
M jobs/gerrit-verifications.yml
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml
index a989760..71a0904 100644
--- a/jobs/gerrit-verifications.yml
+++ b/jobs/gerrit-verifications.yml
@@ -87,7 +87,7 @@

   - osmo-bts:
   a1_name: FIRMWARE_VERSION
-  a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, 
superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, 
origin/nrw/litecell15, origin/nrw/oc2g, origin/nrw/oc2g-next]
+  a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, 
superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, litecell15, 
oc2g, oc2g-next]
   a2_name: BTS_MODEL
   a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15, oc2g]
   combination_filter: >
@@ -98,9 +98,9 @@
 (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo") ||
 (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo") ||
 (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15") ||
-(FIRMWARE_VERSION == "origin/nrw/litecell15" && BTS_MODEL == 
"lc15") ||
-(FIRMWARE_VERSION == "origin/nrw/oc2g" && BTS_MODEL == "oc2g") ||
-(FIRMWARE_VERSION == "origin/nrw/oc2g-next" && BTS_MODEL == "oc2g")
+(FIRMWARE_VERSION == "litecell15" && BTS_MODEL == "lc15") ||
+(FIRMWARE_VERSION == "oc2g" && BTS_MODEL == "oc2g") ||
+(FIRMWARE_VERSION == "oc2g-next" && BTS_MODEL == "oc2g")
   cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"'

   - osmo-ggsn:

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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9130a2f349f06a0b46b50665cef7188ddb08f666
Gerrit-Change-Number: 11484
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


Change in osmo-ttcn3-hacks[master]: library/VTY: fix CONFIG prompt matching in f_vty_wait_for_prompt()

2018-10-28 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11489 )

Change subject: library/VTY: fix CONFIG prompt matching in 
f_vty_wait_for_prompt()
..

library/VTY: fix CONFIG prompt matching in f_vty_wait_for_prompt()

Matching the CONFIG prompt using implicit '\w+(*)' pattern is
a bad idea, because it can actually match almost anything:

  - 'OsmoBlaBla(config)# ',
  - 'OsmoBlaBla(config) ',
  - 'OsmoBlaBla> ',
  - 'Mahlzeit'!

One problem is that the parentheses are interpreted as a matching
operator (which is used to group an expression), so they should
have been escaped by '\'. Another problem is that this pattern
is not complete, because '\# ' is missing. Let's fix this!

Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Related: OS#3675
---
M library/Osmocom_VTY_Functions.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/library/Osmocom_VTY_Functions.ttcn 
b/library/Osmocom_VTY_Functions.ttcn
index b822645..86f58f1 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -53,7 +53,7 @@
alt {
[] pt.receive(pattern "\w+" & VTY_VIEW_SUFFIX) { };
[] pt.receive(pattern "\w+\# ") { };
-   [] pt.receive(pattern "\w+" & VTY_CFG_SUFFIX) { };
+   [] pt.receive(pattern "\w+\(*\)\# ") { };
[] pt.receive(t_vty_unknown) {
testcase.stop(fail, "VTY: Unknown Command");
};

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Gerrit-Change-Number: 11489
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: daniel 


Change in osmo-ttcn3-hacks[master]: library/VTY: fix CONFIG prompt matching in f_vty_wait_for_prompt()

2018-10-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11489 )

Change subject: library/VTY: fix CONFIG prompt matching in 
f_vty_wait_for_prompt()
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Gerrit-Change-Number: 11489
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: daniel 
Gerrit-Comment-Date: Sun, 28 Oct 2018 20:48:57 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: l1ctl_proto.h: use flexible array member for traffic messages

2018-10-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11395 )

Change subject: l1ctl_proto.h: use flexible array member for traffic messages
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/11395/2/src/host/layer23/src/common/l1ctl.c
File src/host/layer23/src/common/l1ctl.c:

https://gerrit.osmocom.org/#/c/11395/2/src/host/layer23/src/common/l1ctl.c@781
PS2, Line 781: size_t frame_len;
 :  uint8_t *frame;
I don't really see the point of introducing those two variables.  Why not 
simply use msgb->l3h = (uint8_t *)data;  and then use msgb_l3len(msg) where you 
want to access frame_len and mesb_l3(msg) when you want frame?



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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I119fa36c84e95c3003d57c19e25f8146ed45c3c6
Gerrit-Change-Number: 11395
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 28 Oct 2018 20:47:50 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in pysim[master]: pySim-*.py: print info about selected reader interface

2018-10-28 Thread Vadim Yanitskiy
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11491

to look at the new patch set (#2).

Change subject: pySim-*.py: print info about selected reader interface
..

pySim-*.py: print info about selected reader interface

Change-Id: Idd791d7ef635e15915aab13274aefc15e70777b0
---
M pySim-prog.py
M pySim-read.py
2 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/91/11491/2
--
To view, visit https://gerrit.osmocom.org/11491
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Idd791d7ef635e15915aab13274aefc15e70777b0
Gerrit-Change-Number: 11491
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)


Change in pysim[master]: pySim-*.py: add command line option for Calypso reader

2018-10-28 Thread Vadim Yanitskiy
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11482

to look at the new patch set (#4).

Change subject: pySim-*.py: add command line option for Calypso reader
..

pySim-*.py: add command line option for Calypso reader

Change-Id: Ia895ced62d29e06ae8af05cd95c9d181fb53b9df
---
M pySim-prog.py
M pySim-read.py
2 files changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/82/11482/4
--
To view, visit https://gerrit.osmocom.org/11482
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia895ced62d29e06ae8af05cd95c9d181fb53b9df
Gerrit-Change-Number: 11482
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)


Change in pysim[master]: pySim-*.py: add command line option for Calypso reader

2018-10-28 Thread Vadim Yanitskiy
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11482

to look at the new patch set (#3).

Change subject: pySim-*.py: add command line option for Calypso reader
..

pySim-*.py: add command line option for Calypso reader

Change-Id: Ia895ced62d29e06ae8af05cd95c9d181fb53b9df
---
M pySim-prog.py
M pySim-read.py
2 files changed, 18 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/82/11482/3
--
To view, visit https://gerrit.osmocom.org/11482
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia895ced62d29e06ae8af05cd95c9d181fb53b9df
Gerrit-Change-Number: 11482
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)


Change in pysim[master]: pySim-*.py: print info about selected reader interface

2018-10-28 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/11491


Change subject: pySim-*.py: print info about selected reader interface
..

pySim-*.py: print info about selected reader interface

Change-Id: Idd791d7ef635e15915aab13274aefc15e70777b0
---
M pySim-prog.py
M pySim-read.py
2 files changed, 8 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/91/11491/1

diff --git a/pySim-prog.py b/pySim-prog.py
index ba1b783..192fb5a 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -564,9 +564,13 @@

# Init card reader driver
if opts.pcsc_dev is not None:
+   print("Using PC/SC reader (dev=%d) interface"
+   % opts.pcsc_dev)
from pySim.transport.pcsc import PcscSimLink
sl = PcscSimLink(opts.pcsc_dev)
else: # Serial reader is default
+   print("Using serial reader (port=%s, baudrate=%d) interface"
+   % (opts.device, opts.baudrate))
from pySim.transport.serial import SerialSimLink
sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate)

diff --git a/pySim-read.py b/pySim-read.py
index 066b0df..3108f5f 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -72,9 +72,13 @@

# Init card reader driver
if opts.pcsc_dev is not None:
+   print("Using PC/SC reader (dev=%d) interface"
+   % opts.pcsc_dev)
from pySim.transport.pcsc import PcscSimLink
sl = PcscSimLink(opts.pcsc_dev)
else: # Serial reader is default
+   print("Using serial reader (port=%s, baudrate=%d) interface"
+   % (opts.device, opts.baudrate))
from pySim.transport.serial import SerialSimLink
sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate)


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd791d7ef635e15915aab13274aefc15e70777b0
Gerrit-Change-Number: 11491
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in pysim[master]: (WIP/CHECK): dump parsed arguments

2018-10-28 Thread Vadim Yanitskiy
Vadim Yanitskiy has abandoned this change. ( https://gerrit.osmocom.org/11485 )

Change subject: (WIP/CHECK): dump parsed arguments
..


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I08ddaf2040328aedb714debaf15707279cd7a0e3
Gerrit-Change-Number: 11485
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)


Change in pysim[master]: pySim/transport: introduce Calypso based reader interface

2018-10-28 Thread Vadim Yanitskiy
Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11480

to look at the new patch set (#3).

Change subject: pySim/transport: introduce Calypso based reader interface
..

pySim/transport: introduce Calypso based reader interface

This interface allows to use a Calypso based phone (e.g. Motorola
C1XX) as a SIM card reader. It basically implements a few L1CTL
messages that are used to interact with the SIM card through
the OsmocomBB 'layer1' firmware.

Please note, that this is an experimental implementation, and
there is a risk that SIM programming would fail. Nevertheless,
I've managed to program and read one of my SIMs a few times.

Change-Id: Iec8101140581bf9e2cf7cf3a0b54bdf1875fc51b
---
M pySim/exceptions.py
A pySim/transport/calypso.py
2 files changed, 160 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/80/11480/3
--
To view, visit https://gerrit.osmocom.org/11480
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iec8101140581bf9e2cf7cf3a0b54bdf1875fc51b
Gerrit-Change-Number: 11480
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: l1ctl_proto.h: use flexible array member for traffic messages

2018-10-28 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11395 )

Change subject: l1ctl_proto.h: use flexible array member for traffic messages
..


Patch Set 2:

Please see: https://gerrit.osmocom.org/11490/


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I119fa36c84e95c3003d57c19e25f8146ed45c3c6
Gerrit-Change-Number: 11395
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 28 Oct 2018 17:21:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmocom-bb[master]: l1ctl_proto.h: use flexible array member for traffic messages

2018-10-28 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11395 )

Change subject: l1ctl_proto.h: use flexible array member for traffic messages
..


Set Ready For Review


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I119fa36c84e95c3003d57c19e25f8146ed45c3c6
Gerrit-Change-Number: 11395
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 28 Oct 2018 17:21:25 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: L1CTL_Types.ttcn: drop length limitation for traffic messages

2018-10-28 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/11490


Change subject: L1CTL_Types.ttcn: drop length limitation for traffic messages
..

L1CTL_Types.ttcn: drop length limitation for traffic messages

There is no any reason to limit payload length.

Change-Id: I1782856affe427b087fa3f7ef1c02a865d136372
---
M library/L1CTL_Types.ttcn
1 file changed, 1 insertion(+), 3 deletions(-)



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

diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn
index 39732be..4273ba3 100644
--- a/library/L1CTL_Types.ttcn
+++ b/library/L1CTL_Types.ttcn
@@ -83,8 +83,6 @@
L1CTL_RES_T_SCHED
} with { variant "FIELDLENGTH(8)" };

-   const integer TRAFFIC_DATA_LEN := 40;
-
type record L1ctlHdrFlags {
BIT7padding,
boolean f_done
@@ -299,7 +297,7 @@


type record L1ctlTrafficReq {
-   octetstring data length(TRAFFIC_DATA_LEN)
+   octetstring data
} with {
variant (data) "BYTEORDER(first)"
}

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1782856affe427b087fa3f7ef1c02a865d136372
Gerrit-Change-Number: 11490
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmo-ttcn3-hacks[master]: library/VTY: fix CONFIG prompt matching in f_vty_wait_for_prompt()

2018-10-28 Thread Vadim Yanitskiy
Hello daniel, Harald Welte, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11489

to look at the new patch set (#2).

Change subject: library/VTY: fix CONFIG prompt matching in 
f_vty_wait_for_prompt()
..

library/VTY: fix CONFIG prompt matching in f_vty_wait_for_prompt()

Matching the CONFIG prompt using implicit '\w+(*)' pattern is
a bad idea, because it can actually match almost anything:

  - 'OsmoBlaBla(config)# ',
  - 'OsmoBlaBla(config) ',
  - 'OsmoBlaBla> ',
  - 'Mahlzeit'!

One problem is that the parentheses are interpreted as a matching
operator (which is used to group an expression), so they should
have been escaped by '\'. Another problem is that this pattern
is not complete, because '\# ' is missing. Let's fix this!

Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Related: OS#3675
---
M library/Osmocom_VTY_Functions.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/89/11489/2
--
To view, visit https://gerrit.osmocom.org/11489
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Gerrit-Change-Number: 11489
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: daniel 


Build failed in Jenkins: master-asn1c ยป a1=default,a2=default,a3=default,osmocom-master-debian9 #290

2018-10-28 Thread jenkins
See 


--
[...truncated 3.67 KB...]

+ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for autoconf... /usr/bin/autoconf
checking for autoheader... /usr/bin/autoheader
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dep

Change in libosmocore[master]: gsm23003: Add MME domain name related helper functions

2018-10-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11411 )

Change subject: gsm23003: Add MME domain name related helper functions
..


Set Ready For Review


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia882d9db05ec0037e593aeebea21bc31adb680bb
Gerrit-Change-Number: 11411
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 28 Oct 2018 13:22:09 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: gsm23003: Add MME domain name related helper functions

2018-10-28 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11411 )

Change subject: gsm23003: Add MME domain name related helper functions
..

gsm23003: Add MME domain name related helper functions

osmo_gen_mme_group_domain(), osmo_gen_mme_group_domain() and
osmo_gen_home_network_domain()

Change-Id: Ia882d9db05ec0037e593aeebea21bc31adb680bb
---
M include/osmocom/gsm/gsm23003.h
M include/osmocom/gsm/protocol/gsm_23_003.h
M src/gsm/gsm23003.c
M src/gsm/libosmogsm.map
M tests/gsm23003/gsm23003_test.c
M tests/gsm23003/gsm23003_test.ok
6 files changed, 185 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h
index fd4f369..2f380ae 100644
--- a/include/osmocom/gsm/gsm23003.h
+++ b/include/osmocom/gsm/gsm23003.h
@@ -101,6 +101,7 @@
 const char *osmo_lai_name(const struct osmo_location_area_id *lai);
 const char *osmo_cgi_name(const struct osmo_cell_global_id *cgi);
 const char *osmo_cgi_name2(const struct osmo_cell_global_id *cgi);
+const char *osmo_gummei_name(const struct osmo_gummei *gummei);

 void osmo_plmn_to_bcd(uint8_t *bcd_dst, const struct osmo_plmn_id *plmn);
 void osmo_plmn_from_bcd(const uint8_t *bcd_src, struct osmo_plmn_id *plmn);
@@ -120,3 +121,9 @@

 int osmo_mnc_cmp(uint16_t a_mnc, bool a_mnc_3_digits, uint16_t b_mnc, bool 
b_mnc_3_digits);
 int osmo_plmn_cmp(const struct osmo_plmn_id *a, const struct osmo_plmn_id *b);
+
+int osmo_gen_home_network_domain(char *out, const struct osmo_plmn_id *plmn);
+int osmo_parse_home_network_domain(struct osmo_plmn_id *out, const char *in);
+int osmo_gen_mme_domain(char *out, const struct osmo_gummei *gummei);
+int osmo_gen_mme_group_domain(char *out, uint16_t mmegi, const struct 
osmo_plmn_id *plmn);
+int osmo_parse_mme_domain(struct osmo_gummei *out, const char *in);
diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h 
b/include/osmocom/gsm/protocol/gsm_23_003.h
index 0e66939..ee697ff 100644
--- a/include/osmocom/gsm/protocol/gsm_23_003.h
+++ b/include/osmocom/gsm/protocol/gsm_23_003.h
@@ -24,3 +24,9 @@
 GSM23003_IMEI_SNR_NUM_DIGITS + 1)
 #define GSM23003_IMEISV_NUM_DIGITS (GSM23003_IMEI_TAC_NUM_DIGITS + \
 GSM23003_IMEI_SNR_NUM_DIGITS + 2)
+
+/* Chapter 19.2 "epc.mnc000.mcc000.3gppnetwork.org" */
+#define GSM23003_HOME_NETWORK_DOMAIN_LEN   33
+
+/* Chapter 19.4.2.4: "mmec00.mmegi.mme.epc.mnc000.mcc000.3gppnetwork.org" 
*/
+#define GSM23003_MME_DOMAIN_LEN55
diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c
index 2c3b21e..4fdad48 100644
--- a/src/gsm/gsm23003.c
+++ b/src/gsm/gsm23003.c
@@ -169,6 +169,14 @@
bcd[0] = val % 10;
 }

+const char *osmo_gummei_name(const struct osmo_gummei *gummei)
+{
+   static char buf[32];
+   snprintf(buf, sizeof(buf), "%s-%04x-%02x", 
osmo_plmn_name(&gummei->plmn),
+gummei->mme.group_id, gummei->mme.code);
+   return buf;
+}
+
 /* Convert MCC + MNC to BCD representation
  * \param[out] bcd_dst caller-allocated memory for output
  * \param[in] mcc Mobile Country Code
@@ -297,3 +305,81 @@
return 1;
return osmo_mnc_cmp(a->mnc, a->mnc_3_digits, b->mnc, b->mnc_3_digits);
 }
+
+/*! Generate TS 23.003 Section 19.2 Home Network Realm/Domain (text form)
+ *  \param out[out] caller-provided output buffer, at least 33 bytes long
+ *  \param plmn[in] Osmocom representation of PLMN ID (MCC + MNC)
+ *  \returns number of characters printed (excluding NUL); negative on error */
+int osmo_gen_home_network_domain(char *out, const struct osmo_plmn_id *plmn)
+{
+   if (plmn->mcc > 999)
+   return -EINVAL;
+   if (plmn->mnc > 999)
+   return -EINVAL;
+   return sprintf(out, "epc.mnc%03u.mcc%03u.3gppnetwork.org", plmn->mnc, 
plmn->mcc);
+}
+
+/*! Parse a TS 23.003 Section 19.2 Home Network Realm/Domain (text form) into 
a \ref osmo_plmn_id
+ *  \param out[out] caller-allocated output structure
+ *  \param in[in] character string representation to be parsed
+ *  \returns 0 on success; negative on error */
+int osmo_parse_home_network_domain(struct osmo_plmn_id *out, const char *in)
+{
+   int rc;
+
+   memset(out, 0, sizeof(*out));
+   rc = sscanf(in, "epc.mnc%03hu.mcc%03hu.3gppnetwork.org", &out->mnc, 
&out->mcc);
+   if (rc < 0)
+   return rc;
+   if (rc != 2)
+   return -EINVAL;
+   return 0;
+}
+
+/*! Generate TS 23.003 Section 19.4.2.4 MME Domain (text form)
+ *  \param out[out] caller-provided output buffer, at least 56 bytes long
+ *  \param gummei[in] Structure representing the Globally Unique MME Identifier
+ *  \returns number of characters printed (excluding NUL); negative on error */
+int osmo_gen_mme_domain(char *out, const struct osmo_gumme

Change in osmo-ttcn3-hacks[master]: library/VTY: fix prompt matching in f_vty_wait_for_prompt()

2018-10-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11489 )

Change subject: library/VTY: fix prompt matching in f_vty_wait_for_prompt()
..


Patch Set 1:

Thanks for looking into this, but...

14:19 <@LaF0rge> fixeria: did you check the commit history of the 
VTY_Functions.ttcn?
14:20 <@LaF0rge> fixeria: if you want to rvert 
I574b56c42fe95540af44a2c43d0fb469938c0e65, then simply
 revert it, rather than reimplementing the old code in a 
diffeernt way
14:20 <@LaF0rge> fixeria: the poit is that we cannot really rely on the module 
parameter, as that assumes
 threre's only a single VTY we talk to.  This is too 
restrictive for more advanced
 testing whre we'd like to talk to multiple different VTY 
interfaces


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Gerrit-Change-Number: 11489
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: daniel 
Gerrit-Comment-Date: Sun, 28 Oct 2018 13:21:30 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: library/VTY: fix prompt matching in f_vty_wait_for_prompt()

2018-10-28 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/11489


Change subject: library/VTY: fix prompt matching in f_vty_wait_for_prompt()
..

library/VTY: fix prompt matching in f_vty_wait_for_prompt()

Matching the prompt by a sequence of any alphanumeric characters
(i.e. '\w+') is a bad idea, because it can led to false-positive
matching results, for example:

  - '\w+> ' matches the following:
* 'OsmoBlaBla> ',
* 'Switching default route from  to foobar'.

Let's avoid using such implicit patterns, and replace the '\w+'
by mp_prompt_prefix, that basically contains the process name.

Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Related: OS#3675
---
M library/Osmocom_VTY_Functions.ttcn
1 file changed, 6 insertions(+), 3 deletions(-)



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

diff --git a/library/Osmocom_VTY_Functions.ttcn 
b/library/Osmocom_VTY_Functions.ttcn
index b822645..b56b792 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -9,6 +9,9 @@
const charstring VTY_ENABLE_SUFFIX := "# ";
const charstring VTY_CFG_SUFFIX := "(*)";

+   template charstring t_vty_prompt_view   := pattern mp_prompt_prefix & 
"> ";
+   template charstring t_vty_prompt_enable := pattern mp_prompt_prefix & 
"\# ";
+   template charstring t_vty_prompt_config := pattern mp_prompt_prefix & 
"(*)\# ";
template charstring t_vty_unknown := pattern "*% Unknown command.";

/* configure prompts in TELNETasp module */
@@ -51,9 +54,9 @@

T.start;
alt {
-   [] pt.receive(pattern "\w+" & VTY_VIEW_SUFFIX) { };
-   [] pt.receive(pattern "\w+\# ") { };
-   [] pt.receive(pattern "\w+" & VTY_CFG_SUFFIX) { };
+   [] pt.receive(t_vty_prompt_view)   {  };
+   [] pt.receive(t_vty_prompt_enable) {  };
+   [] pt.receive(t_vty_prompt_config) {  };
[] pt.receive(t_vty_unknown) {
testcase.stop(fail, "VTY: Unknown Command");
};

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Gerrit-Change-Number: 11489
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmo-ttcn3-hacks[master]: Add SGsAP_CodecPort + SGsAP_Emulation module

2018-10-28 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11306 )

Change subject: Add SGsAP_CodecPort + SGsAP_Emulation module
..

Add SGsAP_CodecPort + SGsAP_Emulation module

Change-Id: I530f8f444d1c7ea0bf11d510da7b97f64a2039f5
---
A library/SGsAP_CodecPort.ttcn
A library/SGsAP_CodecPort_CtrlFunct.ttcn
A library/SGsAP_CodecPort_CtrlFunctDef.cc
A library/SGsAP_Emulation.ttcn
M regen-makefile.sh
5 files changed, 591 insertions(+), 1 deletion(-)

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



diff --git a/library/SGsAP_CodecPort.ttcn b/library/SGsAP_CodecPort.ttcn
new file mode 100644
index 000..2981fa2
--- /dev/null
+++ b/library/SGsAP_CodecPort.ttcn
@@ -0,0 +1,72 @@
+module SGsAP_CodecPort {
+
+/* Simple SGsAP Codec Port, translating between raw SCTP primitives with
+ * octetstring payload towards the IPL4asp provider, and SGsAP primitives
+ * which carry the decoded SGsAP data types as payload.
+ *
+ * (C) 2018 by Harald Welte 
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ */
+
+   import from IPL4asp_PortType all;
+   import from IPL4asp_Types all;
+   import from SGsAP_Types all;
+
+   type record SGsAP_RecvFrom {
+   ConnectionIdconnId,
+   HostNameremName,
+   PortNumber  remPort,
+   HostNamelocName,
+   PortNumber  locPort,
+   PDU_SGsAP   msg
+   };
+
+   template SGsAP_RecvFrom t_SGsAP_RecvFrom(template PDU_SGsAP msg) := {
+   connId := ?,
+   remName := ?,
+   remPort := ?,
+   locName := ?,
+   locPort := ?,
+   msg := msg
+   }
+
+   type record SGsAP_Send {
+   ConnectionIdconnId,
+   PDU_SGsAP   msg
+   }
+
+   template SGsAP_Send t_SGsAP_Send(template ConnectionId connId, template 
PDU_SGsAP msg) := {
+   connId := connId,
+   msg := msg
+   }
+
+   private function IPL4_to_SGsAP_RecvFrom(in ASP_RecvFrom pin, out 
SGsAP_RecvFrom pout) {
+   pout.connId := pin.connId;
+   pout.remName := pin.remName;
+   pout.remPort := pin.remPort;
+   pout.locName := pin.locName;
+   pout.locPort := pin.locPort;
+   pout.msg := dec_PDU_SGsAP(pin.msg);
+   } with { extension "prototype(fast)" };
+
+   private function SGsAP_to_IPL4_Send(in SGsAP_Send pin, out ASP_Send 
pout) {
+   pout.connId := pin.connId;
+   pout.proto := { sctp := {} };
+   pout.msg := enc_PDU_SGsAP(pin.msg);
+   } with { extension "prototype(fast)" };
+
+   type port SGsAP_CODEC_PT message {
+   out SGsAP_Send;
+   in  SGsAP_RecvFrom,
+   ASP_ConnId_ReadyToRelease,
+   ASP_Event;
+   } with { extension "user IPL4asp_PT
+   out(SGsAP_Send -> ASP_Send:function(SGsAP_to_IPL4_Send))
+   in(ASP_RecvFrom -> SGsAP_RecvFrom: 
function(IPL4_to_SGsAP_RecvFrom);
+  ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: 
simple;
+  ASP_Event -> ASP_Event: simple)"
+   }
+}
diff --git a/library/SGsAP_CodecPort_CtrlFunct.ttcn 
b/library/SGsAP_CodecPort_CtrlFunct.ttcn
new file mode 100644
index 000..b09fc94
--- /dev/null
+++ b/library/SGsAP_CodecPort_CtrlFunct.ttcn
@@ -0,0 +1,44 @@
+module SGsAP_CodecPort_CtrlFunct {
+
+  import from SGsAP_CodecPort all;
+  import from IPL4asp_Types all;
+
+  external function f_IPL4_listen(
+inout SGsAP_CODEC_PT portRef,
+in HostName locName,
+in PortNumber locPort,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_connect(
+inout SGsAP_CODEC_PT portRef,
+in HostName remName,
+in PortNumber remPort,
+in HostName locName,
+in PortNumber locPort,
+in ConnectionId connId,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_close(
+inout SGsAP_CODEC_PT portRef,
+in ConnectionId id,
+in ProtoTuple proto := { unspecified := {} }
+  ) return Result;
+
+  external function f_IPL4_setUserData(
+inout SGsAP_CODEC_PT portRef,
+in ConnectionId id,
+in UserData userData
+  ) return Result;
+
+  external function f_IPL4_getUserData(
+inout SGsAP_CODEC_PT portRef,
+in ConnectionId id,
+out UserData userData
+  ) return Result;
+
+}
+
diff --git a/library/SGsAP_CodecPort_CtrlFunctDef.cc 
b/library/SGsAP_CodecPort_CtrlFunctDef.cc
new file mode 100644
index 000..aa38e51
--- /dev/null
+++ b/library/SGsAP_CodecPort_CtrlFunctDef.cc
@@ -0,0 +1,56 @@
+#include "IPL4asp_PortType.hh"

Change in osmo-ttcn3-hacks[master]: Add SGsAP_CodecPort + SGsAP_Emulation module

2018-10-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11306 )

Change subject: Add SGsAP_CodecPort + SGsAP_Emulation module
..


Set Ready For Review


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I530f8f444d1c7ea0bf11d510da7b97f64a2039f5
Gerrit-Change-Number: 11306
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 28 Oct 2018 09:52:20 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: SGsAP: Switch over to osmocom branch/repo to avoid bugs in official one

2018-10-28 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11486 )

Change subject: SGsAP: Switch over to osmocom branch/repo to avoid bugs in 
official one
..

SGsAP: Switch over to osmocom branch/repo to avoid bugs in official one

The VLR and MME name are octetstring with dns-style labels and not
character strings.

Change-Id: I31a8ea04ef508beba9014aac5479693c47b7b956
---
M deps/Makefile
M library/SGsAP_Templates.ttcn
2 files changed, 20 insertions(+), 20 deletions(-)

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



diff --git a/deps/Makefile b/deps/Makefile
index a1ac595..7cf9300 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -40,11 +40,11 @@
titan.ProtocolModules.LLC_v7.1.0 \
titan.ProtocolModules.MobileL3_v13.4.0 \
titan.ProtocolModules.NS_v7.3.0 \
-   titan.ProtocolModules.SGsAP_13.2.0 \
titan.ProtocolModules.SNDCP_v7.0.0 \
titan.ProtocolEmulations.SCCP

 OSMOGITHUB_REPOS=  titan.TestPorts.SCTPasp \
+   titan.ProtocolModules.SGsAP_13.2.0 \
titan.TestPorts.MTP3asp \
titan.ProtocolEmulations.M3UA

@@ -78,7 +78,7 @@
 titan.ProtocolModules.RTP_commit=  R.5.A
 titan.ProtocolModules.ROSE_commit= R.1.C
 titan.ProtocolModules.SCTP_commit= R.2.A
-titan.ProtocolModules.SGsAP_13.2.0_commit= R.1.B
+titan.ProtocolModules.SGsAP_13.2.0_commit= 
520dc48dd41ee15c9fd77e71d2ea7a05c58770b9
 titan.ProtocolModules.SDP_commit=  R.14.A
 titan.ProtocolModules.SMPP_commit= R.2.A-2-gb7aee69
 titan.ProtocolModules.SNDCP_v7.0.0_commit= R.2.A
diff --git a/library/SGsAP_Templates.ttcn b/library/SGsAP_Templates.ttcn
index aac045e..9526080 100644
--- a/library/SGsAP_Templates.ttcn
+++ b/library/SGsAP_Templates.ttcn
@@ -174,12 +174,12 @@


 /* 9.4.13 */
-template (value) MME_Name ts_SGsAP_IE_MmeName(template (value) charstring 
name) := {
+template (value) MME_Name ts_SGsAP_IE_MmeName(template (value) octetstring 
name) := {
iEI := '1001'B,
lengthIndicator := lengthof(valueof(name)),
name := name
 };
-template MME_Name tr_SGsAP_IE_MmeName(template charstring name) := {
+template MME_Name tr_SGsAP_IE_MmeName(template octetstring name) := {
iEI := '1001'B,
lengthIndicator := ?,
name := name
@@ -303,12 +303,12 @@


 /* 9.4.22 */
-template (value) VLR_Name ts_SGsAP_IE_VlrName(template (value) charstring 
name) := {
+template (value) VLR_Name ts_SGsAP_IE_VlrName(template (value) octetstring 
name) := {
iEI := '0010'B,
lengthIndicator := lengthof(name),
name := name
 }
-template VLR_Name tr_SGsAP_IE_VlrName(template charstring name) := {
+template VLR_Name tr_SGsAP_IE_VlrName(template octetstring name) := {
iEI := '0010'B,
lengthIndicator := ?,
name := name
@@ -397,7 +397,7 @@

 /* 8.6 */
 template (value) PDU_SGsAP ts_SGsAP_EPS_DETACH_IND(hexstring imsi,
-  template (value) charstring 
mme_name,
+  template (value) octetstring 
mme_name,
   template (value) 
IMSI_detachFromEPS_serviceType det_serv_typ) := {
sGsAP_EPS_DETACH_INDICATION:= {
messageType := '00010001'B,
@@ -407,7 +407,7 @@
}
 }
 template PDU_SGsAP tr_SGsAP_EPS_DETACH_IND(template hexstring imsi,
-  template charstring mme_name,
+  template octetstring mme_name,
   template 
IMSI_detachFromEPS_serviceType det_serv_typ) := {
sGsAP_EPS_DETACH_INDICATION:= {
messageType := '00010001'B,
@@ -433,7 +433,7 @@

 /* 8.8 */
 template (value) PDU_SGsAP ts_SGsAP_IMSI_DETACH_IND(hexstring imsi,
-   template (value) charstring 
mme_name,
+   template (value) 
octetstring mme_name,
template (value) 
IMSI_detachFromNonEPS_serviceType det_serv_typ) := {
sGsAP_IMSI_DETACH_INDICATION := {
messageType := '00010011'B,
@@ -443,7 +443,7 @@
}
 }
 template PDU_SGsAP tr_SGsAP_IMSI_DETACH_IND(template hexstring imsi,
-   template charstring mme_name := ?,
+   template octetstring mme_name := ?,
template 
IMSI_detachFromNonEPS_serviceType det_serv_typ := ?) := {
sGsAP_IMSI_DETACH_INDICATION := {
messageType := '00010011'B,
@@ -498,7 +498,7 @@

 

Change in osmo-ttcn3-hacks[master]: SGsAP_Emulation: Add functions to send MME or VLR reset

2018-10-28 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11487 )

Change subject: SGsAP_Emulation: Add functions to send MME or VLR reset
..

SGsAP_Emulation: Add functions to send MME or VLR reset

... including encoding/decoding of names between string and binary labels

Change-Id: I981c7c1d34f0db60031b5436739cd924e5a09407
---
A library/DNS_Helpers.ttcn
M library/SGsAP_Emulation.ttcn
2 files changed, 106 insertions(+), 1 deletion(-)

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



diff --git a/library/DNS_Helpers.ttcn b/library/DNS_Helpers.ttcn
new file mode 100644
index 000..45c3a09
--- /dev/null
+++ b/library/DNS_Helpers.ttcn
@@ -0,0 +1,63 @@
+module DNS_Helpers {
+
+private function f_strchr(charstring s, char c) return integer {
+   var integer i;
+   for (i := 0; i < lengthof(s); i := i+1) {
+   if (s[i] == c) {
+   return i;
+   }
+   }
+   return -1;
+}
+
+private function f_dns_enc_label(charstring str) return octetstring {
+   var octetstring ret;
+
+   ret[0] := int2oct(lengthof(str), 1);
+   return ret & char2oct(str);
+}
+
+function f_enc_dns_hostname(charstring str) return octetstring {
+   var octetstring ret := ''O;
+   while (lengthof(str) > 0) {
+   var integer dot_idx;
+   var octetstring lbl;
+
+   dot_idx := f_strchr(str, ".");
+   if (dot_idx >= 0) {
+   /* there is another dot */
+   lbl := f_dns_enc_label(substr(str, 0, dot_idx));
+   str := substr(str, dot_idx+1, lengthof(str)-dot_idx-1);
+   } else {
+   /* no more dot */
+   lbl := f_dns_enc_label(str);
+   str := "";
+   }
+   ret := ret & lbl;
+   }
+   return ret;
+}
+
+
+
+
+function f_dec_dns_hostname(octetstring inp) return charstring {
+   var charstring ret := "";
+   while (lengthof(inp) > 0) {
+   var integer label_len;
+   var charstring lbl;
+
+   label_len := oct2int(substr(inp, 0, 1));
+   lbl := oct2char(substr(inp, 1, label_len));
+   inp := substr(inp, 1+label_len, lengthof(inp)-1-label_len);
+
+   ret := ret & lbl;
+   if (lengthof(inp) > 0) {
+   ret := ret & ".";
+   }
+   }
+   return ret;
+}
+
+
+}
diff --git a/library/SGsAP_Emulation.ttcn b/library/SGsAP_Emulation.ttcn
index 0c37840..968bcdd 100644
--- a/library/SGsAP_Emulation.ttcn
+++ b/library/SGsAP_Emulation.ttcn
@@ -31,6 +31,7 @@
 import from SGsAP_Templates all;
 import from Osmocom_Types all;
 import from IPL4asp_Types all;
+import from DNS_Helpers all;

 type component SGsAP_ConnHdlr {
port SGsAP_Conn_PT SGsAP;
@@ -295,6 +296,7 @@
var hexstring imsi;
var SGsAP_RecvFrom mrf;
var PDU_SGsAP msg;
+   var charstring vlr_name, mme_name;

alt {
/* SGsAP from client */
@@ -329,6 +331,24 @@
f_create_expect(imsi, vc_conn);
SGsAP_PROC.reply(SGsAPEM_register:{imsi, vc_conn}) to 
vc_conn;
}
+   [] SGsAP_PROC.getcall(SGsAPEM_reset_mme:{?,-}) -> 
param(mme_name) {
+   var octetstring mme_enc, vlr_enc;
+   mme_enc := f_enc_dns_hostname(mme_name);
+   msg := f_sgsap_xceive(ts_SGsAP_RESET_IND_MME(mme_enc));
+   vlr_enc := msg.sGsAP_RESET_ACK.vLR_Name.name;
+   vlr_name := f_dec_dns_hostname(vlr_enc);
+   SGsAP_PROC.reply(SGsAPEM_reset_mme:{mme_name, 
vlr_name});
+   }
+   [] SGsAP_PROC.getcall(SGsAPEM_reset_vlr:{?,-}) -> 
param(vlr_name) {
+   var octetstring mme_enc, vlr_enc;
+   vlr_enc := f_enc_dns_hostname(vlr_name);
+   msg := f_sgsap_xceive(ts_SGsAP_RESET_IND_VLR(vlr_enc));
+   mme_enc := msg.sGsAP_RESET_ACK.mME_Name.name;
+   mme_name := f_dec_dns_hostname(mme_enc);
+   SGsAP_PROC.reply(SGsAPEM_reset_vlr:{vlr_name, 
mme_name});
+   }
+
+
}

}
@@ -343,8 +363,11 @@

 signature SGsAPEM_register(in hexstring imsi, in SGsAP_ConnHdlr hdlr);

+signature SGsAPEM_reset_vlr(in charstring vlr_name, out charstring mme_name);
+signature SGsAPEM_reset_mme(in charstring mme_name, out charstring vlr_name);
+
 type port SGsAPEM_PROC_PT procedure {
-   inout SGsAPEM_register;
+   inout SGsAPEM_register, SGsAPEM_reset_vlr, SGsAPEM_reset_mme;
 } with { extension "internal" };

 /* Function that can be used as create_cb and will

Change in osmo-ttcn3-hacks[master]: SGsAP_Emulation: Add functions to send MME or VLR reset

2018-10-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11487 )

Change subject: SGsAP_Emulation: Add functions to send MME or VLR reset
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I981c7c1d34f0db60031b5436739cd924e5a09407
Gerrit-Change-Number: 11487
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 28 Oct 2018 09:52:23 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: SGsAP: Switch over to osmocom branch/repo to avoid bugs in official one

2018-10-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11486 )

Change subject: SGsAP: Switch over to osmocom branch/repo to avoid bugs in 
official one
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I31a8ea04ef508beba9014aac5479693c47b7b956
Gerrit-Change-Number: 11486
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 28 Oct 2018 09:52:16 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: SGsAP_Emulation: Add functions to send MME or VLR reset

2018-10-28 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11487


Change subject: SGsAP_Emulation: Add functions to send MME or VLR reset
..

SGsAP_Emulation: Add functions to send MME or VLR reset

... including encoding/decoding of names between string and binary labels

Change-Id: I981c7c1d34f0db60031b5436739cd924e5a09407
---
A library/DNS_Helpers.ttcn
M library/SGsAP_Emulation.ttcn
2 files changed, 106 insertions(+), 1 deletion(-)



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

diff --git a/library/DNS_Helpers.ttcn b/library/DNS_Helpers.ttcn
new file mode 100644
index 000..45c3a09
--- /dev/null
+++ b/library/DNS_Helpers.ttcn
@@ -0,0 +1,63 @@
+module DNS_Helpers {
+
+private function f_strchr(charstring s, char c) return integer {
+   var integer i;
+   for (i := 0; i < lengthof(s); i := i+1) {
+   if (s[i] == c) {
+   return i;
+   }
+   }
+   return -1;
+}
+
+private function f_dns_enc_label(charstring str) return octetstring {
+   var octetstring ret;
+
+   ret[0] := int2oct(lengthof(str), 1);
+   return ret & char2oct(str);
+}
+
+function f_enc_dns_hostname(charstring str) return octetstring {
+   var octetstring ret := ''O;
+   while (lengthof(str) > 0) {
+   var integer dot_idx;
+   var octetstring lbl;
+
+   dot_idx := f_strchr(str, ".");
+   if (dot_idx >= 0) {
+   /* there is another dot */
+   lbl := f_dns_enc_label(substr(str, 0, dot_idx));
+   str := substr(str, dot_idx+1, lengthof(str)-dot_idx-1);
+   } else {
+   /* no more dot */
+   lbl := f_dns_enc_label(str);
+   str := "";
+   }
+   ret := ret & lbl;
+   }
+   return ret;
+}
+
+
+
+
+function f_dec_dns_hostname(octetstring inp) return charstring {
+   var charstring ret := "";
+   while (lengthof(inp) > 0) {
+   var integer label_len;
+   var charstring lbl;
+
+   label_len := oct2int(substr(inp, 0, 1));
+   lbl := oct2char(substr(inp, 1, label_len));
+   inp := substr(inp, 1+label_len, lengthof(inp)-1-label_len);
+
+   ret := ret & lbl;
+   if (lengthof(inp) > 0) {
+   ret := ret & ".";
+   }
+   }
+   return ret;
+}
+
+
+}
diff --git a/library/SGsAP_Emulation.ttcn b/library/SGsAP_Emulation.ttcn
index 0c37840..968bcdd 100644
--- a/library/SGsAP_Emulation.ttcn
+++ b/library/SGsAP_Emulation.ttcn
@@ -31,6 +31,7 @@
 import from SGsAP_Templates all;
 import from Osmocom_Types all;
 import from IPL4asp_Types all;
+import from DNS_Helpers all;

 type component SGsAP_ConnHdlr {
port SGsAP_Conn_PT SGsAP;
@@ -295,6 +296,7 @@
var hexstring imsi;
var SGsAP_RecvFrom mrf;
var PDU_SGsAP msg;
+   var charstring vlr_name, mme_name;

alt {
/* SGsAP from client */
@@ -329,6 +331,24 @@
f_create_expect(imsi, vc_conn);
SGsAP_PROC.reply(SGsAPEM_register:{imsi, vc_conn}) to 
vc_conn;
}
+   [] SGsAP_PROC.getcall(SGsAPEM_reset_mme:{?,-}) -> 
param(mme_name) {
+   var octetstring mme_enc, vlr_enc;
+   mme_enc := f_enc_dns_hostname(mme_name);
+   msg := f_sgsap_xceive(ts_SGsAP_RESET_IND_MME(mme_enc));
+   vlr_enc := msg.sGsAP_RESET_ACK.vLR_Name.name;
+   vlr_name := f_dec_dns_hostname(vlr_enc);
+   SGsAP_PROC.reply(SGsAPEM_reset_mme:{mme_name, 
vlr_name});
+   }
+   [] SGsAP_PROC.getcall(SGsAPEM_reset_vlr:{?,-}) -> 
param(vlr_name) {
+   var octetstring mme_enc, vlr_enc;
+   vlr_enc := f_enc_dns_hostname(vlr_name);
+   msg := f_sgsap_xceive(ts_SGsAP_RESET_IND_VLR(vlr_enc));
+   mme_enc := msg.sGsAP_RESET_ACK.mME_Name.name;
+   mme_name := f_dec_dns_hostname(mme_enc);
+   SGsAP_PROC.reply(SGsAPEM_reset_vlr:{vlr_name, 
mme_name});
+   }
+
+
}

}
@@ -343,8 +363,11 @@

 signature SGsAPEM_register(in hexstring imsi, in SGsAP_ConnHdlr hdlr);

+signature SGsAPEM_reset_vlr(in charstring vlr_name, out charstring mme_name);
+signature SGsAPEM_reset_mme(in charstring mme_name, out charstring vlr_name);
+
 type port SGsAPEM_PROC_PT procedure {
-   inout SGsAPEM_register;
+   inout SGsAPEM_register, SGsAPEM_reset_vlr, SGsAPEM_reset_mme;
 } with { extension "internal" };

 /* Function that can be used as create_cb and will usse t

Change in osmo-ttcn3-hacks[master]: SGsAP: Switch over to osmocom branch/repo to avoid bugs in official one

2018-10-28 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11486


Change subject: SGsAP: Switch over to osmocom branch/repo to avoid bugs in 
official one
..

SGsAP: Switch over to osmocom branch/repo to avoid bugs in official one

The VLR and MME name are octetstring with dns-style labels and not
character strings.

Change-Id: I31a8ea04ef508beba9014aac5479693c47b7b956
---
M deps/Makefile
M library/SGsAP_Templates.ttcn
2 files changed, 20 insertions(+), 20 deletions(-)



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

diff --git a/deps/Makefile b/deps/Makefile
index a1ac595..7cf9300 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -40,11 +40,11 @@
titan.ProtocolModules.LLC_v7.1.0 \
titan.ProtocolModules.MobileL3_v13.4.0 \
titan.ProtocolModules.NS_v7.3.0 \
-   titan.ProtocolModules.SGsAP_13.2.0 \
titan.ProtocolModules.SNDCP_v7.0.0 \
titan.ProtocolEmulations.SCCP

 OSMOGITHUB_REPOS=  titan.TestPorts.SCTPasp \
+   titan.ProtocolModules.SGsAP_13.2.0 \
titan.TestPorts.MTP3asp \
titan.ProtocolEmulations.M3UA

@@ -78,7 +78,7 @@
 titan.ProtocolModules.RTP_commit=  R.5.A
 titan.ProtocolModules.ROSE_commit= R.1.C
 titan.ProtocolModules.SCTP_commit= R.2.A
-titan.ProtocolModules.SGsAP_13.2.0_commit= R.1.B
+titan.ProtocolModules.SGsAP_13.2.0_commit= 
520dc48dd41ee15c9fd77e71d2ea7a05c58770b9
 titan.ProtocolModules.SDP_commit=  R.14.A
 titan.ProtocolModules.SMPP_commit= R.2.A-2-gb7aee69
 titan.ProtocolModules.SNDCP_v7.0.0_commit= R.2.A
diff --git a/library/SGsAP_Templates.ttcn b/library/SGsAP_Templates.ttcn
index aac045e..9526080 100644
--- a/library/SGsAP_Templates.ttcn
+++ b/library/SGsAP_Templates.ttcn
@@ -174,12 +174,12 @@


 /* 9.4.13 */
-template (value) MME_Name ts_SGsAP_IE_MmeName(template (value) charstring 
name) := {
+template (value) MME_Name ts_SGsAP_IE_MmeName(template (value) octetstring 
name) := {
iEI := '1001'B,
lengthIndicator := lengthof(valueof(name)),
name := name
 };
-template MME_Name tr_SGsAP_IE_MmeName(template charstring name) := {
+template MME_Name tr_SGsAP_IE_MmeName(template octetstring name) := {
iEI := '1001'B,
lengthIndicator := ?,
name := name
@@ -303,12 +303,12 @@


 /* 9.4.22 */
-template (value) VLR_Name ts_SGsAP_IE_VlrName(template (value) charstring 
name) := {
+template (value) VLR_Name ts_SGsAP_IE_VlrName(template (value) octetstring 
name) := {
iEI := '0010'B,
lengthIndicator := lengthof(name),
name := name
 }
-template VLR_Name tr_SGsAP_IE_VlrName(template charstring name) := {
+template VLR_Name tr_SGsAP_IE_VlrName(template octetstring name) := {
iEI := '0010'B,
lengthIndicator := ?,
name := name
@@ -397,7 +397,7 @@

 /* 8.6 */
 template (value) PDU_SGsAP ts_SGsAP_EPS_DETACH_IND(hexstring imsi,
-  template (value) charstring 
mme_name,
+  template (value) octetstring 
mme_name,
   template (value) 
IMSI_detachFromEPS_serviceType det_serv_typ) := {
sGsAP_EPS_DETACH_INDICATION:= {
messageType := '00010001'B,
@@ -407,7 +407,7 @@
}
 }
 template PDU_SGsAP tr_SGsAP_EPS_DETACH_IND(template hexstring imsi,
-  template charstring mme_name,
+  template octetstring mme_name,
   template 
IMSI_detachFromEPS_serviceType det_serv_typ) := {
sGsAP_EPS_DETACH_INDICATION:= {
messageType := '00010001'B,
@@ -433,7 +433,7 @@

 /* 8.8 */
 template (value) PDU_SGsAP ts_SGsAP_IMSI_DETACH_IND(hexstring imsi,
-   template (value) charstring 
mme_name,
+   template (value) 
octetstring mme_name,
template (value) 
IMSI_detachFromNonEPS_serviceType det_serv_typ) := {
sGsAP_IMSI_DETACH_INDICATION := {
messageType := '00010011'B,
@@ -443,7 +443,7 @@
}
 }
 template PDU_SGsAP tr_SGsAP_IMSI_DETACH_IND(template hexstring imsi,
-   template charstring mme_name := ?,
+   template octetstring mme_name := ?,
template 
IMSI_detachFromNonEPS_serviceType det_serv_typ := ?) := {
sGsAP_IMSI_DETACH_INDICATION := {
messageType := '00010011'B,
@@ -498,7 +498,7 @@

 /* 8.11

Change in osmo-ttcn3-hacks[master]: MCS_Tests: Integrate first SGs testscase (RESET procedure)

2018-10-28 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11488


Change subject: MCS_Tests: Integrate first SGs testscase (RESET procedure)
..

MCS_Tests: Integrate first SGs testscase (RESET procedure)

Change-Id: I38543c35a9e74cea276e58d1d7ef01ef07ffe858
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.default
M msc/MSC_Tests.ttcn
M msc/gen_links.sh
4 files changed, 52 insertions(+), 2 deletions(-)



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

diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index bf7a6d2..d259c8a 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -31,8 +31,10 @@

 import from SMPP_Emulation all;

+import from SGsAP_Emulation all;
+
 /* this component represents a single subscriber connection */
-type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, 
GSUP_ConnHdlr, MGCP_ConnHdlr, SMPP_ConnHdlr {
+type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, 
GSUP_ConnHdlr, MGCP_ConnHdlr, SMPP_ConnHdlr, SGsAP_ConnHdlr {
var BSC_ConnHdlrPars g_pars;
timer g_Tguard := 60.0;
 }
@@ -122,6 +124,8 @@
activate(as_Tguard());
/* Route all SMPP messages for our MSISDN to us */
f_create_smpp_expect(hex2str(pars.msisdn));
+   /* Route all SGs message for our IMSI to us */
+   f_create_sgsap_expect(pars.imsi);
 }


diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default
index a24fa38..f807228 100644
--- a/msc/MSC_Tests.default
+++ b/msc/MSC_Tests.default
@@ -22,6 +22,7 @@
 *.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
 *.MSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes"
 *.MSCVTY.PROMPT1 := "OsmoMSC> "
+*.SGsAP.sctp_stack := "kernel"


 [MODULE_PARAMETERS]
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 93d7c77..1f787f5 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -42,6 +42,10 @@
 import from BSSMAP_Emulation all;
 import from BSC_ConnectionHandler all;

+import from SGsAP_Templates all;
+import from SGsAP_Types all;
+import from SGsAP_Emulation all;
+
 import from MobileL3_Types all;
 import from MobileL3_CommonIE_Types all;
 import from L3_Templates all;
@@ -71,6 +75,7 @@
var GSUP_Emulation_CT vc_GSUP;
var IPA_Emulation_CT vc_GSUP_IPA;
var SMPP_Emulation_CT vc_SMPP;
+   var SGsAP_Emulation_CT vc_SGsAP;

/* only to get events from IPA underneath GSUP */
port IPA_CTRL_PT GSUP_IPA_EVENT;
@@ -191,6 +196,25 @@
vc_MGCP.start(MGCP_Emulation.main(ops, pars, id));
 }

+function f_init_sgsap(charstring id) runs on MTC_CT {
+   id := id & "-SGsAP";
+   var SGsAPOps ops := {
+   create_cb := refers(SGsAP_Emulation.ExpectedCreateCallback),
+   unitdata_cb := refers(SGsAP_Emulation.DummyUnitdataCallback)
+   }
+   var SGsAP_conn_parameters pars := {
+   remote_ip := mp_msc_ip,
+   remote_sctp_port := 29118,
+   local_ip := "",
+   local_sctp_port := -1
+   }
+
+   vc_SGsAP := SGsAP_Emulation_CT.create(id);
+   map(vc_SGsAP:SGsAP, system:SGsAP_CODEC_PT);
+   vc_SGsAP.start(SGsAP_Emulation.main(ops, pars, id));
+}
+
+
 function f_init_gsup(charstring id) runs on MTC_CT {
id := id & "-GSUP";
var GsupOps ops := {
@@ -245,6 +269,7 @@
f_init_mgcp("MSC_Test");
f_init_gsup("MSC_Test");
f_init_smpp("MSC_Test");
+   f_init_sgsap("MSC_Test");

map(self:MSCVTY, system:MSCVTY);
f_vty_set_prompts(MSCVTY);
@@ -479,6 +504,9 @@
/* SMPP part */
connect(vc_conn:SMPP, vc_SMPP:SMPP_CLIENT);
connect(vc_conn:SMPP_PROC, vc_SMPP:SMPP_PROC);
+   /* SGs part */
+   connect(vc_conn:SGsAP, vc_SGsAP:SGsAP_CLIENT);
+   connect(vc_conn:SGsAP_PROC, vc_SGsAP:SGsAP_PROC);

/* We cannot use vc_conn.start(f_init_handler(fn, id, pars)); as we 
cannot have
 * a stand-alone 'derefers()' call, see 
https://www.eclipse.org/forums/index.php/t/1091364/ */
@@ -2723,6 +2751,23 @@
* too long / short TLV values
  */

+private function f_tc_sgsap_reset(charstring id, BSC_ConnHdlrPars pars) runs 
on BSC_ConnHdlr {
+   /* This should be DNS-encoded, not a charstring */
+   var charstring mme_name := 
"mmec01.mmegi0001.mme.epc.mnc070.mcc901.3gppnetwork.org";
+   var charstring vlr_name;
+   f_init_handler(pars);
+
+   vlr_name := f_sgsap_reset_mme(mme_name);
+   log("VLR name: ", vlr_name);
+   setverdict(pass);
+}
+
+testcase TC_sgsap_reset() runs on MTC_CT {
+   var BSC_ConnHdlr vc_conn;
+   f_init();
+   vc_conn := f_start_handler(refers(f_tc_sgsap_reset), 10);
+   vc_conn.done;
+}

 control {
execute( TC_cr_before_reset() );
diff --git a/msc/gen_links.sh b/msc/gen_links.sh
index a394853..8d53d31 100755
--- a/msc/gen_links.sh
+++ b/msc/gen_links