9
0
Fork 0

mtp: Make the spare/ni configurable

This commit is contained in:
Holger Hans Peter Freyther 2010-11-26 21:21:04 +01:00
parent e976df1b5b
commit b38b33b884
3 changed files with 30 additions and 0 deletions

View File

@ -110,6 +110,10 @@ struct bsc_data {
char *udp_ip;
int once;
/* the network header to use */
int ni_ni;
int ni_spare;
/* LAC of the cell */
struct gsm48_loc_area_id lai;
uint16_t mcc;

View File

@ -21,6 +21,7 @@
*/
#include <mtp_data.h>
#include <mtp_level3.h>
#include <mtp_pcap.h>
#include <thread.h>
#include <bss_patch.h>
@ -722,6 +723,8 @@ int main(int argc, char **argv)
bsc.udp_port = 3456;
bsc.udp_ip = NULL;
bsc.src_port = 1313;
bsc.ni_ni = MTP_NI_NATION_NET;
bsc.ni_spare = 0;
mtp_link_init();
thread_init();
@ -771,6 +774,8 @@ int main(int argc, char **argv)
bsc.link.the_link->opc = bsc.opc;
bsc.link.the_link->link = 0;
bsc.link.the_link->sltm_once = bsc.once;
bsc.link.the_link->ni = bsc.ni_ni;
bsc.link.the_link->spare = bsc.ni_spare;
bsc.link.bsc = &bsc;
if (bsc.udp_ip) {

View File

@ -62,6 +62,8 @@ static int config_write_cell(struct vty *vty)
vty_out(vty, "cellmgr%s", VTY_NEWLINE);
vty_out(vty, " mtp dpc %d%s", bsc.dpc, VTY_NEWLINE);
vty_out(vty, " mtp opc %d%s", bsc.opc, VTY_NEWLINE);
vty_out(vty, " mtp ni %d%s", bsc.ni_ni, VTY_NEWLINE);
vty_out(vty, " mtp spare %d%s", bsc.ni_spare, VTY_NEWLINE);
vty_out(vty, " country-code %d%s", bsc.mcc, VTY_NEWLINE);
vty_out(vty, " network-code %d%s", bsc.mnc, VTY_NEWLINE);
vty_out(vty, " location-area-code %d%s", bsc.lac, VTY_NEWLINE);
@ -101,6 +103,23 @@ DEFUN(cfg_net_opc, cfg_net_opc_cmd,
return CMD_SUCCESS;
}
DEFUN(cfg_net_mtp_ni, cfg_net_mtp_ni_cmd,
"mtp ni NR",
"Set the MTP NI to be used.\n" "NR")
{
bsc.ni_ni = atoi(argv[0]);
return CMD_SUCCESS;
}
DEFUN(cfg_net_mtp_spare, cfg_net_mtp_spare_cmd,
"mtp spare NR",
"Set the MTP Spare to be used.\n" "NR")
{
bsc.ni_spare = atoi(argv[0]);
return CMD_SUCCESS;
}
DEFUN(cfg_udp_dst_ip, cfg_udp_dst_ip_cmd,
"udp dest ip IP",
"Set the IP when UDP mode is supposed to be used.")
@ -258,6 +277,8 @@ void cell_vty_init(void)
install_element(CELLMGR_NODE, &cfg_net_dpc_cmd);
install_element(CELLMGR_NODE, &cfg_net_opc_cmd);
install_element(CELLMGR_NODE, &cfg_net_mtp_ni_cmd);
install_element(CELLMGR_NODE, &cfg_net_mtp_spare_cmd);
install_element(CELLMGR_NODE, &cfg_udp_dst_ip_cmd);
install_element(CELLMGR_NODE, &cfg_udp_dst_port_cmd);
install_element(CELLMGR_NODE, &cfg_udp_src_port_cmd);