summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Osterried <thomas@osterried.de>2007-04-16 21:32:44 +0000
committerThomas Osterried <thomas@osterried.de>2007-04-16 21:32:44 +0000
commit353e52b23ccd658a6b3f28e284e6abbc37d7b1cb (patch)
tree988195703e1e06e201be9b7688f443c3547d2906
parent33f49efa5348c9d5c11a35e1a6d0298fcd66a8a3 (diff)
- axparms is now more posix compliant
- Fix in the man page: axparms --set-call told something wrong about "serial-device".
-rw-r--r--ax25/axparms.850
-rw-r--r--ax25/axparms.c34
2 files changed, 44 insertions, 40 deletions
diff --git a/ax25/axparms.8 b/ax25/axparms.8
index 627adbf..9989be8 100644
--- a/ax25/axparms.8
+++ b/ax25/axparms.8
@@ -2,7 +2,7 @@
.SH NAME
axparms \- Configure AX.25 interfaces.
.SH SYNOPSIS
-.B axparms -assoc|-forward|-route|-setcall|-version ...
+.B axparms --assoc|--forward|--route|--setcall|--version ...
.SH DESCRIPTION
.LP
The
@@ -16,18 +16,18 @@ and
which this command superceedes. The different modes of the command are
chosen by the first argument. Sunsequent arguments depend upon this argument
and so no generalised command format can be given.
-.SH "-assoc Argument"
+.SH "--assoc Argument"
.LP
The format of this option is:
.LP
.nf
-.B axparms -assoc <callsign> <username>
+.B axparms --assoc <callsign> <username>
.br
-.B axparms -assoc <callsign> delete
+.B axparms --assoc <callsign> delete
.br
-.B axparms -assoc policy [default|deny]
+.B axparms --assoc policy [default|deny]
.br
-.B axparms -assoc show
+.B axparms --assoc show
.fi
.LP
This option mainpulates the kernel uid/callsign mapping table, allowing
@@ -38,21 +38,21 @@ actual port name, or to block traffic.
.LP
At power up the table is blank and the policy is 'default', which is thus
backward compatible.
-.SH "-forward Argument"
+.SH "--forward Argument"
.LP
Allows the use of many receivers with one transmitter, known as packet
forwarding in many systems. The format of this command is:
.LP
.nf
-.B axparms -forward <portfrom> <portto>
+.B axparms --forward <portfrom> <portto>
.br
-.B axparms -forward <portfrom> delete
+.B axparms --forward <portfrom> delete
.fi
.LP
Any packets to be transmitted on port portfrom will be transmitted on port
portto. This will stay in force until the second form of the command is
issued which will remove the association.
-.SH "-route Argument"
+.SH "--route Argument"
.LP
This option allows the internal AX.25 routing table to be manipulated. This
table is available for reading in /proc/net/ax25_route, and will be built up
@@ -62,35 +62,39 @@ entries via this option.
The formats of this option are:
.LP
.nf
-.B axparms -route add <port> <callsign> [<digis>] [-ipmode V|D]
+.B axparms --route add <port> <callsign> [<digis>] [--ipmode V|D]
.br
-.B axparms -route del <port> <callsign>
+.B axparms --route del <port> <callsign>
.fi
-.B axparms -route list
+.B axparms --route list
.fi
.LP
Routes added via this command will not be removed from the internal routing
table when they are \(lqold\(rq as normal entries are. The
-.B -ipmode
+.B --ipmode
option sets mode vc or mode datagram for this destination.
.LP
If the <callsign> argument is set to \(lqdefault\(rq then this will set the
default route for all outgoing AX.25 connections which will be used when there
is no specific route to the required destination.
-.SH "-setcall Argument"
+.SH "--setcall Argument"
.LP
The format of this option is:
.LP
-.B axparms -setcall <serial-device> <callsign>
+.B axparms --setcall <interface> <callsign>
.LP
-This changes the callsign associated with the given serial device in KISS mode.
-The change is permanent until the link is downed or another \(lqaxparms
--setcall\(rq is made.
+This changes the callsign associated at the given physical ax25 interface.
.LP
-The interface must already have been attached with
-.B kissattach
-to use this option.
-.SH "-version Argument"
+Cave: The interface name is not the symbolic port name from axports, but
+the real interface name (from ifconfig(8)):
+ax0, ax1, .., sp0, .., bpq0, ... etc..
+.LP
+The change is permanent as long as the interface exists, or another \(lqaxparms
+--setcall\(rq is issued.
+.LP
+The interface has to exist already in order to use this option; it
+may be in state UP or DOWN.
+.SH "--version Argument"
.LP
This option displays the version of the AX.25 utilities that
.B axparms
diff --git a/ax25/axparms.c b/ax25/axparms.c
index dbcae8f..141ceb2 100644
--- a/ax25/axparms.c
+++ b/ax25/axparms.c
@@ -31,33 +31,33 @@
void usage(void)
{
- fprintf(stderr, "usage: axparms -assoc|-forward|-route|-setcall|-version ...\n");
+ fprintf(stderr, "usage: axparms --assoc|--forward|--route|--setcall|--version ...\n");
}
void usageassoc(void)
{
- fprintf(stderr, "usage: axparms -assoc show\n");
- fprintf(stderr, "usage: axparms -assoc policy default|deny\n");
- fprintf(stderr, "usage: axparms -assoc [callsign] [username]\n");
- fprintf(stderr, "usage: axparms -assoc [callsign] delete\n");
+ fprintf(stderr, "usage: axparms --assoc show\n");
+ fprintf(stderr, "usage: axparms --assoc policy default|deny\n");
+ fprintf(stderr, "usage: axparms --assoc [callsign] [username]\n");
+ fprintf(stderr, "usage: axparms --assoc [callsign] delete\n");
}
void usageforward(void)
{
- fprintf(stderr, "usage: axparms -forward <portfrom> <portto>\n");
- fprintf(stderr, "usage: axparms -forward <portfrom> delete\n");
+ fprintf(stderr, "usage: axparms --forward <portfrom> <portto>\n");
+ fprintf(stderr, "usage: axparms --forward <portfrom> delete\n");
}
void usageroute(void)
{
- fprintf(stderr, "usage: axparms -route add port callsign [digi ...] [-ipmode mode]\n");
- fprintf(stderr, "usage: axparms -route del port callsign\n");
- fprintf(stderr, "usage: axparms -route list\n");
+ fprintf(stderr, "usage: axparms --route add port callsign [digi ...] [--ipmode mode]\n");
+ fprintf(stderr, "usage: axparms --route del port callsign\n");
+ fprintf(stderr, "usage: axparms --route list\n");
}
void usagesetcall(void)
{
- fprintf(stderr, "usage: axparms -setcall interface callsign\n");
+ fprintf(stderr, "usage: axparms --setcall interface callsign\n");
}
int routes(int s, int argc, char *argv[], ax25_address *callsign)
@@ -81,7 +81,7 @@ int routes(int s, int argc, char *argv[], ax25_address *callsign)
}
for (i = 5, j = 0; i < argc && j < 6; i++) {
- if (strncmp(argv[i], "-i", 2) == 0) {
+ if (strncmp(argv[i], "--i", 3) == 0 || strncmp(argv[i], "-i", 2) == 0) {
if (++i == argc) {
fprintf(stderr, "axparms: -i must have a parameter\n");
return 1;
@@ -344,12 +344,12 @@ int main(int argc, char **argv)
return 1;
}
- if (strncmp(argv[1], "-v", 2) == 0) {
+ if (strncmp(argv[1], "--v", 3) == 0 || strncmp(argv[1], "-v", 2) == 0) {
printf("axparms: %s\n", VERSION);
return 0;
}
- if (strncmp(argv[1], "-a", 2) == 0) {
+ if (strncmp(argv[1], "--a", 3) == 0 || strncmp(argv[1], "-a", 2) == 0) {
if (argc < 3) {
usageassoc();
@@ -368,7 +368,7 @@ int main(int argc, char **argv)
return n;
}
- if (strncmp(argv[1], "-f", 2) == 0) {
+ if (strncmp(argv[1], "--f", 3) == 0 || strncmp(argv[1], "-f", 2) == 0) {
if (argc == 2) {
usageforward();
return 1;
@@ -386,7 +386,7 @@ int main(int argc, char **argv)
return n;
}
- if (strncmp(argv[1], "-r", 2) == 0) {
+ if (strncmp(argv[1], "--r", 3) == 0 || strncmp(argv[1], "-r", 2) == 0) {
if (argc < 3 ) {
usageroute();
return 1;
@@ -427,7 +427,7 @@ int main(int argc, char **argv)
return n;
}
- if (strncmp(argv[1], "-s", 2) == 0) {
+ if (strncmp(argv[1], "--s", 3) == 0 || strncmp(argv[1], "-s", 2) == 0) {
if (argc != 4) {
usagesetcall();
return 1;