diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-17 02:18:38 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-17 19:34:28 +0100 |
commit | 6c0b2e570c56b79ccb4e0905e3d2288fc55443e2 (patch) | |
tree | 4aebbcbe745244fad732c751be9c969b508b96ed /src/links.c | |
parent | ea247c1d0a30362afd4602acdcd595b4afd616ec (diff) |
mtp: Make the mtp_link point to a specific type of link
We might want to be able to change the type of a link at
runtime. Decouple the link and the actual type of the link.
Diffstat (limited to 'src/links.c')
-rw-r--r-- | src/links.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/links.c b/src/links.c index ccc8bfb..fae1dea 100644 --- a/src/links.c +++ b/src/links.c @@ -90,6 +90,7 @@ struct mtp_link_set *link_init(struct bsc_data *bsc) { int i; struct mtp_udp_link *lnk; + struct mtp_link *blnk; struct mtp_link_set *set; set = mtp_link_set_alloc(bsc); @@ -121,14 +122,15 @@ struct mtp_link_set *link_init(struct bsc_data *bsc) for (i = 1; i <= bsc->udp_nr_links; ++i) { - lnk = talloc_zero(set, struct mtp_udp_link); - lnk->base.pcap_fd = -1; + blnk = mtp_link_alloc(set); + lnk = talloc_zero(blnk, struct mtp_udp_link); + lnk->base = blnk; + lnk->base->data = lnk; + lnk->base->type = SS7_LTYPE_UDP; lnk->bsc = bsc; lnk->data = &bsc->udp_data; lnk->link_index = i; lnk->reset_timeout = bsc->udp_reset_timeout; - mtp_link_set_add_link(set, (struct mtp_link *) lnk); - /* now connect to the transport */ if (link_udp_init(lnk, bsc->udp_ip, bsc->udp_port) != 0) |