New NOXID option to avoid wasting time to listed station(s)

which understand SABME but not XID.
This commit is contained in:
wb2osz 2018-07-02 12:18:23 -04:00
parent 22f645756d
commit 38ab57afa4
3 changed files with 56 additions and 0 deletions

View File

@ -6357,7 +6357,18 @@ static void mdl_negotiate_request (ax25_dlsm_t *S)
int p = 1; int p = 1;
int nopid = 0; int nopid = 0;
packet_t pp; packet_t pp;
int n;
// At least one known [partial] v2.2 implementation understands SABME but not XID.
// Rather than wasting time, sending XID repeatedly until giving up, we have a workaround.
// The configuration file can contain a list of stations known not to respond to XID.
// Obviously this applies only to v2.2 because XID was not part of v2.0.
for (n = 0; n < g_misc_config_p->noxid_count; n++) {
if (strcmp(S->addrs[PEERCALL],g_misc_config_p->noxid_addrs[n]) == 0) {
return;
}
}
switch (S->mdl_state) { switch (S->mdl_state) {

View File

@ -904,6 +904,8 @@ void config_init (char *fname, struct audio_s *p_audio_config,
p_misc_config->maxv22 = AX25_N2_RETRY_DEFAULT / 2; /* Max SABME before falling back to SABM. */ 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_addrs = NULL; /* Go directly to v2.0 for stations listed. */
p_misc_config->v20_count = 0; p_misc_config->v20_count = 0;
p_misc_config->noxid_addrs = NULL; /* Don't send XID to these stations. */
p_misc_config->noxid_count = 0;
/* /*
* Try to extract options from a file. * Try to extract options from a file.
@ -4796,6 +4798,42 @@ void config_init (char *fname, struct audio_s *p_audio_config,
} }
/*
* NOXID address [ address ... ] - Stations known not to understand XID.
* After connecting to these (with v2.2 obviously), don't try using XID commmand.
* AX.25 for Linux is the one known case so far.
* Possible to have multiple and they are cummulative.
*/
else if (strcasecmp(t, "NOXID") == 0) {
t = split(NULL,0);
if (t == NULL) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Line %d: Missing address(es) for NOXID.\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->noxid_addrs = (char**)realloc (p_misc_config->noxid_addrs, sizeof(char*) * (p_misc_config->noxid_count + 1));
p_misc_config->noxid_addrs[p_misc_config->noxid_count++] = strdup(t);
}
else {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Line %d: Invalid station address for NOXID command.\n", line);
// continue processing any others following.
}
t = split(NULL,0);
}
}
/* /*
* Invalid command. * Invalid command.
*/ */

View File

@ -111,6 +111,13 @@ struct misc_config_s {
int v20_count; /* Number of station addresses in array above. */ int v20_count; /* Number of station addresses in array above. */
char **noxid_addrs; /* Stations known not to understand XID command so don't */
/* waste time sending it and eventually giving up. */
/* AX.25 for Linux is the one known case, so far, where */
/* SABME is implemented but XID is not. */
int noxid_count; /* Number of station addresses in array above. */
// Beacons. // Beacons.