Change in libosmocore[master]: Introduce fields related to DTAP DLCI

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Nov 28 16:11:02 UTC 2019


pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/16259 )

Change subject: Introduce fields related to DTAP DLCI
......................................................................

Introduce fields related to DTAP DLCI

Change-Id: Iec448af02d28e6c5c573e68a0b4a86067ec7e561
---
M include/osmocom/gsm/protocol/gsm_08_08.h
M src/gsm/gsm0808.c
M src/gsm/libosmogsm.map
3 files changed, 36 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h
index a540609..e791b07 100644
--- a/include/osmocom/gsm/protocol/gsm_08_08.h
+++ b/include/osmocom/gsm/protocol/gsm_08_08.h
@@ -7,6 +7,7 @@
 #include <stdint.h>
 #include <osmocom/core/linuxlist.h>
 #include <osmocom/core/utils.h>
+#include <osmocom/core/endian.h>
 
 /*
  * this is from GSM 03.03 CGI but is copied in GSM 08.08
@@ -40,11 +41,37 @@
 } __attribute__((packed));
 
 struct dtap_header {
+#if OSMO_IS_LITTLE_ENDIAN
 	uint8_t type;
-	uint8_t link_id;
+	union {
+		uint8_t link_id;  /* Backward compatibility */
+		struct {
+			uint8_t dlci_cc:2,
+			dlci_spare:3,
+			dlci_sapi:3; /* enum gsm0406_dlc_sapi */
+		};
+	};
 	uint8_t length;
+#elif OSMO_IS_BIG_ENDIAN
+	uint8_t type;
+	union {
+		uint8_t link_id;
+		struct {
+			uint8_t dlci_sapi:3, dlci_spare:3, dlci_cc:2;
+		};
+	};
+	uint8_t length;
+#endif
 } __attribute__((packed));
 
+/* Data Link Control SAPI, GSM 08.06 § 6.3.2, GSM 04.06 § 3.3.3 */
+enum gsm0406_dlci_sapi {
+	DLCI_SAPI_RR_MM_CC	= 0x0,
+	DLCI_SAPI_SMS		= 0x3,
+};
+extern const struct value_string gsm0406_dlci_sapi_names[];
+static inline const char *gsm0406_dlci_sapi_name(enum gsm0406_dlci_sapi val)
+{ return get_value_string(gsm0406_dlci_sapi_names, val); }
 
 enum BSS_MAP_MSG_TYPE {
 	BSS_MAP_MSG_RESERVED_0		= 0,
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 514d7f2..f9f7b58 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -1399,6 +1399,12 @@
 	return &bss_att_tlvdef;
 }
 
+const struct value_string gsm0406_dlci_sapi_names[] = {
+	{ DLCI_SAPI_RR_MM_CC,	"RR/MM/CC" },
+	{ DLCI_SAPI_SMS,	"SMS" },
+	{ 0, NULL }
+};
+
 static const struct value_string gsm0808_msgt_names[] = {
 	{ BSS_MAP_MSG_ASSIGMENT_RQST,		"ASSIGNMENT REQ" },
 	{ BSS_MAP_MSG_ASSIGMENT_COMPLETE,	"ASSIGNMENT COMPL" },
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index a0e3b32..efca0a5 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -86,6 +86,8 @@
 
 gsm0341_build_msg;
 
+gsm0406_dlci_sapi_names;
+
 gsm0480_create_notifySS;
 gsm0480_create_unstructuredSS_Notify;
 gsm0480_create_ussd_resp;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iec448af02d28e6c5c573e68a0b4a86067ec7e561
Gerrit-Change-Number: 16259
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191128/068485f7/attachment.htm>


More information about the gerrit-log mailing list