Change in libosmocore[master]: GSUP: introduce new messages for SS/USSD payloads

2018-05-31 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/7600 )

Change subject: GSUP: introduce new messages for SS/USSD payloads
..

GSUP: introduce new messages for SS/USSD payloads

In order to be able to transfer SS/USSD messages via GSUP,
this change introduces the following new message types:

  - OSMO_GSUP_MSGT_PROC_SS_*,

and the following new IE:

  - OSMO_GSUP_SS_INFO_IE

which represents an ASN.1 encoded MAP payload coming to/from
the mobile station 'as is', without any transcoding.

Change-Id: Ie17a78043a35fffbdd59e80fd2b2da39cce5e532
Related: OS#1597
---
M TODO-RELEASE
M include/osmocom/gsm/gsup.h
M src/gsm/gsup.c
M tests/gsup/gsup_test.c
M tests/gsup/gsup_test.err
M tests/gsup/gsup_test.ok
6 files changed, 87 insertions(+), 1 deletion(-)

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



diff --git a/TODO-RELEASE b/TODO-RELEASE
index d984813..7b225cc 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -9,3 +9,4 @@
 #library   whatdescription / commit summary line
 gsup   gsup.h  the 'osmo_gsup_message' struct 
extended with
session information => ABI 
changed
+   SS/USSD information => ABI 
changed
diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h
index 5f45699..dd27493 100644
--- a/include/osmocom/gsm/gsup.h
+++ b/include/osmocom/gsm/gsup.h
@@ -85,6 +85,9 @@

OSMO_GSUP_SESSION_ID_IE = 0x30,
OSMO_GSUP_SESSION_STATE_IE  = 0x31,
+
+   /*! Supplementary Services payload */
+   OSMO_GSUP_SS_INFO_IE= 0x35,
 };

 /*! GSUP message type */
@@ -114,6 +117,10 @@
OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST  = 0b00011100,
OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR= 0b00011101,
OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT   = 0b0000,
+
+   OSMO_GSUP_MSGT_PROC_SS_REQUEST  = 0b0010,
+   OSMO_GSUP_MSGT_PROC_SS_ERROR= 0b0011,
+   OSMO_GSUP_MSGT_PROC_SS_RESULT   = 0b00100010,
 };

 #define OSMO_GSUP_IS_MSGT_REQUEST(msgt) (((msgt) & 0b0011) == 0b00)
@@ -197,6 +204,10 @@
/*! Unique session identifier and origination flag.
  * Encoded only when \ref session_state != 0x00 */
uint32_tsession_id;
+
+   /*! ASN.1 encoded MAP payload for Supplementary Services */
+   uint8_t *ss_info;
+   size_t  ss_info_len;
 };

 int osmo_gsup_decode(const uint8_t *data, size_t data_len,
diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c
index 8663f44..b4b60b2 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -62,6 +62,11 @@
OSMO_VALUE_STRING(OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST),
OSMO_VALUE_STRING(OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR),
OSMO_VALUE_STRING(OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT),
+
+   OSMO_VALUE_STRING(OSMO_GSUP_MSGT_PROC_SS_REQUEST),
+   OSMO_VALUE_STRING(OSMO_GSUP_MSGT_PROC_SS_ERROR),
+   OSMO_VALUE_STRING(OSMO_GSUP_MSGT_PROC_SS_RESULT),
+
{ 0, NULL }
 };

@@ -393,6 +398,11 @@
gsup_msg->session_state = *value;
break;

+   case OSMO_GSUP_SS_INFO_IE:
+   gsup_msg->ss_info = value;
+   gsup_msg->ss_info_len = value_len;
+   break;
+
default:
LOGP(DLGSUP, LOGL_NOTICE,
 "GSUP IE type %d unknown\n", iei);
@@ -580,6 +590,11 @@
msgb_tlv_put(msg, OSMO_GSUP_SESSION_STATE_IE, sizeof(u8), );
}

+   if (gsup_msg->ss_info) {
+   msgb_tlv_put(msg, OSMO_GSUP_SS_INFO_IE,
+   gsup_msg->ss_info_len, gsup_msg->ss_info);
+   }
+
return 0;
 }

diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index 6ead7d2..9712d77 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -180,6 +180,43 @@
0x31, 0x01, 0x01,
};

+   static const uint8_t send_ussd_req[] = {
+   0x20, /* OSMO_GSUP_MSGT_PROC_SS_REQUEST */
+   TEST_IMSI_IE,
+
+   /* Session ID and state */
+   0x30, 0x04, 0xde, 0xad, 0xbe, 0xef,
+   0x31, 0x01, 0x01,
+
+   /* SS/USSD information IE */
+   0x35, 0x14,
+   /* ASN.1 encoded MAP payload */
+   0xa1, 0x12,
+   0x02, 0x01, /* Component: invoke */
+   0x01, /* invokeID = 1 */
+   /* opCode: processUnstructuredSS-Request */
+   0x02, 0x01, 0x3b, 0x30, 0x0a, 0x04, 0x01, 0x0f,
+   0x04, 

Change in libosmocore[master]: GSUP: introduce new messages for SS/USSD payloads

2018-05-31 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/7600 )

Change subject: GSUP: introduce new messages for SS/USSD payloads
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/7600
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: Ie17a78043a35fffbdd59e80fd2b2da39cce5e532
Gerrit-Change-Number: 7600
Gerrit-PatchSet: 5
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 31 May 2018 13:29:09 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: GSUP: introduce new messages for SS/USSD payloads

2018-05-30 Thread Alexander Chemeris
Alexander Chemeris has posted comments on this change. ( 
https://gerrit.osmocom.org/7600 )

Change subject: GSUP: introduce new messages for SS/USSD payloads
..


Patch Set 5:

(1 comment)

https://gerrit.osmocom.org/#/c/7600/5/tests/gsup/gsup_test.c
File tests/gsup/gsup_test.c:

https://gerrit.osmocom.org/#/c/7600/5/tests/gsup/gsup_test.c@323
PS5, Line 323: maximal
s/maximal/maximum/



--
To view, visit https://gerrit.osmocom.org/7600
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: Ie17a78043a35fffbdd59e80fd2b2da39cce5e532
Gerrit-Change-Number: 7600
Gerrit-PatchSet: 5
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Wed, 30 May 2018 22:28:57 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: GSUP: introduce new messages for SS/USSD payloads

2018-05-30 Thread Vadim Yanitskiy
Hello Alexander Chemeris, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/7600

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

Change subject: GSUP: introduce new messages for SS/USSD payloads
..

GSUP: introduce new messages for SS/USSD payloads

In order to be able to transfer SS/USSD messages via GSUP,
this change introduces the following new message types:

  - OSMO_GSUP_MSGT_PROC_SS_*,

and the following new IE:

  - OSMO_GSUP_SS_INFO_IE

which represents an ASN.1 encoded MAP payload coming to/from
the mobile station 'as is', without any transcoding.

Change-Id: Ie17a78043a35fffbdd59e80fd2b2da39cce5e532
Related: OS#1597
---
M TODO-RELEASE
M include/osmocom/gsm/gsup.h
M src/gsm/gsup.c
M tests/gsup/gsup_test.c
M tests/gsup/gsup_test.err
M tests/gsup/gsup_test.ok
6 files changed, 87 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/7600/5
--
To view, visit https://gerrit.osmocom.org/7600
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie17a78043a35fffbdd59e80fd2b2da39cce5e532
Gerrit-Change-Number: 7600
Gerrit-PatchSet: 5
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy