|
1 | 1 | //
|
2 | 2 | // This file is part of Dire Wolf, an amateur radio packet TNC.
|
3 | 3 | //
|
4 |
| -// Copyright (C) 2015 John Langner, WB2OSZ |
| 4 | +// Copyright (C) 2015, 2016 John Langner, WB2OSZ |
5 | 5 | //
|
6 | 6 | // This program is free software: you can redistribute it and/or modify
|
7 | 7 | // 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)
|
449 | 449 | }
|
450 | 450 | else if (pf->token_str[0] == 'd' && ispunct(pf->token_str[1])) {
|
451 | 451 | int n;
|
452 |
| - // loop on used digipeaters |
| 452 | + // loop on all digipeaters |
453 | 453 | result = 0;
|
454 | 454 | 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. |
455 | 456 | if (ax25_get_h (pf->pp, n)) {
|
456 | 457 | ax25_get_addr_with_ssid (pf->pp, n, addr);
|
457 | 458 | result = filt_bodgu (pf, addr);
|
458 | 459 | }
|
459 | 460 | }
|
460 | 461 | }
|
| 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 | + } |
461 | 475 | else if (pf->token_str[0] == 'g' && ispunct(pf->token_str[1])) {
|
462 | 476 | /* Addressee of message. */
|
463 | 477 | if (ax25_get_dti(pf->pp) == ':') {
|
@@ -528,7 +542,8 @@ static int parse_filter_spec (pfstate_t *pf)
|
528 | 542 | * Object o/obj1/obj2...
|
529 | 543 | * Digipeater d/digi1/digi2...
|
530 | 544 | * Group Msg g/call1/call2...
|
531 |
| - * Unproto u/unproto1/unproto2... |
| 545 | + * Unproto u/unproto1/unproto2... |
| 546 | + * Via-not-yet v/digi1/digi2... |
532 | 547 | *
|
533 | 548 | * arg - Value to match from source addr, destination,
|
534 | 549 | * used digipeater, object name, etc.
|
@@ -1048,6 +1063,13 @@ int main ()
|
1048 | 1063 | pftest (161, "s//#/LS1", "WB2OSZ-5>APDW12:!4237.14N\\07120.83W#PHG7140Chelmsford MA", 0);
|
1049 | 1064 | pftest (162, "s//#/LS1", "WB2OSZ-5>APDW12:!4237.14N/07120.83W#PHG7140Chelmsford MA", 0);
|
1050 | 1065 |
|
| 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 | + |
1051 | 1073 | /* Test error reporting. */
|
1052 | 1074 |
|
1053 | 1075 | pftest (200, "x/", "CWAPID>APRS:;CWAttttz *DDHHMMzLATLONICONADVISETYPE{seq#", -1);
|
|
0 commit comments