diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-04-14 15:33:10 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-04-14 17:11:21 +0200 |
commit | f9aa9401055daad1df6bec456c1968ad3405cff1 (patch) | |
tree | 87922187f6565dea5685eabc81baed935e8e42a5 | |
parent | 74915be10b0e158fdbefba10c94d0e938a268163 (diff) |
osmo_ss7_vty: Add 'show cs7 instance <0-15> users' command
This will list which Service Indicators have bound local users (like SCCP)
Change-Id: Ibb21810e2ebe520e07cfdda3a0c62172b152015e
-rw-r--r-- | src/osmo_ss7_vty.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index d97610d..40f99b1 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -178,6 +178,32 @@ static int config_write_cs7(struct vty *vty) return 0; } +DEFUN(show_cs7_user, show_cs7_user_cmd, + "show cs7 instance <0-15> users", + SHOW_STR CS7_STR INST_STR INST_STR "User Table\n") +{ + int id = atoi(argv[0]); + struct osmo_ss7_instance *inst; + unsigned int i; + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + for (i = 0; i < ARRAY_SIZE(inst->user); i++) { + const struct osmo_ss7_user *user = inst->user[i]; + if (!user) + continue; + vty_out(vty, "SI %u: %s%s", i, user->name, VTY_NEWLINE); + } + + return CMD_SUCCESS; +} + +/* TODO: Links + Linksets */ + /*********************************************************************** * Routing Table Configuration ***********************************************************************/ @@ -897,6 +923,8 @@ int osmo_ss7_is_config_node(struct vty *vty, int node) static void vty_init_shared(void) { + install_element_ve(&show_cs7_user_cmd); + /* the mother of all VTY config nodes */ install_element(CONFIG_NODE, &cs7_instance_cmd); |