mirror of https://github.com/wb2osz/direwolf.git
Packet filtering treated telemetry metadata as messages rather than telemetry.
modified: CHANGES.md modified: pfilter.c
This commit is contained in:
parent
1f8b330185
commit
17e1166a7f
24
pfilter.c
24
pfilter.c
|
@ -619,6 +619,21 @@ static int filt_bodgu (pfstate_t *pf, char *arg)
|
|||
*
|
||||
*------------------------------------------------------------------------------*/
|
||||
|
||||
/* Telemetry metadata is a special case of message. */
|
||||
/* We want to categorize it as telemetry rather than message. */
|
||||
|
||||
static int is_telem_metadata (char *infop)
|
||||
{
|
||||
if (*infop != ':') return (0);
|
||||
if (strlen(infop) < 16) return (0);
|
||||
if (strncmp(infop+10, ":PARM.", 6) == 0) return (1);
|
||||
if (strncmp(infop+10, ":UNIT.", 6) == 0) return (1);
|
||||
if (strncmp(infop+10, ":EQNS.", 6) == 0) return (1);
|
||||
if (strncmp(infop+10, ":BITS.", 6) == 0) return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
static int filt_t (pfstate_t *pf)
|
||||
{
|
||||
char src[AX25_MAX_ADDR_LEN];
|
||||
|
@ -652,7 +667,7 @@ static int filt_t (pfstate_t *pf)
|
|||
break;
|
||||
|
||||
case 'm': /* Message */
|
||||
if (*infop == ':') return (1);
|
||||
if (*infop == ':' && ! is_telem_metadata(infop)) return (1);
|
||||
break;
|
||||
|
||||
case 'q': /* Query */
|
||||
|
@ -665,6 +680,7 @@ static int filt_t (pfstate_t *pf)
|
|||
|
||||
case 't': /* Telemetry */
|
||||
if (*infop == 'T') return (1);
|
||||
if (is_telem_metadata(infop)) return (1);
|
||||
break;
|
||||
|
||||
case 'u': /* User-defined */
|
||||
|
@ -1033,6 +1049,12 @@ int main ()
|
|||
pftest (112, "t/t", "WM1X>APU25N:@210147z4235.39N/07106.58W_359/000g000t027r000P000p000h89b10234/WX REPORT {UIV32N}<0x0d>", 0);
|
||||
pftest (113, "t/w", "WM1X>APU25N:@210147z4235.39N/07106.58W_359/000g000t027r000P000p000h89b10234/WX REPORT {UIV32N}<0x0d>", 1);
|
||||
|
||||
/* Telemetry metadata is a special case of message. */
|
||||
pftest (114, "t/t", "KJ4SNT>APMI04::KJ4SNT :PARM.Vin,Rx1h,Dg1h,Eff1h,Rx10m,O1,O2,O3,O4,I1,I2,I3,I4", 1);
|
||||
pftest (115, "t/m", "KJ4SNT>APMI04::KJ4SNT :PARM.Vin,Rx1h,Dg1h,Eff1h,Rx10m,O1,O2,O3,O4,I1,I2,I3,I4", 0);
|
||||
pftest (116, "t/t", "KB1GKN-10>APRX27,UNCAN,WIDE1*:T#491,4.9,0.3,25.0,0.0,1.0,00000000", 1);
|
||||
|
||||
|
||||
pftest (120, "t/p", "CWAPID>APRS::NWS-TTTTT:DDHHMMz,ADVISETYPE,zcs{seq#", 0);
|
||||
pftest (122, "t/p", "CWAPID>APRS::SKYCWA :DDHHMMz,ADVISETYPE,zcs{seq#", 0);
|
||||
pftest (123, "t/p", "CWAPID>APRS:;CWAttttz *DDHHMMzLATLONICONADVISETYPE{seq#", 0);
|
||||
|
|
Loading…
Reference in New Issue