From 3aad776b280c889a5432e51fbdbe78ef1af624c9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 10 Dec 2010 12:18:57 +0100 Subject: isup: Respond to a ISUP GRS with a GRA. --- src/mtp_layer3.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/mtp_layer3.c') diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c index 4490c8b..78db37c 100644 --- a/src/mtp_layer3.c +++ b/src/mtp_layer3.c @@ -34,6 +34,8 @@ static void *tall_mtp_ctx = NULL; +static int mtp_int_submit(struct mtp_link *link, int sls, int type, const uint8_t *data, unsigned int length); + static struct msgb *mtp_msg_alloc(struct mtp_link *link) { struct mtp_level_3_hdr *hdr; @@ -500,21 +502,34 @@ int mtp_link_data(struct mtp_link *link, struct msgb *msg) int mtp_link_submit_sccp_data(struct mtp_link *link, int sls, const uint8_t *data, unsigned int length) { - uint8_t *put_ptr; - struct mtp_level_3_hdr *hdr; - struct msgb *msg; if (!link->sccp_up) { LOGP(DINP, LOGL_ERROR, "SCCP msg after TRA and before SSA. Dropping it.\n"); return -1; } + return mtp_int_submit(link, sls, MTP_SI_MNT_SCCP, data, length); +} + +int mtp_link_submit_isup_data(struct mtp_link *link, int sls, + const uint8_t *data, unsigned int length) +{ + return mtp_int_submit(link, sls, MTP_SI_MNT_ISUP, data, length); +} + +static int mtp_int_submit(struct mtp_link *link, int sls, int type, + const uint8_t *data, unsigned int length) +{ + uint8_t *put_ptr; + struct mtp_level_3_hdr *hdr; + struct msgb *msg; + msg = mtp_msg_alloc(link); if (!msg) return -1; hdr = (struct mtp_level_3_hdr *) msg->l2h; - hdr->ser_ind = MTP_SI_MNT_SCCP; + hdr->ser_ind = type; hdr->addr = MTP_ADDR(sls % 16, link->dpc, link->opc); -- cgit v1.2.3