Change in libosmocore[master]: WIP

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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon May 13 15:40:35 UTC 2019


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/14017


Change subject: WIP
......................................................................

WIP

Change-Id: I28f83e2e32b9533c99e65ccc1562900ac2aec74e
---
M include/osmocom/gsm/gsm0808_utils.h
M include/osmocom/gsm/protocol/gsm_08_08.h
M src/gsm/gsm0808.c
M src/gsm/gsm0808_utils.c
M src/gsm/libosmogsm.map
5 files changed, 29 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/14017/1

diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h
index 3a7beb7..9cfaea6 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -100,6 +100,7 @@
 				    const struct sockaddr_storage *ss);
 int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss,
 				const uint8_t *elem, uint8_t len);
+int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len);
 
 uint8_t gsm0808_enc_lcls(struct msgb *msg, const struct osmo_lcls *lcls);
 int gsm0808_dec_lcls(struct osmo_lcls *lcls, const struct tlv_parsed *tp);
diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h
index aa01ee5..9806e08 100644
--- a/include/osmocom/gsm/protocol/gsm_08_08.h
+++ b/include/osmocom/gsm/protocol/gsm_08_08.h
@@ -303,6 +303,10 @@
 	GSM0808_IE_SELECTED_OPERATOR		= 0x98,
 	GSM0808_IE_PS_REGISTERED_OPERATOR	= 0x99,
 	GSM0808_IE_CS_REGISTERED_OPERATOR	= 0x9a,
+
+	/* Osmocom extensions: */
+	GSM0808_IE_OSMO_OSMUX_SUPPORT		= 0xf0,
+	GSM0808_IE_OSMO_OSMUX_CID		= 0xf1,
 };
 
 /* 3GPP TS 48.008 3.2.3 Signalling Field Element Coding */
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 3c77c77..514d7f2 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -1387,6 +1387,10 @@
 		[GSM0808_IE_CN_TO_MS_TRANSP_INFO]	= { TLV_TYPE_TLV },
 		[GSM0808_IE_SELECTED_PLMN_ID]		= { TLV_TYPE_FIXED, 3 },
 		[GSM0808_IE_LAST_USED_EUTRAN_PLMN_ID]	= { TLV_TYPE_FIXED, 3 },
+
+		/* Osmocom extensions */
+		[GSM0808_IE_OSMO_OSMUX_SUPPORT]		= { TLV_TYPE_T },
+		[GSM0808_IE_OSMO_OSMUX_CID]		= { TLV_TYPE_TV },
 	},
 };
 
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index e825930..26f7944 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -172,6 +172,25 @@
 	return (int)(elem - old_elem);
 }
 
+/*! Decode TS 08.08 (Osmocom Extension) Osmux CID
+ *  TV with len(V) == 1, and V is the CID to be used.
+ *  \param[out] cid Caller-provided variable where CID is stored
+ *  \param[in] elem pointer to IE value
+ *  \param[in] len length of \a elem in bytes
+ *  \returns number of bytes parsed */
+int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len)
+{
+	OSMO_ASSERT(cid);
+	if (!elem)
+		return -EINVAL;
+	if (len != 1)
+		return -EINVAL;
+
+	*cid = *elem;
+
+	return 1;
+}
+
 #endif /* HAVE_SYS_SOCKET_H */
 
 /* Helper function for gsm0808_enc_speech_codec()
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 840bac9..0f4a0db 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -198,6 +198,7 @@
 gsm0808_enc_cause;
 gsm0808_enc_aoip_trasp_addr;
 gsm0808_dec_aoip_trasp_addr;
+gsm0808_dec_osmux_cid;
 gsm0808_enc_speech_codec;
 gsm0808_dec_speech_codec;
 gsm0808_enc_speech_codec_list;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I28f83e2e32b9533c99e65ccc1562900ac2aec74e
Gerrit-Change-Number: 14017
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190513/bb91dbcd/attachment.htm>


More information about the gerrit-log mailing list