Change in libosmocore[master]: bssgp_bvc_fsm: Set/get maximum BSSGP PDU length

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

daniel gerrit-no-reply at lists.osmocom.org
Fri Feb 12 14:19:21 UTC 2021


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

Change subject: bssgp_bvc_fsm: Set/get maximum BSSGP PDU length
......................................................................

bssgp_bvc_fsm: Set/get maximum BSSGP PDU length

Add functions to get/set the maximum supported BSSGP PDU size by the NS
layer.

IPv4 and IPv6 should not matter since we can just enable IP
fragmentation and send NS PDUs up to 2**16 + bytes. Frame relay does not
support fragmentation and this is the reason we need to be aware of the
maximum PDU size. Luckily with 1600 bytes the MTU in frame relay can hold a
regular IP packet including NS/BSSGP overhead.

On the NS layer this corresponds to the size of an NS SDU in NS-UNITDATA
(3GPP TS 48.016 Ch. 9.2.10)

Change-Id: I9bb82ead27366b7370c9ff968e03ca2113ec11f0
Related: OS#4889
---
M include/osmocom/gprs/bssgp_bvc_fsm.h
M src/gb/bssgp_bvc_fsm.c
M src/gb/libosmogb.map
3 files changed, 28 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/gprs/bssgp_bvc_fsm.h b/include/osmocom/gprs/bssgp_bvc_fsm.h
index e69c205..824cdec 100644
--- a/include/osmocom/gprs/bssgp_bvc_fsm.h
+++ b/include/osmocom/gprs/bssgp_bvc_fsm.h
@@ -64,3 +64,6 @@
 uint32_t bssgp_bvc_get_features_advertised(struct osmo_fsm_inst *fi);
 uint32_t bssgp_bvc_get_features_received(struct osmo_fsm_inst *fi);
 uint32_t bssgp_bvc_get_features_negotiated(struct osmo_fsm_inst *fi);
+
+void bssgp_bvc_fsm_set_max_pdu_len(struct osmo_fsm_inst *fi, uint16_t max_pdu_len);
+uint16_t bssgp_bvc_fsm_get_max_pdu_len(const struct osmo_fsm_inst *fi);
\ No newline at end of file
diff --git a/src/gb/bssgp_bvc_fsm.c b/src/gb/bssgp_bvc_fsm.c
index 6b8bd14..d2ee146 100644
--- a/src/gb/bssgp_bvc_fsm.c
+++ b/src/gb/bssgp_bvc_fsm.c
@@ -116,6 +116,8 @@
 
 	/* NSEI of the underlying NS Entity */
 	uint16_t nsei;
+	/* Maximum size of the BSSGP PDU */
+	uint16_t max_pdu_len;
 
 	/* BVCI of this BVC */
 	uint16_t bvci;
@@ -666,6 +668,7 @@
 	bfp->role_sgsn = role_sgsn;
 	bfp->nsei = nsei;
 	bfp->bvci = bvci;
+	bfp->max_pdu_len = UINT16_MAX;
 
 	return fi;
 }
@@ -817,6 +820,26 @@
 	return bfp->features.negotiated;
 }
 
+/*! Set the maximum size of a BSSGP PDU.
+ *! On the NS layer this corresponds to the size of an NS SDU in NS-UNITDATA (3GPP TS 48.016 Ch. 9.2.10) */
+void bssgp_bvc_fsm_set_max_pdu_len(struct osmo_fsm_inst *fi, uint16_t max_pdu_len) {
+	struct bvc_fsm_priv *bfp = fi->priv;
+
+	OSMO_ASSERT(fi->fsm == &bssgp_bvc_fsm);
+	bfp->max_pdu_len = max_pdu_len;
+}
+
+/*! Return the maximum size of a BSSGP PDU
+ *! On the NS layer this corresponds to the size of an NS SDU in NS-UNITDATA (3GPP TS 48.016 Ch. 9.2.10) */
+uint16_t bssgp_bvc_fsm_get_max_pdu_len(const struct osmo_fsm_inst *fi)
+{
+	const struct bvc_fsm_priv *bfp = fi->priv;
+
+	OSMO_ASSERT(fi->fsm == &bssgp_bvc_fsm);
+	return bfp->max_pdu_len;
+}
+
+
 static __attribute__((constructor)) void on_dso_load_bvc_fsm(void)
 {
 	OSMO_ASSERT(osmo_fsm_register(&bssgp_bvc_fsm) == 0);
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index 7da11cd..2327815 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -96,6 +96,8 @@
 bssgp_bvc_get_features_advertised;
 bssgp_bvc_get_features_received;
 bssgp_bvc_get_features_negotiated;
+bssgp_bvc_fsm_set_max_pdu_len;
+bssgp_bvc_fsm_get_max_pdu_len;
 
 osmo_fr_network_alloc;
 osmo_fr_link_alloc;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9bb82ead27366b7370c9ff968e03ca2113ec11f0
Gerrit-Change-Number: 22873
Gerrit-PatchSet: 3
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
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/20210212/d81a17a2/attachment.htm>


More information about the gerrit-log mailing list