aboutsummaryrefslogtreecommitdiffstats
path: root/src/mtp_layer3.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-18 20:35:11 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-20 11:37:50 +0100
commitcfbe80febb4aa69dd293ef31418682cf72f81b47 (patch)
tree602b097eb0fa177b101841bbe69890f4d91eaf0b /src/mtp_layer3.c
parentadf7692031f4c1f8eca4af7ce0231065365c5dd8 (diff)
mtp: Send a TFA for the point codes we are routing to.
Diffstat (limited to 'src/mtp_layer3.c')
-rw-r--r--src/mtp_layer3.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c
index 6c2223f..fa428ed 100644
--- a/src/mtp_layer3.c
+++ b/src/mtp_layer3.c
@@ -101,7 +101,7 @@ static struct msgb *mtp_create_slta(struct mtp_link_set *link, struct mtp_level_
return out;
}
-static struct msgb *mtp_tfp_alloc(struct mtp_link_set *link, int apoc)
+static struct msgb *mtp_base_alloc(struct mtp_link_set *link, int msg, int apoc)
{
struct mtp_level_3_hdr *hdr;
struct mtp_level_3_prohib *prb;
@@ -114,11 +114,21 @@ static struct msgb *mtp_tfp_alloc(struct mtp_link_set *link, int apoc)
hdr->ser_ind = MTP_SI_MNT_SNM_MSG;
prb = (struct mtp_level_3_prohib *) msgb_put(out, sizeof(*prb));
prb->cmn.h0 = MTP_PROHIBIT_MSG_GRP;
- prb->cmn.h1 = MTP_PROHIBIT_MSG_SIG;
+ prb->cmn.h1 = msg;
prb->apoc = MTP_MAKE_APOC(apoc);
return out;
}
+static struct msgb *mtp_tfp_alloc(struct mtp_link_set *link, int apoc)
+{
+ return mtp_base_alloc(link, MTP_PROHIBIT_MSG_SIG, apoc);
+}
+
+static struct msgb *mtp_tfa_alloc(struct mtp_link_set *link, int apoc)
+{
+ return mtp_base_alloc(link, MTP_PROHIBIT_MSG_TFA, apoc);
+}
+
static struct msgb *mtp_tra_alloc(struct mtp_link_set *link, int opc)
{
struct mtp_level_3_hdr *hdr;
@@ -311,6 +321,16 @@ static int send_tra(struct mtp_link_set *link, int opc)
return 0;
}
+static int send_tfa(struct mtp_link_set *link, int opc)
+{
+ struct msgb *msg;
+ msg = mtp_tfa_alloc(link, opc);
+ if (!msg)
+ return -1;
+ mtp_link_set_submit(link->slc[0], msg);
+ return 0;
+}
+
static int mtp_link_sign_msg(struct mtp_link_set *link, struct mtp_level_3_hdr *hdr, int l3_len)
{
struct mtp_level_3_cmn *cmn;
@@ -349,10 +369,10 @@ static int mtp_link_sign_msg(struct mtp_link_set *link, struct mtp_level_3_hdr *
if (send_tra(link, link->opc) != 0)
return -1;
if (link->sccp_opc != link->opc &&
- send_tra(link, link->sccp_opc) != 0)
+ send_tfa(link, link->sccp_opc) != 0)
return -1;
if (link->isup_opc != link->opc &&
- send_tra(link, link->isup_opc) != 0)
+ send_tfa(link, link->isup_opc) != 0)
return -1;
link->sccp_up = 1;