diff options
-rw-r--r-- | call/call.1 | 5 | ||||
-rw-r--r-- | call/call.c | 21 |
2 files changed, 18 insertions, 8 deletions
diff --git a/call/call.1 b/call/call.1 index 25b8c65..b5d460e 100644 --- a/call/call.1 +++ b/call/call.1 @@ -4,7 +4,7 @@ call \- make an AX.25, NET/ROM or Rose connection. .SH SYNOPSIS For AX.25 .br -.B call [-b l|e] [-d] [-h] [-m s|e] [-p paclen] [-r] [-t] [-v] [-w window] port callsign [[via] digipeaters.....] +.B call [-b l|e] [-d] [-h] [-m s|e] [-p paclen] [-s mycall] [-r] [-t] [-v] [-w window] port callsign [[via] digipeaters.....] .sp 1 For NET/ROM .br @@ -68,6 +68,9 @@ for extended (modulus 128) AX.25 operation. .BI "\-p paclen" Specify a specific maximum amount of data to be sent in each AX.25 packet. .TP 10 +.BI "\-s mycall" +Connect using the specified source call (you may need to be root). +.TP 10 .BI \-r Selects Raw mode. .TP 10 diff --git a/call/call.c b/call/call.c index aa0412d..26534ed 100644 --- a/call/call.c +++ b/call/call.c @@ -86,6 +86,7 @@ static int debug = FALSE; static int af_mode = AF_AX25; static int window = 0; static char *port = NULL; +static char *mycall = NULL; int interrupted = FALSE; int paclen = 0; @@ -114,6 +115,12 @@ typedef struct { #define SLAVEMODE 002 /* Menu mode */ #define RAWMODE 004 /* mode used by earlier versions */ +void usage(void) +{ + fprintf(stderr, "usage: call [-b l|e] [-d] [-h] [-m s|e] [-p paclen] [-r] [-s mycall] [-t] [-v] [-w window] port callsign [[via] digipeaters...]\n"); + exit(1); +} + WINDOW *win; const char *key_words[] = { "//", "#BIN#", @@ -242,6 +249,8 @@ static int connect_to(char *address[]) sockaddr.ax25.fsa_ax25.sax25_ndigis = 1; } sockaddr.ax25.fsa_ax25.sax25_family = AF_AX25; + if (mycall) + ax25_aton_entry(mycall, sockaddr.ax25.fsa_ax25.sax25_call.ax25_call); addrlen = sizeof(struct full_sockaddr_ax25); if (setsockopt @@ -2053,7 +2062,7 @@ int main(int argc, char **argv) int p; int mode = TALKMODE; - while ((p = getopt(argc, argv, "b:dhm:p:rtvw:")) != -1) { + while ((p = getopt(argc, argv, "b:dhm:p:rs:tvw:")) != -1) { switch (p) { case 'b': if (*optarg != 'e' && *optarg != 'l') { @@ -2092,6 +2101,8 @@ int main(int argc, char **argv) case 'r': mode = RAWMODE; break; + case 's': + mycall = strdup(optarg); case 't': mode = TALKMODE; break; @@ -2120,16 +2131,12 @@ int main(int argc, char **argv) break; case '?': case ':': - fprintf(stderr, - "usage: call [-b l|e] [-d] [-h] [-m s|e] [-p paclen] [-r] [-t] [-v] [-w window] port callsign [[via] digipeaters...]\n"); - return 1; + usage(); } } if (optind == argc || optind == argc - 1) { - fprintf(stderr, - "usage: call [-b l|e] [-d] [-h] [-m s|e] [-p paclen] [-r] [-t] [-v] [-w window] port callsign [[via] digipeaters...]\n"); - return 1; + usage(); } port = argv[optind]; |