summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mausezahn.82
-rw-r--r--staging/cli.c10
-rw-r--r--staging/mausezahn.c2
3 files changed, 9 insertions, 5 deletions
diff --git a/mausezahn.8 b/mausezahn.8
index e094e9b..24e829e 100644
--- a/mausezahn.8
+++ b/mausezahn.8
@@ -231,6 +231,7 @@ Options supported in the configuration file are:
password Password for authentication (default: mz)
enable Password to enter privilege mode (default: mops)
port The listening port for the CLI (default: 25542)
+ listen-addr IP address to bind CLI to (default: 0.0.0.0)
management-only Set management interface (no data traffic is allowed to pass through)
cli-device Interface to bind CLI to (default: all) *not fully implemented*
automops Path to automops file (contains XML data describing protocols) *in development*
@@ -242,6 +243,7 @@ Options supported in the configuration file are:
password = mzpasswd
enable = privilege-mode-passwd
port = 65000
+ listen-addr = 127.0.0.1
.PP
.SH INTERACTIVE MODE HOWTO
.PP
diff --git a/staging/cli.c b/staging/cli.c
index a5ce174..3d39bd3 100644
--- a/staging/cli.c
+++ b/staging/cli.c
@@ -56,7 +56,7 @@ int cli_read_cfg(char *str)
char dev[256];
FILE *fd;
int i, j=0, len, found=0, nonspc=0;
- int user=0, pass=0, ena=0, amp=0, mgmt_only=0, cli=0, port=0;
+ int user=0, pass=0, ena=0, amp=0, mgmt_only=0, cli=0, port=0, addr=0;
strncpy(filename, str, 255);
@@ -78,9 +78,10 @@ int cli_read_cfg(char *str)
if (nonspc==0) continue; else nonspc=0;
if (!user) user = sscanf(line, " user = %s ", mz_username);
if (!pass) pass = sscanf(line, " password = %s ", mz_password);
- if (!ena) ena = sscanf(line, " enable = %s ", mz_enable);
+ if (!ena) ena = sscanf(line, " enable = %s ", mz_enable);
if (!port) port = sscanf(line, " port = %i ", &mz_port);
- if (!cli) cli = sscanf(line, " cli-device = %s ", dev);
+ if (!addr) addr = sscanf(line, " listen-addr = %s ", mz_listen_addr);
+ if (!cli) cli = sscanf(line, " cli-device = %s ", dev);
if (cli==1) {
for (i=0; i<device_list_entries; i++) {
if (strncmp(device_list[i].dev, dev, 16)==0) {
@@ -145,6 +146,9 @@ int cli_read_cfg(char *str)
if (port!=1)
fprintf(stderr, "%s: No port specified - will use default.\n", filename);
+
+ if (addr!=1)
+ fprintf(stderr, "%s: No listen address specified - will use default.\n", filename);
}
cli_debug = 0;
diff --git a/staging/mausezahn.c b/staging/mausezahn.c
index 46b7428..6edef71 100644
--- a/staging/mausezahn.c
+++ b/staging/mausezahn.c
@@ -563,8 +563,6 @@ int getopts (int argc, char *argv[])
if (verbose) fprintf(stderr, " mz: no active interfaces found!\n");
strcpy(tx.device, "lo");
}
- if (verbose) // device found
- fprintf(stderr," mz: device not given, will use %s\n",tx.device);
break;
case 1: // arg_string OR device given => find out!
if ( (strncmp(argv[optind],"eth",3)==0)