diff --git a/CHANGES.md b/CHANGES.md index be27c3f..012034a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,9 @@ This is a snapshot of ongoing development towards version of 1.5. Some features - decode_aprs utility can now accept KISS frames and AX.25 frames as series of two digit hexadecimal numbers. +- New configuration option, V20, for listing stations known to not understand AX.25 v2.2. + + ### Bugs Fixed: ### - Little spelling errors in messages ???? diff --git a/ax25_link.c b/ax25_link.c index 324334f..a27ba0f 100644 --- a/ax25_link.c +++ b/ax25_link.c @@ -885,6 +885,8 @@ void dl_connect_request (dlq_item_t *E) { ax25_dlsm_t *S; int ok_to_create = 1; + int old_version; + int n; if (s_debug_client_app) { text_color_set(DW_COLOR_DEBUG); @@ -902,7 +904,16 @@ void dl_connect_request (dlq_item_t *E) INIT_T1V_SRT; - if (g_misc_config_p->maxv22 == 0) { // Don't attempt v2.2. +// See if destination station is in list for v2.0 only. + + old_version = 0; + for (n = 0; n < g_misc_config_p->v20_count && ! old_version; n++) { + if (strcmp(E->addrs[AX25_DESTINATION],g_misc_config_p->v20_addrs[n]) == 0) { + old_version = 1; + } + } + + if (old_version || g_misc_config_p->maxv22 == 0) { // Don't attempt v2.2. set_version_2_0 (S); diff --git a/ax25_pad.c b/ax25_pad.c index 2dccfda..0f7779c 100644 --- a/ax25_pad.c +++ b/ax25_pad.c @@ -707,7 +707,7 @@ packet_t ax25_dup (packet_t copy_from) * * in_addr - Input such as "WB2OSZ-15*" * - * strict - TRUE for strict checking (6 characters, no lower case, + * strict - 1 (true) for strict checking (6 characters, no lower case, * SSID must be in range of 0 to 15). * Strict is appropriate for packets sent * over the radio. Communication with IGate @@ -716,6 +716,8 @@ packet_t ax25_dup (packet_t copy_from) * We also get messages like this from a server. * KB1POR>APU25N,TCPIP*,qAC,T2NUENGLD:... * + * 2 (extra true) will complain if * is found at end. + * * Outputs: out_addr - Address without any SSID. * Must be at least AX25_MAX_ADDR_LEN bytes. * @@ -745,6 +747,11 @@ int ax25_parse_addr (int position, char *in_addr, int strict, char *out_addr, in *out_ssid = 0; *out_heard = 0; + if (position < -1) position = -1; + if (position > AX25_REPEATER_8) position = AX25_REPEATER_8; + position++; /* Adjust for position_name above. */ + + if (strict && strlen(in_addr) >= 2 && strncmp(in_addr, "qA", 2) == 0) { text_color_set(DW_COLOR_ERROR); @@ -754,9 +761,6 @@ int ax25_parse_addr (int position, char *in_addr, int strict, char *out_addr, in //dw_printf ("ax25_parse_addr in: %s\n", in_addr); - if (position < -1) position = -1; - if (position > AX25_REPEATER_8) position = AX25_REPEATER_8; - position++; /* Adjust for position_name above. */ maxlen = strict ? 6 : (AX25_MAX_ADDR_LEN-1); p = in_addr; @@ -811,11 +815,16 @@ int ax25_parse_addr (int position, char *in_addr, int strict, char *out_addr, in if (*p == '*') { *out_heard = 1; p++; + if (strict == 2) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("\"*\" is not allowed at end of address \"%s\" here.\n", in_addr); + return 0; + } } if (*p != '\0') { - text_color_set(DW_COLOR_ERROR); - dw_printf ("Invalid character \"%c\" found in %saddress \"%s\".\n", *p, position_name[position], in_addr); + text_color_set(DW_COLOR_ERROR); + dw_printf ("Invalid character \"%c\" found in %saddress \"%s\".\n", *p, position_name[position], in_addr); return 0; } diff --git a/config.c b/config.c index e9cd239..662c058 100644 --- a/config.c +++ b/config.c @@ -515,7 +515,7 @@ static int check_via_path (char *via_path) r = stemp; while (( a = strsep(&r,",")) != NULL) { - int strict = 1; + int strict = 2; int ok; char addr[AX25_MAX_ADDR_LEN]; int ssid; @@ -892,6 +892,8 @@ void config_init (char *fname, struct audio_s *p_audio_config, p_misc_config->maxframe_extended = AX25_K_MAXFRAME_EXTENDED_DEFAULT; /* Max frames to send before ACK. mod 128 "Window" size. */ p_misc_config->maxv22 = AX25_N2_RETRY_DEFAULT / 2; /* Max SABME before falling back to SABM. */ + p_misc_config->v20_addrs = NULL; /* Go directly to v2.0 for stations listed. */ + p_misc_config->v20_count = 0; /* * Try to extract options from a file. @@ -1193,6 +1195,24 @@ void config_init (char *fname, struct audio_s *p_audio_config, } else { + char *p; + int const strict = 2; + char call_no_ssid[AX25_MAX_ADDR_LEN]; + int ssid, heard; + + for (p = t; *p != '\0'; p++) { + if (islower(*p)) { + *p = toupper(*p); /* Silently force upper case. */ + /* Might change to warning someday. */ + } + } + + if ( ! ax25_parse_addr (-1, t, strict, call_no_ssid, &ssid, &heard)) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("Config file: Invalid value for MYCALL command on line %d.\n", line); + continue; + } + // Definitely set for current channel. // Set for other channels which have not been set yet. @@ -1205,17 +1225,7 @@ void config_init (char *fname, struct audio_s *p_audio_config, strcasecmp(p_audio_config->achan[c].mycall, "NOCALL") == 0 || strcasecmp(p_audio_config->achan[c].mycall, "N0CALL") == 0) { - char *p; - strlcpy (p_audio_config->achan[c].mycall, t, sizeof(p_audio_config->achan[c].mycall)); - - for (p = p_audio_config->achan[c].mycall; *p != '\0'; p++) { - if (islower(*p)) { - *p = toupper(*p); /* silently force upper case. */ - } - } - // TODO: additional checks if valid. - // Should have a function to check for valid callsign[-ssid] } } } @@ -3920,6 +3930,9 @@ void config_init (char *fname, struct audio_s *p_audio_config, /* * IGFILTER - IGate Server side filters. + * Is this name too confusing. Too similar to FILTER IG 0 ... + * Maybe SSFILTER suggesting Server Side. + * SUBSCRIBE might be better because it's not a filter that limits. * * IGFILTER filter-spec ... */ @@ -3928,6 +3941,12 @@ void config_init (char *fname, struct audio_s *p_audio_config, t = split(NULL,1); /* Take rest of line as one string. */ + if (p_igate_config->t2_filter != NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("Line %d: Warning - Earlier IGFILTER value will be replaced by this one.\n", line); + continue; + } + if (t != NULL && strlen(t) > 0) { p_igate_config->t2_filter = strdup (t); } @@ -4562,6 +4581,41 @@ void config_init (char *fname, struct audio_s *p_audio_config, } +/* + * V20 address [ address ... ] - Stations known to support only AX.25 v2.0. + * When connecting to these, skip SABME and go right to SABM. + * Possible to have multiple and they are cummulative. + */ + + else if (strcasecmp(t, "V20") == 0) { + + t = split(NULL,0); + if (t == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("Line %d: Missing address(es) for V20.\n", line); + continue; + } + + while (t != NULL) { + int const strict = 2; + char call_no_ssid[AX25_MAX_ADDR_LEN]; + int ssid, heard; + + if (ax25_parse_addr (AX25_DESTINATION, t, strict, call_no_ssid, &ssid, &heard)) { + p_misc_config->v20_addrs = (char**)realloc (p_misc_config->v20_addrs, sizeof(char*) * (p_misc_config->v20_count + 1)); + p_misc_config->v20_addrs[p_misc_config->v20_count++] = strdup(t); + } + else { + text_color_set(DW_COLOR_ERROR); + dw_printf ("Line %d: Invalid station address for V20 command.\n", line); + + // continue processing any others following. + } + t = split(NULL,0); + } + } + + /* * Invalid command. */ diff --git a/config.h b/config.h index 4e2a767..664c1ac 100644 --- a/config.h +++ b/config.h @@ -104,6 +104,10 @@ struct misc_config_s { /* switching to SABM. This is to handle the case of an old */ /* TNC which simply ignores SABME rather than replying with FRMR. */ + char **v20_addrs; /* Stations known to understand only AX.25 v2.0 so we don't */ + /* waste time trying v2.2 first. */ + + int v20_count; /* Number of station addresses in array above. */ // Beacons. diff --git a/decode_aprs.c b/decode_aprs.c index 55215c1..ec66445 100644 --- a/decode_aprs.c +++ b/decode_aprs.c @@ -3183,7 +3183,7 @@ double get_latitude_8 (char *p, int quiet) else { if ( ! quiet) { text_color_set(DW_COLOR_ERROR); - dw_printf("Error: '%c' found for latitude hemisphere. Specification requires upper case N or s.\n", plat->ns); + dw_printf("Error: '%c' found for latitude hemisphere. Specification requires upper case N or S.\n", plat->ns); } return (G_UNKNOWN); } diff --git a/doc/User-Guide.pdf b/doc/User-Guide.pdf index 8aaaae0..d603cf0 100644 Binary files a/doc/User-Guide.pdf and b/doc/User-Guide.pdf differ