Change in libosmocore[master]: bssgp_bvc_fsm: Add MTU support

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 02:33:43 UTC 2021


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


Change subject: bssgp_bvc_fsm: Add MTU support
......................................................................

bssgp_bvc_fsm: Add MTU support

Add functions to get/set the current MTU
Default to max MTU size

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, 27 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/22873/1

diff --git a/include/osmocom/gprs/bssgp_bvc_fsm.h b/include/osmocom/gprs/bssgp_bvc_fsm.h
index e69c205..d5096b9 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_mtu(struct osmo_fsm_inst *fi, uint16_t mtu);
+uint16_t bssgp_bvc_fsm_get_mtu(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..a1edf58 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;
+	/* MTU of the underlying NS Entity */
+	uint16_t mtu;
 
 	/* BVCI of this BVC */
 	uint16_t bvci;
@@ -666,6 +668,7 @@
 	bfp->role_sgsn = role_sgsn;
 	bfp->nsei = nsei;
 	bfp->bvci = bvci;
+	bfp->mtu = UINT16_MAX;
 
 	return fi;
 }
@@ -817,6 +820,25 @@
 	return bfp->features.negotiated;
 }
 
+/*! Set the maximum size of a BSSGP PDU */
+void bssgp_bvc_fsm_set_mtu(struct osmo_fsm_inst *fi, uint16_t mtu)
+{
+	struct bvc_fsm_priv *bfp = fi->priv;
+
+	OSMO_ASSERT(fi->fsm == &bssgp_bvc_fsm);
+	bfp->mtu = mtu;
+}
+
+/*! Return the maximum size of a BSSGP PDU */
+uint16_t bssgp_bvc_fsm_get_mtu(const struct osmo_fsm_inst *fi)
+{
+	const struct bvc_fsm_priv *bfp = fi->priv;
+
+	OSMO_ASSERT(fi->fsm == &bssgp_bvc_fsm);
+	return bfp->mtu;
+}
+
+
 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 a3171d0..fe7c4ec 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_mtu;
+bssgp_bvc_fsm_get_mtu;
 
 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: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210212/59ce2875/attachment.htm>


More information about the gerrit-log mailing list