Skip to content

Commit 87d9fe0

Browse files
committed
Add new "v" packet filter.
Similar to "d" but it considers unused, rather than used, digipeaters.
1 parent 107a812 commit 87d9fe0

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

CHANGES.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
- AGW network protocol now works properly for big-endian processors
1111
such as PowerPC or MIPS.
1212

13+
- The Mac OSX build procedure is now better about locating the SDK.
14+
1315

1416
----------
1517

1618
## Version 1.3 -- Development snapshot I -- December 2015 ##
1719

1820
### New Feature: ###
1921

20-
- Added support for hamlib. This will provide more flexible options for PTT control.
22+
- Added support for hamlib. This will provide more flexible options for PTT control. Needs better documentation.
2123

2224
----------
2325

doc/User-Guide.pdf

6.38 KB
Binary file not shown.

pfilter.c

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// This file is part of Dire Wolf, an amateur radio packet TNC.
33
//
4-
// Copyright (C) 2015 John Langner, WB2OSZ
4+
// Copyright (C) 2015, 2016 John Langner, WB2OSZ
55
//
66
// This program is free software: you can redistribute it and/or modify
77
// it under the terms of the GNU General Public License as published by
@@ -449,15 +449,29 @@ static int parse_filter_spec (pfstate_t *pf)
449449
}
450450
else if (pf->token_str[0] == 'd' && ispunct(pf->token_str[1])) {
451451
int n;
452-
// loop on used digipeaters
452+
// loop on all digipeaters
453453
result = 0;
454454
for (n = AX25_REPEATER_1; result == 0 && n < ax25_get_num_addr (pf->pp); n++) {
455+
// Consider only those with the H (has-been-used) bit set.
455456
if (ax25_get_h (pf->pp, n)) {
456457
ax25_get_addr_with_ssid (pf->pp, n, addr);
457458
result = filt_bodgu (pf, addr);
458459
}
459460
}
460461
}
462+
else if (pf->token_str[0] == 'v' && ispunct(pf->token_str[1])) {
463+
int n;
464+
// loop on all digipeaters (mnemonic Via)
465+
result = 0;
466+
for (n = AX25_REPEATER_1; result == 0 && n < ax25_get_num_addr (pf->pp); n++) {
467+
// This is different than the previous "d" filter.
468+
// Consider only those where the the H (has-been-used) bit is NOT set.
469+
if ( ! ax25_get_h (pf->pp, n)) {
470+
ax25_get_addr_with_ssid (pf->pp, n, addr);
471+
result = filt_bodgu (pf, addr);
472+
}
473+
}
474+
}
461475
else if (pf->token_str[0] == 'g' && ispunct(pf->token_str[1])) {
462476
/* Addressee of message. */
463477
if (ax25_get_dti(pf->pp) == ':') {
@@ -528,7 +542,8 @@ static int parse_filter_spec (pfstate_t *pf)
528542
* Object o/obj1/obj2...
529543
* Digipeater d/digi1/digi2...
530544
* Group Msg g/call1/call2...
531-
* Unproto u/unproto1/unproto2...
545+
* Unproto u/unproto1/unproto2...
546+
* Via-not-yet v/digi1/digi2...
532547
*
533548
* arg - Value to match from source addr, destination,
534549
* used digipeater, object name, etc.
@@ -1048,6 +1063,13 @@ int main ()
10481063
pftest (161, "s//#/LS1", "WB2OSZ-5>APDW12:!4237.14N\\07120.83W#PHG7140Chelmsford MA", 0);
10491064
pftest (162, "s//#/LS1", "WB2OSZ-5>APDW12:!4237.14N/07120.83W#PHG7140Chelmsford MA", 0);
10501065

1066+
pftest (170, "v/DIGI2/DIGI3", "WB2OSZ-5>APDW12,DIGI1,DIGI2,DIGI3,DIGI4:!4237.14NS07120.83W#PHG7140Chelmsford MA", 1);
1067+
pftest (171, "v/DIGI2/DIGI3", "WB2OSZ-5>APDW12,DIGI1*,DIGI2,DIGI3,DIGI4:!4237.14NS07120.83W#PHG7140Chelmsford MA", 1);
1068+
pftest (172, "v/DIGI2/DIGI3", "WB2OSZ-5>APDW12,DIGI1,DIGI2*,DIGI3,DIGI4:!4237.14NS07120.83W#PHG7140Chelmsford MA", 1);
1069+
pftest (173, "v/DIGI2/DIGI3", "WB2OSZ-5>APDW12,DIGI1,DIGI2,DIGI3*,DIGI4:!4237.14NS07120.83W#PHG7140Chelmsford MA", 0);
1070+
pftest (174, "v/DIGI2/DIGI3", "WB2OSZ-5>APDW12,DIGI1,DIGI2,DIGI3,DIGI4*:!4237.14NS07120.83W#PHG7140Chelmsford MA", 0);
1071+
pftest (175, "v/DIGI9/DIGI2", "WB2OSZ-5>APDW12,DIGI1,DIGI2*,DIGI3,DIGI4:!4237.14NS07120.83W#PHG7140Chelmsford MA", 0);
1072+
10511073
/* Test error reporting. */
10521074

10531075
pftest (200, "x/", "CWAPID>APRS:;CWAttttz *DDHHMMzLATLONICONADVISETYPE{seq#", -1);

0 commit comments

Comments
 (0)