Skip to content

Add possibility to define "one" log file name #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Packet filtering treated telemetry metadata as messages rather than t…
…elemetry.

	modified:   CHANGES.md
	modified:   pfilter.c
  • Loading branch information
wb2osz committed Mar 19, 2016
commit ce9eebf273dd7418ff2d8d6ad3c63924f752e28d
6 changes: 4 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

----------

## Version 1.3 -- Beta Test -- February 2016 ##
## Version 1.3 -- Beta Test -- March 2016 ##

### New Features: ###

Expand Down Expand Up @@ -40,7 +40,7 @@ command line option.

- When receiving packet with comment of a few hundred characters.

- Address in path, from Internet server. more than 9 characters.
- Address in path, from Internet server, more than 9 characters.

- "INTERNAL ERROR: dlq_append NULL packet pointer." when using PASSALL.

Expand All @@ -51,6 +51,8 @@ command line option.
- AGW network protocol now works properly for big-endian processors
such as PowerPC or MIPS.

- Packet filtering treated telemetry metadata as messages rather than telemetry.

----------

## Version 1.2 -- June 2015 ##
Expand Down
26 changes: 24 additions & 2 deletions pfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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 */
Expand All @@ -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 */
Expand Down Expand Up @@ -1033,13 +1049,19 @@ 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);
pftest (124, "t/n", "CWAPID>APRS::NWS-TTTTT:DDHHMMz,ADVISETYPE,zcs{seq#", 1);
pftest (125, "t/n", "CWAPID>APRS::SKYCWA :DDHHMMz,ADVISETYPE,zcs{seq#", 1);
pftest (126, "t/n", "CWAPID>APRS:;CWAttttz *DDHHMMzLATLONICONADVISETYPE{seq#", 1);
pftest (127, "t/", "CWAPID>APRS:;CWAttttz *DDHHMMzLATLONICONADVISETYPE{seq#", 0);
pftest (127, "t/", "CWAPID>APRS:;CWAttttz *DDHHMMzLATLONICONADVISETYPE{seq#", 0);

pftest (130, "r/42.6/-71.3/10", "WB2OSZ-5>APDW12,WIDE1-1,WIDE2-1:!4237.14NS07120.83W#PHG7140Chelmsford MA", 1);
pftest (131, "r/42.6/-71.3/10", "WA1PLE-5>APWW10,W1MHL,N8VIM,WIDE2*:@022301h4208.75N/07115.16WoAPRS-IS for Win32", 0);
Expand Down