From 2d845fca0c2e3561593e2255dbe7f53fdee9e144 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 20 Jan 2011 15:42:13 +0100 Subject: mtp: Rename the the_link to set as it is a link set --- include/mtp_data.h | 2 +- src/link_udp.c | 2 +- src/links.c | 12 ++++++------ src/mtp_layer3.c | 11 ++++++----- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/mtp_data.h b/include/mtp_data.h index 7521f9b..56886b4 100644 --- a/include/mtp_data.h +++ b/include/mtp_data.h @@ -83,7 +83,7 @@ struct mtp_link { struct llist_head entry; int pcap_fd; - struct mtp_link_set *the_link; + struct mtp_link_set *set; int available; diff --git a/src/link_udp.c b/src/link_udp.c index 01296dc..9a7d645 100644 --- a/src/link_udp.c +++ b/src/link_udp.c @@ -81,7 +81,7 @@ static int udp_read_cb(struct bsc_fd *fd) } /* throw away data as the link is down */ - if (link->the_link->available == 0) { + if (link->set->available == 0) { LOGP(DINP, LOGL_ERROR, "The link is down. Not forwarding.\n"); rc = 0; goto exit; diff --git a/src/links.c b/src/links.c index 4bed52d..f5de581 100644 --- a/src/links.c +++ b/src/links.c @@ -46,25 +46,25 @@ void mtp_link_down(struct mtp_link *link) was_up = link->available; link->available = 0; - one_up = is_one_up(link->the_link); + one_up = is_one_up(link->set); /* our linkset is now unsuable */ if (was_up && !one_up) - mtp_linkset_down(link->the_link); + mtp_linkset_down(link->set); link->clear_queue(link); - mtp_link_set_init_slc(link->the_link); + mtp_link_set_init_slc(link->set); } void mtp_link_up(struct mtp_link *link) { int one_up; - one_up = is_one_up(link->the_link); + one_up = is_one_up(link->set); link->available = 1; - mtp_link_set_init_slc(link->the_link); + mtp_link_set_init_slc(link->set); if (!one_up) - mtp_linkset_up(link->the_link); + mtp_linkset_up(link->set); } void mtp_link_set_sccp_down(struct mtp_link_set *link) diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c index 7cce467..be70c6e 100644 --- a/src/mtp_layer3.c +++ b/src/mtp_layer3.c @@ -543,7 +543,7 @@ int mtp_link_set_data(struct mtp_link *link, struct msgb *msg) if (!msg->l2h || msgb_l2len(msg) < sizeof(*hdr)) return -1; - if (!link->the_link->running) { + if (!link->set->running) { LOGP(DINP, LOGL_ERROR, "Link is not running. Call mtp_link_reset first: %p\n", link); return -1; } @@ -553,17 +553,17 @@ int mtp_link_set_data(struct mtp_link *link, struct msgb *msg) switch (hdr->ser_ind) { case MTP_SI_MNT_SNM_MSG: - rc = mtp_link_sign_msg(link->the_link, hdr, l3_len); + rc = mtp_link_sign_msg(link->set, hdr, l3_len); break; case MTP_SI_MNT_REG_MSG: - rc = mtp_link_regular_msg(link->the_link, hdr, l3_len); + rc = mtp_link_regular_msg(link->set, hdr, l3_len); break; case MTP_SI_MNT_SCCP: - rc = mtp_link_sccp_data(link->the_link, hdr, msg, l3_len); + rc = mtp_link_sccp_data(link->set, hdr, msg, l3_len); break; case MTP_SI_MNT_ISUP: msg->l3h = &hdr->data[0]; - rc = mtp_link_set_isup(link->the_link, msg, MTP_LINK_SLS(hdr->addr)); + rc = mtp_link_set_isup(link->set, msg, MTP_LINK_SLS(hdr->addr)); break; default: fprintf(stderr, "Unhandled: %u\n", hdr->ser_ind); @@ -665,5 +665,6 @@ void mtp_link_set_init_slc(struct mtp_link_set *set) void mtp_link_set_add_link(struct mtp_link_set *set, struct mtp_link *lnk) { llist_add_tail(&lnk->entry, &set->links); + lnk->set = set; mtp_link_set_init_slc(set); } -- cgit v1.2.3