diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-18 19:01:43 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-20 11:37:50 +0100 |
commit | adf7692031f4c1f8eca4af7ce0231065365c5dd8 (patch) | |
tree | c350d004e7d2d61701c33a57b96ec7f7b61d3382 /src/mtp_layer3.c | |
parent | 27c5e2357fb2ad60c952db6688e5d93f3e7131b3 (diff) |
mtp: Send TRA messages on all affected point codes
Diffstat (limited to 'src/mtp_layer3.c')
-rw-r--r-- | src/mtp_layer3.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c index 5826dd4..6c2223f 100644 --- a/src/mtp_layer3.c +++ b/src/mtp_layer3.c @@ -119,7 +119,7 @@ static struct msgb *mtp_tfp_alloc(struct mtp_link_set *link, int apoc) return out; } -static struct msgb *mtp_tra_alloc(struct mtp_link_set *link) +static struct msgb *mtp_tra_alloc(struct mtp_link_set *link, int opc) { struct mtp_level_3_hdr *hdr; struct mtp_level_3_cmn *cmn; @@ -130,6 +130,7 @@ static struct msgb *mtp_tra_alloc(struct mtp_link_set *link) hdr = (struct mtp_level_3_hdr *) out->l2h; hdr->ser_ind = MTP_SI_MNT_SNM_MSG; + hdr->addr = MTP_ADDR(0x0, link->dpc, opc); cmn = (struct mtp_level_3_cmn *) msgb_put(out, sizeof(*cmn)); cmn->h0 = MTP_TRF_RESTR_MSG_GRP; cmn->h1 = MTP_RESTR_MSG_ALLWED; @@ -300,9 +301,18 @@ static int send_tfp(struct mtp_link_set *link, int apoc) return 0; } -static int mtp_link_sign_msg(struct mtp_link_set *link, struct mtp_level_3_hdr *hdr, int l3_len) +static int send_tra(struct mtp_link_set *link, int opc) { struct msgb *msg; + msg = mtp_tra_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; uint16_t *apc; @@ -335,11 +345,16 @@ static int mtp_link_sign_msg(struct mtp_link_set *link, struct mtp_level_3_hdr * send_tfp(link, link->isup_opc) != 0) return -1; - msg = mtp_tra_alloc(link); - if (!msg) + /* Send the TRA for all PCs */ + if (send_tra(link, link->opc) != 0) + return -1; + if (link->sccp_opc != link->opc && + send_tra(link, link->sccp_opc) != 0) + return -1; + if (link->isup_opc != link->opc && + send_tra(link, link->isup_opc) != 0) return -1; - mtp_link_set_submit(link->slc[0], msg); link->sccp_up = 1; link->was_up = 1; LOGP(DINP, LOGL_INFO, "SCCP traffic allowed. %p\n", link); |