diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-18 13:29:42 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-20 11:37:50 +0100 |
commit | bee2ed18c7fd1d8316a17a0ff3ba97f7b518c00e (patch) | |
tree | 2b10e515a533af24435e6b80ed17c6b0e27dd46d | |
parent | 84899a484c1a38bd487435160e1eaf9619c08b0d (diff) |
mtp: Make the input path work on a specific link of the linkset
-rw-r--r-- | include/mtp_data.h | 2 | ||||
-rw-r--r-- | src/link_udp.c | 2 | ||||
-rw-r--r-- | src/mtp_layer3.c | 12 | ||||
-rw-r--r-- | src/sctp_m2ua.c | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/include/mtp_data.h b/include/mtp_data.h index 95d54bd..b144ba5 100644 --- a/include/mtp_data.h +++ b/include/mtp_data.h @@ -101,7 +101,7 @@ struct mtp_link { struct mtp_link_set *mtp_link_set_alloc(void); void mtp_link_set_stop(struct mtp_link_set *link); void mtp_link_set_reset(struct mtp_link_set *link); -int mtp_link_set_data(struct mtp_link_set *link, struct msgb *msg); +int mtp_link_set_data(struct mtp_link *link, struct msgb *msg); int mtp_link_set_submit_sccp_data(struct mtp_link_set *link, int sls, const uint8_t *data, unsigned int length); int mtp_link_set_submit_isup_data(struct mtp_link_set *link, int sls, const uint8_t *data, unsigned int length); diff --git a/src/link_udp.c b/src/link_udp.c index 09b680f..01296dc 100644 --- a/src/link_udp.c +++ b/src/link_udp.c @@ -113,7 +113,7 @@ static int udp_read_cb(struct bsc_fd *fd) LOGP(DINP, LOGL_DEBUG, "MSU data on: %p data %s.\n", link, hexdump(msg->data, msg->len)); if (link->pcap_fd >= 0) mtp_pcap_write_msu(link->pcap_fd, msg->l2h, msgb_l2len(msg)); - mtp_link_set_data(link->the_link, msg); + mtp_link_set_data(link, msg); exit: msgb_free(msg); diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c index 0039747..1138d3c 100644 --- a/src/mtp_layer3.c +++ b/src/mtp_layer3.c @@ -466,7 +466,7 @@ static int mtp_link_sccp_data(struct mtp_link_set *link, struct mtp_level_3_hdr return 0; } -int mtp_link_set_data(struct mtp_link_set *link, struct msgb *msg) +int mtp_link_set_data(struct mtp_link *link, struct msgb *msg) { int rc = -1; struct mtp_level_3_hdr *hdr; @@ -475,7 +475,7 @@ int mtp_link_set_data(struct mtp_link_set *link, struct msgb *msg) if (!msg->l2h || msgb_l2len(msg) < sizeof(*hdr)) return -1; - if (!link->running) { + if (!link->the_link->running) { LOGP(DINP, LOGL_ERROR, "Link is not running. Call mtp_link_reset first: %p\n", link); return -1; } @@ -485,17 +485,17 @@ int mtp_link_set_data(struct mtp_link_set *link, struct msgb *msg) switch (hdr->ser_ind) { case MTP_SI_MNT_SNM_MSG: - rc = mtp_link_sign_msg(link, hdr, l3_len); + rc = mtp_link_sign_msg(link->the_link, hdr, l3_len); break; case MTP_SI_MNT_REG_MSG: - rc = mtp_link_regular_msg(link, hdr, l3_len); + rc = mtp_link_regular_msg(link->the_link, hdr, l3_len); break; case MTP_SI_MNT_SCCP: - rc = mtp_link_sccp_data(link, hdr, msg, l3_len); + rc = mtp_link_sccp_data(link->the_link, hdr, msg, l3_len); break; case MTP_SI_MNT_ISUP: msg->l3h = &hdr->data[0]; - rc = mtp_link_set_isup(link, msg, MTP_LINK_SLS(hdr->addr)); + rc = mtp_link_set_isup(link->the_link, msg, MTP_LINK_SLS(hdr->addr)); break; default: fprintf(stderr, "Unhandled: %u\n", hdr->ser_ind); diff --git a/src/sctp_m2ua.c b/src/sctp_m2ua.c index 1ebae60..a4743fa 100644 --- a/src/sctp_m2ua.c +++ b/src/sctp_m2ua.c @@ -322,7 +322,7 @@ static int m2ua_handle_data(struct sctp_m2ua_conn *conn, link = &conn->trans->base; if (link->pcap_fd >= 0) mtp_pcap_write_msu(link->pcap_fd, msg->l2h, msgb_l2len(msg)); - mtp_link_set_data(link->the_link, msg); + mtp_link_set_data(link, msg); msgb_free(msg); return 0; |