pespin has uploaded this change for review.

View Change

Use use new osmo_stream_{cli,srv}_set_segmentation_cb2

The older API osmo_stream_{cli,srv}_set_segmentation_cb() is now
deprecated, use the newer one.

Depends: libosmo-netif.git 519912781a463fa25bf3c7b18def11076e377fb6
Change-Id: I2be4d3a650fa5231f2fdd55325a8d9238d1ba70c
---
M TODO-RELEASE
M src/osmo_ss7_asp.c
M src/osmo_ss7_xua_srv.c
3 files changed, 30 insertions(+), 7 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/83/39383/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 101d9cd..c8cc534 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -16,3 +16,4 @@
libosmo-sigtran add API osmo_ss7_as_get_asp_protocol(), osmo_ss7_as_select_asp()
libosmo-sigtran add API osmo_ss7_user: create(), get_instance(), set_prim_cb(), set_priv(), get_priv()
libosmo-sigtran Make private struct osmo_ss7_instance
+libosmo-netif >1.5.0 Use osmo_stream_srv_set_segmentation_cb2()
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index d81d25c..9d4fa98 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -608,6 +608,8 @@
static int xua_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg);
static int ipa_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg);
static int m3ua_tcp_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg);
+static int ipa_cli_segmentation_cb2(struct osmo_stream_cli *conn, struct msgb *msg);
+static int m3ua_tcp_cli_segmentation_cb2(struct osmo_stream_cli *conn, struct msgb *msg);
static int xua_cli_connect_cb(struct osmo_stream_cli *cli);
static int xua_cli_close_and_reconnect(struct osmo_stream_cli *cli);

@@ -652,22 +654,22 @@
case OSMO_SS7_ASP_PROT_IPA:
OSMO_ASSERT(asp->cfg.trans_proto == IPPROTO_TCP);
osmo_stream_cli_set_read_cb2(asp->client, ipa_cli_read_cb);
- osmo_stream_cli_set_segmentation_cb(asp->client, osmo_ipa_segmentation_cb);
+ osmo_stream_cli_set_segmentation_cb2(asp->client, ipa_cli_segmentation_cb2);
break;
case OSMO_SS7_ASP_PROT_M3UA:
if (asp->cfg.trans_proto == IPPROTO_SCTP) {
osmo_stream_cli_set_read_cb2(asp->client, xua_cli_read_cb);
- osmo_stream_cli_set_segmentation_cb(asp->client, NULL);
+ osmo_stream_cli_set_segmentation_cb2(asp->client, NULL);
} else if (asp->cfg.trans_proto == IPPROTO_TCP) {
osmo_stream_cli_set_read_cb2(asp->client, m3ua_tcp_cli_read_cb);
- osmo_stream_cli_set_segmentation_cb(asp->client, xua_tcp_segmentation_cb);
+ osmo_stream_cli_set_segmentation_cb2(asp->client, m3ua_tcp_cli_segmentation_cb2);
} else
OSMO_ASSERT(0);
break;
default:
OSMO_ASSERT(asp->cfg.trans_proto == IPPROTO_SCTP);
osmo_stream_cli_set_read_cb2(asp->client, xua_cli_read_cb);
- osmo_stream_cli_set_segmentation_cb(asp->client, NULL);
+ osmo_stream_cli_set_segmentation_cb2(asp->client, NULL);
break;
}
osmo_stream_cli_set_data(asp->client, asp);
@@ -980,6 +982,11 @@
return 0;
}

+static int ipa_cli_segmentation_cb2(struct osmo_stream_cli *cli, struct msgb *msg)
+{
+ return osmo_ipa_segmentation_cb(msg);
+}
+
/* read call-back for IPA/SCCPlite socket */
static int ipa_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg)
{
@@ -1003,6 +1010,11 @@
return ipa_rx_msg(asp, msg, fd & 0xf);
}

+static int m3ua_tcp_cli_segmentation_cb2(struct osmo_stream_cli *conn, struct msgb *msg)
+{
+ return xua_tcp_segmentation_cb(msg);
+}
+
/* read call-back for M3UA-over-TCP socket */
static int m3ua_tcp_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg)
{
diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c
index 4962bfd..7d7e54a 100644
--- a/src/osmo_ss7_xua_srv.c
+++ b/src/osmo_ss7_xua_srv.c
@@ -61,6 +61,16 @@
* SS7 xUA Server
***********************************************************************/

+static int xua_srv_ipa_segmentation_cb2(struct osmo_stream_srv *conn, struct msgb *msg)
+{
+ return osmo_ipa_segmentation_cb(msg);
+}
+
+static int xua_srv_tcp_segmentation_cb2(struct osmo_stream_srv *conn, struct msgb *msg)
+{
+ return osmo_ipa_segmentation_cb(msg);
+}
+
/* server has accept()ed a new SCTP association, let's find the ASP for
* it (if any) */
static int xua_accept_cb(struct osmo_stream_srv_link *link, int fd)
@@ -88,21 +98,21 @@
switch (oxs->cfg.proto) {
case OSMO_SS7_ASP_PROT_IPA:
osmo_stream_srv_set_read_cb(srv, ss7_asp_ipa_srv_conn_rx_cb);
- osmo_stream_srv_set_segmentation_cb(srv, osmo_ipa_segmentation_cb);
+ osmo_stream_srv_set_segmentation_cb2(srv, xua_srv_ipa_segmentation_cb2);
break;
case OSMO_SS7_ASP_PROT_M3UA:
if (oxs->cfg.trans_proto == IPPROTO_SCTP)
osmo_stream_srv_set_read_cb(srv, &ss7_asp_xua_srv_conn_rx_cb);
else if (oxs->cfg.trans_proto == IPPROTO_TCP) {
osmo_stream_srv_set_read_cb(srv, &ss7_asp_m3ua_tcp_srv_conn_rx_cb);
- osmo_stream_srv_set_segmentation_cb(srv, xua_tcp_segmentation_cb);
+ osmo_stream_srv_set_segmentation_cb2(srv, xua_srv_tcp_segmentation_cb2);
} else
OSMO_ASSERT(0);
break;
default:
OSMO_ASSERT(oxs->cfg.trans_proto == IPPROTO_SCTP);
osmo_stream_srv_set_read_cb(srv, &ss7_asp_xua_srv_conn_rx_cb);
- osmo_stream_srv_set_segmentation_cb(srv, NULL);
+ osmo_stream_srv_set_segmentation_cb2(srv, NULL);
break;
}
osmo_stream_srv_set_closed_cb(srv, ss7_asp_xua_srv_conn_closed_cb);

To view, visit change 39383. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I2be4d3a650fa5231f2fdd55325a8d9238d1ba70c
Gerrit-Change-Number: 39383
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>