add osmo_gsup_msgb_alloc()
Throughout osmo-hlr's code, the GSUP msgb allocation is duplicated as:
msgb_alloc_headroom(1024+16, 16, "foo");
Instead, use one common function to keep the magic numbers in one place.
Change-Id: I40e99b5bc4fd8f750da7643c03b2119ac3bfd95e
diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c
index 00023ba..8cdc15c 100644
--- a/src/hlr_ussd.c
+++ b/src/hlr_ussd.c
@@ -464,8 +464,7 @@
}
if (is_euse_originated) {
- msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW");
- OSMO_ASSERT(msg_out);
+ msg_out = osmo_gsup_msgb_alloc("GSUP USSD FW");
/* Received from EUSE, Forward to VLR */
osmo_gsup_encode(msg_out, gsup);
ss_gsup_send(ss, conn->server, msg_out);
@@ -481,8 +480,7 @@
LOGPSS(ss, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr);
ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SYSTEM_FAILURE);
} else {
- msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW");
- OSMO_ASSERT(msg_out);
+ msg_out = osmo_gsup_msgb_alloc("GSUP USSD FW");
osmo_gsup_encode(msg_out, gsup);
osmo_gsup_conn_send(conn, msg_out);
}