aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-02 18:47:49 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-17 11:21:11 +0100
commit569f1e171df2f055d0be5fc637e050a523a9ae8a (patch)
tree889e8751a8b433332fb3c5673b1129feb8453445
parent346e1c4bc4266ad645aab88d6357518e17055fb3 (diff)
mtp: Rename mtp_link to mtp_link_set as this is the linkset
The link_udp is actually below the linkset. We need to get this right now and then can have multiple links.
-rw-r--r--include/bsc_data.h4
-rw-r--r--include/bsc_sccp.h2
-rw-r--r--include/isup_types.h4
-rw-r--r--include/mtp_data.h24
-rw-r--r--src/isup.c6
-rw-r--r--src/link_udp.c2
-rw-r--r--src/links.c8
-rw-r--r--src/main.c40
-rw-r--r--src/main_udt.c12
-rw-r--r--src/msc_conn.c6
-rw-r--r--src/mtp_layer3.c72
-rw-r--r--tests/isup/isup_parse_test.c2
12 files changed, 91 insertions, 91 deletions
diff --git a/include/bsc_data.h b/include/bsc_data.h
index 32fc94f..48ce137 100644
--- a/include/bsc_data.h
+++ b/include/bsc_data.h
@@ -59,7 +59,7 @@ struct link_data {
int pcap_fd;
struct bsc_data *bsc;
- struct mtp_link *the_link;
+ struct mtp_link_set *the_link;
struct timer_list link_activate;
int forced_down;
@@ -138,7 +138,7 @@ void msc_send_direct(struct bsc_data *bsc, struct msgb *msg);
void msc_close_connection(struct bsc_data *data);
/* connection tracking and action */
-void update_con_state(struct mtp_link *link, int rc, struct sccp_parse_result *result, struct msgb *msg, int from_msc, int sls);
+void update_con_state(struct mtp_link_set *link, int rc, struct sccp_parse_result *result, struct msgb *msg, int from_msc, int sls);
unsigned int sls_for_src_ref(struct sccp_source_reference *ref);
/* udp init */
diff --git a/include/bsc_sccp.h b/include/bsc_sccp.h
index c75bab6..8811a2b 100644
--- a/include/bsc_sccp.h
+++ b/include/bsc_sccp.h
@@ -54,7 +54,7 @@ struct active_sccp_con {
unsigned int rls_tries;
/* MTP link this was coming in */
- struct mtp_link *link;
+ struct mtp_link_set *link;
/* sls id */
int sls;
diff --git a/include/isup_types.h b/include/isup_types.h
index be7964d..5347cb4 100644
--- a/include/isup_types.h
+++ b/include/isup_types.h
@@ -25,7 +25,7 @@
#include <endian.h>
struct msgb;
-struct mtp_link;
+struct mtp_link_set;
/* This is from Table 4/Q.763 */
#define ISUP_MSG_GRS 0x17
@@ -47,7 +47,7 @@ struct isup_msg_grs {
uint8_t pointer_int;
};
-int mtp_link_forward_isup(struct mtp_link *link, struct msgb *msg, int sls);
+int mtp_link_set_forward_isup(struct mtp_link_set *link, struct msgb *msg, int sls);
int isup_parse_grs(const uint8_t *data, uint8_t length);
diff --git a/include/mtp_data.h b/include/mtp_data.h
index 5168eb1..c2bf841 100644
--- a/include/mtp_data.h
+++ b/include/mtp_data.h
@@ -34,7 +34,7 @@
/**
* The state of the mtp_link in terms of layer3 and upwards
*/
-struct mtp_link {
+struct mtp_link_set {
/* routing info.. */
int dpc, opc, sccp_opc;
int ni;
@@ -63,21 +63,21 @@ struct mtp_link {
};
-struct mtp_link *mtp_link_alloc(void);
-void mtp_link_stop(struct mtp_link *link);
-void mtp_link_reset(struct mtp_link *link);
-int mtp_link_data(struct mtp_link *link, struct msgb *msg);
-int mtp_link_submit_sccp_data(struct mtp_link *link, int sls, const uint8_t *data, unsigned int length);
-int mtp_link_submit_isup_data(struct mtp_link *link, int sls, const uint8_t *data, unsigned int length);
+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_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);
/* one time init function */
-void mtp_link_init(void);
+void mtp_link_set_init(void);
/* to be implemented for MSU sending */
-void mtp_link_submit(struct mtp_link *link, struct msgb *msg);
-void mtp_link_forward_sccp(struct mtp_link *link, struct msgb *msg, int sls);
-void mtp_link_restart(struct mtp_link *link);
-void mtp_link_sccp_down(struct mtp_link *link);
+void mtp_link_set_submit(struct mtp_link_set *link, struct msgb *msg);
+void mtp_link_set_forward_sccp(struct mtp_link_set *link, struct msgb *msg, int sls);
+void mtp_link_set_restart(struct mtp_link_set *link);
+void mtp_link_set_sccp_down(struct mtp_link_set *link);
#endif
diff --git a/src/isup.c b/src/isup.c
index 8af1464..340af16 100644
--- a/src/isup.c
+++ b/src/isup.c
@@ -90,7 +90,7 @@ int isup_parse_grs(const uint8_t *data, uint8_t in_length)
/* Handle incoming ISUP data */
-static int handle_circuit_reset_grs(struct mtp_link *link, int sls, int cic,
+static int handle_circuit_reset_grs(struct mtp_link_set *link, int sls, int cic,
const uint8_t *data, int size)
{
struct msgb *resp;
@@ -104,12 +104,12 @@ static int handle_circuit_reset_grs(struct mtp_link *link, int sls, int cic,
if (!resp)
return -1;
- mtp_link_submit_isup_data(link, sls, resp->l2h, msgb_l2len(resp));
+ mtp_link_set_submit_isup_data(link, sls, resp->l2h, msgb_l2len(resp));
msgb_free(resp);
return 0;
}
-int mtp_link_forward_isup(struct mtp_link *link, struct msgb *msg, int sls)
+int mtp_link_set_forward_isup(struct mtp_link_set *link, struct msgb *msg, int sls)
{
int rc = -1;
int payload_size;
diff --git a/src/link_udp.c b/src/link_udp.c
index 7fcf6f1..e5e476c 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_data(link->the_link, msg);
+ mtp_link_set_data(link->the_link, msg);
exit:
msgb_free(msg);
diff --git a/src/links.c b/src/links.c
index 64e3a3d..adc74d1 100644
--- a/src/links.c
+++ b/src/links.c
@@ -27,16 +27,16 @@
extern struct bsc_data bsc;
-void mtp_link_sccp_down(struct mtp_link *link)
+void mtp_link_set_sccp_down(struct mtp_link_set *link)
{
}
-void mtp_link_submit(struct mtp_link *link, struct msgb *msg)
+void mtp_link_set_submit(struct mtp_link_set *link, struct msgb *msg)
{
bsc.link.write(&bsc.link, msg);
}
-void mtp_link_restart(struct mtp_link *link)
+void mtp_link_set_restart(struct mtp_link_set *link)
{
LOGP(DINP, LOGL_ERROR, "Need to restart the SS7 link.\n");
bsc.link.reset(&bsc.link);
@@ -56,7 +56,7 @@ static void start_rest(void *start)
int link_init(struct bsc_data *bsc)
{
- bsc->link.the_link = mtp_link_alloc();
+ bsc->link.the_link = mtp_link_set_alloc();
bsc->link.the_link->dpc = bsc->dpc;
bsc->link.the_link->opc = bsc->opc;
bsc->link.the_link->sccp_opc = bsc->sccp_opc > -1 ? bsc->sccp_opc : bsc->opc;
diff --git a/src/main.c b/src/main.c
index a4e502c..c764cc2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -64,11 +64,11 @@ static char *config = "cellmgr_ng.cfg";
struct bsc_data bsc;
extern void cell_vty_init(void);
-static void send_reset_ack(struct mtp_link *link, int sls);
+static void send_reset_ack(struct mtp_link_set *link, int sls);
static void bsc_resources_released(struct bsc_data *bsc);
-static void handle_local_sccp(struct mtp_link *link, struct msgb *inp, struct sccp_parse_result *res, int sls);
+static void handle_local_sccp(struct mtp_link_set *link, struct msgb *inp, struct sccp_parse_result *res, int sls);
static void clear_connections(struct bsc_data *bsc);
-static void send_local_rlsd(struct mtp_link *link, struct sccp_parse_result *res);
+static void send_local_rlsd(struct mtp_link_set *link, struct sccp_parse_result *res);
/* send a RSIP to the MGCP GW */
static void mgcp_reset(struct bsc_data *bsc)
@@ -83,7 +83,7 @@ static void mgcp_reset(struct bsc_data *bsc)
/*
* methods called from the MTP Level3 part
*/
-void mtp_link_forward_sccp(struct mtp_link *link, struct msgb *_msg, int sls)
+void mtp_link_set_forward_sccp(struct mtp_link_set *link, struct msgb *_msg, int sls)
{
int rc;
struct sccp_parse_result result;
@@ -130,7 +130,7 @@ void mtp_link_forward_sccp(struct mtp_link *link, struct msgb *_msg, int sls)
/*
* handle local message in close down mode
*/
-static void handle_local_sccp(struct mtp_link *link, struct msgb *inpt, struct sccp_parse_result *result, int sls)
+static void handle_local_sccp(struct mtp_link_set *link, struct msgb *inpt, struct sccp_parse_result *result, int sls)
{
/* Handle msg with a reject */
if (inpt->l2h[0] == SCCP_MSG_TYPE_CR) {
@@ -141,7 +141,7 @@ static void handle_local_sccp(struct mtp_link *link, struct msgb *inpt, struct s
cr = (struct sccp_connection_request *) inpt->l2h;
msg = create_sccp_refuse(&cr->source_local_reference);
if (msg) {
- mtp_link_submit_sccp_data(link, sls, msg->l2h, msgb_l2len(msg));
+ mtp_link_set_submit_sccp_data(link, sls, msg->l2h, msgb_l2len(msg));
msgb_free(msg);
}
return;
@@ -161,7 +161,7 @@ static void handle_local_sccp(struct mtp_link *link, struct msgb *inpt, struct s
LOGP(DINP, LOGL_DEBUG, "Sending a release request now.\n");
msg = create_sccp_rlsd(&con->dst_ref, &con->src_ref);
if (msg) {
- mtp_link_submit_sccp_data(link, con->sls, msg->l2h, msgb_l2len(msg));
+ mtp_link_set_submit_sccp_data(link, con->sls, msg->l2h, msgb_l2len(msg));
msgb_free(msg);
}
return;
@@ -210,7 +210,7 @@ static void bsc_reset_timeout(void *_data)
/* no reset */
if (bsc->reset_count > 0) {
LOGP(DINP, LOGL_ERROR, "The BSC did not answer the GSM08.08 reset. Restart MTP\n");
- mtp_link_stop(bsc->link.the_link);
+ mtp_link_set_stop(bsc->link.the_link);
clear_connections(bsc);
bsc->link.reset(&bsc->link);
bsc_resources_released(bsc);
@@ -224,7 +224,7 @@ static void bsc_reset_timeout(void *_data)
}
++bsc->reset_count;
- mtp_link_submit_sccp_data(bsc->link.the_link, -1, msg->l2h, msgb_l2len(msg));
+ mtp_link_set_submit_sccp_data(bsc->link.the_link, -1, msg->l2h, msgb_l2len(msg));
msgb_free(msg);
bsc_schedule_timer(&bsc->reset_timeout, 20, 0);
}
@@ -269,7 +269,7 @@ void release_bsc_resources(struct bsc_data *bsc)
continue;
/* wait for the clear commands */
- mtp_link_submit_sccp_data(bsc->link.the_link, con->sls, msg->l2h, msgb_l2len(msg));
+ mtp_link_set_submit_sccp_data(bsc->link.the_link, con->sls, msg->l2h, msgb_l2len(msg));
msgb_free(msg);
}
@@ -287,11 +287,11 @@ void release_bsc_resources(struct bsc_data *bsc)
void bsc_link_down(struct link_data *data)
{
int was_up;
- struct mtp_link *link = data->the_link;
+ struct mtp_link_set *link = data->the_link;
link->available = 0;
was_up = link->sccp_up;
- mtp_link_stop(link);
+ mtp_link_set_stop(link);
clear_connections(data->bsc);
mgcp_reset(data->bsc);
@@ -311,7 +311,7 @@ void bsc_link_up(struct link_data *data)
bsc_resources_released(data->bsc);
}
- mtp_link_reset(data->the_link);
+ mtp_link_set_reset(data->the_link);
}
/**
@@ -325,7 +325,7 @@ static void send_rlc_to_bsc(unsigned int sls, struct sccp_source_reference *src,
if (!msg)
return;
- mtp_link_submit_sccp_data(bsc.link.the_link, sls, msg->l2h, msgb_l2len(msg));
+ mtp_link_set_submit_sccp_data(bsc.link.the_link, sls, msg->l2h, msgb_l2len(msg));
msgb_free(msg);
}
@@ -386,7 +386,7 @@ static void handle_rlsd(struct sccp_connection_released *rlsd, int from_msc)
* 1.) We are destroying the connection, we might send a RLC to
* the MSC if we are waiting for one.
*/
-void update_con_state(struct mtp_link *link, int rc, struct sccp_parse_result *res, struct msgb *msg, int from_msc, int sls)
+void update_con_state(struct mtp_link_set *link, int rc, struct sccp_parse_result *res, struct msgb *msg, int from_msc, int sls)
{
struct active_sccp_con *con;
struct sccp_connection_request *cr;
@@ -506,11 +506,11 @@ static void send_local_rlsd_for_con(void *data)
++con->rls_tries;
LOGP(DINP, LOGL_DEBUG, "Sending RLSD for 0x%x the %d time.\n",
sccp_src_ref_to_int(&con->src_ref), con->rls_tries);
- mtp_link_submit_sccp_data(bsc.link.the_link, con->sls, rlsd->l2h, msgb_l2len(rlsd));
+ mtp_link_set_submit_sccp_data(bsc.link.the_link, con->sls, rlsd->l2h, msgb_l2len(rlsd));
msgb_free(rlsd);
}
-static void send_local_rlsd(struct mtp_link *link, struct sccp_parse_result *res)
+static void send_local_rlsd(struct mtp_link_set *link, struct sccp_parse_result *res)
{
struct active_sccp_con *con;
@@ -523,7 +523,7 @@ static void send_local_rlsd(struct mtp_link *link, struct sccp_parse_result *res
send_local_rlsd_for_con(con);
}
-static void send_reset_ack(struct mtp_link *link, int sls)
+static void send_reset_ack(struct mtp_link_set *link, int sls)
{
static const uint8_t reset_ack[] = {
0x09, 0x00, 0x03, 0x05, 0x7, 0x02, 0x42, 0xfe,
@@ -531,7 +531,7 @@ static void send_reset_ack(struct mtp_link *link, int sls)
0x00, 0x01, 0x31
};
- mtp_link_submit_sccp_data(link, sls, reset_ack, sizeof(reset_ack));
+ mtp_link_set_submit_sccp_data(link, sls, reset_ack, sizeof(reset_ack));
}
static void print_usage()
@@ -636,7 +636,7 @@ int main(int argc, char **argv)
bsc.ni_ni = MTP_NI_NATION_NET;
bsc.ni_spare = 0;
- mtp_link_init();
+ mtp_link_set_init();
thread_init();
log_init(&log_info);
diff --git a/src/main_udt.c b/src/main_udt.c
index 3e92bf2..1536301 100644
--- a/src/main_udt.c
+++ b/src/main_udt.c
@@ -65,7 +65,7 @@ extern void cell_vty_init(void);
/*
* methods called from the MTP Level3 part
*/
-void mtp_link_forward_sccp(struct mtp_link *link, struct msgb *_msg, int sls)
+void mtp_link_set_forward_sccp(struct mtp_link_set *link, struct msgb *_msg, int sls)
{
msc_send_direct(&bsc, _msg);
}
@@ -73,11 +73,11 @@ void mtp_link_forward_sccp(struct mtp_link *link, struct msgb *_msg, int sls)
void bsc_link_down(struct link_data *data)
{
int was_up;
- struct mtp_link *link = data->the_link;
+ struct mtp_link_set *link = data->the_link;
link->available = 0;
was_up = link->sccp_up;
- mtp_link_stop(link);
+ mtp_link_set_stop(link);
data->clear_queue(data);
@@ -88,7 +88,7 @@ void bsc_link_down(struct link_data *data)
void bsc_link_up(struct link_data *data)
{
data->the_link->available = 1;
- mtp_link_reset(data->the_link);
+ mtp_link_set_reset(data->the_link);
}
static void print_usage()
@@ -193,7 +193,7 @@ int main(int argc, char **argv)
bsc.ni_ni = MTP_NI_NATION_NET;
bsc.ni_spare = 0;
- mtp_link_init();
+ mtp_link_set_init();
thread_init();
log_init(&log_info);
@@ -264,7 +264,7 @@ struct msgb *create_reset()
return NULL;
}
-void update_con_state(struct mtp_link *link, int rc, struct sccp_parse_result *res, struct msgb *msg, int from_msc, int sls)
+void update_con_state(struct mtp_link_set *link, int rc, struct sccp_parse_result *res, struct msgb *msg, int from_msc, int sls)
{
LOGP(DMSC, LOGL_ERROR, "Should not be called.\n");
return;
diff --git a/src/msc_conn.c b/src/msc_conn.c
index 62459ec..89b39c7 100644
--- a/src/msc_conn.c
+++ b/src/msc_conn.c
@@ -46,9 +46,9 @@ static void msc_send_id_response(struct bsc_data *bsc);
static void msc_send(struct bsc_data *bsc, struct msgb *msg, int proto);
static void msc_schedule_reconnect(struct bsc_data *bsc);
-int send_or_queue_bsc_msg(struct mtp_link *link, int sls, struct msgb *msg)
+int send_or_queue_bsc_msg(struct mtp_link_set *link, int sls, struct msgb *msg)
{
- if (mtp_link_submit_sccp_data(link, sls, msg->l2h, msgb_l2len(msg)) != 0)
+ if (mtp_link_set_submit_sccp_data(link, sls, msg->l2h, msgb_l2len(msg)) != 0)
LOGP(DMSC, LOGL_ERROR, "Could not forward SCCP message.\n");
return 0;
}
@@ -122,7 +122,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd)
{
int error;
struct ipaccess_head *hh;
- struct mtp_link *link;
+ struct mtp_link_set *link;
struct bsc_data *bsc;
struct msgb *msg;
diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c
index e756440..0c835cd 100644
--- a/src/mtp_layer3.c
+++ b/src/mtp_layer3.c
@@ -33,9 +33,9 @@
static void *tall_mtp_ctx = NULL;
-static int mtp_int_submit(struct mtp_link *link, int pc, int sls, int type, const uint8_t *data, unsigned int length);
+static int mtp_int_submit(struct mtp_link_set *link, int pc, int sls, int type, const uint8_t *data, unsigned int length);
-static struct msgb *mtp_msg_alloc(struct mtp_link *link)
+static struct msgb *mtp_msg_alloc(struct mtp_link_set *link)
{
struct mtp_level_3_hdr *hdr;
struct msgb *msg = msgb_alloc_headroom(4096, 128, "mtp-msg");
@@ -52,7 +52,7 @@ static struct msgb *mtp_msg_alloc(struct mtp_link *link)
return msg;
}
-static struct msgb *mtp_create_sltm(struct mtp_link *link)
+static struct msgb *mtp_create_sltm(struct mtp_link_set *link)
{
const uint8_t test_ptrn[14] = { 'G', 'S', 'M', 'M', 'M', 'S', };
struct mtp_level_3_hdr *hdr;
@@ -79,7 +79,7 @@ static struct msgb *mtp_create_sltm(struct mtp_link *link)
return msg;
}
-static struct msgb *mtp_create_slta(struct mtp_link *link, struct mtp_level_3_mng *in_mng, int l3_len)
+static struct msgb *mtp_create_slta(struct mtp_link_set *link, struct mtp_level_3_mng *in_mng, int l3_len)
{
struct mtp_level_3_hdr *hdr;
struct mtp_level_3_mng *mng;
@@ -100,7 +100,7 @@ static struct msgb *mtp_create_slta(struct mtp_link *link, struct mtp_level_3_mn
return out;
}
-static struct msgb *mtp_tfp_alloc(struct mtp_link *link, int apoc)
+static struct msgb *mtp_tfp_alloc(struct mtp_link_set *link, int apoc)
{
struct mtp_level_3_hdr *hdr;
struct mtp_level_3_prohib *prb;
@@ -118,7 +118,7 @@ static struct msgb *mtp_tfp_alloc(struct mtp_link *link, int apoc)
return out;
}
-static struct msgb *mtp_tra_alloc(struct mtp_link *link)
+static struct msgb *mtp_tra_alloc(struct mtp_link_set *link)
{
struct mtp_level_3_hdr *hdr;
struct mtp_level_3_cmn *cmn;
@@ -135,7 +135,7 @@ static struct msgb *mtp_tra_alloc(struct mtp_link *link)
return out;
}
-static struct msgb *mtp_sccp_alloc_scmg(struct mtp_link *link,
+static struct msgb *mtp_sccp_alloc_scmg(struct mtp_link_set *link,
int type, int assn, int sls)
{
struct sccp_data_unitdata *udt;
@@ -186,12 +186,12 @@ static struct msgb *mtp_sccp_alloc_scmg(struct mtp_link *link,
return out;
}
-void mtp_link_init(void)
+void mtp_link_set_init(void)
{
tall_mtp_ctx = talloc_named_const(NULL, 1, "mtp-link");
}
-static void mtp_send_sltm(struct mtp_link *link)
+static void mtp_send_sltm(struct mtp_link_set *link)
{
struct msgb *msg;
@@ -202,12 +202,12 @@ static void mtp_send_sltm(struct mtp_link *link)
return;
}
- mtp_link_submit(link, msg);
+ mtp_link_set_submit(link, msg);
}
static void mtp_sltm_t1_timeout(void *_link)
{
- struct mtp_link *link = (struct mtp_link *) _link;
+ struct mtp_link_set *link = (struct mtp_link_set *) _link;
if (link->slta_misses == 0) {
LOGP(DINP, LOGL_ERROR, "No SLTM response. Retrying. Link: %p\n", link);
@@ -219,14 +219,14 @@ static void mtp_sltm_t1_timeout(void *_link)
link->sccp_up = 0;
link->running = 0;
bsc_del_timer(&link->t2_timer);
- mtp_link_sccp_down(link);
- mtp_link_restart(link);
+ mtp_link_set_sccp_down(link);
+ mtp_link_set_restart(link);
}
}
static void mtp_sltm_t2_timeout(void *_link)
{
- struct mtp_link *link = (struct mtp_link *) _link;
+ struct mtp_link_set *link = (struct mtp_link_set *) _link;
if (!link->running) {
LOGP(DINP, LOGL_INFO, "Not restarting SLTM timer on link: %p\n", link);
@@ -249,11 +249,11 @@ static void mtp_delayed_start(void *link)
mtp_sltm_t2_timeout(link);
}
-struct mtp_link *mtp_link_alloc(void)
+struct mtp_link_set *mtp_link_set_alloc(void)
{
- struct mtp_link *link;
+ struct mtp_link_set *link;
- link = talloc_zero(tall_mtp_ctx, struct mtp_link);
+ link = talloc_zero(tall_mtp_ctx, struct mtp_link_set);
if (!link)
return NULL;
@@ -267,7 +267,7 @@ struct mtp_link *mtp_link_alloc(void)
return link;
}
-void mtp_link_stop(struct mtp_link *link)
+void mtp_link_set_stop(struct mtp_link_set *link)
{
bsc_del_timer(&link->t1_timer);
bsc_del_timer(&link->t2_timer);
@@ -276,17 +276,17 @@ void mtp_link_stop(struct mtp_link *link)
link->running = 0;
link->sltm_pending = 0;
- mtp_link_sccp_down(link);
+ mtp_link_set_sccp_down(link);
}
-void mtp_link_reset(struct mtp_link *link)
+void mtp_link_set_reset(struct mtp_link_set *link)
{
- mtp_link_stop(link);
+ mtp_link_set_stop(link);
link->running = 1;
bsc_schedule_timer(&link->delay_timer, START_DELAY);
}
-static int mtp_link_sign_msg(struct mtp_link *link, struct mtp_level_3_hdr *hdr, int l3_len)
+static int mtp_link_sign_msg(struct mtp_link_set *link, struct mtp_level_3_hdr *hdr, int l3_len)
{
struct msgb *msg;
struct mtp_level_3_cmn *cmn;
@@ -308,18 +308,18 @@ static int mtp_link_sign_msg(struct mtp_link *link, struct mtp_level_3_hdr *hdr,
case MTP_RESTR_MSG_ALLWED:
LOGP(DINP, LOGL_INFO, "Received Restart Allowed. SST could be next: %p\n", link);
link->sccp_up = 0;
- mtp_link_sccp_down(link);
+ mtp_link_set_sccp_down(link);
msg = mtp_tfp_alloc(link, 0);
if (!msg)
return -1;
- mtp_link_submit(link, msg);
+ mtp_link_set_submit(link, msg);
msg = mtp_tra_alloc(link);
if (!msg)
return -1;
- mtp_link_submit(link, msg);
+ mtp_link_set_submit(link, msg);
link->sccp_up = 1;
link->was_up = 1;
LOGP(DINP, LOGL_INFO, "SCCP traffic allowed. %p\n", link);
@@ -348,7 +348,7 @@ static int mtp_link_sign_msg(struct mtp_link *link, struct mtp_level_3_hdr *hdr,
return -1;
}
-static int mtp_link_regular_msg(struct mtp_link *link, struct mtp_level_3_hdr *hdr, int l3_len)
+static int mtp_link_regular_msg(struct mtp_link_set *link, struct mtp_level_3_hdr *hdr, int l3_len)
{
struct msgb *out;
struct mtp_level_3_mng *mng;
@@ -371,7 +371,7 @@ static int mtp_link_regular_msg(struct mtp_link *link, struct mtp_level_3_hdr *h
out = mtp_create_slta(link, mng, l3_len);
if (!out)
return -1;
- mtp_link_submit(link, out);
+ mtp_link_set_submit(link, out);
return 0;
break;
case MTP_TST_MSG_SLTA:
@@ -402,7 +402,7 @@ static int mtp_link_regular_msg(struct mtp_link *link, struct mtp_level_3_hdr *h
return -1;
}
-static int mtp_link_sccp_data(struct mtp_link *link, struct mtp_level_3_hdr *hdr, struct msgb *msg, int l3_len)
+static int mtp_link_sccp_data(struct mtp_link_set *link, struct mtp_level_3_hdr *hdr, struct msgb *msg, int l3_len)
{
struct msgb *out;
struct sccp_con_ctrl_prt_mgt *prt;
@@ -455,15 +455,15 @@ static int mtp_link_sccp_data(struct mtp_link *link, struct mtp_level_3_hdr *hdr
if (!out)
return -1;
- mtp_link_submit(link, out);
+ mtp_link_set_submit(link, out);
return 0;
}
- mtp_link_forward_sccp(link, msg, MTP_LINK_SLS(hdr->addr));
+ mtp_link_set_forward_sccp(link, msg, MTP_LINK_SLS(hdr->addr));
return 0;
}
-int mtp_link_data(struct mtp_link *link, struct msgb *msg)
+int mtp_link_set_data(struct mtp_link_set *link, struct msgb *msg)
{
int rc = -1;
struct mtp_level_3_hdr *hdr;
@@ -492,7 +492,7 @@ int mtp_link_data(struct mtp_link *link, struct msgb *msg)
break;
case MTP_SI_MNT_ISUP:
msg->l3h = &hdr->data[0];
- rc = mtp_link_forward_isup(link, msg, MTP_LINK_SLS(hdr->addr));
+ rc = mtp_link_set_forward_isup(link, msg, MTP_LINK_SLS(hdr->addr));
break;
default:
fprintf(stderr, "Unhandled: %u\n", hdr->ser_ind);
@@ -502,7 +502,7 @@ int mtp_link_data(struct mtp_link *link, struct msgb *msg)
return rc;
}
-int mtp_link_submit_sccp_data(struct mtp_link *link, int sls, const uint8_t *data, unsigned int length)
+int mtp_link_set_submit_sccp_data(struct mtp_link_set *link, int sls, const uint8_t *data, unsigned int length)
{
if (!link->sccp_up) {
@@ -518,13 +518,13 @@ int mtp_link_submit_sccp_data(struct mtp_link *link, int sls, const uint8_t *dat
return mtp_int_submit(link, link->sccp_opc, sls, MTP_SI_MNT_SCCP, data, length);
}
-int mtp_link_submit_isup_data(struct mtp_link *link, int sls,
+int mtp_link_set_submit_isup_data(struct mtp_link_set *link, int sls,
const uint8_t *data, unsigned int length)
{
return mtp_int_submit(link, link->opc, sls, MTP_SI_MNT_ISUP, data, length);
}
-static int mtp_int_submit(struct mtp_link *link, int pc, int sls, int type,
+static int mtp_int_submit(struct mtp_link_set *link, int pc, int sls, int type,
const uint8_t *data, unsigned int length)
{
uint8_t *put_ptr;
@@ -544,6 +544,6 @@ static int mtp_int_submit(struct mtp_link *link, int pc, int sls, int type,
put_ptr = msgb_put(msg, length);
memcpy(put_ptr, data, length);
- mtp_link_submit(link, msg);
+ mtp_link_set_submit(link, msg);
return 0;
}
diff --git a/tests/isup/isup_parse_test.c b/tests/isup/isup_parse_test.c
index 5b19ed0..5c3341c 100644
--- a/tests/isup/isup_parse_test.c
+++ b/tests/isup/isup_parse_test.c
@@ -62,4 +62,4 @@ int main(int argc, char **argv)
}
/* stubs */
-int mtp_link_submit_isup_data() {return -1;}
+int mtp_link_set_submit_isup_data() {return -1;}