[Xastir] NWS objects

Curt Mills, WE7U hacker at tc.fluke.com
Wed Apr 16 12:34:52 EDT 2003


On Tue, 15 Apr 2003, dale huguley wrote:

> Jim wrote:
>
> >Would there be any way to transmit the NWS objects such as "SPCT2200z" that
> >I receive from the Inet on RF so others in my area can see these objects? I
> >guess that a wildcard would need to be programmed into the NWS-stations
> >system since these objects are time stamped and their callsign changes.
> >
> >
> >
> Yes but the "from" call is always SPC something so "SPC*" in your
> stations file will transmit anything from the Severe Storms Forcast Center.

That doesn't appear to be the case in the Xastir code.  Here's the
relevant piece from igate.c:check_NWS_stations():


  ok=0;
  for (i=0; i<NWS_stations && !ok; i++) {
    if (strcasecmp(call,NWS_station_data[i].call)==0) {
      ok=1; // match found
      if (debug_level && 1024) {
        fprintf(stderr,"NWS-MATCH:(%s) (%s)\n",NWS_station_data[i].call,call);
      }
    }
  }
  return(ok);


We use "strcasecmp()" instead of an "strncasecmp()", which would
have restricted the string match to a smaller number of characters.
The two strings have to match exactly, including length, before the
packet is igated.  We make no provision for '*' characters or
partial matches in any way.

db.c:decode_message() is the place that calls
igate.c:output_nws_igate_rf(), but only for messages containing
"SKY" and "NWS-", so that's where specific restrictions on message
contents come into play (beyond the nws_stations.txt file).

There are a couple of things we could do differently here.  #2 is on
the feature request list already:

1) Change the strcasecmp() in the above code to strncasecmp(),
making the size of the compare equal to the size of the string in
NWS_station_data[].  This would allow a partial match of a string
(at the start of the string) to be igated.  With the current code it
would still only involve "NWS-" and "SKY" messages.  This change
would be a relatively easy fix and would allow partial matches
without having to use the '*' symbol.

2) At least one user would like to gate other non-NWS traffic to RF,
like "SCOUTS", etc.  In order to do this we'd have to consult the
NWS_station_data[] array for each and every message to see if it
should be gated.  Since it's only on messages and not every packet,
it probably wouldn't be a big CPU hit to do so.

We also have dupe-checking involved in everything we gate to RF, so
if it has already been gated by someone else, or if we've already
seen it come across the 'net and have gated it once already in the
past XX minutes, we refuse to gate it again until it has expired
from our igated dupe queue.

So... What'cha want to do?

-- 
Curt Mills, WE7U                    hacker_NO_SPAM_ at tc.fluke.com
Senior Methods Engineer/SysAdmin
"Lotto:    A tax on people who are bad at math!"
"Windows:  Microsoft's tax on computer illiterates!" -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"



More information about the Xastir mailing list