aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarehbein <arehbein@sysmocom.de>2023-07-05 16:41:09 +0200
committerdaniel <dwillmann@sysmocom.de>2023-07-18 09:55:26 +0000
commit4ff5db2839674f5ba082b99fffe407c6107f2182 (patch)
treedbdfb04965e15af1c5f8bc8390f988072dd36a96
parentd0d9ecbad1a16a61fedfb625f37e30b63847a9d8 (diff)
Revert "gsm/ipa: Add segmentation callback"
It has been decided that the segmentation callback be changed and moved to libosmo-netif, so we remove it here. This reverts commit 2c59d1285e8f4c47122e1749ff1ac60e99a1874e. Related: OS#5753 Change-Id: I9b380326c63587fc79d6a5d8cd458188074fc55d
-rw-r--r--include/osmocom/gsm/ipa.h3
-rw-r--r--src/gsm/ipa.c29
-rw-r--r--src/gsm/libosmogsm.map1
3 files changed, 0 insertions, 33 deletions
diff --git a/include/osmocom/gsm/ipa.h b/include/osmocom/gsm/ipa.h
index 8a4dd3ff..851b58e0 100644
--- a/include/osmocom/gsm/ipa.h
+++ b/include/osmocom/gsm/ipa.h
@@ -79,6 +79,3 @@ struct msgb *ipa_msg_alloc(int headroom);
int ipa_msg_recv(int fd, struct msgb **rmsg);
int ipa_msg_recv_buffered(int fd, struct msgb **rmsg, struct msgb **tmp_msg);
-
-/* Callback for segmenting TCP stream data into IPA packets */
-int ipa_segmentation_cb(struct msgb *msg);
diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index 40926144..cd95c6bb 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -30,7 +30,6 @@
#include <stdint.h>
#include <errno.h>
#include <stdlib.h>
-#include <inttypes.h>
#include <sys/types.h>
@@ -719,32 +718,4 @@ struct msgb *ipa_msg_alloc(int headroom)
return nmsg;
}
-/*! Segmentation callback used by libosmo-netif streaming backend
- * See definition of `struct osmo_io_ops` for callback semantics
- * \param[in] msg Original `struct msgb` received via osmo_io
- * \returns The total packet length indicated by the first header,
- * otherwise
- * -EAGAIN, if the header has not been read yet,
- * -ENOBUFS, if the header declares a payload too large
- */
-int ipa_segmentation_cb(struct msgb *msg)
-{
- const struct ipaccess_head *hh = (const struct ipaccess_head *) msg->data;
- size_t payload_len, total_len;
- size_t available = msgb_length(msg) + msgb_tailroom(msg);
- if (msgb_length(msg) < sizeof(*hh)) {
- /* Haven't even read the entire header */
- return -EAGAIN;
- }
- payload_len = osmo_ntohs(hh->len);
- total_len = sizeof(*hh) + payload_len;
- if (OSMO_UNLIKELY(available < total_len)) {
- LOGP(DLINP, LOGL_ERROR, "Not enough space left in message buffer. "
- "Have %zu octets, but need %zu\n",
- available, total_len);
- return -ENOBUFS;
- }
- return total_len;
-}
-
/*! @} */
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 0dfffd34..951cbcbf 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -691,7 +691,6 @@ ipa_ccm_id_get_parse;
ipa_ccm_id_resp_parse;
ipa_ccm_make_id_resp;
ipa_ccm_make_id_resp_from_req;
-ipa_segmentation_cb;
ipa_msg_alloc;
ipa_msg_recv;
ipa_msg_recv_buffered;