aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-10-01 15:23:51 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-10-07 18:59:01 +0200
commit06cfe00c711a037981b53946dbaa5b042acb2fbb (patch)
treec61321ecde61322ecab9dcd65879b8d535de7d0c
parent8b4e58462167493e31109e965b4ad6c32d2215f1 (diff)
gsup: factor out header composition & sending.
Move IPA header composition and sending to new static gsup_client_send() (so I can use it in the upcoming OAP code). Sponsored-by: On-Waves ehf
-rw-r--r--openbsc/src/gprs/gprs_gsup_client.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gprs_gsup_client.c b/openbsc/src/gprs/gprs_gsup_client.c
index 807b0c113..1f9e34c83 100644
--- a/openbsc/src/gprs/gprs_gsup_client.c
+++ b/openbsc/src/gprs/gprs_gsup_client.c
@@ -100,6 +100,14 @@ static void connect_timer_cb(void *gsupc_)
gsup_client_connect(gsupc);
}
+static void gsup_client_send(struct gprs_gsup_client *gsupc, int proto_ext, struct msgb *msg_tx)
+{
+ ipa_prepend_header_ext(msg_tx, proto_ext);
+ ipa_msg_push_header(msg_tx, IPAC_PROTO_OSMO);
+ ipa_client_conn_send(gsupc->link, msg_tx);
+ /* msg_tx is now queued and will be freed. */
+}
+
static void gsup_client_updown_cb(struct ipa_client_conn *link, int up)
{
struct gprs_gsup_client *gsupc = link->data;
@@ -275,9 +283,7 @@ int gprs_gsup_client_send(struct gprs_gsup_client *gsupc, struct msgb *msg)
return -EAGAIN;
}
- ipa_prepend_header_ext(msg, IPAC_PROTO_EXT_GSUP);
- ipa_msg_push_header(msg, IPAC_PROTO_OSMO);
- ipa_client_conn_send(gsupc->link, msg);
+ gsup_client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg);
return 0;
}