diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-07-28 16:14:04 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-07-28 16:14:04 +0200 |
commit | 1a6b83c919dec388853a28e4e1eae71305facb87 (patch) | |
tree | 542b751cf2e08db7406a9de360d2168d818af27e | |
parent | bc6a54dadcaa544a8acd0e2124ecf63138f0f79f (diff) |
nat: Document all parameters of the VTY commands
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | 76 |
1 files changed, 50 insertions, 26 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index 4cb353753..1646b592e 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -40,6 +40,8 @@ static struct bsc_nat *_nat; +#define BSC_STR "Information about BSCs\n" +#define MGCP_STR "MGCP related status\n" #define PAGING_STR "Paging\n" #define SMSC_REWRITE "SMSC Rewriting\n" @@ -168,7 +170,8 @@ static int config_write_bsc(struct vty *vty) DEFUN(show_sccp, show_sccp_cmd, "show sccp connections", - SHOW_STR "Display information about current SCCP connections") + SHOW_STR "Display information about SCCP\n" + "All active connections\n") { struct sccp_connections *con; vty_out(vty, "Listing all open SCCP connections%s", VTY_NEWLINE); @@ -189,7 +192,8 @@ DEFUN(show_sccp, show_sccp_cmd, "show sccp connections", } DEFUN(show_bsc, show_bsc_cmd, "show bsc connections", - SHOW_STR "Display information about current BSCs") + SHOW_STR BSC_STR + "All active connections\n") { struct bsc_connection *con; struct sockaddr_in sock; @@ -207,7 +211,7 @@ DEFUN(show_bsc, show_bsc_cmd, "show bsc connections", } DEFUN(show_bsc_mgcp, show_bsc_mgcp_cmd, "show bsc mgcp NR", - SHOW_STR "Display the MGCP status for a given BSC") + SHOW_STR BSC_STR MGCP_STR "Identifier of the BSC\n") { struct bsc_connection *con; int nr = atoi(argv[0]); @@ -242,7 +246,7 @@ DEFUN(show_bsc_mgcp, show_bsc_mgcp_cmd, "show bsc mgcp NR", } DEFUN(show_bsc_cfg, show_bsc_cfg_cmd, "show bsc config", - SHOW_STR "Display information about known BSC configs") + SHOW_STR BSC_STR "Configuration of BSCs\n") { struct bsc_config *conf; llist_for_each_entry(conf, &_nat->bsc_configs, entry) { @@ -300,7 +304,8 @@ static void dump_stat_bsc(struct vty *vty, struct bsc_config *conf) DEFUN(show_stats, show_stats_cmd, "show statistics [NR]", - SHOW_STR "Display network statistics") + SHOW_STR "Display network statistics\n" + "Number of the BSC\n") { struct bsc_config *conf; @@ -343,7 +348,8 @@ DEFUN(show_stats_lac, DEFUN(show_msc, show_msc_cmd, "show msc connection", - SHOW_STR "Show the status of the MSC connection.") + SHOW_STR "MSC related information\n" + "Status of the A-link connection\n") { if (!_nat->msc_con) { vty_out(vty, "The MSC is not yet configured.\n"); @@ -358,7 +364,7 @@ DEFUN(show_msc, DEFUN(close_bsc, close_bsc_cmd, "close bsc connection BSC_NR", - "Close the connection with the BSC identified by the config number.") + "Close\n" "A-link\n" "Connection\n" "Identifier of the BSC\n") { struct bsc_connection *bsc; int bsc_nr = atoi(argv[0]); @@ -384,7 +390,8 @@ DEFUN(cfg_nat, cfg_nat_cmd, "nat", "Configute the NAT") DEFUN(cfg_nat_msc_ip, cfg_nat_msc_ip_cmd, "msc ip A.B.C.D", - "Set the IP address of the MSC.") + "MSC related configuration\n" + "Configure the IP address\n" IP_STR) { bsc_nat_set_msc_ip(_nat, argv[0]); return CMD_SUCCESS; @@ -393,7 +400,9 @@ DEFUN(cfg_nat_msc_ip, DEFUN(cfg_nat_msc_port, cfg_nat_msc_port_cmd, "msc port <1-65500>", - "Set the port of the MSC.") + "MSC related configuration\n" + "Configure the port\n" + "Port number\n") { _nat->main_dest->port = atoi(argv[0]); return CMD_SUCCESS; @@ -402,7 +411,9 @@ DEFUN(cfg_nat_msc_port, DEFUN(cfg_nat_auth_time, cfg_nat_auth_time_cmd, "timeout auth <1-256>", - "The time to wait for an auth response.") + "Timeout configuration\n" + "Authentication timeout\n" + "Timeout in seconds\n") { _nat->auth_timeout = atoi(argv[0]); return CMD_SUCCESS; @@ -411,7 +422,9 @@ DEFUN(cfg_nat_auth_time, DEFUN(cfg_nat_ping_time, cfg_nat_ping_time_cmd, "timeout ping NR", - "Send a ping every NR seconds. Negative to disable.") + "Timeout configuration\n" + "Time between two pings\n" + "Timeout in seconds\n") { _nat->ping_timeout = atoi(argv[0]); return CMD_SUCCESS; @@ -420,7 +433,9 @@ DEFUN(cfg_nat_ping_time, DEFUN(cfg_nat_pong_time, cfg_nat_pong_time_cmd, "timeout pong NR", - "Wait NR seconds for the PONG response. Should be smaller than ping.") + "Timeout configuration\n" + "Waiting for pong timeout\n" + "Timeout in seconds\n") { _nat->pong_timeout = atoi(argv[0]); return CMD_SUCCESS; @@ -428,7 +443,8 @@ DEFUN(cfg_nat_pong_time, DEFUN(cfg_nat_token, cfg_nat_token_cmd, "token TOKEN", - "Set a token for the NAT") + "Authentication token configuration\n" + "Token of the BSC, currently transferred in cleartext\n") { bsc_replace_string(_nat, &_nat->token, argv[0]); return CMD_SUCCESS; @@ -603,7 +619,8 @@ DEFUN(cfg_nat_ussd_local, } /* per BSC configuration */ -DEFUN(cfg_bsc, cfg_bsc_cmd, "bsc BSC_NR", "Select a BSC to configure") +DEFUN(cfg_bsc, cfg_bsc_cmd, "bsc BSC_NR", + "BSC configuration\n" "Identifier of the BSC\n") { int bsc_nr = atoi(argv[0]); struct bsc_config *bsc; @@ -627,7 +644,9 @@ DEFUN(cfg_bsc, cfg_bsc_cmd, "bsc BSC_NR", "Select a BSC to configure") return CMD_SUCCESS; } -DEFUN(cfg_bsc_token, cfg_bsc_token_cmd, "token TOKEN", "Set the token") +DEFUN(cfg_bsc_token, cfg_bsc_token_cmd, "token TOKEN", + "Authentication token configuration\n" + "Token of the BSC, currently transferred in cleartext\n") { struct bsc_config *conf = vty->index; @@ -678,9 +697,10 @@ DEFUN(cfg_bsc_no_lac, cfg_bsc_no_lac_cmd, DEFUN(cfg_lst_imsi_allow, cfg_lst_imsi_allow_cmd, "access-list NAME imsi-allow [REGEXP]", - "Add the regexp to the allowed list\n" - "The name of the access-list\n" - "The regexp of allowed IMSIs\n") + "Access list commands\n" + "Name of the access list\n" + "Add allowed IMSI to the list\n" + "Regexp for IMSIs\n") { struct bsc_nat_acc_lst *acc; struct bsc_nat_acc_lst_entry *entry; @@ -701,9 +721,10 @@ DEFUN(cfg_lst_imsi_allow, DEFUN(cfg_lst_imsi_deny, cfg_lst_imsi_deny_cmd, "access-list NAME imsi-deny [REGEXP]", - "Add the regexp to the deny list\n" - "The name of the access-list\n" - "The regexp of to be denied IMSIs\n") + "Access list commands\n" + "Name of the access list\n" + "Add denied IMSI to the list\n" + "Regexp for IMSIs\n") { struct bsc_nat_acc_lst *acc; struct bsc_nat_acc_lst_entry *entry; @@ -740,7 +761,7 @@ DEFUN(cfg_lst_no, DEFUN(show_acc_lst, show_acc_lst_cmd, "show access-list NAME", - SHOW_STR "The name of the access list\n") + SHOW_STR "IMSI access list\n" "Name of the access list\n") { struct bsc_nat_acc_lst *acc; acc = bsc_nat_acc_lst_find(_nat, argv[0]); @@ -794,7 +815,8 @@ DEFUN(cfg_bsc_max_endps, cfg_bsc_max_endps_cmd, DEFUN(cfg_bsc_paging, cfg_bsc_paging_cmd, "paging forbidden (0|1)", - PAGING_STR "Forbid sending PAGING REQUESTS to the BSC.") + PAGING_STR "Forbid sending PAGING REQUESTS to the BSC.\n" + "Do not forbid\n" "Forbid\n") { struct bsc_config *conf = vty->index; @@ -809,7 +831,7 @@ DEFUN(cfg_bsc_paging, DEFUN(cfg_bsc_desc, cfg_bsc_desc_cmd, "description DESC", - "Provide a description for the given BSC.") + "Provide a description for the given BSC.\n" "Description\n") { struct bsc_config *conf = vty->index; @@ -843,7 +865,9 @@ DEFUN(cfg_bsc_no_paging_grp, DEFUN(test_regex, test_regex_cmd, "test regex PATTERN STRING", - "Check if the string is matching the current pattern.") + "Test utilities\n" + "Regexp testing\n" "The regexp pattern\n" + "The string to match\n") { regex_t reg; char *str = NULL; @@ -918,7 +942,7 @@ DEFUN(cfg_nat_pgroup, cfg_nat_pgroup_cmd, DEFUN(cfg_nat_no_pgroup, cfg_nat_no_pgroup_cmd, "no paging-group <0-1000>", - NO_STR "Delete paging-group\n") + NO_STR "Delete paging-group\n" "Paging-group number\n") { int group = atoi(argv[0]); struct bsc_nat_paging_group *pgroup; |