73
73
74
74
75
75
static packet_t digipeat_match (int from_chan , packet_t pp , char * mycall_rec , char * mycall_xmit ,
76
- regex_t * uidigi , regex_t * uitrace , int to_chan , enum preempt_e preempt , char * type_filter );
76
+ regex_t * uidigi , regex_t * uitrace , int to_chan , enum preempt_e preempt , char * noid , char * type_filter );
77
77
78
78
79
79
/*
@@ -176,6 +176,7 @@ void digipeater (int from_chan, packet_t pp)
176
176
save_audio_config_p -> achan [to_chan ].mycall ,
177
177
& save_digi_config_p -> alias [from_chan ][to_chan ], & save_digi_config_p -> wide [from_chan ][to_chan ],
178
178
to_chan , save_digi_config_p -> preempt [from_chan ][to_chan ],
179
+ save_digi_config_p -> noid [from_chan ][to_chan ],
179
180
save_digi_config_p -> filter_str [from_chan ][to_chan ]);
180
181
if (result != NULL ) {
181
182
dedupe_remember (pp , to_chan );
@@ -202,6 +203,7 @@ void digipeater (int from_chan, packet_t pp)
202
203
save_audio_config_p -> achan [to_chan ].mycall ,
203
204
& save_digi_config_p -> alias [from_chan ][to_chan ], & save_digi_config_p -> wide [from_chan ][to_chan ],
204
205
to_chan , save_digi_config_p -> preempt [from_chan ][to_chan ],
206
+ save_digi_config_p -> noid [from_chan ][to_chan ],
205
207
save_digi_config_p -> filter_str [from_chan ][to_chan ]);
206
208
if (result != NULL ) {
207
209
dedupe_remember (pp , to_chan );
@@ -244,6 +246,9 @@ void digipeater (int from_chan, packet_t pp)
244
246
*
245
247
* preempt - Option for "preemptive" digipeating.
246
248
*
249
+ * noid - No tracing if this matches alias prefix.
250
+ * Hack added for special needs of ATGP.
251
+ *
247
252
* filter_str - Filter expression string or NULL.
248
253
*
249
254
* Returns: Packet object for transmission or NULL.
@@ -260,32 +265,9 @@ void digipeater (int from_chan, packet_t pp)
260
265
*
261
266
*------------------------------------------------------------------------------*/
262
267
263
- #define OBSOLETE14 1
264
-
265
-
266
- #ifndef OBSOLETE14
267
- static char * dest_ssid_path [16 ] = {
268
- "" , /* Use VIA path */
269
- "WIDE1-1" ,
270
- "WIDE2-2" ,
271
- "WIDE3-3" ,
272
- "WIDE4-4" ,
273
- "WIDE5-5" ,
274
- "WIDE6-6" ,
275
- "WIDE7-7" ,
276
- "WIDE1-1" , /* North */
277
- "WIDE1-1" , /* South */
278
- "WIDE1-1" , /* East */
279
- "WIDE1-1" , /* West */
280
- "WIDE2-2" , /* North */
281
- "WIDE2-2" , /* South */
282
- "WIDE2-2" , /* East */
283
- "WIDE2-2" }; /* West */
284
- #endif
285
-
286
268
287
269
static packet_t digipeat_match (int from_chan , packet_t pp , char * mycall_rec , char * mycall_xmit ,
288
- regex_t * alias , regex_t * wide , int to_chan , enum preempt_e preempt , char * filter_str )
270
+ regex_t * alias , regex_t * wide , int to_chan , enum preempt_e preempt , char * noid , char * filter_str )
289
271
{
290
272
char source [AX25_MAX_ADDR_LEN ];
291
273
int ssid ;
@@ -323,15 +305,6 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
323
305
* Otherwise we don't want to modify the input because this could be called multiple times.
324
306
*/
325
307
326
- #ifndef OBSOLETE14 // Took it out in 1.4
327
-
328
- if (ax25_get_num_repeaters (pp ) == 0 && (ssid = ax25_get_ssid (pp , AX25_DESTINATION )) > 0 ) {
329
- ax25_set_addr (pp , AX25_REPEATER_1 , dest_ssid_path [ssid ]);
330
- ax25_set_ssid (pp , AX25_DESTINATION , 0 );
331
- /* Continue with general case, below. */
332
- }
333
- #endif
334
-
335
308
336
309
/*
337
310
* Find the first repeater station which doesn't have "has been repeated" set.
@@ -510,6 +483,26 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
510
483
err = regexec (wide ,repeater ,0 ,NULL ,0 );
511
484
if (err == 0 ) {
512
485
486
+ // Special hack added for ATGP to behave like UIFLOOD NOID in some TNCs.
487
+ // More than 8 digipeater hops are required so tracing is disabled.
488
+
489
+ if (strlen (noid ) > 0 && strncasecmp (repeater , noid , strlen (noid )) == 0 ) {
490
+
491
+ if (ssid >= 1 && ssid <= 7 ) {
492
+ packet_t result ;
493
+
494
+ result = ax25_dup (pp );
495
+ assert (result != NULL );
496
+
497
+ if (ssid == 1 ) {
498
+ ax25_set_h (result , r );
499
+ }
500
+ ax25_set_ssid (result , r , ssid - 1 ); // could be zero.
501
+
502
+ return (result );
503
+ }
504
+ }
505
+
513
506
/*
514
507
* If ssid == 1, we simply replace the repeater with my call and
515
508
* mark it as being used.
@@ -627,6 +620,7 @@ static int failed;
627
620
628
621
static enum preempt_e preempt = PREEMPT_OFF ;
629
622
623
+ static char config_noid [AX25_MAX_ADDR_LEN ] = "HOP" ;
630
624
631
625
632
626
static void test (char * in , char * out )
@@ -640,6 +634,7 @@ static void test (char *in, char *out)
640
634
int frame_len ;
641
635
alevel_t alevel ;
642
636
637
+
643
638
dw_printf ("\n" );
644
639
645
640
/*
@@ -689,9 +684,9 @@ static void test (char *in, char *out)
689
684
text_color_set (DW_COLOR_REC );
690
685
dw_printf ("Rec\t%s\n" , rec );
691
686
692
- //TODO: Add filtering to test.
693
- // V
694
- result = digipeat_match (0 , pp , mycall , mycall , & alias_re , & wide_re , 0 , preempt , NULL );
687
+ //TODO: Add filtering to test.
688
+ // V
689
+ result = digipeat_match (0 , pp , mycall , mycall , & alias_re , & wide_re , 0 , preempt , config_noid , NULL );
695
690
696
691
if (result != NULL ) {
697
692
@@ -740,7 +735,7 @@ int main (int argc, char *argv[])
740
735
exit (1 );
741
736
}
742
737
743
- e = regcomp (& wide_re , "^WIDE[1-7]-[1-7]$|^TRACE[1-7]-[1-7]$|^MA[1-7]-[1-7]$" , REG_EXTENDED |REG_NOSUB );
738
+ e = regcomp (& wide_re , "^WIDE[1-7]-[1-7]$|^TRACE[1-7]-[1-7]$|^MA[1-7]-[1-7]$|^HOP[1-7]-[1-7]$ " , REG_EXTENDED |REG_NOSUB );
744
739
if (e != 0 ) {
745
740
regerror (e , & wide_re , message , sizeof (message ));
746
741
text_color_set (DW_COLOR_ERROR );
@@ -830,11 +825,8 @@ int main (int argc, char *argv[])
830
825
*/
831
826
832
827
test ( "W1ABC>TEST-3:" ,
833
- #ifndef OBSOLETE14
834
- "W1ABC>TEST,WB2OSZ-9*,WIDE3-2:" );
835
- #else
836
828
"" );
837
- #endif
829
+
838
830
test ( "W1DEF>TEST-3,WIDE2-2:" ,
839
831
"W1DEF>TEST-3,WB2OSZ-9*,WIDE2-1:" );
840
832
@@ -844,17 +836,17 @@ int main (int argc, char *argv[])
844
836
* The 4th case might be controversial.
845
837
*/
846
838
847
- test ( "W1XYZ>TEST ,R1*,WIDE3-2:info1" ,
848
- "W1XYZ>TEST ,R1,WB2OSZ-9*,WIDE3-1:info1" );
839
+ test ( "W1XYZ>TESTD ,R1*,WIDE3-2:info1" ,
840
+ "W1XYZ>TESTD ,R1,WB2OSZ-9*,WIDE3-1:info1" );
849
841
850
- test ( "W1XYZ>TEST ,R2*,WIDE3-2:info1" ,
842
+ test ( "W1XYZ>TESTD ,R2*,WIDE3-2:info1" ,
851
843
"" );
852
844
853
- test ( "W1XYZ>TEST ,R3*,WIDE3-2:info1" ,
845
+ test ( "W1XYZ>TESTD ,R3*,WIDE3-2:info1" ,
854
846
"" );
855
847
856
- test ( "W1XYZ>TEST ,R1*,WB2OSZ-9:has explicit routing" ,
857
- "W1XYZ>TEST ,R1,WB2OSZ-9*:has explicit routing" );
848
+ test ( "W1XYZ>TESTD ,R1*,WB2OSZ-9:has explicit routing" ,
849
+ "W1XYZ>TESTD ,R1,WB2OSZ-9*:has explicit routing" );
858
850
859
851
860
852
/*
@@ -931,6 +923,25 @@ int main (int argc, char *argv[])
931
923
test ( "WB2OSZ-15>TEST14,WIDE1-1,WIDE1-1:stuff" ,
932
924
"WB2OSZ-15>TEST14,WB2OSZ-9*,WIDE1-1:stuff" );
933
925
926
+ // New in 1.7 - ATGP Hack
927
+
928
+ preempt = PREEMPT_OFF ; // Shouldn't make a difference here.
929
+
930
+ test ( "W1ABC>TEST51,HOP7-7,HOP7-7:stuff1" ,
931
+ "W1ABC>TEST51,HOP7-6,HOP7-7:stuff1" );
932
+
933
+ test ( "W1ABC>TEST52,HOP7-1,HOP7-7:stuff2" ,
934
+ "W1ABC>TEST52,HOP7*,HOP7-7:stuff2" );
935
+
936
+ test ( "W1ABC>TEST52,HOP7*,HOP7-7:stuff3" ,
937
+ "W1ABC>TEST52,HOP7*,HOP7-6:stuff3" );
938
+
939
+ test ( "W1ABC>TEST52,HOP7*,HOP7-1:stuff4" ,
940
+ "W1ABC>TEST52,HOP7,HOP7*:stuff4" );
941
+
942
+ test ( "W1ABC>TEST52,HOP7,HOP7*:stuff" ,
943
+ "" );
944
+
934
945
935
946
936
947
if (failed == 0 ) {
0 commit comments