Work-In-Progress for M3UA/SCCPlite.. handling
This is a bit of a dead-end. SCCPlite/M3UA should not use a mtp_linkset as this requires dealing with SLTM/SLTA.. routing data. Right now I can either add special code to the linkset to shut off parts of or bypass it in the SS7 application code..
This commit is contained in:
parent
c4e913993d
commit
1f7315058a
9
TODO
9
TODO
|
@ -4,3 +4,12 @@ Implement proper routing as in Q.704. The 'applications' need to describe
|
||||||
which PCs can be reached by the application (insert items in the routing
|
which PCs can be reached by the application (insert items in the routing
|
||||||
table), during the MTP Restart one needs to collect the TRA and TFA for
|
table), during the MTP Restart one needs to collect the TRA and TFA for
|
||||||
rachable points, then TFA for the reachable points to all adjacent links..
|
rachable points, then TFA for the reachable points to all adjacent links..
|
||||||
|
|
||||||
|
== Handling of Link Types ==
|
||||||
|
|
||||||
|
The support for the SCCPlite but also M3UA is difficult. Everything is going
|
||||||
|
through MTP and we would need a linkset base class and have a stub one and a
|
||||||
|
mtp one. Right now this is a a big hack.
|
||||||
|
|
||||||
|
This should be done in the SS7_Application code. Like there are multiple
|
||||||
|
link types.. there should be multiple linksets types.
|
||||||
|
|
|
@ -42,6 +42,7 @@ enum ss7_link_type {
|
||||||
SS7_LTYPE_NONE,
|
SS7_LTYPE_NONE,
|
||||||
SS7_LTYPE_UDP,
|
SS7_LTYPE_UDP,
|
||||||
SS7_LTYPE_M2UA,
|
SS7_LTYPE_M2UA,
|
||||||
|
SS7_LTYPE_SCCP_LITE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -20,13 +20,9 @@
|
||||||
|
|
||||||
#include "mtp_data.h"
|
#include "mtp_data.h"
|
||||||
|
|
||||||
struct sccp_lite_link {
|
struct mtp_sccp_lite_link {
|
||||||
struct mtp_link *base;
|
struct mtp_link *base;
|
||||||
|
|
||||||
int active;
|
|
||||||
int established;
|
|
||||||
struct sccp_lite_conn *conn;
|
|
||||||
|
|
||||||
/* token handling for pseudo-authentication */
|
/* token handling for pseudo-authentication */
|
||||||
char *token;
|
char *token;
|
||||||
|
|
||||||
|
@ -37,4 +33,6 @@ struct sccp_lite_link {
|
||||||
struct mtp_transport *sccp_lite_transp_create(struct bsc_data *bsc);
|
struct mtp_transport *sccp_lite_transp_create(struct bsc_data *bsc);
|
||||||
int sccp_lite_transp_bind(struct mtp_transport *trans, const char *ip, int port);
|
int sccp_lite_transp_bind(struct mtp_transport *trans, const char *ip, int port);
|
||||||
|
|
||||||
|
struct mtp_sccp_lite_link *mtp_sccp_lite_link_init(struct mtp_link *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -67,9 +67,6 @@ struct sctp_m2ua_conn {
|
||||||
|
|
||||||
struct mtp_transport *sctp_m2ua_transp_create(struct bsc_data *bsc);
|
struct mtp_transport *sctp_m2ua_transp_create(struct bsc_data *bsc);
|
||||||
int sctp_m2ua_transport_bind(struct mtp_transport *, const char *ip, int port);
|
int sctp_m2ua_transport_bind(struct mtp_transport *, const char *ip, int port);
|
||||||
struct mtp_m2ua_link *mtp_m2ua_link_create(struct mtp_transport *transport,
|
|
||||||
struct mtp_link_set *);
|
|
||||||
|
|
||||||
struct mtp_m2ua_link *mtp_m2ua_link_init(struct mtp_link *link);
|
struct mtp_m2ua_link *mtp_m2ua_link_init(struct mtp_link *link);
|
||||||
|
|
||||||
int sctp_m2ua_conn_count(struct mtp_transport *tran);
|
int sctp_m2ua_conn_count(struct mtp_transport *tran);
|
||||||
|
|
|
@ -41,6 +41,10 @@ static int sccp_lite_transp_accept(struct osmo_fd *fd, unsigned int what)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct mtp_sccp_lite_link *mtp_sccp_lite_link_init(struct mtp_link *lnk)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
struct mtp_transport *sccp_lite_transp_create(struct bsc_data *bsc)
|
struct mtp_transport *sccp_lite_transp_create(struct bsc_data *bsc)
|
||||||
{
|
{
|
||||||
return mtp_transport_create(bsc);
|
return mtp_transport_create(bsc);
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <mtp_pcap.h>
|
#include <mtp_pcap.h>
|
||||||
#include <msc_connection.h>
|
#include <msc_connection.h>
|
||||||
#include <sctp_m2ua.h>
|
#include <sctp_m2ua.h>
|
||||||
|
#include <sccp_lite.h>
|
||||||
#include <ss7_application.h>
|
#include <ss7_application.h>
|
||||||
#include <ss7_vty.h>
|
#include <ss7_vty.h>
|
||||||
#include <cellmgr_debug.h>
|
#include <cellmgr_debug.h>
|
||||||
|
@ -160,6 +161,7 @@ static void write_link(struct vty *vty, struct mtp_link *link)
|
||||||
const char *name = link->name ? link->name : "";
|
const char *name = link->name ? link->name : "";
|
||||||
struct mtp_udp_link *ulnk;
|
struct mtp_udp_link *ulnk;
|
||||||
struct mtp_m2ua_link *m2ua;
|
struct mtp_m2ua_link *m2ua;
|
||||||
|
struct mtp_sccp_lite_link *lite;
|
||||||
|
|
||||||
vty_out(vty, " link %d%s", link->nr, VTY_NEWLINE);
|
vty_out(vty, " link %d%s", link->nr, VTY_NEWLINE);
|
||||||
vty_out(vty, " description %s%s", name, VTY_NEWLINE);
|
vty_out(vty, " description %s%s", name, VTY_NEWLINE);
|
||||||
|
@ -187,6 +189,13 @@ static void write_link(struct vty *vty, struct mtp_link *link)
|
||||||
vty_out(vty, " m2ua link-index %d%s",
|
vty_out(vty, " m2ua link-index %d%s",
|
||||||
m2ua->link_index, VTY_NEWLINE);
|
m2ua->link_index, VTY_NEWLINE);
|
||||||
break;
|
break;
|
||||||
|
case SS7_LTYPE_SCCP_LITE:
|
||||||
|
lite = (struct mtp_sccp_lite_link *) link->data;
|
||||||
|
vty_out(vty, " ss7-transport sccp-lite%s", VTY_NEWLINE);
|
||||||
|
if (lite->token)
|
||||||
|
vty_out(vty, " sccp-lite token %s%s",
|
||||||
|
lite->token, VTY_NEWLINE);
|
||||||
|
break;
|
||||||
case SS7_LTYPE_NONE:
|
case SS7_LTYPE_NONE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -590,7 +599,7 @@ DEFUN(cfg_linkset_link, cfg_linkset_link_cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN(cfg_link_ss7_transport, cfg_link_ss7_transport_cmd,
|
DEFUN(cfg_link_ss7_transport, cfg_link_ss7_transport_cmd,
|
||||||
"ss7-transport (none|udp|m2ua)",
|
"ss7-transport (none|udp|m2ua|sccp-lite)",
|
||||||
"SS7 transport for the link\n"
|
"SS7 transport for the link\n"
|
||||||
"No transport\n" "MTP over UDP\n" "SCTP M2UA\n")
|
"No transport\n" "MTP over UDP\n" "SCTP M2UA\n")
|
||||||
{
|
{
|
||||||
|
@ -603,12 +612,19 @@ DEFUN(cfg_link_ss7_transport, cfg_link_ss7_transport_cmd,
|
||||||
wanted = SS7_LTYPE_UDP;
|
wanted = SS7_LTYPE_UDP;
|
||||||
else if (strcmp("m2ua", argv[0]) == 0)
|
else if (strcmp("m2ua", argv[0]) == 0)
|
||||||
wanted = SS7_LTYPE_M2UA;
|
wanted = SS7_LTYPE_M2UA;
|
||||||
|
else if (strcmp("sccp-lite", argv[0]) == 0)
|
||||||
|
wanted = SS7_LTYPE_SCCP_LITE;
|
||||||
|
|
||||||
if (link->type != wanted && link->type != SS7_LTYPE_NONE) {
|
if (link->type != wanted && link->type != SS7_LTYPE_NONE) {
|
||||||
vty_out(vty, "%%Can not change the type of a link.\n");
|
vty_out(vty, "%%Can not change the type of a link.\n");
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (link->nr > 0 && wanted == SS7_LTYPE_SCCP_LITE) {
|
||||||
|
vty_out(vty, "%%Can only have SCCP-lite as 0.\n");
|
||||||
|
return CMD_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
switch (wanted) {
|
switch (wanted) {
|
||||||
case SS7_LTYPE_UDP:
|
case SS7_LTYPE_UDP:
|
||||||
link->data = mtp_udp_link_init(link);
|
link->data = mtp_udp_link_init(link);
|
||||||
|
@ -616,6 +632,9 @@ DEFUN(cfg_link_ss7_transport, cfg_link_ss7_transport_cmd,
|
||||||
case SS7_LTYPE_M2UA:
|
case SS7_LTYPE_M2UA:
|
||||||
link->data = mtp_m2ua_link_init(link);
|
link->data = mtp_m2ua_link_init(link);
|
||||||
break;
|
break;
|
||||||
|
case SS7_LTYPE_SCCP_LITE:
|
||||||
|
link->data = mtp_sccp_lite_link_init(link);
|
||||||
|
break;
|
||||||
case SS7_LTYPE_NONE:
|
case SS7_LTYPE_NONE:
|
||||||
/* nothing */
|
/* nothing */
|
||||||
break;
|
break;
|
||||||
|
@ -752,6 +771,25 @@ DEFUN(cfg_link_m2ua_link_index, cfg_link_m2ua_link_index_cmd,
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFUN(cfg_link_sccp_lite_token, cfg_link_sccp_lite_token_cmd,
|
||||||
|
"sccp-lite token TOKEN",
|
||||||
|
"SCCP-lite/MAP-lite related\n" "Token for pseudo-auth\n" "Token\n")
|
||||||
|
{
|
||||||
|
struct mtp_link *link = vty->index;
|
||||||
|
struct mtp_sccp_lite_link *lite;
|
||||||
|
|
||||||
|
if (link->type != SS7_LTYPE_SCCP_LITE) {
|
||||||
|
vty_out(vty, "%%This only applies to SCCP-lite links.%s", VTY_NEWLINE);
|
||||||
|
return CMD_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
|
lite = link->data;
|
||||||
|
if (lite->token)
|
||||||
|
talloc_free(lite->token);
|
||||||
|
lite->token = talloc_strdup(lite, argv[0]);
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
DEFUN(cfg_ss7_msc, cfg_ss7_msc_cmd,
|
DEFUN(cfg_ss7_msc, cfg_ss7_msc_cmd,
|
||||||
"msc <0-100>",
|
"msc <0-100>",
|
||||||
"MSC Connection\n" "MSC Number\n")
|
"MSC Connection\n" "MSC Number\n")
|
||||||
|
@ -1106,6 +1144,7 @@ void cell_vty_init(void)
|
||||||
install_element(LINK_NODE, &cfg_link_udp_link_index_cmd);
|
install_element(LINK_NODE, &cfg_link_udp_link_index_cmd);
|
||||||
install_element(LINK_NODE, &cfg_link_m2ua_as_cmd);
|
install_element(LINK_NODE, &cfg_link_m2ua_as_cmd);
|
||||||
install_element(LINK_NODE, &cfg_link_m2ua_link_index_cmd);
|
install_element(LINK_NODE, &cfg_link_m2ua_link_index_cmd);
|
||||||
|
install_element(LINK_NODE, &cfg_link_sccp_lite_token_cmd);
|
||||||
|
|
||||||
install_element(SS7_NODE, &cfg_ss7_msc_cmd);
|
install_element(SS7_NODE, &cfg_ss7_msc_cmd);
|
||||||
install_node(&msc_node, config_write_msc);
|
install_node(&msc_node, config_write_msc);
|
||||||
|
|
Reference in New Issue