From f603f28488c6c6f04d8314d9f049b535d74d6307 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 30 Jan 2011 00:24:15 +0100 Subject: [PATCH] isup: Make it possible for the STP to handle/not handle ISUP messages Add an option to decide if we should handle GROUP BLOCK and RESET messages inside the STP or if we should forward those as well. --- include/bsc_data.h | 3 +++ src/main_stp.c | 7 +++++-- src/vty_interface.c | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/include/bsc_data.h b/include/bsc_data.h index 698a33f..fe6d295 100644 --- a/include/bsc_data.h +++ b/include/bsc_data.h @@ -124,6 +124,9 @@ struct bsc_data { int ni_ni; int ni_spare; + /* isup handling */ + int isup_pass; + /* LAC of the cell */ struct gsm48_loc_area_id lai; uint16_t mcc; diff --git a/src/main_stp.c b/src/main_stp.c index 45a89aa..444e7be 100644 --- a/src/main_stp.c +++ b/src/main_stp.c @@ -256,8 +256,11 @@ int main(int argc, char **argv) bsc.m2ua_set->name = talloc_strdup(bsc.m2ua_set, "M2UA"); /* for both links we want to have all isup messages */ - bsc.m2ua_set->pass_all_isup = 1; - bsc.link_set->pass_all_isup = 1; + if (bsc.isup_pass) { + LOGP(DINP, LOGL_NOTICE, "Going to pass through all ISUP messages.\n"); + bsc.m2ua_set->pass_all_isup = 1; + bsc.link_set->pass_all_isup = 1; + } lnk = sctp_m2ua_transp_create("0.0.0.0", 2904); lnk->base.pcap_fd = -1; diff --git a/src/vty_interface.c b/src/vty_interface.c index ec85f30..8185406 100644 --- a/src/vty_interface.c +++ b/src/vty_interface.c @@ -83,6 +83,7 @@ static int config_write_cell(struct vty *vty) vty_out(vty, " msc ip %s%s", bsc.msc_address, VTY_NEWLINE); vty_out(vty, " msc ip-dscp %d%s", bsc.msc_ip_dscp, VTY_NEWLINE); vty_out(vty, " msc token %s%s", bsc.token, VTY_NEWLINE); + vty_out(vty, " isup pass-through %d%s", bsc.isup_pass, VTY_NEWLINE); return CMD_SUCCESS; } @@ -290,6 +291,21 @@ DEFUN(cfg_lac, cfg_lac_cmd, return CMD_SUCCESS; } +DEFUN(cfg_isup_pass, cfg_isup_pass_cmd, + "isup pass-through (0|1)", + "ISUP related functionality\n" + "Pass through all ISUP messages directly\n" + "Handle some messages locally\n" "Pass through everything\n") +{ + bsc.isup_pass = atoi(argv[0]); + if (bsc.m2ua_set) + bsc.m2ua_set->pass_all_isup = bsc.isup_pass; + if (bsc.link_set) + bsc.link_set->pass_all_isup = bsc.isup_pass; + + return CMD_SUCCESS; +} + static void dump_stats(struct vty *vty, const char *name, struct mtp_link_set *set) { struct mtp_link *link; @@ -532,6 +548,7 @@ void cell_vty_init(void) install_element(CELLMGR_NODE, &cfg_mcc_cmd); install_element(CELLMGR_NODE, &cfg_mnc_cmd); install_element(CELLMGR_NODE, &cfg_lac_cmd); + install_element(CELLMGR_NODE, &cfg_isup_pass_cmd); /* special commands */ install_element(ENABLE_NODE, &pcap_set_cmd);