aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ss7_application.h5
-rw-r--r--src/ss7_application.c12
-rw-r--r--src/vty_interface.c46
3 files changed, 57 insertions, 6 deletions
diff --git a/include/ss7_application.h b/include/ss7_application.h
index 4462337..3d25165 100644
--- a/include/ss7_application.h
+++ b/include/ss7_application.h
@@ -78,8 +78,9 @@ struct ss7_application {
int forward_only;
int reset_count;
- /* mgcp handling for the cellmgr */
+ /* mgcp handling for the cellmgr and stp */
char *mgcp_domain_name;
+ char *trunk_name;
};
@@ -96,5 +97,7 @@ void ss7_application_pass_isup(struct ss7_application *, int pass);
int ss7_application_mgcp_domain_name(struct ss7_application *,
const char *domain_name);
+int ss7_application_trunk_name(struct ss7_application *,
+ const char *trunk_name);
#endif
diff --git a/src/ss7_application.c b/src/ss7_application.c
index 701ec04..b28c376 100644
--- a/src/ss7_application.c
+++ b/src/ss7_application.c
@@ -1,8 +1,8 @@
/*
* The SS7 Application part for forwarding or nat...
*
- * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
- * (C) 2010-2011 by On-Waves
+ * (C) 2010-2012 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2010-2012 by On-Waves
* All Rights Reserved
*
* This program is free software: you can redistribute it and/or modify
@@ -421,3 +421,11 @@ int ss7_application_mgcp_domain_name(struct ss7_application *app,
return app->mgcp_domain_name == NULL;
}
+
+int ss7_application_trunk_name(struct ss7_application *app, const char *name)
+{
+ talloc_free(app->trunk_name);
+ app->trunk_name = talloc_strdup(app, name);
+
+ return app->trunk_name == NULL;
+}
diff --git a/src/vty_interface.c b/src/vty_interface.c
index 01e504c..48e150e 100644
--- a/src/vty_interface.c
+++ b/src/vty_interface.c
@@ -1,7 +1,7 @@
/* VTY code for the osmo-stp */
/*
- * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
- * (C) 2010-2011 by On-Waves
+ * (C) 2010-2012 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2010-2012 by On-Waves
* All Rights Reserved
*
* This program is free software: you can redistribute it and/or modify
@@ -296,8 +296,10 @@ static void write_application(struct vty *vty, struct ss7_application *app)
vty_out(vty, " description %s%s", name, VTY_NEWLINE);
vty_out(vty, " type %s%s", app_type(app->type), VTY_NEWLINE);
- if (app->type == APP_STP)
+ if (app->type == APP_STP) {
vty_out(vty, " isup-pass-through %d%s", app->isup_pass, VTY_NEWLINE);
+ vty_out(vty, " trunk-name %s%s", app->trunk_name, VTY_NEWLINE);
+ }
if (app->type == APP_CELLMGR && app->mgcp_domain_name) {
vty_out(vty, " domain-name %s%s",
@@ -988,6 +990,42 @@ DEFUN(cfg_app_no_domain_name, cfg_app_no_domain_name_cmd,
return CMD_SUCCESS;
}
+#define TRUNK_NAME_STR "Trunk name to use\n"
+
+DEFUN(cfg_app_trunk_name, cfg_app_trunk_name_cmd,
+ "trunk-name NAME",
+ TRUNK_NAME_STR "The name\n")
+{
+ struct ss7_application *app = vty->index;
+
+ if (app->type != APP_STP) {
+ vty_out(vty, "The app type needs to be 'stp'.%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ if (ss7_application_trunk_name(app, argv[0]) != 0) {
+ vty_out(vty, "Failed to set the trunk name.%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_app_no_trunk_name, cfg_app_no_trunk_name_cmd,
+ "no trunk-name NAME",
+ NO_STR TRUNK_NAME_STR "The name\n")
+{
+ struct ss7_application *app = vty->index;
+
+ if (app->type != APP_STP) {
+ vty_out(vty, "The app type needs to be 'stp'.%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ talloc_free(app->trunk_name);
+ app->trunk_name = NULL;
+ return CMD_SUCCESS;
+}
static void install_defaults(int node)
{
@@ -1062,6 +1100,8 @@ void cell_vty_init(void)
install_element(APP_NODE, &cfg_app_route_ls_cmd);
install_element(APP_NODE, &cfg_app_domain_name_cmd);
install_element(APP_NODE, &cfg_app_no_domain_name_cmd);
+ install_element(APP_NODE, &cfg_app_trunk_name_cmd);
+ install_element(APP_NODE, &cfg_app_no_trunk_name_cmd);
cell_vty_init_cmds();
}