aboutsummaryrefslogtreecommitdiffstats
path: root/src/links.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-17 15:15:05 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-17 15:15:05 +0100
commite13c5aa4185ba44319813a21132b03986c5e09c8 (patch)
tree99b07c632ca019344a154d65770e76af9ebe43fa /src/links.c
parent4a3743440bd77aa0cec240e103aa2c7ce954b714 (diff)
parentd70a7e8e79a25ecd1ba36e357a83c902338648b9 (diff)
Merge branch 'on-waves/m2ua'
Diffstat (limited to 'src/links.c')
-rw-r--r--src/links.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/links.c b/src/links.c
index 023a7f4..1134e59 100644
--- a/src/links.c
+++ b/src/links.c
@@ -31,7 +31,7 @@ extern struct bsc_data bsc;
int is_one_up(struct mtp_link_set *set)
{
- struct link_data *entry;
+ struct mtp_link *entry;
llist_for_each_entry(entry, &set->links, entry)
if (entry->available)
@@ -39,7 +39,7 @@ int is_one_up(struct mtp_link_set *set)
return 0;
}
-void mtp_link_down(struct link_data *link)
+void mtp_link_down(struct mtp_link *link)
{
int one_up;
int was_up;
@@ -55,7 +55,7 @@ void mtp_link_down(struct link_data *link)
mtp_link_set_init_slc(link->the_link);
}
-void mtp_link_up(struct link_data *link)
+void mtp_link_up(struct mtp_link *link)
{
int one_up;
@@ -71,12 +71,12 @@ void mtp_link_set_sccp_down(struct mtp_link_set *link)
{
}
-void mtp_link_set_submit(struct link_data *link, struct msgb *msg)
+void mtp_link_set_submit(struct mtp_link *link, struct msgb *msg)
{
link->write(link, msg);
}
-void mtp_link_restart(struct link_data *link)
+void mtp_link_restart(struct mtp_link *link)
{
LOGP(DINP, LOGL_ERROR, "Need to restart the SS7 link.\n");
link->reset(link);
@@ -84,7 +84,7 @@ void mtp_link_restart(struct link_data *link)
static void start_rest(void *start)
{
- struct link_data *data;
+ struct mtp_link *data;
bsc.setup = 1;
if (msc_init(&bsc, 1) != 0) {
@@ -98,7 +98,7 @@ static void start_rest(void *start)
int link_init(struct bsc_data *bsc)
{
- struct link_data *lnk;
+ struct mtp_udp_link *lnk;
bsc->link_set = mtp_link_set_alloc();
bsc->link_set->dpc = bsc->dpc;
@@ -109,13 +109,13 @@ int link_init(struct bsc_data *bsc)
bsc->link_set->spare = bsc->ni_spare;
bsc->link_set->bsc = bsc;
- lnk = talloc_zero(bsc->link_set, struct link_data);
+ lnk = talloc_zero(bsc->link_set, struct mtp_udp_link);
+ lnk->base.pcap_fd = bsc->pcap_fd;
+ lnk->base.the_link = bsc->link_set;
lnk->bsc = bsc;
- lnk->udp.link_index = 1;
- lnk->pcap_fd = bsc->pcap_fd;
- lnk->udp.reset_timeout = bsc->udp_reset_timeout;
- lnk->the_link = bsc->link_set;
- mtp_link_set_add_link(bsc->link_set, lnk);
+ lnk->link_index = 1;
+ lnk->reset_timeout = bsc->udp_reset_timeout;
+ mtp_link_set_add_link(bsc->link_set, (struct mtp_link *) lnk);
if (!bsc->src_port) {
LOGP(DINP, LOGL_ERROR, "You need to set a UDP address.\n");
@@ -125,8 +125,8 @@ int link_init(struct bsc_data *bsc)
LOGP(DINP, LOGL_NOTICE, "Using UDP MTP mode.\n");
/* setup SNMP first, it is blocking */
- lnk->udp.session = snmp_mtp_session_create(bsc->udp_ip);
- if (!lnk->udp.session)
+ lnk->session = snmp_mtp_session_create(bsc->udp_ip);
+ if (!lnk->session)
return -1;
/* now connect to the transport */
@@ -139,11 +139,11 @@ int link_init(struct bsc_data *bsc)
* SLTM and it begins a reset. Then we will take it up
* again and do the usual business.
*/
- snmp_mtp_deactivate(lnk->udp.session,
- lnk->udp.link_index);
+ snmp_mtp_deactivate(lnk->session,
+ lnk->link_index);
bsc->start_timer.cb = start_rest;
bsc->start_timer.data = &bsc;
- bsc_schedule_timer(&bsc->start_timer, lnk->udp.reset_timeout, 0);
+ bsc_schedule_timer(&bsc->start_timer, lnk->reset_timeout, 0);
LOGP(DMSC, LOGL_NOTICE, "Making sure SLTM will timeout.\n");
return 0;
@@ -151,7 +151,7 @@ int link_init(struct bsc_data *bsc)
int link_shutdown_all(struct mtp_link_set *set)
{
- struct link_data *lnk;
+ struct mtp_link *lnk;
llist_for_each_entry(lnk, &set->links, entry)
lnk->shutdown(lnk);
@@ -160,7 +160,7 @@ int link_shutdown_all(struct mtp_link_set *set)
int link_reset_all(struct mtp_link_set *set)
{
- struct link_data *lnk;
+ struct mtp_link *lnk;
llist_for_each_entry(lnk, &set->links, entry)
lnk->reset(lnk);
@@ -169,7 +169,7 @@ int link_reset_all(struct mtp_link_set *set)
int link_clear_all(struct mtp_link_set *set)
{
- struct link_data *lnk;
+ struct mtp_link *lnk;
llist_for_each_entry(lnk, &set->links, entry)
lnk->clear_queue(lnk);